@namch/agent-assistant 1.3.0 → 1.3.1

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 (90) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/agents/backend-engineer.md +3 -3
  3. package/agents/brainstormer.md +3 -3
  4. package/agents/business-analyst.md +3 -3
  5. package/agents/database-architect.md +3 -3
  6. package/agents/debugger.md +2 -2
  7. package/agents/designer.md +2 -2
  8. package/agents/devops-engineer.md +2 -2
  9. package/agents/docs-manager.md +23 -15
  10. package/agents/frontend-engineer.md +3 -3
  11. package/agents/game-engineer.md +3 -3
  12. package/agents/mobile-engineer.md +4 -4
  13. package/agents/performance-engineer.md +3 -3
  14. package/agents/planner.md +4 -4
  15. package/agents/project-manager.md +3 -3
  16. package/agents/researcher.md +3 -3
  17. package/agents/reviewer.md +3 -3
  18. package/agents/scouter.md +3 -3
  19. package/agents/security-engineer.md +3 -3
  20. package/agents/tech-lead.md +3 -3
  21. package/agents/tester.md +2 -2
  22. package/commands/docs/audit.md +554 -78
  23. package/commands/docs/business.md +392 -76
  24. package/commands/docs/core.md +573 -74
  25. package/commands/docs.md +62 -61
  26. package/documents/business/business-features/00-index.md +101 -0
  27. package/documents/business/business-features/01-feature-inventory.md +341 -0
  28. package/documents/business/business-features/02-prioritization-moscow.md +148 -0
  29. package/documents/business/business-features/03-feature-specifications.md +512 -0
  30. package/documents/business/business-features/04-dependencies-and-release-sequencing.md +313 -0
  31. package/documents/business/business-features/05-success-metrics.md +290 -0
  32. package/documents/business/business-glossary/00-index.md +89 -0
  33. package/documents/business/business-glossary/01-canonical-terms.md +428 -0
  34. package/documents/business/business-glossary/02-synonyms-and-deprecated-terms.md +180 -0
  35. package/documents/business/business-glossary/03-domain-entities-and-events.md +395 -0
  36. package/documents/business/business-glossary/04-api-term-mapping.md +173 -0
  37. package/documents/business/business-prd/00-index.md +107 -0
  38. package/documents/business/business-prd/01-executive-summary.md +131 -0
  39. package/documents/business/business-prd/02-problem-goals-and-scope.md +204 -0
  40. package/documents/business/business-prd/03-stakeholders-and-requirements.md +210 -0
  41. package/documents/business/business-prd/04-acceptance-risks-assumptions.md +246 -0
  42. package/documents/business/business-workflows/00-index.md +107 -0
  43. package/documents/business/business-workflows/01-actor-map.md +303 -0
  44. package/documents/business/business-workflows/02-workflow-catalog.md +252 -0
  45. package/documents/business/business-workflows/03-detailed-workflows.md +641 -0
  46. package/documents/business/business-workflows/04-decision-rules-and-exceptions.md +216 -0
  47. package/documents/business/business-workflows/05-sla-and-handoffs.md +253 -0
  48. package/documents/knowledge-architecture/00-index.md +159 -0
  49. package/documents/knowledge-architecture/01-system-overview.md +240 -0
  50. package/documents/knowledge-architecture/02-components.md +419 -0
  51. package/documents/knowledge-architecture/03-data-flow.md +369 -0
  52. package/documents/knowledge-architecture/04-design-patterns.md +498 -0
  53. package/documents/knowledge-architecture/05-decisions.md +410 -0
  54. package/documents/knowledge-domain/00-index.md +251 -0
  55. package/documents/knowledge-domain/01-entities.md +583 -0
  56. package/documents/knowledge-domain/02-database-schema.md +138 -0
  57. package/documents/knowledge-domain/03-api-contracts.md +479 -0
  58. package/documents/knowledge-domain/04-business-rules.md +555 -0
  59. package/documents/knowledge-overview/00-index.md +107 -0
  60. package/documents/knowledge-overview/01-project-identity.md +162 -0
  61. package/documents/knowledge-overview/02-tech-stack.md +119 -0
  62. package/documents/knowledge-overview/03-features.md +233 -0
  63. package/documents/knowledge-overview/04-getting-started.md +394 -0
  64. package/documents/knowledge-source-base/00-index.md +107 -0
  65. package/documents/knowledge-source-base/01-directory-structure.md +312 -0
  66. package/documents/knowledge-source-base/02-entry-points.md +346 -0
  67. package/documents/knowledge-source-base/03-key-modules.md +582 -0
  68. package/documents/knowledge-source-base/04-configuration.md +467 -0
  69. package/documents/knowledge-standards/00-index.md +129 -0
  70. package/documents/knowledge-standards/01-code-style.md +161 -0
  71. package/documents/knowledge-standards/02-conventions.md +255 -0
  72. package/documents/knowledge-standards/03-git-workflow.md +228 -0
  73. package/documents/knowledge-standards/04-testing-standards.md +175 -0
  74. package/package.json +1 -1
  75. package/rules/REFERENCE.md +10 -6
  76. package/skills/docs-audit/README.md +10 -8
  77. package/skills/docs-audit/SKILL.md +45 -41
  78. package/skills/docs-audit/references/scoring-framework.md +5 -5
  79. package/skills/docs-core/README.md +19 -14
  80. package/skills/docs-core/SKILL.md +189 -117
  81. package/skills/planning/references/codebase-understanding.md +5 -5
  82. package/documents/business/business-features.md +0 -894
  83. package/documents/business/business-glossary.md +0 -554
  84. package/documents/business/business-prd.md +0 -400
  85. package/documents/business/business-workflows.md +0 -713
  86. package/documents/knowledge-architecture.md +0 -621
  87. package/documents/knowledge-domain.md +0 -602
  88. package/documents/knowledge-overview.md +0 -316
  89. package/documents/knowledge-source-base.md +0 -581
  90. package/documents/knowledge-standards.md +0 -632
@@ -0,0 +1,216 @@
1
+ # Agent Assistant — Decision Rules & Exceptions
2
+
3
+ | Field | Value |
4
+ |-------|-------|
5
+ | **Purpose** | Codify all business rules governing workflow behavior, including orchestration laws, tiered execution, phase sequencing, HSOL thresholds, debate limits, error classification, and the exception catalog |
6
+ | **Parent** | [00-index.md](00-index.md) |
7
+ | **Last Updated** | 2026-03-26 |
8
+ | **Generated By** | docs-business skill |
9
+
10
+ ---
11
+
12
+ ## 1. Orchestration Laws (Workflow-Relevant)
13
+
14
+ The 10 Orchestration Laws define absolute behavioral constraints on the Orchestrator. The following laws have direct workflow implications:
15
+
16
+ | Law | Name | Rule | Workflow Impact |
17
+ |-----|------|------|----------------|
18
+ | L1 | Load Before Act | CORE.md must be loaded before any action | BW-003: pre-flight requires CORE.md loaded |
19
+ | L2 | Never Guess | Ambiguous requirements → PAUSE + ASK | BW-003: halts command execution until clarified |
20
+ | L3 | Follow the File | Workflow files are authoritative — follow them exactly | BW-003: variant file dictates phase sequence |
21
+ | L4 | Phase Order | Phase N must complete before Phase N+1 | BW-003, BW-009: strict sequential execution |
22
+ | L5 | Verify Exit | Every phase exit criteria must be verified | BW-003, BW-004: gate between phases |
23
+ | L6 | Prefer TIER 1 | Sub-agent (isolated) always preferred over embodiment | BW-004: delegation tier selection |
24
+ | L7 | Never Implement | Orchestrator delegates — never writes code or implements directly | All workflows: Orchestrator is coordinator only |
25
+ | L8 | Immutable Deliverables | Output from Phase N is read-only in Phase N+1 | BW-003: inter-phase data contract |
26
+ | L9 | Explicit Failure | No silent failures — every error must surface | BW-010: terminal guarantee |
27
+ | L10 | Scope Lock | Stay within the defined scope — no scope creep | All workflows: boundary enforcement |
28
+
29
+ ---
30
+
31
+ ## 2. Tiered Execution Rules
32
+
33
+ ### Rule Set
34
+
35
+ | Rule ID | Rule | Condition | Action |
36
+ |---------|------|-----------|--------|
37
+ | TE-001 | TIER 1 priority | `runSubagent` is available | MUST use TIER 1 (isolated sub-agent) |
38
+ | TE-002 | TIER 2 fallback | `runSubagent` unavailable OR fails | MAY use TIER 2 (embodiment) with logged justification |
39
+ | TE-003 | TIER 2 logging | TIER 2 used | MUST log reason for TIER 2 selection |
40
+ | TE-004 | No TIER 2 when TIER 1 works | `runSubagent` available and functional | FORBIDDEN to use TIER 2 |
41
+ | TE-005 | Deliverable parity | Either tier produces output | Deliverable format and exit criteria are identical regardless of tier |
42
+
43
+ ### TIER Comparison
44
+
45
+ | Aspect | TIER 1 (Sub-Agent) | TIER 2 (Embodiment) |
46
+ |--------|--------------------|--------------------|
47
+ | Context | Isolated — scoped to phase | Shared — Orchestrator's full context |
48
+ | Risk | Low — no context bleed | Higher — potential context interference |
49
+ | Preference | Always preferred | Fallback only |
50
+ | Logging | Standard | Must include TIER 2 justification |
51
+ | Deliverable | Returned from sub-agent | Extracted from shared context |
52
+
53
+ ---
54
+
55
+ ## 3. Phase Sequencing Rules
56
+
57
+ | Rule ID | Rule | Description |
58
+ |---------|------|-------------|
59
+ | PS-001 | Sequential execution | Phases execute in defined order — no parallelism, no reordering |
60
+ | PS-002 | Gate verification | Each phase's exit criteria must be verified before proceeding |
61
+ | PS-003 | Input immutability | A phase receives prior deliverables as read-only inputs (Law 8) |
62
+ | PS-004 | Halt on failure | If exit criteria not met and BW-010 cannot recover → halt workflow |
63
+ | PS-005 | No skip | Phases cannot be skipped except via explicit short-circuit (BW-011) |
64
+ | PS-006 | Plan short-circuit | If valid PLAN-*.md referenced in /code:hard or /code:focus → skip research/scout/brainstorm phases |
65
+ | PS-007 | Variant authority | The variant file defines the phase sequence — no deviation |
66
+
67
+ ---
68
+
69
+ ## 4. HSOL Threshold Rules
70
+
71
+ ### Fitness Band Routing
72
+
73
+ | Rule ID | Fitness Band | Route | Blocking? | Discovery? |
74
+ |---------|-------------|-------|-----------|------------|
75
+ | HS-001 | ≥ 0.8 | Matrix skills only | No | No |
76
+ | HS-002 | 0.75 – 0.8 | Matrix skills + async discovery | No | Async (BW-006) |
77
+ | HS-003 | < 0.75 | Blocking discovery | Yes | Sync (BW-006) |
78
+
79
+ ### Discovery Rules
80
+
81
+ | Rule ID | Rule | Description |
82
+ |---------|------|-------------|
83
+ | HS-004 | Superiority delta | Dynamic skill must exceed current best by > 0.15 to be adopted |
84
+ | HS-005 | Confirmation gate | Low-trust skill + critical task → Framework User confirmation required |
85
+ | HS-006 | Timeout ceiling | Discovery must complete within 5 seconds; timeout → matrix-only |
86
+ | HS-007 | Install rollback | Failed installation → rollback + offer matrix alternatives |
87
+ | HS-008 | Hard/focus only | Dynamic discovery only triggers for hard and focus command variants |
88
+
89
+ ### Trust Progression Rules
90
+
91
+ | Rule ID | Rule | Description |
92
+ |---------|------|-------------|
93
+ | TP-001 | Initial trust | Newly discovered skills start at NEW (0.3) |
94
+ | TP-002 | Promotion: NEW → EVALUATING | 3 successive successful executions |
95
+ | TP-003 | Promotion: EVALUATING → VALIDATED | 10 successive successful executions |
96
+ | TP-004 | Promotion: VALIDATED → PROMOTED | count ≥ 10, success rate ≥ 85%, inactive ≤ 30 days |
97
+ | TP-005 | Block: performance | Success rate < 85% at any checkpoint → BLOCKED |
98
+ | TP-006 | Block: inactivity30 | Inactive > 30 days → BLOCKED |
99
+ | TP-007 | Decay: inactivity90 | Inactive > 90 days → full trust decay to 0.0 |
100
+ | TP-008 | No auto-unblock | BLOCKED skills require manual review to reinstate |
101
+
102
+ ---
103
+
104
+ ## 5. Team Collaboration Rules
105
+
106
+ ### Debate Protocol
107
+
108
+ | Rule ID | Rule | Description |
109
+ |---------|------|-------------|
110
+ | TC-001 | Max rounds | Maximum 3 debate rounds between Executor and Reviewer |
111
+ | TC-002 | Arbitration | After 3 rounds, Tech Lead makes final binding decision |
112
+ | TC-003 | Evidence required | FAIL reviews must include specific evidence/reasoning |
113
+ | TC-004 | Auto-FAIL | "Disagree without proof" → automatic FAIL of the review itself |
114
+ | TC-005 | Consensus stamp | Every team deliverable requires consensus stamp before release |
115
+
116
+ ### Mailbox Protocol
117
+
118
+ | Rule ID | Rule | Description |
119
+ |---------|------|-------------|
120
+ | TC-006 | Message types | TASK_ASSIGNMENT, SUBMISSION, REVIEW only |
121
+ | TC-007 | Ordered flow | TASK_ASSIGNMENT → SUBMISSION → REVIEW → (loop or release) |
122
+ | TC-008 | Channel isolation | Team agents communicate only through Mailbox — no side channels |
123
+ | TC-009 | Tech Lead authority | Tech Lead has final authority after discussion exhaustion |
124
+
125
+ ---
126
+
127
+ ## 6. Error Classification Rules
128
+
129
+ ### Tier Definitions
130
+
131
+ | Tier | Name | Strategy | Attempts | Escalates To |
132
+ |------|------|----------|----------|-------------|
133
+ | E1 | Retry | Re-execute identical operation | 3 | E1b |
134
+ | E1b | Chunk | Break into smaller units, retry each | 1 | E2 |
135
+ | E2 | Alternative | Entirely different approach | 1 | E3 |
136
+ | E3 | Safe Point | Save progress to recoverable state | 1 | E4 |
137
+ | E4 | Rollback | Revert + user escalation | 1 | User decision |
138
+
139
+ ### Error Recovery Rules
140
+
141
+ | Rule ID | Rule | Description |
142
+ |---------|------|-------------|
143
+ | ER-001 | Graduated escalation | E1 → E1b → E2 → E3 → E4, in order — no skipping |
144
+ | ER-002 | No silent failure | Every error path must terminate in success or explicit user decision (Law 9) |
145
+ | ER-003 | Context preservation | Error recovery preserves all deliverables from completed phases |
146
+ | ER-004 | Cascading prevention | E4 stops error propagation to prevent cascading failures |
147
+ | ER-005 | User agency | After E4, user gets full context and options: retry, accept partial, abort |
148
+ | ER-006 | Rollback integrity | E4 rollback restores to last known good state — partial rollback not permitted |
149
+
150
+ ---
151
+
152
+ ## 7. Command Routing Rules
153
+
154
+ | Rule ID | Rule | Description |
155
+ |---------|------|-------------|
156
+ | CR-001 | Explicit commands | `/{cmd}` or `/{cmd}:{variant}` → direct route to `commands/{cmd}/{variant}.md` |
157
+ | CR-002 | Natural language | NL input → mapped to closest command (implement→/cook, fix/bug→/fix, plan→/plan) |
158
+ | CR-003 | Default variant | No variant specified → use default (base) variant |
159
+ | CR-004 | Team routing | `:team` variant → route to BW-008 (Golden Triangle) |
160
+ | CR-005 | Unknown command | Unrecognized input → attempt NL mapping → still unknown → ASK user |
161
+
162
+ ---
163
+
164
+ ## 8. Exception Catalog
165
+
166
+ | Exception ID | Workflow | Trigger | Handling | Severity |
167
+ |-------------|----------|---------|----------|----------|
168
+ | EX-001 | BW-001 | Node.js < 18 | Error message + exit 1 | Blocking |
169
+ | EX-002 | BW-001 | Invalid tool name | "Unknown tool" + exit 1 | Blocking |
170
+ | EX-003 | BW-001 | Directory creation failure | Report error + exit 1 | Blocking |
171
+ | EX-004 | BW-002 | Installation not found | Skip with info message | Non-blocking |
172
+ | EX-005 | BW-003 | Ambiguous requirement | PAUSE + ASK user (Law 2) | Blocking (waiting) |
173
+ | EX-006 | BW-003 | Exit criteria not met | Invoke BW-010 | Escalating |
174
+ | EX-007 | BW-003 | Unknown command/NL | ASK user for clarification | Blocking (waiting) |
175
+ | EX-008 | BW-004 | runSubagent failure | Fall back to TIER 2 + log | Non-blocking |
176
+ | EX-009 | BW-005 | Network timeout | Matrix-only fallback | Degraded |
177
+ | EX-010 | BW-005 | No matching skills | Report gap to Orchestrator | Informational |
178
+ | EX-011 | BW-006 | Discovery timeout (5s) | Matrix-only fallback | Degraded |
179
+ | EX-012 | BW-006 | Install failure | Rollback + offer matrix | Recoverable |
180
+ | EX-013 | BW-006 | User declines skill | Matrix-only | Non-blocking |
181
+ | EX-014 | BW-007 | Success rate < 85% | Skill → BLOCKED | Automatic |
182
+ | EX-015 | BW-007 | Inactive > 30d | Skill → BLOCKED | Automatic |
183
+ | EX-016 | BW-008 | 3 rounds exhausted | Tech Lead arbitrates | Escalating |
184
+ | EX-017 | BW-008 | FAIL without evidence | Auto-FAIL the review | Automatic |
185
+ | EX-018 | BW-009 | Layer incomplete | FAILED status, halt | Blocking |
186
+ | EX-019 | BW-010 | E4 rollback fails | User escalation immediate | Critical |
187
+ | EX-020 | BW-011 | Invalid plan file | Fall back to standard BW-003 | Non-blocking |
188
+ | EX-021 | BW-012 | Convention deviation | Design review required | Blocking |
189
+
190
+ ---
191
+
192
+ ## 9. Rule Precedence
193
+
194
+ When rules conflict, precedence follows this hierarchy (highest first):
195
+
196
+ 1. **Safety**: Error recovery and no-silent-failure guarantee (ER-002)
197
+ 2. **Orchestration Laws**: L1–L10 are absolute and non-negotiable
198
+ 3. **Phase Sequencing**: PS-001 through PS-007
199
+ 4. **Tiered Execution**: TE-001 through TE-005
200
+ 5. **HSOL Thresholds**: HS-001 through HS-008
201
+ 6. **Team Protocol**: TC-001 through TC-009
202
+ 7. **Command Routing**: CR-001 through CR-005
203
+
204
+ ---
205
+
206
+ ## Evidence Sources
207
+
208
+ - `rules/CORE.md` — 10 Orchestration Laws (L1–L10)
209
+ - `rules/AGENTS.md` — TIER 1/TIER 2 execution rules, sub-agent protocol
210
+ - `rules/PHASES.md` — Phase sequencing, exit criteria, immutability
211
+ - `rules/SKILLS.md` — HSOL fitness algorithm, threshold bands, trust state machine, dynamic discovery
212
+ - `rules/TEAMS.md` — Golden Triangle protocol, debate rounds, Mailbox, consensus stamps
213
+ - `rules/ERRORS.md` — E1–E4 error tiers, graduated escalation, no-silent-halt
214
+ - `CLAUDE.md` — Orchestrator prohibitions, command routing
215
+ - `commands/*.md` — Command and variant definitions
216
+ - `cli/install.js` — CLI error handling and validation
@@ -0,0 +1,253 @@
1
+ # Agent Assistant — SLA & Handoffs
2
+
3
+ | Field | Value |
4
+ |-------|-------|
5
+ | **Purpose** | Define timing expectations, handoff contracts between actors, and SLA/SLO context for all business workflows |
6
+ | **Parent** | [00-index.md](00-index.md) |
7
+ | **Last Updated** | 2026-03-26 |
8
+ | **Generated By** | docs-business skill |
9
+
10
+ ---
11
+
12
+ ## 1. Timing Expectations by Workflow
13
+
14
+ ### System-Controlled Operations
15
+
16
+ | Workflow | Operation | Target Time | Tolerance | Notes |
17
+ |----------|-----------|-------------|-----------|-------|
18
+ | BW-001 | Full installation (single tool) | < 15s | 30s max | File copy + placeholder replacement |
19
+ | BW-001 | Full installation (--all, 5 tools) | < 30s | 60s max | Sequential per-tool |
20
+ | BW-002 | Uninstallation (single tool) | < 10s | 20s max | File removal + cleanup |
21
+ | BW-002 | Uninstallation (--all) | < 20s | 40s max | Sequential per-tool |
22
+ | BW-003 | Command routing + variant resolution | < 5s | 10s max | Pre-flight + file load |
23
+ | BW-005 | Matrix-only skill resolution (≥0.8) | < 2s | 5s max | YAML parse + scoring |
24
+ | BW-005 | Matrix + async discovery (0.75–0.8) | < 2s sync | 5s async cap | Matrix immediate; discovery background |
25
+ | BW-006 | Dynamic skill discovery | ≤ 5s | Hard timeout | `npx skills find` enforced ceiling |
26
+ | BW-006 | Skill installation | < 10s | 15s max | `npx skills add` |
27
+
28
+ ### AI-Dependent Operations
29
+
30
+ These timings depend on the AI model's inference speed and context window. They represent best-effort targets, not enforced SLAs.
31
+
32
+ | Workflow | Operation | Expected Range | Bounded By |
33
+ |----------|-----------|---------------|------------|
34
+ | BW-003 | Single phase execution | 5s – 60s | Model inference + tool execution |
35
+ | BW-003 | Full command (simple variant) | 30s – 5min | Phase count × phase time |
36
+ | BW-003 | Full command (hard/focus variant) | 2min – 30min | Research + implementation complexity |
37
+ | BW-004 | Agent delegation (TIER 1) | 5s – 30s per phase | Sub-agent spawn + execution |
38
+ | BW-004 | Agent delegation (TIER 2) | 3s – 20s per phase | No spawn overhead |
39
+ | BW-008 | Team collaboration (full cycle) | 5min – 45min | 1–3 debate rounds × 3 agents |
40
+ | BW-009 | Documentation generation (full) | 10min – 60min | 13 folders sequential |
41
+ | BW-010 | Error recovery (E1) | 5s – 30s per retry | Up to 3 retries |
42
+ | BW-010 | Error recovery (full E1–E4) | 30s – 10min | Graduated escalation |
43
+
44
+ ---
45
+
46
+ ## 2. Handoff Contracts
47
+
48
+ ### 2.1 User → Orchestrator
49
+
50
+ | Contract ID | HC-001 |
51
+ |-------------|--------|
52
+ | **From** | Framework User |
53
+ | **To** | AI Model (Orchestrator) |
54
+ | **Trigger** | User types command or natural language instruction |
55
+ | **Payload** | Command text, optional file references, conversation context |
56
+ | **Required** | Actionable intent (explicit command or mappable NL) |
57
+ | **Acknowledgment** | Orchestrator begins pre-flight within 5s |
58
+ | **Failure Mode** | Unrecognizable intent → Orchestrator ASKs for clarification |
59
+
60
+ ---
61
+
62
+ ### 2.2 Orchestrator → Agent (Phase Delegation)
63
+
64
+ | Contract ID | HC-002 |
65
+ |-------------|--------|
66
+ | **From** | AI Model (Orchestrator) |
67
+ | **To** | Specialist Agent (any of 21 agents) |
68
+ | **Trigger** | Phase N begins execution |
69
+ | **Payload** | Phase definition, exit criteria, prior phase deliverables (read-only), skill set (from BW-005) |
70
+ | **Required** | Agent definition loaded, TIER selected, context scoped |
71
+ | **Deliverable** | Phase output matching exit criteria format |
72
+ | **Acknowledgment** | Agent confirms receipt and begins execution |
73
+ | **Failure Mode** | TIER 1 failure → fallback to TIER 2; deliverable missing → BW-010 |
74
+
75
+ ---
76
+
77
+ ### 2.3 Agent → Orchestrator (Phase Completion)
78
+
79
+ | Contract ID | HC-003 |
80
+ |-------------|--------|
81
+ | **From** | Specialist Agent |
82
+ | **To** | AI Model (Orchestrator) |
83
+ | **Trigger** | Agent completes phase work |
84
+ | **Payload** | Phase deliverable (code, analysis, plan, etc.) |
85
+ | **Required** | Deliverable must match exit criteria defined in phase spec |
86
+ | **Verification** | Orchestrator verifies exit criteria before accepting |
87
+ | **Failure Mode** | Exit criteria not met → BW-010 error recovery |
88
+
89
+ ---
90
+
91
+ ### 2.4 Orchestrator → Tech Lead (Team Init)
92
+
93
+ | Contract ID | HC-004 |
94
+ |-------------|--------|
95
+ | **From** | AI Model (Orchestrator) |
96
+ | **To** | Tech Lead (Team Agent) |
97
+ | **Trigger** | `:team` variant command received |
98
+ | **Payload** | Full task description, constraints, quality requirements |
99
+ | **Required** | Task must be decomposable into assignable units |
100
+ | **Deliverable** | TASK_ASSIGNMENT message posted to Mailbox |
101
+ | **Timing** | Assignment within first phase cycle |
102
+ | **Failure Mode** | Undecomposable task → escalate to user |
103
+
104
+ ---
105
+
106
+ ### 2.5 Tech Lead → Executor (via Mailbox)
107
+
108
+ | Contract ID | HC-005 |
109
+ |-------------|--------|
110
+ | **From** | Tech Lead |
111
+ | **To** | Executor (domain-specific agent) |
112
+ | **Channel** | Mailbox (TASK_ASSIGNMENT message) |
113
+ | **Payload** | Task decomposition, acceptance criteria, constraints, skill context |
114
+ | **Required** | Clear, implementable task units with measurable criteria |
115
+ | **Deliverable** | SUBMISSION message to Mailbox |
116
+ | **Failure Mode** | Unclear assignment → Executor requests clarification via Mailbox |
117
+
118
+ ---
119
+
120
+ ### 2.6 Executor → Reviewer (via Mailbox)
121
+
122
+ | Contract ID | HC-006 |
123
+ |-------------|--------|
124
+ | **From** | Executor |
125
+ | **To** | Reviewer |
126
+ | **Channel** | Mailbox (SUBMISSION message) |
127
+ | **Payload** | Implementation output, reference to TASK_ASSIGNMENT |
128
+ | **Required** | Complete implementation addressing all assignment criteria |
129
+ | **Deliverable** | REVIEW message (PASS or FAIL with evidence) |
130
+ | **Failure Mode** | Incomplete submission → Reviewer issues FAIL with specifics |
131
+
132
+ ---
133
+
134
+ ### 2.7 Reviewer → Executor (Debate Loop)
135
+
136
+ | Contract ID | HC-007 |
137
+ |-------------|--------|
138
+ | **From** | Reviewer |
139
+ | **To** | Executor |
140
+ | **Channel** | Mailbox (REVIEW message with FAIL status) |
141
+ | **Payload** | Specific critique with evidence |
142
+ | **Required** | Evidence-based FAIL (no "disagree without proof") |
143
+ | **Deliverable** | Revised SUBMISSION from Executor |
144
+ | **Max Rounds** | 3 |
145
+ | **Failure Mode** | Round 3 exhausted → Tech Lead arbitration (HC-008) |
146
+
147
+ ---
148
+
149
+ ### 2.8 Tech Lead Arbitration
150
+
151
+ | Contract ID | HC-008 |
152
+ |-------------|--------|
153
+ | **From** | Orchestrator |
154
+ | **To** | Tech Lead |
155
+ | **Trigger** | 3 debate rounds exhausted without consensus |
156
+ | **Payload** | Full debate history (all SUBMISSIONs and REVIEWs) |
157
+ | **Deliverable** | Final binding decision + consensus stamp |
158
+ | **Required** | Decision must reference debate evidence |
159
+ | **Failure Mode** | None — Tech Lead decision is terminal for the team cycle |
160
+
161
+ ---
162
+
163
+ ### 2.9 HSOL → Agent (Skill Delivery)
164
+
165
+ | Contract ID | HC-009 |
166
+ |-------------|--------|
167
+ | **From** | HSOL System |
168
+ | **To** | Agent (via Orchestrator) |
169
+ | **Trigger** | BW-005 completes skill resolution |
170
+ | **Payload** | Sorted skill set with fitness scores |
171
+ | **Required** | At least one skill, or explicit gap report |
172
+ | **Timing** | ≤ 2s for matrix-only; ≤ 5s if discovery involved |
173
+ | **Failure Mode** | No skills → gap report; timeout → matrix fallback |
174
+
175
+ ---
176
+
177
+ ### 2.10 Orchestrator → User (Error Escalation)
178
+
179
+ | Contract ID | HC-010 |
180
+ |-------------|--------|
181
+ | **From** | AI Model (Orchestrator) |
182
+ | **To** | Framework User |
183
+ | **Trigger** | E4 reached or unrecoverable error |
184
+ | **Payload** | Error context, completed deliverables, options (retry/accept/abort) |
185
+ | **Required** | Full transparency — no hidden state |
186
+ | **Deliverable** | User's explicit decision |
187
+ | **Failure Mode** | None — user decision is always terminal |
188
+
189
+ ---
190
+
191
+ ## 3. SLA/SLO Summary
192
+
193
+ ### Enforced SLAs (System-Controlled)
194
+
195
+ | ID | Metric | Target | Enforcement |
196
+ |----|--------|--------|-------------|
197
+ | SLA-001 | CLI install time (single) | < 30s | Hard timeout in install.js |
198
+ | SLA-002 | HSOL discovery timeout | ≤ 5s | Hard timeout in discovery logic |
199
+ | SLA-003 | Error: no silent failure | 100% | Law 9 — every error surfaces |
200
+ | SLA-004 | TIER 1 preference | 100% when available | Law 6 — TIER 2 only as fallback |
201
+ | SLA-005 | Phase ordering | 100% sequential | Law 4 — no skip, no reorder |
202
+ | SLA-006 | Deliverable immutability | 100% | Law 8 — prior outputs read-only |
203
+
204
+ ### Best-Effort SLOs (AI-Dependent)
205
+
206
+ | ID | Metric | Target | Measurement |
207
+ |----|--------|--------|-------------|
208
+ | SLO-001 | Command routing latency | < 5s | Time from input to first phase start |
209
+ | SLO-002 | Simple command completion | < 5 min | End-to-end for easy/default variants |
210
+ | SLO-003 | Team workflow completion | < 45 min | Full Golden Triangle cycle |
211
+ | SLO-004 | Error recovery success | > 80% | Recovered before E3 stage |
212
+ | SLO-005 | HSOL matrix-only resolution rate | > 70% | Commands resolved without discovery |
213
+ | SLO-006 | Doc generation (full) | < 60 min | All 13 folders generated |
214
+
215
+ ### Trust SLOs (HSOL-Specific)
216
+
217
+ | ID | Metric | Target | Period |
218
+ |----|--------|--------|--------|
219
+ | SLO-007 | NEW → EVALUATING promotion | ≤ 3 task cycles | Per dynamic skill |
220
+ | SLO-008 | EVALUATING → VALIDATED promotion | ≤ 10 task cycles | Per dynamic skill |
221
+ | SLO-009 | Skill success rate threshold | ≥ 85% | Rolling per skill |
222
+ | SLO-010 | Inactivity detection | ≤ 30 days | Automatic BLOCKED transition |
223
+
224
+ ---
225
+
226
+ ## 4. Handoff Flow Summary
227
+
228
+ ```mermaid
229
+ flowchart LR
230
+ U[User] -->|HC-001: Command| O[Orchestrator]
231
+ O -->|HC-002: Phase delegation| A[Agent]
232
+ A -->|HC-003: Deliverable| O
233
+ O -->|HC-004: Team init| TL[Tech Lead]
234
+ TL -->|HC-005: Assignment| EX[Executor]
235
+ EX -->|HC-006: Submission| RV[Reviewer]
236
+ RV -->|HC-007: Review/FAIL| EX
237
+ O -->|HC-008: Arbitration| TL
238
+ HSOL[HSOL System] -->|HC-009: Skills| A
239
+ O -->|HC-010: Error escalation| U
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Evidence Sources
245
+
246
+ - `cli/install.js` — Installation timing characteristics, error exit codes
247
+ - `rules/CORE.md` — Orchestration Laws L4 (phase order), L6 (TIER 1 preference), L8 (immutability), L9 (no silent failure)
248
+ - `rules/AGENTS.md` — TIER 1/TIER 2 handoff protocol, sub-agent context scoping
249
+ - `rules/SKILLS.md` — HSOL timing (5s discovery cap), fitness band routing, trust progression timelines
250
+ - `rules/TEAMS.md` — Golden Triangle Mailbox protocol, message types, debate round limits
251
+ - `rules/ERRORS.md` — E1–E4 escalation path, user escalation terminal guarantee
252
+ - `rules/PHASES.md` — Exit criteria verification as handoff gate
253
+ - `CLAUDE.md` — Orchestrator behavioral constraints
@@ -0,0 +1,159 @@
1
+ # Knowledge Architecture
2
+
3
+ > **Purpose**: Architecture summary, table of contents, and cross-references for the Agent Assistant framework architecture
4
+ > **Last Updated**: 2026-03-26
5
+ > **Generated By**: docs-core skill
6
+
7
+ ---
8
+
9
+ ## Quick Summary
10
+
11
+ Agent Assistant is a **plugin-based orchestrator framework** where the AI model itself is the runtime. Rather than shipping executable code, the framework distributes Markdown and YAML instruction files that AI coding assistants read and follow as their operating protocol. The architecture centers on a single Orchestrator (defined in platform entry points) that delegates work to 21 specialist agents through 14 command routers, governed by 10 immutable orchestration laws and a Hybrid Skill Orchestration Layer (HSOL) that resolves and injects 1,430 skills across 19 domains.
12
+
13
+ The system deploys identically to 5 platforms (Cursor, GitHub Copilot, Claude Code, Codex, Antigravity/Gemini) through a CLI installer that performs `{TOOL}` placeholder substitution. At runtime, the AI reads CORE.md as its operating system, loads rules on demand, routes user commands to workflow variants, and executes phase-sequential pipelines where each phase delegates to a specialist agent via tiered execution (sub-agent isolation preferred, shared-context embodiment as fallback). For high-stakes work, the `:team` variant activates a Golden Triangle of 3 agents (Tech Lead + Executor + Reviewer) with adversarial debate capped at 3 rounds.
14
+
15
+ ```mermaid
16
+ graph TB
17
+ subgraph "Platform Layer"
18
+ CLAUDE["CLAUDE.md"]
19
+ COPILOT["COPILOT.md"]
20
+ CURSOR["CURSOR.md"]
21
+ CODEX["CODEX.md"]
22
+ GEMINI["GEMINI.md"]
23
+ end
24
+
25
+ subgraph "Orchestrator Core"
26
+ CORE["CORE.md<br/>Identity + 10 Laws"]
27
+ RULES["Rules Engine"]
28
+ end
29
+
30
+ subgraph "Command Layer"
31
+ ROUTER["14 Command Routers"]
32
+ VARIANTS["54 Workflow Variants<br/>(fast, hard, focus, team)"]
33
+ end
34
+
35
+ subgraph "Agent Layer"
36
+ AGENTS["21 Individual Agents"]
37
+ TEAMS["17 Teams × 3 Roles<br/>(Golden Triangle)"]
38
+ end
39
+
40
+ subgraph "Skill Layer"
41
+ MATRIX["Matrix Skills<br/>19 Domains · 1,430 Skills"]
42
+ DYNAMIC["Dynamic Skills<br/>Community Discovery"]
43
+ HSOL["HSOL Engine<br/>Fitness Scoring"]
44
+ end
45
+
46
+ subgraph "Distribution"
47
+ CLI["CLI Installer<br/>cli/install.js"]
48
+ PKG["npm Package<br/>@namch/agent-assistant"]
49
+ end
50
+
51
+ CLAUDE & COPILOT & CURSOR & CODEX & GEMINI --> CORE
52
+ CORE --> RULES
53
+ CORE --> ROUTER
54
+ ROUTER --> VARIANTS
55
+ VARIANTS --> AGENTS
56
+ VARIANTS --> TEAMS
57
+ AGENTS --> HSOL
58
+ HSOL --> MATRIX
59
+ HSOL --> DYNAMIC
60
+ PKG --> CLI
61
+ CLI -->|"{TOOL} replacement"| CLAUDE & COPILOT & CURSOR & CODEX & GEMINI
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Table of Contents
67
+
68
+ 1. [Quick Summary](#quick-summary)
69
+ 2. [Sub-Files](#sub-files)
70
+ 3. [Quick Facts](#quick-facts)
71
+ 4. [Cross-References](#cross-references)
72
+ 5. [Known Gaps and Open Questions](#known-gaps-and-open-questions)
73
+
74
+ ---
75
+
76
+ ## Sub-Files
77
+
78
+ | # | File | Description |
79
+ |---|------|-------------|
80
+ | 1 | [01-system-overview.md](./01-system-overview.md) | High-level architecture diagram, architecture style, layer boundaries, and key design decisions table |
81
+ | 2 | [02-components.md](./02-components.md) | Per-component breakdown — Orchestrator, Agents, Commands, Rules, Matrix Skills, Skills, CLI, Code Assistants, Web, Platform Entry Points |
82
+ | 3 | [03-data-flow.md](./03-data-flow.md) | Request lifecycle, CLI install flow, skill resolution flow, and Golden Triangle team flow — all with Mermaid diagrams |
83
+ | 4 | [04-design-patterns.md](./04-design-patterns.md) | 11 observed architectural patterns with descriptions, locations, rationale, and code references |
84
+ | 5 | [05-decisions.md](./05-decisions.md) | Architecture Decision Records (ADRs) — 7 key decisions with choices, alternatives, rationale, and trade-offs |
85
+
86
+ ---
87
+
88
+ ## Quick Facts
89
+
90
+ | Key | Value |
91
+ |-----|-------|
92
+ | Architecture Style | Plugin-based Orchestrator Framework |
93
+ | Runtime Model | AI model reads Markdown/YAML instructions (no traditional server) |
94
+ | Core Governance | 10 Orchestration Laws (CORE.md v4.1) |
95
+ | Platform Entry Points | 5 (CLAUDE.md, COPILOT.md, CURSOR.md, CODEX.md, GEMINI.md) |
96
+ | Rule Files | 7 (CORE, PHASES, AGENTS, SKILLS, TEAMS, ERRORS, REFERENCE) |
97
+ | Command Routers | 14 |
98
+ | Workflow Variants | 4 per command (fast, hard, focus, team) |
99
+ | Individual Agents | 21 across 5 categories (meta, execution, validation, research, support) |
100
+ | Team Configurations | 17 teams × 3 roles = 51 team agents |
101
+ | Skill Modules | 1,430 matrix + dynamic community skills |
102
+ | Skill Domains | 19 YAML domain files |
103
+ | Error Classes | 5 (E1, E1b, E2, E3, E4) |
104
+ | Execution Tiers | 2 (sub-agent isolation, shared-context embodiment) |
105
+ | Debate Rounds (Team) | Max 3, then Tech Lead arbitration |
106
+ | Production Dependencies | 0 |
107
+
108
+ ---
109
+
110
+ ## Cross-References
111
+
112
+ | Resource | Path | Relationship |
113
+ |----------|------|-------------|
114
+ | Knowledge Overview | [../knowledge-overview/00-index.md](../knowledge-overview/00-index.md) | Project-level overview, quick facts, and getting started |
115
+ | Knowledge Source Base | [../knowledge-source-base/00-index.md](../knowledge-source-base/00-index.md) | Directory structure, entry points, key modules, and configuration |
116
+ | HSOL Assessment | [../HSOL-ASSESSMENT.md](../HSOL-ASSESSMENT.md) | Detailed evaluation of the Hybrid Skill Orchestration Layer |
117
+ | SMART Skill Orchestration | [../SMART-SKILL-ORCHESTRATION-BLUEPRINT.md](../SMART-SKILL-ORCHESTRATION-BLUEPRINT.md) | Blueprint for skill orchestration design |
118
+ | Core Rules | [../../rules/CORE.md](../../rules/CORE.md) | Orchestrator protocol, 10 laws, tiered execution |
119
+ | Phase Rules | [../../rules/PHASES.md](../../rules/PHASES.md) | Phase output format, requirements registry |
120
+ | Agent Rules | [../../rules/AGENTS.md](../../rules/AGENTS.md) | Tiered execution protocol, agent categories |
121
+ | Skills Rules | [../../rules/SKILLS.md](../../rules/SKILLS.md) | HSOL resolution algorithm, fitness calculation |
122
+ | Teams Rules | [../../rules/TEAMS.md](../../rules/TEAMS.md) | Golden Triangle protocol, debate mechanism |
123
+ | Error Rules | [../../rules/ERRORS.md](../../rules/ERRORS.md) | Error classification and recovery protocols |
124
+ | Reference Rules | [../../rules/REFERENCE.md](../../rules/REFERENCE.md) | Command table, agent table, deliverable paths |
125
+ | Matrix Skills Index | [../../matrix-skills/_index.yaml](../../matrix-skills/_index.yaml) | HSOL configuration, domain registry |
126
+ | Package Manifest | [../../package.json](../../package.json) | npm metadata, scripts, platform install commands |
127
+ | CLI Installer | [../../cli/install.js](../../cli/install.js) | Platform installation logic and `{TOOL}` replacement |
128
+
129
+ ---
130
+
131
+ ## Known Gaps and Open Questions
132
+
133
+ | # | Gap | Impact | Notes |
134
+ |---|-----|--------|-------|
135
+ | 1 | No formal interface contracts between agents — handoff semantics are implied by Markdown conventions | Medium | Agent `handoffs` field in YAML frontmatter lists targets but does not define data schemas |
136
+ | 2 | HSOL fitness scoring is declarative (defined in SKILLS.md and _index.yaml) but has no executable implementation to verify | Medium | The AI model interprets the algorithm; no unit-testable code exists |
137
+ | 3 | Mailbox append-only guarantee relies on AI compliance, not filesystem enforcement | Low | TEAMS.md declares `C8-TEAMS-01` checkpoint but it is a behavioral contract |
138
+ | 4 | Dynamic skill trust progression (0.3 → 1.0) lacks persistent state across sessions | Medium | Promotion criteria defined in SKILLS.md but no storage mechanism is documented |
139
+ | 5 | Platform-specific behavior differences are not documented — the `{TOOL}` replacement is path-only, but AI model capabilities vary across platforms | Low | Sub-agent availability (TIER 1) is platform-dependent per AGENTS.md |
140
+ | 6 | Web application architecture (web/) is not covered in this folder — it is an independent sub-project | Low | Tracked separately from the core framework architecture |
141
+
142
+ ---
143
+
144
+ ## Evidence Sources
145
+
146
+ | Source | Path | What It Provides |
147
+ |--------|------|------------------|
148
+ | CORE.md | `rules/CORE.md` | Identity, paths, command routing, tiered execution, 10 laws, prohibitions |
149
+ | PHASES.md | `rules/PHASES.md` | Phase output format, requirements registry, Golden Triangle phase format |
150
+ | AGENTS.md | `rules/AGENTS.md` | Tiered execution protocol, tool discovery, agent categories, completion guarantee |
151
+ | SKILLS.md | `rules/SKILLS.md` | HSOL overview, resolution algorithm, fitness calculation, trust progression |
152
+ | TEAMS.md | `rules/TEAMS.md` | Golden Triangle roles, debate mechanism, mailbox communication, C8 checkpoints |
153
+ | ERRORS.md | `rules/ERRORS.md` | Error classification (E1–E4), recovery protocol, anti-patterns (A1–A10) |
154
+ | REFERENCE.md | `rules/REFERENCE.md` | Command table, agent table, natural language detection, deliverable paths |
155
+ | _index.yaml | `matrix-skills/_index.yaml` | HSOL configuration, domain registry, discovery settings |
156
+ | package.json | `package.json` | Version, scripts, dependencies, platforms, engine requirements |
157
+ | cli/install.js | `cli/install.js` | Platform configuration, path mappings, `{TOOL}` replacement tables |
158
+ | Agent files | `agents/*.md` | YAML frontmatter (profile, handoffs), cognitive anchor, skill injection |
159
+ | Command files | `commands/*.md` | Router directives, routing logic, variant tables |