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,198 @@
1
+ ---
2
+ name: 'step-05-compile'
3
+ description: 'Assemble SKILL.md, context-snippet, metadata, and references from extraction inventory'
4
+ nextStepFile: './step-06-validate.md'
5
+ skillSectionsData: '../data/skill-sections.md'
6
+ ---
7
+
8
+ # Step 5: Compile
9
+
10
+ ## STEP GOAL:
11
+
12
+ To assemble the complete skill content from the extraction inventory and enrichment annotations — building SKILL.md sections, context-snippet.md, metadata.json, and references/ content according to the agentskills.io format.
13
+
14
+ ## MANDATORY EXECUTION RULES (READ FIRST):
15
+
16
+ ### Universal Rules:
17
+
18
+ - 📖 CRITICAL: Read the complete step file before taking any action
19
+ - 🎯 ALWAYS follow the exact instructions in the step file
20
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a 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 a skill compilation engine performing structured assembly
26
+ - ✅ Every instruction in SKILL.md must trace to source code with a provenance citation
27
+ - ✅ Uncitable content is excluded, not guessed — zero hallucination
28
+
29
+ ### Step-Specific Rules:
30
+
31
+ - 🎯 Focus ONLY on assembling content from extraction inventory + enrichment
32
+ - 🚫 FORBIDDEN to include any content without a provenance citation
33
+ - 🚫 FORBIDDEN to write files — content stays in context until step-07
34
+ - 🚫 FORBIDDEN to fabricate examples not found in source tests or docs
35
+ - ⚒️ Seed `<!-- [MANUAL] -->` markers for future update-skill compatibility
36
+
37
+ ## EXECUTION PROTOCOLS:
38
+
39
+ - 🎯 Follow MANDATORY SEQUENCE exactly
40
+ - 💾 Build all content in context — do not write files
41
+ - 📖 Follow agentskills.io section structure from data file
42
+ - 🚫 Do not write any output files — that's step-07
43
+
44
+ ## CONTEXT BOUNDARIES:
45
+
46
+ - Available: extraction_inventory, enrichment_annotations (if Deep), brief_data, tier
47
+ - Focus: Assembling structured content from verified data
48
+ - Limits: Do NOT write files, validate spec compliance, or report
49
+ - Dependencies: Extraction inventory from step-03 (enrichment from step-04 if Deep)
50
+
51
+ ## MANDATORY SEQUENCE
52
+
53
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
54
+
55
+ ### 1. Load Section Structure
56
+
57
+ Load `{skillSectionsData}` completely. This defines the agentskills.io-compliant format for all output artifacts.
58
+
59
+ ### 2. Build SKILL.md Content
60
+
61
+ Assemble each section in order from the skill-sections data file:
62
+
63
+ **Frontmatter:**
64
+ ```yaml
65
+ ---
66
+ name: {brief.name}
67
+ version: {brief.version}
68
+ description: {brief.name} — {export_count} verified functions
69
+ author: {source_author}
70
+ ---
71
+ ```
72
+
73
+ **Section 1 — Overview:**
74
+ - What this skill provides
75
+ - Source repo, version, branch
76
+ - Forge tier used for compilation
77
+ - Export count and confidence summary
78
+
79
+ **Section 2 — Quick Start:**
80
+ - Select the 3-5 most commonly used functions (by import frequency or documentation prominence)
81
+ - Minimal usage examples — ONLY from source tests or official docs
82
+ - If no examples exist in source, show signature-only quick start
83
+ - Provenance citation for each function
84
+
85
+ **Section 3 — API Reference:**
86
+ - Group by module/file
87
+ - For each exported function:
88
+ - Full signature with types
89
+ - Parameters table (name, type, required/optional, description)
90
+ - Return type
91
+ - Usage example (from source tests/docs ONLY — omit if none found)
92
+ - Provenance citation: `[AST:{file}:L{line}]` or `[SRC:{file}:L{line}]`
93
+ - T2 annotations (Deep tier only): temporal context from enrichment
94
+
95
+ **Section 4 — Type Definitions:**
96
+ - All exported types, interfaces, enums
97
+ - Full type signatures with provenance citations
98
+
99
+ **Section 5 — Integration Patterns (Forge/Deep only):**
100
+ - Co-import patterns detected by ast_bridge
101
+ - Common usage combinations
102
+ - Skip for Quick tier (no co-import data available)
103
+
104
+ **Section 6 — Manual Sections:**
105
+ - Seed empty `<!-- [MANUAL] -->` markers:
106
+ ```markdown
107
+ <!-- [MANUAL:additional-notes] -->
108
+ <!-- Add custom notes here. This section is preserved during skill updates. -->
109
+ <!-- [/MANUAL:additional-notes] -->
110
+ ```
111
+ - Place after Quick Start and after API Reference sections
112
+
113
+ ### 3. Build context-snippet.md Content
114
+
115
+ Compressed 2-line format for CLAUDE.md managed section:
116
+
117
+ ```markdown
118
+ {skill-name} -> skills/{skill-name}/
119
+ exports: {comma-separated top 10 function names}
120
+ ```
121
+
122
+ ### 4. Build metadata.json Content
123
+
124
+ Following the structure from the skill-sections data file:
125
+ - Populate all fields from brief_data, extraction inventory, and tier
126
+ - Set `generated_at` to current ISO-8601 timestamp
127
+ - Set `source_commit` from resolved source (if available)
128
+ - Set `stats` from extraction aggregate counts
129
+ - Set `tool_versions` based on tier and available tools
130
+
131
+ ### 5. Build references/ Content
132
+
133
+ Create one reference file per major function group or type:
134
+ - Full function signatures with detailed parameter descriptions
135
+ - Complete usage examples (from source only)
136
+ - Related functions cross-references
137
+ - Temporal annotations (Deep tier: T2-past, T2-future)
138
+
139
+ Group functions logically by module, file, or functional area.
140
+
141
+ ### 6. Build provenance-map.json Content
142
+
143
+ One entry per extracted claim:
144
+ - claim text
145
+ - source_file and source_line
146
+ - confidence tier (T1, T1-low, T2)
147
+ - extraction_method (ast_bridge.scan_definitions, gh_bridge.read_file, qmd_bridge.search)
148
+ - ast_node_type (if AST-extracted)
149
+
150
+ ### 7. Build evidence-report.md Content
151
+
152
+ Compilation audit trail:
153
+ - Generation date, forge tier, source info
154
+ - Tool versions used
155
+ - Extraction summary (files scanned, exports found, confidence breakdown)
156
+ - Validation results (populated in step-06)
157
+ - Warnings from extraction or enrichment
158
+
159
+ ### 8. Menu Handling Logic
160
+
161
+ **Auto-proceed step — no user interaction.**
162
+
163
+ After all content is assembled in context, immediately load, read entire file, then execute `{nextStepFile}`.
164
+
165
+ #### EXECUTION RULES:
166
+
167
+ - This is an auto-proceed assembly step with no user choices
168
+ - All content stays in context — no files are written yet
169
+ - Proceed directly to validation after assembly is complete
170
+
171
+ ## CRITICAL STEP COMPLETION NOTE
172
+
173
+ ONLY WHEN all 7 content artifacts (SKILL.md, context-snippet.md, metadata.json, references/, provenance-map.json, evidence-report.md, extraction-rules.yaml) are assembled in context will you proceed to load `{nextStepFile}` for spec validation.
174
+
175
+ ---
176
+
177
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
178
+
179
+ ### ✅ SUCCESS:
180
+
181
+ - Skill-sections data file loaded and followed
182
+ - SKILL.md assembled with all required sections in agentskills.io format
183
+ - Every function entry has a provenance citation
184
+ - [MANUAL] markers seeded for update-skill compatibility
185
+ - context-snippet.md, metadata.json, references/, provenance-map.json, evidence-report.md all assembled
186
+ - No content without provenance citations included
187
+ - Auto-proceeded to step-06
188
+
189
+ ### ❌ SYSTEM FAILURE:
190
+
191
+ - Including functions or examples without provenance citations
192
+ - Fabricating usage examples not found in source
193
+ - Writing files to disk (that's step-07)
194
+ - Missing required SKILL.md sections
195
+ - Not seeding [MANUAL] markers
196
+ - Not building all 7 content artifacts
197
+
198
+ **Master Rule:** Zero hallucination — every line of SKILL.md must trace to source code. Compile from data, not imagination.
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: 'step-06-validate'
3
+ description: 'Validate compiled skill content against agentskills.io spec via skills_ref'
4
+ nextStepFile: './step-07-generate-artifacts.md'
5
+ ---
6
+
7
+ # Step 6: Validate
8
+
9
+ ## STEP GOAL:
10
+
11
+ To validate the compiled SKILL.md content against the agentskills.io specification using skills_ref, auto-fix any validation failures, and confirm spec compliance before artifact generation.
12
+
13
+ ## MANDATORY EXECUTION RULES (READ FIRST):
14
+
15
+ ### Universal Rules:
16
+
17
+ - 📖 CRITICAL: Read the complete step file before taking any action
18
+ - 🎯 ALWAYS follow the exact instructions in the step file
19
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a 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 a skill compilation engine performing quality assurance
25
+ - ✅ Validation ensures spec compliance — it does not modify content semantics
26
+ - ✅ Tool unavailability means skip validation, not halt workflow
27
+
28
+ ### Step-Specific Rules:
29
+
30
+ - 🎯 Focus ONLY on validating compiled content against spec
31
+ - 🚫 FORBIDDEN to add new content — only fix spec compliance issues
32
+ - 🚫 FORBIDDEN to write files — content stays in context until step-07
33
+ - 💬 If auto-fix fails, report issues clearly but proceed (warn, don't halt)
34
+ - ⚙️ If skills_ref unavailable: skip validation, add warning to evidence report
35
+
36
+ ## EXECUTION PROTOCOLS:
37
+
38
+ - 🎯 Follow MANDATORY SEQUENCE exactly
39
+ - 💾 Validation results are added to evidence-report content in context
40
+ - 📖 Auto-fix pattern: validate → fix → re-validate (once)
41
+ - 🚫 Maximum one auto-fix attempt per validation failure
42
+
43
+ ## CONTEXT BOUNDARIES:
44
+
45
+ - Available: All compiled content from step-05 (SKILL.md, metadata.json, etc.)
46
+ - Focus: Spec compliance validation and auto-fix
47
+ - Limits: Do NOT add new content or modify extraction data
48
+ - Dependencies: Compiled content must exist from step-05
49
+
50
+ ## MANDATORY SEQUENCE
51
+
52
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
53
+
54
+ ### 1. Check Tool Availability
55
+
56
+ **If skills_ref tool is available:**
57
+ Continue to validation steps.
58
+
59
+ **If skills_ref tool is NOT available:**
60
+ - Add warning to evidence-report content: "Spec validation skipped — skills_ref tool unavailable"
61
+ - Auto-proceed to next step
62
+
63
+ ### 2. Validate Schema
64
+
65
+ Use `skills_ref.validate_schema()` against the compiled SKILL.md content.
66
+
67
+ **Check:**
68
+ - Required sections present (Overview, Quick Start, API Reference, Type Definitions)
69
+ - Section order follows agentskills.io standard
70
+ - Frontmatter contains required fields (name, version, description, author)
71
+ - Provenance citations present in API Reference entries
72
+
73
+ **If validation passes:** Record "Schema: PASS" in evidence-report content.
74
+
75
+ **If validation fails:**
76
+ 1. Identify specific failures
77
+ 2. Attempt auto-fix (structural adjustments only — never invent content)
78
+ 3. Re-validate once
79
+ 4. If still failing: record "Schema: FAIL — {specific issues}" in evidence-report, add warnings, but proceed
80
+
81
+ ### 3. Validate Frontmatter
82
+
83
+ Use `skills_ref.validate_frontmatter()` against the SKILL.md frontmatter.
84
+
85
+ **Check:**
86
+ - `name` matches brief.name (kebab-case)
87
+ - `version` matches brief.version
88
+ - `description` follows format: "{name} — {count} verified functions"
89
+ - `author` is set
90
+
91
+ **If validation passes:** Record "Frontmatter: PASS" in evidence-report content.
92
+
93
+ **If validation fails:**
94
+ 1. Auto-fix frontmatter (these are deterministic fixes)
95
+ 2. Re-validate once
96
+ 3. Record result in evidence-report
97
+
98
+ ### 4. Validate metadata.json
99
+
100
+ Cross-check metadata.json content against extraction inventory:
101
+ - `stats.exports_documented` matches actual documented exports
102
+ - `stats.exports_total` matches total extracted exports
103
+ - `stats.coverage` is accurate (documented / total)
104
+ - `confidence_t1`, `confidence_t2`, `confidence_t3` match actual counts
105
+ - `spec_version` is "1.3"
106
+
107
+ Auto-fix any discrepancies (these are computed values).
108
+
109
+ ### 5. Update Evidence Report
110
+
111
+ Add validation results to the evidence-report content in context:
112
+
113
+ ```markdown
114
+ ## Validation Results
115
+ - Schema: {pass/fail}
116
+ - Frontmatter: {pass/fail}
117
+ - Metadata: {pass/fail}
118
+
119
+ ## Warnings
120
+ - {any warnings from validation}
121
+ ```
122
+
123
+ ### 6. Menu Handling Logic
124
+
125
+ **Auto-proceed step — no user interaction.**
126
+
127
+ After validation is complete (or skipped if tools unavailable), immediately load, read entire file, then execute `{nextStepFile}`.
128
+
129
+ #### EXECUTION RULES:
130
+
131
+ - This is an auto-proceed validation step with no user choices
132
+ - Tool unavailability is a skip, not a halt
133
+ - Validation failures are warnings — proceed to artifact generation
134
+ - Proceed directly to next step after validation completes
135
+
136
+ ## CRITICAL STEP COMPLETION NOTE
137
+
138
+ ONLY WHEN validation is complete (or skipped) and evidence-report content is updated will you proceed to load `{nextStepFile}` for artifact generation.
139
+
140
+ ---
141
+
142
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
143
+
144
+ ### ✅ SUCCESS:
145
+
146
+ - Schema validation attempted (or skipped with warning if tool unavailable)
147
+ - Frontmatter validation attempted
148
+ - Metadata cross-check performed
149
+ - Auto-fix applied for deterministic failures
150
+ - Evidence report updated with validation results
151
+ - Warnings recorded for any failures
152
+ - Auto-proceeded to step-07
153
+
154
+ ### ❌ SYSTEM FAILURE:
155
+
156
+ - Halting the workflow on validation failure (should warn and proceed)
157
+ - Halting on skills_ref unavailability (should skip with warning)
158
+ - Adding new content during validation (only structural fixes allowed)
159
+ - Not recording validation results in evidence report
160
+ - Attempting more than one auto-fix cycle per failure
161
+
162
+ **Master Rule:** Validation informs, it does not block. Record results, fix what's deterministic, warn about the rest, and proceed.
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: 'step-07-generate-artifacts'
3
+ description: 'Write all output files — 4 deliverables to skills/ and 3 workspace artifacts to forge-data/'
4
+ nextStepFile: './step-08-report.md'
5
+ ---
6
+
7
+ # Step 7: Generate Artifacts
8
+
9
+ ## STEP GOAL:
10
+
11
+ To write all compiled content to disk — 4 deliverable files to `skills/{name}/` and 3 workspace artifacts to `forge-data/{name}/`, creating directories as needed.
12
+
13
+ ## MANDATORY EXECUTION RULES (READ FIRST):
14
+
15
+ ### Universal Rules:
16
+
17
+ - 📖 CRITICAL: Read the complete step file before taking any action
18
+ - 🎯 ALWAYS follow the exact instructions in the step file
19
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a 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 a skill compilation engine performing artifact generation
25
+ - ✅ All content was assembled in step-05 and validated in step-06
26
+ - ✅ This step ONLY writes — it does not modify, compile, or validate content
27
+
28
+ ### Step-Specific Rules:
29
+
30
+ - 🎯 Focus ONLY on writing files from the compiled content in context
31
+ - 🚫 FORBIDDEN to modify content during writing — write exactly what was compiled
32
+ - 🚫 FORBIDDEN to skip any artifact — all 7 files must be written
33
+ - 💬 Report each file written with its path
34
+ - 📁 Create directories before writing files
35
+
36
+ ## EXECUTION PROTOCOLS:
37
+
38
+ - 🎯 Follow MANDATORY SEQUENCE exactly
39
+ - 💾 Write files using the compiled content from context
40
+ - 📖 Create directory structure first, then write files
41
+ - 🚫 Halt with error if a file write fails — do not continue with partial output
42
+
43
+ ## CONTEXT BOUNDARIES:
44
+
45
+ - Available: All compiled content from step-05, validation results from step-06
46
+ - Focus: File system operations — create directories, write files
47
+ - Limits: Do NOT modify content during writing
48
+ - Dependencies: All content must be compiled and validated in context
49
+
50
+ ## MANDATORY SEQUENCE
51
+
52
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
53
+
54
+ ### 1. Create Directory Structure
55
+
56
+ Create the following directories at `{project-root}/`:
57
+
58
+ ```
59
+ skills/{name}/
60
+ skills/{name}/references/
61
+ forge-data/{name}/
62
+ ```
63
+
64
+ Where `{name}` is the skill name from the brief (kebab-case).
65
+
66
+ If directories already exist, do not error — proceed with file writing (overwrites existing files).
67
+
68
+ ### 2. Write Deliverables to skills/{name}/
69
+
70
+ Write these 4 files from the compiled content:
71
+
72
+ **File 1:** `skills/{name}/SKILL.md`
73
+ - The complete compiled skill document
74
+ - agentskills.io-compliant format with all sections
75
+ - [MANUAL] markers seeded
76
+
77
+ **File 2:** `skills/{name}/context-snippet.md`
78
+ - Compressed 2-line format for CLAUDE.md integration
79
+
80
+ **File 3:** `skills/{name}/metadata.json`
81
+ - Machine-readable birth certificate with stats and provenance
82
+
83
+ **File 4:** `skills/{name}/references/*.md`
84
+ - One file per function group or type
85
+ - Progressive disclosure detail files
86
+
87
+ ### 3. Write Workspace Artifacts to forge-data/{name}/
88
+
89
+ Write these 3 files from the compiled content:
90
+
91
+ **File 5:** `forge-data/{name}/provenance-map.json`
92
+ - Per-claim source map with AST bindings and confidence tiers
93
+
94
+ **File 6:** `forge-data/{name}/evidence-report.md`
95
+ - Build artifact with extraction summary, validation results, warnings
96
+
97
+ **File 7:** `forge-data/{name}/extraction-rules.yaml`
98
+ - Language and ast-grep schema used for this extraction (for reproducibility)
99
+
100
+ ### 4. Verify Write Completion
101
+
102
+ After all files are written, verify:
103
+ - All 7 files exist at their expected paths
104
+ - List each file with its path and size
105
+
106
+ **If any write failed:**
107
+ Halt with: "Artifact generation failed: could not write `{file_path}`. Check permissions and disk space."
108
+
109
+ **If all writes succeeded:**
110
+ Display brief confirmation:
111
+
112
+ "**Artifacts generated.**
113
+
114
+ **Deliverables (skills/{name}/):**
115
+ - SKILL.md
116
+ - context-snippet.md
117
+ - metadata.json
118
+ - references/ ({reference_count} files)
119
+
120
+ **Workspace (forge-data/{name}/):**
121
+ - provenance-map.json
122
+ - evidence-report.md
123
+ - extraction-rules.yaml
124
+
125
+ Proceeding to compilation report..."
126
+
127
+ ### 5. Menu Handling Logic
128
+
129
+ **Auto-proceed step — no user interaction.**
130
+
131
+ After all artifacts are written and verified, immediately load, read entire file, then execute `{nextStepFile}`.
132
+
133
+ #### EXECUTION RULES:
134
+
135
+ - This is an auto-proceed file writing step with no user choices
136
+ - All 7 files must be written before proceeding
137
+ - File write failures are real errors — halt, do not proceed with partial output
138
+ - Proceed directly to next step after successful generation
139
+
140
+ ## CRITICAL STEP COMPLETION NOTE
141
+
142
+ ONLY WHEN all 7 artifact files are written and verified will you proceed to load `{nextStepFile}` for the compilation report.
143
+
144
+ ---
145
+
146
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
147
+
148
+ ### ✅ SUCCESS:
149
+
150
+ - Directory structure created (skills/{name}/, forge-data/{name}/)
151
+ - All 4 deliverable files written to skills/{name}/
152
+ - All 3 workspace artifact files written to forge-data/{name}/
153
+ - Write completion verified — all 7 files exist
154
+ - Brief confirmation displayed with file list
155
+ - Auto-proceeded to step-08
156
+
157
+ ### ❌ SYSTEM FAILURE:
158
+
159
+ - Modifying content during the write step
160
+ - Skipping any of the 7 required files
161
+ - Proceeding with partial output if a write fails
162
+ - Not creating directories before writing
163
+ - Not verifying all files were written
164
+
165
+ **Master Rule:** This step ONLY writes. All content was compiled and validated in previous steps. Write faithfully, verify completely.
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: 'step-08-report'
3
+ description: 'Display compilation summary with confidence tiers, suggest next steps'
4
+ ---
5
+
6
+ # Step 8: Report
7
+
8
+ ## STEP GOAL:
9
+
10
+ To display the final compilation summary — skill name, version, source, export count, confidence distribution, tier used, file list, and any warnings — and suggest next steps for the user.
11
+
12
+ ## MANDATORY EXECUTION RULES (READ FIRST):
13
+
14
+ ### Universal Rules:
15
+
16
+ - 📖 CRITICAL: Read the complete step file before taking any action
17
+ - 🎯 ALWAYS follow the exact instructions in the step file
18
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a tool you do not have access to, you MUST still achieve the outcome in your main context thread
19
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
20
+
21
+ ### Role Reinforcement:
22
+
23
+ - ✅ You are a skill compilation engine delivering the final report
24
+ - ✅ This is the completion step — celebrate the forged skill
25
+ - ✅ Positive capability framing — describe what was achieved
26
+
27
+ ### Step-Specific Rules:
28
+
29
+ - 🎯 Focus ONLY on reporting compilation results
30
+ - 🚫 FORBIDDEN to modify any files — reporting only
31
+ - 🚫 FORBIDDEN to re-run extraction or compilation
32
+ - 💬 Deliver structured report with confidence breakdown
33
+
34
+ ## EXECUTION PROTOCOLS:
35
+
36
+ - 🎯 Follow MANDATORY SEQUENCE exactly
37
+ - 💾 No file operations — display only
38
+ - 📖 This is the final step — no next step to load
39
+ - 🚫 Do not modify any output files
40
+
41
+ ## CONTEXT BOUNDARIES:
42
+
43
+ - Available: All data from previous steps — brief, extraction, enrichment, compilation, validation, artifacts
44
+ - Focus: Summarizing and reporting
45
+ - Limits: Do NOT modify files or re-run any previous step
46
+ - Dependencies: All artifacts must have been generated in step-07
47
+
48
+ ## MANDATORY SEQUENCE
49
+
50
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
51
+
52
+ ### 1. Display Forge Completion Banner
53
+
54
+ "**Skill forged: {name} v{version} — {export_count} functions, {primary_confidence} confidence.**"
55
+
56
+ Where `{primary_confidence}` is the predominant confidence tier (T1 if Forge/Deep, T1-low if Quick).
57
+
58
+ ### 2. Display Compilation Summary
59
+
60
+ "**Compilation Summary**
61
+
62
+ | Field | Value |
63
+ |-------|-------|
64
+ | **Skill** | {name} v{version} |
65
+ | **Source** | {source_repo} @ {branch} ({commit_short}) |
66
+ | **Language** | {language} |
67
+ | **Forge Tier** | {tier} — {tier_description} |
68
+ | **Files Scanned** | {file_count} |
69
+ | **Exports Documented** | {documented_count} of {total_count} ({coverage}%) |
70
+
71
+ **Confidence Distribution:**
72
+ | Tier | Count | Description |
73
+ |------|-------|-------------|
74
+ | T1 (AST) | {t1_count} | Structurally verified via ast-grep |
75
+ | T1-low (Source) | {t1_low_count} | Inferred from source reading |
76
+ | T2 (QMD) | {t2_count} | Enriched with temporal context |
77
+
78
+ **Output Files:**
79
+ - `skills/{name}/SKILL.md` — Active skill with trigger-based usage
80
+ - `skills/{name}/context-snippet.md` — Passive context for CLAUDE.md
81
+ - `skills/{name}/metadata.json` — Machine-readable birth certificate
82
+ - `skills/{name}/references/` — Progressive disclosure ({ref_count} files)
83
+ - `forge-data/{name}/provenance-map.json` — Source map with AST bindings
84
+ - `forge-data/{name}/evidence-report.md` — Build audit trail
85
+ - `forge-data/{name}/extraction-rules.yaml` — Reproducible extraction schema"
86
+
87
+ ### 3. Display Warnings (If Any)
88
+
89
+ If there were warnings from extraction, validation, or enrichment, display them:
90
+
91
+ "**Warnings:**
92
+ - {warning_1}
93
+ - {warning_2}
94
+ - ..."
95
+
96
+ If no warnings, omit this section entirely.
97
+
98
+ ### 4. Suggest Next Steps
99
+
100
+ "**Recommended next steps:**
101
+ - **[TS] Test Skill** — verify completeness and accuracy before export
102
+ - **[ES] Export Skill** — publish to your skill library or agentskills.io
103
+ - **[US] Update Skill** — edit specific sections or add manual content
104
+
105
+ To use this skill immediately, add the context snippet to your CLAUDE.md:
106
+ ```
107
+ {context_snippet_content}
108
+ ```"
109
+
110
+ ### 5. Batch Mode Status (If Applicable)
111
+
112
+ **If running in --batch mode:**
113
+
114
+ "**Batch progress:** {completed_count} of {total_count} skills compiled.
115
+
116
+ {If more remaining:} Proceeding to next brief: {next_skill_name}..."
117
+
118
+ Update sidecar checkpoint with batch progress, then loop back to step-01 for the next brief.
119
+
120
+ **If not batch mode or all batch briefs complete:**
121
+
122
+ End workflow. No further steps.
123
+
124
+ ### 6. Workflow Complete
125
+
126
+ This is the final step. No `{nextStepFile}` to load.
127
+
128
+ Display: "Forge session complete. Return to Ferris menu for further actions."
129
+
130
+ ## CRITICAL STEP COMPLETION NOTE
131
+
132
+ This is the FINAL STEP of the create-skill workflow. After displaying the compilation report and next steps, the workflow is complete. No further steps are loaded.
133
+
134
+ For batch mode: loop back to step-01 for remaining briefs via sidecar checkpoint.
135
+
136
+ ---
137
+
138
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
139
+
140
+ ### ✅ SUCCESS:
141
+
142
+ - Forge completion banner displayed with skill name, version, export count
143
+ - Full compilation summary with confidence distribution
144
+ - All output file paths listed
145
+ - Warnings displayed (if any)
146
+ - Next steps suggested (test-skill, export-skill, update-skill)
147
+ - Context snippet provided for immediate use
148
+ - Batch progress updated (if applicable)
149
+ - Workflow ended gracefully
150
+
151
+ ### ❌ SYSTEM FAILURE:
152
+
153
+ - Not displaying the forge completion banner
154
+ - Missing confidence distribution in summary
155
+ - Modifying any files during the report step
156
+ - Not listing all output file paths
157
+ - Not suggesting next steps
158
+ - Not ending the workflow (attempting to load nonexistent next step)
159
+
160
+ **Master Rule:** This step reports and celebrates. It does not modify, re-extract, or re-compile. The skill is forged.