bmad-module-skill-forge 0.5.0 → 0.7.0

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 (149) hide show
  1. package/README.md +4 -3
  2. package/docs/agents.md +12 -5
  3. package/docs/concepts.md +37 -15
  4. package/docs/examples.md +49 -5
  5. package/docs/getting-started.md +43 -17
  6. package/docs/how-it-works.md +115 -90
  7. package/docs/index.md +2 -2
  8. package/docs/workflows.md +89 -41
  9. package/package.json +2 -2
  10. package/src/agents/forger.agent.yaml +18 -6
  11. package/src/forger/README.md +1 -1
  12. package/src/forger/forge-tier.yaml +18 -1
  13. package/src/forger/preferences.yaml +6 -8
  14. package/src/knowledge/agentskills-spec.md +1 -1
  15. package/src/knowledge/architecture-verification.md +102 -0
  16. package/src/knowledge/ccc-bridge.md +110 -0
  17. package/src/knowledge/confidence-tiers.md +14 -3
  18. package/src/knowledge/doc-fetcher.md +1 -1
  19. package/src/knowledge/manual-section-integrity.md +2 -2
  20. package/src/knowledge/overview.md +10 -6
  21. package/src/knowledge/progressive-capability.md +15 -6
  22. package/src/knowledge/qmd-registry.md +18 -1
  23. package/src/knowledge/skf-knowledge-index.csv +3 -1
  24. package/src/knowledge/skill-lifecycle.md +26 -2
  25. package/src/knowledge/split-body-strategy.md +16 -2
  26. package/src/knowledge/zero-hallucination.md +11 -8
  27. package/src/module-help.csv +9 -6
  28. package/src/module.yaml +4 -1
  29. package/src/workflows/README.md +36 -18
  30. package/src/workflows/analyze-source/data/skill-brief-schema.md +18 -5
  31. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +1 -0
  32. package/src/workflows/analyze-source/steps-c/step-01-init.md +4 -4
  33. package/src/workflows/analyze-source/steps-c/step-01b-continue.md +1 -1
  34. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +1 -1
  35. package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +1 -1
  36. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +8 -4
  37. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +1 -1
  38. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +2 -2
  39. package/src/workflows/analyze-source/workflow.md +2 -2
  40. package/src/workflows/audit-skill/data/drift-report-template.md +6 -6
  41. package/src/workflows/audit-skill/data/severity-rules.md +1 -1
  42. package/src/workflows/audit-skill/steps-c/step-01-init.md +3 -2
  43. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +23 -1
  44. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +6 -6
  45. package/src/workflows/audit-skill/workflow.md +3 -2
  46. package/src/workflows/brief-skill/data/scope-templates.md +10 -0
  47. package/src/workflows/brief-skill/data/skill-brief-schema.md +25 -23
  48. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +4 -4
  49. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +15 -0
  50. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +3 -0
  51. package/src/workflows/create-skill/data/extraction-patterns.md +37 -1
  52. package/src/workflows/create-skill/data/skill-sections.md +14 -13
  53. package/src/workflows/create-skill/data/source-resolution-protocols.md +1 -1
  54. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +18 -12
  55. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +2 -2
  56. package/src/workflows/create-skill/steps-c/step-02b-ccc-discover.md +157 -0
  57. package/src/workflows/create-skill/steps-c/step-03-extract.md +25 -20
  58. package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +8 -8
  59. package/src/workflows/create-skill/steps-c/step-03c-fetch-docs.md +3 -1
  60. package/src/workflows/create-skill/steps-c/step-04-enrich.md +9 -9
  61. package/src/workflows/create-skill/steps-c/step-05-compile.md +4 -3
  62. package/src/workflows/create-skill/steps-c/step-06-validate.md +3 -3
  63. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +60 -39
  64. package/src/workflows/create-skill/steps-c/step-08-report.md +26 -11
  65. package/src/workflows/create-skill/workflow.md +3 -3
  66. package/src/workflows/create-stack-skill/data/compose-mode-rules.md +65 -0
  67. package/src/workflows/create-stack-skill/data/stack-skill-template.md +29 -7
  68. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +25 -8
  69. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +35 -2
  70. package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +26 -2
  71. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +24 -0
  72. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +40 -2
  73. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +5 -1
  74. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +53 -5
  75. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +4 -4
  76. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +8 -2
  77. package/src/workflows/create-stack-skill/workflow.md +3 -3
  78. package/src/workflows/export-skill/data/managed-section-format.md +8 -1
  79. package/src/workflows/export-skill/data/snippet-format.md +1 -1
  80. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +1 -1
  81. package/src/workflows/export-skill/steps-c/step-02-package.md +1 -1
  82. package/src/workflows/export-skill/steps-c/step-04-update-context.md +7 -2
  83. package/src/workflows/export-skill/steps-c/step-05-token-report.md +1 -1
  84. package/src/workflows/export-skill/workflow.md +3 -1
  85. package/src/workflows/quick-skill/data/skill-template.md +24 -4
  86. package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +1 -3
  87. package/src/workflows/quick-skill/steps-c/step-04-compile.md +26 -6
  88. package/src/workflows/quick-skill/steps-c/step-05-validate.md +1 -1
  89. package/src/workflows/quick-skill/steps-c/step-06-write.md +3 -0
  90. package/src/workflows/quick-skill/workflow.md +1 -1
  91. package/src/workflows/refine-architecture/data/refinement-rules.md +102 -0
  92. package/src/workflows/refine-architecture/steps-c/step-01-init.md +188 -0
  93. package/src/workflows/refine-architecture/steps-c/step-02-gap-analysis.md +179 -0
  94. package/src/workflows/refine-architecture/steps-c/step-03-issue-detection.md +182 -0
  95. package/src/workflows/refine-architecture/steps-c/step-04-improvements.md +169 -0
  96. package/src/workflows/refine-architecture/steps-c/step-05-compile.md +200 -0
  97. package/src/workflows/refine-architecture/steps-c/step-06-report.md +147 -0
  98. package/src/workflows/refine-architecture/workflow.md +61 -0
  99. package/src/workflows/setup-forge/data/tier-rules.md +16 -6
  100. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +33 -15
  101. package/src/workflows/setup-forge/steps-c/step-01b-ccc-index.md +148 -0
  102. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +29 -12
  103. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +29 -6
  104. package/src/workflows/setup-forge/steps-c/step-04-report.md +16 -4
  105. package/src/workflows/setup-forge/workflow.md +4 -3
  106. package/src/workflows/test-skill/data/scoring-rules.md +8 -0
  107. package/src/workflows/test-skill/data/source-access-protocol.md +1 -1
  108. package/src/workflows/test-skill/steps-c/step-01-init.md +3 -2
  109. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +2 -0
  110. package/src/workflows/test-skill/templates/test-report-template.md +3 -0
  111. package/src/workflows/test-skill/workflow.md +2 -2
  112. package/src/workflows/update-skill/steps-c/step-01-init.md +3 -2
  113. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +2 -2
  114. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +24 -4
  115. package/src/workflows/update-skill/steps-c/step-05-validate.md +7 -11
  116. package/src/workflows/update-skill/steps-c/step-06-write.md +7 -4
  117. package/src/workflows/update-skill/workflow.md +1 -1
  118. package/src/workflows/verify-stack/data/coverage-patterns.md +45 -0
  119. package/src/workflows/verify-stack/data/feasibility-report-template.md +63 -0
  120. package/src/workflows/verify-stack/data/integration-verification-rules.md +73 -0
  121. package/src/workflows/verify-stack/steps-c/step-01-init.md +174 -0
  122. package/src/workflows/verify-stack/steps-c/step-02-coverage.md +181 -0
  123. package/src/workflows/verify-stack/steps-c/step-03-integrations.md +195 -0
  124. package/src/workflows/verify-stack/steps-c/step-04-requirements.md +168 -0
  125. package/src/workflows/verify-stack/steps-c/step-05-synthesize.md +191 -0
  126. package/src/workflows/verify-stack/steps-c/step-06-report.md +197 -0
  127. package/src/workflows/verify-stack/workflow.md +61 -0
  128. package/tools/cli/commands/status.js +2 -1
  129. package/src/workflows/analyze-source/validation-report.md +0 -657
  130. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +0 -385
  131. package/src/workflows/audit-skill/validation-report.md +0 -545
  132. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +0 -318
  133. package/src/workflows/brief-skill/validation-report.md +0 -630
  134. package/src/workflows/brief-skill/workflow-plan-brief-skill.md +0 -360
  135. package/src/workflows/create-skill/validation-report.md +0 -189
  136. package/src/workflows/create-skill/workflow-plan-create-skill.md +0 -523
  137. package/src/workflows/create-stack-skill/validation-report.md +0 -401
  138. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +0 -481
  139. package/src/workflows/export-skill/validation-report.md +0 -263
  140. package/src/workflows/export-skill/workflow-plan-export-skill.md +0 -369
  141. package/src/workflows/quick-skill/validation-report.md +0 -543
  142. package/src/workflows/quick-skill/workflow-plan-quick-skill.md +0 -405
  143. package/src/workflows/setup-forge/validation-report.md +0 -504
  144. package/src/workflows/setup-forge/workflow-plan-setup-forge.md +0 -428
  145. package/src/workflows/test-skill/validation-report.md +0 -390
  146. package/src/workflows/test-skill/workflow-plan-test-skill.md +0 -292
  147. package/src/workflows/update-skill/data/tier-degradation-rules.md +0 -46
  148. package/src/workflows/update-skill/validation-report.md +0 -559
  149. package/src/workflows/update-skill/workflow-plan-update-skill.md +0 -441
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: 'step-05-compile'
3
+ description: 'Produce the refined architecture document by annotating the original with gaps, issues, and improvements'
4
+
5
+ nextStepFile: './step-06-report.md'
6
+ outputFile: '{output_folder}/refined-architecture-{project_name}.md'
7
+ ---
8
+
9
+ # Step 5: Compile Refined Architecture
10
+
11
+ ## STEP GOAL:
12
+
13
+ Produce the refined architecture document by starting with the original as a base, adding gap-fill subsections, issue callout blocks, and improvement suggestions. Append a Refinement Summary. Present for user review before finalizing.
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - 📖 CRITICAL: Read the complete step file before taking any action
20
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
21
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
22
+
23
+ ### Role Reinforcement:
24
+
25
+ - ✅ You are an architecture refinement analyst compiling the final refined document
26
+ - ✅ Additive, not destructive — preserve every word of the original, only add refinements
27
+ - ✅ The document must be in `{document_output_language}`
28
+
29
+ ### Step-Specific Rules:
30
+
31
+ - 🚫 FORBIDDEN to discover new gaps, issues, or improvements — use only what Steps 02-04 produced
32
+ - 🚫 FORBIDDEN to delete, reword, or rearrange original architecture content
33
+ - 💬 Present compiled document for user review (Gate checkpoint)
34
+
35
+ ## EXECUTION PROTOCOLS:
36
+
37
+ - Compile refined architecture from original + findings from Steps 02-04
38
+ - Write output to {outputFile}, wait for user approval before proceeding
39
+
40
+ ## CONTEXT BOUNDARIES:
41
+
42
+ - From Steps 01-04: Architecture document, skill inventory, gap/issue/improvement findings
43
+ - This step produces: The refined architecture document at {outputFile}
44
+
45
+ ## MANDATORY SEQUENCE
46
+
47
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
48
+
49
+ ### 1. Prepare the Original as Base
50
+
51
+ Load the complete original architecture document.
52
+
53
+ This is the base. Every line of the original MUST appear in the refined document, unmodified.
54
+
55
+ **Context recovery check:** If gap, issue, or improvement findings from Steps 02-04 are not available in context (e.g., due to context degradation in long runs), attempt to read the durability state from `{forge_data_folder}/ra-state-{project_name}.md`. Parse the `<!-- [RA-GAPS] -->`, `<!-- [RA-ISSUES] -->`, and `<!-- [RA-IMPROVEMENTS] -->` comment blocks to recover the complete formatted findings (each block contains full citation text with evidence, not just counts). If a section is still missing or contains only summary counts after recovery, HALT: "⚠️ Context for the [Gaps|Issues|Improvements] analysis was lost and the durability state is insufficient to reconstruct findings. Re-run [RA] from the beginning — step 01 will reset the state file, then steps 02-04 will rebuild all findings."
56
+
57
+ ### 2. Insert Gap-Fill Subsections
58
+
59
+ For each gap finding from Step 02:
60
+
61
+ **Locate the most relevant section** in the original architecture where this integration would logically belong.
62
+
63
+ **Insert a gap-fill subsection** one heading level deeper than the parent section:
64
+
65
+ ```markdown
66
+ #### RA: {Library A} <-> {Library B} Integration Path
67
+
68
+ > [!NOTE] **Gap Identified by Refine Architecture**
69
+ > This integration path was not documented in the original architecture but is supported by skill API evidence.
70
+
71
+ {Gap description with full evidence citation from Step 02}
72
+
73
+ **Proposed Integration:**
74
+ {Suggested architecture content describing how the libraries connect}
75
+ ```
76
+
77
+ If no clear parent section exists, collect orphan gaps into a new section: "## RA: Additional Integration Paths"
78
+
79
+ ### 3. Insert Issue Annotations
80
+
81
+ For each issue finding from Step 03:
82
+
83
+ **Locate the section** containing the contradicted claim.
84
+
85
+ **Insert an issue callout block** immediately after the contradicted text:
86
+
87
+ ```markdown
88
+ > [!WARNING] **Issue Detected by Refine Architecture** ({severity})
89
+ > Architecture states: "{quoted claim}"
90
+ > Skill reality: {contradicting evidence from skill}
91
+ > {IF VS report}: VS verdict: {verdict} for {pair}
92
+ >
93
+ > **Suggested Correction:** {specific correction with API evidence}
94
+ ```
95
+
96
+ **Placement priority:** Place each issue callout immediately after the contradicted text in its original location. If the contradicted claim is inside a Markdown list item, code block, or table row where inserting a callout block would break syntax, place the callout immediately after the enclosing block instead. If the contradicted claim cannot be precisely located, collect into "## RA: Additional Issues Detected" at the end of the document, ordered by severity (Critical first, then Major, then Minor).
97
+
98
+ ### 4. Insert Improvement Suggestions
99
+
100
+ For each improvement finding from Step 04:
101
+
102
+ **Locate the section** where the library is discussed.
103
+
104
+ **Insert an improvement subsection** one heading level deeper:
105
+
106
+ ```markdown
107
+ #### RA: Enhancement — {Improvement Title}
108
+
109
+ > [!TIP] **Improvement Suggested by Refine Architecture** ({value} value)
110
+ > {skill_name} provides `{api}` which is not currently leveraged.
111
+
112
+ {Full improvement description with evidence citation from Step 04}
113
+
114
+ **How to Incorporate:**
115
+ {Specific suggestion for updating the architecture}
116
+ ```
117
+
118
+ **Order by value:** High value improvements first, then Medium, then Low.
119
+
120
+ **Placement fallback:** If the library's only architecture mention is inside a table, code block, or Mermaid diagram where inserting a subsection would break syntax, collect into `## RA: Additional Improvements Suggested` at the end of the document.
121
+
122
+ ### 5. Add Refinement Summary Section
123
+
124
+ Append a `## Refinement Summary` section containing:
125
+
126
+ - **Header:** "Produced by: Refine Architecture workflow using {skill_count} skills" and date
127
+ - **Changes Made table** with the following rows:
128
+
129
+ | Category | Count | Breakdown |
130
+ |----------|-------|-----------|
131
+ | Gaps Filled | {gap_count} | — |
132
+ | Issues Flagged | {issue_count} | Critical: {critical_count}, Major: {major_count}, Minor: {minor_count} |
133
+ | Improvements Suggested | {improvement_count} | High: {high_count}, Medium: {medium_count}, Low: {low_count} |
134
+ | Skills Used as Evidence | {skill_count} | — |
135
+ - **Evidence Sources table:** Each skill name and how many refinements cite it
136
+ - **Next Steps:** Review `[!WARNING]` issues, `[!NOTE]` gaps, `[!TIP]` improvements; then run **[SS] Stack Skill** to compose your individual skills into a unified stack skill, providing this refined architecture doc when prompted
137
+
138
+ ### 6. Write the Refined Document
139
+
140
+ Write the complete refined architecture to `{outputFile}`.
141
+
142
+ ### 7. Present Compiled Document for Review
143
+
144
+ "**Refined architecture compiled. Please review:**
145
+
146
+ ---
147
+
148
+ {Display the Refinement Summary section only — not the full document}
149
+
150
+ ---
151
+
152
+ **The full refined document has been written to:** `{outputFile}`
153
+
154
+ Please review the refinements:
155
+ - {gap_count} gap-fill subsections added
156
+ - {issue_count} issue annotations inserted
157
+ - {improvement_count} improvement suggestions included
158
+ - Original architecture content preserved in full
159
+
160
+ **Does the refinement look correct?**"
161
+
162
+ ### 8. Present MENU OPTIONS
163
+
164
+ Display: **Select:** [C] Continue to Final Report
165
+
166
+ #### EXECUTION RULES:
167
+
168
+ - ALWAYS halt and wait for user input after presenting compilation
169
+ - ONLY proceed to next step when user approves and selects 'C'
170
+
171
+ #### Menu Handling Logic:
172
+
173
+ - IF C: Load, read entire file, then execute {nextStepFile}
174
+ - IF Any other: Process as feedback, adjust specific refinements in the document, rewrite {outputFile}, redisplay preview, then [Redisplay Menu Options](#8-present-menu-options)
175
+
176
+ ---
177
+
178
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
179
+
180
+ ### ✅ SUCCESS:
181
+
182
+ - Original architecture document preserved in full without modifications
183
+ - Gap-fill subsections inserted at logical locations with evidence citations
184
+ - Issue callout blocks inserted adjacent to contradicted claims with severity
185
+ - Improvement suggestions inserted with value ratings and evidence
186
+ - Refinement Summary section appended with accurate counts
187
+ - Refined document written to {outputFile}
188
+ - User reviewed and approved compilation
189
+ - Proceeded to step 06 only after user selected C
190
+
191
+ ### ❌ SYSTEM FAILURE:
192
+
193
+ - Deleting, rewording, or rearranging original architecture content
194
+ - Discovering new findings not from Steps 02-04
195
+ - Inserting refinements without evidence citations
196
+ - Proceeding without user review (Gate checkpoint)
197
+ - Not writing the document to {outputFile} before presenting for review
198
+ - Hardcoded paths instead of frontmatter variables
199
+
200
+ **Master Rule:** Additive only. Preserve the original. Get user approval before proceeding.
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: 'step-06-report'
3
+ description: 'Present refinement summary to user with counts, next steps, and review options'
4
+
5
+ outputFile: '{output_folder}/refined-architecture-{project_name}.md'
6
+ ---
7
+
8
+ # Step 6: Present Report
9
+
10
+ ## STEP GOAL:
11
+
12
+ Present the complete refinement summary to the user. Display counts of gaps filled, issues flagged, and improvements suggested. Provide the output file path and recommend next steps. Offer the user options to review changes in detail or exit. This is the FINAL step — no nextStepFile.
13
+
14
+ ## MANDATORY EXECUTION RULES (READ FIRST):
15
+
16
+ ### Universal Rules:
17
+
18
+ - 📖 CRITICAL: Read the complete step file before taking any action
19
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
20
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
21
+
22
+ ### Role Reinforcement:
23
+
24
+ - ✅ You are an architecture refinement analyst delivering the final summary
25
+ - ✅ Present findings clearly and concisely — the user needs to decide which refinements to keep
26
+ - ✅ Next step recommendations must be specific and actionable
27
+
28
+ ### Step-Specific Rules:
29
+
30
+ - 🎯 Focus ONLY on presenting the completed refinement — no new analysis
31
+ - 🚫 FORBIDDEN to discover new gaps, issues, or improvements
32
+ - 🚫 FORBIDDEN to modify the refined document — only read and present
33
+ - 📋 This is the FINAL step — no nextStepFile
34
+
35
+ ## EXECUTION PROTOCOLS:
36
+
37
+ - Load and present the refinement summary from the compiled document
38
+ - No new content written — document was finalized in Step 05
39
+ - Present summary, next steps, and review options clearly
40
+ - Read-only presentation — do not alter document data
41
+
42
+ ## CONTEXT BOUNDARIES:
43
+
44
+ - Available: Complete {outputFile} with all refinements from Steps 02-05
45
+ - Focus: Clear, actionable presentation of refinement results
46
+ - Limits: Do not add new analysis or change any refinements
47
+ - Dependencies: All previous steps must be complete (Steps 01-05)
48
+
49
+ ## MANDATORY SEQUENCE
50
+
51
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
52
+
53
+ ### 1. Load Refined Document
54
+
55
+ Read the `{outputFile}` to have all data available for presentation.
56
+
57
+ Verify the `## Refinement Summary` section is present. If it is absent, HALT: "⚠️ Refinement Summary not found in `{outputFile}`. Step 05 may not have completed successfully. Re-run [RA] from the beginning."
58
+
59
+ **Extract metrics from the Refinement Summary section:** Parse `gap_count`, `issue_count`, `improvement_count`, `critical_count`, `major_count`, `minor_count`, `high_count`, `medium_count`, `low_count`, and `skill_count` from the Changes Made table and Evidence Sources table. Use these extracted values in the summary table and next-steps sections below.
60
+
61
+ ### 2. Display Summary
62
+
63
+ "**Refine Architecture — Refinement Complete**
64
+
65
+ ---
66
+
67
+ | Metric | Count |
68
+ |--------|-------|
69
+ | **Gaps Filled** | {gap_count} |
70
+ | **Issues Flagged** | {issue_count} (Critical: {critical_count}, Major: {major_count}, Minor: {minor_count}) |
71
+ | **Improvements Suggested** | {improvement_count} (High: {high_count}, Medium: {medium_count}, Low: {low_count}) |
72
+ | **Skills Used as Evidence** | {skill_count} |
73
+
74
+ **Evidence Sources:** (which skills contributed evidence)
75
+
76
+ {Display the Evidence Sources table from the Refinement Summary section of the document}
77
+
78
+ ---
79
+
80
+ **Your refined architecture is at:** `{outputFile}`
81
+
82
+ The original architecture content is fully preserved. All refinements are clearly marked with `[!NOTE]`, `[!WARNING]`, and `[!TIP]` callout blocks that you can accept, modify, or remove."
83
+
84
+ ### 3. Present Next Steps
85
+
86
+ "**Recommended next steps:**
87
+
88
+ 1. **Review the refined document** — accept, modify, or remove individual refinements
89
+ 2. **[SS] Stack Skill** — compose-mode activates automatically when SS detects existing individual skills without a codebase; provide this refined architecture doc as the architecture document when prompted
90
+ 3. **Re-run [VS] Verify Stack** if you made changes based on issue corrections — to confirm resolution
91
+
92
+ {IF issues with Critical severity were found:}
93
+ **⚠️ Attention:** {critical_count} critical issue(s) were flagged. These indicate fundamental contradictions between your architecture and the verified API surfaces. Address these before proceeding to stack skill composition."
94
+
95
+ ### 4. Present Menu
96
+
97
+ Display: "**[R] Review changes in detail** | **[X] Exit refinement**"
98
+
99
+ #### Menu Handling Logic:
100
+
101
+ - **IF R:** Walk through each refinement with its full evidence citation:
102
+ 1. First, all gaps with their evidence and proposed integration paths
103
+ 2. Then, all issues ordered by severity with architecture claim vs. skill reality
104
+ 3. Finally, all improvements ordered by value with untapped capability details
105
+ After completing the walkthrough, redisplay the menu.
106
+
107
+ - **IF X:** "**Refined architecture saved to:** `{outputFile}`
108
+
109
+ Re-run **[RA] Refine Architecture** anytime after updating your skills or architecture document.
110
+
111
+ **Architecture refinement complete.**"
112
+
113
+ #### EXECUTION RULES:
114
+
115
+ - ALWAYS halt and wait for user input after presenting the menu
116
+ - R may be selected multiple times — always walk through all refinements
117
+ - X ends the workflow
118
+
119
+ ## CRITICAL STEP COMPLETION NOTE
120
+
121
+ This is the final step of the refine-architecture workflow. When the user selects X, the workflow is complete. The refined architecture at `{outputFile}` contains the full original content plus all gap-fills, issue annotations, and improvement suggestions backed by skill API evidence.
122
+
123
+ ---
124
+
125
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
126
+
127
+ ### ✅ SUCCESS:
128
+
129
+ - Refined document loaded and verified for Refinement Summary section
130
+ - Summary displayed with accurate counts for gaps, issues, and improvements
131
+ - Output file path displayed prominently
132
+ - Next steps presented with specific workflow recommendations
133
+ - Critical issues highlighted if present
134
+ - Menu presented with R and X options
135
+ - Detailed review walkthrough available on R selection with full evidence citations
136
+ - Workflow exits cleanly on X with saved file path
137
+
138
+ ### ❌ SYSTEM FAILURE:
139
+
140
+ - Discovering new findings or changing refinements in this step
141
+ - Modifying the refined document content
142
+ - Not presenting the menu
143
+ - Not displaying the document save path on exit
144
+ - Inaccurate counts in the summary
145
+ - Hardcoded paths instead of frontmatter variables
146
+
147
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: refine-architecture
3
+ description: Improve architecture doc using verified skill data and VS feasibility findings
4
+ web_bundle: true
5
+ installed_path: '{project-root}/_bmad/skf/workflows/skillforge/refine-architecture'
6
+ ---
7
+
8
+ # Refine Architecture
9
+
10
+ **Goal:** Take an original architecture document + generated skills + optional VS feasibility report, and produce a refined architecture with gaps filled, issues flagged, and improvements suggested — all backed by specific API evidence from the generated skills.
11
+
12
+ **Your Role:** In addition to your name, communication_style, and persona, you are also an architecture refinement analyst operating in Ferris Architect mode. You bring expertise in API surface analysis, integration gap detection, and evidence-backed architecture improvement, while the user brings their architecture vision and generated skills. Execute with analytical precision — every suggestion must cite specific APIs from the generated skills. Evidence-backed suggestions, not speculation.
13
+
14
+ ---
15
+
16
+ ## WORKFLOW ARCHITECTURE
17
+
18
+ This uses **step-file architecture** for disciplined execution:
19
+
20
+ ### Core Principles
21
+
22
+ - **Micro-file Design**: Each step is a self-contained instruction file that must be followed exactly
23
+ - **Just-In-Time Loading**: Only the current step file is in memory — never load future step files until told to do so
24
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
25
+ - **Additive, Not Destructive**: This workflow enhances the original architecture — it never deletes original content, only adds annotations, subsections, and suggestions
26
+ - **Evidence-Backed Refinement**: Every gap, issue, or improvement must cite specific APIs, types, or function signatures from the generated skills
27
+
28
+ ### Step Processing Rules
29
+
30
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
31
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
32
+ 3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
33
+ 4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
34
+ 5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
35
+
36
+ ### Critical Rules (NO EXCEPTIONS)
37
+
38
+ - 🛑 **NEVER** load multiple step files simultaneously
39
+ - 📖 **ALWAYS** read entire step file before execution
40
+ - 🚫 **NEVER** skip steps or optimize the sequence
41
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
42
+ - ⏸️ **ALWAYS** halt at menus and wait for user input
43
+ - 📋 **NEVER** create mental todo lists from future steps
44
+ - ⚙️ **TOOL/SUBPROCESS FALLBACK**: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
45
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
46
+ - 📝 **DOCUMENT-PRODUCING**: This workflow outputs a refined architecture markdown file
47
+
48
+ ---
49
+
50
+ ## INITIALIZATION SEQUENCE
51
+
52
+ ### 1. Module Configuration Loading
53
+
54
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
55
+
56
+ - `project_name`, `user_name`, `communication_language`, `document_output_language`
57
+ - `skills_output_folder`, `forge_data_folder`, `output_folder`
58
+
59
+ ### 2. First Step Execution
60
+
61
+ Load, read the full file and then execute `./steps-c/step-01-init.md` to begin the workflow.
@@ -7,16 +7,20 @@
7
7
  | ast-grep | `ast-grep --version` | Returns version string without error |
8
8
  | gh | `gh --version` | Returns version string without error |
9
9
  | qmd | `qmd status` | Returns status indicating initialized and operational |
10
+ | ccc | Step A: `ccc --help` Step B: `ccc doctor` | Step A: exits 0 (binary exists). Step B: daemon running, version string, model check OK |
10
11
 
11
- **Important:** Use verification commands, not existence checks (`which`, `command -v`). A tool must be functional, not just present on PATH.
12
+ **Important:** Use verification commands, not existence checks (`which`, `command -v`). A tool must be functional, not just present on PATH. For daemon-based tools (ccc), verify both binary existence and daemon health.
12
13
 
13
14
  ## Tier Calculation
14
15
 
15
- | Tier | Required Tools | Rule |
16
- |------|---------------|------|
17
- | Quick | None | Default when no tools are available |
18
- | Forge | ast-grep | ast-grep available, regardless of gh/qmd |
19
- | Deep | ast-grep + gh + qmd | All three tools available and functional |
16
+ | Priority | Tier | Required Tools | Rule |
17
+ |----------|------|---------------|------|
18
+ | 1 (highest) | Deep | ast-grep + gh + qmd | All three core tools available and functional |
19
+ | 2 | Forge+ | ast-grep + ccc | ast-grep AND ccc available, regardless of gh/qmd |
20
+ | 3 | Forge | ast-grep | ast-grep available, without ccc/gh/qmd |
21
+ | 4 (default) | Quick | None | Default when no tools are available |
22
+
23
+ **Evaluation order:** Check Deep first, then Forge+, then Forge. The first match wins. This ensures Deep always takes priority when all tools are present.
20
24
 
21
25
  **Override:** If `tier_override` is set in preferences.yaml, use that value instead of calculated tier.
22
26
 
@@ -24,6 +28,9 @@
24
28
  - gh available but no ast-grep → Quick (gh alone doesn't unlock Forge)
25
29
  - ast-grep + gh but no qmd → Forge (qmd required for Deep)
26
30
  - ast-grep + qmd but no gh → Forge (gh required for Deep)
31
+ - ccc available but no ast-grep → Quick (ccc alone doesn't unlock Forge+)
32
+ - ast-grep + ccc + gh but no qmd → Forge+ (qmd required for Deep)
33
+ - ast-grep + gh + qmd + ccc → Deep (Deep subsumes Forge+; ccc enhances transparently)
27
34
 
28
35
  ## Tier Capability Descriptions
29
36
 
@@ -35,6 +42,9 @@ Use these for positive-framing in the report step. Describe what the tier GIVES,
35
42
  ### Forge Tier
36
43
  "Forge tier active. You have AST-backed structural code analysis with line-level citations, plus template-driven generation. Every skill instruction traces to verified source code."
37
44
 
45
+ ### Forge+ Tier
46
+ "Forge+ tier active. Semantic-guided precision compilation — cocoindex-code maps the codebase semantically before AST extraction runs. Every skill begins with a ranked discovery pass that surfaces the most relevant source regions, then AST-backed verification gives each export its line-level citation."
47
+
38
48
  ### Deep Tier
39
49
  "Deep tier active. Full capability unlocked — AST-backed code analysis, GitHub repository exploration, and QMD knowledge search with cross-repository synthesis. Maximum provenance and intelligence."
40
50
 
@@ -2,7 +2,7 @@
2
2
  name: 'step-01-detect-and-tier'
3
3
  description: 'Detect available tools and determine forge capability tier'
4
4
 
5
- nextStepFile: './step-02-write-config.md'
5
+ nextStepFile: './step-01b-ccc-index.md'
6
6
  tierRulesData: '../data/tier-rules.md'
7
7
  ---
8
8
 
@@ -10,7 +10,7 @@ tierRulesData: '../data/tier-rules.md'
10
10
 
11
11
  ## STEP GOAL:
12
12
 
13
- Verify availability of the three forge tools (ast-grep, gh, qmd), read any existing configuration for re-run comparison, check for tier override, and calculate the capability tier.
13
+ Verify availability of the four forge tools (ast-grep, gh, qmd, ccc), read any existing configuration for re-run comparison, check for tier override, and calculate the capability tier.
14
14
 
15
15
  ## MANDATORY EXECUTION RULES (READ FIRST):
16
16
 
@@ -30,7 +30,7 @@ Verify availability of the three forge tools (ast-grep, gh, qmd), read any exist
30
30
 
31
31
  - 🎯 Focus only on tool detection and tier calculation
32
32
  - 🚫 FORBIDDEN to write any files — that is step-02's job
33
- - 🚫 FORBIDDEN to skip any tool check — all 3 must be verified
33
+ - 🚫 FORBIDDEN to skip any tool check — all 4 must be verified
34
34
  - 💬 Tool command failures are NOT errors — they indicate unavailability
35
35
 
36
36
  ## EXECUTION PROTOCOLS:
@@ -38,13 +38,14 @@ Verify availability of the three forge tools (ast-grep, gh, qmd), read any exist
38
38
  - 🎯 Follow the MANDATORY SEQUENCE exactly
39
39
  - 💾 Store all results in memory for step-02
40
40
  - 📖 Load tier-rules.md for calculation reference
41
- - 🚫 FORBIDDEN to proceed without checking all 3 tools
41
+ - 🚫 FORBIDDEN to proceed without checking all 4 tools
42
42
 
43
43
  ## CONTEXT BOUNDARIES:
44
44
 
45
45
  - This is the first step — no prior context exists
46
46
  - Available: forge-tier.yaml and preferences.yaml may exist from prior runs
47
47
  - Focus: tool verification and tier calculation only
48
+ - Produces: `{detected_tools}`, `{calculated_tier}`, `{previous_tier}`, `{tier_override}` for downstream steps
48
49
  - Dependencies: none — this step bootstraps everything
49
50
 
50
51
  ## MANDATORY SEQUENCE
@@ -95,22 +96,38 @@ Check if the `SNYK_TOKEN` environment variable is set:
95
96
 
96
97
  This is informational only — security scan availability does NOT affect the tier level. It is recorded in forge-tier.yaml so that create-skill's validation step can report actionable guidance when security scanning is unavailable.
97
98
 
98
- ### 7. Calculate Tier
99
+ ### 7. Verify Tool: ccc (cocoindex-code)
99
100
 
100
- **If `{tier_override}` is set and valid (Quick, Forge, or Deep):**
101
+ **Step A Binary existence:** Run `ccc --help`
102
+
103
+ - If exits 0: binary confirmed. Continue to Step B.
104
+ - If fails (command not found or error): record `{ccc: false}`. Skip Step B.
105
+
106
+ **Step B — Daemon health:** Run `ccc doctor`
107
+
108
+ - If daemon is running and model check OK: record `{ccc: true, ccc_daemon: "healthy"}` and store version string from output
109
+ - If daemon is not running: record `{ccc: true, ccc_daemon: "stopped"}` — binary available, daemon needs starting. Step-01b will handle this.
110
+ - If error or timeout: record `{ccc: true, ccc_daemon: "error"}` — binary works but daemon has issues.
111
+
112
+ ccc availability gates the Forge+ tier and enhances Deep tier when present.
113
+
114
+ ### 8. Calculate Tier
115
+
116
+ **If `{tier_override}` is set and valid (Quick, Forge, Forge+, or Deep):**
101
117
  - Use `{tier_override}` as `{calculated_tier}`
102
118
  - Note that override is active for the report step
103
119
 
104
- **If no override, apply tier rules from {tierRulesData}:**
120
+ **If no override, apply tier rules from {tierRulesData} in order — the first matching rule wins. Do not continue checking once a match is found:**
105
121
  - `{ast_grep}` AND `{gh_cli}` AND `{qmd}` all true → **Deep**
106
- - `{ast_grep}` true (regardless of gh/qmd) → **Forge**
122
+ - `{ast_grep}` AND `{ccc}` both true (regardless of gh/qmd) → **Forge+**
123
+ - `{ast_grep}` true (regardless of ccc/gh/qmd) → **Forge**
107
124
  - Otherwise → **Quick**
108
125
 
109
126
  **If `{tier_override}` is set but invalid:** ignore it, use detected tier, flag for warning in report.
110
127
 
111
- ### 8. Auto-Proceed
128
+ ### 9. Auto-Proceed
112
129
 
113
- "**Proceeding to write configuration...**"
130
+ "**Proceeding to CCC index check...**"
114
131
 
115
132
  #### Menu Handling Logic:
116
133
 
@@ -123,7 +140,7 @@ This is informational only — security scan availability does NOT affect the ti
123
140
 
124
141
  ## CRITICAL STEP COMPLETION NOTE
125
142
 
126
- ONLY WHEN all 3 core tools have been verified, optional security scan checked, and the tier calculated will you load and read fully `{nextStepFile}` to execute the configuration write step.
143
+ ONLY WHEN all 4 core tools have been verified, optional security scan checked, and the tier calculated will you load and read fully `{nextStepFile}` to execute the CCC index check step.
127
144
 
128
145
  ---
129
146
 
@@ -131,19 +148,20 @@ ONLY WHEN all 3 core tools have been verified, optional security scan checked, a
131
148
 
132
149
  ### ✅ SUCCESS:
133
150
 
134
- - All 3 tools checked via verification commands (not existence checks)
151
+ - All 4 tools checked via verification commands (not existence checks)
135
152
  - Existing forge-tier.yaml read for re-run comparison (if present)
136
153
  - Existing preferences.yaml read for tier_override (if present)
137
154
  - Tier correctly calculated from tool results or override applied
138
- - All results stored in context for step-02
139
- - Auto-proceeded to step-02
155
+ - All results stored in context for step-01b and step-02
156
+ - Auto-proceeded to step-01b
140
157
 
141
158
  ### ❌ SYSTEM FAILURE:
142
159
 
143
- - Skipping any tool verification
160
+ - Skipping any tool verification (ast-grep, gh, qmd, ccc — all 4 must be checked)
144
161
  - Using `which` or `command -v` instead of verification commands
145
162
  - Assuming tool availability without running the command
146
163
  - Writing files in this step (that is step-02)
147
164
  - Not checking for existing configuration on re-runs
165
+ - Not checking ccc availability (both binary and daemon health)
148
166
 
149
167
  **Master Rule:** Every tool MUST be verified empirically. No assumptions, no shortcuts.