claude-all-hands 1.0.1 → 1.0.2

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 (160) hide show
  1. package/.claude/agents/code-simplifier.md +52 -0
  2. package/.claude/agents/curator.md +189 -245
  3. package/.claude/agents/documentor.md +147 -0
  4. package/.claude/agents/planner.md +123 -166
  5. package/.claude/agents/researcher.md +58 -41
  6. package/.claude/agents/surveyor.md +81 -0
  7. package/.claude/agents/worker.md +74 -0
  8. package/.claude/commands/audit-docs.md +94 -0
  9. package/.claude/commands/continue.md +120 -0
  10. package/.claude/commands/create-docs.md +100 -0
  11. package/.claude/commands/create-skill.md +107 -0
  12. package/.claude/commands/create-specialist.md +111 -0
  13. package/.claude/commands/curator-audit.md +4 -0
  14. package/.claude/commands/debug.md +183 -0
  15. package/.claude/commands/plan.md +199 -102
  16. package/.claude/commands/validate.md +11 -0
  17. package/.claude/commands/whats-next.md +106 -134
  18. package/.claude/envoy/envoy +11 -14
  19. package/.claude/envoy/package-lock.json +1388 -0
  20. package/.claude/envoy/package.json +29 -0
  21. package/.claude/envoy/src/cli.ts +126 -0
  22. package/.claude/envoy/src/commands/base.ts +216 -0
  23. package/.claude/envoy/src/commands/gemini.ts +999 -0
  24. package/.claude/envoy/src/commands/git.ts +639 -0
  25. package/.claude/envoy/src/commands/index.ts +73 -0
  26. package/.claude/envoy/src/commands/knowledge.ts +187 -0
  27. package/.claude/envoy/src/commands/perplexity.ts +129 -0
  28. package/.claude/envoy/src/commands/plan/core.ts +134 -0
  29. package/.claude/envoy/src/commands/plan/findings.ts +446 -0
  30. package/.claude/envoy/src/commands/plan/gates.ts +672 -0
  31. package/.claude/envoy/src/commands/plan/index.ts +135 -0
  32. package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
  33. package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
  34. package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
  35. package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
  36. package/.claude/envoy/src/commands/repomix.ts +99 -0
  37. package/.claude/envoy/src/commands/tavily.ts +220 -0
  38. package/.claude/envoy/src/commands/xai.ts +168 -0
  39. package/.claude/envoy/src/lib/design.ts +41 -0
  40. package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
  41. package/.claude/envoy/src/lib/findings.ts +215 -0
  42. package/.claude/envoy/src/lib/gates.ts +572 -0
  43. package/.claude/envoy/src/lib/git.ts +132 -0
  44. package/.claude/envoy/src/lib/index.ts +188 -0
  45. package/.claude/envoy/src/lib/knowledge.ts +594 -0
  46. package/.claude/envoy/src/lib/markdown.ts +75 -0
  47. package/.claude/envoy/src/lib/observability.ts +262 -0
  48. package/.claude/envoy/src/lib/paths.ts +130 -0
  49. package/.claude/envoy/src/lib/plan-io.ts +117 -0
  50. package/.claude/envoy/src/lib/prompts.ts +231 -0
  51. package/.claude/envoy/src/lib/protocols.ts +314 -0
  52. package/.claude/envoy/src/lib/repomix.ts +133 -0
  53. package/.claude/envoy/src/lib/retry.ts +138 -0
  54. package/.claude/envoy/src/lib/watcher.ts +167 -0
  55. package/.claude/envoy/tsconfig.json +21 -0
  56. package/.claude/hooks/scripts/scan_agents.py +62 -0
  57. package/.claude/hooks/scripts/scan_commands.py +50 -0
  58. package/.claude/hooks/scripts/scan_skills.py +46 -70
  59. package/.claude/hooks/scripts/validate_artifacts.py +128 -0
  60. package/.claude/hooks/startup.sh +26 -24
  61. package/.claude/protocols/bug-discovery.yaml +55 -0
  62. package/.claude/protocols/debugging.yaml +51 -0
  63. package/.claude/protocols/discovery.yaml +53 -0
  64. package/.claude/protocols/implementation.yaml +84 -0
  65. package/.claude/settings.json +37 -97
  66. package/.claude/skills/brainstorming/SKILL.md +54 -0
  67. package/.claude/skills/commands-development/SKILL.md +630 -0
  68. package/.claude/skills/commands-development/references/arguments.md +252 -0
  69. package/.claude/skills/commands-development/references/patterns.md +796 -0
  70. package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
  71. package/.claude/skills/discovery-mode/SKILL.md +108 -0
  72. package/.claude/skills/hooks-development/SKILL.md +332 -0
  73. package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
  74. package/.claude/skills/hooks-development/references/examples.md +658 -0
  75. package/.claude/skills/hooks-development/references/hook-types.md +463 -0
  76. package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
  77. package/.claude/skills/hooks-development/references/matchers.md +470 -0
  78. package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
  79. package/.claude/skills/implementation-mode/SKILL.md +171 -0
  80. package/.claude/skills/research-tools/SKILL.md +35 -33
  81. package/.claude/skills/skills-development/SKILL.md +192 -0
  82. package/.claude/skills/skills-development/references/api-security.md +226 -0
  83. package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
  84. package/.claude/skills/skills-development/references/common-patterns.md +595 -0
  85. package/.claude/skills/skills-development/references/core-principles.md +437 -0
  86. package/.claude/skills/skills-development/references/executable-code.md +175 -0
  87. package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
  88. package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
  89. package/.claude/skills/skills-development/references/skill-structure.md +372 -0
  90. package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
  91. package/.claude/skills/skills-development/references/using-scripts.md +113 -0
  92. package/.claude/skills/skills-development/references/using-templates.md +112 -0
  93. package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
  94. package/.claude/skills/skills-development/templates/router-skill.md +73 -0
  95. package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
  96. package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
  97. package/.claude/skills/skills-development/workflows/add-script.md +93 -0
  98. package/.claude/skills/skills-development/workflows/add-template.md +74 -0
  99. package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
  100. package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
  101. package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
  102. package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
  103. package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
  104. package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
  105. package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
  106. package/.claude/skills/subagents-development/SKILL.md +325 -0
  107. package/.claude/skills/subagents-development/references/context-management.md +567 -0
  108. package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
  109. package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
  110. package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
  111. package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
  112. package/.claude/skills/subagents-development/references/subagents.md +508 -0
  113. package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
  114. package/.claude/statusline.sh +24 -0
  115. package/bin/cli.js +110 -72
  116. package/package.json +1 -1
  117. package/.claude/agents/explorer.md +0 -62
  118. package/.claude/agents/parallel-worker.md +0 -121
  119. package/.claude/commands/curation-fix.md +0 -92
  120. package/.claude/commands/new-branch.md +0 -36
  121. package/.claude/commands/parallel-discovery.md +0 -69
  122. package/.claude/commands/parallel-orchestration.md +0 -99
  123. package/.claude/commands/plan-checkpoint.md +0 -37
  124. package/.claude/envoy/commands/__init__.py +0 -1
  125. package/.claude/envoy/commands/base.py +0 -95
  126. package/.claude/envoy/commands/parallel.py +0 -439
  127. package/.claude/envoy/commands/perplexity.py +0 -86
  128. package/.claude/envoy/commands/plans.py +0 -451
  129. package/.claude/envoy/commands/tavily.py +0 -156
  130. package/.claude/envoy/commands/vertex.py +0 -358
  131. package/.claude/envoy/commands/xai.py +0 -124
  132. package/.claude/envoy/envoy.py +0 -122
  133. package/.claude/envoy/pyrightconfig.json +0 -4
  134. package/.claude/envoy/requirements.txt +0 -2
  135. package/.claude/hooks/capture-queries.sh +0 -3
  136. package/.claude/hooks/scripts/enforce_planning.py +0 -118
  137. package/.claude/hooks/scripts/enforce_rg.py +0 -34
  138. package/.claude/hooks/scripts/validate_skill.py +0 -81
  139. package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
  140. package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
  141. package/.claude/skills/command-development/SKILL.md +0 -206
  142. package/.claude/skills/command-development/examples/simple-commands.md +0 -212
  143. package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
  144. package/.claude/skills/hook-development/SKILL.md +0 -127
  145. package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
  146. package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
  147. package/.claude/skills/hook-development/references/event-reference.md +0 -226
  148. package/.claude/skills/repomix-extraction/SKILL.md +0 -91
  149. package/.claude/skills/skill-development/SKILL.md +0 -168
  150. package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
  151. package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
  152. package/.claude/skills/skill-development/references/writing-style.md +0 -180
  153. package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
  154. package/.claude/skills/specialist-builder/SKILL.md +0 -327
  155. package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
  156. package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
  157. package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
  158. package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
  159. package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
  160. /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
@@ -1,115 +1,212 @@
1
1
  ---
2
- description: Begin planning workflow for current feature branch
3
- argument-hint: [user-prompt]
2
+ description: Begin planning workflow for feature or amendment
3
+ argument-hint: [user-prompt] [--quick | --create | --refine]
4
4
  ---
5
5
 
6
6
  <objective>
7
- Start or continue structured planning workflow. Creates plan files for feature branches, gathers specialist context, and delegates to planner agent for plan creation/iteration.
7
+ Orchestrate the full planning workflow: gather requirements, delegate to specialists for discovery, run research, create implementation plan, and hand off to /continue.
8
+
9
+ Modes:
10
+ - `--quick`: No questions, minimal inference, simple plan
11
+ - `--create`: New feature planning (default if no existing plan)
12
+ - `--refine`: Amend existing plan with new requirements
8
13
  </objective>
9
14
 
10
- <quick_start>
11
- 1. Check plan status via `envoy plans frontmatter`
12
- 2. Handle branch/status appropriately (draft/active/new)
13
- 3. Gather specialist context if creating new plan
14
- 4. Delegate to planner with all context
15
- </quick_start>
16
-
17
- <success_criteria>
18
- - Plan file exists at `.claude/plans/<branch>/plan.md`
19
- - Status is "active" (approved) or "draft" (awaiting approval)
20
- - User has approved plan OR explicitly declined planning
21
- </success_criteria>
15
+ <context>
16
+ Plan status: !`.claude/envoy/envoy plan check`
17
+ </context>
22
18
 
23
19
  <process>
20
+ <step name="parse_mode">
21
+ Parse $ARGUMENTS for mode flags and user prompt:
22
+ - If `--quick` present: quick_mode = true
23
+ - If `--create` present: mode = "create"
24
+ - If `--refine` present: mode = "refine"
25
+ - Everything else = user_prompt
26
+ </step>
27
+
28
+ <step name="quick_mode" condition="quick_mode = true">
29
+ **Quick Mode - No questions, minimal delegation**
30
+
31
+ 1. Call `envoy plan check` to get status
32
+ 2. **If plan exists (in_progress or completed)**:
33
+ - Append user prompt: `.claude/envoy/envoy plan append-user-input "<user_prompt>"`
34
+ - Delegate to **planner agent**:
35
+ * "Run `envoy plan protocol implementation` and follow the steps. INPUTS: `{ mode: 'quick', workflow_type: 'feature', feature_branch: <current_branch>, plan_status: <status> }`"
36
+ - AskUserQuestion: "Quick plan created. Ready to implement?"
37
+ - If yes: call /continue command
38
+ 3. **If no plan exists**:
39
+ - Create branch from user prompt context (infer name)
40
+ - Append user prompt: `.claude/envoy/envoy plan append-user-input "<user_prompt>"`
41
+ - Delegate to **planner agent**:
42
+ * "Run `envoy plan protocol implementation` and follow the steps. INPUTS: `{ mode: 'quick', workflow_type: 'feature', feature_branch: <current_branch> }`"
43
+ - AskUserQuestion: "Quick plan created. Ready to implement?"
44
+ - If yes: call /continue command
45
+ 4. **Exit** - quick mode complete
46
+ </step>
47
+
48
+ <step name="check_status" condition="quick_mode = false">
49
+ Call `envoy plan check` and determine mode:
50
+
51
+ | Condition | Action |
52
+ |-----------|--------|
53
+ | No plan, user_input.md has content | Read user_input.md, continue to input_gate |
54
+ | No plan, fresh start | Create branch (infer name from prompt), set mode = "create" |
55
+ | Plan exists, prompt unrelated | AskUserQuestion: "Existing plan found. Continue with it or start fresh?" |
56
+ | Plan exists, prompt related | Set mode = "refine" |
57
+
58
+ If user chooses "start fresh": create new branch off base, set mode = "create"
59
+ </step>
60
+
61
+ <step name="input_gate">
62
+ **Progressive disclosure approach**
63
+
64
+ 1. **Type question** (if not inferred from prompt):
65
+ AskUserQuestion: "What type of change?"
66
+ Options: ["UI/Frontend", "Backend/API", "Full-stack", "Observability/Monitoring", "Developer Experience", "Infrastructure/DevOps", "Other"]
67
+
68
+ 2. **Constraints** (always ask):
69
+ AskUserQuestion: "Any additional constraints? (skip to infer from context)"
70
+
71
+ 3. **Domain-specific questions** (progressive):
72
+ Build questions from Feature Knowledge Bank below. Ask 3 at a time, offer "continue with current context" option.
73
+
74
+ 4. **Design materials** (if UI involved):
75
+ AskUserQuestion: "Include UI screenshots/design material? If yes, add them to filesystem and describe in manifest."
76
+ </step>
77
+
78
+ <step name="write_user_input">
79
+ Append all gathered context to user_input.md:
80
+ `.claude/envoy/envoy plan append-user-input "<all_gathered_context>"`
81
+ </step>
82
+
83
+ <step name="specialist_delegation">
84
+ 1. Extract atomic requirements from user prompt + answers
85
+ 2. Cluster requirements by primary domain
86
+ 3. For each cluster, determine specialist:
87
+ - If confidence lacking: AskUserQuestion: "Should I create a new specialist for [domain]? (/create-specialist)"
88
+ - If no specialist and user declines: use "surveyor" agent
89
+ 4. Delegate to specialists:
90
+ * "Run `envoy plan protocol discovery` and follow the steps. INPUTS: `{ agent_name: '<specialist_name>[_N]', segment_context: '<requirements_for_segment>' }`"
91
+ * Add `_N` suffix if multiple segments for same specialist
92
+ * OUTPUTS: `{ success: true }`
93
+ </step>
94
+
95
+ <step name="get_findings">
96
+ Call `.claude/envoy/envoy plan get-findings` to get list of approaches
97
+ </step>
98
+
99
+ <step name="research_delegation">
100
+ For each distinct research objective identified from approaches:
101
+ * Delegate to **researcher agent**:
102
+ * "Run `envoy plan protocol discovery` and follow the steps. INPUTS: `{ agent_name: 'researcher[_N]', segment_context: '<research_objectives_with_approach_references>' }`"
103
+ * OUTPUTS: `{ success: true }`
104
+ </step>
105
+
106
+ <step name="findings_gate">
107
+ 1. Present all clarifying questions from approach documents to user
108
+ 2. AskUserQuestion: "Want to redirect specialists with specific requirements? (clears all findings)"
109
+ - If yes: clear findings, return to specialist_delegation step
110
+ 3. Call `.claude/envoy/envoy plan block-findings-gate`
111
+ - Returns: `{ thoughts, affected_approaches: [{ specialist_name, approach_number }] }`
112
+ 4. If affected_approaches exist:
113
+ - Re-delegate to affected specialists with thoughts context
114
+ - Rerun findings gate
115
+ </step>
116
+
117
+ <step name="planner_delegation">
118
+ Delegate to **planner agent**:
119
+ * "Run the planning-workflow. INPUTS: `{ mode: '<create|refine>', workflow_type: 'feature', feature_branch: '<current_branch>' }`"
120
+ * OUTPUTS: `{ success: true }`
121
+ </step>
122
+
123
+ <step name="handoff">
124
+ Call /continue command
125
+ </step>
126
+ </process>
24
127
 
25
- ## Step 1: Status Check
26
-
27
- Run: `.claude/envoy/envoy plans frontmatter`
28
-
29
-
30
- - **{exists: false}**: Use AskUserQuestion:
31
- - Question: "You're on a protected branch. How to proceed?"
32
- - Options: ["Create a new branch", "Abandon planning mode"]
33
- - On "Create a new branch" → Create new branch, re-run /plan
34
- - On "Abandon planning mode" → Continue to address user prompt without planning
35
-
36
- - **draft**: Use AskUserQuestion:
37
- - Question: "Draft plan exists. How to proceed?"
38
- - Options: ["Continue drafting", "Start fresh (new branch)", "Decline planning"]
39
- - On "Continue drafting" → Delegate to planner: "continue draft, incorporate prompt"
40
- - On "Start fresh" → Create new branch, re-run /plan
41
- - On "Decline" → Run `envoy plans set-status deactivated`, proceed without planning
42
-
43
- - **active**: Check if user's prompt aligns with plan specs.
44
- - If aligned → Read plan, continue implementation (skip planner)
45
- - If misaligned Use AskUserQuestion:
46
- - Question: "Active plan exists but prompt seems unrelated. Options?"
47
- - Options: ["Add to plan", "New branch for this work", "Proceed without planning"]
48
- - Handle each appropriately
49
-
50
- ## Step 1.5: Intake Gate (New Plans Only)
51
-
52
- **Trigger**: When creating a new plan AND user prompt lacks specifics.
53
-
54
- **Skip if**: Continuing draft (context exists) or prompt already detailed.
55
-
56
- **Structured questioning** via AskUserQuestion:
57
-
58
- 1. **Scope**: "What specifically needs to be built/changed?"
59
- - Options based on inferred type: [Feature, Bug fix, Refactor, Research, Other]
60
-
61
- 2. **Constraints**: "Any constraints or requirements?"
62
- - Options: [Performance critical, Must maintain backwards compat, Specific tech stack, None/flexible]
63
-
64
- 3. **Dependencies**: "Dependencies or blockers?"
65
- - Options: [Depends on external API, Needs design review, Blocked by other work, None]
66
-
67
- 4. **Success criteria**: "How will we know it's done?"
68
- - Options: [Tests pass, User can X, Performance target, Manual verification]
69
-
70
- **Package intake answers** with original prompt for planner delegation.
71
-
72
- ---
73
-
74
- ## Step 2: Gather Specialist Context
75
-
76
- Check agent descriptions for relevant specialists (exclude researcher/planner/explorer).
77
-
78
- - **Specialists found**: Use `/parallel-discovery` to dispatch specialists + explorer simultaneously
79
- - Query specialists: "What repo context/patterns relevant to: {prompt}?"
80
- - Query explorer: "What code structure/implementation relevant to: {prompt}?"
81
- - **None found**: Dispatch **explorer** agent to analyze relevant directories:
82
- - Query: "Analyze codebase patterns relevant to: {prompt}"
83
- - Explorer uses repomix-extraction to gather context
84
- - Returns patterns/conventions for planner to incorporate
85
-
86
- ## Step 3: Delegate to Planner
87
-
88
- Send to planner agent:
89
- - Directive: "create new plan" | "continue draft" | "add to plan"
90
- - User's original prompt
91
- - **Intake answers** (scope, constraints, dependencies, success criteria) if gathered
92
- - Current branch name
93
- - Specialist findings
94
-
95
- ## Step 4: On Planner Return
96
-
97
- Planner returns with status:
98
-
99
- - **plan_ready**: Use AskUserQuestion:
100
- - Question: "Plan ready. Approve to begin implementation?"
101
- - Options: ["Approve", "Needs changes"]
102
- - On "Approve" → Read `.claude/plans/<branch>/plan.md`, then run `/parallel-orchestration` to check for parallel work streams
103
- - On "Needs changes" → User provides feedback via Other, re-delegate to planner with feedback
104
-
105
- - **Planning declined** → Proceed with user's original request without planning
106
- - **Cancelled** → No action needed
128
+ <knowledge_bank name="feature_input_gate">
129
+ **Generic (all types):**
130
+ - Core mission/objective in one sentence
131
+ - Success criteria (how do we know it's done?)
132
+ - Explicit out-of-scope items
133
+ - Acceptable level of jank/tech debt
134
+ - Hard constraints (stack, APIs, security, existing patterns)
135
+ - Primary users or systems affected
136
+ - Key scenarios/user flows (1-3)
137
+ - Happy path for each scenario
138
+ - Must-do behaviors per scenario
139
+ - Forbidden behaviors/invariants
140
+ - Key edge cases
141
+ - Anticipated follow-up work
142
+ - Manual testing approach
143
+
144
+ **UI/Frontend specific:**
145
+ - UX quality bar (scrappy prototype | functional MVP | polished release)
146
+ - Target devices/viewports
147
+ - Accessibility requirements
148
+ - Design references or screenshots available?
149
+ - State management approach
150
+ - Error/loading state handling
151
+
152
+ **Backend/API specific:**
153
+ - Input/output schemas (examples)
154
+ - Performance targets (latency, throughput)
155
+ - Data models/entities affected
156
+ - Database migrations needed?
157
+ - Authentication/authorization requirements
158
+ - Rate limiting/quota considerations
159
+
160
+ **Full-stack specific:**
161
+ - All of the above
162
+ - API contract between frontend and backend
163
+ - Deployment coordination needs
164
+
165
+ **Observability/Monitoring specific:**
166
+ - What signals indicate success/failure?
167
+ - Log levels and what to capture
168
+ - Metrics to track
169
+ - Alerting thresholds
170
+ - Dashboard requirements
171
+
172
+ **DX specific:**
173
+ - Who is the developer audience?
174
+ - Documentation requirements
175
+ - Error message clarity
176
+ - Local development impact
177
+ - CI/CD pipeline changes
178
+
179
+ **Infrastructure/DevOps specific:**
180
+ - Environments affected (dev, staging, prod)
181
+ - Rollback strategy
182
+ - Security/compliance requirements
183
+ - Scaling considerations
184
+ - Cost implications
185
+
186
+ **Informational context for LLM:**
187
+ - Goal is confident delegation to specialists, not exhaustive documentation
188
+ - Prioritize questions that would change architectural approach
189
+ - Edge case questions can wait until findings gate
190
+ - If user's description is detailed, fewer questions needed
191
+ - Combine related bullets into single questions
192
+ - Skip questions where answer is obvious from codebase
193
+ - For --refine mode, only ask about NEW aspects
194
+ </knowledge_bank>
107
195
 
108
- </process>
196
+ <success_criteria>
197
+ - Mode correctly determined from arguments and context
198
+ - User input gathered via progressive disclosure
199
+ - Specialists delegated with focused requirements
200
+ - Findings gate reviewed with user
201
+ - Plan created via planner delegation
202
+ - Control passed to /continue
203
+ </success_criteria>
109
204
 
110
205
  <constraints>
111
- - NEVER skip status check - always run `envoy plans frontmatter` first
112
- - NEVER create plan without user approval at Step 4
113
- - NEVER skip intake gate for vague prompts on new plans
114
- - Main agent delegates to planner - does not write plan directly
206
+ - MUST use AskUserQuestion for all user interactions
207
+ - MUST NOT proceed without user confirmation at gates
208
+ - MUST append all user context to user_input.md via envoy
209
+ - Quick mode MUST skip all questions
210
+ - Specialist delegation MUST use discovery protocol
211
+ - All delegations MUST follow INPUTS/OUTPUTS format
115
212
  </constraints>
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Show detailed .claude/ validation errors
3
+ ---
4
+
5
+ Run the validation script and display all errors:
6
+
7
+ ```bash
8
+ python3 .claude/hooks/scripts/validate_artifacts.py
9
+ ```
10
+
11
+ Parse the JSON output and list each error clearly for the user to address.
@@ -1,147 +1,119 @@
1
1
  ---
2
- description: Generate XML handoff document for session continuity
3
- argument-hint: [--save]
2
+ description: Suggest next steps after plan completion based on implemented work
4
3
  ---
5
4
 
6
5
  <objective>
7
- Generate structured XML handoff document capturing session state for seamless context transfer to next session. Prevents knowledge loss and repeated work.
6
+ Analyze completed plan and generate contextual next-step suggestions. Uses plan context (user_input.md, summary.md, plan.md) to suggest relevant follow-up work.
8
7
  </objective>
9
8
 
10
- <quick_start>
11
- 1. Gather git status, branch, recent commits
12
- 2. Extract completed/remaining work from plan
13
- 3. Document failed approaches and critical context
14
- 4. Output XML to chat (or save to file with --save)
15
- </quick_start>
16
-
17
- <success_criteria>
18
- - XML document captures all session work and state
19
- - Failed approaches documented with WHY they failed
20
- - Critical non-obvious context preserved
21
- - Next session can resume without rediscovery
22
- </success_criteria>
9
+ <context>
10
+ Plan status: !`.claude/envoy/envoy plan check`
11
+ </context>
23
12
 
24
13
  <process>
14
+ <step name="check_status">
15
+ Parse plan check result:
16
+
17
+ | Status | Action |
18
+ |--------|--------|
19
+ | in_progress | Tell user: "Plan has incomplete prompts. Run /continue or /plan --refine" and exit |
20
+ | completed | Continue to get_context step |
21
+ | no_plan | Generate generic suggestions (skip get_context) |
22
+ </step>
23
+
24
+ <step name="get_context">
25
+ Call `.claude/envoy/envoy plan get-full-plan`
26
+
27
+ Parse returned context:
28
+ - user_input.md: original requirements, anticipated follow-ups, out-of-scope items
29
+ - summary.md: what was implemented, key decisions
30
+ - plan.md: prompts that were executed
31
+ </step>
32
+
33
+ <step name="generate_suggestions">
34
+ Using the Suggestion Domains below and parsed context, generate **3-5 concrete suggestions**.
35
+
36
+ **Priority order:**
37
+ 1. Explicitly mentioned follow-ups from user_input.md
38
+ 2. Natural extensions of what was built
39
+ 3. Quality/hardening improvements
40
+ 4. New capabilities enabled by implementation
41
+
42
+ **Format each suggestion as actionable:**
43
+ - Good: "Add unit tests for the auth service refresh token logic"
44
+ - Bad: "Maybe add some tests"
45
+ </step>
46
+
47
+ <step name="present_suggestions">
48
+ Output suggestions with routing guidance:
49
+
50
+ "Based on the completed work, here are suggested next steps:
51
+
52
+ 1. [Suggestion 1]
53
+ 2. [Suggestion 2]
54
+ 3. [Suggestion 3]
55
+ ...
56
+
57
+ **Ready to continue?**
58
+ - `/plan [suggestion]` - Start planning one of these
59
+ - `/plan [your own idea]` - Plan something else
60
+ - `/plan --refine` - Add to current plan instead of starting fresh
61
+ - `/debug [issue]` - If you found a bug to fix first"
62
+ </step>
63
+ </process>
25
64
 
26
- ## Output Format
27
-
28
- ```xml
29
- <handoff>
30
- <work_completed>
31
- <!-- Bullet list of completed tasks/changes this session -->
32
- </work_completed>
33
-
34
- <work_remaining>
35
- <!-- Bullet list of outstanding tasks from plan -->
36
- </work_remaining>
37
-
38
- <attempted_approaches>
39
- <!-- Any approaches tried that failed or were abandoned -->
40
- <!-- Include WHY they failed to prevent repetition -->
41
- </attempted_approaches>
42
-
43
- <critical_context>
44
- <!-- Non-obvious discoveries, constraints, or decisions -->
45
- <!-- Things that would be lost without explicit capture -->
46
- </critical_context>
47
-
48
- <current_state>
49
- <!-- Git status, branch, uncommitted changes -->
50
- <!-- Any blockers or pending decisions -->
51
- </current_state>
52
- </handoff>
53
- ```
54
-
55
- ## Execution
56
-
57
- ### Step 1: Gather Session Context
58
-
59
- Analyze:
60
- 1. Current git branch and status
61
- 2. Recent commits (if on feature branch)
62
- 3. Plan file contents (if exists at `.claude/plans/<branch>/plan.md`)
63
- 4. Any uncommitted changes
64
-
65
- ### Step 2: Extract Work Status
66
-
67
- From plan file (if exists):
68
- - `[x]` items → work_completed
69
- - `[ ]` items → work_remaining
70
-
71
- From session memory:
72
- - What was attempted this session
73
- - What succeeded vs failed
74
- - Why failures occurred
75
-
76
- ### Step 3: Identify Critical Context
77
-
78
- Capture:
79
- - Design decisions made and rationale
80
- - Discovered constraints or gotchas
81
- - Dependencies or blockers identified
82
- - Any deviations from plan and why
83
-
84
- ### Step 4: Document Current State
85
-
86
- ```bash
87
- git status
88
- git branch --show-current
89
- git log --oneline -5 # if on feature branch
90
- ```
91
-
92
- ### Step 5: Generate Output
93
-
94
- If `--save` argument provided:
95
- - Save to `.claude/plans/<branch>/handoff.md`
96
- - Confirm: "Handoff saved to .claude/plans/<branch>/handoff.md"
97
-
98
- Otherwise:
99
- - Output XML directly to chat for copy/paste
65
+ <knowledge_bank name="suggestion_domains">
66
+ **Directly Mentioned:**
67
+ - Anything in "Anticipated follow-ups" from user_input.md
68
+ - Items explicitly marked "out of scope for this iteration"
69
+ - Technical debt the user said was acceptable for now
70
+
71
+ **Natural Extensions:**
72
+ - Additional user flows that build on implemented features
73
+ - Edge cases that weren't covered but now matter
74
+ - Performance optimizations for implemented features
75
+ - Mobile/responsive versions if only desktop was built
76
+ - API extensions if backend was built
77
+ - Admin/management UI if user-facing was built
78
+
79
+ **Quality and Hardening:**
80
+ - Test coverage for implemented features
81
+ - Error handling improvements
82
+ - Accessibility enhancements
83
+ - Documentation (README, API docs, inline comments)
84
+ - Logging/monitoring for new features
85
+ - Security hardening (input validation, auth edge cases)
86
+
87
+ **Developer Experience:**
88
+ - Local development improvements
89
+ - CI/CD enhancements
90
+ - Developer documentation
91
+ - Code cleanup/refactoring opportunities identified during implementation
92
+
93
+ **New Capabilities:**
94
+ - Features that are now possible because of what was built
95
+ - Integrations with other systems
96
+ - Analytics/reporting on new functionality
97
+ - User feedback mechanisms
98
+
99
+ **Observability and Operations:**
100
+ - Dashboards for new features
101
+ - Alerting for failure modes
102
+ - Performance baselines
103
+ - Usage tracking
104
+ </knowledge_bank>
100
105
 
101
- </process>
106
+ <success_criteria>
107
+ - Plan status correctly determined
108
+ - Context parsed from plan files
109
+ - 3-5 contextual suggestions generated
110
+ - Suggestions prioritized by relevance
111
+ - Clear routing guidance provided
112
+ </success_criteria>
102
113
 
103
114
  <constraints>
104
- - ALWAYS include WHY for failed approaches - prevents repetition
105
- - NEVER omit critical_context section - even if "none" is the value
106
- - Be specific in work_completed: include file paths, commit hashes
115
+ - MUST check plan status first
116
+ - MUST read plan context before generating suggestions
117
+ - Suggestions MUST be specific to implemented work (not generic)
118
+ - MUST provide routing guidance for each action type
107
119
  </constraints>
108
-
109
- ## Usage Examples
110
-
111
- **End of session:**
112
- ```
113
- /whats-next
114
- ```
115
- Outputs XML to chat for next session.
116
-
117
- **Save for later:**
118
- ```
119
- /whats-next --save
120
- ```
121
- Persists to plan directory.
122
-
123
- ## Section Guidelines
124
-
125
- ### work_completed
126
- - Be specific: "Added intake gate to /plan command" not "made changes"
127
- - Include file paths modified
128
- - Note commits made
129
-
130
- ### work_remaining
131
- - Pull directly from plan's unchecked items
132
- - Add any discovered tasks not in original plan
133
-
134
- ### attempted_approaches
135
- - ONLY include if something failed or was abandoned
136
- - Always include WHY: "X failed because Y"
137
- - This prevents next session from repeating mistakes
138
-
139
- ### critical_context
140
- - Non-obvious information that isn't in code comments
141
- - Verbal agreements or decisions
142
- - External constraints discovered
143
- - "If I forget this, I'll waste time rediscovering it"
144
-
145
- ### current_state
146
- - Factual: branch, status, blockers
147
- - Any pending questions awaiting user input
@@ -1,9 +1,8 @@
1
1
  #!/bin/bash
2
- # claude-envoy: CLI for agent-scoped external tool access
2
+ # claude-envoy: CLI for agent-scoped external tool access (TypeScript)
3
3
 
4
4
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  PROJECT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
6
- VENV_DIR="$SCRIPT_DIR/.venv"
7
6
 
8
7
  # Load .env if exists
9
8
  if [ -f "$PROJECT_DIR/.env" ]; then
@@ -12,19 +11,17 @@ if [ -f "$PROJECT_DIR/.env" ]; then
12
11
  set +a
13
12
  fi
14
13
 
15
- # Auto-create venv if missing
16
- if [ ! -d "$VENV_DIR" ]; then
17
- python3 -m venv "$VENV_DIR"
18
- "$VENV_DIR/bin/pip" install -q -r "$SCRIPT_DIR/requirements.txt"
19
- cp "$SCRIPT_DIR/requirements.txt" "$VENV_DIR/.requirements.txt"
14
+ # Auto-install if node_modules missing
15
+ if [ ! -d "$SCRIPT_DIR/node_modules" ]; then
16
+ npm install --prefix "$SCRIPT_DIR" --silent 2>/dev/null
17
+ cp "$SCRIPT_DIR/package.json" "$SCRIPT_DIR/node_modules/.package.json.cache" 2>/dev/null
20
18
  fi
21
19
 
22
- # Reinstall if requirements.txt changed
23
- if ! cmp -s "$SCRIPT_DIR/requirements.txt" "$VENV_DIR/.requirements.txt" 2>/dev/null; then
24
- "$VENV_DIR/bin/pip" install -q -r "$SCRIPT_DIR/requirements.txt"
25
- cp "$SCRIPT_DIR/requirements.txt" "$VENV_DIR/.requirements.txt"
20
+ # Reinstall if package.json changed
21
+ if ! cmp -s "$SCRIPT_DIR/package.json" "$SCRIPT_DIR/node_modules/.package.json.cache" 2>/dev/null; then
22
+ npm install --prefix "$SCRIPT_DIR" --silent 2>/dev/null
23
+ cp "$SCRIPT_DIR/package.json" "$SCRIPT_DIR/node_modules/.package.json.cache" 2>/dev/null
26
24
  fi
27
25
 
28
- # Suppress Python warnings (urllib3, deprecation, etc)
29
- export PYTHONWARNINGS="ignore"
30
- exec "$VENV_DIR/bin/python" "$SCRIPT_DIR/envoy.py" "$@"
26
+ # Use tsx for direct TypeScript execution (no compile step needed)
27
+ exec "$SCRIPT_DIR/node_modules/.bin/tsx" "$SCRIPT_DIR/src/cli.ts" "$@"