A useful prompt often has two parts: instructions you repeat and details that change with the task.
For a code review, the repeated part might ask for concrete bugs, file references, and test gaps. The variable part is the branch, file, or behavior you want reviewed today. Copying the whole thing from an old chat makes it easy to bring along stale context.
AIClaw 3.7.23 adds ten local prompt presets to the desktop composer. Selecting a preset inserts editable text. It does not submit a message or start agent work.
The feature is included in the published v3.7.23 release. Here is how it works, and why the insertion boundary matters.
Save a reusable instruction in a numbered slot
Type /presets in the composer and choose the management entry from the slash menu. The dialog lets you select one of ten positions, enter a name and prompt, and save it. An occupied slot can be replaced or deleted.
For example, you could save this instruction in slot 1 under “Review changes”:
Review the changed code for concrete bugs and missing regression coverage. Explain each finding with a file reference. Separate verified behavior from assumptions.
That is an illustrative prompt, not a claim about what a model will always do.
Later, type /preset1 and select the saved entry, or search for its title in the slash menu. The text appears in the composer, ready for you to add the files or behavior relevant to the current task.
The workflow is documented in the versioned README, and the management dialog is implemented in PromptPresets.vue.
Selecting a prompt is an editing action
The important behavior is what happens before submission.
AIClaw replaces the active slash-command span with the preset body. It keeps the draft after the caret and restores the caret at the end of the inserted text. When that trailing text has no leading whitespace, the insertion helper adds a separating space.
The regression fixture makes this concrete. With the caret immediately after /preset2, a draft of:
/preset2 keep this draft
and a saved body of:
Check code
Report bugs
becomes:
Check code
Report bugs keep this draft
The remaining draft is preserved, and no message is sent just because the menu selection used Enter.
When the suggestion menu is open, Enter or Tab selects the entry. After insertion, normal composer submission rules apply. If an agent turn is already running, sending the completed prompt still follows the existing queue behavior and permission policy.
The text transformation is a small function in shared/presets.ts. Its integration with the slash picker lives in ChatView.vue.
The manager leaves room to change your mind
Opening the manager does not send the current composer text. Dismissing it preserves the draft, including the slash command you typed.
Saving uses the application's existing configuration path. The dialog closes after that save succeeds. If the save fails, the dialog shows the error and keeps the entered values available. While saving, the form disables its editing controls.
Presets share the slash menu with skills, but they have a different job. A preset expands saved text into the composer; it does not install a skill or add a runtime tool. Keeping both kinds of entries in one picker makes them easy to discover without making prompt insertion execute anything.
Normalize configuration at the boundary
The feature stores explicit numbered slots rather than relying on array position as the shortcut number.
Normalization accepts slots 1 through 10, drops invalid entries and duplicate slot numbers, and sorts the accepted entries by slot. Names and prompt bodies must be nonblank. Names are trimmed and limited to 80 JavaScript string units; prompt text is bounded at 20,000. The dialog also exposes matching length limits.
An older configuration without presets becomes an empty list. A missing field does not seed sample prompts or reinterpret another setting as a saved instruction.
These are local saved prompts in the desktop application's configuration. This release implements text reuse and editing; it does not add a template language, automatic variable substitution, or a scheduled execution mechanism to presets.
See configuration normalization and the preset helper.
What was checked for this article
I reran the focused preset configuration test. It passed checks for missing-field migration, invalid and duplicate slots, shortcut/title matching, draft-preserving insertion, caret position, and length limits.
I also rebuilt the desktop app and ran its controlled Electron work-UI smoke suite: 195/195 checks passed. Four preset-specific checks cover opening the manager without sending, saving through configuration, inserting while preserving trailing draft text without sending, and dismissing the dialog without losing the composer draft.
The public checks are in test-config.ts and smoke-work.cjs.
The UI suite uses the real Vue/preload workflow with fixture IPC handlers and temporary test data. It verifies those interface behaviors; it is not a paid-model integration test or a manual test of every packaged platform.
For recurring reviews, report instructions, and explanation formats, the useful unit is often just a saved paragraph. Presets make that paragraph easy to insert while leaving the final task details and the decision to send in the composer.
Top comments (0)