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,249 @@
1
+ ---
2
+ name: 'step-04-coherence-check'
3
+ description: 'Validate internal consistency — references, types, and integration patterns'
4
+
5
+ nextStepFile: './step-05-score.md'
6
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
7
+ outputFormatsFile: '../data/output-section-formats.md'
8
+ ---
9
+
10
+ # Step 4: Coherence Check
11
+
12
+ ## STEP GOAL:
13
+
14
+ Validate internal consistency of the skill documentation. In contextual mode (stack skills): verify that all cross-references in SKILL.md point to real files, types match their declarations, and integration patterns are complete. In naive mode (individual skills): perform basic structural validation only.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 🛑 NEVER fabricate references or claim files exist without verifying — zero hallucination
21
+ - 📖 CRITICAL: Read the complete step file before taking any action
22
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
23
+ - ⚙️ 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
24
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
25
+
26
+ ### Role Reinforcement:
27
+
28
+ - ✅ You are a skill auditor in Ferris's Audit mode — zero hallucination
29
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
30
+ - ✅ Every broken reference must cite exactly what was referenced and where it was expected
31
+ - ✅ Report structural facts — do not interpret or editorialize
32
+
33
+ ### Step-Specific Rules:
34
+
35
+ - 🎯 Use subprocess optimization: Pattern 1 (grep for references across files), Pattern 2 (per-reference deep validation)
36
+ - 💬 Subprocess returns structured findings only, not full file contents
37
+ - 🚫 DO NOT BE LAZY — For EACH reference in contextual mode, launch a subprocess to validate the target
38
+ - ⚙️ If subprocess unavailable, perform validation in main thread sequentially
39
+ - 📋 Analysis depth is conditional on testMode (naive vs contextual)
40
+
41
+ ## EXECUTION PROTOCOLS:
42
+
43
+ - 🎯 Check testMode from output frontmatter to determine analysis depth
44
+ - 💾 Append Coherence Analysis section to {outputFile}
45
+ - 📖 Update stepsCompleted in {outputFile}
46
+ - 🚫 FORBIDDEN to skip coherence check entirely — even naive mode runs basic structural validation
47
+
48
+ ## CONTEXT BOUNDARIES:
49
+
50
+ - Available: SKILL.md, source files, testMode, forge tier, coverage results from step 03
51
+ - Focus: Internal consistency and reference validation only — coverage was step 03
52
+ - Limits: Do NOT recalculate coverage scores — use results from step 03
53
+ - Dependencies: step-03 must have completed coverage analysis
54
+
55
+ ## MANDATORY SEQUENCE
56
+
57
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
58
+
59
+ ### 1. Check Test Mode
60
+
61
+ Read `testMode` from `{outputFile}` frontmatter.
62
+
63
+ **IF naive mode → Execute Naive Coherence (Section 2)**
64
+ **IF contextual mode → Execute Contextual Coherence (Sections 3-5)**
65
+
66
+ ### 2. Naive Mode: Basic Structural Validation
67
+
68
+ Perform lightweight structural checks:
69
+
70
+ **Document structure:**
71
+ - SKILL.md has required top-level sections (description, exports, usage)
72
+ - Section headers are properly formatted
73
+ - Code examples have language annotations
74
+ - No broken markdown (unclosed code blocks, malformed tables)
75
+
76
+ **Internal consistency:**
77
+ - Exports referenced in usage examples match exports listed in exports section
78
+ - Type names used in examples match documented types
79
+ - No self-contradictions (e.g., function described as async but shown sync in example)
80
+
81
+ Build a simple structural findings list:
82
+
83
+ ```json
84
+ {
85
+ "structural_issues": [
86
+ {"type": "missing_section", "detail": "No 'Usage' section found"},
87
+ {"type": "broken_example", "detail": "Line 42: references undeclared function 'getConfig'"}
88
+ ],
89
+ "issues_found": 2
90
+ }
91
+ ```
92
+
93
+ **After naive coherence → Skip to Section 6 (Append Results)**
94
+
95
+ ### 3. Contextual Mode: Extract References
96
+
97
+ Scan SKILL.md for all cross-references:
98
+
99
+ **Reference types to extract:**
100
+ - File path references (`./path/to/file.ts`, `../shared/types.ts`)
101
+ - Skill references (`See SKILL.md for {other-skill}`, `Integrates with {package}`)
102
+ - Type imports (`import { Type } from './module'`)
103
+ - Integration pattern references (middleware chains, plugin hooks, shared state)
104
+
105
+ Launch a subprocess that:
106
+ 1. Runs grep/regex across SKILL.md for reference patterns (file paths, import statements, skill names)
107
+ 2. Returns all found references with their line numbers
108
+
109
+ ```json
110
+ {
111
+ "references_found": [
112
+ {"line": 15, "type": "file_path", "target": "./shared/types.ts"},
113
+ {"line": 42, "type": "skill_ref", "target": "auth-skill"},
114
+ {"line": 78, "type": "type_import", "target": "SharedConfig from ./config"}
115
+ ],
116
+ "total_references": 3
117
+ }
118
+ ```
119
+
120
+ If subprocess unavailable, scan SKILL.md in main thread.
121
+
122
+ ### 4. Contextual Mode: Validate Each Reference
123
+
124
+ DO NOT BE LAZY — For EACH reference found, launch a subprocess that:
125
+
126
+ 1. Checks if the target exists (file exists, skill exists, type is declared)
127
+ 2. If target exists, validates the reference is accurate:
128
+ - File path references: file exists at specified path
129
+ - Type imports: type is actually exported from the referenced module
130
+ - Skill references: referenced skill exists in skills output folder
131
+ - Integration patterns: documented pattern matches actual implementation
132
+ 3. Returns structured validation:
133
+
134
+ ```json
135
+ {
136
+ "reference": "./shared/types.ts",
137
+ "line": 15,
138
+ "target_exists": true,
139
+ "type_match": true,
140
+ "signature_match": true,
141
+ "issues": []
142
+ }
143
+ ```
144
+
145
+ Or for failures:
146
+
147
+ ```json
148
+ {
149
+ "reference": "auth-skill",
150
+ "line": 42,
151
+ "target_exists": false,
152
+ "issues": ["Referenced skill 'auth-skill' not found in skills output folder"]
153
+ }
154
+ ```
155
+
156
+ If subprocess unavailable, validate each reference in main thread.
157
+
158
+ ### 5. Contextual Mode: Check Integration Pattern Completeness
159
+
160
+ For stack skills, verify integration patterns are complete:
161
+
162
+ - **All documented integration points have corresponding code examples**
163
+ - **Shared types are consistently used across referenced components**
164
+ - **Middleware/plugin chains show complete flow, not fragments**
165
+ - **Event handlers reference valid event types**
166
+
167
+ Build integration completeness findings:
168
+
169
+ ```json
170
+ {
171
+ "patterns_documented": 5,
172
+ "patterns_complete": 4,
173
+ "incomplete_patterns": [
174
+ {
175
+ "pattern": "Auth middleware chain",
176
+ "issue": "Shows middleware registration but not the handler function signature",
177
+ "line": 95
178
+ }
179
+ ]
180
+ }
181
+ ```
182
+
183
+ ### 6. Append Coherence Analysis to Output
184
+
185
+ Load `{outputFormatsFile}` and use the appropriate Coherence Analysis section format (naive or contextual) to append findings to `{outputFile}`.
186
+
187
+ ### 7. Report Coherence Results
188
+
189
+ **For Naive Mode:**
190
+ "**Coherence check complete (naive mode).**
191
+
192
+ Basic structural validation of **{skill_name}**:
193
+ - {N} structural issues found
194
+ - Coherence category not scored (weight redistributed to coverage)
195
+
196
+ **Proceeding to scoring...**"
197
+
198
+ **For Contextual Mode:**
199
+ "**Coherence check complete (contextual mode).**
200
+
201
+ Reference validation of **{skill_name}**:
202
+ - References: {valid}/{total} valid ({percentage}%)
203
+ - Integration patterns: {complete}/{total} complete ({percentage}%)
204
+ - Combined coherence: {percentage}%
205
+
206
+ **{N} issues found** — details in Coherence Analysis section.
207
+
208
+ **Proceeding to scoring...**"
209
+
210
+ ### 8. Auto-Proceed
211
+
212
+ Display: "**Proceeding to scoring...**"
213
+
214
+ #### Menu Handling Logic:
215
+
216
+ - After coherence analysis is complete, update {outputFile} frontmatter stepsCompleted, then immediately load, read entire file, then execute {nextStepFile}
217
+
218
+ #### EXECUTION RULES:
219
+
220
+ - This is an auto-proceed validation step with no user choices
221
+ - Proceed directly to next step after coherence is analyzed
222
+
223
+ ## CRITICAL STEP COMPLETION NOTE
224
+
225
+ ONLY WHEN coherence analysis is complete (naive structural or contextual full validation), the Coherence Analysis section has been appended to {outputFile}, and coherence scores (if contextual) have been calculated, will you then load and read fully `{nextStepFile}` to execute scoring.
226
+
227
+ ---
228
+
229
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
230
+
231
+ ### ✅ SUCCESS:
232
+
233
+ - Correct mode path executed (naive structural OR contextual full)
234
+ - All references validated in contextual mode (DO NOT BE LAZY)
235
+ - Every broken reference cites exact location and expected target
236
+ - Coherence Analysis section appended to output document
237
+ - Coherence scores calculated (contextual) or weight redistribution noted (naive)
238
+ - Zero fabricated findings — all traceable to artifacts
239
+
240
+ ### ❌ SYSTEM FAILURE:
241
+
242
+ - Skipping coherence check entirely (even naive mode runs structural checks)
243
+ - Fabricating reference validation results
244
+ - Not checking every reference in contextual mode (DO NOT BE LAZY)
245
+ - Running contextual checks on a naive-mode skill (unnecessary depth)
246
+ - Running only naive checks on a contextual-mode skill (insufficient depth)
247
+ - Hardcoding paths instead of using frontmatter variables
248
+
249
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. Zero hallucination — every finding traces to artifacts.
@@ -0,0 +1,222 @@
1
+ ---
2
+ name: 'step-05-score'
3
+ description: 'Calculate completeness score from coverage and coherence findings'
4
+
5
+ nextStepFile: './step-06-report.md'
6
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
7
+ scoringRulesFile: '../data/scoring-rules.md'
8
+ ---
9
+
10
+ # Step 5: Score
11
+
12
+ ## STEP GOAL:
13
+
14
+ Calculate the overall completeness score by aggregating coverage and coherence category scores with the appropriate weight distribution (naive or contextual), apply the pass/fail threshold, and determine the test result.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 🛑 NEVER invent scores — all values must derive from step 03 and step 04 findings
21
+ - 📖 CRITICAL: Read the complete step file before taking any action
22
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
23
+ - ⚙️ 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
24
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
25
+
26
+ ### Role Reinforcement:
27
+
28
+ - ✅ You are a skill auditor in Ferris's Audit mode — zero hallucination
29
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
30
+ - ✅ Scoring is mechanical — apply the formula, report the math
31
+ - ✅ Do not editorialize on the score — facts and numbers only
32
+
33
+ ### Step-Specific Rules:
34
+
35
+ - 🎯 Focus only on score calculation — do NOT generate remediation suggestions (that's step 06)
36
+ - 🚫 FORBIDDEN to adjust scores subjectively — the formula determines the result
37
+ - 💬 Show the math: category scores, weights, weighted contributions, total
38
+ - 📋 Score must be reproducible — same inputs always produce same output
39
+
40
+ ## EXECUTION PROTOCOLS:
41
+
42
+ - 🎯 Load scoring rules and read findings from {outputFile}
43
+ - 💾 Append Completeness Score section to {outputFile}
44
+ - 📖 Update {outputFile} frontmatter with testResult, score, and stepsCompleted
45
+ - 🚫 FORBIDDEN to proceed without setting testResult to pass or fail
46
+
47
+ ## CONTEXT BOUNDARIES:
48
+
49
+ - Available: Coverage Analysis (step 03) and Coherence Analysis (step 04) in {outputFile}
50
+ - Focus: Score calculation and pass/fail determination only
51
+ - Limits: Do NOT generate gap remediation — that's step 06
52
+ - Dependencies: steps 03 and 04 must have appended their analysis sections
53
+
54
+ ## MANDATORY SEQUENCE
55
+
56
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
57
+
58
+ ### 1. Load Scoring Rules
59
+
60
+ Load `{scoringRulesFile}` to get:
61
+ - Category weights (naive vs contextual distribution)
62
+ - Default threshold (80%)
63
+ - Tier-dependent scoring adjustments
64
+ - Any custom threshold override from workflow input
65
+
66
+ ### 2. Read Category Scores from Output
67
+
68
+ Read `{outputFile}` and extract the category scores calculated in previous steps:
69
+
70
+ **From Coverage Analysis (step 03):**
71
+ - Export Coverage: {percentage}%
72
+ - Signature Accuracy: {percentage}% or N/A (Quick tier)
73
+ - Type Coverage: {percentage}% or N/A (Quick tier)
74
+
75
+ **From Coherence Analysis (step 04):**
76
+ - Combined Coherence: {percentage}% (contextual mode only)
77
+ - Or: not scored (naive mode — weight redistributed)
78
+
79
+ ### 3. Apply Weight Distribution
80
+
81
+ **Read testMode from {outputFile} frontmatter.**
82
+
83
+ **IF naive mode — use redistributed weights:**
84
+
85
+ | Category | Score | Weight | Weighted |
86
+ |----------|-------|--------|----------|
87
+ | Export Coverage | {N}% | 50% | {N * 0.50}% |
88
+ | Signature Accuracy | {N}% | 30% | {N * 0.30}% |
89
+ | Type Coverage | {N}% | 20% | {N * 0.20}% |
90
+ | **Total** | | **100%** | **{sum}%** |
91
+
92
+ **IF contextual mode — use full weights:**
93
+
94
+ | Category | Score | Weight | Weighted |
95
+ |----------|-------|--------|----------|
96
+ | Export Coverage | {N}% | 40% | {N * 0.40}% |
97
+ | Signature Accuracy | {N}% | 25% | {N * 0.25}% |
98
+ | Type Coverage | {N}% | 15% | {N * 0.15}% |
99
+ | Coherence | {N}% | 20% | {N * 0.20}% |
100
+ | **Total** | | **100%** | **{sum}%** |
101
+
102
+ **Quick tier adjustment:**
103
+ If Signature Accuracy and Type Coverage are N/A (Quick tier, no AST):
104
+ - Naive: Export Coverage gets 100% weight
105
+ - Contextual: Export Coverage 60%, Coherence 40%
106
+
107
+ ### 4. Determine Pass/Fail
108
+
109
+ ```
110
+ threshold = custom_threshold OR default_threshold (80%)
111
+ score = sum of weighted category scores
112
+
113
+ IF score >= threshold → PASS
114
+ IF score < threshold → FAIL
115
+ ```
116
+
117
+ ### 5. Determine Next Workflow Recommendation
118
+
119
+ Based on test result:
120
+
121
+ **IF PASS:**
122
+ - `nextWorkflow: 'export-skill'` — skill is ready for export
123
+
124
+ **IF FAIL:**
125
+ - `nextWorkflow: 'update-skill'` — skill needs remediation before export
126
+
127
+ ### 6. Append Completeness Score to Output
128
+
129
+ Append the **Completeness Score** section to `{outputFile}`:
130
+
131
+ ```markdown
132
+ ## Completeness Score
133
+
134
+ ### Score Breakdown
135
+
136
+ | Category | Score | Weight | Weighted |
137
+ |----------|-------|--------|----------|
138
+ | Export Coverage | {N}% | {W}% | {WS}% |
139
+ | Signature Accuracy | {N}% | {W}% | {WS}% |
140
+ | Type Coverage | {N}% | {W}% | {WS}% |
141
+ | Coherence | {N}% | {W}% | {WS}% |
142
+ | **Total** | | **100%** | **{total}%** |
143
+
144
+ ### Result
145
+
146
+ **Score:** {total}%
147
+ **Threshold:** {threshold}%
148
+ **Result:** **{PASS|FAIL}**
149
+
150
+ **Weight Distribution:** {naive (redistributed) | contextual (full)}
151
+ **Tier Adjustment:** {none | Quick tier — signature and type coverage not scored}
152
+ ```
153
+
154
+ ### 7. Update Output Frontmatter
155
+
156
+ Update `{outputFile}` frontmatter:
157
+ - `testResult: '{pass|fail}'`
158
+ - `score: '{total}%'`
159
+ - `threshold: '{threshold}%'`
160
+ - `nextWorkflow: '{export-skill|update-skill}'`
161
+ - Append `'step-05-score'` to `stepsCompleted`
162
+
163
+ ### 8. Report Score
164
+
165
+ "**Completeness score calculated.**
166
+
167
+ **{skill_name}:** **{total}%** — **{PASS|FAIL}**
168
+
169
+ | Category | Score | Weighted |
170
+ |----------|-------|----------|
171
+ | Export Coverage | {N}% | {WS}% |
172
+ | Signature Accuracy | {N}% | {WS}% |
173
+ | Type Coverage | {N}% | {WS}% |
174
+ | Coherence | {N}% | {WS}% |
175
+
176
+ **Threshold:** {threshold}%
177
+ **Recommendation:** {export-skill if pass | update-skill if fail}
178
+
179
+ **Proceeding to gap report...**"
180
+
181
+ ### 9. Auto-Proceed
182
+
183
+ Display: "**Proceeding to gap report...**"
184
+
185
+ #### Menu Handling Logic:
186
+
187
+ - After score is calculated and frontmatter updated, immediately load, read entire file, then execute {nextStepFile}
188
+
189
+ #### EXECUTION RULES:
190
+
191
+ - This is an auto-proceed scoring step with no user choices
192
+ - Proceed directly to next step after score is determined
193
+
194
+ ## CRITICAL STEP COMPLETION NOTE
195
+
196
+ ONLY WHEN the score is calculated, pass/fail is determined, the Completeness Score section is appended to {outputFile}, and frontmatter is updated with testResult and score, will you then load and read fully `{nextStepFile}` to execute gap report generation.
197
+
198
+ ---
199
+
200
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
201
+
202
+ ### ✅ SUCCESS:
203
+
204
+ - All category scores read from previous steps (not invented)
205
+ - Correct weight distribution applied (naive vs contextual)
206
+ - Tier adjustment applied if Quick tier
207
+ - Score calculated with visible math (show the formula)
208
+ - Pass/fail determined against threshold
209
+ - Completeness Score section appended to output
210
+ - Frontmatter updated with testResult, score, threshold, nextWorkflow
211
+ - Auto-proceeded to step 06
212
+
213
+ ### ❌ SYSTEM FAILURE:
214
+
215
+ - Inventing category scores not calculated in steps 03/04
216
+ - Using wrong weight distribution for the detected mode
217
+ - Not showing the math (score must be reproducible)
218
+ - Subjectively adjusting the score
219
+ - Not setting testResult in frontmatter
220
+ - Generating remediation suggestions (that's step 06)
221
+
222
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. Scoring is mechanical — apply the formula, report the math.
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: 'step-06-report'
3
+ description: 'Generate gap report with remediation suggestions and finalize test report'
4
+
5
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
6
+ scoringRulesFile: '../data/scoring-rules.md'
7
+ outputFormatsFile: '../data/output-section-formats.md'
8
+ ---
9
+
10
+ # Step 6: Gap Report
11
+
12
+ ## STEP GOAL:
13
+
14
+ Generate a detailed gap report listing every issue found during coverage and coherence analysis, assign severity to each gap, provide specific actionable remediation suggestions, and finalize the test report document. This is the final step — no next step file.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 🛑 NEVER fabricate gaps — every item must trace to findings from steps 03 and 04
21
+ - 📖 CRITICAL: Read the complete step file before taking any action
22
+ - ⚙️ 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
23
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
24
+
25
+ ### Role Reinforcement:
26
+
27
+ - ✅ You are a skill auditor in Ferris's Audit mode — zero hallucination
28
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
+ - ✅ Remediation suggestions must be specific and actionable — not vague advice
30
+ - ✅ Each gap tells the user exactly what to fix, where, and how
31
+
32
+ ### Step-Specific Rules:
33
+
34
+ - 🎯 Focus on gap enumeration, severity classification, and remediation
35
+ - 🚫 FORBIDDEN to recalculate scores — use the score from step 05
36
+ - 💬 Remediation suggestions reference specific files, exports, and line numbers
37
+ - 📋 Gaps are ordered by severity (Critical → High → Medium → Low → Info)
38
+
39
+ ## EXECUTION PROTOCOLS:
40
+
41
+ - 🎯 Read all findings from {outputFile} coverage and coherence sections
42
+ - 💾 Append Gap Report section to {outputFile}
43
+ - 📖 Update {outputFile} frontmatter: mark stepsCompleted with all steps, finalize document
44
+ - 🚫 This is the final step — no next step to load
45
+
46
+ ## CONTEXT BOUNDARIES:
47
+
48
+ - Available: Complete {outputFile} with Test Summary, Coverage Analysis, Coherence Analysis, Completeness Score
49
+ - Focus: Gap enumeration and remediation only
50
+ - Limits: Do NOT re-analyze source code — work from existing findings
51
+ - Dependencies: steps 03, 04, and 05 must have completed their sections
52
+
53
+ ## MANDATORY SEQUENCE
54
+
55
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
56
+
57
+ ### 1. Collect All Issues
58
+
59
+ Read `{outputFile}` and extract every issue found across all analysis sections:
60
+
61
+ **From Coverage Analysis (step 03):**
62
+ - Missing documentation (exports in source but not in SKILL.md)
63
+ - Signature mismatches (documented signature differs from source)
64
+ - Stale documentation (documented but no longer in source)
65
+ - Type coverage gaps (undocumented types/interfaces)
66
+
67
+ **From Coherence Analysis (step 04):**
68
+ - Broken references (file paths, skill references, type imports that don't resolve)
69
+ - Incomplete integration patterns (contextual mode)
70
+ - Structural issues (naive mode — missing sections, broken examples)
71
+
72
+ ### 2. Load Severity Rules
73
+
74
+ Load `{scoringRulesFile}` for gap severity classification:
75
+
76
+ | Severity | Criteria |
77
+ |----------|----------|
78
+ | **Critical** | Missing exported function/class documentation |
79
+ | **High** | Signature mismatch between source and SKILL.md |
80
+ | **Medium** | Missing type or interface documentation |
81
+ | **Low** | Missing optional metadata or examples |
82
+ | **Info** | Style suggestions, non-blocking observations |
83
+
84
+ ### 3. Classify and Order Gaps
85
+
86
+ Load `{outputFormatsFile}` for gap entry format and remediation quality rules.
87
+
88
+ For each issue, assign severity from `{scoringRulesFile}` and generate a specific remediation following the quality rules in `{outputFormatsFile}`. Order gaps by severity: Critical → High → Medium → Low → Info.
89
+
90
+ ### 4. Generate Remediation Summary and Append Gap Report
91
+
92
+ Load the Gap Report section format from `{outputFormatsFile}`. Count gaps by severity, estimate effort per the guidelines in `{outputFormatsFile}`, and append the complete **Gap Report** section to `{outputFile}`.
93
+
94
+ If no gaps found, append a clean pass message recommending **export-skill** workflow.
95
+
96
+ ### 5. Finalize Output Document
97
+
98
+ Update `{outputFile}` frontmatter:
99
+ - Set `stepsCompleted` to `['step-01-init', 'step-02-detect-mode', 'step-03-coverage-check', 'step-04-coherence-check', 'step-05-score', 'step-06-report']`
100
+
101
+ ### 6. Present Final Report
102
+
103
+ "**Test complete for {skill_name}.**
104
+
105
+ ---
106
+
107
+ **Result:** **{PASS|FAIL}** — **{score}%** (threshold: {threshold}%)
108
+
109
+ **Gaps Found:** {total_gaps}
110
+ - Critical: {N}
111
+ - High: {N}
112
+ - Medium: {N}
113
+ - Low: {N}
114
+ - Info: {N}
115
+
116
+ **Report saved to:** `{outputFile}`
117
+
118
+ ---
119
+
120
+ **Recommended next step:**
121
+
122
+ {IF PASS:}
123
+ **export-skill** — This skill is ready for export. Run the export-skill workflow to package it for distribution.
124
+
125
+ {IF FAIL:}
126
+ **update-skill** — This skill needs remediation. Review the gap report above and run the update-skill workflow to address the {N} blocking issues (Critical + High).
127
+
128
+ ---
129
+
130
+ **Test report finalized.**"
131
+
132
+ ### 7. Present MENU OPTIONS
133
+
134
+ Display: "**Test complete.** [C] Finish"
135
+
136
+ #### Menu Handling Logic:
137
+
138
+ - IF C: Workflow is complete. No further steps to load.
139
+ - IF Any other: help user respond, then redisplay menu
140
+
141
+ #### EXECUTION RULES:
142
+
143
+ - ALWAYS halt and wait for user input after presenting menu
144
+ - This is the final step — C ends the workflow
145
+ - User may ask questions about the report before finishing
146
+
147
+ ## CRITICAL STEP COMPLETION NOTE
148
+
149
+ This is the final step of the test-skill workflow. When the user selects C, the workflow is complete. The test report document at `{outputFile}` contains the full analysis: Test Summary, Coverage Analysis, Coherence Analysis, Completeness Score, and Gap Report.
150
+
151
+ ---
152
+
153
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
154
+
155
+ ### ✅ SUCCESS:
156
+
157
+ - Every gap traces to a finding from steps 03 or 04 (zero fabrication)
158
+ - Gaps classified by severity using scoring rules
159
+ - Gaps ordered by severity (Critical first)
160
+ - Every gap has a specific, actionable remediation suggestion
161
+ - Remediation summary with counts and effort estimates
162
+ - Output document finalized with all stepsCompleted
163
+ - Correct next workflow recommended (export-skill or update-skill)
164
+ - Report presented clearly to user
165
+
166
+ ### ❌ SYSTEM FAILURE:
167
+
168
+ - Fabricating gaps not found in analysis steps
169
+ - Vague remediation suggestions ("fix the issue", "add documentation")
170
+ - Not classifying severity
171
+ - Recalculating or modifying the score from step 05
172
+ - Not finalizing the output document frontmatter
173
+ - Missing the next workflow recommendation
174
+
175
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. Every gap is specific, every remediation is actionable.
@@ -0,0 +1,24 @@
1
+ ---
2
+ workflowType: 'test-skill'
3
+ skillName: ''
4
+ testMode: ''
5
+ forgeTier: ''
6
+ testResult: ''
7
+ score: ''
8
+ threshold: ''
9
+ testDate: ''
10
+ stepsCompleted: []
11
+ nextWorkflow: ''
12
+ ---
13
+
14
+ # Test Report: {{skillName}}
15
+
16
+ ## Test Summary
17
+
18
+ ## Coverage Analysis
19
+
20
+ ## Coherence Analysis
21
+
22
+ ## Completeness Score
23
+
24
+ ## Gap Report