wave-agent-sdk 0.15.4 → 0.15.5
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/builtin/skills/init/SKILL.md +28 -0
- package/builtin/skills/loop/SKILL.md +79 -0
- package/builtin/skills/settings/ENV.md +69 -0
- package/builtin/skills/settings/HOOKS.md +192 -0
- package/builtin/skills/settings/MCP.md +92 -0
- package/builtin/skills/settings/MEMORY_RULES.md +60 -0
- package/builtin/skills/settings/MODELS.md +71 -0
- package/builtin/skills/settings/PERMISSIONS.md +57 -0
- package/builtin/skills/settings/PLUGINS.md +171 -0
- package/builtin/skills/settings/SKILL.md +121 -0
- package/builtin/skills/settings/SKILLS.md +105 -0
- package/builtin/skills/settings/SUBAGENTS.md +77 -0
- package/builtin/subagents/bash.md +19 -0
- package/builtin/subagents/explore.md +43 -0
- package/builtin/subagents/general-purpose.md +20 -0
- package/builtin/subagents/plan.md +56 -0
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +8 -21
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +1 -0
- package/dist/types/configuration.d.ts +2 -0
- package/dist/types/configuration.d.ts.map +1 -1
- package/dist/utils/configPaths.d.ts +11 -0
- package/dist/utils/configPaths.d.ts.map +1 -1
- package/dist/utils/configPaths.js +40 -2
- package/dist/utils/ripgrep.d.ts +2 -0
- package/dist/utils/ripgrep.d.ts.map +1 -1
- package/dist/utils/ripgrep.js +4 -4
- package/dist/utils/subagentParser.d.ts +0 -5
- package/dist/utils/subagentParser.d.ts.map +1 -1
- package/dist/utils/subagentParser.js +3 -155
- package/package.json +3 -1
- package/src/managers/skillManager.ts +11 -21
- package/src/services/configurationService.ts +1 -0
- package/src/types/configuration.ts +2 -0
- package/src/utils/configPaths.ts +45 -2
- package/src/utils/ripgrep.ts +6 -7
- package/src/utils/subagentParser.ts +3 -160
- package/dist/utils/builtinSkills.d.ts +0 -7
- package/dist/utils/builtinSkills.d.ts.map +0 -1
- package/dist/utils/builtinSkills.js +0 -149
- package/src/utils/builtinSkills.ts +0 -158
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Wave Plugins & Plugin Marketplaces
|
|
2
|
+
|
|
3
|
+
This guide covers creating plugins, publishing plugin marketplaces, and installing plugins from marketplaces.
|
|
4
|
+
|
|
5
|
+
## Plugins
|
|
6
|
+
|
|
7
|
+
Plugins bundle skills, hooks, MCP servers, LSP servers, and slash commands into a reusable package.
|
|
8
|
+
|
|
9
|
+
### Creating a Plugin
|
|
10
|
+
|
|
11
|
+
A plugin is any directory containing a `.wave-plugin/plugin.json` manifest:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"name": "my-plugin",
|
|
16
|
+
"description": "A plugin that adds code review capabilities",
|
|
17
|
+
"version": "1.0.0",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Your Name"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Plugin name must match `^[a-z0-9-]+$` (lowercase letters, numbers, hyphens only).
|
|
25
|
+
|
|
26
|
+
Place resources in standard directories within the plugin:
|
|
27
|
+
|
|
28
|
+
| Directory / File | Purpose |
|
|
29
|
+
|-----------------|---------|
|
|
30
|
+
| `skills/` | Skill directories, each containing a `SKILL.md` file |
|
|
31
|
+
| `commands/` | Custom slash command definitions |
|
|
32
|
+
| `hooks/hooks.json` | Hook configuration |
|
|
33
|
+
| `.lsp.json` | LSP server configuration |
|
|
34
|
+
| `.mcp.json` | MCP server configuration |
|
|
35
|
+
|
|
36
|
+
Only `plugin.json` should exist in `.wave-plugin/` — any other files there will cause a validation error.
|
|
37
|
+
|
|
38
|
+
### Installing a Plugin Locally
|
|
39
|
+
|
|
40
|
+
Add a plugin directly in `settings.json`:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"plugins": [
|
|
45
|
+
{
|
|
46
|
+
"type": "local",
|
|
47
|
+
"path": "/path/to/my-plugin"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `${WAVE_PLUGIN_ROOT}` Placeholder
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
Example hook command:
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"hooks": {
|
|
61
|
+
"SessionStart": [
|
|
62
|
+
{
|
|
63
|
+
"hooks": [
|
|
64
|
+
{
|
|
65
|
+
"type": "command",
|
|
66
|
+
"command": "\"${WAVE_PLUGIN_ROOT}/hooks/session-start\"",
|
|
67
|
+
"async": false
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Plugin Marketplaces
|
|
77
|
+
|
|
78
|
+
A plugin marketplace is a git repository containing a `.wave-plugin/marketplace.json` that lists available plugins.
|
|
79
|
+
|
|
80
|
+
### Marketplace Manifest
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"name": "my-plugins",
|
|
85
|
+
"owner": {
|
|
86
|
+
"name": "Your Name"
|
|
87
|
+
},
|
|
88
|
+
"plugins": [
|
|
89
|
+
{
|
|
90
|
+
"name": "review-plugin",
|
|
91
|
+
"description": "Adds a /review command for code reviews",
|
|
92
|
+
"source": "./plugins/review-plugin"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "remote-plugin",
|
|
96
|
+
"description": "Plugin hosted on a remote git repo",
|
|
97
|
+
"source": "https://github.com/user/remote-plugin.git"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- `source` can be a **relative path** (resolved from the marketplace repo root) or a **git URL** (`https://`, `git@`, `ssh://`) for remote repos.
|
|
104
|
+
- Each plugin at its source path must have its own `.wave-plugin/plugin.json` manifest.
|
|
105
|
+
|
|
106
|
+
### Registering a Marketplace
|
|
107
|
+
|
|
108
|
+
Add a marketplace in `settings.json`:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"marketplaces": {
|
|
113
|
+
"my-plugins": {
|
|
114
|
+
"source": {
|
|
115
|
+
"source": "github",
|
|
116
|
+
"repo": "user/my-plugins"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Source types:**
|
|
124
|
+
|
|
125
|
+
| Type | Format | Example |
|
|
126
|
+
|------|--------|---------|
|
|
127
|
+
| GitHub | `{ "source": "github", "repo": "owner/repo", "ref": "branch" }` | Clones from `github.com/owner/repo` |
|
|
128
|
+
| Git URL | `{ "source": "git", "url": "https://...", "ref": "branch" }` | Clones from any git remote |
|
|
129
|
+
| Directory | `{ "source": "directory", "path": "/local/path" }` | Uses a local directory |
|
|
130
|
+
|
|
131
|
+
### Installing from a Marketplace
|
|
132
|
+
|
|
133
|
+
Install a plugin using the format `plugin-name@marketplace-name`:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
/install-plugin my-plugin@my-plugins
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Wave clones the marketplace repo, reads the manifest, and copies the plugin to its cache directory.
|
|
140
|
+
|
|
141
|
+
### Creating a Plugin Marketplace
|
|
142
|
+
|
|
143
|
+
1. Create a git repository
|
|
144
|
+
2. Add `.wave-plugin/marketplace.json` at the root
|
|
145
|
+
3. Add plugin directories with their own `.wave-plugin/plugin.json`
|
|
146
|
+
4. Register the marketplace in your `settings.json` using a github, git, or directory source
|
|
147
|
+
5. Plugins are cloned to the cache directory on install
|
|
148
|
+
|
|
149
|
+
### Updating Plugins
|
|
150
|
+
|
|
151
|
+
Marketplaces with `autoUpdate: true` are checked for updates on startup:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"marketplaces": {
|
|
156
|
+
"my-plugins": {
|
|
157
|
+
"source": { "source": "github", "repo": "user/my-plugins" },
|
|
158
|
+
"autoUpdate": true
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Marketplace Scopes
|
|
165
|
+
|
|
166
|
+
Marketplace declarations can be scoped:
|
|
167
|
+
- **User scope**: `~/.wave/settings.json` — available in all projects
|
|
168
|
+
- **Project scope**: `.wave/settings.json` — available in this project only
|
|
169
|
+
- **Local scope**: `.wave/settings.local.json` — not committed to git
|
|
170
|
+
|
|
171
|
+
Later scopes override earlier ones (local > project > user).
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: settings
|
|
3
|
+
description: Manage Wave settings and get guidance on settings.json, hooks, environment variables, permissions, MCP servers, memory rules, skills, subagents, plugins, and plugin marketplaces. Use this when the user wants to view, update, or learn how to configure Wave.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wave Settings Skill
|
|
7
|
+
|
|
8
|
+
This skill helps you manage your Wave configuration and provides guidance on how to use `settings.json`.
|
|
9
|
+
|
|
10
|
+
## What is `settings.json`?
|
|
11
|
+
|
|
12
|
+
`settings.json` is the central configuration file for Wave. It allows you to customize hooks, environment variables, tool permissions, and more.
|
|
13
|
+
|
|
14
|
+
### Live Reload
|
|
15
|
+
|
|
16
|
+
Changes to `settings.json` take effect immediately without restarting Wave. When you modify any setting, the new configuration is applied to subsequent operations automatically.
|
|
17
|
+
|
|
18
|
+
Wave looks for `settings.json` in three scopes:
|
|
19
|
+
1. **User Scope**: Global settings for all projects. Located at `~/.wave/settings.json`.
|
|
20
|
+
2. **Project Scope**: Settings specific to the current project. Located at `.wave/settings.json` in your project root.
|
|
21
|
+
3. **Local Scope**: Local overrides for the current project (not committed to git). Located at `.wave/settings.local.json`.
|
|
22
|
+
|
|
23
|
+
## Common Settings
|
|
24
|
+
|
|
25
|
+
### 1. Hooks
|
|
26
|
+
Hooks allow you to automate tasks when certain events occur (e.g., `PreToolUse`, `PostToolUse`, `SessionStart`, `SessionEnd`).
|
|
27
|
+
For detailed hook configuration, see [HOOKS.md](${WAVE_SKILL_DIR}/HOOKS.md).
|
|
28
|
+
|
|
29
|
+
### 2. Environment Variables
|
|
30
|
+
Set environment variables that will be available to all tools and hooks. Common `WAVE_*` variables include:
|
|
31
|
+
- `WAVE_MODEL`, `WAVE_FAST_MODEL`: Model selection
|
|
32
|
+
- `WAVE_MAX_INPUT_TOKENS`, `WAVE_MAX_OUTPUT_TOKENS`: Token limits
|
|
33
|
+
- `WAVE_API_KEY`, `WAVE_BASE_URL`: API configuration
|
|
34
|
+
|
|
35
|
+
For detailed configuration, see [ENV.md](${WAVE_SKILL_DIR}/ENV.md).
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"env": {
|
|
39
|
+
"NODE_ENV": "development",
|
|
40
|
+
"API_KEY": "your-api-key"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. Permissions
|
|
46
|
+
Manage tool permissions and define the "Safe Zone". Changes to permissions take effect immediately with live reload.
|
|
47
|
+
For detailed permission configuration and available permission modes, see [PERMISSIONS.md](${WAVE_SKILL_DIR}/PERMISSIONS.md).
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"permissions": {
|
|
51
|
+
"allow": ["Bash", "Read"],
|
|
52
|
+
"deny": ["Write"],
|
|
53
|
+
"permissionMode": "default",
|
|
54
|
+
"additionalDirectories": ["/tmp/wave-exports"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 4. Model Configuration
|
|
60
|
+
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.
|
|
61
|
+
For detailed model configuration, see [MODELS.md](${WAVE_SKILL_DIR}/MODELS.md).
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"models": {
|
|
65
|
+
"claude-3-7-sonnet-20250219": {
|
|
66
|
+
"thinking": {
|
|
67
|
+
"type": "enabled",
|
|
68
|
+
"budget_tokens": 1024
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"o3-mini": {
|
|
72
|
+
"reasoning_effort": "high"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 5. Model Context Protocol (MCP)
|
|
79
|
+
Connect to external servers to provide additional tools and context.
|
|
80
|
+
For detailed MCP configuration, see [MCP.md](${WAVE_SKILL_DIR}/MCP.md).
|
|
81
|
+
|
|
82
|
+
### 6. Memory Rules
|
|
83
|
+
Provide context-specific instructions and guidelines to the agent.
|
|
84
|
+
For detailed memory rules configuration, see [MEMORY_RULES.md](${WAVE_SKILL_DIR}/MEMORY_RULES.md).
|
|
85
|
+
|
|
86
|
+
### 7. Skills
|
|
87
|
+
Extend Wave's functionality by creating custom skills.
|
|
88
|
+
For detailed guidance on creating skills, see [SKILLS.md](${WAVE_SKILL_DIR}/SKILLS.md).
|
|
89
|
+
|
|
90
|
+
### 8. Subagents
|
|
91
|
+
Delegate tasks to specialized AI personalities.
|
|
92
|
+
For detailed guidance on creating subagents, see [SUBAGENTS.md](${WAVE_SKILL_DIR}/SUBAGENTS.md).
|
|
93
|
+
|
|
94
|
+
### 9. Plugins
|
|
95
|
+
|
|
96
|
+
Plugins bundle skills, hooks, MCP servers, LSP servers, commands, and subagents into a reusable package. You can install plugins locally or from a marketplace.
|
|
97
|
+
For detailed guidance on creating plugins and marketplaces, see [PLUGINS.md](${WAVE_SKILL_DIR}/PLUGINS.md).
|
|
98
|
+
|
|
99
|
+
### 10. Other Settings
|
|
100
|
+
- `language`: Preferred language for agent communication (e.g., `"en"`, `"zh"`).
|
|
101
|
+
- `autoMemoryEnabled`: Enable or disable auto-memory (default: `true`).
|
|
102
|
+
- `autoMemoryFrequency`: Frequency of auto-memory extraction turns (default: `1`).
|
|
103
|
+
|
|
104
|
+
## How to use this skill
|
|
105
|
+
|
|
106
|
+
You can ask me to:
|
|
107
|
+
- "Show my current settings"
|
|
108
|
+
- "Update my project settings to enable auto-memory"
|
|
109
|
+
- "How do I configure a post-commit hook?"
|
|
110
|
+
- "What are the available permission modes?"
|
|
111
|
+
- "Update my permission mode to acceptEdits"
|
|
112
|
+
- "How do I extend the Safe Zone for permissions?"
|
|
113
|
+
- "How do I create a custom skill?"
|
|
114
|
+
- "How do I define a new subagent?"
|
|
115
|
+
- "How do I set max input tokens?"
|
|
116
|
+
- "How do I change the model?"
|
|
117
|
+
- "How do I create a Wave plugin?"
|
|
118
|
+
- "How do I set up a plugin marketplace?"
|
|
119
|
+
- "How do I install a plugin from a marketplace?"
|
|
120
|
+
|
|
121
|
+
I will guide you through the process and ensure your configuration is valid.
|
|
@@ -0,0 +1,105 @@
|
|
|
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. When `context: fork` is used, the Markdown body is passed as the initial prompt to the subagent.
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
---
|
|
23
|
+
name: my-skill
|
|
24
|
+
description: A brief description of what the skill does.
|
|
25
|
+
context: fork
|
|
26
|
+
allowed-tools:
|
|
27
|
+
- Bash
|
|
28
|
+
- Read
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# My Skill Instructions
|
|
32
|
+
|
|
33
|
+
When this skill is invoked, follow these steps:
|
|
34
|
+
1. Use the `Read` tool to examine the project structure.
|
|
35
|
+
2. Use the `Bash` tool to run `npm test`.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### YAML Frontmatter Fields
|
|
39
|
+
|
|
40
|
+
- `name`: (Required) Unique identifier (lowercase, numbers, hyphens).
|
|
41
|
+
- `description`: (Required) Explains when the AI should use this skill.
|
|
42
|
+
- `allowed-tools`: (Optional) List of tools the skill can use.
|
|
43
|
+
- `context: fork`: (Optional) Run the skill in a separate subagent.
|
|
44
|
+
- `agent`: (Optional) Specify the subagent type (default: `general-purpose`).
|
|
45
|
+
- `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.
|
|
46
|
+
- `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.
|
|
47
|
+
- `model`: (Optional) Override the AI model used for skill execution (e.g., `"gpt-4o"`, `"o3-mini"`).
|
|
48
|
+
|
|
49
|
+
## Skill Locations
|
|
50
|
+
|
|
51
|
+
Wave looks for skills in two locations:
|
|
52
|
+
|
|
53
|
+
1. **User Skills**: `~/.wave/skills/` (Available in all projects)
|
|
54
|
+
2. **Project Skills**: `.wave/skills/` (Specific to the current project)
|
|
55
|
+
|
|
56
|
+
Project skills take precedence over user skills with the same name.
|
|
57
|
+
|
|
58
|
+
## Invoking Skills
|
|
59
|
+
|
|
60
|
+
- **AI-Invoked**: The agent automatically discovers and uses skills based on their `description`.
|
|
61
|
+
- **User-Invoked**: Use slash commands in the CLI (e.g., `/my-skill`).
|
|
62
|
+
|
|
63
|
+
## Bash Command Substitution
|
|
64
|
+
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
### Inline Syntax
|
|
68
|
+
|
|
69
|
+
Use `!`command`` for single-line commands:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
Current git status: !`git status --short`
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Block Syntax
|
|
76
|
+
|
|
77
|
+
Use ` ```! ` code blocks for multi-line commands:
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
```!
|
|
81
|
+
git log --oneline -10
|
|
82
|
+
```
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Blocks are processed before inline commands, with results replaced in order of appearance.
|
|
86
|
+
|
|
87
|
+
### Output Limits
|
|
88
|
+
|
|
89
|
+
- Output is capped at **30,000 characters** per command.
|
|
90
|
+
- When truncated, a 2,048-character preview is shown along with a temp file path containing the full output.
|
|
91
|
+
|
|
92
|
+
### Safe Replacement
|
|
93
|
+
|
|
94
|
+
Shell output containing special strings like `$$`, `$&`, `$'` is replaced safely without corruption.
|
|
95
|
+
|
|
96
|
+
### Empty Commands
|
|
97
|
+
|
|
98
|
+
Empty or whitespace-only commands are silently skipped.
|
|
99
|
+
|
|
100
|
+
## Best Practices
|
|
101
|
+
|
|
102
|
+
- **Clear Descriptions**: Write descriptions that help the AI understand exactly when the skill is relevant.
|
|
103
|
+
- **Modular Design**: Keep skills focused on a single task or capability.
|
|
104
|
+
- **Use `${WAVE_SKILL_DIR}`**: Use this placeholder to reference files within the skill directory.
|
|
105
|
+
- **Bash Commands**: Use `!`command`` for inline output or ` ```! ` blocks for multi-line commands. Keep outputs concise.
|
|
@@ -0,0 +1,77 @@
|
|
|
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. 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.
|
|
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
|
+
You are a specialized subagent for a specific task. Your goal is to:
|
|
29
|
+
1. Use the `Read` tool to examine the project structure.
|
|
30
|
+
2. Use the `Bash` tool to run `npm test`.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### YAML Frontmatter Fields
|
|
34
|
+
|
|
35
|
+
- `name`: (Required) Unique identifier.
|
|
36
|
+
- `description`: (Required) Explains the subagent's expertise and when to use it.
|
|
37
|
+
- `tools`: (Optional) List of tools the subagent can use.
|
|
38
|
+
- `model`: (Optional) Overrides the default model for this subagent.
|
|
39
|
+
|
|
40
|
+
## Subagent Locations
|
|
41
|
+
|
|
42
|
+
Wave looks for subagents in three locations:
|
|
43
|
+
|
|
44
|
+
1. **User Subagents**: `~/.wave/agents/` (Available in all projects)
|
|
45
|
+
2. **Project Subagents**: `.wave/agents/` (Specific to the current project)
|
|
46
|
+
3. **Plugin Agents**: `agents/` within an installed plugin directory (Scoped to the plugin)
|
|
47
|
+
|
|
48
|
+
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.
|
|
49
|
+
|
|
50
|
+
## Plugin Agents
|
|
51
|
+
|
|
52
|
+
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.
|
|
53
|
+
|
|
54
|
+
For example, a plugin at `/path/to/my-plugin/` with `agents/researcher.md`:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
---
|
|
58
|
+
name: researcher
|
|
59
|
+
description: A research agent that uses the plugin's knowledge base
|
|
60
|
+
tools: ["Read", "Glob"]
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
You are a research assistant. Access plugin resources at ${WAVE_PLUGIN_ROOT}/data.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
After loading, `${WAVE_PLUGIN_ROOT}` is replaced with `/path/to/my-plugin/`, and the agent is registered as `my-plugin:researcher`.
|
|
67
|
+
|
|
68
|
+
## Delegating to Subagents
|
|
69
|
+
|
|
70
|
+
- **Automatic Delegation**: Wave automatically recognizes when a task matches a subagent's expertise and delegates to it.
|
|
71
|
+
- **Explicit Delegation**: You can explicitly request a specific subagent for a task.
|
|
72
|
+
|
|
73
|
+
## Best Practices
|
|
74
|
+
|
|
75
|
+
- **Focused Expertise**: Define subagents with clear, specific roles (e.g., "Testing Expert", "Refactoring Specialist").
|
|
76
|
+
- **Detailed System Prompts**: Provide clear instructions and guidelines in the system prompt to ensure consistent behavior.
|
|
77
|
+
- **Tool Selection**: Only provide the tools that are necessary for the subagent's role.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bash
|
|
3
|
+
description: Command execution specialist for running bash commands. Use this for git operations, command execution, and other terminal tasks.
|
|
4
|
+
tools: [Bash]
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a command execution specialist. Your role is to execute bash commands efficiently and safely.
|
|
9
|
+
|
|
10
|
+
Guidelines:
|
|
11
|
+
- Execute commands precisely as instructed
|
|
12
|
+
- For git operations, follow git safety protocols
|
|
13
|
+
- Report command output clearly and concisely
|
|
14
|
+
- If a command fails, explain the error and suggest solutions
|
|
15
|
+
- Use command chaining (&&) for dependent operations
|
|
16
|
+
- Quote paths with spaces properly
|
|
17
|
+
- For clear communication, avoid using emojis
|
|
18
|
+
|
|
19
|
+
Complete the requested operations efficiently.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Explore
|
|
3
|
+
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.'
|
|
4
|
+
tools: [Glob, Grep, Read, Bash, LSP]
|
|
5
|
+
model: fastModel
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
|
|
9
|
+
|
|
10
|
+
=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
|
|
11
|
+
This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
|
|
12
|
+
- Creating new files (no Write, touch, or file creation of any kind)
|
|
13
|
+
- Modifying existing files (no Edit operations)
|
|
14
|
+
- Moving or copying files (no mv or cp)
|
|
15
|
+
- Creating temporary files anywhere, including /tmp
|
|
16
|
+
- Using redirect operators (>, >>, |) or heredocs to write to files
|
|
17
|
+
- Running ANY commands that change system state
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
Your strengths:
|
|
22
|
+
- Rapidly finding files using glob patterns
|
|
23
|
+
- Searching code and text with powerful regex patterns
|
|
24
|
+
- Reading and analyzing file contents
|
|
25
|
+
- Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
|
|
26
|
+
|
|
27
|
+
Guidelines:
|
|
28
|
+
- Use Glob for broad file pattern matching
|
|
29
|
+
- Use Grep for searching file contents with regex
|
|
30
|
+
- Use Read when you know the specific file path you need to read
|
|
31
|
+
- Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
|
|
32
|
+
- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
|
|
33
|
+
- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
|
|
34
|
+
- Adapt your search approach based on the thoroughness level specified by the caller
|
|
35
|
+
- Return file paths as absolute paths in your final response
|
|
36
|
+
- For clear communication, avoid using emojis
|
|
37
|
+
- Communicate your final report directly as a regular message - do NOT attempt to create files
|
|
38
|
+
|
|
39
|
+
NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
|
|
40
|
+
- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
|
|
41
|
+
- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
|
|
42
|
+
|
|
43
|
+
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.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Plan
|
|
3
|
+
description: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs.
|
|
4
|
+
tools: [Glob, Grep, Read, Bash, LSP]
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.
|
|
9
|
+
|
|
10
|
+
=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
|
|
11
|
+
This is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:
|
|
12
|
+
- Creating new files (no Write, touch, or file creation of any kind)
|
|
13
|
+
- Modifying existing files (no Edit operations)
|
|
14
|
+
- Moving or copying files (no mv or cp)
|
|
15
|
+
- Creating temporary files anywhere, including /tmp
|
|
16
|
+
- Using redirect operators (>, >>, |) or heredocs to write to files
|
|
17
|
+
- Running ANY commands that change system state
|
|
18
|
+
|
|
19
|
+
Your role is EXCLUSIVELY to explore the codebase and design implementation plans. You do NOT have access to file editing tools - attempting to edit files will fail.
|
|
20
|
+
|
|
21
|
+
You will be provided with a set of requirements and optionally a perspective on how to approach the design process.
|
|
22
|
+
|
|
23
|
+
## Your Process
|
|
24
|
+
|
|
25
|
+
1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.
|
|
26
|
+
|
|
27
|
+
2. **Explore Thoroughly**:
|
|
28
|
+
- Read any files provided to you in the initial prompt
|
|
29
|
+
- Find existing patterns and conventions using Glob, Grep, and Read
|
|
30
|
+
- Understand the current architecture
|
|
31
|
+
- Identify similar features as reference
|
|
32
|
+
- Trace through relevant code paths
|
|
33
|
+
- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
|
|
34
|
+
- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
|
|
35
|
+
|
|
36
|
+
3. **Design Solution**:
|
|
37
|
+
- Create implementation approach based on your assigned perspective
|
|
38
|
+
- Consider trade-offs and architectural decisions
|
|
39
|
+
- Follow existing patterns where appropriate
|
|
40
|
+
|
|
41
|
+
4. **Detail the Plan**:
|
|
42
|
+
- Provide step-by-step implementation strategy
|
|
43
|
+
- Identify dependencies and sequencing
|
|
44
|
+
- Anticipate potential challenges
|
|
45
|
+
|
|
46
|
+
## Required Output
|
|
47
|
+
|
|
48
|
+
End your response with:
|
|
49
|
+
|
|
50
|
+
### Critical Files for Implementation
|
|
51
|
+
List 3-5 files most critical for implementing this plan:
|
|
52
|
+
- path/to/file1.ts - [Brief reason: e.g., "Core logic to modify"]
|
|
53
|
+
- path/to/file2.ts - [Brief reason: e.g., "Interfaces to implement"]
|
|
54
|
+
- path/to/file3.ts - [Brief reason: e.g., "Pattern to follow"]
|
|
55
|
+
|
|
56
|
+
REMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skillManager.d.ts","sourceRoot":"","sources":["../../src/managers/skillManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,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AAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,CACzC;IA6BD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;OAEG;YACW,yBAAyB;IASvC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;OAEG;IACH,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;CA2BhE"}
|
|
@@ -6,7 +6,7 @@ import { FileWatcherService } from "../services/fileWatcher.js";
|
|
|
6
6
|
import { parseSkillFile, formatSkillError } from "../utils/skillParser.js";
|
|
7
7
|
import { substituteCommandParameters } from "../utils/commandArgumentParser.js";
|
|
8
8
|
import { parseBashCommands, replaceBashCommandsWithOutput, executeBashCommands, } from "../utils/markdownParser.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getBuiltinSkillsDir } from "../utils/configPaths.js";
|
|
10
10
|
import { logger } from "../utils/globalLogger.js";
|
|
11
11
|
/**
|
|
12
12
|
* Manages skill discovery and loading
|
|
@@ -153,31 +153,18 @@ export class SkillManager extends EventEmitter {
|
|
|
153
153
|
* Discover skills in builtin, personal and project directories
|
|
154
154
|
*/
|
|
155
155
|
async discoverSkills() {
|
|
156
|
-
|
|
157
|
-
const builtinSkills = new Map();
|
|
158
|
-
for (const skill of BUILTIN_SKILLS) {
|
|
159
|
-
builtinSkills.set(skill.name, {
|
|
160
|
-
name: skill.name,
|
|
161
|
-
description: skill.description,
|
|
162
|
-
type: skill.type,
|
|
163
|
-
skillPath: skill.skillPath,
|
|
164
|
-
allowedTools: skill.allowedTools,
|
|
165
|
-
context: skill.context,
|
|
166
|
-
agent: skill.agent,
|
|
167
|
-
model: skill.model,
|
|
168
|
-
disableModelInvocation: skill.disableModelInvocation,
|
|
169
|
-
userInvocable: skill.userInvocable,
|
|
170
|
-
});
|
|
171
|
-
// Store full skill content for later loading
|
|
172
|
-
this.skillContent.set(skill.name, skill);
|
|
173
|
-
}
|
|
156
|
+
const builtinCollection = await this.discoverSkillCollection(getBuiltinSkillsDir(), "builtin");
|
|
174
157
|
const personalCollection = await this.discoverSkillCollection(this.personalSkillsPath, "personal");
|
|
175
158
|
const projectCollection = await this.discoverSkillCollection(this.workdir, "project");
|
|
176
159
|
return {
|
|
177
|
-
builtinSkills,
|
|
160
|
+
builtinSkills: builtinCollection.skills,
|
|
178
161
|
personalSkills: personalCollection.skills,
|
|
179
162
|
projectSkills: projectCollection.skills,
|
|
180
|
-
errors: [
|
|
163
|
+
errors: [
|
|
164
|
+
...builtinCollection.errors,
|
|
165
|
+
...personalCollection.errors,
|
|
166
|
+
...projectCollection.errors,
|
|
167
|
+
],
|
|
181
168
|
};
|
|
182
169
|
}
|
|
183
170
|
/**
|