@iaforged/context-code 1.0.58 → 1.0.61

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 (73) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/src/bridge/bridgeMain.js +40 -40
  3. package/dist/src/cli/print.js +12 -12
  4. package/dist/src/commands/commit-push-pr.js +55 -55
  5. package/dist/src/commands/createMovedToPluginCommand.js +9 -9
  6. package/dist/src/commands/init-verifiers.js +241 -241
  7. package/dist/src/commands/init.js +216 -216
  8. package/dist/src/commands/install.js +2 -2
  9. package/dist/src/commands/review.js +22 -22
  10. package/dist/src/commands/terminalSetup/terminalSetup.js +24 -24
  11. package/dist/src/components/agents/generateAgent.js +92 -92
  12. package/dist/src/components/grove/Grove.js +10 -10
  13. package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +8 -8
  14. package/dist/src/constants/github-app.js +134 -134
  15. package/dist/src/constants/prompts.js +123 -123
  16. package/dist/src/coordinator/coordinatorMode.js +252 -252
  17. package/dist/src/ink/reconciler.js +7 -7
  18. package/dist/src/memdir/findRelevantMemories.js +6 -6
  19. package/dist/src/services/MagicDocs/prompts.js +56 -56
  20. package/dist/src/services/PromptSuggestion/promptSuggestion.js +29 -29
  21. package/dist/src/services/SessionMemory/prompts.js +66 -66
  22. package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +9 -9
  23. package/dist/src/skills/bundled/batch.js +78 -78
  24. package/dist/src/skills/bundled/claudeApi.js +34 -34
  25. package/dist/src/skills/bundled/claudeInChrome.js +4 -4
  26. package/dist/src/skills/bundled/debug.js +36 -36
  27. package/dist/src/skills/bundled/scheduleRemoteAgents.js +151 -151
  28. package/dist/src/skills/bundled/skillify.js +134 -134
  29. package/dist/src/skills/bundled/stuck.js +53 -53
  30. package/dist/src/skills/bundled/updateConfig.js +418 -418
  31. package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +26 -26
  32. package/dist/src/tools/AgentTool/AgentTool.js +7 -7
  33. package/dist/src/tools/AgentTool/built-in/claudeCodeGuideAgent.js +67 -67
  34. package/dist/src/tools/AgentTool/built-in/exploreAgent.js +32 -32
  35. package/dist/src/tools/AgentTool/built-in/generalPurposeAgent.js +13 -13
  36. package/dist/src/tools/AgentTool/built-in/planAgent.js +49 -49
  37. package/dist/src/tools/AgentTool/built-in/statuslineSetup.js +129 -129
  38. package/dist/src/tools/AgentTool/built-in/verificationAgent.js +119 -119
  39. package/dist/src/tools/AgentTool/prompt.js +131 -131
  40. package/dist/src/tools/AgentTool/runAgent.js +9 -9
  41. package/dist/src/tools/BashTool/BashTool.js +10 -10
  42. package/dist/src/tools/BashTool/prompt.js +94 -94
  43. package/dist/src/tools/ConfigTool/prompt.js +29 -29
  44. package/dist/src/tools/EnterWorktreeTool/prompt.js +27 -27
  45. package/dist/src/tools/FileReadTool/prompt.js +12 -12
  46. package/dist/src/tools/PowerShellTool/prompt.js +82 -82
  47. package/dist/src/tools/RemoteTriggerTool/prompt.js +9 -9
  48. package/dist/src/tools/ScheduleCronTool/prompt.js +37 -37
  49. package/dist/src/tools/TeamCreateTool/prompt.js +110 -110
  50. package/dist/src/tools/TeamDeleteTool/prompt.js +13 -13
  51. package/dist/src/utils/advisor.js +15 -15
  52. package/dist/src/utils/api.js +2 -2
  53. package/dist/src/utils/autoUpdater.js +18 -18
  54. package/dist/src/utils/bash/ShellSnapshot.js +86 -86
  55. package/dist/src/utils/bash/commands.js +61 -61
  56. package/dist/src/utils/claudeInChrome/prompt.js +53 -53
  57. package/dist/src/utils/claudeInChrome/setup.js +8 -8
  58. package/dist/src/utils/databaseMcp/server/queries.js +632 -632
  59. package/dist/src/utils/deepLink/registerProtocol.js +35 -35
  60. package/dist/src/utils/deepLink/terminalLauncher.js +12 -12
  61. package/dist/src/utils/hooks/execAgentHook.js +7 -7
  62. package/dist/src/utils/hooks/execPromptHook.js +4 -4
  63. package/dist/src/utils/hooks/skillImprovement.js +36 -36
  64. package/dist/src/utils/mcp/dateTimeParser.js +9 -9
  65. package/dist/src/utils/messages.js +191 -191
  66. package/dist/src/utils/powershell/parser.js +253 -253
  67. package/dist/src/utils/sessionTitle.js +12 -12
  68. package/dist/src/utils/sideQuestion.js +17 -17
  69. package/dist/src/utils/swarm/backends/registry.js +9 -9
  70. package/dist/src/utils/telemetry/instrumentation.js +9 -9
  71. package/dist/src/utils/teleport.js +15 -15
  72. package/dist/src/utils/undercover.js +28 -28
  73. package/package.json +170 -170
@@ -5,55 +5,55 @@ import { getFsImplementation } from '../../utils/fsOperations.js';
5
5
  * Get the Magic Docs update prompt template
6
6
  */
7
7
  function getUpdatePromptTemplate() {
8
- return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
9
-
10
- Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.
11
-
12
- The file {{docPath}} has already been read for you. Here are its current contents:
13
- <current_doc_content>
14
- {{docContents}}
15
- </current_doc_content>
16
-
17
- Document title: {{docTitle}}
18
- {{customInstructions}}
19
-
20
- Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.
21
-
22
- CRITICAL RULES FOR EDITING:
23
- - Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
24
- - If there's an italicized line immediately after the header, preserve it exactly as-is
25
- - Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
26
- - Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
27
- - Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
28
- - Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
29
- - Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
30
- - Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting
31
-
32
- DOCUMENTATION PHILOSOPHY - READ CAREFULLY:
33
- - BE TERSE. High signal only. No filler words or unnecessary elaboration.
34
- - Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
35
- - Do NOT duplicate information that's already obvious from reading the source code
36
- - Do NOT document every function, parameter, or line number reference
37
- - Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
38
- - Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives
39
-
40
- What TO document:
41
- - High-level architecture and system design
42
- - Non-obvious patterns, conventions, or gotchas
43
- - Key entry points and where to start reading code
44
- - Important design decisions and their rationale
45
- - Critical dependencies or integration points
46
- - References to related files, docs, or code (like a wiki) - help readers navigate to relevant context
47
-
48
- What NOT to document:
49
- - Anything obvious from reading the code itself
50
- - Exhaustive lists of files, functions, or parameters
51
- - Step-by-step implementation details
52
- - Low-level code mechanics
53
- - Information already in CLAUDE.md or other project docs
54
-
55
- Use the Edit tool with file_path: {{docPath}}
56
-
8
+ return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
9
+
10
+ Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.
11
+
12
+ The file {{docPath}} has already been read for you. Here are its current contents:
13
+ <current_doc_content>
14
+ {{docContents}}
15
+ </current_doc_content>
16
+
17
+ Document title: {{docTitle}}
18
+ {{customInstructions}}
19
+
20
+ Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.
21
+
22
+ CRITICAL RULES FOR EDITING:
23
+ - Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
24
+ - If there's an italicized line immediately after the header, preserve it exactly as-is
25
+ - Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
26
+ - Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
27
+ - Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
28
+ - Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
29
+ - Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
30
+ - Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting
31
+
32
+ DOCUMENTATION PHILOSOPHY - READ CAREFULLY:
33
+ - BE TERSE. High signal only. No filler words or unnecessary elaboration.
34
+ - Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
35
+ - Do NOT duplicate information that's already obvious from reading the source code
36
+ - Do NOT document every function, parameter, or line number reference
37
+ - Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
38
+ - Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives
39
+
40
+ What TO document:
41
+ - High-level architecture and system design
42
+ - Non-obvious patterns, conventions, or gotchas
43
+ - Key entry points and where to start reading code
44
+ - Important design decisions and their rationale
45
+ - Critical dependencies or integration points
46
+ - References to related files, docs, or code (like a wiki) - help readers navigate to relevant context
47
+
48
+ What NOT to document:
49
+ - Anything obvious from reading the code itself
50
+ - Exhaustive lists of files, functions, or parameters
51
+ - Step-by-step implementation details
52
+ - Low-level code mechanics
53
+ - Information already in CLAUDE.md or other project docs
54
+
55
+ Use the Edit tool with file_path: {{docPath}}
56
+
57
57
  REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`;
58
58
  }
59
59
  /**
@@ -90,13 +90,13 @@ export async function buildMagicDocsUpdatePrompt(docContents, docPath, docTitle,
90
90
  const promptTemplate = await loadMagicDocsPrompt();
91
91
  // Build custom instructions section if provided
92
92
  const customInstructions = instructions
93
- ? `
94
-
95
- DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
96
- The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
97
-
98
- "${instructions}"
99
-
93
+ ? `
94
+
95
+ DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
96
+ The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
97
+
98
+ "${instructions}"
99
+
100
100
  These instructions take priority over the general rules below. Make sure your updates align with these specific guidelines.`
101
101
  : '';
102
102
  // Substitute variables in the prompt
@@ -184,35 +184,35 @@ export function getParentCacheSuppressReason(lastAssistantMessage) {
184
184
  ? 'cache_cold'
185
185
  : null;
186
186
  }
187
- const SUGGESTION_PROMPT = `[SUGGESTION MODE: Suggest what the user might naturally type next into Context Code.]
188
-
189
- FIRST: Look at the user's recent messages and original request.
190
-
191
- Your job is to predict what THEY would type - not what you think they should do.
192
-
193
- THE TEST: Would they think "I was just about to type that"?
194
-
195
- EXAMPLES:
196
- User asked "fix the bug and run tests", bug is fixed → "run the tests"
197
- After code written → "try it out"
198
- Claude offers options → suggest the one the user would likely pick, based on conversation
199
- Claude asks to continue → "yes" or "go ahead"
200
- Task complete, obvious follow-up → "commit this" or "push it"
201
- After error or misunderstanding → silence (let them assess/correct)
202
-
203
- Be specific: "run the tests" beats "continue".
204
-
205
- NEVER SUGGEST:
206
- - Evaluative ("looks good", "thanks")
207
- - Questions ("what about...?")
208
- - Claude-voice ("Let me...", "I'll...", "Here's...")
209
- - New ideas they didn't ask about
210
- - Multiple sentences
211
-
212
- Stay silent if the next step isn't obvious from what the user said.
213
-
214
- Format: 2-12 words, match the user's style. Or nothing.
215
-
187
+ const SUGGESTION_PROMPT = `[SUGGESTION MODE: Suggest what the user might naturally type next into Context Code.]
188
+
189
+ FIRST: Look at the user's recent messages and original request.
190
+
191
+ Your job is to predict what THEY would type - not what you think they should do.
192
+
193
+ THE TEST: Would they think "I was just about to type that"?
194
+
195
+ EXAMPLES:
196
+ User asked "fix the bug and run tests", bug is fixed → "run the tests"
197
+ After code written → "try it out"
198
+ Claude offers options → suggest the one the user would likely pick, based on conversation
199
+ Claude asks to continue → "yes" or "go ahead"
200
+ Task complete, obvious follow-up → "commit this" or "push it"
201
+ After error or misunderstanding → silence (let them assess/correct)
202
+
203
+ Be specific: "run the tests" beats "continue".
204
+
205
+ NEVER SUGGEST:
206
+ - Evaluative ("looks good", "thanks")
207
+ - Questions ("what about...?")
208
+ - Claude-voice ("Let me...", "I'll...", "Here's...")
209
+ - New ideas they didn't ask about
210
+ - Multiple sentences
211
+
212
+ Stay silent if the next step isn't obvious from what the user said.
213
+
214
+ Format: 2-12 words, match the user's style. Or nothing.
215
+
216
216
  Reply with ONLY the suggestion, no quotes or explanation.`;
217
217
  const SUGGESTION_PROMPTS = {
218
218
  user_intent: SUGGESTION_PROMPT,
@@ -6,74 +6,74 @@ import { getErrnoCode, toError } from '../../utils/errors.js';
6
6
  import { logError } from '../../utils/log.js';
7
7
  const MAX_SECTION_LENGTH = 2000;
8
8
  const MAX_TOTAL_SESSION_MEMORY_TOKENS = 12000;
9
- export const DEFAULT_SESSION_MEMORY_TEMPLATE = `
10
- # Session Title
11
- _A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_
12
-
13
- # Current State
14
- _What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._
15
-
16
- # Task specification
17
- _What did the user ask to build? Any design decisions or other explanatory context_
18
-
19
- # Files and Functions
20
- _What are the important files? In short, what do they contain and why are they relevant?_
21
-
22
- # Workflow
23
- _What bash commands are usually run and in what order? How to interpret their output if not obvious?_
24
-
25
- # Errors & Corrections
26
- _Errors encountered and how they were fixed. What did the user correct? What approaches failed and should not be tried again?_
27
-
28
- # Codebase and System Documentation
29
- _What are the important system components? How do they work/fit together?_
30
-
31
- # Learnings
32
- _What has worked well? What has not? What to avoid? Do not duplicate items from other sections_
33
-
34
- # Key results
35
- _If the user asked a specific output such as an answer to a question, a table, or other document, repeat the exact result here_
36
-
37
- # Worklog
38
- _Step by step, what was attempted, done? Very terse summary for each step_
9
+ export const DEFAULT_SESSION_MEMORY_TEMPLATE = `
10
+ # Session Title
11
+ _A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_
12
+
13
+ # Current State
14
+ _What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._
15
+
16
+ # Task specification
17
+ _What did the user ask to build? Any design decisions or other explanatory context_
18
+
19
+ # Files and Functions
20
+ _What are the important files? In short, what do they contain and why are they relevant?_
21
+
22
+ # Workflow
23
+ _What bash commands are usually run and in what order? How to interpret their output if not obvious?_
24
+
25
+ # Errors & Corrections
26
+ _Errors encountered and how they were fixed. What did the user correct? What approaches failed and should not be tried again?_
27
+
28
+ # Codebase and System Documentation
29
+ _What are the important system components? How do they work/fit together?_
30
+
31
+ # Learnings
32
+ _What has worked well? What has not? What to avoid? Do not duplicate items from other sections_
33
+
34
+ # Key results
35
+ _If the user asked a specific output such as an answer to a question, a table, or other document, repeat the exact result here_
36
+
37
+ # Worklog
38
+ _Step by step, what was attempted, done? Very terse summary for each step_
39
39
  `;
40
40
  function getDefaultUpdatePrompt() {
41
- return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
42
-
43
- Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file.
44
-
45
- The file {{notesPath}} has already been read for you. Here are its current contents:
46
- <current_notes_content>
47
- {{currentNotes}}
48
- </current_notes_content>
49
-
50
- Your ONLY task is to use the Edit tool to update the notes file, then stop. You can make multiple edits (update every section as needed) - make all Edit tool calls in parallel in a single message. Do not call any other tools.
51
-
52
- CRITICAL RULES FOR EDITING:
53
- - The file must maintain its exact structure with all sections, headers, and italic descriptions intact
54
- -- NEVER modify, delete, or add section headers (the lines starting with '#' like # Task specification)
55
- -- NEVER modify or delete the italic _section description_ lines (these are the lines in italics immediately following each header - they start and end with underscores)
56
- -- The italic _section descriptions_ are TEMPLATE INSTRUCTIONS that must be preserved exactly as-is - they guide what content belongs in each section
57
- -- ONLY update the actual content that appears BELOW the italic _section descriptions_ within each existing section
58
- -- Do NOT add any new sections, summaries, or information outside the existing structure
59
- - Do NOT reference this note-taking process or instructions anywhere in the notes
60
- - It's OK to skip updating a section if there are no substantial new insights to add. Do not add filler content like "No info yet", just leave sections blank/unedited if appropriate.
61
- - Write DETAILED, INFO-DENSE content for each section - include specifics like file paths, function names, error messages, exact commands, technical details, etc.
62
- - For "Key results", include the complete, exact output the user requested (e.g., full table, full answer, etc.)
63
- - Do not include information that's already in the CLAUDE.md files included in the context
64
- - Keep each section under ~${MAX_SECTION_LENGTH} tokens/words - if a section is approaching this limit, condense it by cycling out less important details while preserving the most critical information
65
- - Focus on actionable, specific information that would help someone understand or recreate the work discussed in the conversation
66
- - IMPORTANT: Always update "Current State" to reflect the most recent work - this is critical for continuity after compaction
67
-
68
- Use the Edit tool with file_path: {{notesPath}}
69
-
70
- STRUCTURE PRESERVATION REMINDER:
71
- Each section has TWO parts that must be preserved exactly as they appear in the current file:
72
- 1. The section header (line starting with #)
73
- 2. The italic description line (the _italicized text_ immediately after the header - this is a template instruction)
74
-
75
- You ONLY update the actual content that comes AFTER these two preserved lines. The italic description lines starting and ending with underscores are part of the template structure, NOT content to be edited or removed.
76
-
41
+ return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
42
+
43
+ Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file.
44
+
45
+ The file {{notesPath}} has already been read for you. Here are its current contents:
46
+ <current_notes_content>
47
+ {{currentNotes}}
48
+ </current_notes_content>
49
+
50
+ Your ONLY task is to use the Edit tool to update the notes file, then stop. You can make multiple edits (update every section as needed) - make all Edit tool calls in parallel in a single message. Do not call any other tools.
51
+
52
+ CRITICAL RULES FOR EDITING:
53
+ - The file must maintain its exact structure with all sections, headers, and italic descriptions intact
54
+ -- NEVER modify, delete, or add section headers (the lines starting with '#' like # Task specification)
55
+ -- NEVER modify or delete the italic _section description_ lines (these are the lines in italics immediately following each header - they start and end with underscores)
56
+ -- The italic _section descriptions_ are TEMPLATE INSTRUCTIONS that must be preserved exactly as-is - they guide what content belongs in each section
57
+ -- ONLY update the actual content that appears BELOW the italic _section descriptions_ within each existing section
58
+ -- Do NOT add any new sections, summaries, or information outside the existing structure
59
+ - Do NOT reference this note-taking process or instructions anywhere in the notes
60
+ - It's OK to skip updating a section if there are no substantial new insights to add. Do not add filler content like "No info yet", just leave sections blank/unedited if appropriate.
61
+ - Write DETAILED, INFO-DENSE content for each section - include specifics like file paths, function names, error messages, exact commands, technical details, etc.
62
+ - For "Key results", include the complete, exact output the user requested (e.g., full table, full answer, etc.)
63
+ - Do not include information that's already in the CLAUDE.md files included in the context
64
+ - Keep each section under ~${MAX_SECTION_LENGTH} tokens/words - if a section is approaching this limit, condense it by cycling out less important details while preserving the most critical information
65
+ - Focus on actionable, specific information that would help someone understand or recreate the work discussed in the conversation
66
+ - IMPORTANT: Always update "Current State" to reflect the most recent work - this is critical for continuity after compaction
67
+
68
+ Use the Edit tool with file_path: {{notesPath}}
69
+
70
+ STRUCTURE PRESERVATION REMINDER:
71
+ Each section has TWO parts that must be preserved exactly as they appear in the current file:
72
+ 1. The section header (line starting with #)
73
+ 2. The italic description line (the _italicized text_ immediately after the header - this is a template instruction)
74
+
75
+ You ONLY update the actual content that comes AFTER these two preserved lines. The italic description lines starting and ending with underscores are part of the template structure, NOT content to be edited or removed.
76
+
77
77
  REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`;
78
78
  }
79
79
  /**
@@ -10,15 +10,15 @@ import { logError } from '../../utils/log.js';
10
10
  import { jsonStringify } from '../../utils/slowOperations.js';
11
11
  import { asSystemPrompt } from '../../utils/systemPromptType.js';
12
12
  import { queryHaiku } from '../api/claude.js';
13
- const TOOL_USE_SUMMARY_SYSTEM_PROMPT = `Write a short summary label describing what these tool calls accomplished. It appears as a single-line row in a mobile app and truncates around 30 characters, so think git-commit-subject, not sentence.
14
-
15
- Keep the verb in past tense and the most distinctive noun. Drop articles, connectors, and long location context first.
16
-
17
- Examples:
18
- - Searched in auth/
19
- - Fixed NPE in UserService
20
- - Created signup endpoint
21
- - Read config.json
13
+ const TOOL_USE_SUMMARY_SYSTEM_PROMPT = `Write a short summary label describing what these tool calls accomplished. It appears as a single-line row in a mobile app and truncates around 30 characters, so think git-commit-subject, not sentence.
14
+
15
+ Keep the verb in past tense and the most distinctive noun. Drop articles, connectors, and long location context first.
16
+
17
+ Examples:
18
+ - Searched in auth/
19
+ - Fixed NPE in UserService
20
+ - Created signup endpoint
21
+ - Read config.json
22
22
  - Ran failing tests`;
23
23
  /**
24
24
  * Generates a human-readable summary of completed tools.
@@ -7,89 +7,89 @@ import { getIsGit } from '../../utils/git.js';
7
7
  import { registerBundledSkill } from '../bundledSkills.js';
8
8
  const MIN_AGENTS = 5;
9
9
  const MAX_AGENTS = 30;
10
- const WORKER_INSTRUCTIONS = `After you finish implementing the change:
11
- 1. **Simplify** — Invoke the \`${SKILL_TOOL_NAME}\` tool with \`skill: "simplify"\` to review and clean up your changes.
12
- 2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
13
- 3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
14
- 4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
10
+ const WORKER_INSTRUCTIONS = `After you finish implementing the change:
11
+ 1. **Simplify** — Invoke the \`${SKILL_TOOL_NAME}\` tool with \`skill: "simplify"\` to review and clean up your changes.
12
+ 2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
13
+ 3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
14
+ 4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
15
15
  5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;
16
16
  function buildPrompt(instruction) {
17
- return `# Batch: Parallel Work Orchestration
18
-
19
- You are orchestrating a large, parallelizable change across this codebase.
20
-
21
- ## User Instruction
22
-
23
- ${instruction}
24
-
25
- ## Phase 1: Research and Plan (Plan Mode)
26
-
27
- Call the \`${ENTER_PLAN_MODE_TOOL_NAME}\` tool now to enter plan mode, then:
28
-
29
- 1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
30
-
31
- 2. **Decompose into independent units.** Break the work into ${MIN_AGENTS}–${MAX_AGENTS} self-contained units. Each unit must:
32
- - Be independently implementable in an isolated git worktree (no shared state with sibling units)
33
- - Be mergeable on its own without depending on another unit's PR landing first
34
- - Be roughly uniform in size (split large units, merge trivial ones)
35
-
36
- Scale the count to the actual work: few files → closer to ${MIN_AGENTS}; hundreds of files → closer to ${MAX_AGENTS}. Prefer per-directory or per-module slicing over arbitrary file lists.
37
-
38
- 3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
39
- - A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
40
- - A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
41
- - A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
42
- - An existing e2e/integration test suite the worker can run
43
-
44
- If you cannot find a concrete e2e path, use the \`${ASK_USER_QUESTION_TOOL_NAME}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
45
-
46
- Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
47
-
48
- 4. **Write the plan.** In your plan file, include:
49
- - A summary of what you found during research
50
- - A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
51
- - The e2e test recipe (or "skip e2e because …" if the user chose that)
52
- - The exact worker instructions you will give each agent (the shared template)
53
-
54
- 5. Call \`${EXIT_PLAN_MODE_TOOL_NAME}\` to present the plan for approval.
55
-
56
- ## Phase 2: Spawn Workers (After Plan Approval)
57
-
58
- Once the plan is approved, spawn one background agent per work unit using the \`${AGENT_TOOL_NAME}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
59
-
60
- For each agent, the prompt must be fully self-contained. Include:
61
- - The overall goal (the user's instruction)
62
- - This unit's specific task (title, file list, change description — copied verbatim from your plan)
63
- - Any codebase conventions you discovered that the worker needs to follow
64
- - The e2e test recipe from your plan (or "skip e2e because …")
65
- - The worker instructions below, copied verbatim:
66
-
67
- \`\`\`
68
- ${WORKER_INSTRUCTIONS}
69
- \`\`\`
70
-
71
- Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
72
-
73
- ## Phase 3: Track Progress
74
-
75
- After launching all workers, render an initial status table:
76
-
77
- | # | Unit | Status | PR |
78
- |---|------|--------|----|
79
- | 1 | <title> | running | — |
80
- | 2 | <title> | running | — |
81
-
82
- As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
83
-
84
- When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
17
+ return `# Batch: Parallel Work Orchestration
18
+
19
+ You are orchestrating a large, parallelizable change across this codebase.
20
+
21
+ ## User Instruction
22
+
23
+ ${instruction}
24
+
25
+ ## Phase 1: Research and Plan (Plan Mode)
26
+
27
+ Call the \`${ENTER_PLAN_MODE_TOOL_NAME}\` tool now to enter plan mode, then:
28
+
29
+ 1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
30
+
31
+ 2. **Decompose into independent units.** Break the work into ${MIN_AGENTS}–${MAX_AGENTS} self-contained units. Each unit must:
32
+ - Be independently implementable in an isolated git worktree (no shared state with sibling units)
33
+ - Be mergeable on its own without depending on another unit's PR landing first
34
+ - Be roughly uniform in size (split large units, merge trivial ones)
35
+
36
+ Scale the count to the actual work: few files → closer to ${MIN_AGENTS}; hundreds of files → closer to ${MAX_AGENTS}. Prefer per-directory or per-module slicing over arbitrary file lists.
37
+
38
+ 3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
39
+ - A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
40
+ - A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
41
+ - A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
42
+ - An existing e2e/integration test suite the worker can run
43
+
44
+ If you cannot find a concrete e2e path, use the \`${ASK_USER_QUESTION_TOOL_NAME}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
45
+
46
+ Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
47
+
48
+ 4. **Write the plan.** In your plan file, include:
49
+ - A summary of what you found during research
50
+ - A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
51
+ - The e2e test recipe (or "skip e2e because …" if the user chose that)
52
+ - The exact worker instructions you will give each agent (the shared template)
53
+
54
+ 5. Call \`${EXIT_PLAN_MODE_TOOL_NAME}\` to present the plan for approval.
55
+
56
+ ## Phase 2: Spawn Workers (After Plan Approval)
57
+
58
+ Once the plan is approved, spawn one background agent per work unit using the \`${AGENT_TOOL_NAME}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
59
+
60
+ For each agent, the prompt must be fully self-contained. Include:
61
+ - The overall goal (the user's instruction)
62
+ - This unit's specific task (title, file list, change description — copied verbatim from your plan)
63
+ - Any codebase conventions you discovered that the worker needs to follow
64
+ - The e2e test recipe from your plan (or "skip e2e because …")
65
+ - The worker instructions below, copied verbatim:
66
+
67
+ \`\`\`
68
+ ${WORKER_INSTRUCTIONS}
69
+ \`\`\`
70
+
71
+ Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
72
+
73
+ ## Phase 3: Track Progress
74
+
75
+ After launching all workers, render an initial status table:
76
+
77
+ | # | Unit | Status | PR |
78
+ |---|------|--------|----|
79
+ | 1 | <title> | running | — |
80
+ | 2 | <title> | running | — |
81
+
82
+ As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
83
+
84
+ When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
85
85
  `;
86
86
  }
87
87
  const NOT_A_GIT_REPO_MESSAGE = `This is not a git repository. The \`/batch\` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.`;
88
- const MISSING_INSTRUCTION_MESSAGE = `Provide an instruction describing the batch change you want to make.
89
-
90
- Examples:
91
- /batch migrate from react to vue
92
- /batch replace all uses of lodash with native equivalents
88
+ const MISSING_INSTRUCTION_MESSAGE = `Provide an instruction describing the batch change you want to make.
89
+
90
+ Examples:
91
+ /batch migrate from react to vue
92
+ /batch replace all uses of lodash with native equivalents
93
93
  /batch add type annotations to all untyped function parameters`;
94
94
  export function registerBatchSkill() {
95
95
  registerBundledSkill({
@@ -60,40 +60,40 @@ function buildInlineReference(filePaths, content) {
60
60
  }
61
61
  return sections.join('\n\n');
62
62
  }
63
- const INLINE_READING_GUIDE = `## Reference Documentation
64
-
65
- The relevant documentation for your detected language is included below in \`<doc>\` tags. Each tag has a \`path\` attribute showing its original file path. Use this to find the right section:
66
-
67
- ### Quick Task Reference
68
-
69
- **Single text classification/summarization/extraction/Q&A:**
70
- → Refer to \`{lang}/claude-api/README.md\`
71
-
72
- **Chat UI or real-time response display:**
73
- → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/streaming.md\`
74
-
75
- **Long-running conversations (may exceed context window):**
76
- → Refer to \`{lang}/claude-api/README.md\` — see Compaction section
77
-
78
- **Prompt caching / optimize caching / "why is my cache hit rate low":**
79
- → Refer to \`shared/prompt-caching.md\` + \`{lang}/claude-api/README.md\` (Prompt Caching section)
80
-
81
- **Function calling / tool use / agents:**
82
- → Refer to \`{lang}/claude-api/README.md\` + \`shared/tool-use-concepts.md\` + \`{lang}/claude-api/tool-use.md\`
83
-
84
- **Batch processing (non-latency-sensitive):**
85
- → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/batches.md\`
86
-
87
- **File uploads across multiple requests:**
88
- → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/files-api.md\`
89
-
90
- **Agent with built-in tools (file/web/terminal) (Python & TypeScript only):**
91
- → Refer to \`{lang}/agent-sdk/README.md\` + \`{lang}/agent-sdk/patterns.md\`
92
-
93
- **Error handling:**
94
- → Refer to \`shared/error-codes.md\`
95
-
96
- **Latest docs via WebFetch:**
63
+ const INLINE_READING_GUIDE = `## Reference Documentation
64
+
65
+ The relevant documentation for your detected language is included below in \`<doc>\` tags. Each tag has a \`path\` attribute showing its original file path. Use this to find the right section:
66
+
67
+ ### Quick Task Reference
68
+
69
+ **Single text classification/summarization/extraction/Q&A:**
70
+ → Refer to \`{lang}/claude-api/README.md\`
71
+
72
+ **Chat UI or real-time response display:**
73
+ → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/streaming.md\`
74
+
75
+ **Long-running conversations (may exceed context window):**
76
+ → Refer to \`{lang}/claude-api/README.md\` — see Compaction section
77
+
78
+ **Prompt caching / optimize caching / "why is my cache hit rate low":**
79
+ → Refer to \`shared/prompt-caching.md\` + \`{lang}/claude-api/README.md\` (Prompt Caching section)
80
+
81
+ **Function calling / tool use / agents:**
82
+ → Refer to \`{lang}/claude-api/README.md\` + \`shared/tool-use-concepts.md\` + \`{lang}/claude-api/tool-use.md\`
83
+
84
+ **Batch processing (non-latency-sensitive):**
85
+ → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/batches.md\`
86
+
87
+ **File uploads across multiple requests:**
88
+ → Refer to \`{lang}/claude-api/README.md\` + \`{lang}/claude-api/files-api.md\`
89
+
90
+ **Agent with built-in tools (file/web/terminal) (Python & TypeScript only):**
91
+ → Refer to \`{lang}/agent-sdk/README.md\` + \`{lang}/agent-sdk/patterns.md\`
92
+
93
+ **Error handling:**
94
+ → Refer to \`shared/error-codes.md\`
95
+
96
+ **Latest docs via WebFetch:**
97
97
  → Refer to \`shared/live-sources.md\` for URLs`;
98
98
  function buildPrompt(lang, args, content) {
99
99
  // Take the SKILL.md content up to the "Reading Guide" section
@@ -3,10 +3,10 @@ import { BASE_CHROME_PROMPT } from '../../utils/claudeInChrome/prompt.js';
3
3
  import { shouldAutoEnableClaudeInChrome } from '../../utils/claudeInChrome/setup.js';
4
4
  import { registerBundledSkill } from '../bundledSkills.js';
5
5
  const CLAUDE_IN_CHROME_MCP_TOOLS = BROWSER_TOOLS.map(tool => `mcp__claude-in-chrome__${tool.name}`);
6
- const SKILL_ACTIVATION_MESSAGE = `
7
- Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages.
8
-
9
- IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs.
6
+ const SKILL_ACTIVATION_MESSAGE = `
7
+ Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages.
8
+
9
+ IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs.
10
10
  `;
11
11
  export function registerClaudeInChromeSkill() {
12
12
  registerBundledSkill({