@namch/agent-assistant 1.0.1 β†’ 1.0.3

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 (42) hide show
  1. package/README.md +103 -40
  2. package/agents/reporter.md +177 -0
  3. package/code-assistants/antigravity-assistant/AntigravityGlobal.agent.md +3 -1
  4. package/code-assistants/antigravity-assistant/GEMINI.md +2 -0
  5. package/code-assistants/copilot-assistant/agent-assistant.agent.md +5 -0
  6. package/code-assistants/cursor-assistant/rules/agent-assistant.mdc +3 -1
  7. package/commands/code/focus.md +323 -0
  8. package/commands/code/hard.md +59 -0
  9. package/commands/code.md +13 -7
  10. package/commands/cook/focus.md +262 -0
  11. package/commands/cook/hard.md +59 -0
  12. package/commands/cook.md +13 -7
  13. package/commands/debug/focus.md +155 -0
  14. package/commands/debug/hard.md +53 -0
  15. package/commands/debug.md +9 -4
  16. package/commands/design/focus.md +267 -0
  17. package/commands/design/hard.md +53 -0
  18. package/commands/design.md +13 -7
  19. package/commands/fix/focus.md +175 -0
  20. package/commands/fix/hard.md +57 -0
  21. package/commands/fix.md +13 -7
  22. package/commands/plan/focus.md +190 -0
  23. package/commands/plan/hard.md +56 -0
  24. package/commands/plan.md +13 -7
  25. package/commands/report/fast.md +71 -0
  26. package/commands/report/focus.md +156 -0
  27. package/commands/report/hard.md +112 -0
  28. package/commands/report.md +89 -0
  29. package/commands/test/focus.md +165 -0
  30. package/commands/test/hard.md +53 -0
  31. package/commands/test.md +9 -4
  32. package/documents/business/business-features.md +1 -1
  33. package/documents/business/business-glossary.md +9 -8
  34. package/documents/business/business-prd.md +8 -8
  35. package/documents/knowledge-architecture.md +1 -1
  36. package/documents/knowledge-domain.md +5 -4
  37. package/documents/knowledge-overview.md +7 -6
  38. package/documents/knowledge-source-base.md +9 -9
  39. package/package.json +1 -1
  40. package/rules/AGENT-RULES.md +2 -1
  41. package/rules/BOOTSTRAP.md +3 -0
  42. package/rules/QUICK-REFERENCE.md +8 -0
@@ -0,0 +1,323 @@
1
+ ---
2
+ description: πŸ”’ Focused Development β€” Full development cycle with enforced context optimization
3
+ version: "1.0"
4
+ category: engineering
5
+ execution-mode: execute
6
+ ---
7
+
8
+ # /code:focus β€” Focus Development Cycle
9
+
10
+ > **MISSION**: Execute complete development workflow with **enforced context optimization**.
11
+ >
12
+ > This variant automatically clears context before implementationβ€”no user prompt required.
13
+ > Use when you want guaranteed clean implementation without context rot risk.
14
+
15
+ <task>$ARGUMENTS</task>
16
+
17
+ ---
18
+
19
+ ## πŸ›‘ PRE-FLIGHT (DO FIRST β€” BLOCKS PHASE 1)
20
+
21
+ **LOAD now** (in order; path `./rules/` or `~/.{TOOL}/skills/agent-assistant/rules/`):
22
+
23
+ 1. ORCHESTRATION-LAWS.md
24
+ 2. ADAPTIVE-EXECUTION.md
25
+ 3. EXECUTION-PROTOCOL.md
26
+
27
+ **β›” Do not run Phase 1 until all are loaded.** Follow **all** rules in those files; they override any conflicting instructions in this file.
28
+
29
+ ---
30
+
31
+ ## πŸ”€ TIERED EXECUTION PROTOCOL (MANDATORY)
32
+
33
+ > **Reference**: `{RULES_PATH}/ADAPTIVE-EXECUTION.md`
34
+
35
+ ```yaml
36
+ tiered_execution:
37
+ principle: "Sub-agent FIRST (Tier 1). EMBODY ONLY on system failure (Tier 2)."
38
+
39
+ tool_discovery: "Check runSubagent availability BEFORE first delegation"
40
+
41
+ for_each_phase:
42
+ TIER_1_MANDATORY: "IF tool exists β†’ MUST use SUB_AGENT_DELEGATION"
43
+ TIER_2_FALLBACK: "ONLY on system errorβ€”NOT complexity/preference/speed"
44
+
45
+ anti_lazy_fallback:
46
+ - ❌ NEVER use Tier 2 when Tier 1 tool is available
47
+ - βœ… ALWAYS attempt Tier 1 first when tool exists
48
+ - βœ… ALWAYS log justification for Tier 2 fallback
49
+ ```
50
+
51
+ ---
52
+
53
+ ## ⚠️ CRITICAL: PHASE CONTINUITY RULES
54
+
55
+ ```yaml
56
+ phase_continuity:
57
+ rule: "Each phase MUST reference and follow outputs from prior phases"
58
+
59
+ check_for_files:
60
+ - "./reports/brainstorms/BRAINSTORM-{task}.md"
61
+ - "./reports/scouts/SCOUT-{task}.md"
62
+ - "./reports/plans/PLAN-{task}.md"
63
+
64
+ enforcement:
65
+ - Phase 3 (Planning) MUST incorporate Scout findings
66
+ - Phase 4 (Implementation) MUST follow the Plan file exactly
67
+ - Phase 5 (Testing) MUST verify all plan checkpoints
68
+ - If prior phase file missing β†’ Agent MUST create it
69
+ ```
70
+
71
+ All files in `./reports/` β†’ English only.
72
+
73
+ ---
74
+
75
+ ## β›” INCREMENTAL EXECUTION (MANDATORY)
76
+
77
+ One phase at a time, each phase independent: Phase 1 β†’ then Phase 2 β†’ … in one reply. No batching (load only what each phase needs). **Within each phase:** when doing a part, output it in format so user sees what's happening (announce before doing).
78
+
79
+ ---
80
+
81
+ ## 🎭 Phase 1: REQUIREMENTS ANALYSIS
82
+
83
+ | Attribute | Value |
84
+ | ----------- | --------------------------------- |
85
+ | **Agent** | `brainstormer` |
86
+ | **Goal** | Clarify requirements if ambiguous |
87
+ | **Trigger** | If requirements unclear |
88
+
89
+ ### ⚑ TIERED EXECUTION
90
+
91
+ **TIER 1 (MANDATORY when tool exists):**
92
+
93
+ > Invoke runSubagent for `brainstormer`. Context: ISOLATED.
94
+
95
+ **TIER 2 (FALLBACK on system error only):**
96
+
97
+ > Load `{AGENTS_PATH}/brainstormer.md`
98
+ > EMBODY [brainstormer] β€” Requires logged system error justification.
99
+
100
+ **Exit Criteria:**
101
+
102
+ - [ ] Requirements clear
103
+ - [ ] Scope defined
104
+ - [ ] Acceptance criteria established
105
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `brainstormer` Thinking Protocol
106
+
107
+ ---
108
+
109
+ ## 🎭 Phase 2: CODEBASE ANALYSIS
110
+
111
+ | Attribute | Value |
112
+ | --------- | ----------------------------- |
113
+ | **Agent** | `scouter` |
114
+ | **Goal** | Full codebase context mapping |
115
+
116
+ ### ⚑ TIERED EXECUTION
117
+
118
+ **TIER 1 (MANDATORY when tool exists):**
119
+
120
+ > Invoke runSubagent for `scouter`. Context: ISOLATED.
121
+
122
+ **TIER 2 (FALLBACK on system error only):**
123
+
124
+ > Load `{AGENTS_PATH}/scouter.md`
125
+ > EMBODY [scouter] β€” Requires logged system error justification.
126
+
127
+ **Exit Criteria:**
128
+
129
+ - [ ] Architecture understood
130
+ - [ ] Patterns documented
131
+ - [ ] Integration points identified
132
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `scouter` Thinking Protocol
133
+
134
+ ---
135
+
136
+ ## 🎭 Phase 3: IMPLEMENTATION PLANNING
137
+
138
+ | Attribute | Value |
139
+ | --------- | -------------------------- |
140
+ | **Agent** | `planner` |
141
+ | **Goal** | Create implementation plan |
142
+
143
+ ### ⚑ TIERED EXECUTION
144
+
145
+ **TIER 1 (MANDATORY when tool exists):**
146
+
147
+ > Invoke runSubagent for `planner`. Context: ISOLATED.
148
+
149
+ **TIER 2 (FALLBACK on system error only):**
150
+
151
+ > Load `{AGENTS_PATH}/planner.md`
152
+ > EMBODY [planner] β€” Requires logged system error justification.
153
+
154
+ **Exit Criteria:**
155
+
156
+ - [ ] Plan created
157
+ - [ ] Steps defined
158
+ - [ ] Risks identified
159
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `planner` Thinking Protocol
160
+
161
+ ---
162
+
163
+ ## πŸ›‘οΈ STRICT CONTEXT GATE β€” Automatic Context Optimization
164
+
165
+ > **⚑ FOCUS MODE**: This checkpoint executes automatically. NO user input required.
166
+ >
167
+ > **PURPOSE**: Prevent "context rot" by forcibly clearing noisy planning history.
168
+ > This acts as a mandatory "firewall" between Planning and Implementation phases.
169
+
170
+ ### πŸ”’ AUTOMATIC EXECUTION (NO PROMPT)
171
+
172
+ ```yaml
173
+ strict_context_gate:
174
+ mode: "AUTOMATIC - No user interaction"
175
+ behavior: "Force Clear context & Auto-Implement"
176
+
177
+ execution:
178
+ 1. ANNOUNCE: |
179
+ ## πŸ›‘οΈ Strict Context Gate β€” Automatic
180
+
181
+ βœ… **Plan Complete**: `./reports/plans/PLAN-{task}.md`
182
+ πŸ”’ **Focus Mode**: Automatically clearing context for implementation.
183
+
184
+ ⚑ Executing: **Clear context & Auto-Implement**...
185
+
186
+ 2. CONTEXT_DIRECTIVE: |
187
+ ╔══════════════════════════════════════════════════════════════════╗
188
+ β•‘ β›” MANDATORY CONTEXT RESET β€” FOCUS MODE β•‘
189
+ ╠══════════════════════════════════════════════════════════════════╣
190
+ β•‘ IGNORE: All previous chat messages, reasoning chains, β•‘
191
+ β•‘ brainstorming discussions, research explorations, β•‘
192
+ β•‘ rejected alternatives, and intermediate thinking. β•‘
193
+ β•‘ β•‘
194
+ β•‘ SOLE SOURCE OF TRUTH: `./reports/plans/PLAN-{task}.md` β•‘
195
+ β•‘ β•‘
196
+ β•‘ PROCEED: Begin Implementation phase with FRESH context mindset. β•‘
197
+ β•‘ Treat this as a NEW conversation starting from Plan. β•‘
198
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
199
+
200
+ 3. LOAD: Read Plan file completely as if seeing it for the first time
201
+
202
+ 4. PROCEED: Start Phase 4 (Implementation) immediately
203
+ ```
204
+
205
+ ### πŸ“‹ Post-Gate Status
206
+
207
+ ```markdown
208
+ πŸ”’ **Context Gate Passed**
209
+
210
+ - Previous context: DISCARDED
211
+ - Active context: Plan file only
212
+ - Mode: Fresh implementation start
213
+
214
+ Proceeding to Implementation...
215
+ ```
216
+
217
+ ---
218
+
219
+ ## 🎭 Phase 4: IMPLEMENTATION
220
+
221
+ | Attribute | Value |
222
+ | --------- | ----------------------------------- |
223
+ | **Agent** | `tech-lead` β†’ routes to specialists |
224
+ | **Goal** | Execute plan with specialist agents |
225
+
226
+ ### ⚑ TIERED EXECUTION
227
+
228
+ **TIER 1 (MANDATORY when tool exists):**
229
+
230
+ > Invoke runSubagent for `tech-lead`. Context: ISOLATED.
231
+ > Tech-lead will spawn specialist subagents as needed.
232
+
233
+ **TIER 2 (FALLBACK on system error only):**
234
+
235
+ > Load `{AGENTS_PATH}/tech-lead.md`
236
+ > EMBODY [tech-lead] β€” Requires logged system error justification.
237
+ > Then recursively EMBODY specialists as needed.
238
+
239
+ ### ⚑ FOCUS ADHERENCE DIRECTIVE
240
+
241
+ ```
242
+ 1. READ plan completely BEFORE any implementation
243
+ 2. FOR EACH plan step:
244
+ a. Implement EXACTLY as specified
245
+ b. Mark complete: `- [ ]` β†’ `- [x]`
246
+ 3. IF deviation needed:
247
+ a. STOP
248
+ b. REQUEST Re-Planning
249
+ c. DO NOT proceed with own interpretation
250
+ ```
251
+
252
+ **Exit Criteria:**
253
+
254
+ - [ ] All plan steps executed
255
+ - [ ] Code complete
256
+ - [ ] Documentation updated
257
+ - [ ] **Each plan step has corresponding implementation**
258
+ - [ ] **No unauthorized deviations**
259
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `tech-lead` Thinking Protocol
260
+
261
+ ---
262
+
263
+ ## 🎭 Phase 5: TESTING
264
+
265
+ | Attribute | Value |
266
+ | --------- | --------------------- |
267
+ | **Agent** | `tester` |
268
+ | **Goal** | Comprehensive testing |
269
+
270
+ ### ⚑ TIERED EXECUTION
271
+
272
+ **TIER 1 (MANDATORY when tool exists):**
273
+
274
+ > Invoke runSubagent for `tester`. Context: ISOLATED.
275
+
276
+ **TIER 2 (FALLBACK on system error only):**
277
+
278
+ > Load `{AGENTS_PATH}/tester.md`
279
+ > EMBODY [tester] β€” Requires logged system error justification.
280
+
281
+ **Exit Criteria:**
282
+
283
+ - [ ] Tests written
284
+ - [ ] All tests pass
285
+ - [ ] Coverage adequate
286
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `tester` Thinking Protocol
287
+
288
+ ---
289
+
290
+ ## 🎭 Phase 6: REVIEW
291
+
292
+ | Attribute | Value |
293
+ | --------- | ------------------- |
294
+ | **Agent** | `reviewer` |
295
+ | **Goal** | Code quality review |
296
+
297
+ ### ⚑ TIERED EXECUTION
298
+
299
+ **TIER 1 (MANDATORY when tool exists):**
300
+
301
+ > Invoke runSubagent for `reviewer`. Context: ISOLATED.
302
+
303
+ **TIER 2 (FALLBACK on system error only):**
304
+
305
+ > Load `{AGENTS_PATH}/reviewer.md`
306
+ > EMBODY [reviewer] β€” Requires logged system error justification.
307
+
308
+ **Exit Criteria:**
309
+
310
+ - [ ] Code reviewed
311
+ - [ ] Standards met
312
+ - [ ] No blocking issues
313
+ - [ ] **METHODOLOGY CHECK**: Output aligns with `reviewer` Thinking Protocol
314
+
315
+ ---
316
+
317
+ ## COMPLETION
318
+
319
+ Present implementation report with:
320
+
321
+ 1. βœ… **Done** β€” Feature complete (Focus Mode)
322
+ 2. πŸš€ **Deploy** β†’ `/deploy:preview`
323
+ 3. πŸ“ **Docs** β†’ `/docs:core`
@@ -213,6 +213,65 @@ One phase at a time, each phase independent: Phase 1 β†’ then Phase 2 β†’ … in
213
213
 
214
214
  ---
215
215
 
216
+ ## πŸ›‘οΈ VERIFICATION CHECKPOINT β€” Context Optimization
217
+
218
+ > **PURPOSE**: Prevent "context rot" by clearing noisy planning history before implementation.
219
+ >
220
+ > Long-running planning sessions fill context with noise that degrades code generation quality.
221
+ > This checkpoint acts as a "firewall" between Planning and Implementation phases.
222
+
223
+ ### ⚑ OPTIONS (Present to User)
224
+
225
+ ```markdown
226
+ ## πŸ›‘οΈ Context Optimization Checkpoint
227
+
228
+ **Planning Complete** β€” Plan file created at: `./reports/plans/PLAN-{task}.md`
229
+
230
+ **Choose how to proceed with implementation:**
231
+
232
+ | Option | Action | Description |
233
+ |--------|--------|-------------|
234
+ | **1. πŸš€ Clear context & Auto-Implement** | `RECOMMENDED` | Fresh start: Reload Plan file, ignore chat history, begin implementation immediately |
235
+ | **2. ⏸️ Clear context & Manual** | `SAFE` | Clear context, reload Plan, pause for your command before coding |
236
+ | **3. ⚠️ Continue (No Clear)** | `RISKY` | Proceed with full history attached (may cause hallucination) |
237
+
238
+ ⏳ Awaiting selection...
239
+ ```
240
+
241
+ ### πŸ”„ EXECUTION BEHAVIOR
242
+
243
+ ```yaml
244
+ option_1_clear_auto_implement:
245
+ behavior: "RECOMMENDED - Simulate fresh start"
246
+ steps:
247
+ 1. ACKNOWLEDGE: "πŸš€ Executing Clear context & Auto-Implement..."
248
+ 2. CONTEXT_DIRECTIVE: |
249
+ β›” IGNORE all previous chat messages and reasoning chains.
250
+ βœ… RELOAD: `./reports/plans/PLAN-{task}.md` as SOLE SOURCE OF TRUTH.
251
+ βœ… PROCEED: Begin Phase 4 (Implementation) immediately.
252
+ 3. LOAD: Read Plan file completely
253
+ 4. EXECUTE: Start Implementation phase with fresh context mindset
254
+
255
+ option_2_clear_manual:
256
+ behavior: "Clear and wait for explicit command"
257
+ steps:
258
+ 1. ACKNOWLEDGE: "⏸️ Context cleared. Plan reloaded."
259
+ 2. CONTEXT_DIRECTIVE: |
260
+ β›” IGNORE all previous chat messages and reasoning chains.
261
+ βœ… RELOAD: `./reports/plans/PLAN-{task}.md` as SOLE SOURCE OF TRUTH.
262
+ 3. OUTPUT: "Ready for implementation. Type `/continue` or give specific instructions."
263
+ 4. WAIT: For user command before proceeding
264
+
265
+ option_3_continue_no_clear:
266
+ behavior: "Proceed with caution - context rot risk"
267
+ steps:
268
+ 1. WARN: "⚠️ Continuing with full history. Higher hallucination risk."
269
+ 2. PROCEED: Continue to Phase 4 with existing context
270
+ 3. MONITOR: Watch for signs of context confusion
271
+ ```
272
+
273
+ ---
274
+
216
275
  ## 🎭 Phase 4: IMPLEMENTATION
217
276
 
218
277
  | Attribute | Value |
package/commands/code.md CHANGED
@@ -16,9 +16,10 @@ execution-mode: router
16
16
  ## πŸ›‘ PRE-FLIGHT (DO FIRST β€” BLOCKS EXECUTION)
17
17
 
18
18
  **LOAD now** (in order; path `./rules/` or `~/.{TOOL}/skills/agent-assistant/rules/`):
19
- 1. ORCHESTRATION-LAWS.md
20
- 2. ADAPTIVE-EXECUTION.md
21
- 3. EXECUTION-PROTOCOL.md
19
+
20
+ 1. ORCHESTRATION-LAWS.md
21
+ 2. ADAPTIVE-EXECUTION.md
22
+ 3. EXECUTION-PROTOCOL.md
22
23
 
23
24
  **β›” Do not run any workflow phase until all are loaded.** Follow **all** rules in those files. Then run this file's ROUTING LOGIC, LOAD the chosen variant workflow, and execute it.
24
25
 
@@ -33,6 +34,9 @@ IF task is simple (clear requirements, single file):
33
34
  IF task is complex (multi-file, research needed):
34
35
  β†’ Route to /code:hard
35
36
 
37
+ IF task is complex AND context optimization is critical:
38
+ β†’ Route to /code:focus
39
+
36
40
  IF unsure:
37
41
  β†’ Default to /code:fast (escalate if needed)
38
42
  ```
@@ -41,10 +45,11 @@ IF unsure:
41
45
 
42
46
  ## AVAILABLE ROUTES
43
47
 
44
- | Route | When to Use |
45
- | ------------ | ---------------------------------------- |
46
- | `/code:fast` | Quick implementation, clear requirements |
47
- | `/code:hard` | Complex features, multi-file changes |
48
+ | Route | When to Use |
49
+ | ------------- | ------------------------------------------------------- |
50
+ | `/code:fast` | Quick implementation, clear requirements |
51
+ | `/code:hard` | Complex features, multi-file changes |
52
+ | `/code:focus` | Complex features with **enforced context optimization** |
48
53
 
49
54
  ---
50
55
 
@@ -59,6 +64,7 @@ IF unsure:
59
64
 
60
65
  1. ⚑ **Fast** β†’ `/code:fast` β€” Quick implementation
61
66
  2. ⚑⚑⚑ **Hard** β†’ `/code:hard` β€” Full development cycle
67
+ 3. 🎯 **Focus** β†’ `/code:focus` β€” Full cycle with **automatic context clearing** (prevents hallucination)
62
68
 
63
69
  ⏳ Awaiting selection...
64
70
  ```
@@ -0,0 +1,262 @@
1
+ ---
2
+ description: πŸ”’ Focused Feature β€” Complete development with enforced context optimization
3
+ version: "1.0"
4
+ category: engineering
5
+ execution-mode: execute
6
+ ---
7
+
8
+ # /cook:focus β€” Focus Feature Development
9
+
10
+ > **MISSION**: Full feature development with **enforced context optimization**.
11
+ >
12
+ > This variant automatically clears context before implementationβ€”no user prompt required.
13
+ > Use when you want guaranteed clean implementation without context rot risk.
14
+
15
+ <feature>$ARGUMENTS</feature>
16
+
17
+ ---
18
+
19
+ ## πŸ›‘ PRE-FLIGHT (DO FIRST β€” BLOCKS PHASE 1)
20
+
21
+ **LOAD now** (in order; path `./rules/` or `~/.{TOOL}/skills/agent-assistant/rules/`):
22
+
23
+ 1. ORCHESTRATION-LAWS.md
24
+ 2. ADAPTIVE-EXECUTION.md
25
+ 3. EXECUTION-PROTOCOL.md
26
+
27
+ **β›” Do not run Phase 1 until all are loaded.** Follow **all** rules in those files; they override any conflicting instructions in this file.
28
+
29
+ ---
30
+
31
+ ## πŸ”€ TIERED EXECUTION
32
+
33
+ > Reference: `{RULES_PATH}/ADAPTIVE-EXECUTION.md`
34
+
35
+ | Tier | When | Action |
36
+ | ---------- | ----------------------------- | ---------------------------- |
37
+ | **TIER 1** | runSubagent/Agent Tool EXISTS | Invoke sub-agent (MANDATORY) |
38
+ | **TIER 2** | Tool MISSING or SYSTEM error | EMBODY agent file (FALLBACK) |
39
+
40
+ **❌ Anti-Lazy**: Never use TIER 2 when TIER 1 tool available.
41
+
42
+ ---
43
+
44
+ ## πŸ“ DELIVERABLE FILES
45
+
46
+ | Agent | Output |
47
+ | ------------ | ----------------------------------------------- |
48
+ | brainstormer | `./reports/brainstorms/BRAINSTORM-{feature}.md` |
49
+ | researcher | `./reports/researchers/RESEARCH-{feature}.md` |
50
+ | scouter | `./reports/scouts/SCOUT-{feature}.md` |
51
+ | designer | `./reports/designs/DESIGN-{feature}.md` |
52
+ | planner | `./reports/plans/PLAN-{feature}.md` |
53
+
54
+ All files in `./reports/` β†’ English only.
55
+
56
+ ---
57
+
58
+ ## πŸ”— PHASE DEPENDENCIES
59
+
60
+ | Phase | Requires | Blocking |
61
+ | ------------------ | ---------------------- | ----------- |
62
+ | P1: Brainstorm | User request | No |
63
+ | P2: Research | User request | No |
64
+ | P3: Scout | User request | No |
65
+ | P3.5: DB Design | Data requirements | Conditional |
66
+ | P4: Design | Scout findings | Conditional |
67
+ | P5: Planning | RESEARCH + SCOUT files | **YES** |
68
+ | P5.5: Context Gate | **PLAN file** | **AUTO** |
69
+ | P6: Implementation | **PLAN file** | **YES** |
70
+ | P7: Testing | PLAN + Code | **YES** |
71
+ | P8: Review | PLAN + Code + Tests | **YES** |
72
+
73
+ **β›” Blocking**: If input missing β†’ STOP β†’ Create it first β†’ Resume
74
+
75
+ ---
76
+
77
+ ## β›” INCREMENTAL EXECUTION (MANDATORY)
78
+
79
+ One phase at a time, each phase independent: Phase 1 β†’ then Phase 2 β†’ … in one reply. No batching (load only what each phase needs). **Within each phase:** when doing a part, output it in format so user sees what's happening (announce before doing). Format: rules/EXECUTION-PROTOCOL.md Β§ Phase output structure.
80
+
81
+ ---
82
+
83
+ ## 🎭 Phase 1: REQUIREMENTS CLARIFICATION
84
+
85
+ | Agent | `brainstormer` |
86
+ | ----- | -------------------------------------------------------------------- |
87
+ | Goal | Full requirements discovery |
88
+ | Exit | Requirements clear, constraints identified, success criteria defined |
89
+
90
+ ---
91
+
92
+ ## 🎭 Phase 2: RESEARCH
93
+
94
+ | Agent | `researcher` |
95
+ | ----- | -------------------------------------------------------------------------- |
96
+ | Goal | Research best practices and patterns |
97
+ | Exit | Patterns researched, best practices identified, recommendations documented |
98
+
99
+ ---
100
+
101
+ ## 🎭 Phase 3: CODEBASE ANALYSIS
102
+
103
+ | Agent | `scouter` |
104
+ | ----- | ----------------------------------------------------------------------- |
105
+ | Goal | Map architecture and integration points |
106
+ | Exit | Architecture understood, integration points mapped, patterns documented |
107
+
108
+ ---
109
+
110
+ ## 🎭 Phase 3.5: DATABASE DESIGN (IF DATA CHANGES)
111
+
112
+ | Agent | `database-architect` |
113
+ | ------- | ----------------------------------------------------------- |
114
+ | Trigger | Feature involves database changes/migrations |
115
+ | Goal | Schema design and data modeling |
116
+ | Exit | Schema designed, migrations planned, query patterns defined |
117
+
118
+ ---
119
+
120
+ ## 🎭 Phase 4: DESIGN (IF UI NEEDED)
121
+
122
+ | Agent | `designer` |
123
+ | ------- | ----------------------------------------------------- |
124
+ | Trigger | Feature has UI components |
125
+ | Goal | UI/UX design |
126
+ | Exit | Design created, accessibility considered, specs ready |
127
+
128
+ ---
129
+
130
+ ## 🎭 Phase 5: PLANNING
131
+
132
+ | Agent | `planner` |
133
+ | ------------ | --------------------------------------------------- |
134
+ | Prerequisite | **READ** RESEARCH + SCOUT + DESIGN files |
135
+ | Goal | Create detailed implementation plan |
136
+ | Output | `./reports/plans/PLAN-{feature}.md` |
137
+ | Exit | Plan file created, phases defined, risks identified |
138
+
139
+ ---
140
+
141
+ ## πŸ›‘οΈ STRICT CONTEXT GATE β€” Automatic Context Optimization
142
+
143
+ > **⚑ FOCUS MODE**: This checkpoint executes automatically. NO user input required.
144
+ >
145
+ > **PURPOSE**: Prevent "context rot" by forcibly clearing noisy planning history.
146
+ > This acts as a mandatory "firewall" between Planning and Implementation phases.
147
+
148
+ ### πŸ”’ AUTOMATIC EXECUTION (NO PROMPT)
149
+
150
+ ```yaml
151
+ strict_context_gate:
152
+ mode: "AUTOMATIC - No user interaction"
153
+ behavior: "Force Clear context & Auto-Implement"
154
+
155
+ execution:
156
+ 1. ANNOUNCE: |
157
+ ## πŸ›‘οΈ Strict Context Gate β€” Automatic
158
+
159
+ βœ… **Plan Complete**: `./reports/plans/PLAN-{feature}.md`
160
+ πŸ”’ **Focus Mode**: Automatically clearing context for implementation.
161
+
162
+ ⚑ Executing: **Clear context & Auto-Implement**...
163
+
164
+ 2. CONTEXT_DIRECTIVE: |
165
+ ╔══════════════════════════════════════════════════════════════════╗
166
+ β•‘ β›” MANDATORY CONTEXT RESET β€” FOCUS MODE β•‘
167
+ ╠══════════════════════════════════════════════════════════════════╣
168
+ β•‘ IGNORE: All previous chat messages, reasoning chains, β•‘
169
+ β•‘ brainstorming discussions, research explorations, β•‘
170
+ β•‘ rejected alternatives, and intermediate thinking. β•‘
171
+ β•‘ β•‘
172
+ β•‘ SOLE SOURCE OF TRUTH: `./reports/plans/PLAN-{feature}.md` β•‘
173
+ β•‘ β•‘
174
+ β•‘ PROCEED: Begin Implementation phase with FRESH context mindset. β•‘
175
+ β•‘ Treat this as a NEW conversation starting from Plan. β•‘
176
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
177
+
178
+ 3. LOAD: Read Plan file completely as if seeing it for the first time
179
+
180
+ 4. PROCEED: Start Phase 6 (Implementation) immediately
181
+ ```
182
+
183
+ ### πŸ“‹ Post-Gate Status
184
+
185
+ ```markdown
186
+ πŸ”’ **Context Gate Passed**
187
+
188
+ - Previous context: DISCARDED
189
+ - Active context: Plan file only
190
+ - Mode: Fresh implementation start
191
+
192
+ Proceeding to Implementation...
193
+ ```
194
+
195
+ ---
196
+
197
+ ## 🎭 Phase 6: IMPLEMENTATION
198
+
199
+ | Agent | `tech-lead` β†’ routes to specialists |
200
+ | ------------ | ------------------------------------------------------- |
201
+ | Prerequisite | **READ and FOLLOW** `./reports/plans/PLAN-{feature}.md` |
202
+ | Goal | Execute implementation plan |
203
+
204
+ **FOCUS ADHERENCE:**
205
+
206
+ ```
207
+ 1. READ plan FIRST
208
+ 2. FOR EACH step:
209
+ - Implement EXACTLY as specified
210
+ - Mark step complete: [ ] β†’ [x]
211
+ 3. IF step seems wrong:
212
+ - STOP β†’ Document β†’ Request Re-Planning
213
+ - DO NOT implement your own interpretation
214
+ ```
215
+
216
+ | Exit | All plan phases complete, no unauthorized deviations |
217
+
218
+ ---
219
+
220
+ ## 🎭 Phase 7: TESTING
221
+
222
+ | Agent | `tester` |
223
+ | ------------ | ---------------------------- |
224
+ | Prerequisite | **READ** PLAN + Code changes |
225
+ | Goal | Comprehensive testing |
226
+
227
+ **PLAN CHECKPOINT VERIFICATION:**
228
+
229
+ ```
230
+ FOR EACH checkpoint in PLAN:
231
+ - Write test that verifies criteria
232
+ - Document: "Checkpoint X β†’ Test Y"
233
+ ```
234
+
235
+ | Exit | All tests pass, each plan checkpoint has test |
236
+
237
+ ---
238
+
239
+ ## 🎭 Phase 8: REVIEW
240
+
241
+ | Agent | `reviewer` |
242
+ | ------------ | -------------------------------- |
243
+ | Prerequisite | **READ** PLAN + Code + Tests |
244
+ | Goal | Quality review + Plan compliance |
245
+
246
+ **REVIEW CHECKLIST:**
247
+
248
+ - Does code implement plan specification?
249
+ - Any unauthorized deviations?
250
+ - All plan phases reflected in code?
251
+
252
+ | Exit | Code matches plan intent, standards met, approved |
253
+
254
+ ---
255
+
256
+ ## COMPLETION
257
+
258
+ Present feature report with:
259
+
260
+ 1. βœ… **Done** β€” Feature complete (Focus Mode)
261
+ 2. πŸš€ **Deploy** β†’ `/deploy:preview`
262
+ 3. πŸ“ **Docs** β†’ `/docs:core`