@namch/agent-assistant 1.0.2 → 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 +24 -9
  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
@@ -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`
@@ -134,6 +134,65 @@ One phase at a time, each phase independent: Phase 1 → then Phase 2 → … in
134
134
 
135
135
  ---
136
136
 
137
+ ## 🛡️ VERIFICATION CHECKPOINT — Context Optimization
138
+
139
+ > **PURPOSE**: Prevent "context rot" by clearing noisy planning history before implementation.
140
+ >
141
+ > Long-running planning sessions fill context with noise that degrades code generation quality.
142
+ > This checkpoint acts as a "firewall" between Planning and Implementation phases.
143
+
144
+ ### ⚡ OPTIONS (Present to User)
145
+
146
+ ```markdown
147
+ ## 🛡️ Context Optimization Checkpoint
148
+
149
+ **Planning Complete** — Plan file created at: `./reports/plans/PLAN-{feature}.md`
150
+
151
+ **Choose how to proceed with implementation:**
152
+
153
+ | Option | Action | Description |
154
+ | -------------------------------- | ------------- | ------------------------------------------------------------------------------------ |
155
+ | **1. 🚀 Clear context & Auto-Implement** | `RECOMMENDED` | Fresh start: Reload Plan file, ignore chat history, begin implementation immediately |
156
+ | **2. ⏸️ Clear context & Manual** | `SAFE` | Clear context, reload Plan, pause for your command before coding |
157
+ | **3. ⚠️ Continue (No Clear)** | `RISKY` | Proceed with full history attached (may cause hallucination) |
158
+
159
+ ⏳ Awaiting selection...
160
+ ```
161
+
162
+ ### 🔄 EXECUTION BEHAVIOR
163
+
164
+ ```yaml
165
+ option_1_clear_auto_implement:
166
+ behavior: "RECOMMENDED - Simulate fresh start"
167
+ steps:
168
+ 1. ACKNOWLEDGE: "🚀 Executing Clear context & Auto-Implement..."
169
+ 2. CONTEXT_DIRECTIVE: |
170
+ ⛔ IGNORE all previous chat messages and reasoning chains.
171
+ ✅ RELOAD: `./reports/plans/PLAN-{feature}.md` as SOLE SOURCE OF TRUTH.
172
+ ✅ PROCEED: Begin Phase 6 (Implementation) immediately.
173
+ 3. LOAD: Read Plan file completely
174
+ 4. EXECUTE: Start Implementation phase with fresh context mindset
175
+
176
+ option_2_clear_manual:
177
+ behavior: "Clear and wait for explicit command"
178
+ steps:
179
+ 1. ACKNOWLEDGE: "⏸️ Context cleared. Plan reloaded."
180
+ 2. CONTEXT_DIRECTIVE: |
181
+ ⛔ IGNORE all previous chat messages and reasoning chains.
182
+ ✅ RELOAD: `./reports/plans/PLAN-{feature}.md` as SOLE SOURCE OF TRUTH.
183
+ 3. OUTPUT: "Ready for implementation. Type `/continue` or give specific instructions."
184
+ 4. WAIT: For user command before proceeding
185
+
186
+ option_3_continue_no_clear:
187
+ behavior: "Proceed with caution - context rot risk"
188
+ steps:
189
+ 1. WARN: "⚠️ Continuing with full history. Higher hallucination risk."
190
+ 2. PROCEED: Continue to Phase 6 with existing context
191
+ 3. MONITOR: Watch for signs of context confusion
192
+ ```
193
+
194
+ ---
195
+
137
196
  ## 🎭 Phase 6: IMPLEMENTATION
138
197
 
139
198
  | Agent | `tech-lead` → routes to specialists |
package/commands/cook.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 feature is simple (clear spec, low complexity):
33
34
  IF feature is complex (multi-component, research needed):
34
35
  → Route to /cook:hard
35
36
 
37
+ IF feature is complex AND context optimization is critical:
38
+ → Route to /cook:focus
39
+
36
40
  IF unsure:
37
41
  → Default to /cook:fast
38
42
  ```
@@ -41,10 +45,11 @@ IF unsure:
41
45
 
42
46
  ## AVAILABLE ROUTES
43
47
 
44
- | Route | When to Use |
45
- | ------------ | ------------------------------------ |
46
- | `/cook:fast` | Quick features, clear specifications |
47
- | `/cook:hard` | Complex features, full workflow |
48
+ | Route | When to Use |
49
+ | ------------- | ------------------------------------------------------- |
50
+ | `/cook:fast` | Quick features, clear specifications |
51
+ | `/cook:hard` | Complex features, full workflow |
52
+ | `/cook: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** → `/cook:fast` — Quick implementation
61
66
  2. ⚡⚡⚡ **Hard** → `/cook:hard` — Full feature development
67
+ 3. 🎯 **Focus** → `/cook:focus` — Full development with **automatic context clearing** (prevents hallucination)
62
68
 
63
69
  ⏳ Awaiting selection...
64
70
  ```
@@ -0,0 +1,155 @@
1
+ ---
2
+ description: 🔒 Focused Debug — Deep investigation with enforced context optimization
3
+ version: "1.0"
4
+ category: debugging
5
+ execution-mode: execute
6
+ ---
7
+
8
+ # /debug:focus — Focus Deep Investigation
9
+
10
+ > **MISSION**: Thorough investigation with **enforced context optimization**.
11
+ >
12
+ > This variant automatically clears context before fix handoff—no user prompt required.
13
+ > Use when you want guaranteed clean fix handoff without hypothesis drift.
14
+
15
+ <issue>$ARGUMENTS</issue>
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
+ | Tier | When | Action |
34
+ | ---------- | ------------------ | ---------------------------- |
35
+ | **TIER 1** | runSubagent EXISTS | Invoke sub-agent (MANDATORY) |
36
+ | **TIER 2** | Tool MISSING | EMBODY agent file (FALLBACK) |
37
+
38
+ ---
39
+
40
+ ## 📁 DELIVERABLE FILES
41
+
42
+ | Agent | Output |
43
+ | -------- | ----------------------------------- |
44
+ | debugger | `./reports/debugs/DEBUG-{issue}.md` |
45
+
46
+ All files in `./reports/` → English only.
47
+
48
+ ---
49
+
50
+ ## ⛔ INCREMENTAL EXECUTION (MANDATORY)
51
+
52
+ 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).
53
+
54
+ ---
55
+
56
+ ## 🎭 Phase 1: INFORMATION GATHERING
57
+
58
+ | Agent | `scouter` |
59
+ | ----- | ----------------------------------------- |
60
+ | Goal | Gather context and reproduction steps |
61
+ | Exit | Context gathered, reproduction documented |
62
+
63
+ ---
64
+
65
+ ## 🎭 Phase 2: HYPOTHESIS FORMATION
66
+
67
+ | Agent | `debugger` |
68
+ | ----- | ----------------------------------- |
69
+ | Goal | Form and rank hypotheses |
70
+ | Exit | Hypotheses documented with evidence |
71
+
72
+ ---
73
+
74
+ ## 🎭 Phase 3: ROOT CAUSE ANALYSIS
75
+
76
+ | Agent | `debugger` |
77
+ | ------ | ----------------------------------------------- |
78
+ | Goal | Deep investigation |
79
+ | Output | `./reports/debugs/DEBUG-{issue}.md` |
80
+ | Exit | Root cause identified, failure chain documented |
81
+
82
+ ---
83
+
84
+ ## 🎭 Phase 4: SOLUTION DESIGN
85
+
86
+ | Agent | `planner` |
87
+ | ----- | --------------------------------------- |
88
+ | Goal | Design fix strategy |
89
+ | Exit | Fix approach defined with rollback plan |
90
+
91
+ ---
92
+
93
+ ## 🛡️ STRICT CONTEXT GATE — Automatic Context Optimization
94
+
95
+ > **⚡ FOCUS MODE**: This checkpoint executes automatically. NO user input required.
96
+ >
97
+ > **PURPOSE**: Prevent "context rot" by forcibly clearing noisy debugging history.
98
+ > This acts as a mandatory "firewall" before handoff to fix workflows.
99
+
100
+ ### 🔒 AUTOMATIC EXECUTION (NO PROMPT)
101
+
102
+ ```yaml
103
+ strict_context_gate:
104
+ mode: "AUTOMATIC - No user interaction"
105
+ behavior: "Force Clear context & Fix"
106
+
107
+ execution:
108
+ 1. ANNOUNCE: |
109
+ ## 🛡️ Strict Context Gate — Automatic
110
+
111
+ ✅ **Debug Complete**: Root cause identified, fix strategy designed.
112
+ 🔒 **Focus Mode**: Automatically clearing context for fix handoff.
113
+
114
+ ⚡ Executing: **Clear context & Fix**...
115
+
116
+ 2. CONTEXT_DIRECTIVE: |
117
+ ╔══════════════════════════════════════════════════════════════════╗
118
+ ║ ⛔ MANDATORY CONTEXT RESET — FOCUS MODE ║
119
+ ╠══════════════════════════════════════════════════════════════════╣
120
+ ║ IGNORE: All debugging hypotheses, failed investigation paths, ║
121
+ ║ rejected theories, and intermediate reasoning. ║
122
+ ║ ║
123
+ ║ SOLE SOURCE OF TRUTH: Root cause + Fix strategy. ║
124
+ ║ ║
125
+ ║ HANDOFF: Ready for `/fix:focus` implementation. ║
126
+ ║ Fix should treat root cause as fresh context. ║
127
+ ╚══════════════════════════════════════════════════════════════════╝
128
+
129
+ 3. OUTPUT: Root cause + Fix strategy summary
130
+
131
+ 4. PROCEED: To COMPLETION
132
+ ```
133
+
134
+ ### 📋 Post-Gate Status
135
+
136
+ ```markdown
137
+ 🔒 **Context Gate Passed**
138
+
139
+ - Previous context: DISCARDED
140
+ - Active context: Root cause + Fix strategy only
141
+ - Mode: Clean handoff ready
142
+
143
+ Ready for fix implementation...
144
+ ```
145
+
146
+ ---
147
+
148
+ ## COMPLETION
149
+
150
+ Present findings with:
151
+
152
+ 1. ✅ **Root Cause** — Identified (Focus Mode)
153
+ 2. 🔒 **Context Optimized** — Ready for focus fix
154
+ 3. 🔧 **Fix** → `/fix:focus`
155
+ 4. 📝 **Document** → `/docs:core`