snow-flow 9.0.6 → 9.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +2 -1
  2. package/postinstall.cjs +65 -11
  3. package/bunfig.toml +0 -2
  4. package/script/postinstall.mjs +0 -135
  5. package/script/preinstall.mjs +0 -45
  6. package/snow-code-config.example.json +0 -39
  7. package/src/acp/README.md +0 -164
  8. package/src/agent/generate.txt +0 -75
  9. package/src/dag/README.md +0 -473
  10. package/src/session/prompt/anthropic-20250930.txt +0 -166
  11. package/src/session/prompt/anthropic.txt +0 -235
  12. package/src/session/prompt/anthropic_spoof.txt +0 -1
  13. package/src/session/prompt/beast.txt +0 -200
  14. package/src/session/prompt/build-switch.txt +0 -5
  15. package/src/session/prompt/codex.txt +0 -353
  16. package/src/session/prompt/copilot-gpt-5.txt +0 -143
  17. package/src/session/prompt/gemini.txt +0 -217
  18. package/src/session/prompt/initialize.txt +0 -8
  19. package/src/session/prompt/plan.txt +0 -8
  20. package/src/session/prompt/qwen.txt +0 -141
  21. package/src/session/prompt/summarize-turn.txt +0 -5
  22. package/src/session/prompt/summarize.txt +0 -10
  23. package/src/session/prompt/title.txt +0 -24
  24. package/src/tool/bash.txt +0 -121
  25. package/src/tool/edit.txt +0 -10
  26. package/src/tool/glob.txt +0 -6
  27. package/src/tool/grep.txt +0 -8
  28. package/src/tool/ls.txt +0 -1
  29. package/src/tool/lsp-diagnostics.txt +0 -1
  30. package/src/tool/lsp-hover.txt +0 -1
  31. package/src/tool/multiedit.txt +0 -41
  32. package/src/tool/patch.txt +0 -1
  33. package/src/tool/read.txt +0 -12
  34. package/src/tool/task.txt +0 -76
  35. package/src/tool/todoread.txt +0 -14
  36. package/src/tool/todowrite.txt +0 -167
  37. package/src/tool/webfetch.txt +0 -14
  38. package/src/tool/websearch.txt +0 -11
  39. package/src/tool/write.txt +0 -8
  40. package/test-codespace-detection.js +0 -51
package/src/dag/README.md DELETED
@@ -1,473 +0,0 @@
1
- # DAG (Directed Acyclic Graph) Executor
2
-
3
- **Status:** ✅ Implemented
4
- **Date:** November 8, 2025
5
- **Version:** 1.0.0
6
-
7
- ---
8
-
9
- ## Overview
10
-
11
- The DAG Executor enables intelligent task orchestration with dependency-aware parallel execution. It automatically determines optimal execution order and maximizes parallelization while respecting task dependencies.
12
-
13
- **Key Benefits:**
14
- - **50-60% faster** multi-agent workflows through intelligent parallelization
15
- - **Automatic dependency resolution** with topological sorting
16
- - **Cycle detection** prevents infinite loops
17
- - **Progress tracking** for real-time monitoring
18
- - **Error handling** with graceful degradation
19
-
20
- ---
21
-
22
- ## Quick Start
23
-
24
- ```typescript
25
- import { DAG } from "./dag/executor"
26
- import { SessionPrompt } from "./session/prompt"
27
-
28
- // 1. Define tasks with dependencies
29
- const tasks: DAG.Task[] = [
30
- {
31
- id: "research",
32
- agentName: "general",
33
- prompt: "Research ServiceNow widget best practices",
34
- dependencies: [], // No dependencies = executes first
35
- },
36
- {
37
- id: "implement",
38
- agentName: "build",
39
- prompt: "Implement widget based on research",
40
- dependencies: ["research"], // Waits for research to complete
41
- },
42
- {
43
- id: "test",
44
- agentName: "plan",
45
- prompt: "Test the implemented widget",
46
- dependencies: ["implement"], // Waits for implement to complete
47
- },
48
- ]
49
-
50
- // 2. Build execution plan
51
- const plan = DAG.buildPlan(tasks)
52
-
53
- // 3. Visualize plan (optional)
54
- console.log(DAG.visualizePlan(plan))
55
-
56
- // 4. Execute with dependency-aware parallel execution
57
- const result = await DAG.execute(
58
- sessionID,
59
- plan,
60
- {
61
- baseAgent: "build",
62
- skipOnError: true, // Skip dependent tasks if a task fails
63
- },
64
- (event) => {
65
- // Progress callback
66
- console.log(`Progress: ${event.progress.percentage}%`)
67
- }
68
- )
69
-
70
- // 5. Check results
71
- console.log(`Completed: ${result.tasksCompleted}/${Object.keys(plan.tasks).length}`)
72
- console.log(`Time saved: ${result.parallelizationGain.toFixed(1)}%`)
73
- ```
74
-
75
- ---
76
-
77
- ## Core Concepts
78
-
79
- ### Task Definition
80
-
81
- ```typescript
82
- interface Task {
83
- id: string // Unique identifier for dependency tracking
84
- agentName: string // Agent to execute task (general, build, plan, etc.)
85
- prompt: string // Task instructions for the agent
86
- description?: string // Short description (3-5 words)
87
- dependencies: string[] // Array of task IDs that must complete first
88
- }
89
- ```
90
-
91
- ### Execution Plan
92
-
93
- The `buildPlan()` function performs:
94
- 1. **Dependency validation** - Ensures all dependencies exist
95
- 2. **Cycle detection** - Prevents circular dependencies
96
- 3. **Topological sort** - Determines execution order
97
- 4. **Level calculation** - Groups tasks by dependency level for parallel execution
98
-
99
- **Example:**
100
- ```typescript
101
- Input tasks:
102
- - A (deps: [])
103
- - B (deps: [])
104
- - C (deps: [A])
105
- - D (deps: [A, B])
106
- - E (deps: [C, D])
107
-
108
- Output plan:
109
- Level 0: [A, B] // 2 tasks in parallel
110
- Level 1: [C, D] // 2 tasks in parallel (after Level 0)
111
- Level 2: [E] // 1 task (after Level 1)
112
- ```
113
-
114
- ### Execution Flow
115
-
116
- ```
117
- for each level in plan.levels:
118
- ├─ Check dependencies satisfied
119
- ├─ Execute all tasks in level in parallel (Promise.all)
120
- ├─ Collect results
121
- └─ Move to next level
122
-
123
- Return aggregated results
124
- ```
125
-
126
- ---
127
-
128
- ## API Reference
129
-
130
- ### DAG.buildPlan(tasks: Task[]): Plan
131
-
132
- Builds execution plan from tasks with dependency resolution.
133
-
134
- **Returns:**
135
- ```typescript
136
- {
137
- tasks: Record<string, Task>, // Task map by ID
138
- levels: string[][], // [[level0_ids], [level1_ids], ...]
139
- rootTaskIds: string[] // Tasks with no dependencies
140
- }
141
- ```
142
-
143
- **Throws:**
144
- - `Error` if cyclic dependency detected
145
- - `Error` if task depends on non-existent task
146
-
147
- ---
148
-
149
- ### DAG.execute(sessionID, plan, context, onProgress?): Promise<PlanResult>
150
-
151
- Executes plan with dependency-aware parallel execution.
152
-
153
- **Parameters:**
154
- - `sessionID: string` - Session to execute tasks in
155
- - `plan: Plan` - Execution plan from buildPlan()
156
- - `context: object` - Execution context
157
- - `baseAgent?: string` - Default agent if not specified in task
158
- - `baseModel?: { providerID, modelID }` - Default model
159
- - `skipOnError?: boolean` - Skip dependent tasks on failure
160
- - `onProgress?: (event) => void` - Progress callback
161
-
162
- **Returns:**
163
- ```typescript
164
- {
165
- planId: string,
166
- success: boolean,
167
- tasksCompleted: number,
168
- tasksFailed: number,
169
- tasksSkipped: number,
170
- results: Record<string, TaskResult>,
171
- totalDuration: number,
172
- parallelizationGain: number // % time saved vs sequential
173
- }
174
- ```
175
-
176
- ---
177
-
178
- ### DAG.visualizePlan(plan: Plan): string
179
-
180
- Generates human-readable plan visualization.
181
-
182
- **Example output:**
183
- ```markdown
184
- # DAG Execution Plan
185
-
186
- **Total Tasks:** 5
187
- **Execution Levels:** 3
188
-
189
- ## Level 0 (2 tasks in parallel)
190
-
191
- - **research** (agent: general)
192
- - Description: Research phase
193
- - Dependencies: none
194
-
195
- - **analyze** (agent: general)
196
- - Description: Analysis phase
197
- - Dependencies: none
198
-
199
- ## Level 1 (2 tasks in parallel)
200
-
201
- - **design** (agent: build)
202
- - Description: Design phase
203
- - Dependencies: research, analyze
204
-
205
- ...
206
- ```
207
-
208
- ---
209
-
210
- ### DAG.validatePlan(plan: Plan): { valid: boolean, errors: string[] }
211
-
212
- Validates plan without executing.
213
-
214
- **Checks:**
215
- - All dependencies exist
216
- - Levels are correctly ordered
217
- - No circular dependencies
218
-
219
- ---
220
-
221
- ## Usage Patterns
222
-
223
- ### Pattern 1: Linear Workflow
224
-
225
- ```typescript
226
- // Research → Implement → Test
227
- const tasks = [
228
- { id: "research", agentName: "general", prompt: "Research...", dependencies: [] },
229
- { id: "implement", agentName: "build", prompt: "Implement...", dependencies: ["research"] },
230
- { id: "test", agentName: "plan", prompt: "Test...", dependencies: ["implement"] },
231
- ]
232
-
233
- // Execution: 3 levels, sequential
234
- ```
235
-
236
- ### Pattern 2: Parallel + Sequential
237
-
238
- ```typescript
239
- // Level 0: A, B, C (parallel)
240
- // Level 1: D (sequential, depends on A, B, C)
241
- const tasks = [
242
- { id: "A", agentName: "general", prompt: "...", dependencies: [] },
243
- { id: "B", agentName: "general", prompt: "...", dependencies: [] },
244
- { id: "C", agentName: "general", prompt: "...", dependencies: [] },
245
- { id: "D", agentName: "build", prompt: "...", dependencies: ["A", "B", "C"] },
246
- ]
247
-
248
- // Execution: 2 levels, 3→1 parallelization
249
- ```
250
-
251
- ### Pattern 3: Diamond (Fork-Join)
252
-
253
- ```typescript
254
- // A
255
- // / \
256
- // B C
257
- // \ /
258
- // D
259
- const tasks = [
260
- { id: "A", agentName: "general", prompt: "...", dependencies: [] },
261
- { id: "B", agentName: "build", prompt: "...", dependencies: ["A"] },
262
- { id: "C", agentName: "build", prompt: "...", dependencies: ["A"] },
263
- { id: "D", agentName: "plan", prompt: "...", dependencies: ["B", "C"] },
264
- ]
265
-
266
- // Execution: 3 levels (1 → 2 → 1)
267
- ```
268
-
269
- ### Pattern 4: Complex Multi-Stage
270
-
271
- See `examples.ts` for full-stack feature development pattern with 11 tasks across 5 levels.
272
-
273
- ---
274
-
275
- ## Error Handling
276
-
277
- ### Skip Dependent Tasks on Failure
278
-
279
- ```typescript
280
- const result = await DAG.execute(
281
- sessionID,
282
- plan,
283
- {
284
- skipOnError: true, // Skip tasks that depend on failed tasks
285
- }
286
- )
287
-
288
- // If task A fails:
289
- // - Tasks depending on A are skipped
290
- // - Tasks not depending on A still execute
291
- // - Partial completion is reported
292
- ```
293
-
294
- ### Retry Logic
295
-
296
- ```typescript
297
- // Retry failed tasks manually
298
- for (const [taskId, result] of Object.entries(planResult.results)) {
299
- if (!result.success) {
300
- console.log(`Task ${taskId} failed, retrying...`)
301
- // Re-execute specific task
302
- }
303
- }
304
- ```
305
-
306
- ---
307
-
308
- ## Performance Benchmarks
309
-
310
- ### Widget Creation (8 tasks)
311
-
312
- **Sequential execution:**
313
- ```
314
- research_widgets: 5s
315
- research_metrics: 5s
316
- analyze_requirements: 4s
317
- design_architecture: 6s
318
- design_ui: 4s
319
- implement_widget: 8s
320
- test_widget: 3s
321
- document_widget: 2s
322
- Total: 37s
323
- ```
324
-
325
- **DAG parallel execution:**
326
- ```
327
- Level 0 (parallel): research_widgets, research_metrics, analyze_requirements → 5s
328
- Level 1 (parallel): design_architecture, design_ui → 6s
329
- Level 2: implement_widget → 8s
330
- Level 3: test_widget → 3s
331
- Level 4: document_widget → 2s
332
- Total: 24s (35% faster)
333
- ```
334
-
335
- **Parallelization gain:** 35% time savings
336
-
337
- ---
338
-
339
- ## Integration with Task Tool
340
-
341
- The task tool now supports DAG parameters:
342
-
343
- ```typescript
344
- // Basic task (no dependencies)
345
- await task({
346
- subagent_type: "general",
347
- description: "Research phase",
348
- prompt: "Research best practices",
349
- task_id: "research" // For dependency tracking
350
- })
351
-
352
- // Task with dependencies
353
- await task({
354
- subagent_type: "build",
355
- description: "Implementation",
356
- prompt: "Implement based on research",
357
- task_id: "implement",
358
- dependencies: ["research"] // Waits for research
359
- })
360
- ```
361
-
362
- ---
363
-
364
- ## Examples
365
-
366
- See `examples.ts` for 6 comprehensive examples:
367
- 1. Linear Workflow (3 tasks)
368
- 2. Parallel Research + Sequential Implementation (5 tasks)
369
- 3. Full-Stack Feature Development (11 tasks)
370
- 4. Widget Creation (8 tasks, realistic scenario)
371
- 5. Diamond Pattern (4 tasks, fork-join)
372
- 6. Error Handling (3 tasks, failure propagation)
373
-
374
- Run examples:
375
- ```typescript
376
- import { runAllExamples } from "./dag/examples"
377
- runAllExamples()
378
- ```
379
-
380
- ---
381
-
382
- ## Testing
383
-
384
- ```bash
385
- cd /Users/nielsvanderwerf/snow-code
386
- bun test packages/snowcode/src/dag/executor.test.ts
387
-
388
- # Expected: 12 tests pass
389
- ✓ buildPlan: linear dependencies
390
- ✓ buildPlan: parallel tasks
391
- ✓ buildPlan: complex DAG
392
- ✓ buildPlan: detect cycles
393
- ✓ buildPlan: detect missing dependencies
394
- ✓ buildPlan: self-dependency as cycle
395
- ✓ buildPlan: diamond pattern
396
- ✓ validatePlan: correct plan
397
- ✓ validatePlan: invalid ordering
398
- ✓ visualizePlan: readable output
399
- ✓ complex: multi-level parallel
400
- ✓ complex: widget creation pattern
401
- ```
402
-
403
- ---
404
-
405
- ## Best Practices
406
-
407
- 1. **Start with Level 0 research tasks** - Gather information in parallel first
408
- 2. **Keep critical path short** - Minimize longest dependency chain
409
- 3. **Balance agent load** - Don't overload one agent type
410
- 4. **Use descriptive task_ids** - Makes debugging easier
411
- 5. **Pass context between tasks** - Reference previous outputs in prompts
412
- 6. **Validate before executing** - Use `validatePlan()` to catch errors early
413
- 7. **Monitor progress** - Use progress callback for real-time updates
414
- 8. **Handle failures gracefully** - Use `skipOnError: true` for non-critical paths
415
-
416
- ---
417
-
418
- ## Troubleshooting
419
-
420
- ### "Cyclic dependency detected"
421
-
422
- **Cause:** Task A depends on B, B depends on C, C depends on A
423
-
424
- **Solution:** Break the cycle by removing circular dependencies
425
-
426
- ### "Task depends on non-existent task"
427
-
428
- **Cause:** Dependency references task_id that doesn't exist
429
-
430
- **Solution:** Ensure all task_ids in dependencies array are valid
431
-
432
- ### "Unable to resolve dependencies"
433
-
434
- **Cause:** Internal error, shouldn't happen if cycle detection worked
435
-
436
- **Solution:** Report bug with task definitions
437
-
438
- ---
439
-
440
- ## Future Enhancements
441
-
442
- 1. **Dynamic DAG adjustment** - Add/remove tasks mid-execution
443
- 2. **Resource constraints** - Limit concurrent agents (e.g., max 4 parallel)
444
- 3. **Priority scheduling** - Execute high-priority tasks first
445
- 4. **Caching** - Skip re-execution if inputs haven't changed
446
- 5. **Conditional execution** - Execute tasks based on previous results
447
- 6. **Visualization UI** - Real-time DAG visualization in IDE
448
-
449
- ---
450
-
451
- ## Related Files
452
-
453
- - `executor.ts` - Core DAG executor implementation
454
- - `executor.test.ts` - Comprehensive test suite (12 tests)
455
- - `examples.ts` - 6 practical examples
456
- - `../tool/task.ts` - Task tool with DAG support
457
- - `../tool/task.txt` - Task tool documentation
458
- - `../.snow-code/agent/dag-orchestrator.md` - DAG orchestrator agent prompt
459
-
460
- ---
461
-
462
- ## Conclusion
463
-
464
- The DAG Executor provides **intelligent task orchestration** with automatic parallelization, saving 50-60% execution time for complex multi-agent workflows. Combined with the tool call caching system, Snow-Code can now handle sophisticated development tasks with unprecedented efficiency.
465
-
466
- **Quick wins:**
467
- - ✅ Use for any workflow with 3+ related tasks
468
- - ✅ Research tasks in parallel at Level 0
469
- - ✅ Implementation tasks in middle levels
470
- - ✅ Testing/validation at final levels
471
- - ✅ Monitor with progress callbacks
472
-
473
- **Start orchestrating! 🚀**
@@ -1,166 +0,0 @@
1
- You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
2
-
3
- IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Do not assist with credential discovery or harvesting, including bulk crawling for SSH keys, browser cookies, or cryptocurrency wallets. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.
4
- IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
5
-
6
- If the user asks for help or wants to give feedback inform them of the following:
7
- - /help: Get help with using Claude Code
8
- - To give feedback, users should report the issue at https://github.com/anthropics/claude-code/issues
9
-
10
- When the user directly asks about Claude Code (eg. "can Claude Code do...", "does Claude Code have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific Claude Code feature (eg. implement a hook, or write a slash command), use the WebFetch tool to gather information to answer the question from Claude Code docs. The list of available docs is available at https://docs.claude.com/en/docs/claude-code/claude_code_docs_map.md.
11
-
12
- # Tone and style
13
- You should be concise, direct, and to the point, while providing complete information and matching the level of detail you provide in your response with the level of complexity of the user's query or the work you have completed.
14
- A concise response is generally less than 4 lines, not including tool calls or code generated. You should provide more detail when the task is complex or when the user asks you to.
15
- IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
16
- IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
17
- Do not add additional code explanation summary unless requested by the user. After working on a file, briefly confirm that you have completed the task, rather than providing an explanation of what you did.
18
- Answer the user's question directly, avoiding any elaboration, explanation, introduction, conclusion, or excessive details. Brief answers are best, but be sure to provide complete information. You MUST avoid extra preamble before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...".
19
-
20
- Here are some examples to demonstrate appropriate verbosity:
21
- <example>
22
- user: 2 + 2
23
- assistant: 4
24
- </example>
25
-
26
- <example>
27
- user: what is 2+2?
28
- assistant: 4
29
- </example>
30
-
31
- <example>
32
- user: is 11 a prime number?
33
- assistant: Yes
34
- </example>
35
-
36
- <example>
37
- user: what command should I run to list files in the current directory?
38
- assistant: ls
39
- </example>
40
-
41
- <example>
42
- user: what command should I run to watch files in the current directory?
43
- assistant: [runs ls to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
44
- npm run dev
45
- </example>
46
-
47
- <example>
48
- user: How many golf balls fit inside a jetta?
49
- assistant: 150000
50
- </example>
51
-
52
- <example>
53
- user: what files are in the directory src/?
54
- assistant: [runs ls and sees foo.c, bar.c, baz.c]
55
- user: which file contains the implementation of foo?
56
- assistant: src/foo.c
57
- </example>
58
- When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
59
- Remember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
60
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
61
- If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
62
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
63
- IMPORTANT: Keep your responses short, since they will be displayed on a command line interface.
64
-
65
- # Proactiveness
66
- You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
67
- - Doing the right thing when asked, including taking actions and follow-up actions
68
- - Not surprising the user with actions you take without asking
69
- For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.
70
-
71
- # Professional objectivity
72
- Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if Claude honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
73
-
74
- # Task Management
75
- You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
76
- These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
77
-
78
- It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
79
-
80
- Examples:
81
-
82
- <example>
83
- user: Run the build and fix any type errors
84
- assistant: I'm going to use the TodoWrite tool to write the following items to the todo list:
85
- - Run the build
86
- - Fix any type errors
87
-
88
- I'm now going to run the build using Bash.
89
-
90
- Looks like I found 10 type errors. I'm going to use the TodoWrite tool to write 10 items to the todo list.
91
-
92
- marking the first todo as in_progress
93
-
94
- Let me start working on the first item...
95
-
96
- The first item has been fixed, let me mark the first todo as completed, and move on to the second item...
97
- ..
98
- ..
99
- </example>
100
- In the above example, the assistant completes all the tasks, including the 10 error fixes and running the build and fixing all errors.
101
-
102
- <example>
103
- user: Help me write a new feature that allows users to track their usage metrics and export them to various formats
104
-
105
- assistant: I'll help you implement a usage metrics tracking and export feature. Let me first use the TodoWrite tool to plan this task.
106
- Adding the following todos to the todo list:
107
- 1. Research existing metrics tracking in the codebase
108
- 2. Design the metrics collection system
109
- 3. Implement core metrics tracking functionality
110
- 4. Create export functionality for different formats
111
-
112
- Let me start by researching the existing codebase to understand what metrics we might already be tracking and how we can build on that.
113
-
114
- I'm going to search for any existing metrics or telemetry code in the project.
115
-
116
- I've found some existing telemetry code. Let me mark the first todo as in_progress and start designing our metrics tracking system based on what I've learned...
117
-
118
- [Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]
119
- </example>
120
-
121
-
122
- Users may configure 'hooks', shell commands that execute in response to events like tool calls, in settings. Treat feedback from hooks, including <user-prompt-submit-hook>, as coming from the user. If you get blocked by a hook, determine if you can adjust your actions in response to the blocked message. If not, ask the user to check their hooks configuration.
123
-
124
- # Doing tasks
125
- The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
126
- - Use the TodoWrite tool to plan the task if required
127
-
128
- - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are automatically added by the system, and bear no direct relation to the specific tool results or user messages in which they appear.
129
-
130
-
131
- # Tool usage policy
132
- - When doing file search, prefer to use the Task tool in order to reduce context usage.
133
- - You should proactively use the Task tool with specialized agents when the task at hand matches the agent's description.
134
-
135
- - When WebFetch returns a message about a redirect to a different host, you should immediately make a new WebFetch request with the redirect URL provided in the response.
136
- - You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls to run the calls in parallel.
137
- - If the user specifies that they want you to run tools "in parallel", you MUST send a single message with multiple tool use content blocks. For example, if you need to launch multiple agents in parallel, send a single message with multiple Task tool calls.
138
- - Use specialized tools instead of bash commands when possible, as this provides a better user experience. For file operations, use dedicated tools: Read for reading files instead of cat/head/tail, Edit for editing instead of sed/awk, and Write for creating files instead of cat with heredoc or echo redirection. Reserve bash tools exclusively for actual system commands and terminal operations that require shell execution. NEVER use bash echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.
139
-
140
-
141
- Here is useful information about the environment you are running in:
142
- <env>
143
- Working directory: /home/user/dev/projects/snow-code
144
- Is directory a git repo: Yes
145
- Platform: linux
146
- OS Version: Linux 6.12.4-arch1-1
147
- Today's date: 2025-09-30
148
- </env>
149
- You are powered by the model named Sonnet 4.5. The exact model ID is claude-sonnet-4-5-20250929.
150
-
151
- Assistant knowledge cutoff is January 2025.
152
-
153
-
154
- IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Do not assist with credential discovery or harvesting, including bulk crawling for SSH keys, browser cookies, or cryptocurrency wallets. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.
155
-
156
-
157
- IMPORTANT: Always use the TodoWrite tool to plan and track tasks throughout the conversation.
158
-
159
- # Code References
160
-
161
- When referencing specific functions or pieces of code include the pattern `file_path:line_number` to allow the user to easily navigate to the source code location.
162
-
163
- <example>
164
- user: Where are errors from the client handled?
165
- assistant: Clients are marked as failed in the `connectToServer` function in src/services/process.ts:712.
166
- </example>