wave-agent-sdk 0.15.3 → 0.15.4

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 (38) hide show
  1. package/dist/managers/skillManager.d.ts.map +1 -1
  2. package/dist/managers/skillManager.js +21 -8
  3. package/dist/services/configurationService.d.ts.map +1 -1
  4. package/dist/services/configurationService.js +0 -1
  5. package/dist/types/configuration.d.ts +0 -2
  6. package/dist/types/configuration.d.ts.map +1 -1
  7. package/dist/utils/builtinSkills.d.ts +7 -0
  8. package/dist/utils/builtinSkills.d.ts.map +1 -0
  9. package/dist/utils/builtinSkills.js +149 -0
  10. package/dist/utils/configPaths.d.ts +0 -10
  11. package/dist/utils/configPaths.d.ts.map +1 -1
  12. package/dist/utils/configPaths.js +2 -25
  13. package/dist/utils/subagentParser.d.ts +5 -0
  14. package/dist/utils/subagentParser.d.ts.map +1 -1
  15. package/dist/utils/subagentParser.js +155 -3
  16. package/package.json +1 -2
  17. package/src/managers/skillManager.ts +21 -11
  18. package/src/services/configurationService.ts +0 -1
  19. package/src/types/configuration.ts +0 -2
  20. package/src/utils/builtinSkills.ts +158 -0
  21. package/src/utils/configPaths.ts +2 -30
  22. package/src/utils/subagentParser.ts +160 -3
  23. package/builtin/skills/init/SKILL.md +0 -28
  24. package/builtin/skills/loop/SKILL.md +0 -79
  25. package/builtin/skills/settings/ENV.md +0 -69
  26. package/builtin/skills/settings/HOOKS.md +0 -192
  27. package/builtin/skills/settings/MCP.md +0 -92
  28. package/builtin/skills/settings/MEMORY_RULES.md +0 -60
  29. package/builtin/skills/settings/MODELS.md +0 -71
  30. package/builtin/skills/settings/PERMISSIONS.md +0 -57
  31. package/builtin/skills/settings/PLUGINS.md +0 -171
  32. package/builtin/skills/settings/SKILL.md +0 -121
  33. package/builtin/skills/settings/SKILLS.md +0 -105
  34. package/builtin/skills/settings/SUBAGENTS.md +0 -77
  35. package/builtin/subagents/bash.md +0 -19
  36. package/builtin/subagents/explore.md +0 -43
  37. package/builtin/subagents/general-purpose.md +0 -20
  38. package/builtin/subagents/plan.md +0 -56
@@ -104,8 +104,6 @@ export interface ConfigurationPaths {
104
104
  userPaths: string[];
105
105
  /** Project-specific configuration file paths in priority order */
106
106
  projectPaths: string[];
107
- /** Builtin configuration file paths */
108
- builtinPaths: string[];
109
107
  /** All configuration paths combined */
110
108
  allPaths: string[];
111
109
  /** Only the paths that actually exist on the filesystem */
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Builtin skill configurations hardcoded as TypeScript objects.
3
+ * Replaces the former builtin/skills directory of markdown files.
4
+ */
5
+
6
+ import type { Skill } from "../types/index.js";
7
+
8
+ const LOOP_CONTENT = [
9
+ "---",
10
+ "name: loop",
11
+ "description: Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)",
12
+ "allowed-tools: CronCreate, Skill",
13
+ "user-invocable: true",
14
+ "---",
15
+ "",
16
+ "# /loop — schedule a recurring prompt",
17
+ "",
18
+ "Parse the input below into `[interval] <prompt…>` and schedule it with CronCreate.",
19
+ "",
20
+ "## Usage",
21
+ "",
22
+ "```",
23
+ "/loop [interval] <prompt>",
24
+ "",
25
+ "Run a prompt or slash command on a recurring interval.",
26
+ "",
27
+ "Intervals: Ns, Nm, Nh, Nd (e.g. 5m, 30m, 2h, 1d). Minimum granularity is 1 minute.",
28
+ "If no interval is specified, defaults to 10m.",
29
+ "",
30
+ "Examples:",
31
+ " /loop 5m /babysit-prs",
32
+ " /loop 30m check the deploy",
33
+ " /loop 1h /standup 1",
34
+ " /loop check the deploy (defaults to 10m)",
35
+ " /loop check the deploy every 20m",
36
+ "```",
37
+ "",
38
+ "## Parsing (in priority order)",
39
+ "",
40
+ "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.",
41
+ '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.',
42
+ "3. **Default**: otherwise, interval is `10m` and the entire input is the prompt.",
43
+ "",
44
+ "If the resulting prompt is empty, show usage `/loop [interval] <prompt>` and stop — do not call CronCreate.",
45
+ "",
46
+ "Examples:",
47
+ "- `5m /babysit-prs` → interval `5m`, prompt `/babysit-prs` (rule 1)",
48
+ "- `check the deploy every 20m` → interval `20m`, prompt `check the deploy` (rule 2)",
49
+ "- `run tests every 5 minutes` → interval `5m`, prompt `run tests` (rule 2)",
50
+ "- `check the deploy` → interval `10m`, prompt `check the deploy` (rule 3)",
51
+ '- `check every PR` → interval `10m`, prompt `check every PR` (rule 3 — "every" not followed by time)',
52
+ "- `5m` → empty prompt → show usage",
53
+ "",
54
+ "## Interval → cron",
55
+ "",
56
+ "Supported suffixes: `s` (seconds, rounded up to nearest minute, min 1), `m` (minutes), `h` (hours), `d` (days). Convert:",
57
+ "",
58
+ "| Interval pattern | Cron expression | Notes |",
59
+ "|-----------------------|---------------------|------------------------------------------|",
60
+ "| `Nm` where N ≤ 59 | `*/N * * * *` | every N minutes |",
61
+ "| `Nm` where N ≥ 60 | `0 */H * * *` | round to hours (H = N/60, must divide 24)|",
62
+ "| `Nh` where N ≤ 23 | `0 */N * * *` | every N hours |",
63
+ "| `Nd` | `0 0 */N * *` | every N days at midnight local |",
64
+ "| `Ns` | treat as `ceil(N/60)m` | cron minimum granularity is 1 minute |",
65
+ "",
66
+ "**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.",
67
+ "",
68
+ "## Avoid the :00 and :30 minute marks",
69
+ "",
70
+ "When the user's request is approximate, pick a minute that is NOT 0 or 30:",
71
+ '- "every morning around 9" → `57 8 * * *` or `3 9 * * *` (not `0 9 * * *`)',
72
+ '- "hourly" → `7 * * * *` (not `0 * * * *`)',
73
+ "",
74
+ 'Only use minute 0 or 30 when the user names that exact time and clearly means it ("at 9:00 sharp", "at half past").',
75
+ "",
76
+ "## Action",
77
+ "",
78
+ "1. Call CronCreate with:",
79
+ " - `cron`: the expression from the table above",
80
+ " - `prompt`: the parsed prompt from above, verbatim (slash commands are passed through unchanged)",
81
+ " - `recurring`: `true`",
82
+ "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).",
83
+ "3. **Then immediately execute the parsed prompt now** — don't wait for the first cron fire. If it's a slash command, run it directly; otherwise act on it directly.",
84
+ "",
85
+ "## Input",
86
+ "",
87
+ "$ARGUMENTS",
88
+ ].join("\n");
89
+
90
+ const INIT_CONTENT = [
91
+ "---",
92
+ "name: init",
93
+ "description: Analyze the codebase and create an AGENTS.md file to guide future agents.",
94
+ "disable-model-invocation: true",
95
+ "---",
96
+ "",
97
+ "Please analyze this codebase and create a AGENTS.md file, which will be given to future instances of Agent to operate in this repository.",
98
+ "",
99
+ "What to add:",
100
+ "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.",
101
+ '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.',
102
+ "",
103
+ "Usage notes:",
104
+ "- If there's already a AGENTS.md, suggest improvements to it.",
105
+ '- 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".',
106
+ "- Avoid listing every component or file structure that can be easily discovered.",
107
+ "- Don't include generic development practices.",
108
+ "- 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.",
109
+ "- Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.",
110
+ "- If there is a README.md, make sure to include the important parts.",
111
+ '- 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.',
112
+ "- Be sure to prefix the file with the following text:",
113
+ "",
114
+ "```",
115
+ "# AGENTS.md",
116
+ "",
117
+ "This file provides guidance to Agent when working with code in this repository.",
118
+ "```",
119
+ ].join("\n");
120
+
121
+ export const BUILTIN_SKILLS: Skill[] = [
122
+ {
123
+ name: "loop",
124
+ description:
125
+ "Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)",
126
+ type: "builtin",
127
+ skillPath: "<builtin:loop>",
128
+ allowedTools: ["CronCreate", "Skill"],
129
+ userInvocable: true,
130
+ content: LOOP_CONTENT,
131
+ frontmatter: {
132
+ name: "loop",
133
+ description:
134
+ "Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)",
135
+ "allowed-tools": ["CronCreate", "Skill"],
136
+ "user-invocable": true,
137
+ },
138
+ isValid: true,
139
+ errors: [],
140
+ },
141
+ {
142
+ name: "init",
143
+ description:
144
+ "Analyze the codebase and create an AGENTS.md file to guide future agents.",
145
+ type: "builtin",
146
+ skillPath: "<builtin:init>",
147
+ disableModelInvocation: true,
148
+ content: INIT_CONTENT,
149
+ frontmatter: {
150
+ name: "init",
151
+ description:
152
+ "Analyze the codebase and create an AGENTS.md file to guide future agents.",
153
+ "disable-model-invocation": true,
154
+ },
155
+ isValid: true,
156
+ errors: [],
157
+ },
158
+ ];
@@ -10,31 +10,9 @@
10
10
  * - Project configs override user configs (existing behavior)
11
11
  */
12
12
 
13
- import { join, dirname } from "path";
13
+ import { join } from "path";
14
14
  import { homedir } from "os";
15
15
  import { existsSync } from "fs";
16
- import { fileURLToPath } from "url";
17
-
18
- const __filename = fileURLToPath(import.meta.url);
19
- const __dirname = dirname(__filename);
20
-
21
- /**
22
- * Get the builtin skills directory path
23
- */
24
- export function getBuiltinSkillsDir(): string {
25
- // Builtin skills are now in the 'builtin/skills' directory at the root of the package
26
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/skills
27
- return join(__dirname, "..", "..", "builtin", "skills");
28
- }
29
-
30
- /**
31
- * Get the builtin subagents directory path
32
- */
33
- export function getBuiltinSubagentsDir(): string {
34
- // Builtin subagents are now in the 'builtin/subagents' directory at the root of the package
35
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/subagents
36
- return join(__dirname, "..", "..", "builtin", "subagents");
37
- }
38
16
 
39
17
  /**
40
18
  * Get the user-specific configuration file path (legacy function)
@@ -84,18 +62,15 @@ export function getProjectConfigPaths(workdir: string): string[] {
84
62
  export function getAllConfigPaths(workdir: string): {
85
63
  userPaths: string[];
86
64
  projectPaths: string[];
87
- builtinPaths: string[];
88
65
  allPaths: string[];
89
66
  } {
90
67
  const userPaths = getUserConfigPaths();
91
68
  const projectPaths = getProjectConfigPaths(workdir);
92
- const builtinPaths = [join(getBuiltinSkillsDir(), "settings", "SKILL.md")];
93
69
 
94
70
  return {
95
71
  userPaths,
96
72
  projectPaths,
97
- builtinPaths,
98
- allPaths: [...userPaths, ...projectPaths, ...builtinPaths],
73
+ allPaths: [...userPaths, ...projectPaths],
99
74
  };
100
75
  }
101
76
 
@@ -106,20 +81,17 @@ export function getAllConfigPaths(workdir: string): {
106
81
  export function getExistingConfigPaths(workdir: string): {
107
82
  userPaths: string[];
108
83
  projectPaths: string[];
109
- builtinPaths: string[];
110
84
  existingPaths: string[];
111
85
  } {
112
86
  const allPaths = getAllConfigPaths(workdir);
113
87
 
114
88
  const existingUserPaths = allPaths.userPaths.filter(existsSync);
115
89
  const existingProjectPaths = allPaths.projectPaths.filter(existsSync);
116
- const existingBuiltinPaths = allPaths.builtinPaths.filter(existsSync);
117
90
  const allExistingPaths = allPaths.allPaths.filter(existsSync);
118
91
 
119
92
  return {
120
93
  userPaths: existingUserPaths,
121
94
  projectPaths: existingProjectPaths,
122
- builtinPaths: existingBuiltinPaths,
123
95
  existingPaths: allExistingPaths,
124
96
  };
125
97
  }
@@ -1,7 +1,6 @@
1
1
  import { readFileSync, readdirSync, statSync } from "fs";
2
2
  import { join, extname, basename } from "path";
3
3
  import { logger } from "./globalLogger.js";
4
- import { getBuiltinSubagentsDir } from "./configPaths.js";
5
4
 
6
5
  export interface SubagentConfiguration {
7
6
  name: string;
@@ -16,6 +15,164 @@ export interface SubagentConfiguration {
16
15
  pluginRoot?: string;
17
16
  }
18
17
 
18
+ /**
19
+ * Builtin subagent configurations hardcoded as TypeScript objects.
20
+ * Replaces the former builtin/subagents directory of markdown files.
21
+ */
22
+ export const BUILTIN_SUBAGENTS: SubagentConfiguration[] = [
23
+ {
24
+ name: "Explore",
25
+ description:
26
+ '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.',
27
+ tools: ["Glob", "Grep", "Read", "Bash", "LSP"],
28
+ model: "fastModel",
29
+ systemPrompt: `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
30
+
31
+ === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
32
+ This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
33
+ - Creating new files (no Write, touch, or file creation of any kind)
34
+ - Modifying existing files (no Edit operations)
35
+ - Moving or copying files (no mv or cp)
36
+ - Creating temporary files anywhere, including /tmp
37
+ - Using redirect operators (>, >>, |) or heredocs to write to files
38
+ - Running ANY commands that change system state
39
+
40
+ 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.
41
+
42
+ Your strengths:
43
+ - Rapidly finding files using glob patterns
44
+ - Searching code and text with powerful regex patterns
45
+ - Reading and analyzing file contents
46
+ - Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
47
+
48
+ Guidelines:
49
+ - Use Glob for broad file pattern matching
50
+ - Use Grep for searching file contents with regex
51
+ - Use Read when you know the specific file path you need to read
52
+ - Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
53
+ - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
54
+ - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
55
+ - Adapt your search approach based on the thoroughness level specified by the caller
56
+ - Return file paths as absolute paths in your final response
57
+ - For clear communication, avoid using emojis
58
+ - Communicate your final report directly as a regular message - do NOT attempt to create files
59
+
60
+ NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
61
+ - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
62
+ - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
63
+
64
+ Complete the user's search request efficiently and report your findings clearly.`,
65
+ filePath: "<builtin:Explore>",
66
+ scope: "builtin",
67
+ priority: 3,
68
+ },
69
+ {
70
+ name: "Bash",
71
+ description:
72
+ "Command execution specialist for running bash commands. Use this for git operations, command execution, and other terminal tasks.",
73
+ tools: ["Bash"],
74
+ model: "inherit",
75
+ systemPrompt: `You are a command execution specialist. Your role is to execute bash commands efficiently and safely.
76
+
77
+ Guidelines:
78
+ - Execute commands precisely as instructed
79
+ - For git operations, follow git safety protocols
80
+ - Report command output clearly and concisely
81
+ - If a command fails, explain the error and suggest solutions
82
+ - Use command chaining (&&) for dependent operations
83
+ - Quote paths with spaces properly
84
+ - For clear communication, avoid using emojis
85
+
86
+ Complete the requested operations efficiently.`,
87
+ filePath: "<builtin:Bash>",
88
+ scope: "builtin",
89
+ priority: 3,
90
+ },
91
+ {
92
+ name: "Plan",
93
+ description:
94
+ "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.",
95
+ tools: ["Glob", "Grep", "Read", "Bash", "LSP"],
96
+ model: "inherit",
97
+ systemPrompt: `You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.
98
+
99
+ === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
100
+ This is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:
101
+ - Creating new files (no Write, touch, or file creation of any kind)
102
+ - Modifying existing files (no Edit operations)
103
+ - Moving or copying files (no mv or cp)
104
+ - Creating temporary files anywhere, including /tmp
105
+ - Using redirect operators (>, >>, |) or heredocs to write to files
106
+ - Running ANY commands that change system state
107
+
108
+ 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.
109
+
110
+ You will be provided with a set of requirements and optionally a perspective on how to approach the design process.
111
+
112
+ ## Your Process
113
+
114
+ 1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.
115
+
116
+ 2. **Explore Thoroughly**:
117
+ - Read any files provided to you in the initial prompt
118
+ - Find existing patterns and conventions using Glob, Grep, and Read
119
+ - Understand the current architecture
120
+ - Identify similar features as reference
121
+ - Trace through relevant code paths
122
+ - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
123
+ - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
124
+
125
+ 3. **Design Solution**:
126
+ - Create implementation approach based on your assigned perspective
127
+ - Consider trade-offs and architectural decisions
128
+ - Follow existing patterns where appropriate
129
+
130
+ 4. **Detail the Plan**:
131
+ - Provide step-by-step implementation strategy
132
+ - Identify dependencies and sequencing
133
+ - Anticipate potential challenges
134
+
135
+ ## Required Output
136
+
137
+ End your response with:
138
+
139
+ ### Critical Files for Implementation
140
+ List 3-5 files most critical for implementing this plan:
141
+ - path/to/file1.ts - [Brief reason: e.g., "Core logic to modify"]
142
+ - path/to/file2.ts - [Brief reason: e.g., "Interfaces to implement"]
143
+ - path/to/file3.ts - [Brief reason: e.g., "Pattern to follow"]
144
+
145
+ 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.`,
146
+ filePath: "<builtin:Plan>",
147
+ scope: "builtin",
148
+ priority: 3,
149
+ },
150
+ {
151
+ name: "general-purpose",
152
+ description:
153
+ "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.",
154
+ systemPrompt: `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.
155
+
156
+ Your strengths:
157
+ - Searching for code, configurations, and patterns across large codebases
158
+ - Analyzing multiple files to understand system architecture
159
+ - Investigating complex questions that require exploring many files
160
+ - Performing multi-step research tasks
161
+
162
+ Guidelines:
163
+ - For file searches: Use Grep or Glob when you need to search broadly. Use Read when you know the specific file path.
164
+ - For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.
165
+ - Be thorough: Check multiple locations, consider different naming conventions, look for related files.
166
+ - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.
167
+ - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.
168
+ - 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.
169
+ - For clear communication, avoid using emojis.`,
170
+ filePath: "<builtin:general-purpose>",
171
+ scope: "builtin",
172
+ priority: 3,
173
+ },
174
+ ];
175
+
19
176
  interface SubagentFrontmatter {
20
177
  name?: string;
21
178
  description?: string;
@@ -231,10 +388,10 @@ export async function loadSubagentConfigurations(
231
388
  ): Promise<SubagentConfiguration[]> {
232
389
  const projectDir = join(workdir, ".wave", "agents");
233
390
  const userDir = join(process.env.HOME || "~", ".wave", "agents");
234
- const builtinDir = getBuiltinSubagentsDir();
235
391
 
236
392
  // Load configurations from all sources
237
- const builtinConfigs = scanSubagentDirectory(builtinDir, "builtin");
393
+ // Builtin subagents are hardcoded in TS, not scanned from a directory
394
+ const builtinConfigs = [...BUILTIN_SUBAGENTS];
238
395
  const projectConfigs = scanSubagentDirectory(projectDir, "project");
239
396
  const userConfigs = scanSubagentDirectory(userDir, "user");
240
397
 
@@ -1,28 +0,0 @@
1
- ---
2
- name: init
3
- description: Analyze the codebase and create an AGENTS.md file to guide future agents.
4
- disable-model-invocation: true
5
- ---
6
-
7
- Please analyze this codebase and create a AGENTS.md file, which will be given to future instances of Agent to operate in this repository.
8
-
9
- What to add:
10
- 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.
11
- 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.
12
-
13
- Usage notes:
14
- - If there's already a AGENTS.md, suggest improvements to it.
15
- - 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".
16
- - Avoid listing every component or file structure that can be easily discovered.
17
- - Don't include generic development practices.
18
- - 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.
19
- - Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.
20
- - If there is a README.md, make sure to include the important parts.
21
- - 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.
22
- - Be sure to prefix the file with the following text:
23
-
24
- ```
25
- # AGENTS.md
26
-
27
- This file provides guidance to Agent when working with code in this repository.
28
- ```
@@ -1,79 +0,0 @@
1
- ---
2
- name: loop
3
- description: Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)
4
- allowed-tools: CronCreate, Skill
5
- user-invocable: true
6
- ---
7
-
8
- # /loop — schedule a recurring prompt
9
-
10
- Parse the input below into `[interval] <prompt…>` and schedule it with CronCreate.
11
-
12
- ## Usage
13
-
14
- ```
15
- /loop [interval] <prompt>
16
-
17
- Run a prompt or slash command on a recurring interval.
18
-
19
- Intervals: Ns, Nm, Nh, Nd (e.g. 5m, 30m, 2h, 1d). Minimum granularity is 1 minute.
20
- If no interval is specified, defaults to 10m.
21
-
22
- Examples:
23
- /loop 5m /babysit-prs
24
- /loop 30m check the deploy
25
- /loop 1h /standup 1
26
- /loop check the deploy (defaults to 10m)
27
- /loop check the deploy every 20m
28
- ```
29
-
30
- ## Parsing (in priority order)
31
-
32
- 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.
33
- 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.
34
- 3. **Default**: otherwise, interval is `10m` and the entire input is the prompt.
35
-
36
- If the resulting prompt is empty, show usage `/loop [interval] <prompt>` and stop — do not call CronCreate.
37
-
38
- Examples:
39
- - `5m /babysit-prs` → interval `5m`, prompt `/babysit-prs` (rule 1)
40
- - `check the deploy every 20m` → interval `20m`, prompt `check the deploy` (rule 2)
41
- - `run tests every 5 minutes` → interval `5m`, prompt `run tests` (rule 2)
42
- - `check the deploy` → interval `10m`, prompt `check the deploy` (rule 3)
43
- - `check every PR` → interval `10m`, prompt `check every PR` (rule 3 — "every" not followed by time)
44
- - `5m` → empty prompt → show usage
45
-
46
- ## Interval → cron
47
-
48
- Supported suffixes: `s` (seconds, rounded up to nearest minute, min 1), `m` (minutes), `h` (hours), `d` (days). Convert:
49
-
50
- | Interval pattern | Cron expression | Notes |
51
- |-----------------------|---------------------|------------------------------------------|
52
- | `Nm` where N ≤ 59 | `*/N * * * *` | every N minutes |
53
- | `Nm` where N ≥ 60 | `0 */H * * *` | round to hours (H = N/60, must divide 24)|
54
- | `Nh` where N ≤ 23 | `0 */N * * *` | every N hours |
55
- | `Nd` | `0 0 */N * *` | every N days at midnight local |
56
- | `Ns` | treat as `ceil(N/60)m` | cron minimum granularity is 1 minute |
57
-
58
- **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.
59
-
60
- ## Avoid the :00 and :30 minute marks
61
-
62
- When the user's request is approximate, pick a minute that is NOT 0 or 30:
63
- - "every morning around 9" → `57 8 * * *` or `3 9 * * *` (not `0 9 * * *`)
64
- - "hourly" → `7 * * * *` (not `0 * * * *`)
65
-
66
- Only use minute 0 or 30 when the user names that exact time and clearly means it ("at 9:00 sharp", "at half past").
67
-
68
- ## Action
69
-
70
- 1. Call CronCreate with:
71
- - `cron`: the expression from the table above
72
- - `prompt`: the parsed prompt from above, verbatim (slash commands are passed through unchanged)
73
- - `recurring`: `true`
74
- 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).
75
- 3. **Then immediately execute the parsed prompt now** — don't wait for the first cron fire. If it's a slash command, run it directly; otherwise act on it directly.
76
-
77
- ## Input
78
-
79
- $ARGUMENTS
@@ -1,69 +0,0 @@
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
- | `WAVE_PROMPT_CACHE_REGEX` | Regex pattern to match model names that support prompt caching. Models matching this pattern will have cache control markers applied. | `claude` |
34
-
35
- ## Configuration Scopes
36
-
37
- Environment variables can be set in different scopes, with the following precedence (highest to lowest):
38
-
39
- 1. **Local Scope**: `.wave/settings.local.json` (Local overrides, ignored by git)
40
- 2. **Project Scope**: `.wave/settings.json` (Project-specific settings, shared via git)
41
- 3. **User Scope**: `~/.wave/settings.json` (Global settings for all projects)
42
- 4. **System Environment**: Variables set in your shell (e.g., `export WAVE_API_KEY=...`)
43
-
44
- ## Custom Environment Variables
45
-
46
- You can also define custom environment variables in the `env` field. These variables will be available to:
47
-
48
- - **Hooks**: Any shell command executed as a hook will have these variables in its environment.
49
- - **Tools**: Tools like `Bash` will have access to these variables.
50
-
51
- Example:
52
- ```json
53
- {
54
- "env": {
55
- "PROJECT_NAME": "my-awesome-project",
56
- "DEPLOY_TARGET": "staging"
57
- }
58
- }
59
- ```
60
-
61
- ## Live Reload
62
-
63
- 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.
64
-
65
- ## Best Practices
66
-
67
- - **Use Local Overrides for Secrets**: Never commit sensitive information like `WAVE_API_KEY` to `settings.json`. Use `settings.local.json` instead.
68
- - **Standard Naming**: Use uppercase and underscores for environment variable names (e.g., `MY_VARIABLE`).
69
- - **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.