wave-agent-sdk 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin/index.d.ts +1 -0
- package/dist/builtin/index.js +20 -0
- package/dist/builtin/plugins.d.ts +1 -0
- package/dist/builtin/plugins.js +225 -0
- package/dist/builtin/skills/artifact.d.ts +1 -0
- package/dist/builtin/skills/artifact.js +18 -0
- package/dist/builtin/skills/code-review.d.ts +1 -0
- package/{builtin/skills/code-review/SKILL.md → dist/builtin/skills/code-review.js} +23 -19
- package/dist/builtin/skills/deep-research.d.ts +1 -0
- package/{builtin/skills/deep-research/SKILL.md → dist/builtin/skills/deep-research.js} +18 -14
- package/dist/builtin/skills/init.d.ts +1 -0
- package/{builtin/skills/init/SKILL.md → dist/builtin/skills/init.js} +6 -3
- package/dist/builtin/skills/loop.d.ts +1 -0
- package/dist/builtin/skills/loop.js +83 -0
- package/dist/builtin/skills/settings.d.ts +1 -0
- package/dist/builtin/skills/settings.js +1224 -0
- package/dist/builtin/skills/simplify.d.ts +1 -0
- package/{builtin/skills/simplify/SKILL.md → dist/builtin/skills/simplify.js} +7 -3
- package/dist/builtin/subagents.d.ts +1 -0
- package/dist/builtin/subagents.js +164 -0
- package/dist/managers/aiManager.js +18 -1
- package/dist/managers/mcpManager.js +1 -1
- package/dist/managers/messageManager.d.ts +6 -0
- package/dist/managers/messageManager.js +33 -0
- package/dist/managers/subagentManager.d.ts +8 -0
- package/dist/managers/subagentManager.js +57 -2
- package/dist/tools/editTool.js +1 -0
- package/dist/tools/readTool.js +6 -3
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/writeTool.js +1 -0
- package/dist/types/messaging.d.ts +1 -0
- package/dist/utils/builtinEmbed.d.ts +21 -0
- package/dist/utils/builtinEmbed.js +53 -0
- package/dist/utils/configPaths.d.ts +0 -1
- package/dist/utils/configPaths.js +5 -26
- package/dist/utils/convertMessagesForAPI.js +21 -2
- package/dist/utils/messageOperations.d.ts +1 -0
- package/dist/utils/toolImagePersistence.d.ts +25 -0
- package/dist/utils/toolImagePersistence.js +56 -0
- package/package.json +1 -3
- package/builtin/plugins/sdd/.wave-plugin/plugin.json +0 -8
- package/builtin/plugins/sdd/hooks/hooks.json +0 -14
- package/builtin/plugins/sdd/scripts/session-start.js +0 -24
- package/builtin/plugins/sdd/scripts/spec-count.js +0 -77
- package/builtin/plugins/sdd/skills/specify/SKILL.md +0 -47
- package/builtin/plugins/sdd/skills/specify/templates/spec-template.md +0 -47
- package/builtin/skills/artifact/SKILL.md +0 -14
- package/builtin/skills/loop/SKILL.md +0 -79
- package/builtin/skills/settings/ENV.md +0 -78
- package/builtin/skills/settings/HOOKS.md +0 -227
- package/builtin/skills/settings/MCP.md +0 -137
- package/builtin/skills/settings/MEMORY.md +0 -76
- package/builtin/skills/settings/MODELS.md +0 -119
- package/builtin/skills/settings/PERMISSIONS.md +0 -88
- package/builtin/skills/settings/PLUGINS.md +0 -171
- package/builtin/skills/settings/SKILL.md +0 -132
- package/builtin/skills/settings/SKILLS.md +0 -107
- package/builtin/skills/settings/SUBAGENTS.md +0 -77
- package/builtin/subagents/bash.md +0 -19
- package/builtin/subagents/explore.md +0 -43
- package/builtin/subagents/general-purpose.md +0 -20
- package/builtin/subagents/plan.md +0 -56
- package/builtin/subagents/vision.md +0 -18
|
@@ -0,0 +1,1224 @@
|
|
|
1
|
+
export const settingsSkills = {
|
|
2
|
+
"skills/settings/ENV.md": `# Wave Environment Variables Configuration
|
|
3
|
+
|
|
4
|
+
Environment variables allow you to customize Wave's behavior, configure AI models, and provide context to hooks and tools. This document provides detailed guidance on how to configure environment variables in \`settings.json\`.
|
|
5
|
+
|
|
6
|
+
## The \`env\` Field
|
|
7
|
+
|
|
8
|
+
Environment variables are configured in the \`env\` field of \`settings.json\`. It is a simple key-value pair of strings.
|
|
9
|
+
|
|
10
|
+
\`\`\`json
|
|
11
|
+
{
|
|
12
|
+
"env": {
|
|
13
|
+
"WAVE_MODEL": "gemini-3-flash",
|
|
14
|
+
"MY_CUSTOM_VAR": "some-value"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
## Supported \`WAVE_*\` Environment Variables
|
|
20
|
+
|
|
21
|
+
Wave uses several environment variables to control its core functionality. Variables marked **OS env only** are read from the OS environment (or constructor / stdio \`initialize\` params) and are **NOT** read from settings.json \`env\` — set them in your shell, not in the \`env\` field.
|
|
22
|
+
|
|
23
|
+
| Variable | Description | Default |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| \`WAVE_API_KEY\` | API key for the AI gateway. | - |
|
|
26
|
+
| \`WAVE_BASE_URL\` | Base URL for the AI gateway. | - |
|
|
27
|
+
| \`WAVE_SERVER_URL\` | Server URL for SSO authentication. Resolution order: \`options.serverUrl\` → \`process.env.WAVE_SERVER_URL\` → default. Unlike other \`WAVE_*\` vars, a settings.json \`env\` value is also mirrored to \`process.env\` so process-level singletons (AuthService) see it without a per-session snapshot. | \`https://codechat.codewave.163.com\` |
|
|
28
|
+
| \`WAVE_CUSTOM_HEADERS\` | Custom HTTP headers for the AI gateway. Newline-separated \`Key: Value\` pairs (e.g., \`"X-Foo: bar\\nAuthorization: Bearer xxx"\`). | - |
|
|
29
|
+
| \`WAVE_MODEL\` | The primary AI model to use for the agent. | \`gemini-3-flash\` |
|
|
30
|
+
| \`WAVE_FAST_MODEL\` | The fast AI model to use for quick tasks. | \`gemini-2.5-flash\` |
|
|
31
|
+
| \`WAVE_VISION_MODEL\` | Vision-capable model used by the built-in \`vision\` subagent for image recognition. When set, the built-in \`vision\` subagent is registered (its frontmatter \`model: visionModel\` resolves to this value); when unset, the subagent is not loaded. Useful when the main model is fast but non-vision (e.g. DeepSeek). | - (not registered) |
|
|
32
|
+
| \`WAVE_MAX_INPUT_TOKENS\` | Maximum number of input tokens allowed. | \`200000\` |
|
|
33
|
+
| \`WAVE_MAX_OUTPUT_TOKENS\` | Maximum number of output tokens allowed. | \`32000\` |
|
|
34
|
+
| \`WAVE_DISABLE_AUTO_MEMORY\` | Set to \`1\` or \`true\` to disable the auto-memory feature. | \`false\` |
|
|
35
|
+
| \`WAVE_AUTO_MEMORY_FREQUENCY\` | Auto memory update frequency. \`1\` = every turn, \`2\` = every 2 turns, etc. | \`1\` |
|
|
36
|
+
| \`WAVE_TASK_LIST_ID\` | Explicitly set the task list ID for the session. | (Session ID) |
|
|
37
|
+
| \`WAVE_PLUGIN_GIT_TIMEOUT_MS\` | Timeout in milliseconds for git operations when installing plugins. **OS env only** (infrastructure). | \`300000\` |
|
|
38
|
+
|
|
39
|
+
## Configuration Scopes
|
|
40
|
+
|
|
41
|
+
Environment variables can be set in different scopes. Wave merges scopes from lowest to highest priority and stores the result in the agent's **per-session environment snapshot**. The snapshot takes priority over OS environment variables but is **NOT written to \`process.env\`** — this keeps multiple sessions in one \`wave --stdio\` process from polluting each other.
|
|
42
|
+
|
|
43
|
+
Precedence (highest to lowest):
|
|
44
|
+
|
|
45
|
+
1. **Local Scope**: \`.wave/settings.local.json\` (Local overrides, ignored by git)
|
|
46
|
+
2. **Project Scope**: \`.wave/settings.json\` (Project-specific settings, shared via git)
|
|
47
|
+
3. **User Scope**: \`~/.wave/settings.json\` (Global settings for all projects)
|
|
48
|
+
4. **System Environment**: Variables set in your shell (e.g., \`export WAVE_API_KEY=...\`). Used as a fallback when a key is absent from the settings snapshot.
|
|
49
|
+
|
|
50
|
+
> Settings \`env\` shadows (does not mutate) OS env: a key set in both settings.json \`env\` and the OS environment resolves to the settings value for that session, while the OS value remains untouched and visible to unrelated processes.
|
|
51
|
+
|
|
52
|
+
## Custom Environment Variables
|
|
53
|
+
|
|
54
|
+
You can also define custom environment variables in the \`env\` field. These variables are stored in the session's environment snapshot and will be available to:
|
|
55
|
+
|
|
56
|
+
- **Hooks**: Any shell command executed as a hook will have these variables in its environment (merged on top of OS env).
|
|
57
|
+
- **Tools**: Tools like \`Bash\` will have access to these variables (merged on top of OS env).
|
|
58
|
+
|
|
59
|
+
In \`wave --stdio\` mode one process hosts multiple sessions; each session keeps its own snapshot, so sessions with different \`env\` do not pollute each other (no "last session wins").
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
\`\`\`json
|
|
63
|
+
{
|
|
64
|
+
"env": {
|
|
65
|
+
"PROJECT_NAME": "my-awesome-project",
|
|
66
|
+
"DEPLOY_TARGET": "staging"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
## Live Reload
|
|
72
|
+
|
|
73
|
+
Environment variables configured in \`settings.json\` support **live reload**. When you modify the \`env\` field in any \`settings.json\` file (user, project, or local scope), the changes take effect immediately without requiring a Wave session restart — the session's environment snapshot is refreshed and subsequent resolve calls / subprocess spawns use the new values.
|
|
74
|
+
|
|
75
|
+
## Best Practices
|
|
76
|
+
|
|
77
|
+
- **Use Local Overrides for Secrets**: Never commit sensitive information like \`WAVE_API_KEY\` to \`settings.json\`. Use \`settings.local.json\` instead.
|
|
78
|
+
- **Standard Naming**: Use uppercase and underscores for environment variable names (e.g., \`MY_VARIABLE\`).
|
|
79
|
+
- **Avoid Overriding System Variables**: Be careful not to override standard system variables like \`PATH\` or \`HOME\` unless you have a specific reason to do so.
|
|
80
|
+
`,
|
|
81
|
+
"skills/settings/HOOKS.md": `# Wave Hooks Configuration
|
|
82
|
+
|
|
83
|
+
Hooks allow you to automate tasks when certain events occur in Wave. This document provides detailed guidance on how to configure hooks in \`settings.json\`.
|
|
84
|
+
|
|
85
|
+
## Hook Events
|
|
86
|
+
|
|
87
|
+
Wave supports the following hook events:
|
|
88
|
+
|
|
89
|
+
- \`PreToolUse\`: Triggered before a tool is executed.
|
|
90
|
+
- \`PostToolUse\`: Triggered after a tool has finished executing.
|
|
91
|
+
- \`UserPromptSubmit\`: Triggered when a user submits a prompt.
|
|
92
|
+
- \`PermissionRequest\`: Triggered when Wave requests permission to use a tool.
|
|
93
|
+
- \`Stop\`: Triggered when Wave finishes its response cycle (no more tool calls).
|
|
94
|
+
- \`SubagentStop\`: Triggered when a subagent finishes its response cycle.
|
|
95
|
+
- \`WorktreeCreate\`: Triggered when a new worktree is created.
|
|
96
|
+
- \`WorktreeRemove\`: Triggered before a worktree is removed (e.g., via ExitWorktree with \`action: "remove"\`). Non-blocking. Fires **before** the worktree directory is deleted so hooks can still read files inside it. The hook receives \`worktree_path\` in the JSON input. Useful for cleanup tasks (e.g., \`docker compose -p $(basename "$worktree_path") down\`).
|
|
97
|
+
- \`CwdChanged\`: Triggered when the working directory changes (e.g., entering/exiting a worktree). Non-blocking.
|
|
98
|
+
- \`SessionStart\`: Triggered during session initialization. Hooks can inject \`additionalContext\` and \`initialUserMessage\` via stdout.
|
|
99
|
+
- \`SessionEnd\`: Triggered during agent destruction (fire-and-forget, non-blocking). Useful for cleanup, resource teardown, and analytics.
|
|
100
|
+
- \`PreCompact\`: Triggered before conversation compaction. Hook stdout is captured as additional instructions and merged into the compaction prompt.
|
|
101
|
+
- \`PostCompact\`: Triggered after conversation compaction completes. Receives the compact summary text.
|
|
102
|
+
|
|
103
|
+
## Hook Configuration Structure
|
|
104
|
+
|
|
105
|
+
Hooks are configured in the \`hooks\` field of \`settings.json\`. Each event can have multiple hook configurations.
|
|
106
|
+
|
|
107
|
+
\`\`\`json
|
|
108
|
+
{
|
|
109
|
+
"hooks": {
|
|
110
|
+
"PreToolUse": [
|
|
111
|
+
{
|
|
112
|
+
"matcher": "Write",
|
|
113
|
+
"hooks": [
|
|
114
|
+
{
|
|
115
|
+
"command": "pnpm lint",
|
|
116
|
+
"description": "Run lint before writing files"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"PermissionRequest": [
|
|
122
|
+
{
|
|
123
|
+
"matcher": "Bash",
|
|
124
|
+
"hooks": [
|
|
125
|
+
{
|
|
126
|
+
"command": "echo \\"Permission requested for Bash tool\\" >> hooks.log",
|
|
127
|
+
"description": "Log permission requests for Bash"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
## Hook Configuration Fields
|
|
137
|
+
|
|
138
|
+
- \`matcher\`: (Optional) A pattern to match against the tool name (e.g., "Write", "Read*", "/^Edit/"). Only applicable for \`PreToolUse\`, \`PostToolUse\`, and \`PermissionRequest\`.
|
|
139
|
+
- \`hooks\`: An array of hook commands to execute.
|
|
140
|
+
- \`command\`: The shell command to execute.
|
|
141
|
+
- \`description\`: A brief description of the hook's purpose.
|
|
142
|
+
- \`async\`: (Optional) Whether the hook should run in the background without blocking (default: \`false\`).
|
|
143
|
+
- \`timeout\`: (Optional) Maximum execution time in seconds (default: \`600\`).
|
|
144
|
+
|
|
145
|
+
## Hook Input JSON
|
|
146
|
+
|
|
147
|
+
Wave provides detailed context to hook processes via \`stdin\` as a JSON object. This allows hooks to make informed decisions based on the current state.
|
|
148
|
+
|
|
149
|
+
### Common Fields
|
|
150
|
+
- \`session_id\`: The current session ID.
|
|
151
|
+
- \`transcript_path\`: Path to the session transcript file (JSON).
|
|
152
|
+
- \`cwd\`: The current working directory.
|
|
153
|
+
- \`hook_event_name\`: The name of the triggering event.
|
|
154
|
+
|
|
155
|
+
### Event-Specific Fields
|
|
156
|
+
- \`tool_name\`: (PreToolUse, PostToolUse, PermissionRequest) The name of the tool.
|
|
157
|
+
- \`tool_input\`: (PreToolUse, PostToolUse, PermissionRequest) The input parameters passed to the tool.
|
|
158
|
+
- \`tool_response\`: (PostToolUse) The result of the tool execution.
|
|
159
|
+
- \`user_prompt\`: (UserPromptSubmit) The text submitted by the user.
|
|
160
|
+
- \`subagent_type\`: (If executed by a subagent) The type of the subagent.
|
|
161
|
+
- \`name\`: (WorktreeCreate) The name of the new worktree.
|
|
162
|
+
- \`worktree_path\`: (WorktreeRemove) The absolute path of the worktree about to be removed. Derive the worktree name with \`basename "$worktree_path"\`.
|
|
163
|
+
- \`old_cwd\`: (CwdChanged) The previous working directory.
|
|
164
|
+
- \`new_cwd\`: (CwdChanged) The new working directory.
|
|
165
|
+
- \`compact_instructions\`: (PreCompact) Custom instructions for the compaction, if any.
|
|
166
|
+
- \`compact_summary\`: (PostCompact) The AI-generated compaction summary text.
|
|
167
|
+
- \`source\`: (SessionStart) The session start source: \`"startup"\`, \`"resume"\`, or \`"compact"\`.
|
|
168
|
+
- \`agent_type\`: (SessionStart) The agent type identifier.
|
|
169
|
+
- \`end_source\`: (SessionEnd) The session end source: \`"exit"\`, \`"stop"\`, or \`"compact"\`.
|
|
170
|
+
|
|
171
|
+
## Hook Exit Codes
|
|
172
|
+
|
|
173
|
+
Hooks can communicate status and control Wave's behavior using exit codes:
|
|
174
|
+
|
|
175
|
+
- **Exit 0**: Success. Wave continues its normal execution.
|
|
176
|
+
- **Exit 2**: Blocking Error. Wave blocks the current operation and provides feedback based on the event:
|
|
177
|
+
- \`UserPromptSubmit\`: Blocks prompt processing and shows \`stderr\` as a user error.
|
|
178
|
+
- \`PreToolUse\`: Blocks tool execution and provides \`stderr\` to the agent as feedback.
|
|
179
|
+
- \`PostToolUse\`: Appends \`stderr\` to the tool result as feedback for the agent.
|
|
180
|
+
- \`Stop\`: Blocks the stop operation and provides \`stderr\` to the agent.
|
|
181
|
+
- \`WorktreeCreate\` / \`WorktreeRemove\` / \`CwdChanged\` / \`PreCompact\` / \`PostCompact\`: Shows \`stderr\` in an error block, but does not block the operation.
|
|
182
|
+
- \`SessionStart\` / \`SessionEnd\`: Shows \`stderr\` in an error block, but does not block startup or shutdown.
|
|
183
|
+
- **Other Exits (e.g., Exit 1)**: Non-blocking error. Wave continues execution but shows \`stderr\` as a warning to the user.
|
|
184
|
+
|
|
185
|
+
## SessionStart Hooks
|
|
186
|
+
|
|
187
|
+
\`SessionStart\` hooks fire during session initialization. They can inject context and messages into the session via stdout.
|
|
188
|
+
|
|
189
|
+
### Stdout Processing
|
|
190
|
+
|
|
191
|
+
Hook stdout is processed as follows:
|
|
192
|
+
- If stdout is valid JSON with \`hookSpecificOutput.additionalContext\` (Claude Code format), that value is injected as additional context.
|
|
193
|
+
- If stdout is valid JSON with \`initialUserMessage\` at the top level, that value is injected as the initial user message.
|
|
194
|
+
- If stdout is not JSON, the entire output is appended as additional context.
|
|
195
|
+
|
|
196
|
+
Example hook output:
|
|
197
|
+
\`\`\`json
|
|
198
|
+
{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "User prefers concise responses"}, "initialUserMessage": "Here is my current task..."}
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
### Example Configuration
|
|
202
|
+
\`\`\`json
|
|
203
|
+
{
|
|
204
|
+
"hooks": {
|
|
205
|
+
"SessionStart": [
|
|
206
|
+
{
|
|
207
|
+
"hooks": [
|
|
208
|
+
{
|
|
209
|
+
"command": "echo '{\\"hookSpecificOutput\\": {\\"hookEventName\\": \\"SessionStart\\", \\"additionalContext\\": \\"Project uses pnpm and TypeScript\\"}}'",
|
|
210
|
+
"description": "Inject project context at session start"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
\`\`\`
|
|
218
|
+
|
|
219
|
+
## SessionEnd Hooks
|
|
220
|
+
|
|
221
|
+
\`SessionEnd\` hooks fire during agent destruction (fire-and-forget, non-blocking). They are useful for cleanup tasks, resource teardown, and analytics.
|
|
222
|
+
|
|
223
|
+
### Input
|
|
224
|
+
SessionEnd hooks receive \`end_source\` in the JSON input indicating how the session ended:
|
|
225
|
+
- \`"exit"\`: User exited the session
|
|
226
|
+
- \`"stop"\`: Session was explicitly stopped
|
|
227
|
+
- \`"compact"\`: Session was compacted
|
|
228
|
+
|
|
229
|
+
### Example Configuration
|
|
230
|
+
\`\`\`json
|
|
231
|
+
{
|
|
232
|
+
"hooks": {
|
|
233
|
+
"SessionEnd": [
|
|
234
|
+
{
|
|
235
|
+
"hooks": [
|
|
236
|
+
{
|
|
237
|
+
"command": "echo '{\\"session_id\\": \\"$WAVE_SESSION_ID\\"}' >> /tmp/session-analytics.log",
|
|
238
|
+
"description": "Log session end for analytics",
|
|
239
|
+
"async": true
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
## WorktreeRemove Hooks
|
|
249
|
+
|
|
250
|
+
\`WorktreeRemove\` hooks fire **before** the worktree directory is deleted, so they can still read files inside it. They are non-blocking (Notification type): the hook never replaces \`git worktree remove\` itself. Useful for cleaning up external resources that were provisioned for the worktree (databases, containers, etc.).
|
|
251
|
+
|
|
252
|
+
### Input
|
|
253
|
+
WorktreeRemove hooks receive \`worktree_path\` in the JSON input (alongside the common fields \`session_id\`, \`transcript_path\`, \`cwd\`, \`hook_event_name\`). The worktree name can be derived via \`basename "$worktree_path"\`.
|
|
254
|
+
|
|
255
|
+
### Example Configuration
|
|
256
|
+
\`\`\`json
|
|
257
|
+
{
|
|
258
|
+
"hooks": {
|
|
259
|
+
"WorktreeRemove": [
|
|
260
|
+
{
|
|
261
|
+
"hooks": [
|
|
262
|
+
{
|
|
263
|
+
"command": "worktree_path=$(jq -r '.worktree_path') && docker compose -p \\"$(basename \\"$worktree_path\\")\\" down || true",
|
|
264
|
+
"description": "Tear down the worktree's docker compose project before removal"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
\`\`\`
|
|
272
|
+
|
|
273
|
+
## Live Reload
|
|
274
|
+
|
|
275
|
+
Hook configurations support **live reload**. When you modify hooks in \`settings.json\`, the changes take effect immediately without restarting Wave.
|
|
276
|
+
|
|
277
|
+
## Plugin Hooks
|
|
278
|
+
|
|
279
|
+
When hooks are registered via a **plugin**, Wave automatically:
|
|
280
|
+
|
|
281
|
+
1. Substitutes \`\${WAVE_PLUGIN_ROOT}\` with the plugin's directory path in the command string
|
|
282
|
+
2. Injects \`WAVE_PLUGIN_ROOT\` as an environment variable into the hook process
|
|
283
|
+
|
|
284
|
+
\`\`\`json
|
|
285
|
+
{
|
|
286
|
+
"hooks": {
|
|
287
|
+
"WorktreeCreate": [
|
|
288
|
+
{
|
|
289
|
+
"hooks": [
|
|
290
|
+
{
|
|
291
|
+
"command": "\${WAVE_PLUGIN_ROOT}/scripts/setup-worktree.sh"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
\`\`\`
|
|
299
|
+
|
|
300
|
+
The shell also receives \`WAVE_PLUGIN_ROOT\` as an env var, so \`$WAVE_PLUGIN_ROOT\` works in the hook script itself.
|
|
301
|
+
|
|
302
|
+
## Best Practices
|
|
303
|
+
|
|
304
|
+
- **Keep hooks fast**: Long-running hooks can slow down your workflow unless they are \`async\`.
|
|
305
|
+
- **Use descriptive names**: Help yourself and others understand what each hook does.
|
|
306
|
+
- **Test your hooks**: Run the commands manually first to ensure they work as expected.
|
|
307
|
+
- **Use local overrides**: For machine-specific hooks, use \`.wave/settings.local.json\`.
|
|
308
|
+
`,
|
|
309
|
+
"skills/settings/MCP.md": `# Model Context Protocol (MCP) Configuration
|
|
310
|
+
|
|
311
|
+
The Model Context Protocol (MCP) allows Wave to connect to external servers that provide additional tools and context. This document explains how to configure and use MCP servers in Wave.
|
|
312
|
+
|
|
313
|
+
## Configuration File: \`.mcp.json\`
|
|
314
|
+
|
|
315
|
+
MCP servers are configured in a \`.mcp.json\` file. Wave looks for this file in your project root:
|
|
316
|
+
|
|
317
|
+
1. **Project Scope**: \`.mcp.json\` in your project root (Project-specific MCP servers)
|
|
318
|
+
|
|
319
|
+
## Configuration Structure
|
|
320
|
+
|
|
321
|
+
The \`.mcp.json\` file contains a list of MCP server configurations.
|
|
322
|
+
|
|
323
|
+
\`\`\`json
|
|
324
|
+
{
|
|
325
|
+
"mcpServers": {
|
|
326
|
+
"sqlite": {
|
|
327
|
+
"command": "uvx",
|
|
328
|
+
"args": ["mcp-server-sqlite", "--db-path", "/path/to/your/database.db"]
|
|
329
|
+
},
|
|
330
|
+
"github": {
|
|
331
|
+
"command": "npx",
|
|
332
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
333
|
+
"env": {
|
|
334
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
\`\`\`
|
|
340
|
+
|
|
341
|
+
### Fields for each server:
|
|
342
|
+
|
|
343
|
+
- \`type\`: (Optional) The transport type: \`"stdio"\`, \`"sse"\`, or \`"http"\`. If omitted, Wave infers the type from other fields (URL → \`"http"\`, command → \`"stdio"\`). Set explicitly for clarity and to avoid the default behavior.
|
|
344
|
+
- \`command\`: (For stdio) The executable to run (e.g., \`npx\`, \`uvx\`, \`python\`, \`node\`).
|
|
345
|
+
- \`args\`: (For stdio) An array of command-line arguments for the executable.
|
|
346
|
+
- \`env\`: (Optional) A record of environment variables for the server process.
|
|
347
|
+
- \`url\`: (For \`sse\`/\`http\`) The endpoint URL of a remote MCP server.
|
|
348
|
+
- \`headers\`: (For \`sse\`/\`http\`) A record of HTTP headers to send with requests (e.g., \`{"Authorization": "Bearer token"}\`).
|
|
349
|
+
|
|
350
|
+
## Transport Types
|
|
351
|
+
|
|
352
|
+
Wave supports three MCP transport types. When \`type\` is not specified, Wave uses the following defaults:
|
|
353
|
+
- If \`url\` is provided → defaults to \`"http"\` (Streamable HTTP)
|
|
354
|
+
- If \`command\` is provided → defaults to \`"stdio"\`
|
|
355
|
+
|
|
356
|
+
### stdio
|
|
357
|
+
|
|
358
|
+
The server is launched as a local subprocess. Use for locally installed MCP servers.
|
|
359
|
+
|
|
360
|
+
\`\`\`json
|
|
361
|
+
{
|
|
362
|
+
"mcpServers": {
|
|
363
|
+
"sqlite": {
|
|
364
|
+
"type": "stdio",
|
|
365
|
+
"command": "uvx",
|
|
366
|
+
"args": ["mcp-server-sqlite", "--db-path", "/path/to/db"]
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
\`\`\`
|
|
371
|
+
|
|
372
|
+
### http (Streamable HTTP)
|
|
373
|
+
|
|
374
|
+
The recommended transport for remote servers. Uses the MCP Streamable HTTP protocol.
|
|
375
|
+
|
|
376
|
+
\`\`\`json
|
|
377
|
+
{
|
|
378
|
+
"mcpServers": {
|
|
379
|
+
"remote-api": {
|
|
380
|
+
"type": "http",
|
|
381
|
+
"url": "https://mcp-server.example.com/mcp",
|
|
382
|
+
"headers": {
|
|
383
|
+
"Authorization": "Bearer your-token"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
\`\`\`
|
|
389
|
+
|
|
390
|
+
### sse (Server-Sent Events)
|
|
391
|
+
|
|
392
|
+
Legacy transport for remote servers that only support SSE. Use \`"http"\` for new servers unless the server requires SSE.
|
|
393
|
+
|
|
394
|
+
\`\`\`json
|
|
395
|
+
{
|
|
396
|
+
"mcpServers": {
|
|
397
|
+
"legacy-server": {
|
|
398
|
+
"type": "sse",
|
|
399
|
+
"url": "https://mcp-server.example.com/sse"
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
\`\`\`
|
|
404
|
+
|
|
405
|
+
> **Note**: When \`type\` is not specified, URL-based servers default to \`"http"\` with no SSE fallback. If you need SSE, set \`type: "sse"\` explicitly.
|
|
406
|
+
|
|
407
|
+
## Using MCP Tools
|
|
408
|
+
|
|
409
|
+
Once configured, Wave will automatically connect to the MCP servers when it starts. Tools provided by these servers will be available to the agent with a prefix:
|
|
410
|
+
|
|
411
|
+
\`mcp__[serverName]__[toolName]\`
|
|
412
|
+
|
|
413
|
+
For example, if you have a server named \`sqlite\` with a tool named \`query\`, it will be available as \`mcp__sqlite__query\`.
|
|
414
|
+
|
|
415
|
+
## Permissions for MCP Tools
|
|
416
|
+
|
|
417
|
+
By default, MCP tools require user permission before execution. When you grant permission, you can choose to "Allow always" for a specific tool. These persistent rules are stored in your \`settings.json\` under the \`permissions\` field.
|
|
418
|
+
|
|
419
|
+
## Plugin MCP Servers
|
|
420
|
+
|
|
421
|
+
When MCP servers are registered via a **plugin**, Wave automatically injects the \`WAVE_PLUGIN_ROOT\` environment variable into the server process. Additionally, \`\${WAVE_PLUGIN_ROOT}\` in the \`command\`, \`args\`, and \`env\` fields is substituted with the plugin's directory path before the server is spawned (matching Claude Code's \`\${CLAUDE_PLUGIN_ROOT}\` behavior).
|
|
422
|
+
|
|
423
|
+
\`\`\`json
|
|
424
|
+
{
|
|
425
|
+
"mcpServers": {
|
|
426
|
+
"my-plugin-server": {
|
|
427
|
+
"command": "\${WAVE_PLUGIN_ROOT}/bin/mcp-server",
|
|
428
|
+
"args": ["--config", "\${WAVE_PLUGIN_ROOT}/config/server.json"]
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
\`\`\`
|
|
433
|
+
|
|
434
|
+
Your MCP server code can also read \`WAVE_PLUGIN_ROOT\` as an environment variable:
|
|
435
|
+
|
|
436
|
+
\`\`\`ts
|
|
437
|
+
// Inside your MCP server (e.g., a Node.js script)
|
|
438
|
+
const pluginRoot = process.env.WAVE_PLUGIN_ROOT;
|
|
439
|
+
\`\`\`
|
|
440
|
+
|
|
441
|
+
## Troubleshooting
|
|
442
|
+
|
|
443
|
+
- **Server Connection**: If a server fails to connect, Wave will log an error. You can check the status of MCP servers by asking the agent.
|
|
444
|
+
- **Tool Availability**: If a tool is not appearing, ensure the server is running and the \`.mcp.json\` configuration is correct.
|
|
445
|
+
- **Logs**: MCP server \`stderr\` is often used for logging and can be helpful for debugging connection issues.
|
|
446
|
+
`,
|
|
447
|
+
"skills/settings/MEMORY.md": `# Wave Memory
|
|
448
|
+
|
|
449
|
+
Wave provides multiple memory layers to give the agent context-specific instructions and knowledge. Memory files are standard Markdown files loaded automatically at startup.
|
|
450
|
+
|
|
451
|
+
## Memory Layers
|
|
452
|
+
|
|
453
|
+
Wave looks for memory in the following locations, loaded in order of increasing priority:
|
|
454
|
+
|
|
455
|
+
1. **User Memory**: \`~/.wave/AGENTS.md\` — Global instructions across all projects
|
|
456
|
+
2. **Project Memory**: \`AGENTS.md\` in the project root — Project-specific instructions
|
|
457
|
+
3. **Memory Rules**: \`.wave/rules/*.md\` and \`~/.wave/rules/*.md\` — Modular, path-scoped rules (see below)
|
|
458
|
+
|
|
459
|
+
> \`CLAUDE.md\` is also supported as a fallback for both user and project memory, for compatibility with existing repositories.
|
|
460
|
+
|
|
461
|
+
## User Memory
|
|
462
|
+
|
|
463
|
+
Stored at \`~/.wave/AGENTS.md\`. Use it for cross-project preferences and global instructions, e.g. "always write tests for new features", "prefer functional style".
|
|
464
|
+
|
|
465
|
+
## Project Memory
|
|
466
|
+
|
|
467
|
+
### Project Memory File
|
|
468
|
+
|
|
469
|
+
The \`AGENTS.md\` file in the project root is the primary project-level memory. It is checked into the repository and shared with all contributors. Use it for:
|
|
470
|
+
|
|
471
|
+
- Build and test commands (e.g. "use pnpm not npm")
|
|
472
|
+
- Project structure and architecture conventions
|
|
473
|
+
- Coding standards and patterns
|
|
474
|
+
|
|
475
|
+
### Memory Rules
|
|
476
|
+
|
|
477
|
+
Memory rules are modular Markdown files that provide path-scoped instructions. They are discovered in:
|
|
478
|
+
|
|
479
|
+
- **Project scope**: \`.wave/rules/*.md\` (checked into the repo)
|
|
480
|
+
- **User scope**: \`~/.wave/rules/*.md\` (personal, not shared)
|
|
481
|
+
|
|
482
|
+
Each file can optionally include YAML frontmatter to scope rules to specific file paths:
|
|
483
|
+
|
|
484
|
+
\`\`\`markdown
|
|
485
|
+
---
|
|
486
|
+
paths:
|
|
487
|
+
- "src/api/**/*.ts"
|
|
488
|
+
- "src/services/**/*.ts"
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
# API and Service Guidelines
|
|
492
|
+
|
|
493
|
+
- Always use \`async/await\` for asynchronous operations.
|
|
494
|
+
- Use \`Zod\` for input validation.
|
|
495
|
+
\`\`\`
|
|
496
|
+
|
|
497
|
+
#### YAML Frontmatter Fields
|
|
498
|
+
|
|
499
|
+
- \`paths\`: (Optional) A list of glob patterns. The rules in this file will only be active when the agent is working with files that match these patterns. If omitted, the rules are always active.
|
|
500
|
+
- \`priority\`: (Optional) A number controlling rule precedence. Higher priority rules override lower ones on conflict.
|
|
501
|
+
|
|
502
|
+
#### How Memory Rules are Loaded
|
|
503
|
+
|
|
504
|
+
- Wave recursively discovers all \`.md\` files in \`.wave/rules/\` and \`~/.wave/rules/\`.
|
|
505
|
+
- **Path-specific activation**: If a rule has a \`paths\` field, it is only included in the agent's context when a file being read or modified matches the glob patterns.
|
|
506
|
+
- **Unconditional rules**: Rules without a \`paths\` field are always active.
|
|
507
|
+
- **Priority**: Project-level rules take priority over user-level rules if there is a conflict.
|
|
508
|
+
|
|
509
|
+
#### Best Practices
|
|
510
|
+
|
|
511
|
+
- **Keep rules focused**: Create separate files for different topics (e.g. \`testing.md\`, \`ui-components.md\`).
|
|
512
|
+
- **Leverage path scoping**: Use the \`paths\` field to keep the agent's context window clean and relevant.
|
|
513
|
+
- **Share with your team**: Commit \`.wave/rules/\` to your git repository.
|
|
514
|
+
|
|
515
|
+
## Auto-Memory
|
|
516
|
+
|
|
517
|
+
In addition to manual memory files, Wave has an **auto-memory** feature that automatically extracts and remembers important information across sessions. This is stored in \`~/.wave/projects/<project-id>/memory/MEMORY.md\`.
|
|
518
|
+
|
|
519
|
+
You can control auto-memory in \`settings.json\`:
|
|
520
|
+
|
|
521
|
+
- \`autoMemoryEnabled\`: Enable or disable auto-memory (default: \`true\`).
|
|
522
|
+
- \`autoMemoryFrequency\`: Frequency of auto-memory extraction turns (default: \`1\`).
|
|
523
|
+
`,
|
|
524
|
+
"skills/settings/MODELS.md": `# Model Configuration
|
|
525
|
+
|
|
526
|
+
Wave allows you to configure model-specific parameters directly in your \`settings.json\`. This gives you fine-grained control over reasoning quality, token cost, and latency for different models.
|
|
527
|
+
|
|
528
|
+
## Model Overrides
|
|
529
|
+
|
|
530
|
+
You can define overrides for specific models in the \`models\` field. The key should be the exact model name used by Wave.
|
|
531
|
+
|
|
532
|
+
\`\`\`json
|
|
533
|
+
{
|
|
534
|
+
"models": {
|
|
535
|
+
"claude-3-7-sonnet-20250219": {
|
|
536
|
+
"options": {
|
|
537
|
+
"thinking": {
|
|
538
|
+
"type": "enabled",
|
|
539
|
+
"budget_tokens": 1024
|
|
540
|
+
},
|
|
541
|
+
"temperature": 1.0
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"o3-mini": {
|
|
545
|
+
"options": {
|
|
546
|
+
"reasoning_effort": "high"
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
"gpt-4o": {
|
|
550
|
+
"options": {
|
|
551
|
+
"temperature": 0.5
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
\`\`\`
|
|
557
|
+
|
|
558
|
+
## Supported Parameters
|
|
559
|
+
|
|
560
|
+
Generation parameters are nested under the \`options\` field within each model's configuration. Wave supports passing arbitrary parameters to the underlying AI provider. Common parameters include:
|
|
561
|
+
|
|
562
|
+
- \`temperature\`: Controls randomness (0.0 to 2.0).
|
|
563
|
+
- \`maxTokens\`: Maximum number of tokens to generate in the response.
|
|
564
|
+
- \`reasoning_effort\`: (OpenAI specific) Controls the reasoning effort for models like \`o1\` and \`o3-mini\`. Values: \`low\`, \`medium\`, \`high\`.
|
|
565
|
+
- \`thinking\`: (Claude specific) Configures the thinking/reasoning capabilities for Claude 3.7+ models.
|
|
566
|
+
- \`type\`: \`"enabled"\` or \`"disabled"\`.
|
|
567
|
+
- \`budget_tokens\`: Maximum tokens to use for thinking.
|
|
568
|
+
|
|
569
|
+
## Model Capabilities
|
|
570
|
+
|
|
571
|
+
Wave needs to know whether a model supports certain features. Instead of guessing from the model name, you declare these explicitly via the \`capabilities\` field. Note that \`capabilities\` is set at the top level of the model configuration, **not** inside the \`options\` field — \`options\` is reserved for generation parameters only.
|
|
572
|
+
|
|
573
|
+
- \`vision\` (default: \`true\`): Whether the model can accept image inputs. When \`false\`, images are stripped and replaced with text placeholders.
|
|
574
|
+
- \`promptCaching\` (default: \`false\`): Whether the model supports ephemeral prompt caching (e.g., Anthropic's \`cache_control\` markers). When \`true\`, Wave injects cache markers on the system prompt and last user message.
|
|
575
|
+
|
|
576
|
+
\`\`\`json
|
|
577
|
+
{
|
|
578
|
+
"models": {
|
|
579
|
+
"claude-3-7-sonnet-20250219": {
|
|
580
|
+
"capabilities": {
|
|
581
|
+
"vision": true,
|
|
582
|
+
"promptCaching": true
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"deepseek-r1": {
|
|
586
|
+
"capabilities": {
|
|
587
|
+
"vision": false,
|
|
588
|
+
"promptCaching": false
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
\`\`\`
|
|
594
|
+
|
|
595
|
+
You can also set \`capabilities\` at the top level of \`settings.json\` to apply to the default model:
|
|
596
|
+
|
|
597
|
+
\`\`\`json
|
|
598
|
+
{
|
|
599
|
+
"capabilities": {
|
|
600
|
+
"vision": true,
|
|
601
|
+
"promptCaching": false
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
\`\`\`
|
|
605
|
+
|
|
606
|
+
## Unsetting Default Parameters
|
|
607
|
+
|
|
608
|
+
If a model does not support a default parameter (like \`temperature\` for some reasoning models), you can explicitly set it to \`null\` inside the \`options\` field to ensure it is not sent to the provider.
|
|
609
|
+
|
|
610
|
+
\`\`\`json
|
|
611
|
+
{
|
|
612
|
+
"models": {
|
|
613
|
+
"o1-preview": {
|
|
614
|
+
"options": {
|
|
615
|
+
"temperature": null
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
\`\`\`
|
|
621
|
+
|
|
622
|
+
## Global Model Selection
|
|
623
|
+
|
|
624
|
+
You can also set the default models Wave uses via environment variables in \`settings.json\`:
|
|
625
|
+
|
|
626
|
+
\`\`\`json
|
|
627
|
+
{
|
|
628
|
+
"env": {
|
|
629
|
+
"WAVE_MODEL": "gemini-3-flash",
|
|
630
|
+
"WAVE_FAST_MODEL": "gemini-2.5-flash",
|
|
631
|
+
"WAVE_VISION_MODEL": "qwen-vl-max",
|
|
632
|
+
"WAVE_MAX_INPUT_TOKENS": "100000",
|
|
633
|
+
"WAVE_MAX_OUTPUT_TOKENS": "4096"
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
\`\`\`
|
|
637
|
+
|
|
638
|
+
\`WAVE_VISION_MODEL\` names a vision-capable model for the built-in \`vision\` subagent. Setting it registers the subagent, whose frontmatter \`model: visionModel\` resolves to this value — so a fast non-vision main model can delegate image recognition. Leave it unset to disable the built-in \`vision\` subagent.
|
|
639
|
+
|
|
640
|
+
## Live Reload
|
|
641
|
+
|
|
642
|
+
Model configurations support **live reload**. When you modify the \`models\` field or model-related environment variables in \`settings.json\`, the changes take effect immediately without restarting Wave.
|
|
643
|
+
`,
|
|
644
|
+
"skills/settings/PERMISSIONS.md": `# Tool Permissions & Safe Zone
|
|
645
|
+
|
|
646
|
+
Wave includes a robust permission system to protect your system while allowing the AI to be productive. This system is centered around the "Safe Zone" and configurable permission modes.
|
|
647
|
+
|
|
648
|
+
## The Safe Zone
|
|
649
|
+
|
|
650
|
+
The Safe Zone is a set of directories where Wave is allowed to perform potentially sensitive operations (like editing or writing files) with reduced friction.
|
|
651
|
+
|
|
652
|
+
By default, the Safe Zone includes:
|
|
653
|
+
- The current project directory.
|
|
654
|
+
- The Wave configuration directories (\`~/.wave/\` and \`.wave/\`).
|
|
655
|
+
- The system temporary directory.
|
|
656
|
+
|
|
657
|
+
You can extend the Safe Zone by adding \`additionalDirectories\` to your \`permissions\` configuration in \`settings.json\`.
|
|
658
|
+
|
|
659
|
+
## Permission Modes
|
|
660
|
+
|
|
661
|
+
The \`permissionMode\` setting determines how Wave handles requests to use restricted tools (e.g., \`Bash\`, \`Edit\`, \`Write\`, \`AskUserQuestion\`).
|
|
662
|
+
|
|
663
|
+
| Mode | Description |
|
|
664
|
+
| :--- | :--- |
|
|
665
|
+
| \`default\` | **Recommended.** Wave will ask for your permission before using any restricted tool. |
|
|
666
|
+
| \`bypassPermissions\` | **Use with caution.** Wave will execute all tools without asking for permission. |
|
|
667
|
+
| \`acceptEdits\` | Wave will automatically allow \`Edit\` and \`Write\` operations within the Safe Zone. It will still ask for permission for \`Bash\` and operations outside the Safe Zone. |
|
|
668
|
+
| \`plan\` | Restricted mode for editing the plan file (usually internal). |
|
|
669
|
+
| \`dontAsk\` | Wave will automatically deny all restricted tools without asking. This is the most restrictive mode. |
|
|
670
|
+
|
|
671
|
+
### Example Configuration
|
|
672
|
+
|
|
673
|
+
\`\`\`json
|
|
674
|
+
{
|
|
675
|
+
"permissions": {
|
|
676
|
+
"permissionMode": "default",
|
|
677
|
+
"additionalDirectories": ["/home/user/my-exports"],
|
|
678
|
+
"allow": ["ls -R", "git status"],
|
|
679
|
+
"deny": ["rm -rf"]
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
\`\`\`
|
|
683
|
+
|
|
684
|
+
## Allow and Deny Rules
|
|
685
|
+
|
|
686
|
+
You can pre-approve or explicitly forbid specific operations using \`allow\` and \`deny\` rules.
|
|
687
|
+
|
|
688
|
+
- **\`allow\`**: An array of string patterns (e.g., bash commands or file paths) that are always permitted.
|
|
689
|
+
- **\`deny\`**: An array of string patterns that are always forbidden.
|
|
690
|
+
|
|
691
|
+
When a tool is called, Wave checks:
|
|
692
|
+
1. If the operation matches a \`deny\` rule, it is rejected.
|
|
693
|
+
2. If the operation matches an \`allow\` rule, it is permitted.
|
|
694
|
+
3. If no rules match, the behavior depends on the \`permissionMode\`.
|
|
695
|
+
|
|
696
|
+
### Rule Syntax
|
|
697
|
+
|
|
698
|
+
Rules use the format \`ToolName(pattern)\`. The wildcard \`*\` has different semantics depending on the tool type:
|
|
699
|
+
|
|
700
|
+
**Bash rules** — \`*\` matches everything including \`/\` (regex-style):
|
|
701
|
+
|
|
702
|
+
\`\`\`json
|
|
703
|
+
{ "allow": ["Bash(git status*)", "Bash(npm run *)"] }
|
|
704
|
+
\`\`\`
|
|
705
|
+
|
|
706
|
+
- \`Bash(git status*)\` matches \`git status\`, \`git status -s\`, \`git status --short\`
|
|
707
|
+
- \`Bash(npm run *)\` matches \`npm run build\`, \`npm run test:unit\`
|
|
708
|
+
- \`*\` → \`.*\` regex conversion, so \`Bash(node */scripts/*.mjs*)\` matches \`node plugins/code2cwspec/scripts/check-manifest.mjs\`
|
|
709
|
+
|
|
710
|
+
**File tool rules** (\`Read\`, \`Write\`, \`Edit\`) — \`*\` does NOT cross \`/\` (glob-style, use \`**\` for directories):
|
|
711
|
+
|
|
712
|
+
\`\`\`json
|
|
713
|
+
{ "allow": ["Read(**/*.env)", "Write(src/**/*.ts)"] }
|
|
714
|
+
\`\`\`
|
|
715
|
+
|
|
716
|
+
- \`Read(*.env)\` matches \`local.env\` but NOT \`config/local.env\`
|
|
717
|
+
- \`Read(**/*.env)\` matches \`local.env\`, \`config/local.env\`, \`a/b/c.env\`
|
|
718
|
+
- Uses \`minimatch\` glob semantics
|
|
719
|
+
|
|
720
|
+
| Tool | \`*\` matches \`/\`? | Semantics | Example |
|
|
721
|
+
| :--- | :--- | :--- | :--- |
|
|
722
|
+
| \`Bash(...)\` | Yes | Regex \`.*\` | \`Bash(npm *)\` → any npm command |
|
|
723
|
+
| \`Read(...)\` | No | Glob (use \`**\`) | \`Read(**/*.env)\` → any depth \`.env\` |
|
|
724
|
+
| \`Write(...)\` | No | Glob (use \`**\`) | \`Write(src/**/*.ts)\` → any \`.ts\` in src |
|
|
725
|
+
| \`Edit(...)\` | No | Glob (use \`**\`) | \`Edit(**/*.json)\` → any \`.json\` |
|
|
726
|
+
|
|
727
|
+
## Managing Permissions via CLI
|
|
728
|
+
|
|
729
|
+
You can also manage permissions directly through the Wave interface:
|
|
730
|
+
- When Wave asks for permission, you can select "Always allow" to add a rule to your \`settings.local.json\`.
|
|
731
|
+
- You can ask Wave to "Update my permission mode to acceptEdits".
|
|
732
|
+
`,
|
|
733
|
+
"skills/settings/PLUGINS.md": `# Wave Plugins & Plugin Marketplaces
|
|
734
|
+
|
|
735
|
+
This guide covers creating plugins, publishing plugin marketplaces, and installing plugins from marketplaces.
|
|
736
|
+
|
|
737
|
+
## Plugins
|
|
738
|
+
|
|
739
|
+
Plugins bundle skills, hooks, MCP servers, LSP servers, and slash commands into a reusable package.
|
|
740
|
+
|
|
741
|
+
### Creating a Plugin
|
|
742
|
+
|
|
743
|
+
A plugin is any directory containing a \`.wave-plugin/plugin.json\` manifest:
|
|
744
|
+
|
|
745
|
+
\`\`\`json
|
|
746
|
+
{
|
|
747
|
+
"name": "my-plugin",
|
|
748
|
+
"description": "A plugin that adds code review capabilities",
|
|
749
|
+
"version": "1.0.0",
|
|
750
|
+
"author": {
|
|
751
|
+
"name": "Your Name"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
\`\`\`
|
|
755
|
+
|
|
756
|
+
Plugin name must match \`^[a-z0-9-]+$\` (lowercase letters, numbers, hyphens only).
|
|
757
|
+
|
|
758
|
+
Place resources in standard directories within the plugin:
|
|
759
|
+
|
|
760
|
+
| Directory / File | Purpose |
|
|
761
|
+
|-----------------|---------|
|
|
762
|
+
| \`skills/\` | Skill directories, each containing a \`SKILL.md\` file |
|
|
763
|
+
| \`commands/\` | Custom slash command definitions |
|
|
764
|
+
| \`hooks/hooks.json\` | Hook configuration |
|
|
765
|
+
| \`.lsp.json\` | LSP server configuration |
|
|
766
|
+
| \`.mcp.json\` | MCP server configuration |
|
|
767
|
+
|
|
768
|
+
Only \`plugin.json\` should exist in \`.wave-plugin/\` — any other files there will cause a validation error.
|
|
769
|
+
|
|
770
|
+
### Installing a Plugin Locally
|
|
771
|
+
|
|
772
|
+
Add a plugin directly in \`settings.json\`:
|
|
773
|
+
|
|
774
|
+
\`\`\`json
|
|
775
|
+
{
|
|
776
|
+
"plugins": [
|
|
777
|
+
{
|
|
778
|
+
"type": "local",
|
|
779
|
+
"path": "/path/to/my-plugin"
|
|
780
|
+
}
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
\`\`\`
|
|
784
|
+
|
|
785
|
+
### \`\${WAVE_PLUGIN_ROOT}\` Placeholder
|
|
786
|
+
|
|
787
|
+
Plugin skills, hooks, MCP servers, and LSP servers can reference their parent plugin's directory using \`\${WAVE_PLUGIN_ROOT}\`. Wave substitutes this placeholder with the plugin's absolute directory path at load time, and also injects \`WAVE_PLUGIN_ROOT\` as an environment variable into spawned processes.
|
|
788
|
+
|
|
789
|
+
Example hook command:
|
|
790
|
+
\`\`\`json
|
|
791
|
+
{
|
|
792
|
+
"hooks": {
|
|
793
|
+
"SessionStart": [
|
|
794
|
+
{
|
|
795
|
+
"hooks": [
|
|
796
|
+
{
|
|
797
|
+
"type": "command",
|
|
798
|
+
"command": "\\"\${WAVE_PLUGIN_ROOT}/hooks/session-start\\"",
|
|
799
|
+
"async": false
|
|
800
|
+
}
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
]
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
\`\`\`
|
|
807
|
+
|
|
808
|
+
## Plugin Marketplaces
|
|
809
|
+
|
|
810
|
+
A plugin marketplace is a git repository containing a \`.wave-plugin/marketplace.json\` that lists available plugins.
|
|
811
|
+
|
|
812
|
+
### Marketplace Manifest
|
|
813
|
+
|
|
814
|
+
\`\`\`json
|
|
815
|
+
{
|
|
816
|
+
"name": "my-plugins",
|
|
817
|
+
"owner": {
|
|
818
|
+
"name": "Your Name"
|
|
819
|
+
},
|
|
820
|
+
"plugins": [
|
|
821
|
+
{
|
|
822
|
+
"name": "review-plugin",
|
|
823
|
+
"description": "Adds a /review command for code reviews",
|
|
824
|
+
"source": "./plugins/review-plugin"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"name": "remote-plugin",
|
|
828
|
+
"description": "Plugin hosted on a remote git repo",
|
|
829
|
+
"source": "https://github.com/user/remote-plugin.git"
|
|
830
|
+
}
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
\`\`\`
|
|
834
|
+
|
|
835
|
+
- \`source\` can be a **relative path** (resolved from the marketplace repo root) or a **git URL** (\`https://\`, \`git@\`, \`ssh://\`) for remote repos.
|
|
836
|
+
- Each plugin at its source path must have its own \`.wave-plugin/plugin.json\` manifest.
|
|
837
|
+
|
|
838
|
+
### Registering a Marketplace
|
|
839
|
+
|
|
840
|
+
Add a marketplace in \`settings.json\`:
|
|
841
|
+
|
|
842
|
+
\`\`\`json
|
|
843
|
+
{
|
|
844
|
+
"marketplaces": {
|
|
845
|
+
"my-plugins": {
|
|
846
|
+
"source": {
|
|
847
|
+
"source": "github",
|
|
848
|
+
"repo": "user/my-plugins"
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
\`\`\`
|
|
854
|
+
|
|
855
|
+
**Source types:**
|
|
856
|
+
|
|
857
|
+
| Type | Format | Example |
|
|
858
|
+
|------|--------|---------|
|
|
859
|
+
| GitHub | \`{ "source": "github", "repo": "owner/repo", "ref": "branch" }\` | Clones from \`github.com/owner/repo\` |
|
|
860
|
+
| Git URL | \`{ "source": "git", "url": "https://...", "ref": "branch" }\` | Clones from any git remote |
|
|
861
|
+
| Directory | \`{ "source": "directory", "path": "/local/path" }\` | Uses a local directory |
|
|
862
|
+
|
|
863
|
+
### Installing from a Marketplace
|
|
864
|
+
|
|
865
|
+
Install a plugin using the format \`plugin-name@marketplace-name\`:
|
|
866
|
+
|
|
867
|
+
\`\`\`
|
|
868
|
+
/install-plugin my-plugin@my-plugins
|
|
869
|
+
\`\`\`
|
|
870
|
+
|
|
871
|
+
Wave clones the marketplace repo, reads the manifest, and copies the plugin to its cache directory.
|
|
872
|
+
|
|
873
|
+
### Creating a Plugin Marketplace
|
|
874
|
+
|
|
875
|
+
1. Create a git repository
|
|
876
|
+
2. Add \`.wave-plugin/marketplace.json\` at the root
|
|
877
|
+
3. Add plugin directories with their own \`.wave-plugin/plugin.json\`
|
|
878
|
+
4. Register the marketplace in your \`settings.json\` using a github, git, or directory source
|
|
879
|
+
5. Plugins are cloned to the cache directory on install
|
|
880
|
+
|
|
881
|
+
### Updating Plugins
|
|
882
|
+
|
|
883
|
+
Marketplaces with \`autoUpdate: true\` are checked for updates on startup:
|
|
884
|
+
|
|
885
|
+
\`\`\`json
|
|
886
|
+
{
|
|
887
|
+
"marketplaces": {
|
|
888
|
+
"my-plugins": {
|
|
889
|
+
"source": { "source": "github", "repo": "user/my-plugins" },
|
|
890
|
+
"autoUpdate": true
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
\`\`\`
|
|
895
|
+
|
|
896
|
+
### Marketplace Scopes
|
|
897
|
+
|
|
898
|
+
Marketplace declarations can be scoped:
|
|
899
|
+
- **User scope**: \`~/.wave/settings.json\` — available in all projects
|
|
900
|
+
- **Project scope**: \`.wave/settings.json\` — available in this project only
|
|
901
|
+
- **Local scope**: \`.wave/settings.local.json\` — not committed to git
|
|
902
|
+
|
|
903
|
+
Later scopes override earlier ones (local > project > user).
|
|
904
|
+
`,
|
|
905
|
+
"skills/settings/SKILL.md": `---
|
|
906
|
+
name: settings
|
|
907
|
+
description: Manage Wave settings and get guidance on settings.json, hooks, environment variables, permissions, MCP servers, memory, skills, subagents, plugins, and plugin marketplaces. Use this when the user wants to view, update, or learn how to configure Wave.
|
|
908
|
+
---
|
|
909
|
+
|
|
910
|
+
# Wave Settings Skill
|
|
911
|
+
|
|
912
|
+
This skill helps you manage your Wave configuration and provides guidance on how to use \`settings.json\`.
|
|
913
|
+
|
|
914
|
+
## What is \`settings.json\`?
|
|
915
|
+
|
|
916
|
+
\`settings.json\` is the central configuration file for Wave. It allows you to customize hooks, environment variables, tool permissions, and more.
|
|
917
|
+
|
|
918
|
+
### Live Reload
|
|
919
|
+
|
|
920
|
+
Changes to \`settings.json\` take effect immediately without restarting Wave. When you modify any setting, the new configuration is applied to subsequent operations automatically.
|
|
921
|
+
|
|
922
|
+
Wave looks for \`settings.json\` in three scopes:
|
|
923
|
+
1. **User Scope**: Global settings for all projects. Located at \`~/.wave/settings.json\`.
|
|
924
|
+
2. **Project Scope**: Settings specific to the current project. Located at \`.wave/settings.json\` in your project root.
|
|
925
|
+
3. **Local Scope**: Local overrides for the current project (not committed to git). Located at \`.wave/settings.local.json\`.
|
|
926
|
+
|
|
927
|
+
## Common Settings
|
|
928
|
+
|
|
929
|
+
### 1. Hooks
|
|
930
|
+
Hooks allow you to automate tasks when certain events occur (e.g., \`PreToolUse\`, \`PostToolUse\`, \`SessionStart\`, \`SessionEnd\`).
|
|
931
|
+
For detailed hook configuration, see [HOOKS.md](\${WAVE_SKILL_DIR}/HOOKS.md).
|
|
932
|
+
|
|
933
|
+
### 2. Environment Variables
|
|
934
|
+
Set environment variables that will be available to all tools and hooks. Common \`WAVE_*\` variables include:
|
|
935
|
+
- \`WAVE_MODEL\`, \`WAVE_FAST_MODEL\`: Model selection
|
|
936
|
+
- \`WAVE_MAX_INPUT_TOKENS\`, \`WAVE_MAX_OUTPUT_TOKENS\`: Token limits
|
|
937
|
+
- \`WAVE_API_KEY\`, \`WAVE_BASE_URL\`: API configuration
|
|
938
|
+
|
|
939
|
+
For detailed configuration, see [ENV.md](\${WAVE_SKILL_DIR}/ENV.md).
|
|
940
|
+
\`\`\`json
|
|
941
|
+
{
|
|
942
|
+
"env": {
|
|
943
|
+
"NODE_ENV": "development",
|
|
944
|
+
"API_KEY": "your-api-key"
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
\`\`\`
|
|
948
|
+
|
|
949
|
+
### 3. Permissions
|
|
950
|
+
Manage tool permissions and define the "Safe Zone". Changes to permissions take effect immediately with live reload.
|
|
951
|
+
For detailed permission configuration and available permission modes, see [PERMISSIONS.md](\${WAVE_SKILL_DIR}/PERMISSIONS.md).
|
|
952
|
+
\`\`\`json
|
|
953
|
+
{
|
|
954
|
+
"permissions": {
|
|
955
|
+
"allow": ["Bash", "Read"],
|
|
956
|
+
"deny": ["Write"],
|
|
957
|
+
"permissionMode": "default",
|
|
958
|
+
"additionalDirectories": ["/tmp/wave-exports"]
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
\`\`\`
|
|
962
|
+
|
|
963
|
+
### 4. Model Configuration
|
|
964
|
+
Define which AI models Wave should use and set model-specific parameters like \`temperature\`, \`reasoning_effort\`, and \`thinking\`. You can also configure model selection and token limits via environment variables in the \`env\` field.
|
|
965
|
+
For detailed model configuration, see [MODELS.md](\${WAVE_SKILL_DIR}/MODELS.md).
|
|
966
|
+
\`\`\`json
|
|
967
|
+
{
|
|
968
|
+
"models": {
|
|
969
|
+
"claude-3-7-sonnet-20250219": {
|
|
970
|
+
"options": {
|
|
971
|
+
"thinking": {
|
|
972
|
+
"type": "enabled",
|
|
973
|
+
"budget_tokens": 1024
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
"o3-mini": {
|
|
978
|
+
"options": {
|
|
979
|
+
"reasoning_effort": "high"
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
\`\`\`
|
|
985
|
+
|
|
986
|
+
### 5. Model Context Protocol (MCP)
|
|
987
|
+
Connect to external servers to provide additional tools and context.
|
|
988
|
+
For detailed MCP configuration, see [MCP.md](\${WAVE_SKILL_DIR}/MCP.md).
|
|
989
|
+
|
|
990
|
+
### 6. Memory
|
|
991
|
+
Provide context-specific instructions and knowledge to the agent through user memory, project memory, memory rules, and auto-memory.
|
|
992
|
+
For detailed memory configuration, see [MEMORY.md](\${WAVE_SKILL_DIR}/MEMORY.md).
|
|
993
|
+
|
|
994
|
+
### 7. Skills
|
|
995
|
+
Extend Wave's functionality by creating custom skills.
|
|
996
|
+
For detailed guidance on creating skills, see [SKILLS.md](\${WAVE_SKILL_DIR}/SKILLS.md).
|
|
997
|
+
|
|
998
|
+
### 8. Subagents
|
|
999
|
+
Delegate tasks to specialized AI personalities.
|
|
1000
|
+
For detailed guidance on creating subagents, see [SUBAGENTS.md](\${WAVE_SKILL_DIR}/SUBAGENTS.md).
|
|
1001
|
+
|
|
1002
|
+
### 9. Plugins
|
|
1003
|
+
|
|
1004
|
+
Plugins bundle skills, hooks, MCP servers, LSP servers, commands, and subagents into a reusable package. You can install plugins locally or from a marketplace.
|
|
1005
|
+
For detailed guidance on creating plugins and marketplaces, see [PLUGINS.md](\${WAVE_SKILL_DIR}/PLUGINS.md).
|
|
1006
|
+
|
|
1007
|
+
### 10. Other Settings
|
|
1008
|
+
- \`language\`: Preferred language for agent communication (e.g., \`"en"\`, \`"zh"\`).
|
|
1009
|
+
- \`autoMemoryEnabled\`: Enable or disable auto-memory (default: \`true\`).
|
|
1010
|
+
- \`autoMemoryFrequency\`: Frequency of auto-memory extraction turns (default: \`1\`).
|
|
1011
|
+
- \`enableArtifact\`: Enable the Artifact tool, which publishes local \`.html\`/\`.md\` files as shareable (default-private) web pages. Defaults to \`false\` while the frame backend is not live; set to \`true\` to register the tool and enable WebFetch interception for artifact URLs. Toggling it hot-reloads the tool registry.
|
|
1012
|
+
|
|
1013
|
+
\`\`\`json
|
|
1014
|
+
{
|
|
1015
|
+
"enableArtifact": true
|
|
1016
|
+
}
|
|
1017
|
+
\`\`\`
|
|
1018
|
+
|
|
1019
|
+
## How to use this skill
|
|
1020
|
+
|
|
1021
|
+
You can ask me to:
|
|
1022
|
+
- "Show my current settings"
|
|
1023
|
+
- "Update my project settings to enable auto-memory"
|
|
1024
|
+
- "How do I configure a post-commit hook?"
|
|
1025
|
+
- "What are the available permission modes?"
|
|
1026
|
+
- "Update my permission mode to acceptEdits"
|
|
1027
|
+
- "How do I extend the Safe Zone for permissions?"
|
|
1028
|
+
- "How do I create a custom skill?"
|
|
1029
|
+
- "How do I define a new subagent?"
|
|
1030
|
+
- "How do I set max input tokens?"
|
|
1031
|
+
- "How do I change the model?"
|
|
1032
|
+
- "How do I create a Wave plugin?"
|
|
1033
|
+
- "How do I set up a plugin marketplace?"
|
|
1034
|
+
- "How do I install a plugin from a marketplace?"
|
|
1035
|
+
|
|
1036
|
+
I will guide you through the process and ensure your configuration is valid.
|
|
1037
|
+
`,
|
|
1038
|
+
"skills/settings/SKILLS.md": `# Creating and Managing Wave Skills
|
|
1039
|
+
|
|
1040
|
+
Skills are discoverable capabilities that extend Wave's functionality. They allow you to package instructions, tools, and scripts into reusable modules.
|
|
1041
|
+
|
|
1042
|
+
## Skill Structure
|
|
1043
|
+
|
|
1044
|
+
A skill is a directory containing a \`SKILL.md\` file.
|
|
1045
|
+
|
|
1046
|
+
\`\`\`text
|
|
1047
|
+
my-skill/
|
|
1048
|
+
├── SKILL.md # Main skill definition (required)
|
|
1049
|
+
├── reference.md # Supporting documentation (optional)
|
|
1050
|
+
├── scripts/ # Custom scripts (optional)
|
|
1051
|
+
└── templates/ # Code templates (optional)
|
|
1052
|
+
\`\`\`
|
|
1053
|
+
|
|
1054
|
+
## The \`SKILL.md\` File
|
|
1055
|
+
|
|
1056
|
+
The \`SKILL.md\` file uses YAML frontmatter for configuration and Markdown for instructions. When \`context: fork\` is used, the Markdown body is passed as the initial prompt to the subagent.
|
|
1057
|
+
|
|
1058
|
+
\`\`\`markdown
|
|
1059
|
+
---
|
|
1060
|
+
name: my-skill
|
|
1061
|
+
description: A brief description of what the skill does.
|
|
1062
|
+
context: fork
|
|
1063
|
+
allowed-tools:
|
|
1064
|
+
- Bash
|
|
1065
|
+
- Read
|
|
1066
|
+
---
|
|
1067
|
+
|
|
1068
|
+
# My Skill Instructions
|
|
1069
|
+
|
|
1070
|
+
When this skill is invoked, follow these steps:
|
|
1071
|
+
1. Use the \`Read\` tool to examine the project structure.
|
|
1072
|
+
2. Use the \`Bash\` tool to run \`npm test\`.
|
|
1073
|
+
\`\`\`
|
|
1074
|
+
|
|
1075
|
+
### YAML Frontmatter Fields
|
|
1076
|
+
|
|
1077
|
+
- \`name\`: (Required) Unique identifier (lowercase, numbers, hyphens).
|
|
1078
|
+
- \`description\`: (Required) Explains when the AI should use this skill.
|
|
1079
|
+
- \`allowed-tools\`: (Optional) List of tools the skill can use.
|
|
1080
|
+
- \`context: fork\`: (Optional) Run the skill in a separate subagent.
|
|
1081
|
+
- \`agent\`: (Optional) Specify the subagent type (default: \`general-purpose\`).
|
|
1082
|
+
- \`disable-model-invocation\`: (Optional, default: \`false\`) Set to \`true\` to hide the skill from the AI's available skills list. The skill can still be invoked by users via slash commands.
|
|
1083
|
+
- \`user-invocable\`: (Optional, default: \`true\`) Set to \`false\` to hide the skill from the \`/\` slash command menu. The AI can still invoke it unless \`disable-model-invocation\` is also set.
|
|
1084
|
+
- \`model\`: (Optional) Override the AI model used for skill execution (e.g., \`"gpt-4o"\`, \`"o3-mini"\`).
|
|
1085
|
+
|
|
1086
|
+
## Skill Locations
|
|
1087
|
+
|
|
1088
|
+
Wave looks for skills in multiple locations, with later sources overriding earlier ones for same-named skills:
|
|
1089
|
+
|
|
1090
|
+
1. **User Skills**: \`~/.agents/skills/\` → \`~/.claude/skills/\` → \`~/.wave/skills/\` (Available in all projects)
|
|
1091
|
+
2. **Project Skills**: \`.agents/skills/\` → \`.claude/skills/\` → \`.wave/skills/\` (Specific to the current project)
|
|
1092
|
+
|
|
1093
|
+
The \`.agents/skills\` directory is the cross-tool standard adopted by Codex, Cursor, Cline, Gemini CLI, GitHub Copilot, and OpenCode, so a single skill directory can be shared across all your AI tools.
|
|
1094
|
+
|
|
1095
|
+
Project skills take precedence over user skills with the same name. Within each level, \`.wave\` overrides \`.claude\`, which overrides \`.agents\`.
|
|
1096
|
+
|
|
1097
|
+
## Invoking Skills
|
|
1098
|
+
|
|
1099
|
+
- **AI-Invoked**: The agent automatically discovers and uses skills based on their \`description\`.
|
|
1100
|
+
- **User-Invoked**: Use slash commands in the CLI (e.g., \`/my-skill\`).
|
|
1101
|
+
|
|
1102
|
+
## Bash Command Substitution
|
|
1103
|
+
|
|
1104
|
+
You can embed shell commands in skill content using two syntaxes. Commands are executed and their output is inserted inline when the skill is invoked.
|
|
1105
|
+
|
|
1106
|
+
### Inline Syntax
|
|
1107
|
+
|
|
1108
|
+
Use \`!\`command\`\` for single-line commands:
|
|
1109
|
+
|
|
1110
|
+
\`\`\`markdown
|
|
1111
|
+
Current git status: !\`git status --short\`
|
|
1112
|
+
\`\`\`
|
|
1113
|
+
|
|
1114
|
+
### Block Syntax
|
|
1115
|
+
|
|
1116
|
+
Use \` \`\`\`! \` code blocks for multi-line commands:
|
|
1117
|
+
|
|
1118
|
+
\`\`\`markdown
|
|
1119
|
+
\`\`\`!
|
|
1120
|
+
git log --oneline -10
|
|
1121
|
+
\`\`\`
|
|
1122
|
+
\`\`\`
|
|
1123
|
+
|
|
1124
|
+
Blocks are processed before inline commands, with results replaced in order of appearance.
|
|
1125
|
+
|
|
1126
|
+
### Output Limits
|
|
1127
|
+
|
|
1128
|
+
- Output is capped at **30,000 characters** per command.
|
|
1129
|
+
- When truncated, a 2,048-character preview is shown along with a temp file path containing the full output.
|
|
1130
|
+
|
|
1131
|
+
### Safe Replacement
|
|
1132
|
+
|
|
1133
|
+
Shell output containing special strings like \`$$\`, \`$&\`, \`$'\` is replaced safely without corruption.
|
|
1134
|
+
|
|
1135
|
+
### Empty Commands
|
|
1136
|
+
|
|
1137
|
+
Empty or whitespace-only commands are silently skipped.
|
|
1138
|
+
|
|
1139
|
+
## Best Practices
|
|
1140
|
+
|
|
1141
|
+
- **Clear Descriptions**: Write descriptions that help the AI understand exactly when the skill is relevant.
|
|
1142
|
+
- **Modular Design**: Keep skills focused on a single task or capability.
|
|
1143
|
+
- **Use \`\${WAVE_SKILL_DIR}\`**: Use this placeholder to reference files within the skill directory.
|
|
1144
|
+
- **Bash Commands**: Use \`!\`command\`\` for inline output or \` \`\`\`! \` blocks for multi-line commands. Keep outputs concise.
|
|
1145
|
+
`,
|
|
1146
|
+
"skills/settings/SUBAGENTS.md": `# Creating and Managing Wave Subagents
|
|
1147
|
+
|
|
1148
|
+
Subagents are specialized AI personalities that Wave can delegate tasks to. They have their own context windows, expertise areas, and tool configurations.
|
|
1149
|
+
|
|
1150
|
+
## Subagent Structure
|
|
1151
|
+
|
|
1152
|
+
A subagent is defined by a Markdown file with YAML frontmatter.
|
|
1153
|
+
|
|
1154
|
+
\`\`\`text
|
|
1155
|
+
.wave/agents/
|
|
1156
|
+
└── my-subagent.md # Subagent definition
|
|
1157
|
+
\`\`\`
|
|
1158
|
+
|
|
1159
|
+
## The \`subagent.md\` File
|
|
1160
|
+
|
|
1161
|
+
The \`subagent.md\` file uses YAML frontmatter for configuration and Markdown for the system prompt. The Markdown content (excluding frontmatter) is passed directly as the system prompt to the subagent. Avoid using top-level Markdown headers (like \`# My Subagent\`) unless you want them to be part of the system prompt.
|
|
1162
|
+
|
|
1163
|
+
\`\`\`markdown
|
|
1164
|
+
---
|
|
1165
|
+
name: my-subagent
|
|
1166
|
+
description: A specialized subagent for a specific task.
|
|
1167
|
+
tools:
|
|
1168
|
+
- Bash
|
|
1169
|
+
- Read
|
|
1170
|
+
model: gemini-3-flash
|
|
1171
|
+
---
|
|
1172
|
+
|
|
1173
|
+
You are a specialized subagent for a specific task. Your goal is to:
|
|
1174
|
+
1. Use the \`Read\` tool to examine the project structure.
|
|
1175
|
+
2. Use the \`Bash\` tool to run \`npm test\`.
|
|
1176
|
+
\`\`\`
|
|
1177
|
+
|
|
1178
|
+
### YAML Frontmatter Fields
|
|
1179
|
+
|
|
1180
|
+
- \`name\`: (Required) Unique identifier.
|
|
1181
|
+
- \`description\`: (Required) Explains the subagent's expertise and when to use it.
|
|
1182
|
+
- \`tools\`: (Optional) List of tools the subagent can use.
|
|
1183
|
+
- \`model\`: (Optional) Overrides the default model for this subagent. The special values \`fastModel\` and \`visionModel\` resolve to the \`WAVE_FAST_MODEL\` / \`WAVE_VISION_MODEL\` env vars respectively. Built-in subagents declaring \`model: visionModel\` (e.g. the built-in \`vision\` agent) are only registered when \`WAVE_VISION_MODEL\` is set; for user-defined subagents the value simply resolves to the configured vision model.
|
|
1184
|
+
|
|
1185
|
+
## Subagent Locations
|
|
1186
|
+
|
|
1187
|
+
Wave looks for subagents in three locations:
|
|
1188
|
+
|
|
1189
|
+
1. **User Subagents**: \`~/.wave/agents/\` (Available in all projects)
|
|
1190
|
+
2. **Project Subagents**: \`.wave/agents/\` (Specific to the current project)
|
|
1191
|
+
3. **Plugin Agents**: \`agents/\` within an installed plugin directory (Scoped to the plugin)
|
|
1192
|
+
|
|
1193
|
+
Project subagents take precedence over user subagents with the same name. Plugin agents are namespaced with the plugin name (e.g., \`pluginName:agentName\`) to avoid collisions.
|
|
1194
|
+
|
|
1195
|
+
## Plugin Agents
|
|
1196
|
+
|
|
1197
|
+
Plugins can define their own subagents in an \`agents/\` directory within the plugin. These agents can reference their parent plugin's directory using the \`\${WAVE_PLUGIN_ROOT}\` template variable, which is substituted at load time.
|
|
1198
|
+
|
|
1199
|
+
For example, a plugin at \`/path/to/my-plugin/\` with \`agents/researcher.md\`:
|
|
1200
|
+
|
|
1201
|
+
\`\`\`markdown
|
|
1202
|
+
---
|
|
1203
|
+
name: researcher
|
|
1204
|
+
description: A research agent that uses the plugin's knowledge base
|
|
1205
|
+
tools: ["Read", "Glob"]
|
|
1206
|
+
---
|
|
1207
|
+
|
|
1208
|
+
You are a research assistant. Access plugin resources at \${WAVE_PLUGIN_ROOT}/data.
|
|
1209
|
+
\`\`\`
|
|
1210
|
+
|
|
1211
|
+
After loading, \`\${WAVE_PLUGIN_ROOT}\` is replaced with \`/path/to/my-plugin/\`, and the agent is registered as \`my-plugin:researcher\`.
|
|
1212
|
+
|
|
1213
|
+
## Delegating to Subagents
|
|
1214
|
+
|
|
1215
|
+
- **Automatic Delegation**: Wave automatically recognizes when a task matches a subagent's expertise and delegates to it.
|
|
1216
|
+
- **Explicit Delegation**: You can explicitly request a specific subagent for a task.
|
|
1217
|
+
|
|
1218
|
+
## Best Practices
|
|
1219
|
+
|
|
1220
|
+
- **Focused Expertise**: Define subagents with clear, specific roles (e.g., "Testing Expert", "Refactoring Specialist").
|
|
1221
|
+
- **Detailed System Prompts**: Provide clear instructions and guidelines in the system prompt to ensure consistent behavior.
|
|
1222
|
+
- **Tool Selection**: Only provide the tools that are necessary for the subagent's role.
|
|
1223
|
+
`,
|
|
1224
|
+
};
|