wave-agent-sdk 0.10.4 → 0.11.1

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.
Files changed (155) hide show
  1. package/builtin/skills/init/SKILL.md +26 -0
  2. package/builtin/skills/loop/SKILL.md +53 -0
  3. package/builtin/skills/settings/ENV.md +64 -0
  4. package/builtin/skills/settings/HOOKS.md +94 -0
  5. package/builtin/skills/settings/MCP.md +55 -0
  6. package/builtin/skills/settings/MEMORY_RULES.md +60 -0
  7. package/{dist/builtin-skills → builtin/skills}/settings/SKILL.md +23 -16
  8. package/builtin/skills/settings/SKILLS.md +63 -0
  9. package/builtin/skills/settings/SUBAGENTS.md +60 -0
  10. package/builtin/subagents/bash.md +18 -0
  11. package/builtin/subagents/explore.md +42 -0
  12. package/builtin/subagents/general-purpose.md +20 -0
  13. package/builtin/subagents/plan.md +55 -0
  14. package/dist/agent.d.ts +8 -6
  15. package/dist/agent.d.ts.map +1 -1
  16. package/dist/agent.js +12 -9
  17. package/dist/constants/tools.d.ts +3 -0
  18. package/dist/constants/tools.d.ts.map +1 -1
  19. package/dist/constants/tools.js +3 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1 -0
  23. package/dist/managers/aiManager.d.ts +0 -2
  24. package/dist/managers/aiManager.d.ts.map +1 -1
  25. package/dist/managers/aiManager.js +53 -14
  26. package/dist/managers/cronManager.d.ts +19 -0
  27. package/dist/managers/cronManager.d.ts.map +1 -0
  28. package/dist/managers/cronManager.js +124 -0
  29. package/dist/managers/hookManager.d.ts.map +1 -1
  30. package/dist/managers/hookManager.js +21 -13
  31. package/dist/managers/liveConfigManager.js +1 -1
  32. package/dist/managers/mcpManager.d.ts +1 -1
  33. package/dist/managers/mcpManager.d.ts.map +1 -1
  34. package/dist/managers/mcpManager.js +10 -2
  35. package/dist/managers/messageManager.d.ts +0 -1
  36. package/dist/managers/messageManager.d.ts.map +1 -1
  37. package/dist/managers/permissionManager.d.ts +27 -7
  38. package/dist/managers/permissionManager.d.ts.map +1 -1
  39. package/dist/managers/permissionManager.js +119 -14
  40. package/dist/managers/slashCommandManager.d.ts.map +1 -1
  41. package/dist/managers/slashCommandManager.js +7 -12
  42. package/dist/managers/subagentManager.d.ts +3 -0
  43. package/dist/managers/subagentManager.d.ts.map +1 -1
  44. package/dist/managers/subagentManager.js +10 -17
  45. package/dist/managers/toolManager.d.ts +1 -1
  46. package/dist/managers/toolManager.d.ts.map +1 -1
  47. package/dist/managers/toolManager.js +28 -4
  48. package/dist/prompts/index.d.ts +0 -5
  49. package/dist/prompts/index.d.ts.map +1 -1
  50. package/dist/prompts/index.js +1 -136
  51. package/dist/services/configurationService.d.ts.map +1 -1
  52. package/dist/services/configurationService.js +8 -7
  53. package/dist/services/hook.d.ts.map +1 -1
  54. package/dist/services/hook.js +3 -10
  55. package/dist/services/initializationService.js +2 -2
  56. package/dist/services/jsonlHandler.d.ts.map +1 -1
  57. package/dist/services/jsonlHandler.js +3 -0
  58. package/dist/services/reversionService.d.ts +2 -2
  59. package/dist/services/reversionService.d.ts.map +1 -1
  60. package/dist/services/reversionService.js +3 -3
  61. package/dist/services/session.d.ts.map +1 -1
  62. package/dist/services/session.js +18 -11
  63. package/dist/tools/agentTool.js +1 -1
  64. package/dist/tools/bashTool.d.ts.map +1 -1
  65. package/dist/tools/bashTool.js +5 -5
  66. package/dist/tools/cronCreateTool.d.ts +3 -0
  67. package/dist/tools/cronCreateTool.d.ts.map +1 -0
  68. package/dist/tools/cronCreateTool.js +59 -0
  69. package/dist/tools/cronDeleteTool.d.ts +3 -0
  70. package/dist/tools/cronDeleteTool.d.ts.map +1 -0
  71. package/dist/tools/cronDeleteTool.js +38 -0
  72. package/dist/tools/cronListTool.d.ts +3 -0
  73. package/dist/tools/cronListTool.d.ts.map +1 -0
  74. package/dist/tools/cronListTool.js +30 -0
  75. package/dist/tools/skillTool.d.ts +0 -3
  76. package/dist/tools/skillTool.d.ts.map +1 -1
  77. package/dist/tools/skillTool.js +4 -3
  78. package/dist/tools/taskOutputTool.d.ts.map +1 -1
  79. package/dist/tools/taskOutputTool.js +15 -8
  80. package/dist/tools/types.d.ts +2 -0
  81. package/dist/tools/types.d.ts.map +1 -1
  82. package/dist/types/agent.d.ts +10 -0
  83. package/dist/types/agent.d.ts.map +1 -1
  84. package/dist/types/configuration.d.ts +1 -1
  85. package/dist/types/configuration.d.ts.map +1 -1
  86. package/dist/types/cron.d.ts +10 -0
  87. package/dist/types/cron.d.ts.map +1 -0
  88. package/dist/types/cron.js +1 -0
  89. package/dist/types/hooks.d.ts +1 -5
  90. package/dist/types/hooks.d.ts.map +1 -1
  91. package/dist/types/hooks.js +1 -1
  92. package/dist/types/index.d.ts +1 -0
  93. package/dist/types/index.d.ts.map +1 -1
  94. package/dist/types/index.js +1 -0
  95. package/dist/types/messaging.d.ts +1 -1
  96. package/dist/types/messaging.d.ts.map +1 -1
  97. package/dist/utils/configPaths.d.ts +4 -0
  98. package/dist/utils/configPaths.d.ts.map +1 -1
  99. package/dist/utils/configPaths.js +11 -9
  100. package/dist/utils/containerSetup.d.ts.map +1 -1
  101. package/dist/utils/containerSetup.js +40 -13
  102. package/dist/utils/fileSearch.d.ts.map +1 -1
  103. package/dist/utils/fileSearch.js +7 -1
  104. package/dist/utils/mcpUtils.d.ts +2 -2
  105. package/dist/utils/mcpUtils.d.ts.map +1 -1
  106. package/dist/utils/mcpUtils.js +1 -5
  107. package/dist/utils/subagentParser.d.ts.map +1 -1
  108. package/dist/utils/subagentParser.js +14 -4
  109. package/package.json +4 -2
  110. package/src/agent.ts +17 -12
  111. package/src/constants/tools.ts +3 -0
  112. package/src/index.ts +1 -0
  113. package/src/managers/aiManager.ts +72 -24
  114. package/src/managers/cronManager.ts +167 -0
  115. package/src/managers/hookManager.ts +27 -13
  116. package/src/managers/liveConfigManager.ts +2 -2
  117. package/src/managers/mcpManager.ts +23 -2
  118. package/src/managers/messageManager.ts +0 -6
  119. package/src/managers/permissionManager.ts +154 -18
  120. package/src/managers/slashCommandManager.ts +7 -14
  121. package/src/managers/subagentManager.ts +15 -19
  122. package/src/managers/toolManager.ts +37 -4
  123. package/src/prompts/index.ts +0 -144
  124. package/src/services/configurationService.ts +8 -7
  125. package/src/services/hook.ts +5 -11
  126. package/src/services/initializationService.ts +3 -3
  127. package/src/services/jsonlHandler.ts +4 -0
  128. package/src/services/reversionService.ts +9 -4
  129. package/src/services/session.ts +19 -12
  130. package/src/tools/agentTool.ts +1 -1
  131. package/src/tools/bashTool.ts +6 -5
  132. package/src/tools/cronCreateTool.ts +73 -0
  133. package/src/tools/cronDeleteTool.ts +47 -0
  134. package/src/tools/cronListTool.ts +38 -0
  135. package/src/tools/skillTool.ts +6 -4
  136. package/src/tools/taskOutputTool.ts +14 -8
  137. package/src/tools/types.ts +2 -0
  138. package/src/types/agent.ts +10 -0
  139. package/src/types/configuration.ts +1 -1
  140. package/src/types/cron.ts +9 -0
  141. package/src/types/hooks.ts +5 -9
  142. package/src/types/index.ts +1 -0
  143. package/src/types/messaging.ts +1 -1
  144. package/src/utils/configPaths.ts +12 -10
  145. package/src/utils/containerSetup.ts +50 -16
  146. package/src/utils/fileSearch.ts +7 -1
  147. package/src/utils/mcpUtils.ts +2 -5
  148. package/src/utils/subagentParser.ts +16 -6
  149. package/dist/builtin-skills/settings/HOOKS.md +0 -95
  150. package/dist/utils/builtinSubagents.d.ts +0 -7
  151. package/dist/utils/builtinSubagents.d.ts.map +0 -1
  152. package/dist/utils/builtinSubagents.js +0 -94
  153. package/src/builtin-skills/settings/HOOKS.md +0 -95
  154. package/src/builtin-skills/settings/SKILL.md +0 -86
  155. package/src/utils/builtinSubagents.ts +0 -122
@@ -0,0 +1,26 @@
1
+ ---
2
+ disable-model-invocation: true
3
+ ---
4
+
5
+ Please analyze this codebase and create a AGENTS.md file, which will be given to future instances of Agent to operate in this repository.
6
+
7
+ What to add:
8
+ 1. Commands that will be commonly used, such as how to build, lint, and run tests. Include the necessary commands to develop in this codebase, such as how to run a single test.
9
+ 2. High-level code architecture and structure so that future instances can be productive more quickly. Focus on the "big picture" architecture that requires reading multiple files to understand.
10
+
11
+ Usage notes:
12
+ - If there's already a AGENTS.md, suggest improvements to it.
13
+ - When you make the initial AGENTS.md, do not repeat yourself and do not include obvious instructions like "Provide helpful error messages to users", "Write unit tests for all new utilities", "Never include sensitive information (API keys, tokens) in code or commits".
14
+ - Avoid listing every component or file structure that can be easily discovered.
15
+ - Don't include generic development practices.
16
+ - If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include the important parts.
17
+ - Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.
18
+ - If there is a README.md, make sure to include the important parts.
19
+ - Do not make up information such as "Common Development Tasks", "Tips for Development", "Support and Documentation" unless this is expressly included in other files that you read.
20
+ - Be sure to prefix the file with the following text:
21
+
22
+ ```
23
+ # AGENTS.md
24
+
25
+ This file provides guidance to Agent when working with code in this repository.
26
+ ```
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: loop
3
+ description: Parses user input into an interval and prompt, converts the interval to a cron expression, and schedules a recurring task
4
+ allowed-tools: CronCreate, Skill
5
+ ---
6
+ # /loop — schedule a recurring prompt
7
+
8
+ Parse the input below into `[interval] <prompt…>` and schedule it with CronCreate.
9
+
10
+ ## Parsing (in priority order)
11
+
12
+ 1. **Leading token**: if the first whitespace-delimited token matches `^\d+[smhd]$` (e.g. `5m`, `2h`), that's the interval; the rest is the prompt.
13
+ 2. **Trailing "every" clause**: otherwise, if the input ends with `every <N><unit>` or `every <N> <unit-word>` (e.g. `every 20m`, `every 5 minutes`, `every 2 hours`), extract that as the interval and strip it from the prompt. Only match when what follows "every" is a time expression — `check every PR` has no interval.
14
+ 3. **Default**: otherwise, interval is `10m` and the entire input is the prompt.
15
+
16
+ If the resulting prompt is empty, show usage `/loop [interval] <prompt>` and stop — do not call CronCreate.
17
+
18
+ Examples:
19
+ - `5m /babysit-prs` → interval `5m`, prompt `/babysit-prs` (rule 1)
20
+ - `check the deploy every 20m` → interval `20m`, prompt `check the deploy` (rule 2)
21
+ - `run tests every 5 minutes` → interval `5m`, prompt `run tests` (rule 2)
22
+ - `check the deploy` → interval `10m`, prompt `check the deploy` (rule 3)
23
+ - `check every PR` → interval `10m`, prompt `check every PR` (rule 3 — "every" not followed by time)
24
+ - `5m` → empty prompt → show usage
25
+
26
+ ## Interval → cron
27
+
28
+ Supported suffixes: `s` (seconds, rounded up to nearest minute, min 1), `m` (minutes), `h` (hours), `d` (days). Convert:
29
+
30
+ | Interval pattern | Cron expression | Notes |
31
+ |-----------------------|---------------------|------------------------------------------|
32
+ | `Nm` where N ≤ 59 | `*/N * * * *` | every N minutes |
33
+ | `Nm` where N ≥ 60 | `0 */H * * *` | round to hours (H = N/60, must divide 24)|
34
+ | `Nh` where N ≤ 23 | `0 */N * * *` | every N hours |
35
+ | `Nd` | `0 0 */N * *` | every N days at midnight local |
36
+ | `Ns` | treat as `ceil(N/60)m` | cron minimum granularity is 1 minute |
37
+
38
+ **If the interval doesn't cleanly divide its unit** (e.g. `7m` → `*/7 * * * *` gives uneven gaps at :56→:00; `90m` → 1.5h which cron can't express), pick the nearest clean interval and tell the user what you rounded to before scheduling.
39
+
40
+ **Thundering herd prevention**: For approximate requests like "hourly" or "every morning", pick a random minute (e.g., 7) instead of 0 to avoid global sync issues.
41
+
42
+ ## Action
43
+
44
+ 1. Call CronCreate with:
45
+ - `cron`: the expression from the table above
46
+ - `prompt`: the parsed prompt from above, verbatim (slash commands are passed through unchanged)
47
+ - `recurring`: `true`
48
+ 2. Briefly confirm: what's scheduled, the cron expression, the human-readable cadence, that recurring tasks auto-expire after 7 days, and that they can cancel sooner with CronDelete (include the job ID).
49
+ 3. **Then immediately execute the parsed prompt now** — don't wait for the first cron fire. If it's a slash command, invoke it via the Skill tool; otherwise act on it directly.
50
+
51
+ ## Input
52
+
53
+ $ARGUMENTS
@@ -0,0 +1,64 @@
1
+ # Wave Environment Variables Configuration
2
+
3
+ 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`.
4
+
5
+ ## The `env` Field
6
+
7
+ Environment variables are configured in the `env` field of `settings.json`. It is a simple key-value pair of strings.
8
+
9
+ ```json
10
+ {
11
+ "env": {
12
+ "WAVE_MODEL": "gemini-3-flash",
13
+ "MY_CUSTOM_VAR": "some-value"
14
+ }
15
+ }
16
+ ```
17
+
18
+ ## Supported `WAVE_*` Environment Variables
19
+
20
+ Wave uses several environment variables to control its core functionality.
21
+
22
+ | Variable | Description | Default |
23
+ | :--- | :--- | :--- |
24
+ | `WAVE_API_KEY` | API key for the AI gateway. | - |
25
+ | `WAVE_BASE_URL` | Base URL for the AI gateway. | - |
26
+ | `WAVE_CUSTOM_HEADERS` | Custom HTTP headers for the AI gateway (JSON string). | - |
27
+ | `WAVE_MODEL` | The primary AI model to use for the agent. | `gemini-3-flash` |
28
+ | `WAVE_FAST_MODEL` | The fast AI model to use for quick tasks. | `gemini-2.5-flash` |
29
+ | `WAVE_MAX_INPUT_TOKENS` | Maximum number of input tokens allowed. | `96000` |
30
+ | `WAVE_MAX_OUTPUT_TOKENS` | Maximum number of output tokens allowed. | `8192` |
31
+ | `WAVE_DISABLE_AUTO_MEMORY` | Set to `1` or `true` to disable the auto-memory feature. | `false` |
32
+ | `WAVE_TASK_LIST_ID` | Explicitly set the task list ID for the session. | (Session ID) |
33
+
34
+ ## Configuration Scopes
35
+
36
+ Environment variables can be set in different scopes, with the following precedence (highest to lowest):
37
+
38
+ 1. **Local Scope**: `.wave/settings.local.json` (Local overrides, ignored by git)
39
+ 2. **Project Scope**: `.wave/settings.json` (Project-specific settings, shared via git)
40
+ 3. **User Scope**: `~/.wave/settings.json` (Global settings for all projects)
41
+ 4. **System Environment**: Variables set in your shell (e.g., `export WAVE_API_KEY=...`)
42
+
43
+ ## Custom Environment Variables
44
+
45
+ You can also define custom environment variables in the `env` field. These variables will be available to:
46
+
47
+ - **Hooks**: Any shell command executed as a hook will have these variables in its environment.
48
+ - **Tools**: Tools like `Bash` will have access to these variables.
49
+
50
+ Example:
51
+ ```json
52
+ {
53
+ "env": {
54
+ "PROJECT_NAME": "my-awesome-project",
55
+ "DEPLOY_TARGET": "staging"
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Best Practices
61
+
62
+ - **Use Local Overrides for Secrets**: Never commit sensitive information like `WAVE_API_KEY` to `settings.json`. Use `settings.local.json` instead.
63
+ - **Standard Naming**: Use uppercase and underscores for environment variable names (e.g., `MY_VARIABLE`).
64
+ - **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.
@@ -0,0 +1,94 @@
1
+ # Wave Hooks Configuration
2
+
3
+ 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`.
4
+
5
+ ## Hook Events
6
+
7
+ Wave supports the following hook events:
8
+
9
+ - `PreToolUse`: Triggered before a tool is executed.
10
+ - `PostToolUse`: Triggered after a tool has finished executing.
11
+ - `UserPromptSubmit`: Triggered when a user submits a prompt.
12
+ - `PermissionRequest`: Triggered when Wave requests permission to use a tool.
13
+ - `Stop`: Triggered when Wave finishes its response cycle (no more tool calls).
14
+ - `SubagentStop`: Triggered when a subagent finishes its response cycle.
15
+ - `WorktreeCreate`: Triggered when a new worktree is created.
16
+
17
+ ## Hook Configuration Structure
18
+
19
+ Hooks are configured in the `hooks` field of `settings.json`. Each event can have multiple hook configurations.
20
+
21
+ ```json
22
+ {
23
+ "hooks": {
24
+ "PreToolUse": [
25
+ {
26
+ "matcher": "Write",
27
+ "hooks": [
28
+ {
29
+ "command": "pnpm lint",
30
+ "description": "Run lint before writing files"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "PermissionRequest": [
36
+ {
37
+ "matcher": "Bash",
38
+ "hooks": [
39
+ {
40
+ "command": "echo \"Permission requested for Bash tool\" >> hooks.log",
41
+ "description": "Log permission requests for Bash"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ ```
49
+
50
+ ## Hook Configuration Fields
51
+
52
+ - `matcher`: (Optional) A pattern to match against the tool name (e.g., "Write", "Read*", "/^Edit/"). Only applicable for `PreToolUse`, `PostToolUse`, and `PermissionRequest`.
53
+ - `hooks`: An array of hook commands to execute.
54
+ - `command`: The shell command to execute.
55
+ - `description`: A brief description of the hook's purpose.
56
+ - `async`: (Optional) Whether the hook should run in the background without blocking (default: `false`).
57
+ - `timeout`: (Optional) Maximum execution time in seconds (default: `600`).
58
+
59
+ ## Hook Input JSON
60
+
61
+ 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.
62
+
63
+ ### Common Fields
64
+ - `session_id`: The current session ID.
65
+ - `transcript_path`: Path to the session transcript file (JSON).
66
+ - `cwd`: The current working directory.
67
+ - `hook_event_name`: The name of the triggering event.
68
+
69
+ ### Event-Specific Fields
70
+ - `tool_name`: (PreToolUse, PostToolUse, PermissionRequest) The name of the tool.
71
+ - `tool_input`: (PreToolUse, PostToolUse, PermissionRequest) The input parameters passed to the tool.
72
+ - `tool_response`: (PostToolUse) The result of the tool execution.
73
+ - `user_prompt`: (UserPromptSubmit) The text submitted by the user.
74
+ - `subagent_type`: (If executed by a subagent) The type of the subagent.
75
+ - `name`: (WorktreeCreate) The name of the new worktree.
76
+
77
+ ## Hook Exit Codes
78
+
79
+ Hooks can communicate status and control Wave's behavior using exit codes:
80
+
81
+ - **Exit 0**: Success. Wave continues its normal execution.
82
+ - **Exit 2**: Blocking Error. Wave blocks the current operation and provides feedback based on the event:
83
+ - `UserPromptSubmit`: Blocks prompt processing and shows `stderr` as a user error.
84
+ - `PreToolUse`: Blocks tool execution and provides `stderr` to the agent as feedback.
85
+ - `PostToolUse`: Appends `stderr` to the tool result as feedback for the agent.
86
+ - `Stop`: Blocks the stop operation and provides `stderr` to the agent.
87
+ - **Other Exits (e.g., Exit 1)**: Non-blocking error. Wave continues execution but shows `stderr` as a warning to the user.
88
+
89
+ ## Best Practices
90
+
91
+ - **Keep hooks fast**: Long-running hooks can slow down your workflow unless they are `async`.
92
+ - **Use descriptive names**: Help yourself and others understand what each hook does.
93
+ - **Test your hooks**: Run the commands manually first to ensure they work as expected.
94
+ - **Use local overrides**: For machine-specific hooks, use `.wave/settings.local.json`.
@@ -0,0 +1,55 @@
1
+ # Model Context Protocol (MCP) Configuration
2
+
3
+ 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.
4
+
5
+ ## Configuration File: `.mcp.json`
6
+
7
+ MCP servers are configured in a `.mcp.json` file. Wave looks for this file in your project root:
8
+
9
+ 1. **Project Scope**: `.mcp.json` in your project root (Project-specific MCP servers)
10
+
11
+ ## Configuration Structure
12
+
13
+ The `.mcp.json` file contains a list of MCP server configurations.
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "sqlite": {
19
+ "command": "uvx",
20
+ "args": ["mcp-server-sqlite", "--db-path", "/path/to/your/database.db"]
21
+ },
22
+ "github": {
23
+ "command": "npx",
24
+ "args": ["-y", "@modelcontextprotocol/server-github"],
25
+ "env": {
26
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ### Fields for each server:
34
+
35
+ - `command`: The executable to run (e.g., `npx`, `uvx`, `python`, `node`).
36
+ - `args`: An array of command-line arguments for the executable.
37
+ - `env`: (Optional) A record of environment variables for the server process.
38
+
39
+ ## Using MCP Tools
40
+
41
+ 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:
42
+
43
+ `mcp__[serverName]__[toolName]`
44
+
45
+ For example, if you have a server named `sqlite` with a tool named `query`, it will be available as `mcp__sqlite__query`.
46
+
47
+ ## Permissions for MCP Tools
48
+
49
+ 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.
50
+
51
+ ## Troubleshooting
52
+
53
+ - **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.
54
+ - **Tool Availability**: If a tool is not appearing, ensure the server is running and the `.mcp.json` configuration is correct.
55
+ - **Logs**: MCP server `stderr` is often used for logging and can be helpful for debugging connection issues.
@@ -0,0 +1,60 @@
1
+ # Wave Memory Rules Configuration
2
+
3
+ Memory rules allow you to provide context-specific instructions and guidelines to the agent. This document explains how to create and manage memory rules in Wave.
4
+
5
+ ## What are Memory Rules?
6
+
7
+ Memory rules are Markdown files that contain instructions for the agent. They are used to:
8
+ - Enforce coding styles and conventions.
9
+ - Provide project-specific context (e.g., "always use pnpm").
10
+ - Define architectural patterns and best practices.
11
+ - Share common knowledge across the team.
12
+
13
+ ## Creating Memory Rules
14
+
15
+ Wave looks for memory rules in the following locations:
16
+
17
+ 1. **User Scope**: `~/.wave/rules/*.md` (Global memory rules)
18
+ 2. **Project Scope**: `.wave/rules/*.md` (Project-specific memory rules)
19
+ 3. **Project Root**: `AGENTS.md` (Legacy project-level memory rules)
20
+
21
+ ### File Structure
22
+
23
+ A memory rule file is a standard Markdown file. It can optionally include YAML frontmatter to scope the rules to specific file paths.
24
+
25
+ ```markdown
26
+ ---
27
+ paths:
28
+ - "src/api/**/*.ts"
29
+ - "src/services/**/*.ts"
30
+ ---
31
+
32
+ # API and Service Guidelines
33
+
34
+ - Always use `async/await` for asynchronous operations.
35
+ - Use `Zod` for input validation.
36
+ - Follow the repository pattern for data access.
37
+ ```
38
+
39
+ ### YAML Frontmatter Fields
40
+
41
+ - `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.
42
+
43
+ ## How Memory Rules are Loaded
44
+
45
+ Wave automatically discovers and loads all `.md` files in the `.wave/rules/` directory and its immediate subdirectories.
46
+
47
+ - **Path-Specific Activation**: If a memory rule has a `paths` field, it is only included in the agent's context if *any* file currently being read or modified matches the glob patterns.
48
+ - **Union of Rules**: If multiple files are in context, Wave activates the union of all matching memory rules.
49
+ - **Priority**: Project-level memory rules take priority over user-level memory rules if there is a conflict.
50
+
51
+ ## Best Practices
52
+
53
+ - **Keep rules focused**: Create separate files for different topics (e.g., `testing.md`, `ui-components.md`).
54
+ - **Use clear instructions**: Write rules in a way that is easy for the agent to understand and follow.
55
+ - **Leverage path scoping**: Use the `paths` field to keep the agent's context window clean and relevant.
56
+ - **Share rules with your team**: Commit `.wave/rules/` to your git repository to ensure everyone on the team has the same context.
57
+
58
+ ## Auto-Memory
59
+
60
+ In addition to manual memory rules, Wave also has an **auto-memory** feature that automatically remembers important information across sessions. This is stored in `~/.wave/projects/<project-id>/memory/MEMORY.md`. You can disable this feature in `settings.json` by setting `"autoMemoryEnabled": false`.
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: settings
3
- description: Manage Wave settings and get guidance on settings.json
4
- allowed-tools: Bash, Read, Write
3
+ description: Manage Wave settings and get guidance on settings.json, hooks, environment variables, permissions, MCP servers, memory rules, skills, and subagents. Use this when the user wants to view, update, or learn how to configure Wave.
5
4
  ---
6
5
 
7
6
  # Wave Settings Skill
@@ -25,6 +24,7 @@ For detailed hook configuration, see [HOOKS.md](${WAVE_SKILL_DIR}/HOOKS.md).
25
24
 
26
25
  ### 2. Environment Variables
27
26
  Set environment variables that will be available to all tools and hooks.
27
+ For detailed environment variable configuration and available `WAVE_*` variables, see [ENV.md](${WAVE_SKILL_DIR}/ENV.md).
28
28
  ```json
29
29
  {
30
30
  "env": {
@@ -41,24 +41,13 @@ Manage tool permissions and define the "Safe Zone".
41
41
  "permissions": {
42
42
  "allow": ["Bash", "Read"],
43
43
  "deny": ["Write"],
44
- "defaultMode": "interactive",
44
+ "permissionMode": "default",
45
45
  "additionalDirectories": ["/tmp/wave-exports"]
46
46
  }
47
47
  }
48
48
  ```
49
49
 
50
- ### 4. Enabled Plugins
51
- Enable or disable specific plugins.
52
- ```json
53
- {
54
- "enabledPlugins": {
55
- "git-plugin": true,
56
- "experimental-plugin": false
57
- }
58
- }
59
- ```
60
-
61
- ### 5. Model and Token Configuration
50
+ ### 4. Model and Token Configuration
62
51
  Define which AI models Wave should use and set token limits via environment variables.
63
52
  ```json
64
53
  {
@@ -71,7 +60,23 @@ Define which AI models Wave should use and set token limits via environment vari
71
60
  }
72
61
  ```
73
62
 
74
- ### 6. Other Settings
63
+ ### 5. Model Context Protocol (MCP)
64
+ Connect to external servers to provide additional tools and context.
65
+ For detailed MCP configuration, see [MCP.md](${WAVE_SKILL_DIR}/MCP.md).
66
+
67
+ ### 6. Memory Rules
68
+ Provide context-specific instructions and guidelines to the agent.
69
+ For detailed memory rules configuration, see [MEMORY_RULES.md](${WAVE_SKILL_DIR}/MEMORY_RULES.md).
70
+
71
+ ### 7. Skills
72
+ Extend Wave's functionality by creating custom skills.
73
+ For detailed guidance on creating skills, see [SKILLS.md](${WAVE_SKILL_DIR}/SKILLS.md).
74
+
75
+ ### 8. Subagents
76
+ Delegate tasks to specialized AI personalities.
77
+ For detailed guidance on creating subagents, see [SUBAGENTS.md](${WAVE_SKILL_DIR}/SUBAGENTS.md).
78
+
79
+ ### 9. Other Settings
75
80
  - `language`: Preferred language for agent communication (e.g., `"en"`, `"zh"`).
76
81
  - `autoMemoryEnabled`: Enable or disable auto-memory (default: `true`).
77
82
 
@@ -82,5 +87,7 @@ You can ask me to:
82
87
  - "Update my project settings to enable auto-memory"
83
88
  - "How do I configure a post-commit hook?"
84
89
  - "What are the available permission modes?"
90
+ - "How do I create a custom skill?"
91
+ - "How do I define a new subagent?"
85
92
 
86
93
  I will guide you through the process and ensure your configuration is valid.
@@ -0,0 +1,63 @@
1
+ # Creating and Managing Wave Skills
2
+
3
+ Skills are discoverable capabilities that extend Wave's functionality. They allow you to package instructions, tools, and scripts into reusable modules.
4
+
5
+ ## Skill Structure
6
+
7
+ A skill is a directory containing a `SKILL.md` file.
8
+
9
+ ```text
10
+ my-skill/
11
+ ├── SKILL.md # Main skill definition (required)
12
+ ├── reference.md # Supporting documentation (optional)
13
+ ├── scripts/ # Custom scripts (optional)
14
+ └── templates/ # Code templates (optional)
15
+ ```
16
+
17
+ ## The `SKILL.md` File
18
+
19
+ The `SKILL.md` file uses YAML frontmatter for configuration and Markdown for instructions.
20
+
21
+ ```markdown
22
+ ---
23
+ name: my-skill
24
+ description: A brief description of what the skill does.
25
+ allowed-tools:
26
+ - Bash
27
+ - Read
28
+ ---
29
+
30
+ # My Skill Instructions
31
+
32
+ When this skill is invoked, follow these steps:
33
+ 1. Use the `Read` tool to examine the project structure.
34
+ 2. Use the `Bash` tool to run `npm test`.
35
+ ```
36
+
37
+ ### YAML Frontmatter Fields
38
+
39
+ - `name`: (Required) Unique identifier (lowercase, numbers, hyphens).
40
+ - `description`: (Required) Explains when the AI should use this skill.
41
+ - `allowed-tools`: (Optional) List of tools the skill can use.
42
+ - `context: fork`: (Optional) Run the skill in a separate subagent.
43
+ - `agent`: (Optional) Specify the subagent type (e.g., `general-purpose`).
44
+
45
+ ## Skill Locations
46
+
47
+ Wave looks for skills in two locations:
48
+
49
+ 1. **User Skills**: `~/.wave/skills/` (Available in all projects)
50
+ 2. **Project Skills**: `.wave/skills/` (Specific to the current project)
51
+
52
+ Project skills take precedence over user skills with the same name.
53
+
54
+ ## Invoking Skills
55
+
56
+ - **AI-Invoked**: The agent automatically discovers and uses skills based on their `description`.
57
+ - **User-Invoked**: Use slash commands in the CLI (e.g., `/my-skill`).
58
+
59
+ ## Best Practices
60
+
61
+ - **Clear Descriptions**: Write descriptions that help the AI understand exactly when the skill is relevant.
62
+ - **Modular Design**: Keep skills focused on a single task or capability.
63
+ - **Use `${WAVE_SKILL_DIR}`**: Use this placeholder to reference files within the skill directory.
@@ -0,0 +1,60 @@
1
+ # Creating and Managing Wave Subagents
2
+
3
+ Subagents are specialized AI personalities that Wave can delegate tasks to. They have their own context windows, expertise areas, and tool configurations.
4
+
5
+ ## Subagent Structure
6
+
7
+ A subagent is defined by a Markdown file with YAML frontmatter.
8
+
9
+ ```text
10
+ .wave/agents/
11
+ └── my-subagent.md # Subagent definition
12
+ ```
13
+
14
+ ## The `subagent.md` File
15
+
16
+ The `subagent.md` file uses YAML frontmatter for configuration and Markdown for the system prompt.
17
+
18
+ ```markdown
19
+ ---
20
+ name: my-subagent
21
+ description: A specialized subagent for a specific task.
22
+ tools:
23
+ - Bash
24
+ - Read
25
+ model: gemini-3-flash
26
+ ---
27
+
28
+ # My Subagent System Prompt
29
+
30
+ You are a specialized subagent for a specific task. Your goal is to:
31
+ 1. Use the `Read` tool to examine the project structure.
32
+ 2. Use the `Bash` tool to run `npm test`.
33
+ ```
34
+
35
+ ### YAML Frontmatter Fields
36
+
37
+ - `name`: (Required) Unique identifier.
38
+ - `description`: (Required) Explains the subagent's expertise and when to use it.
39
+ - `tools`: (Optional) List of tools the subagent can use.
40
+ - `model`: (Optional) Overrides the default model for this subagent.
41
+
42
+ ## Subagent Locations
43
+
44
+ Wave looks for subagents in two locations:
45
+
46
+ 1. **User Subagents**: `~/.wave/agents/` (Available in all projects)
47
+ 2. **Project Subagents**: `.wave/agents/` (Specific to the current project)
48
+
49
+ Project subagents take precedence over user subagents with the same name.
50
+
51
+ ## Delegating to Subagents
52
+
53
+ - **Automatic Delegation**: Wave automatically recognizes when a task matches a subagent's expertise and delegates to it.
54
+ - **Explicit Delegation**: You can explicitly request a specific subagent for a task.
55
+
56
+ ## Best Practices
57
+
58
+ - **Focused Expertise**: Define subagents with clear, specific roles (e.g., "Testing Expert", "Refactoring Specialist").
59
+ - **Detailed System Prompts**: Provide clear instructions and guidelines in the system prompt to ensure consistent behavior.
60
+ - **Tool Selection**: Only provide the tools that are necessary for the subagent's role.
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Command execution specialist for running bash commands. Use this for git operations, command execution, and other terminal tasks.
3
+ tools: [Bash]
4
+ model: inherit
5
+ ---
6
+
7
+ You are a command execution specialist. Your role is to execute bash commands efficiently and safely.
8
+
9
+ Guidelines:
10
+ - Execute commands precisely as instructed
11
+ - For git operations, follow git safety protocols
12
+ - Report command output clearly and concisely
13
+ - If a command fails, explain the error and suggest solutions
14
+ - Use command chaining (&&) for dependent operations
15
+ - Quote paths with spaces properly
16
+ - For clear communication, avoid using emojis
17
+
18
+ Complete the requested operations efficiently.
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: 'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.'
3
+ tools: [Glob, Grep, Read, Bash, LSP]
4
+ model: fastModel
5
+ ---
6
+
7
+ You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
8
+
9
+ === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
10
+ This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
11
+ - Creating new files (no Write, touch, or file creation of any kind)
12
+ - Modifying existing files (no Edit operations)
13
+ - Moving or copying files (no mv or cp)
14
+ - Creating temporary files anywhere, including /tmp
15
+ - Using redirect operators (>, >>, |) or heredocs to write to files
16
+ - Running ANY commands that change system state
17
+
18
+ Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.
19
+
20
+ Your strengths:
21
+ - Rapidly finding files using glob patterns
22
+ - Searching code and text with powerful regex patterns
23
+ - Reading and analyzing file contents
24
+ - Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
25
+
26
+ Guidelines:
27
+ - Use Glob for broad file pattern matching
28
+ - Use Grep for searching file contents with regex
29
+ - Use Read when you know the specific file path you need to read
30
+ - Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
31
+ - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
32
+ - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
33
+ - Adapt your search approach based on the thoroughness level specified by the caller
34
+ - Return file paths as absolute paths in your final response
35
+ - For clear communication, avoid using emojis
36
+ - Communicate your final report directly as a regular message - do NOT attempt to create files
37
+
38
+ NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
39
+ - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
40
+ - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
41
+
42
+ Complete the user's search request efficiently and report your findings clearly.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you.
3
+ ---
4
+
5
+ You are an agent. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.
6
+
7
+ Your strengths:
8
+ - Searching for code, configurations, and patterns across large codebases
9
+ - Analyzing multiple files to understand system architecture
10
+ - Investigating complex questions that require exploring many files
11
+ - Performing multi-step research tasks
12
+
13
+ Guidelines:
14
+ - For file searches: Use Grep or Glob when you need to search broadly. Use Read when you know the specific file path.
15
+ - For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.
16
+ - Be thorough: Check multiple locations, consider different naming conventions, look for related files.
17
+ - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.
18
+ - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.
19
+ - In your final response always share relevant file names and code snippets. Any file paths you return in your response MUST be absolute. Do NOT use relative paths.
20
+ - For clear communication, avoid using emojis.