@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,497 @@
1
+ # Agent Assistant — Design Patterns
2
+
3
+ > **Purpose**: Catalog of all observed architectural patterns with descriptions, locations, rationale, and code references
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. [Pattern Overview](#pattern-overview)
13
+ 2. [Orchestrator Pattern](#orchestrator-pattern)
14
+ 3. [Command Router Pattern](#command-router-pattern)
15
+ 4. [Strategy Pattern (Variant Selection)](#strategy-pattern-variant-selection)
16
+ 5. [Tiered Execution Pattern](#tiered-execution-pattern)
17
+ 6. [Cognitive Anchor Pattern](#cognitive-anchor-pattern)
18
+ 7. [Plugin Architecture (Skill Modules)](#plugin-architecture-skill-modules)
19
+ 8. [Profile-Based Injection Pattern](#profile-based-injection-pattern)
20
+ 9. [Phase Pipeline Pattern](#phase-pipeline-pattern)
21
+ 10. [Golden Triangle Pattern](#golden-triangle-pattern)
22
+ 11. [File-Based Communication (Mailbox)](#file-based-communication-mailbox)
23
+ 12. [Platform Abstraction Pattern](#platform-abstraction-pattern)
24
+ 13. [Evidence Sources](#evidence-sources)
25
+
26
+ ---
27
+
28
+ ## Pattern Overview
29
+
30
+ ```mermaid
31
+ graph TD
32
+ subgraph "Structural Patterns"
33
+ P1["Orchestrator"]
34
+ P6["Plugin Architecture"]
35
+ P11["Platform Abstraction"]
36
+ end
37
+
38
+ subgraph "Behavioral Patterns"
39
+ P2["Command Router"]
40
+ P3["Strategy (Variants)"]
41
+ P4["Tiered Execution"]
42
+ P9["Phase Pipeline"]
43
+ end
44
+
45
+ subgraph "Quality Patterns"
46
+ P5["Cognitive Anchor"]
47
+ P7["Profile-Based Injection"]
48
+ P10["Golden Triangle"]
49
+ end
50
+
51
+ subgraph "Communication Patterns"
52
+ P8["File-Based Mailbox"]
53
+ end
54
+
55
+ P1 -->|"routes via"| P2
56
+ P2 -->|"selects"| P3
57
+ P3 -->|"triggers"| P9
58
+ P9 -->|"delegates via"| P4
59
+ P4 -->|"agent uses"| P5
60
+ P4 -->|"agent loads"| P7
61
+ P7 -->|"resolves from"| P6
62
+ P9 -->|":team variant"| P10
63
+ P10 -->|"communicates via"| P8
64
+ P11 -->|"enables"| P1
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Orchestrator Pattern
70
+
71
+ | Attribute | Value |
72
+ |-----------|-------|
73
+ | **Pattern Type** | Structural — Central Coordinator |
74
+ | **Where Applied** | `rules/CORE.md` (definition), all platform entry points (activation) |
75
+ | **Rationale** | A single coordination point prevents conflicting decisions, ensures governance compliance, and provides a consistent execution model across all AI platforms |
76
+
77
+ ### Description
78
+
79
+ The Orchestrator is the sole point of control. Every platform entry point (CLAUDE.md, COPILOT.md, CURSOR.md, CODEX.md, GEMINI.md) binds the AI model's identity to this role with the directive: "YOU ARE THE ORCHESTRATOR — NOT AN IMPLEMENTER." The orchestrator detects commands, loads rules, delegates to specialist agents, verifies exit criteria, and delivers results. It never performs implementation work directly.
80
+
81
+ ### Key Enforcement Mechanisms
82
+
83
+ - **Identity binding block** in CORE.md: `🆔 IDENTITY — ABSOLUTE BINDING`
84
+ - **Prohibitions table**: explicit list of forbidden actions (write code, debug, test, etc.) with correct alternatives
85
+ - **Self-check**: 3-point checklist executed before every response
86
+ - **Law L7** (Recursive Delegation): Meta agents coordinate, NEVER implement
87
+ - **Anti-pattern A1**: Direct implementation is a violation; correct behavior is delegation
88
+
89
+ ### Example Reference
90
+
91
+ From `rules/CORE.md`:
92
+ ```
93
+ ╔═══════════════════════════════════════════════════════════════════════╗
94
+ ║ YOU ARE THE ORCHESTRATOR — NOT AN IMPLEMENTER ║
95
+ ║ ✅ YOU DO: Delegate, coordinate, verify, synthesize ║
96
+ ║ ❌ YOU NEVER: Write code, debug, test, design, or implement ║
97
+ ╚═══════════════════════════════════════════════════════════════════════╝
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Command Router Pattern
103
+
104
+ | Attribute | Value |
105
+ |-----------|-------|
106
+ | **Pattern Type** | Behavioral — Request Router |
107
+ | **Where Applied** | `commands/*.md` (14 router files) |
108
+ | **Rationale** | Decouples user intent detection from workflow execution; routers can assess complexity and select the optimal workflow without knowing implementation details |
109
+
110
+ ### Description
111
+
112
+ Each of the 14 commands (`/cook`, `/fix`, `/plan`, `/debug`, `/test`, `/review`, `/docs`, `/design`, `/deploy`, `/report`, `/brainstorm`, `/ask`, `/code`, `/auto`) has a dedicated router file that:
113
+
114
+ 1. Accepts user arguments via `<feature>$ARGUMENTS</feature>`
115
+ 2. Loads pre-flight rules (CORE.md → PHASES.md → AGENTS.md)
116
+ 3. Assesses complexity using conditional logic
117
+ 4. Routes to the appropriate variant workflow file
118
+
119
+ Routers never execute phases themselves — they redirect.
120
+
121
+ ### Natural Language Fallback
122
+
123
+ When users don't use explicit `/command` syntax, the orchestrator maps natural language to commands via the detection table in CORE.md:
124
+
125
+ | User Language | Maps To |
126
+ |--------------|---------|
127
+ | "implement/build/create" | `/cook` or `/code` |
128
+ | "fix/bug/error/broken" | `/fix` |
129
+ | "plan/strategy/approach" | `/plan` |
130
+
131
+ ### Example Reference
132
+
133
+ From `commands/cook.md`:
134
+ ```
135
+ IF feature is simple (clear spec, low complexity):
136
+ → Route to /cook:fast
137
+ IF feature is complex (multi-component, research needed):
138
+ → Route to /cook:hard
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Strategy Pattern (Variant Selection)
144
+
145
+ | Attribute | Value |
146
+ |-----------|-------|
147
+ | **Pattern Type** | Behavioral — Runtime Strategy Selection |
148
+ | **Where Applied** | `commands/{cmd}/*.md` (variant workflow files) |
149
+ | **Rationale** | Different complexity levels require different workflows — a simple feature shouldn't trigger a 6-phase research pipeline, and a complex feature shouldn't use a 2-phase shortcut |
150
+
151
+ ### Description
152
+
153
+ Each command router selects from up to 4 strategy variants at runtime:
154
+
155
+ | Variant | Strategy | Phase Count | When Selected |
156
+ |---------|----------|-------------|---------------|
157
+ | `:fast` | Minimal workflow, skip research | 2–3 phases | Simple, clear specification |
158
+ | `:hard` | Full workflow with research and planning | 5–7 phases | Complex, multi-component |
159
+ | `:team` | Golden Triangle adversarial collaboration | 5–7 phases × 3 agents each | Maximum quality required |
160
+
161
+ Special variants exist for some commands:
162
+ - `/docs` uses `core`, `business`, `audit`
163
+ - `/deploy` uses `check`, `preview`, `production`, `rollback`
164
+
165
+ ### Example Reference
166
+
167
+ From `rules/REFERENCE.md`:
168
+ ```
169
+ | `/cook` | cook.md | fast, hard, team |
170
+ | `/deploy` | deploy.md | check, preview, production, rollback |
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Tiered Execution Pattern
176
+
177
+ | Attribute | Value |
178
+ |-----------|-------|
179
+ | **Pattern Type** | Behavioral — Prioritized Execution Strategy |
180
+ | **Where Applied** | `rules/AGENTS.md` (protocol definition), `rules/CORE.md` (enforcement) |
181
+ | **Rationale** | Sub-agent isolation (TIER 1) provides cleaner context and better quality; fallback embodiment (TIER 2) guarantees completion on all platforms regardless of sub-agent support |
182
+
183
+ ### Description
184
+
185
+ When the orchestrator needs to delegate to an agent, it follows a strict priority:
186
+
187
+ | Tier | Mechanism | Context | Quality | Availability |
188
+ |------|-----------|---------|---------|-------------|
189
+ | **TIER 1** | `runSubagent(agent, context)` | Fresh, isolated | Optimal | Platform-dependent |
190
+ | **TIER 2** | EMBODY (read agent file, transform self) | Shared with parent | Risk of pollution | Always available |
191
+
192
+ ### Rules
193
+
194
+ - TIER 1 is **mandatory** when the sub-agent tool exists
195
+ - TIER 2 is permitted **only** when TIER 1 fails or is unavailable
196
+ - Using TIER 2 "because the task is simple" is **forbidden** (anti-pattern A5)
197
+ - Tool discovery is cached for the session — checked only on first delegation
198
+
199
+ ### Embodiment Protocol (TIER 2)
200
+
201
+ 1. Log: `⚠️ TIER 2: {reason}`
202
+ 2. Read agent file **completely**
203
+ 3. Extract: Directive, Protocol, Constraints, Format
204
+ 4. Announce embodiment with structured block
205
+ 5. Execute as agent (follow THEIR protocol)
206
+ 6. Exit embodiment, continue as orchestrator
207
+
208
+ ### Example Reference
209
+
210
+ From `rules/AGENTS.md`:
211
+ ```
212
+ ❌ FORBIDDEN: Using TIER 2 when runSubagent available
213
+ ❌ FORBIDDEN: Skipping TIER 1 because task is "simple"
214
+ ✅ REQUIRED: Attempt TIER 1 first, log if falling back
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Cognitive Anchor Pattern
220
+
221
+ | Attribute | Value |
222
+ |-----------|-------|
223
+ | **Pattern Type** | Quality — Anti-Hallucination Guardrail |
224
+ | **Where Applied** | Every agent file in `agents/*.md` and `agents/teams/*/` |
225
+ | **Rationale** | AI models can drift from their assigned role, especially in long contexts. The cognitive anchor forces the AI to extract and bind to the agent's specific directive before doing any work |
226
+
227
+ ### Description
228
+
229
+ Every agent file begins with a `🔒 COGNITIVE ANCHOR — MANDATORY OPERATING SYSTEM` block that:
230
+
231
+ 1. Declares the file **overrides** default AI patterns
232
+ 2. Mandates extraction of Core Directive + Constraints + Output Format **before** proceeding
233
+ 3. Binds the AI to follow the agent's Thinking Protocol exactly
234
+
235
+ This pattern prevents the AI from falling back to generic behavior when it should be acting as a specialist.
236
+
237
+ ### Example Reference
238
+
239
+ From `agents/backend-engineer.md`:
240
+ ```markdown
241
+ <!-- 🔒 COGNITIVE ANCHOR — MANDATORY OPERATING SYSTEM -->
242
+ > **BINDING**: This file OVERRIDES default AI patterns. Follow Thinking Protocol EXACTLY.
243
+ > **EXTRACT**: Core Directive + Constraints + Output Format before proceeding.
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Plugin Architecture (Skill Modules)
249
+
250
+ | Attribute | Value |
251
+ |-----------|-------|
252
+ | **Pattern Type** | Structural — Modular Plugin System |
253
+ | **Where Applied** | `skills/*/SKILL.md` (1,430+ modules), `matrix-skills/*.yaml` (19 domain registries) |
254
+ | **Rationale** | Domain knowledge changes faster than framework structure; independent modules can be added, discovered, and promoted without modifying core framework files |
255
+
256
+ ### Description
257
+
258
+ Each skill is a self-contained directory containing at minimum a `SKILL.md` file with domain-specific best practices. Skills are registered in 19 domain YAML files under `matrix-skills/` and resolved by the HSOL layer.
259
+
260
+ ### Plugin Lifecycle
261
+
262
+ | Phase | Mechanism |
263
+ |-------|-----------|
264
+ | **Registration** | Listed in `matrix-skills/{domain}.yaml` with metadata (priority, relevance mapping) |
265
+ | **Discovery** | HSOL matches skills to agent profiles; `find-skills` discovers community skills |
266
+ | **Resolution** | 5-factor fitness scoring selects optimal skills for a task |
267
+ | **Injection** | SKILL.md content is loaded into the agent's context |
268
+ | **Promotion** | Community skills progress: NEW (0.3) → EVALUATING (0.5) → VALIDATED (0.7) → PROMOTED (1.0) |
269
+
270
+ ### Example Reference
271
+
272
+ From `matrix-skills/_index.yaml`:
273
+ ```yaml
274
+ total_matrix_skills: 1430
275
+ hsol:
276
+ enabled: true
277
+ version: "1.1"
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Profile-Based Injection Pattern
283
+
284
+ | Attribute | Value |
285
+ |-----------|-------|
286
+ | **Pattern Type** | Quality — Automatic Knowledge Provisioning |
287
+ | **Where Applied** | Agent YAML frontmatter (`agents/*.md`), HSOL resolution (`rules/SKILLS.md`) |
288
+ | **Rationale** | Agents should not manually request skills — their declared profile automatically determines what knowledge they receive, ensuring consistent expertise across invocations |
289
+
290
+ ### Description
291
+
292
+ Every agent declares a `profile` field in their YAML frontmatter (e.g., `profile: "backend:execution"`). The HSOL layer uses this profile to:
293
+
294
+ 1. Load inherited domains from `_index.yaml`
295
+ 2. Filter skills by relevance mapping from domain YAML files
296
+ 3. Apply priority thresholds (critical ≥ 9, core ≥ 7, minimum ≥ 5)
297
+ 4. Calculate fitness scores
298
+ 5. Return a sorted skill set
299
+
300
+ ### Profile Format
301
+
302
+ ```
303
+ {domain}:{category}
304
+ ```
305
+
306
+ | Example Profile | Domains Loaded |
307
+ |----------------|----------------|
308
+ | `backend:execution` | backend, architecture, quality, data, languages |
309
+ | `frontend:execution` | frontend, design, quality, languages |
310
+ | `research:documentation` | research |
311
+ | `quality:validation` | quality, security, performance |
312
+
313
+ ### Example Reference
314
+
315
+ From `agents/backend-engineer.md`:
316
+ ```yaml
317
+ profile: "backend:execution"
318
+ ```
319
+ ```markdown
320
+ > **MATRIX DISCOVERY**: Skills auto-injected from domain files in ~/.{TOOL}/skills/agent-assistant/matrix-skills/
321
+ > Profile: backend:execution | Domains: backend, architecture, quality, data, languages
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Phase Pipeline Pattern
327
+
328
+ | Attribute | Value |
329
+ |-----------|-------|
330
+ | **Pattern Type** | Behavioral — Sequential Pipeline with Gates |
331
+ | **Where Applied** | `rules/PHASES.md` (format), `rules/CORE.md` (L5 enforcement), variant workflow files |
332
+ | **Rationale** | Sequential execution with exit criteria prevents downstream errors from incomplete phases and ensures each phase builds on verified prior work |
333
+
334
+ ### Description
335
+
336
+ Every workflow variant defines a series of phases that execute strictly in order:
337
+
338
+ 1. **Requirements Intake** — Parse ALL requirements into a numbered registry (100% fidelity)
339
+ 2. **Phase 1 → Phase N** — Each phase delegates to an agent, produces a deliverable, and verifies exit criteria
340
+ 3. **Deliverable as Constraint** — Completed deliverables become immutable inputs for subsequent phases (L8: Stateful Handoff)
341
+
342
+ ### Phase Output Format (from PHASES.md)
343
+
344
+ ```markdown
345
+ ## 🎭 Phase {N}: {name}
346
+ ### Sub-agent: `{agent}` — {role}
347
+ {agent work / summary}
348
+ ### Exit Criteria
349
+ - [x] {criterion_1}
350
+ - [x] {criterion_2}
351
+ ### ✅ `{agent}` complete
352
+ **Deliverable**: {summary}
353
+ ```
354
+
355
+ ### Key Rules
356
+
357
+ - L5 (Sequential Execution): Phase N completes before Phase N+1 starts
358
+ - L8 (Stateful Handoff): Prior deliverables are immutable constraints
359
+ - L2 (Requirement Integrity): 100% fidelity, zero loss in requirements registry
360
+ - No batching: phases execute one at a time, never loaded in parallel (anti-pattern A8)
361
+
362
+ ---
363
+
364
+ ## Golden Triangle Pattern
365
+
366
+ | Attribute | Value |
367
+ |-----------|-------|
368
+ | **Pattern Type** | Quality — Adversarial Collaboration |
369
+ | **Where Applied** | `rules/TEAMS.md` (protocol), `agents/teams/*/` (17 team directories) |
370
+ | **Rationale** | Structured tension between a builder and a challenger, orchestrated by an arbitrator, produces higher-quality output than single-agent execution or parallel cooperation |
371
+
372
+ ### Description
373
+
374
+ When `:team` variant is invoked, each phase spawns exactly 3 agent roles:
375
+
376
+ | Role | Personality | Function |
377
+ |------|------------|----------|
378
+ | **Tech Lead** | Pragmatic, decisive | Decomposes tasks, coordinates, arbitrates disputes, synthesizes |
379
+ | **Executor** | Builder, evidence-driven | Implements, defends work with technical proof |
380
+ | **Reviewer** | Skeptical, demanding | Challenges with devil's advocate mindset, assumes defects exist |
381
+
382
+ ### Debate Rules
383
+
384
+ - Max 3 rounds of Executor ↔ Reviewer exchange
385
+ - Executor MUST defend with technical evidence (benchmarks, specs, references)
386
+ - "I disagree" without proof = automatic FAIL
387
+ - After round 3 without agreement, Tech Lead reads all exchanges and issues a binding `DECISION`
388
+ - Consensus stamp required: `TechLead ✓ | Executor ✓ | Reviewer ✓`
389
+
390
+ ### Example Reference
391
+
392
+ From `rules/TEAMS.md`:
393
+ ```
394
+ CORE PRINCIPLE: Every team phase spawns exactly 3 agent roles — no more, no less.
395
+ Quality emerges from structured tension between an Executor who builds
396
+ and a Reviewer who challenges, orchestrated by a Tech Lead who arbitrates.
397
+ ```
398
+
399
+ ---
400
+
401
+ ## File-Based Communication (Mailbox)
402
+
403
+ | Attribute | Value |
404
+ |-----------|-------|
405
+ | **Pattern Type** | Communication — Append-Only Event Log |
406
+ | **Where Applied** | `rules/TEAMS.md` (protocol), `./reports/{topic}/MAILBOX-{date}.md` (runtime artifact) |
407
+ | **Rationale** | File-based communication provides a persistent, auditable record of all inter-agent exchanges without requiring a message broker or shared memory |
408
+
409
+ ### Description
410
+
411
+ All agent communication within a Golden Triangle flows through two shared artifacts:
412
+
413
+ | Artifact | Format | Rules |
414
+ |----------|--------|-------|
415
+ | **Shared Task List** | Table in phase output | Owned by Tech Lead; tracks assignments, status, priorities |
416
+ | **Mailbox** | `./reports/{topic}/MAILBOX-{date}.md` | Append-only — no edits or deletions; all agents can read; all agents can append |
417
+
418
+ ### Message Types
419
+
420
+ | Type | Direction | Purpose |
421
+ |------|-----------|---------|
422
+ | TASK_ASSIGNMENT | Tech Lead → Executor | Assign work |
423
+ | SUBMISSION | Executor → Reviewer | Submit deliverable |
424
+ | REVIEW (PASS/FAIL) | Reviewer → Executor | Accept or reject |
425
+ | DEFENSE | Executor → Reviewer | Defend with evidence |
426
+ | RESUBMISSION | Executor → Reviewer | Resubmit after fixes |
427
+ | DECISION | Tech Lead → All | Binding arbitration |
428
+
429
+ ### Enforcement
430
+
431
+ - C8-TEAMS-01 (BLOCK): Mailbox is append-only and required for all inter-agent exchanges
432
+ - No agent may edit or delete prior exchanges
433
+
434
+ ---
435
+
436
+ ## Platform Abstraction Pattern
437
+
438
+ | Attribute | Value |
439
+ |-----------|-------|
440
+ | **Pattern Type** | Structural — Write-Once Deploy-Many |
441
+ | **Where Applied** | `cli/install.js` (implementation), all `.md` and `.yaml` files (placeholders) |
442
+ | **Rationale** | Supporting 5 AI platforms from a single codebase eliminates duplication and ensures feature parity; install-time substitution is simpler than runtime branching |
443
+
444
+ ### Description
445
+
446
+ The framework uses `{TOOL}` (and related) placeholders throughout all Markdown and YAML files. At install time, `cli/install.js` performs text replacement based on the target platform:
447
+
448
+ | Platform | `{TOOL}` Value | Install Path |
449
+ |----------|---------------|--------------|
450
+ | Cursor | `cursor` | `~/.cursor/skills/agent-assistant/` |
451
+ | GitHub Copilot | `copilot` | `~/.copilot/skills/agent-assistant/` |
452
+ | Claude Code | `claude` | `~/.claude/skills/agent-assistant/` |
453
+ | Codex | `codex` | `~/.codex/skills/agent-assistant/` |
454
+ | Antigravity/Gemini | `gemini/antigravity` | `~/.gemini/antigravity/skills/agent-assistant/` |
455
+
456
+ ### Platform-Specific Assets
457
+
458
+ Beyond placeholder substitution, each platform has custom assets in `code-assistants/{tool}-assistant/`:
459
+
460
+ | Platform | Custom Assets |
461
+ |----------|--------------|
462
+ | Cursor | Rules directory, `.cursorrules` file |
463
+ | Copilot | `agent-assistant.agent.md` VS Code prompt file |
464
+ | Claude Code | Claude-specific configuration |
465
+ | Codex | Codex-specific configuration |
466
+ | Antigravity | Gemini-specific configuration |
467
+
468
+ ### Example Reference
469
+
470
+ From `cli/install.js` (Cursor config):
471
+ ```javascript
472
+ replacements: {
473
+ '~/.{TOOL}/skills/agent-assistant/': '~/.cursor/skills/agent-assistant/',
474
+ '{TOOL}': 'cursor',
475
+ '{HOME}': '~',
476
+ }
477
+ ```
478
+
479
+ ---
480
+
481
+ ## Evidence Sources
482
+
483
+ | Source | Path | What It Provides |
484
+ |--------|------|------------------|
485
+ | CORE.md v4.1 | `rules/CORE.md` | Orchestrator identity, execution loop, 10 laws, prohibitions, self-check |
486
+ | PHASES.md | `rules/PHASES.md` | Phase output format, requirements registry, exit criteria pattern |
487
+ | AGENTS.md | `rules/AGENTS.md` | TIER 1/TIER 2 protocol, embodiment format, tool discovery, completion guarantee |
488
+ | SKILLS.md | `rules/SKILLS.md` | HSOL resolution, fitness formula, trust lifecycle, complexity gating |
489
+ | TEAMS.md | `rules/TEAMS.md` | Golden Triangle: roles, debate mechanism (3 rounds), mailbox protocol, C8 checkpoints |
490
+ | ERRORS.md | `rules/ERRORS.md` | Anti-patterns A1–A10 (violations of proper patterns) |
491
+ | REFERENCE.md | `rules/REFERENCE.md` | Command-variant table, agent category table |
492
+ | _index.yaml | `matrix-skills/_index.yaml` | HSOL config, total skills, domain count, discovery settings |
493
+ | cli/install.js | `cli/install.js` | Platform configs, replacement maps, file copy logic |
494
+ | cook.md | `commands/cook.md` | Example command router: pre-flight, routing logic, variant table |
495
+ | backend-engineer.md | `agents/backend-engineer.md` | Example agent: profile `backend:execution`, cognitive anchor, handoffs |
496
+ | docs-manager.md | `agents/docs-manager.md` | Example agent profile: `research:documentation` |
497
+ | agents/teams/ | `agents/teams/` | 17 team directories with techlead.md, executor.md, reviewer.md each |