bmad-module-skill-forge 0.2.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 (154) hide show
  1. package/.nvmrc +1 -0
  2. package/LICENSE +26 -0
  3. package/README.md +213 -0
  4. package/docs/404.md +20 -0
  5. package/docs/agents.md +73 -0
  6. package/docs/architecture.md +301 -0
  7. package/docs/examples.md +144 -0
  8. package/docs/getting-started.md +198 -0
  9. package/docs/index.md +75 -0
  10. package/docs/workflows.md +190 -0
  11. package/package.json +109 -0
  12. package/src/agents/forger.agent.yaml +93 -0
  13. package/src/forger/README.md +17 -0
  14. package/src/forger/forge-tier.yaml +13 -0
  15. package/src/forger/preferences.yaml +10 -0
  16. package/src/knowledge/agentskills-spec.md +158 -0
  17. package/src/knowledge/confidence-tiers.md +153 -0
  18. package/src/knowledge/manual-section-integrity.md +156 -0
  19. package/src/knowledge/overview.md +56 -0
  20. package/src/knowledge/progressive-capability.md +120 -0
  21. package/src/knowledge/provenance-tracking.md +163 -0
  22. package/src/knowledge/skf-knowledge-index.csv +9 -0
  23. package/src/knowledge/skill-lifecycle.md +150 -0
  24. package/src/knowledge/zero-hallucination.md +101 -0
  25. package/src/module-help.csv +12 -0
  26. package/src/module.yaml +22 -0
  27. package/src/workflows/README.md +148 -0
  28. package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
  29. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
  30. package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
  31. package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
  32. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
  33. package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
  34. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
  35. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
  36. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
  37. package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
  38. package/src/workflows/analyze-source/validation-report.md +657 -0
  39. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
  40. package/src/workflows/analyze-source/workflow.md +61 -0
  41. package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
  42. package/src/workflows/audit-skill/data/severity-rules.md +52 -0
  43. package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
  44. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
  45. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
  46. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
  47. package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
  48. package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
  49. package/src/workflows/audit-skill/validation-report.md +545 -0
  50. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
  51. package/src/workflows/audit-skill/workflow.md +63 -0
  52. package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
  53. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
  54. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
  55. package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
  56. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
  57. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
  58. package/src/workflows/brief-skill/validation-report.md +630 -0
  59. package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
  60. package/src/workflows/brief-skill/workflow.md +57 -0
  61. package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
  62. package/src/workflows/create-skill/data/skill-sections.md +166 -0
  63. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
  64. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
  65. package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
  66. package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
  67. package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
  68. package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
  69. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
  70. package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
  71. package/src/workflows/create-skill/validation-report.md +189 -0
  72. package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
  73. package/src/workflows/create-skill/workflow.md +52 -0
  74. package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
  75. package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
  76. package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
  77. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
  78. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
  79. package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
  80. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
  81. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
  82. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
  83. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
  84. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
  85. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
  86. package/src/workflows/create-stack-skill/validation-report.md +401 -0
  87. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
  88. package/src/workflows/create-stack-skill/workflow.md +59 -0
  89. package/src/workflows/export-skill/data/managed-section-format.md +70 -0
  90. package/src/workflows/export-skill/data/snippet-format.md +32 -0
  91. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
  92. package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
  93. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
  94. package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
  95. package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
  96. package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
  97. package/src/workflows/export-skill/validation-report.md +263 -0
  98. package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
  99. package/src/workflows/export-skill/workflow.md +56 -0
  100. package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
  101. package/src/workflows/quick-skill/data/skill-template.md +66 -0
  102. package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
  103. package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
  104. package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
  105. package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
  106. package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
  107. package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
  108. package/src/workflows/quick-skill/validation-report.md +543 -0
  109. package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
  110. package/src/workflows/quick-skill/workflow.md +56 -0
  111. package/src/workflows/setup-forge/data/tier-rules.md +50 -0
  112. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
  113. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
  114. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
  115. package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
  116. package/src/workflows/setup-forge/validation-report.md +504 -0
  117. package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
  118. package/src/workflows/setup-forge/workflow.md +49 -0
  119. package/src/workflows/test-skill/data/output-section-formats.md +96 -0
  120. package/src/workflows/test-skill/data/scoring-rules.md +74 -0
  121. package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
  122. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
  123. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
  124. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
  125. package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
  126. package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
  127. package/src/workflows/test-skill/templates/test-report-template.md +24 -0
  128. package/src/workflows/test-skill/validation-report.md +390 -0
  129. package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
  130. package/src/workflows/test-skill/workflow.md +57 -0
  131. package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
  132. package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
  133. package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
  134. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
  135. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
  136. package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
  137. package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
  138. package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
  139. package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
  140. package/src/workflows/update-skill/validation-report.md +559 -0
  141. package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
  142. package/src/workflows/update-skill/workflow.md +56 -0
  143. package/tools/cli/commands/install.js +33 -0
  144. package/tools/cli/commands/status.js +195 -0
  145. package/tools/cli/commands/uninstall.js +226 -0
  146. package/tools/cli/commands/update.js +63 -0
  147. package/tools/cli/lib/compiler.js +306 -0
  148. package/tools/cli/lib/ide-commands.js +244 -0
  149. package/tools/cli/lib/installer.js +307 -0
  150. package/tools/cli/lib/manifest.js +109 -0
  151. package/tools/cli/lib/ui.js +277 -0
  152. package/tools/cli/lib/version-check.js +86 -0
  153. package/tools/cli/skf-cli.js +45 -0
  154. package/tools/skf-npx-wrapper.js +36 -0
@@ -0,0 +1,428 @@
1
+ ---
2
+ conversionFrom: 'src/workflows/setup-forge/setup-forge.spec.md'
3
+ originalFormat: 'Specification/Placeholder'
4
+ stepsCompleted: ['step-00-conversion', 'step-02-classification', 'step-03-requirements', 'step-04-tools', 'step-05-plan-review', 'step-06-design', 'step-07-foundation', 'step-08-build-step-01', 'step-09-build-remaining', 'step-10-confirmation']
5
+ created: 2026-02-26
6
+ status: CONFIRMED
7
+ confirmationDate: 2026-02-26
8
+ confirmationType: conversion
9
+ coverageStatus: complete
10
+ approvedDate: 2026-02-26
11
+ validationStatus: COMPLETE
12
+ validationDate: 2026-02-26
13
+ validationReport: validation-report.md
14
+ ---
15
+
16
+ # Workflow Creation Plan
17
+
18
+ ## Conversion Source
19
+
20
+ **Original Path:** src/workflows/setup-forge/setup-forge.spec.md
21
+ **Original Format:** Specification/Placeholder (not yet implemented)
22
+ **Detected Structure:** 5-step create-only workflow spec with defined steps, inputs, outputs, and agent integration
23
+
24
+ ---
25
+
26
+ ## Original Workflow Analysis
27
+
28
+ ### Goal (from source)
29
+
30
+ Initialize forge environment, detect tools, set tier, auto-index project
31
+
32
+ ### Original Steps (Complete List)
33
+
34
+ **Step 1:** detect-tools - Check for gh, ast-grep, QMD availability
35
+ **Step 2:** determine-tier - Set Quick/Forge/Deep based on tools found
36
+ **Step 3:** create-config - Generate forge-config.yaml with tier and tool flags
37
+ **Step 4:** auto-index - Index current project as QMD collection (Deep only)
38
+ **Step 5:** report - Display forge status, tier, and capabilities
39
+
40
+ ### Output / Deliverable
41
+
42
+ - `forge-config.yaml` — Tier and tool configuration
43
+ - `forge-data/` directory created
44
+ - `_bmad/_memory/forger-sidecar/forge-tier.yaml` — Capability flags
45
+ - `_bmad/_memory/forger-sidecar/preferences.yaml` — User preferences (defaults on first run)
46
+
47
+ ### Input Requirements
48
+
49
+ **Required:**
50
+ - Project root path
51
+
52
+ **Optional:**
53
+ - `--update-spec` flag to fetch latest agentskills.io spec schema
54
+
55
+ ### Key Instructions to LLM
56
+
57
+ - Ferris agent in Architect mode is the primary operator
58
+ - Tier-aware communication: acknowledge detected tier in responses
59
+ - Zero hallucination: tool detection must be empirical (actually run commands), not assumed
60
+ - Progressive capability: adapt behavior based on detected tier
61
+
62
+ ---
63
+
64
+ ## Conversion Notes
65
+
66
+ **What works well in original:**
67
+ - Clear 5-step decomposition with logical progression
68
+ - Well-defined progressive tier system (Quick/Forge/Deep)
69
+ - Three distinct output artifacts with clear purposes
70
+ - Correctly identified as foundation workflow all others depend on
71
+
72
+ **What needs improvement:**
73
+ - `--update-spec` is underspecified — deduced as convenience flag to fetch agentskills.io schema for downstream validation, not a core step
74
+ - No re-run behavior defined — deduced as re-detect and overwrite (config/tier), preserve (preferences), skip-if-exists (forge-data/), report changes
75
+ - Step 04 (auto-index) is conditional (Deep-only) — needs graceful skip logic
76
+ - Missing `preferences.yaml` creation with defaults on first run
77
+
78
+ **Compliance gaps identified:**
79
+ - No workflow.md entry point file
80
+ - No step files exist (steps-c/ directory not created)
81
+ - No BMAD frontmatter or step architecture
82
+ - No menu handling or continuation logic
83
+ - No state tracking via stepsCompleted
84
+ - No data/ or templates/ directories
85
+
86
+ **Deduced design decisions:**
87
+ - `--update-spec` handled as optional action within report step, not its own step
88
+ - Re-run behavior: re-detect tools, overwrite config/tier, preserve preferences, report tier changes
89
+ - `preferences.yaml` created with defaults if missing, never overwritten
90
+ - `forge-data/` directory creation is idempotent (skip if exists)
91
+
92
+ ---
93
+
94
+ ## Classification Decisions
95
+
96
+ **Workflow Name:** setup-forge
97
+ **Target Path:** `_bmad/skf/workflows/setup-forge/`
98
+
99
+ **4 Key Decisions:**
100
+ 1. **Document Output:** false — action-based workflow producing config files as side effects, not a progressively-built document
101
+ 2. **Module Affiliation:** SKF — core initializer for the Skill Forge module
102
+ 3. **Session Type:** single-session — tool detection and config generation completes in under 5 minutes
103
+ 4. **Lifecycle Support:** create-only — idempotent re-run replaces the need for edit/validate modes
104
+
105
+ **Structure Implications:**
106
+ - Simple `steps-c/` folder only, no edit/validate modes
107
+ - No `step-01b-continue.md` needed
108
+ - No document template — output is config files written directly
109
+ - Standard init step without continuation logic
110
+
111
+ ---
112
+
113
+ ## Advanced Elicitation Refinements
114
+
115
+ *Applied from 5-method analysis: Architecture Decision Records, Pre-mortem, First Principles, Critique and Refine, Red Team vs Blue Team*
116
+
117
+ ### Config File Consolidation
118
+ - **forge-tier.yaml** (sidecar) is the single source of truth for tool availability and tier
119
+ - **forge-config.yaml** must have a distinct, non-overlapping purpose — module-level settings (output paths, skill defaults, module preferences) NOT tier/tool duplication
120
+ - If forge-config.yaml has no unique purpose beyond tier data, eliminate it and use forge-tier.yaml only
121
+
122
+ ### Tool Verification Over Detection
123
+ - Step 01 must verify tools are functional, not just present
124
+ - Use `ast-grep --version`, `gh --version`, `qmd status` — not just `which` or `command -v`
125
+ - QMD specifically: check it's initialized, not just installed
126
+
127
+ ### Preferences Enhancement
128
+ - Add `tier_override` field to preferences.yaml for manual tier forcing
129
+ - Allows users to force Deep when tools are partially available (e.g., QMD coming soon)
130
+ - Re-run respects override: if set, skip detection for that tier and use override
131
+
132
+ ### Step 04 Resilience
133
+ - QMD auto-indexing could be slow on large projects
134
+ - Step 04 needs timeout awareness and graceful degradation
135
+ - If indexing fails/times out, forge-tier.yaml still records `qmd: true` — index can be re-attempted later
136
+
137
+ ### Report Framing
138
+ - Frame capabilities positively: "Your Forge tier gives you AST-backed analysis and structural code search"
139
+ - Do NOT list what was skipped or missing — no "You're missing QMD for Deep tier"
140
+ - On re-run: report tier changes explicitly ("Upgraded from Quick to Forge — ast-grep now available")
141
+
142
+ ### `--update-spec` Placement
143
+ - Owned by report step as optional post-action
144
+ - Not its own step — fires at end if flag is present
145
+ - Requires gh or web access to fetch latest agentskills.io schema
146
+
147
+ ---
148
+
149
+ ## Requirements
150
+
151
+ **Flow Structure:**
152
+ - Pattern: Linear with conditional branch (step 03 auto-index is Deep-only)
153
+ - Phases: Init → Detect & Verify + Determine Tier → Write Config → [Deep?] Auto-Index → Report
154
+ - Estimated steps: 4 step files (merged detect+tier into one, auto-index+report could merge but kept separate for conditional clarity)
155
+ - Revised step plan:
156
+ - step-01: detect-and-tier — verify all 3 tools functional, calculate tier (or apply tier_override)
157
+ - step-02: write-config — write forge-tier.yaml, create preferences.yaml defaults if missing, ensure forge-data/ exists
158
+ - step-03: auto-index — QMD collection indexing of project (Deep tier only, skip gracefully for Quick/Forge, timeout resilient)
159
+ - step-04: report — display forge status with positive capability framing, handle --update-spec if flagged, report tier changes on re-run
160
+
161
+ **User Interaction:**
162
+ - Style: Fully autonomous — zero user interaction during execution
163
+ - Decision points: None — all decisions are algorithmic (tool exists? → tier assignment)
164
+ - Checkpoint frequency: None — runs straight through, report at end
165
+
166
+ **Inputs Required:**
167
+ - Required: Project root path (implicit from BMAD context)
168
+ - Optional: `--update-spec` flag, `tier_override` in preferences.yaml
169
+ - Prerequisites: BMAD installed with SKF module active, Ferris agent available
170
+
171
+ **Output Specifications:**
172
+ - Type: Action-based (config file generation + directory creation + tool verification)
173
+ - Files created/updated:
174
+ - `_bmad/_memory/forger-sidecar/forge-tier.yaml` — single source of truth for tools + tier + timestamp
175
+ - `_bmad/_memory/forger-sidecar/preferences.yaml` — user defaults (create if missing, never overwrite)
176
+ - `forge-data/` directory — created if missing, skipped if exists
177
+ - Eliminated: `forge-config.yaml` — consolidated into forge-tier.yaml to prevent drift
178
+ - Display: Forge status report with tier, capabilities, and positive framing
179
+ - Frequency: Single execution per run (idempotent, safe to re-run)
180
+
181
+ **Success Criteria:**
182
+ - All 3 tools (ast-grep, gh, qmd) verified via version/status commands, results accurately recorded
183
+ - Correct tier assigned from tool availability (or tier_override respected if set)
184
+ - forge-tier.yaml written with tools, tier, and tier_detected_at timestamp
185
+ - preferences.yaml exists with defaults (created on first run, preserved on re-run)
186
+ - forge-data/ directory exists
187
+ - Report displayed with positive capability framing (no "missing" language)
188
+ - On re-run: tier changes detected and reported (upgrade/downgrade/same)
189
+ - QMD auto-index completes or degrades gracefully on timeout (Deep tier only)
190
+
191
+ **Instruction Style:**
192
+ - Overall: Prescriptive — exact operations, no creative facilitation
193
+ - Notes: Each step has precise shell commands, file write operations, and conditional logic. No open-ended questions or user discovery needed. Tool verification uses specific commands (ast-grep --version, gh --version, qmd status), not existence checks.
194
+
195
+ ---
196
+
197
+ ## Tools Configuration
198
+
199
+ **Core BMAD Tools:**
200
+ - **Party Mode:** Excluded — fully autonomous workflow, no creative exploration needed
201
+ - **Advanced Elicitation:** Excluded — no content to refine, purely mechanical operations
202
+ - **Brainstorming:** Excluded — no ideation needed in tool detection
203
+
204
+ **LLM Features:**
205
+ - **Web-Browsing:** Excluded — tool detection is local; --update-spec uses gh/curl via shell
206
+ - **File I/O:** Included — core to workflow (read/write forge-tier.yaml, preferences.yaml, create forge-data/)
207
+ - **Sub-Agents:** Excluded — simple linear flow, no parallel specialization
208
+ - **Sub-Processes:** Excluded — no parallel processing needed
209
+
210
+ **Memory:**
211
+ - Type: Single-session, no complex tracking
212
+ - Sidecar file: forge-tier.yaml serves as persistent state (read on re-run to detect tier changes)
213
+ - No stepsCompleted tracking needed (non-document, single-session)
214
+
215
+ **External Integrations:**
216
+ - **QMD MCP server:** Required for step-03 auto-index (Deep tier only) — must be manually installed by the user following official QMD documentation
217
+ - No other external integrations
218
+
219
+ **Installation Requirements:**
220
+ - **QMD MCP server:** Manual installation required for Deep tier — not bundled with BMAD, user follows official docs
221
+ - ast-grep and gh are standard CLI tools installed independently by the user
222
+
223
+ ---
224
+
225
+ ## Workflow Design
226
+
227
+ ### File Structure
228
+
229
+ ```
230
+ setup-forge/
231
+ ├── workflow.md # Entry point
232
+ ├── data/
233
+ │ └── tier-rules.md # Tier calculation rules + capability descriptions
234
+ └── steps-c/
235
+ ├── step-01-detect-and-tier.md
236
+ ├── step-02-write-config.md
237
+ ├── step-03-auto-index.md
238
+ └── step-04-report.md
239
+ ```
240
+
241
+ No templates/ directory (non-document workflow).
242
+
243
+ ### Step Sequence
244
+
245
+ | Step | File | Type | Menu | Goal |
246
+ |------|------|------|------|------|
247
+ | 01 | step-01-detect-and-tier.md | Init (Non-Continuable) | Auto-proceed | Verify 3 tools functional, check tier_override, calculate tier, read previous tier |
248
+ | 02 | step-02-write-config.md | Middle (Simple) | Auto-proceed | Write forge-tier.yaml, create preferences.yaml defaults if missing, ensure forge-data/ exists |
249
+ | 03 | step-03-auto-index.md | Middle (Simple + Conditional) | Auto-proceed | QMD index project (Deep only), skip gracefully otherwise |
250
+ | 04 | step-04-report.md | Final Step | None | Display status with positive framing, handle --update-spec, report tier changes |
251
+
252
+ ### Step Detail: step-01-detect-and-tier
253
+
254
+ **Frontmatter refs:** nextStepFile, tierRulesData (../data/tier-rules.md)
255
+ **Actions:**
256
+ 1. Load tier-rules.md for tier calculation reference
257
+ 2. Read existing forge-tier.yaml if present → store as {previous_tier}
258
+ 3. Read existing preferences.yaml if present → check for tier_override
259
+ 4. Run `ast-grep --version` → record result (available/unavailable + version)
260
+ 5. Run `gh --version` → record result
261
+ 6. Run `qmd status` → record result (check initialized, not just installed)
262
+ 7. Calculate tier from tier-rules.md logic (or apply tier_override if set)
263
+ 8. Store {detected_tools}, {calculated_tier}, {previous_tier} in context
264
+ 9. Auto-proceed to step-02
265
+
266
+ **Error handling:** Tool command failures are NOT errors — they indicate tool unavailability. Record as unavailable and continue.
267
+
268
+ ### Step Detail: step-02-write-config
269
+
270
+ **Frontmatter refs:** nextStepFile
271
+ **Actions:**
272
+ 1. Write forge-tier.yaml with: tools (ast_grep, gh_cli, qmd booleans), tier, tier_detected_at timestamp
273
+ 2. Check if preferences.yaml exists
274
+ - If missing: create with defaults (tier_override: ~, plus any other default preferences)
275
+ - If exists: preserve entirely, do not modify
276
+ 3. Check if forge-data/ directory exists
277
+ - If missing: create it
278
+ - If exists: skip
279
+ 4. Auto-proceed to step-03
280
+
281
+ **Error handling:** File write failure → report error clearly, halt workflow.
282
+
283
+ ### Step Detail: step-03-auto-index
284
+
285
+ **Frontmatter refs:** nextStepFile
286
+ **Actions:**
287
+ 1. Check {calculated_tier}
288
+ 2. If Deep:
289
+ - Run QMD collection indexing of current project
290
+ - Handle timeout gracefully (if indexing exceeds reasonable time, log and continue)
291
+ - If indexing fails: log that index needs retry, do NOT fail the workflow
292
+ 3. If Quick or Forge:
293
+ - Skip silently — no output, no "missing" messaging
294
+ 4. Auto-proceed to step-04
295
+
296
+ **Error handling:** QMD failures degrade gracefully. forge-tier.yaml already records qmd: true — index can be retried later.
297
+
298
+ ### Step Detail: step-04-report
299
+
300
+ **Frontmatter refs:** tierRulesData (../data/tier-rules.md)
301
+ **Actions:**
302
+ 1. Load tier-rules.md for capability descriptions
303
+ 2. Display forge status report:
304
+ - Detected tier with positive capability framing (from tier-rules.md)
305
+ - Tool availability summary (versions detected)
306
+ - If re-run: report tier change (upgrade/downgrade/same) with what changed
307
+ 3. If --update-spec flag present:
308
+ - Fetch latest agentskills.io schema via gh/curl
309
+ - Store in forge-data/
310
+ 4. Final summary: "Forge ready. [Tier] tier active."
311
+
312
+ **Error handling:** --update-spec fetch failure → warn but don't fail.
313
+
314
+ ### Data Flow
315
+
316
+ ```
317
+ step-01 ──→ step-02 ──→ step-03 ──→ step-04
318
+ │ │ │ │
319
+ │reads: │reads: │reads: │reads:
320
+ │ tier-rules │ context │ context │ tier-rules
321
+ │ forge-tier │ │ │ context
322
+ │ prefs │writes: │writes: │
323
+ │ │ forge-tier │ QMD index │displays:
324
+ │sets: │ prefs │ (Deep) │ report
325
+ │ tools │ forge-data/│ │
326
+ │ tier │ │ │fetches:
327
+ │ prev_tier │ │ │ spec (opt)
328
+ ```
329
+
330
+ ### Interaction Pattern
331
+ - All steps: Auto-proceed (Menu Pattern 3)
332
+ - Zero user interaction during execution
333
+ - Report step is display-only output
334
+
335
+ ### Role and Persona
336
+ - Ferris agent, prescriptive system task execution
337
+ - Forge metaphor used briefly in final report only
338
+ - No collaborative dialogue, no questions asked
339
+
340
+ ### Validation and Error Handling
341
+ - Tool command failures → not errors, record as unavailable
342
+ - File write failures → real errors, halt and report
343
+ - QMD index failures → degrade gracefully, log for retry
344
+ - Invalid tier_override → ignore, use detected tier, warn in report
345
+
346
+ ### Special Features
347
+ - Conditional logic in step-03 (Deep-only indexing)
348
+ - Re-run detection via existing forge-tier.yaml comparison
349
+ - No input discovery (first workflow, no dependencies)
350
+ - Upstream of ALL other SKF workflows (produces forge-tier.yaml)
351
+
352
+ ### Subprocess Optimization
353
+ - Not applicable — simple sequential operations, no parallel analysis needed
354
+
355
+ ---
356
+
357
+ ## Foundation Build Complete
358
+
359
+ **Created:**
360
+ - Folder structure at: `_bmad-output/bmb-creations/workflows/setup-forge/`
361
+ - `workflow.md` — entry point with auto-proceed architecture, SKF config loading
362
+ - `data/tier-rules.md` — tier calculation rules, capability descriptions, re-run messages
363
+ - `steps-c/` directory — ready for step files
364
+
365
+ **Configuration:**
366
+ - Workflow name: setup-forge
367
+ - Continuable: no
368
+ - Document output: no (non-document, action-based)
369
+ - Mode: create-only
370
+ - Output template: none (non-document workflow)
371
+
372
+ **Next Steps:**
373
+ - Step 8: Build step-01-detect-and-tier.md
374
+ - Step 9: Build remaining steps (02, 03, 04)
375
+
376
+ ---
377
+
378
+ ## Step 01 Build Complete
379
+
380
+ **Created:**
381
+ - steps-c/step-01-detect-and-tier.md
382
+
383
+ **Step Configuration:**
384
+ - Type: Init (Non-Continuable)
385
+ - Input Discovery: No
386
+ - Menu: Auto-proceed (Pattern 3)
387
+ - Next Step: step-02-write-config.md
388
+ - No step-01b needed (single-session)
389
+
390
+ **Supporting Files:**
391
+ - data/tier-rules.md (created in foundation step)
392
+
393
+ ---
394
+
395
+ ## Step 02 Build Complete
396
+
397
+ **Created:**
398
+ - steps-c/step-02-write-config.md
399
+
400
+ **Step Configuration:**
401
+ - Type: Middle (Simple)
402
+ - Menu: Auto-proceed (Pattern 3)
403
+ - Next Step: step-03-auto-index.md
404
+
405
+ ---
406
+
407
+ ## Step 03 Build Complete
408
+
409
+ **Created:**
410
+ - steps-c/step-03-auto-index.md
411
+
412
+ **Step Configuration:**
413
+ - Type: Middle (Simple + Conditional)
414
+ - Menu: Auto-proceed (Pattern 3)
415
+ - Conditional: Deep tier → QMD indexing, other tiers → silent skip
416
+ - Next Step: step-04-report.md
417
+
418
+ ---
419
+
420
+ ## Step 04 Build Complete
421
+
422
+ **Created:**
423
+ - steps-c/step-04-report.md
424
+
425
+ **Step Configuration:**
426
+ - Type: Final Step
427
+ - Menu: None (workflow ends)
428
+ - References: data/tier-rules.md for capability descriptions
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: setup-forge
3
+ description: Initialize forge environment, detect tools, set tier, auto-index project
4
+ web_bundle: true
5
+ ---
6
+
7
+ # Setup Forge
8
+
9
+ **Goal:** Initialize the forge environment by detecting available tools, determining the capability tier (Quick/Forge/Deep), writing persistent configuration, and optionally indexing the project for deep search.
10
+
11
+ **Your Role:** You are a system executor performing environment resolution. This is a fully autonomous workflow — no user interaction is required during execution. Run each step in sequence, write configuration files, and report results at completion.
12
+
13
+ ## WORKFLOW ARCHITECTURE
14
+
15
+ ### Core Principles
16
+
17
+ - **Micro-file Design**: Each step of the overall goal is a self contained instruction file that you will adhere too 1 file as directed at a time
18
+ - **Just-In-Time Loading**: Only 1 current step file will be loaded, read, and executed to completion - never load future step files until told to do so
19
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
20
+ - **Fully Autonomous**: All steps auto-proceed with no user interaction until the final report
21
+
22
+ ### Step Processing Rules
23
+
24
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
25
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
26
+ 3. **AUTO-PROCEED**: Each step proceeds to the next automatically after completion
27
+ 4. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
28
+
29
+ ### Critical Rules (NO EXCEPTIONS)
30
+
31
+ - 🛑 **NEVER** load multiple step files simultaneously
32
+ - 📖 **ALWAYS** read entire step file before execution
33
+ - 🚫 **NEVER** skip steps or optimize the sequence
34
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
35
+ - 📋 **NEVER** create mental todo lists from future steps
36
+
37
+ ---
38
+
39
+ ## INITIALIZATION SEQUENCE
40
+
41
+ ### 1. Module Configuration Loading
42
+
43
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
44
+
45
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
46
+
47
+ ### 2. First Step Execution
48
+
49
+ Load, read the full file and then execute ./steps-c/step-01-detect-and-tier.md to begin the workflow.
@@ -0,0 +1,96 @@
1
+ # Output Section Formats
2
+
3
+ ## Coherence Analysis — Naive Mode
4
+
5
+ ```markdown
6
+ ## Coherence Analysis
7
+
8
+ **Mode:** Naive (structural validation only)
9
+ **Coherence category:** Not scored (weight redistributed)
10
+
11
+ ### Structural Findings
12
+
13
+ | # | Type | Detail | Line |
14
+ |---|------|--------|------|
15
+ | {per-issue rows} |
16
+
17
+ **Structural Issues:** {count}
18
+ ```
19
+
20
+ ## Coherence Analysis — Contextual Mode
21
+
22
+ ```markdown
23
+ ## Coherence Analysis
24
+
25
+ **Mode:** Contextual (full reference validation)
26
+ **References Found:** {count}
27
+ **References Valid:** {count}
28
+ **Broken References:** {count}
29
+
30
+ ### Reference Validation
31
+
32
+ | Reference | Type | Line | Target Exists | Accurate | Issues |
33
+ |-----------|------|------|--------------|----------|--------|
34
+ | {per-reference rows} |
35
+
36
+ ### Integration Pattern Completeness
37
+
38
+ | Pattern | Complete | Issue |
39
+ |---------|----------|-------|
40
+ | {per-pattern rows} |
41
+
42
+ ### Coherence Score
43
+
44
+ - **Reference Validity:** {valid}/{total} ({percentage}%)
45
+ - **Integration Completeness:** {complete}/{total} ({percentage}%)
46
+ - **Combined Coherence:** {percentage}%
47
+ ```
48
+
49
+ ## Gap Report Section
50
+
51
+ ```markdown
52
+ ## Gap Report
53
+
54
+ **Total Gaps:** {N}
55
+ **Blocking (Critical + High):** {N}
56
+ **Non-blocking (Medium + Low + Info):** {N}
57
+
58
+ ### Remediation Summary
59
+
60
+ | Severity | Count | Estimated Effort |
61
+ |----------|-------|-----------------|
62
+ | Critical | {N} | {description} |
63
+ | High | {N} | {description} |
64
+ | Medium | {N} | {description} |
65
+ | Low | {N} | {description} |
66
+ | Info | {N} | {description} |
67
+ | **Total** | **{N}** | |
68
+ ```
69
+
70
+ ## Gap Entry Format
71
+
72
+ ```markdown
73
+ ### GAP-{NNN}: {Brief title}
74
+
75
+ **Severity:** {Critical|High|Medium|Low|Info}
76
+ **Category:** {Coverage|Coherence|Structural}
77
+ **Source:** {file:line or section reference}
78
+
79
+ **Issue:** {Precise description of what is wrong or missing}
80
+
81
+ **Remediation:** {Exact action to fix this gap}
82
+ ```
83
+
84
+ ## Remediation Quality Rules
85
+
86
+ - **Good:** "Add documentation for `formatDate(date: Date, format?: string): string` exported from `src/utils.ts:42`. Include the optional `format` parameter with default value `'YYYY-MM-DD'`."
87
+ - **Bad:** "Document the missing function."
88
+ - **Good:** "Update signature in SKILL.md line 78 from `(date: Date) => string` to `(date: Date, format?: string) => string` to match source at `src/utils.ts:42`."
89
+ - **Bad:** "Fix the signature mismatch."
90
+
91
+ ## Effort Estimation Guidelines
92
+
93
+ - Critical/High gaps: typically require reading source code and writing documentation
94
+ - Medium gaps: typically require adding type definitions or interface docs
95
+ - Low gaps: typically require adding examples or metadata
96
+ - Info: optional improvements, no action required
@@ -0,0 +1,74 @@
1
+ # Scoring Rules
2
+
3
+ ## Default Threshold
4
+
5
+ **Pass threshold:** 80%
6
+
7
+ ## Category Weights
8
+
9
+ | Category | Weight | Description |
10
+ |----------|--------|-------------|
11
+ | Export Coverage | 40% | Percentage of source exports documented in SKILL.md |
12
+ | Signature Accuracy | 25% | Documented signatures match actual source signatures |
13
+ | Type Coverage | 15% | Types and interfaces referenced are complete |
14
+ | Coherence (contextual) | 20% | Cross-references valid, integration patterns complete |
15
+ | Coherence (naive) | 0% | Not applicable — weight redistributed to other categories |
16
+
17
+ ## Naive Mode Weight Redistribution
18
+
19
+ When running in naive mode (no coherence category):
20
+ - Export Coverage: 50%
21
+ - Signature Accuracy: 30%
22
+ - Type Coverage: 20%
23
+
24
+ ## Tier-Dependent Scoring
25
+
26
+ ### Quick Tier (no tools)
27
+ - Export Coverage: file/structure existence check only
28
+ - Signature Accuracy: skipped (no AST)
29
+ - Type Coverage: skipped (no AST)
30
+ - Score based on: structural completeness only
31
+
32
+ ### Forge Tier (ast-grep)
33
+ - Export Coverage: AST-backed export comparison
34
+ - Signature Accuracy: AST-verified signature matching
35
+ - Type Coverage: AST-verified type completeness
36
+ - Full scoring formula applied
37
+
38
+ ### Deep Tier (ast-grep + gh + QMD)
39
+ - All Forge tier checks plus:
40
+ - Cross-repository reference verification
41
+ - QMD knowledge enrichment for coherence
42
+ - Full scoring formula with maximum depth
43
+
44
+ ## Score Calculation
45
+
46
+ ```
47
+ score = sum(category_weight * category_score) for each category
48
+ category_score = (items_passing / items_total) * 100
49
+ ```
50
+
51
+ ## Coherence Score Aggregation (Contextual Mode)
52
+
53
+ ```
54
+ reference_validity = (valid_references / total_references) * 100
55
+ integration_completeness = (complete_patterns / total_patterns) * 100
56
+ combined_coherence = (reference_validity * 0.6) + (integration_completeness * 0.4)
57
+ ```
58
+
59
+ If no integration patterns exist, combined coherence equals reference validity.
60
+
61
+ ## Result Determination
62
+
63
+ - score >= threshold → PASS
64
+ - score < threshold → FAIL
65
+
66
+ ## Gap Severity
67
+
68
+ | Severity | Criteria |
69
+ |----------|----------|
70
+ | Critical | Missing exported function/class documentation |
71
+ | High | Signature mismatch between source and SKILL.md |
72
+ | Medium | Missing type or interface documentation |
73
+ | Low | Missing optional metadata or examples |
74
+ | Info | Style suggestions, non-blocking observations |