@namch/agent-assistant 1.3.0 → 1.3.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 (142) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/README.md +3 -4
  3. package/agents/backend-engineer.md +3 -3
  4. package/agents/brainstormer.md +3 -3
  5. package/agents/business-analyst.md +3 -3
  6. package/agents/database-architect.md +3 -3
  7. package/agents/debugger.md +2 -2
  8. package/agents/designer.md +2 -2
  9. package/agents/devops-engineer.md +2 -2
  10. package/agents/docs-manager.md +23 -15
  11. package/agents/frontend-engineer.md +3 -3
  12. package/agents/game-engineer.md +3 -3
  13. package/agents/mobile-engineer.md +4 -4
  14. package/agents/performance-engineer.md +3 -3
  15. package/agents/planner.md +4 -4
  16. package/agents/project-manager.md +3 -3
  17. package/agents/researcher.md +3 -3
  18. package/agents/reviewer.md +3 -3
  19. package/agents/scouter.md +3 -3
  20. package/agents/security-engineer.md +3 -3
  21. package/agents/tech-lead.md +3 -3
  22. package/agents/tester.md +2 -2
  23. package/code-assistants/codex-assistant/CODEX.md +1 -2
  24. package/commands/ask/hard.md +1 -1
  25. package/commands/brainstorm/hard.md +1 -1
  26. package/commands/code/hard.md +1 -1
  27. package/commands/code.md +2 -7
  28. package/commands/cook/hard.md +1 -1
  29. package/commands/cook.md +1 -6
  30. package/commands/debug/hard.md +1 -1
  31. package/commands/debug.md +1 -6
  32. package/commands/design/hard.md +1 -1
  33. package/commands/design.md +1 -6
  34. package/commands/docs/audit.md +554 -78
  35. package/commands/docs/business.md +392 -76
  36. package/commands/docs/core.md +573 -74
  37. package/commands/docs.md +62 -61
  38. package/commands/fix/hard.md +1 -1
  39. package/commands/fix.md +1 -6
  40. package/commands/plan/hard.md +1 -1
  41. package/commands/plan.md +1 -6
  42. package/commands/report/fast.md +2 -2
  43. package/commands/report/hard.md +1 -1
  44. package/commands/report.md +2 -7
  45. package/commands/review/hard.md +1 -1
  46. package/commands/test/hard.md +1 -1
  47. package/commands/test.md +1 -6
  48. package/documents/HSOL-ASSESSMENT.md +6 -6
  49. package/documents/SMART-SKILL-ORCHESTRATION-BLUEPRINT.md +1 -1
  50. package/documents/business/business-features/00-index.md +101 -0
  51. package/documents/business/business-features/01-feature-inventory.md +341 -0
  52. package/documents/business/business-features/02-prioritization-moscow.md +148 -0
  53. package/documents/business/business-features/03-feature-specifications.md +511 -0
  54. package/documents/business/business-features/04-dependencies-and-release-sequencing.md +313 -0
  55. package/documents/business/business-features/05-success-metrics.md +290 -0
  56. package/documents/business/business-glossary/00-index.md +89 -0
  57. package/documents/business/business-glossary/01-canonical-terms.md +428 -0
  58. package/documents/business/business-glossary/02-synonyms-and-deprecated-terms.md +180 -0
  59. package/documents/business/business-glossary/03-domain-entities-and-events.md +395 -0
  60. package/documents/business/business-glossary/04-api-term-mapping.md +173 -0
  61. package/documents/business/business-prd/00-index.md +107 -0
  62. package/documents/business/business-prd/01-executive-summary.md +131 -0
  63. package/documents/business/business-prd/02-problem-goals-and-scope.md +204 -0
  64. package/documents/business/business-prd/03-stakeholders-and-requirements.md +210 -0
  65. package/documents/business/business-prd/04-acceptance-risks-assumptions.md +246 -0
  66. package/documents/business/business-workflows/00-index.md +107 -0
  67. package/documents/business/business-workflows/01-actor-map.md +303 -0
  68. package/documents/business/business-workflows/02-workflow-catalog.md +252 -0
  69. package/documents/business/business-workflows/03-detailed-workflows.md +641 -0
  70. package/documents/business/business-workflows/04-decision-rules-and-exceptions.md +216 -0
  71. package/documents/business/business-workflows/05-sla-and-handoffs.md +253 -0
  72. package/documents/knowledge-architecture/00-index.md +159 -0
  73. package/documents/knowledge-architecture/01-system-overview.md +240 -0
  74. package/documents/knowledge-architecture/02-components.md +419 -0
  75. package/documents/knowledge-architecture/03-data-flow.md +368 -0
  76. package/documents/knowledge-architecture/04-design-patterns.md +497 -0
  77. package/documents/knowledge-architecture/05-decisions.md +410 -0
  78. package/documents/knowledge-domain/00-index.md +251 -0
  79. package/documents/knowledge-domain/01-entities.md +582 -0
  80. package/documents/knowledge-domain/02-database-schema.md +138 -0
  81. package/documents/knowledge-domain/03-api-contracts.md +477 -0
  82. package/documents/knowledge-domain/04-business-rules.md +554 -0
  83. package/documents/knowledge-overview/00-index.md +107 -0
  84. package/documents/knowledge-overview/01-project-identity.md +162 -0
  85. package/documents/knowledge-overview/02-tech-stack.md +119 -0
  86. package/documents/knowledge-overview/03-features.md +232 -0
  87. package/documents/knowledge-overview/04-getting-started.md +394 -0
  88. package/documents/knowledge-source-base/00-index.md +107 -0
  89. package/documents/knowledge-source-base/01-directory-structure.md +312 -0
  90. package/documents/knowledge-source-base/02-entry-points.md +346 -0
  91. package/documents/knowledge-source-base/03-key-modules.md +581 -0
  92. package/documents/knowledge-source-base/04-configuration.md +467 -0
  93. package/documents/knowledge-standards/00-index.md +129 -0
  94. package/documents/knowledge-standards/01-code-style.md +161 -0
  95. package/documents/knowledge-standards/02-conventions.md +254 -0
  96. package/documents/knowledge-standards/03-git-workflow.md +228 -0
  97. package/documents/knowledge-standards/04-testing-standards.md +175 -0
  98. package/matrix-skills/_index.yaml +1 -1
  99. package/package.json +1 -1
  100. package/rules/AGENTS.md +1 -1
  101. package/rules/REFERENCE.md +18 -14
  102. package/rules/SKILLS.md +1 -1
  103. package/rules/TEAMS.md +1 -2
  104. package/skills/docs-audit/README.md +10 -8
  105. package/skills/docs-audit/SKILL.md +45 -41
  106. package/skills/docs-audit/references/scoring-framework.md +5 -5
  107. package/skills/docs-core/README.md +19 -14
  108. package/skills/docs-core/SKILL.md +189 -117
  109. package/skills/planning/references/codebase-understanding.md +5 -5
  110. package/code-assistants/codex-assistant/skills/agent-assistant-code-focus/SKILL.md +0 -18
  111. package/code-assistants/codex-assistant/skills/agent-assistant-code-focus/agents/openai.yaml +0 -4
  112. package/code-assistants/codex-assistant/skills/agent-assistant-cook-focus/SKILL.md +0 -18
  113. package/code-assistants/codex-assistant/skills/agent-assistant-cook-focus/agents/openai.yaml +0 -4
  114. package/code-assistants/codex-assistant/skills/agent-assistant-debug-focus/SKILL.md +0 -18
  115. package/code-assistants/codex-assistant/skills/agent-assistant-debug-focus/agents/openai.yaml +0 -4
  116. package/code-assistants/codex-assistant/skills/agent-assistant-design-focus/SKILL.md +0 -18
  117. package/code-assistants/codex-assistant/skills/agent-assistant-design-focus/agents/openai.yaml +0 -4
  118. package/code-assistants/codex-assistant/skills/agent-assistant-fix-focus/SKILL.md +0 -18
  119. package/code-assistants/codex-assistant/skills/agent-assistant-fix-focus/agents/openai.yaml +0 -4
  120. package/code-assistants/codex-assistant/skills/agent-assistant-plan-focus/SKILL.md +0 -18
  121. package/code-assistants/codex-assistant/skills/agent-assistant-plan-focus/agents/openai.yaml +0 -4
  122. package/code-assistants/codex-assistant/skills/agent-assistant-report-focus/SKILL.md +0 -18
  123. package/code-assistants/codex-assistant/skills/agent-assistant-report-focus/agents/openai.yaml +0 -4
  124. package/code-assistants/codex-assistant/skills/agent-assistant-test-focus/SKILL.md +0 -18
  125. package/code-assistants/codex-assistant/skills/agent-assistant-test-focus/agents/openai.yaml +0 -4
  126. package/commands/code/focus.md +0 -297
  127. package/commands/cook/focus.md +0 -209
  128. package/commands/debug/focus.md +0 -103
  129. package/commands/design/focus.md +0 -229
  130. package/commands/fix/focus.md +0 -145
  131. package/commands/plan/focus.md +0 -140
  132. package/commands/report/focus.md +0 -107
  133. package/commands/test/focus.md +0 -123
  134. package/documents/business/business-features.md +0 -894
  135. package/documents/business/business-glossary.md +0 -554
  136. package/documents/business/business-prd.md +0 -400
  137. package/documents/business/business-workflows.md +0 -713
  138. package/documents/knowledge-architecture.md +0 -621
  139. package/documents/knowledge-domain.md +0 -602
  140. package/documents/knowledge-overview.md +0 -316
  141. package/documents/knowledge-source-base.md +0 -581
  142. package/documents/knowledge-standards.md +0 -632
@@ -0,0 +1,368 @@
1
+ # Agent Assistant — Data Flow
2
+
3
+ > **Purpose**: Request lifecycle, CLI install flow, skill resolution flow, and Golden Triangle team flow — all with Mermaid diagrams
4
+ > **Parent**: [00-index.md](./00-index.md)
5
+ > **Last Updated**: 2026-03-26
6
+ > **Generated By**: docs-core skill
7
+
8
+ ---
9
+
10
+ ## Table of Contents
11
+
12
+ 1. [User Command Lifecycle](#user-command-lifecycle)
13
+ 2. [CLI Install Flow](#cli-install-flow)
14
+ 3. [Skill Resolution Flow (HSOL)](#skill-resolution-flow-hsol)
15
+ 4. [Golden Triangle Team Flow](#golden-triangle-team-flow)
16
+ 5. [Error Recovery Flow](#error-recovery-flow)
17
+ 6. [Evidence Sources](#evidence-sources)
18
+
19
+ ---
20
+
21
+ ## User Command Lifecycle
22
+
23
+ This is the primary data flow — from a user typing a prompt to receiving a structured deliverable. The orchestrator detects the command, routes to a variant, then executes phases sequentially, delegating each phase to a specialist agent.
24
+
25
+ ```mermaid
26
+ sequenceDiagram
27
+ participant U as User
28
+ participant EP as Platform Entry Point
29
+ participant ORC as Orchestrator (CORE.md)
30
+ participant R as Command Router
31
+ participant V as Variant Workflow
32
+ participant A as Agent (TIER 1 or 2)
33
+ participant S as Skill Layer (HSOL)
34
+
35
+ U->>EP: User prompt or /command
36
+ EP->>ORC: Load CORE.md (identity + laws)
37
+
38
+ Note over ORC: DETECT command<br/>(explicit or NLP mapping)
39
+ ORC->>ORC: Load PHASES.md + AGENTS.md
40
+ ORC->>R: Route to commands/{cmd}.md
41
+
42
+ Note over R: Parse $ARGUMENTS<br/>Assess complexity
43
+ R->>V: Route to commands/{cmd}/{variant}.md
44
+
45
+ Note over V: PRE-FLIGHT complete<br/>Begin phase execution
46
+
47
+ loop For each Phase N
48
+ V->>ORC: Phase N assignment
49
+ ORC->>ORC: Parse requirements into Registry
50
+
51
+ alt TIER 1 available
52
+ ORC->>A: runSubagent(agent, context)
53
+ Note over A: Isolated context
54
+ else TIER 2 fallback
55
+ ORC->>ORC: EMBODY agent
56
+ Note over ORC: Shared context<br/>Read agent file completely
57
+ end
58
+
59
+ A->>S: Request skill injection (profile-based)
60
+ S->>A: Return matched skills (fitness ≥ threshold)
61
+ A->>A: Execute phase work
62
+ A->>ORC: Return deliverable
63
+
64
+ Note over ORC: VERIFY exit criteria<br/>Mark phase complete<br/>Deliverable becomes immutable (L8)
65
+ end
66
+
67
+ ORC->>U: Deliver final result
68
+ ```
69
+
70
+ ### Key Data at Each Stage
71
+
72
+ | Stage | Data Flowing | Format |
73
+ |-------|-------------|--------|
74
+ | User → Entry Point | Natural language or `/command:variant args` | Free text |
75
+ | Entry Point → Orchestrator | Identity binding + path configuration | CORE.md loaded into context |
76
+ | Orchestrator → Router | Command name + arguments | Mapped via REFERENCE.md table |
77
+ | Router → Variant | Complexity assessment + user arguments | Redirect to variant file |
78
+ | Variant → Orchestrator | Phase assignment (agent name, task, criteria) | Phase definition in variant file |
79
+ | Orchestrator → Agent | Requirements registry, task description, acceptance criteria, constraints | Structured handoff context |
80
+ | Agent → Skill Layer | Agent profile from YAML frontmatter (e.g., `backend:execution`) | Profile string |
81
+ | Skill Layer → Agent | Matched SKILL.md contents sorted by fitness score | Markdown content |
82
+ | Agent → Orchestrator | Completed deliverable | Per PHASES.md output format |
83
+ | Orchestrator → User | Final result (all phases composed) | Markdown with phase sections |
84
+
85
+ ---
86
+
87
+ ## CLI Install Flow
88
+
89
+ The CLI installer is the distribution mechanism — it copies framework files from the npm package to each platform's global directory, performing placeholder substitution on every Markdown and YAML file.
90
+
91
+ ```mermaid
92
+ flowchart TD
93
+ START["npm install @namch/agent-assistant<br/>or npx agent-assistant install {tool}"]
94
+
95
+ PARSE["Parse CLI arguments<br/>install | uninstall | list"]
96
+ RESOLVE["Resolve target platform(s)<br/>cursor | copilot | antigravity | codex | --all"]
97
+
98
+ subgraph "Per Platform"
99
+ DIRS["Create directory structure<br/>~/.{tool}/skills/agent-assistant/"]
100
+
101
+ subgraph "Copy Loop (all framework files)"
102
+ READ["Read source file from npm package"]
103
+ REPLACE["Apply {TOOL} replacements:<br/>~/.{TOOL}/skills/ → ~/.cursor/skills/<br/>{TOOL} → cursor<br/>{HOME} → ~"]
104
+ WRITE["Write transformed file to target"]
105
+ SYNC["fs.sync for reliability"]
106
+ end
107
+
108
+ ASSETS["Copy platform-specific assets<br/>from code-assistants/{tool}-assistant/"]
109
+ VERIFY["Verification phase<br/>Check all files written"]
110
+ REPORT["Summary report with statistics"]
111
+ end
112
+
113
+ START --> PARSE --> RESOLVE
114
+ RESOLVE --> DIRS
115
+ DIRS --> READ --> REPLACE --> WRITE --> SYNC
116
+ SYNC -->|"Next file"| READ
117
+ SYNC -->|"All files done"| ASSETS
118
+ ASSETS --> VERIFY --> REPORT
119
+ ```
120
+
121
+ ### Files Distributed per Platform
122
+
123
+ | Category | Source Path | Destination |
124
+ |----------|-----------|-------------|
125
+ | Rules | `rules/*.md` | `~/.{tool}/skills/agent-assistant/rules/` |
126
+ | Agents | `agents/*.md` | `~/.{tool}/skills/agent-assistant/agents/` |
127
+ | Team Agents | `agents/teams/*/` | `~/.{tool}/skills/agent-assistant/agents/teams/` |
128
+ | Commands | `commands/**/*.md` | `~/.{tool}/skills/agent-assistant/commands/` |
129
+ | Matrix Skills | `matrix-skills/*.yaml` | `~/.{tool}/skills/agent-assistant/matrix-skills/` |
130
+ | Skills | `skills/*/SKILL.md` | `~/.{tool}/skills/*/SKILL.md` (at skills root) |
131
+ | Documents | `documents/**` | `~/.{tool}/skills/agent-assistant/documents/` |
132
+ | Platform Assets | `code-assistants/{tool}-assistant/` | Platform-specific locations (varies) |
133
+
134
+ ### Replacement Table (from cli/install.js)
135
+
136
+ All `.md` and `.yaml` files undergo text replacement. The replacement map is platform-specific:
137
+
138
+ | Placeholder | Cursor | Copilot | Codex |
139
+ |------------|--------|---------|-------|
140
+ | `{TOOL}` | `cursor` | `copilot` | `codex` |
141
+ | `~/.{TOOL}/skills/agent-assistant/` | `~/.cursor/skills/agent-assistant/` | `~/.copilot/skills/agent-assistant/` | `~/.codex/skills/agent-assistant/` |
142
+ | `{HOME}` | `~` | `~` | `~` |
143
+
144
+ ---
145
+
146
+ ## Skill Resolution Flow (HSOL)
147
+
148
+ The Hybrid Skill Orchestration Layer resolves domain skills for an agent based on their profile, applies a 5-factor fitness score, and either uses matrix skills directly or triggers community discovery for gaps.
149
+
150
+ ```mermaid
151
+ flowchart TD
152
+ TRIGGER["Agent delegated for phase<br/>Profile: backend:execution"]
153
+
154
+ ASSESS["Assess task complexity<br/>Simple or Complex?"]
155
+
156
+ SIMPLE["Simple → Skip skill resolution<br/>Use base knowledge"]
157
+
158
+ PARSE["Parse agent profile<br/>from YAML frontmatter"]
159
+ LOAD["Load inherited domains<br/>from _index.yaml"]
160
+ FILTER["Filter skills by relevance_mapping<br/>from domain YAML files"]
161
+
162
+ SCORE["Calculate fitness score per skill:<br/>0.35 × Semantic Match<br/>+ 0.25 × Specificity<br/>+ 0.20 × Trust Level<br/>+ 0.10 × Freshness<br/>+ 0.10 × Success Rate"]
163
+
164
+ THRESHOLD{{"Fitness ≥ 0.8?"}}
165
+ ASYNC{{"Fitness 0.75–0.8?"}}
166
+
167
+ USE["Execute with matrix skills<br/>(skip discovery)"]
168
+ RECOMMEND["Execute with matrix skills<br/>+ surface recommendation later"]
169
+
170
+ DISCOVER["BLOCKING: Run dynamic discovery<br/>npx skills find [query]"]
171
+ INSTALL["Install discovered skill<br/>npx skills add owner/repo@skill"]
172
+
173
+ TRUST["Apply trust level:<br/>Matrix = 1.0 (always trusted)<br/>Dynamic = 0.3 (new) → 1.0 (promoted)"]
174
+
175
+ INJECT["Inject skill SKILL.md content<br/>into agent context"]
176
+
177
+ TRIGGER --> ASSESS
178
+ ASSESS -->|"Simple"| SIMPLE
179
+ ASSESS -->|"Complex"| PARSE
180
+ PARSE --> LOAD --> FILTER --> SCORE
181
+ SCORE --> THRESHOLD
182
+ THRESHOLD -->|"≥ 0.8"| USE
183
+ THRESHOLD -->|"< 0.8"| ASYNC
184
+ ASYNC -->|"0.75–0.8"| RECOMMEND
185
+ ASYNC -->|"< 0.75"| DISCOVER
186
+ DISCOVER --> INSTALL --> TRUST
187
+ TRUST --> INJECT
188
+ USE --> INJECT
189
+ RECOMMEND --> INJECT
190
+ ```
191
+
192
+ ### Trust Progression Lifecycle (from SKILLS.md)
193
+
194
+ ```mermaid
195
+ stateDiagram-v2
196
+ [*] --> NEW: Dynamic skill installed
197
+ NEW --> EVALUATING: 3 successful executions
198
+ EVALUATING --> VALIDATED: 10 successful executions
199
+ VALIDATED --> PROMOTED: Auto-promote to matrix
200
+ PROMOTED --> [*]: Added to matrix-skills YAML
201
+
202
+ state NEW {
203
+ note right of NEW: Trust = 0.3
204
+ }
205
+ state EVALUATING {
206
+ note right of EVALUATING: Trust = 0.5
207
+ }
208
+ state VALIDATED {
209
+ note right of VALIDATED: Trust = 0.7
210
+ }
211
+ state PROMOTED {
212
+ note right of PROMOTED: Trust = 1.0
213
+ }
214
+ ```
215
+
216
+ ### Variant Impact on Discovery (from SKILLS.md)
217
+
218
+ | Variant | Discovery Behavior |
219
+ |---------|-------------------|
220
+ | `:fast` | Skip — use matrix skills only, no dynamic discovery |
221
+ | `:hard` | Check matrix fitness; trigger discovery if < 0.8 |
222
+ | `:team` | Same as `:hard` — applies per agent in the triangle |
223
+
224
+ ---
225
+
226
+ ## Golden Triangle Team Flow
227
+
228
+ When a `:team` variant is activated, each phase spawns exactly 3 agents who collaborate through a structured adversarial protocol with file-based communication.
229
+
230
+ ```mermaid
231
+ sequenceDiagram
232
+ participant ORC as Orchestrator
233
+ participant TL as Tech Lead
234
+ participant EX as Executor
235
+ participant RV as Reviewer
236
+ participant MB as Mailbox<br/>(append-only file)
237
+ participant TK as Shared Task List
238
+
239
+ ORC->>TL: Phase N assignment (:team variant)
240
+
241
+ Note over TL: Decompose into tasks
242
+ TL->>TK: Create Shared Task List
243
+ TL->>MB: TASK_ASSIGNMENT → Executor
244
+
245
+ EX->>TK: Read task assignments
246
+ Note over EX: Implement deliverable
247
+ EX->>MB: SUBMISSION → Reviewer
248
+
249
+ RV->>MB: Read submission
250
+ Note over RV: Devil's Advocate review<br/>"Assume defects exist"
251
+
252
+ alt PASS
253
+ RV->>MB: REVIEW (PASS) → All
254
+ Note over TL,RV: Consensus reached
255
+ else FAIL (Round 1)
256
+ RV->>MB: REVIEW (FAIL) → Executor
257
+
258
+ alt Executor agrees
259
+ EX->>EX: Apply fixes
260
+ EX->>MB: RESUBMISSION → Reviewer
261
+ else Executor defends
262
+ EX->>MB: DEFENSE (with evidence) → Reviewer
263
+ Note over EX: Must include technical proof<br/>(benchmarks, specs, references)
264
+ end
265
+
266
+ RV->>MB: Re-review
267
+
268
+ alt PASS
269
+ RV->>MB: REVIEW (PASS) → All
270
+ else FAIL (Round 2-3)
271
+ Note over RV: Loop continues<br/>Max 3 rounds
272
+ end
273
+ end
274
+
275
+ alt No consensus after 3 rounds
276
+ RV->>TL: Escalate unresolved dispute
277
+ TL->>MB: Read ALL exchanges
278
+ Note over TL: Evaluate evidence quality<br/>Not seniority or role
279
+ TL->>MB: DECISION (binding) → All
280
+ end
281
+
282
+ Note over TL,RV: CONSENSUS STAMP<br/>TechLead ✓ | Executor ✓ | Reviewer ✓
283
+ TL->>ORC: Return consensus-stamped deliverable
284
+ ```
285
+
286
+ ### Communication Artifacts
287
+
288
+ | Artifact | Location | Owner | Rules |
289
+ |----------|----------|-------|-------|
290
+ | Shared Task List | Inline in phase output | Tech Lead | Status tracking: assignments, priorities, completion |
291
+ | Mailbox | `./reports/{topic}/MAILBOX-{date}.md` | All agents (append-only) | No edits or deletions; every exchange is logged |
292
+
293
+ ### Message Types in Mailbox
294
+
295
+ | Type | From → To | Purpose |
296
+ |------|-----------|---------|
297
+ | `TASK_ASSIGNMENT` | Tech Lead → Executor | Assign implementation tasks |
298
+ | `SUBMISSION` | Executor → Reviewer | Submit completed work for review |
299
+ | `REVIEW (PASS)` | Reviewer → All | Approve submission |
300
+ | `REVIEW (FAIL)` | Reviewer → Executor | Reject with specific issues |
301
+ | `DEFENSE` | Executor → Reviewer | Defend work with evidence |
302
+ | `RESUBMISSION` | Executor → Reviewer | Resubmit after fixes |
303
+ | `DECISION` | Tech Lead → All | Binding arbitration (after 3 rounds) |
304
+
305
+ ### C8 Enforcement Checkpoints (from TEAMS.md)
306
+
307
+ | Checkpoint | Rule | Block Level |
308
+ |-----------|------|-------------|
309
+ | C8-TEAMS-01 | Mailbox is append-only and required for all inter-agent exchanges | BLOCK |
310
+ | C8-TEAMS-02 | Debate capped at 3 rounds; unresolved disputes escalate to Tech Lead | BLOCK |
311
+ | C8-TEAMS-03 | Phase output requires explicit consensus stamp before release | BLOCK |
312
+
313
+ ---
314
+
315
+ ## Error Recovery Flow
316
+
317
+ When errors occur during any flow above, the framework follows a self-healing protocol with 5 error classes.
318
+
319
+ ```mermaid
320
+ flowchart TD
321
+ ERROR["Error Detected"]
322
+ CAPTURE["1. CAPTURE<br/>error type, phase, agent, state"]
323
+ CLASSIFY["2. CLASSIFY"]
324
+
325
+ E1["E1: Transient<br/>(timeout, network)"]
326
+ E1B["E1b: Output Overflow<br/>(file too large)"]
327
+ E2["E2: Recoverable<br/>(logic error)"]
328
+ E3["E3: Blocking<br/>(critical failure)"]
329
+ E4["E4: Cascading<br/>(affects downstream)"]
330
+
331
+ RETRY["Retry 3× with backoff"]
332
+ CHUNK["Switch to chunked<br/>deliverable strategy"]
333
+ ALT["Attempt alternative<br/>approach"]
334
+ SAFE["Safe point →<br/>Best option →<br/>Auto-recover"]
335
+ ROLLBACK["Stop propagation →<br/>Rollback →<br/>Report impact"]
336
+
337
+ RESUME["4. RESUME immediately"]
338
+ ESCALATE["USER ESCALATION<br/>⚠️ BLOCKED — Decision Required<br/>Options A/B/C/D"]
339
+
340
+ ERROR --> CAPTURE --> CLASSIFY
341
+ CLASSIFY --> E1 --> RETRY --> RESUME
342
+ CLASSIFY --> E1B --> CHUNK --> RESUME
343
+ CLASSIFY --> E2 --> ALT --> RESUME
344
+ CLASSIFY --> E3 --> SAFE --> RESUME
345
+ CLASSIFY --> E4 --> ROLLBACK --> RESUME
346
+
347
+ RETRY -->|"3 retries failed"| ESCALATE
348
+ ALT -->|"No alternative"| ESCALATE
349
+ SAFE -->|"Cannot auto-recover"| ESCALATE
350
+ ROLLBACK -->|"Rollback failed"| ESCALATE
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Evidence Sources
356
+
357
+ | Source | Path | What It Provides |
358
+ |--------|------|------------------|
359
+ | CORE.md v4.1 | `rules/CORE.md` | Execution loop (5 steps), command routing table, tiered execution, NLP detection |
360
+ | PHASES.md | `rules/PHASES.md` | Requirements intake format, phase output format (standard + GT), exit criteria |
361
+ | AGENTS.md | `rules/AGENTS.md` | TIER 1/TIER 2 handoff protocol, tool discovery, embodiment announcement format |
362
+ | SKILLS.md | `rules/SKILLS.md` | Resolution algorithm (6 steps), fitness formula (5 factors), trust lifecycle (4 stages), variant behavior |
363
+ | TEAMS.md | `rules/TEAMS.md` | Golden Triangle diagram, 3 roles, debate flow, max 3 rounds, defense rules, mailbox protocol, C8 checkpoints |
364
+ | ERRORS.md | `rules/ERRORS.md` | Error classification table (E1–E4), recovery protocol (5 steps), user escalation format |
365
+ | _index.yaml | `matrix-skills/_index.yaml` | HSOL config: async_threshold 0.8, discovery settings, variant apply rules |
366
+ | cli/install.js | `cli/install.js` | Platform TOOLS config, replacement maps, directory creation, file copy logic |
367
+ | package.json | `package.json` | npm scripts for install/uninstall per platform, files array for distribution |
368
+ | REFERENCE.md | `rules/REFERENCE.md` | Deliverable paths per agent, command-variant mappings |