@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
@@ -1,167 +1,483 @@
1
1
  ---
2
- description: 📊 Business Docs Generate 4 business documentation files
3
- version: "1.0"
2
+ description: "Business Docs - Generate 4 business folders with structured sub-files"
3
+ version: "2.0"
4
4
  category: documentation
5
5
  execution-mode: execute
6
6
  ---
7
7
 
8
- # /docs:business Business Documentation
8
+ # /docs:business - Business Documentation (Folder-Based)
9
9
 
10
- > **MISSION**: Generate **ALL 4** business documentation files.
10
+ > **MISSION**: Generate or update **ALL 4 business knowledge folders**, each with `00-index.md` + numbered sub-files. Output must be evidence-backed, traceable, and actionable for product, engineering, and delivery teams.
11
11
 
12
12
  <scope>$ARGUMENTS</scope>
13
13
 
14
14
  ---
15
15
 
16
- ## 🛑 PRE-FLIGHT (DO FIRST BLOCKS PHASE 1)
16
+ ## PRE-FLIGHT (DO FIRST - BLOCKS PHASE 1)
17
17
 
18
18
  **LOAD now** (in order; path `./rules/` or `~/.{TOOL}/skills/agent-assistant/rules/`):
19
19
 
20
- 1. CORE.md Identity, Laws, Routing
21
- 2. PHASES.md Phase Execution
22
- 3. AGENTS.md Tiered Execution
20
+ 1. CORE.md - Identity, Laws, Routing
21
+ 2. PHASES.md - Phase Execution
22
+ 3. AGENTS.md - Tiered Execution
23
23
 
24
- **⛔ Do not run Phase 1 until all are loaded.** Follow **all** rules in those files; they override any conflicting instructions in this file.
24
+ **Do not run Phase 1 until all are loaded.** Follow all rules in those files; they override any conflicting instructions in this file.
25
25
 
26
26
  ---
27
27
 
28
- ## 🔀 TIERED EXECUTION PROTOCOL (MANDATORY)
28
+ ## TIERED EXECUTION PROTOCOL (MANDATORY)
29
29
 
30
- > **Reference: AGENTS.md (Tiered Execution)`
30
+ > **Reference: AGENTS.md (Tiered Execution)**
31
31
 
32
32
  ```yaml
33
33
  tiered_execution:
34
34
  principle: "Sub-agent FIRST (Tier 1). EMBODY ONLY on system failure (Tier 2)."
35
35
  for_each_phase:
36
- TIER_1_MANDATORY: "IF tool exists MUST use SUB_AGENT_DELEGATION"
37
- TIER_2_FALLBACK: "ONLY on system errorNOT complexity/preference/speed"
36
+ TIER_1_MANDATORY: "IF tool exists -> MUST use SUB_AGENT_DELEGATION"
37
+ TIER_2_FALLBACK: "ONLY on system error - NOT complexity/preference/speed"
38
38
  anti_lazy_fallback:
39
- - NEVER use Tier 2 when Tier 1 tool is available
40
- - ALWAYS attempt Tier 1 first when tool exists
39
+ - NEVER use Tier 2 when Tier 1 tool is available
40
+ - ALWAYS attempt Tier 1 first when tool exists
41
41
  ```
42
42
 
43
43
  ---
44
44
 
45
- ## 📦 DELIVERABLES (REQUIRED ALL 4 FILES)
45
+ ## DELIVERABLES - FOLDER-BASED BUSINESS SYSTEM
46
46
 
47
47
  > [!CAUTION]
48
- > **MUST CREATE ALL 4 FILES**. Incomplete = FAILED execution.
48
+ > **MUST CREATE OR UPDATE ALL 4 FOLDERS** with `00-index.md` and sub-files. Incomplete = FAILED execution.
49
49
 
50
- > **⛔ DOCUMENT LANGUAGE NON-NEGOTIABLE**
51
- > Every file under `./documents/` must be written in **English only**. Do not use the user's language (e.g. Vietnamese) for file content. (CORE § LAW 6.)
50
+ > **DOCUMENT LANGUAGE - NON-NEGOTIABLE**
51
+ > Every file under `./documents/` must be written in **English only**. Do not use the user's language for file content. (CORE LAW 6.)
52
52
 
53
- | File | Purpose |
54
- | -------------------------------------------- | ----------------------------- |
55
- | `./documents/business/business-prd.md` | Product requirements document |
56
- | `./documents/business/business-features.md` | Feature specifications |
57
- | `./documents/business/business-workflows.md` | Business processes and flows |
58
- | `./documents/business/business-glossary.md` | Domain terms and definitions |
53
+ ### Folder Structure
54
+
55
+ ```
56
+ ./documents/business/
57
+ business-prd/
58
+ 00-index.md
59
+ 01-executive-summary.md
60
+ 02-problem-goals-and-scope.md
61
+ 03-stakeholders-and-requirements.md
62
+ 04-acceptance-risks-assumptions.md
63
+
64
+ business-features/
65
+ 00-index.md
66
+ 01-feature-inventory.md
67
+ 02-prioritization-moscow.md
68
+ 03-feature-specifications.md
69
+ 04-dependencies-and-release-sequencing.md
70
+ 05-success-metrics.md
71
+
72
+ business-workflows/
73
+ 00-index.md
74
+ 01-actor-map.md
75
+ 02-workflow-catalog.md
76
+ 03-detailed-workflows.md
77
+ 04-decision-rules-and-exceptions.md
78
+ 05-sla-and-handoffs.md
79
+
80
+ business-glossary/
81
+ 00-index.md
82
+ 01-canonical-terms.md
83
+ 02-synonyms-and-deprecated-terms.md
84
+ 03-domain-entities-and-events.md
85
+ 04-api-term-mapping.md
86
+ ```
87
+
88
+ **Minimum total**: 4 folders x (1 index + 4-5 sub-files) = **22 files minimum**.
89
+
90
+ ### `00-index.md` Pattern (MANDATORY)
91
+
92
+ Every business folder `00-index.md` MUST include:
93
+
94
+ 1. Quick summary (2-3 paragraphs)
95
+ 2. Sub-files table with descriptions
96
+ 3. Key facts for that area
97
+ 4. Cross-references to related business/core folders
98
+ 5. Known Gaps and Open Questions
99
+
100
+ ```markdown
101
+ # {Business Area}
102
+
103
+ > **Purpose**: {one-line purpose}
104
+ > **Sub-files**: {count}
105
+ > **Last Updated**: {YYYY-MM-DD}
106
+
107
+ ## Quick Summary
108
+ {2-3 paragraphs}
109
+
110
+ ## Sub-Files
111
+ | File | Description |
112
+ |------|-------------|
113
+ | [01-...](./01-...md) | ... |
114
+
115
+ ## Key Facts
116
+ | Key | Value |
117
+ |-----|-------|
118
+ | ... | ... |
119
+
120
+ ## Cross-References
121
+ - [knowledge-overview](../knowledge-overview/00-index.md)
122
+ - [knowledge-domain](../knowledge-domain/00-index.md)
123
+
124
+ ## Known Gaps and Open Questions
125
+ - ...
126
+ ```
59
127
 
60
128
  ---
61
129
 
62
- ## INCREMENTAL EXECUTION (MANDATORY)
130
+ ## INCREMENTAL EXECUTION (MANDATORY)
63
131
 
64
- One phase at a time, each phase independent: Phase 1 then Phase 2 in one reply. No batching (load only what each phase needs). **Within each phase:** when doing a part, output it in format so user sees what’s happening (announce before doing).
132
+ One phase at a time, each phase independent: Phase 1 -> Phase 2 -> Phase 3 -> Phase 4.
65
133
 
66
134
  ---
67
135
 
68
- ## 🎭 Phase 1: CODEBASE & REQUIREMENTS ANALYSIS
136
+ ## Phase 1: BUSINESS RECONNAISSANCE
69
137
 
70
- | Attribute | Value |
71
- | --------- | ------------------------------------ |
72
- | **Agent** | `scouter` |
73
- | **Goal** | Identify business logic and features |
138
+ | Attribute | Value |
139
+ |-----------|-------|
140
+ | **Agent** | `scouter` |
141
+ | **Goal** | Build evidence-backed business intelligence from codebase + existing docs |
74
142
 
75
- ### TIERED EXECUTION
143
+ ### TIERED EXECUTION
76
144
 
77
145
  **TIER 1 (MANDATORY when tool exists):**
78
-
79
146
  > Invoke runSubagent for `scouter`. Context: ISOLATED.
80
147
 
81
148
  **TIER 2 (FALLBACK on system error only):**
82
-
83
149
  > Load `{AGENTS_PATH}/scouter.md`
84
- > EMBODY [scouter] Requires logged system error justification.
150
+ > EMBODY [scouter] - Requires logged system error justification.
151
+
152
+ ### Required Work
153
+
154
+ 1. Detect current business docs state (folder-level mode per area):
155
+ - `./documents/business/business-prd/`
156
+ - `./documents/business/business-features/`
157
+ - `./documents/business/business-workflows/`
158
+ - `./documents/business/business-glossary/`
159
+
160
+ Mode rules:
161
+ - Folder exists with sub-files -> UPDATE
162
+ - Flat file exists (legacy `business-*.md`) -> MIGRATE
163
+ - Neither exists -> CREATE
164
+
165
+ 2. Scan business signals from repository:
166
+ - README/product docs/roadmap/changelog
167
+ - route and API surfaces for user-facing capabilities
168
+ - domain models/entities/events
169
+ - feature flags/config toggles
170
+
171
+ 3. Extract and catalog:
172
+ - stakeholders and actors
173
+ - business goals and constraints
174
+ - feature inventory and dependencies
175
+ - workflow candidates and state transitions
176
+ - domain terminology and synonyms
177
+
178
+ 4. Build Business Evidence Ledger with file-level references.
179
+
180
+ ### Mandatory Output
181
+
182
+ ```markdown
183
+ ## Business Intelligence Report
184
+
185
+ ### Execution Plan
186
+ | Business Area | Mode | Notes |
187
+ |---------------|------|-------|
188
+ | business-prd/ | CREATE/UPDATE/MIGRATE | {note} |
189
+ | business-features/ | CREATE/UPDATE/MIGRATE | {note} |
190
+ | business-workflows/ | CREATE/UPDATE/MIGRATE | {note} |
191
+ | business-glossary/ | CREATE/UPDATE/MIGRATE | {note} |
192
+
193
+ ### Stakeholder and Actor Map
194
+ | Actor | Goal | Touchpoints | Evidence |
195
+ |-------|------|-------------|----------|
196
+ | {actor} | {goal} | {workflow/api} | {path} |
197
+
198
+ ### Feature Inventory (Raw)
199
+ | Feature | User Value | Technical Surface | Dependencies | Evidence |
200
+ |---------|------------|-------------------|--------------|----------|
201
+ | {feature} | {value} | {files/apis} | {deps} | {path} |
202
+
203
+ ### Workflow Candidates
204
+ | Workflow | Trigger | Steps (summary) | Exceptions | Evidence |
205
+ |----------|---------|-----------------|------------|----------|
206
+ | {name} | {trigger} | {summary} | {exceptions} | {path} |
207
+
208
+ ### Domain Terms (Raw)
209
+ | Term | Candidate Definition | Synonyms | Source |
210
+ |------|----------------------|----------|--------|
211
+ | {term} | {definition} | {synonyms} | {path} |
212
+
213
+ ### Business Evidence Ledger
214
+ | Claim Area | Evidence Files | Confidence |
215
+ |------------|----------------|------------|
216
+ | Stakeholders | {paths} | High/Medium/Low |
217
+ | Features | {paths} | High/Medium/Low |
218
+ | Workflows | {paths} | High/Medium/Low |
219
+ | Domain Terms | {paths} | High/Medium/Low |
220
+ ```
221
+
222
+ ### Anti-Shallow Guardrails
223
+
224
+ - NEVER generate content from README alone - must verify with direct file reads
225
+ - Each business area must have at least 2 evidence files in the ledger
226
+ - If evidence is weak (Low confidence), explicitly state it - do NOT guess
227
+ - Unknowns go to `Known Gaps and Open Questions`, not speculative claims
85
228
 
86
- **Exit Criteria:**
229
+ ### Exit Criteria
87
230
 
88
- - [ ] Business logic identified
89
- - [ ] Features cataloged
90
- - [ ] Domain terms noted
231
+ - [ ] CREATE/UPDATE/MIGRATE mode detected per business area
232
+ - [ ] Stakeholders and actors mapped with evidence
233
+ - [ ] Feature inventory extracted with dependencies
234
+ - [ ] Workflow candidates identified
235
+ - [ ] Domain terms extracted
236
+ - [ ] Business Evidence Ledger complete
91
237
 
92
238
  ---
93
239
 
94
- ## 🎭 Phase 2: BUSINESS ANALYSIS
240
+ ## Phase 2: BUSINESS STRUCTURING AND PRIORITIZATION
95
241
 
96
- | Attribute | Value |
97
- | --------- | ------------------------ |
98
- | **Agent** | `business-analyst` |
99
- | **Goal** | Analyze business context |
242
+ | Attribute | Value |
243
+ |-----------|-------|
244
+ | **Agent** | `business-analyst` |
245
+ | **Goal** | Convert raw intelligence into structured, testable business artifacts |
246
+ | **Skill** | Load `skills/business-analyst/SKILL.md` |
100
247
 
101
- ### TIERED EXECUTION
248
+ ### TIERED EXECUTION
102
249
 
103
250
  **TIER 1 (MANDATORY when tool exists):**
104
-
105
251
  > Invoke runSubagent for `business-analyst`. Context: ISOLATED.
106
252
 
107
253
  **TIER 2 (FALLBACK on system error only):**
108
-
109
254
  > Load `{AGENTS_PATH}/business-analyst.md`
110
- > EMBODY [business-analyst] Requires logged system error justification.
255
+ > EMBODY [business-analyst] - Requires logged system error justification.
256
+
257
+ ### Required Work
258
+
259
+ 1. Apply INVEST quality to requirements.
260
+ 2. Apply MoSCoW prioritization to features.
261
+ 3. Canonicalize workflows.
262
+ 4. Resolve glossary conflicts (canonical term + aliases + deprecated terms).
263
+ 5. Build traceability matrix:
264
+ - Business Goal -> Requirement -> Feature -> Workflow -> KPI
265
+
266
+ ### Mandatory Output
267
+
268
+ ```markdown
269
+ ## Structured Business Pack
270
+
271
+ ### Goals and Scope
272
+ | Goal ID | Goal | KPI | Priority |
273
+ |---------|------|-----|----------|
274
+ | BG-001 | {goal} | {metric} | Must/Should/Could |
275
+
276
+ ### Requirements (INVEST)
277
+ | Req ID | Requirement | Value | INVEST Score | Acceptance Criteria |
278
+ |--------|-------------|-------|--------------|---------------------|
279
+ | BR-001 | {text} | {value} | {score} | {testable criteria} |
280
+
281
+ ### Features (MoSCoW)
282
+ | Feature ID | Feature | Priority | Dependencies | Success Metric |
283
+ |------------|---------|----------|--------------|----------------|
284
+ | BF-001 | {feature} | Must | {deps} | {metric} |
285
+
286
+ ### Workflows (Canonical)
287
+ | Workflow ID | Actor | Trigger | Outcome | Exception Handling |
288
+ |-------------|-------|---------|---------|--------------------|
289
+ | BW-001 | {actor} | {trigger} | {outcome} | {rule} |
290
+
291
+ ### Glossary Canonicalization
292
+ | Canonical Term | Definition | Aliases | Deprecated Terms |
293
+ |----------------|------------|---------|------------------|
294
+ | {term} | {definition} | {aliases} | {deprecated} |
295
+
296
+ ### Traceability Matrix
297
+ | Goal | Requirement | Feature | Workflow | KPI |
298
+ |------|-------------|---------|----------|-----|
299
+ | BG-001 | BR-001 | BF-001 | BW-001 | {metric} |
300
+ ```
111
301
 
112
- **Exit Criteria:**
302
+ ### Exit Criteria
113
303
 
114
- - [ ] Business goals understood
115
- - [ ] Stakeholders identified
116
- - [ ] Workflows mapped
304
+ - [ ] Requirements are testable and value-linked
305
+ - [ ] Features prioritized with rationale
306
+ - [ ] Workflows canonicalized
307
+ - [ ] Glossary conflicts resolved
308
+ - [ ] Traceability matrix complete
117
309
 
118
310
  ---
119
311
 
120
- ## 🎭 Phase 3: GENERATE ALL 4 DOCUMENTS
312
+ ## Phase 3: GENERATE BUSINESS FOLDERS
121
313
 
122
- | Attribute | Value |
123
- | --------- | ------------------------------------------------------------------------------------------------- |
124
- | **Agent** | `docs-manager` |
125
- | **Goal** | Create all 4 business documentation files in **English only** (no user-language content in files) |
314
+ | Attribute | Value |
315
+ |-----------|-------|
316
+ | **Agent** | `docs-manager` |
317
+ | **Goal** | Generate or update all 4 business folders in English only |
126
318
 
127
- ### TIERED EXECUTION
319
+ ### TIERED EXECUTION
128
320
 
129
321
  **TIER 1 (MANDATORY when tool exists):**
130
-
131
322
  > Invoke runSubagent for `docs-manager`. Context: ISOLATED.
132
323
 
133
324
  **TIER 2 (FALLBACK on system error only):**
134
-
135
325
  > Load `{AGENTS_PATH}/docs-manager.md`
136
- > EMBODY [docs-manager] Requires logged system error justification.
326
+ > EMBODY [docs-manager] - Requires logged system error justification.
327
+
328
+ ### Thinking Protocol (MANDATORY - Run BEFORE Writing Each Sub-File)
329
+
330
+ For each sub-file, THINK before writing:
331
+
332
+ 1. What evidence from Phase 1/2 supports this file's content?
333
+ 2. Is every claim backed by an actual file read or the Business Evidence Ledger?
334
+ 3. Am I writing REAL project data or just paraphrasing the template?
335
+ 4. Would a business stakeholder find this SUFFICIENT for decision-making?
336
+ 5. Is anything speculative? Remove it or mark: "Assumption - needs verification"
337
+
338
+ ### Writing Protocol (MANDATORY)
339
+
340
+ For each business folder:
341
+
342
+ 1. If UPDATE mode:
343
+ - read all existing sub-files fully
344
+ - preserve accurate sections
345
+ - append missing and revise stale sections
346
+ - add update footer: `> Last updated: {date} - {summary}` to touched files
347
+ 2. If CREATE mode:
348
+ - create folder
349
+ - write `00-index.md` first
350
+ - write `01-...`, `02-...` sub-files sequentially
351
+ 3. If MIGRATE mode (legacy flat file exists):
352
+ - read existing flat file fully - preserve all valid content
353
+ - create folder with `00-index.md` + sub-files
354
+ - distribute content into appropriate sub-files
355
+ - add migration note: `> Migrated from flat file: {date}`
356
+ - delete or archive legacy flat file after migration
357
+ 4. Include `## Evidence Sources` in every sub-file
358
+ 5. Include `## Known Gaps and Open Questions` in every `00-index.md`
359
+ 6. No placeholders: `TODO`, `TBD`, `{placeholder}`, `fill in later`
360
+
361
+ ### Per-Folder Content Requirements
362
+
363
+ #### `business-prd/`
364
+ - `00-index.md`: summary, TOC, key facts, cross-refs
365
+ - `01-executive-summary.md`: mission, value proposition, target outcomes
366
+ - `02-problem-goals-and-scope.md`: problem statement, goals, non-goals, in-scope/out-of-scope
367
+ - `03-stakeholders-and-requirements.md`: stakeholder map, functional/non-functional requirements, traceability
368
+ - `04-acceptance-risks-assumptions.md`: acceptance criteria, risks, assumptions, open questions
369
+
370
+ #### `business-features/`
371
+ - `00-index.md`: summary, TOC, key facts, cross-refs
372
+ - `01-feature-inventory.md`: complete feature list and business value
373
+ - `02-prioritization-moscow.md`: MoSCoW prioritization with rationale
374
+ - `03-feature-specifications.md`: feature-level spec details and acceptance checks
375
+ - `04-dependencies-and-release-sequencing.md`: dependencies, rollout order, sequencing constraints
376
+ - `05-success-metrics.md`: KPIs, baselines, targets, measurement approach
377
+
378
+ #### `business-workflows/`
379
+ - `00-index.md`: summary, TOC, key facts, cross-refs
380
+ - `01-actor-map.md`: actor definitions, responsibilities, boundaries
381
+ - `02-workflow-catalog.md`: workflow inventory with trigger/outcome
382
+ - `03-detailed-workflows.md`: step-by-step flows with decision points
383
+ - `04-decision-rules-and-exceptions.md`: business rules, exceptions, fallback paths
384
+ - `05-sla-and-handoffs.md`: timing expectations, handoff contracts, SLA/SLO context
385
+
386
+ #### `business-glossary/`
387
+ - `00-index.md`: summary, TOC, key facts, cross-refs
388
+ - `01-canonical-terms.md`: approved canonical terms and definitions
389
+ - `02-synonyms-and-deprecated-terms.md`: aliases, deprecated terms, replacement guidance
390
+ - `03-domain-entities-and-events.md`: entity/event vocabulary and meaning boundaries
391
+ - `04-api-term-mapping.md`: mapping between domain terms and API fields/endpoints
392
+
393
+ ### Exit Criteria
394
+
395
+ - [ ] `business-prd/` complete (`00-index.md` + 4 sub-files)
396
+ - [ ] `business-features/` complete (`00-index.md` + 5 sub-files)
397
+ - [ ] `business-workflows/` complete (`00-index.md` + 5 sub-files)
398
+ - [ ] `business-glossary/` complete (`00-index.md` + 4 sub-files)
399
+ - [ ] Each sub-file includes Evidence Sources
400
+ - [ ] No placeholders remain
137
401
 
138
- **Exit Criteria:**
402
+ ---
139
403
 
140
- - [ ] `business-prd.md` created
141
- - [ ] `business-features.md` created
142
- - [ ] `business-workflows.md` created
143
- - [ ] `business-glossary.md` created
404
+ ## Phase 4: QUALITY AND CONSISTENCY REVIEW
405
+
406
+ | Attribute | Value |
407
+ |-----------|-------|
408
+ | **Agent** | `project-manager` |
409
+ | **Goal** | Validate cross-folder consistency, delivery readiness, and completeness |
410
+
411
+ ### TIERED EXECUTION
412
+
413
+ **TIER 1 (MANDATORY when tool exists):**
414
+ > Invoke runSubagent for `project-manager`. Context: ISOLATED.
415
+
416
+ **TIER 2 (FALLBACK on system error only):**
417
+ > Load `{AGENTS_PATH}/project-manager.md`
418
+ > EMBODY [project-manager] - Requires logged system error justification.
419
+
420
+ ### Consistency Matrix (MANDATORY)
421
+
422
+ ```markdown
423
+ ## Business Docs Consistency Matrix
424
+ | Check | PRD | Features | Workflows | Glossary | Status |
425
+ |------|-----|----------|-----------|----------|--------|
426
+ | Scope consistent | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
427
+ | Terms consistent | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
428
+ | IDs traceable (BG/BR/BF/BW) | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
429
+ | Metrics defined | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
430
+ | No contradictions | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
431
+ ```
432
+
433
+ ### Exit Criteria
434
+
435
+ - [ ] Cross-folder consistency verified
436
+ - [ ] Contradictions resolved
437
+ - [ ] Traceability intact
438
+ - [ ] Delivery readiness confirmed
144
439
 
145
440
  ---
146
441
 
147
- ## VERIFICATION
442
+ ## VERIFICATION
443
+
444
+ Before completion, verify folder existence and quality:
148
445
 
149
- Before completion, verify ALL 4 files exist:
446
+ ### Folder Existence
150
447
 
151
448
  ```
152
449
  ./documents/business/
153
- ├── business-prd.md
154
- ├── business-features.md
155
- ├── business-workflows.md
156
- └── business-glossary.md
450
+ [ ] business-prd/ (00-index.md + 01~04)
451
+ [ ] business-features/ (00-index.md + 01~05)
452
+ [ ] business-workflows/ (00-index.md + 01~05)
453
+ [ ] business-glossary/ (00-index.md + 01~04)
157
454
  ```
158
455
 
456
+ ### Quality Gates
457
+
458
+ For every business folder and sub-file:
459
+
460
+ - [ ] English only
461
+ - [ ] Required sections present
462
+ - [ ] Evidence Sources section present with actual paths
463
+ - [ ] `00-index.md` contains Known Gaps and Open Questions
464
+ - [ ] No placeholder text
465
+ - [ ] Business value explicit and measurable where applicable
466
+ - [ ] TOC links in every `00-index.md` match actual sub-files
467
+
468
+ ### Cross-Folder Gates
469
+
470
+ - [ ] IDs consistent (BG/BR/BF/BW)
471
+ - [ ] Same term has one canonical meaning across folders
472
+ - [ ] Feature priorities align with PRD scope
473
+ - [ ] Workflows reflect features and requirements accurately
474
+
159
475
  ---
160
476
 
161
477
  ## COMPLETION
162
478
 
163
479
  Report status:
164
480
 
165
- 1. **Complete** All 4 business docs created
166
- 2. **Incomplete** List missing files
167
- 3. 📝 **Continue** `/docs:audit` for audit docs
481
+ 1. **Complete** - All 4 business folders created/updated and consistency-validated
482
+ 2. **Incomplete** - List missing folders/sub-files, failed quality gates, and blockers
483
+ 3. **Continue** -> `/docs:audit` for audit documentation