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,180 @@
1
+ ---
2
+ name: 'step-04-compile'
3
+ description: 'Assemble best-effort SKILL.md, context-snippet.md, and metadata.json from extraction inventory'
4
+
5
+ nextStepFile: './step-05-validate.md'
6
+ skillTemplateData: '../data/skill-template.md'
7
+ ---
8
+
9
+ # Step 4: Compile
10
+
11
+ ## STEP GOAL:
12
+
13
+ To assemble the best-effort SKILL.md document, context-snippet.md in ADR-L two-line format, and metadata.json with `source_authority: community` from the extraction inventory. Present compiled output for review before validation.
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - 🛑 NEVER generate content without user input
20
+ - 📖 CRITICAL: Read the complete step file before taking any action
21
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
22
+ - 📋 YOU ARE A FACILITATOR, not a content generator
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 rapid skill compiler assembling output documents
28
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
+ - ✅ Best-effort quality — populate what's available, mark gaps honestly
30
+ - ✅ Follow template structure exactly from {skillTemplateData}
31
+
32
+ ### Step-Specific Rules:
33
+
34
+ - 🎯 Focus only on assembling the three output documents
35
+ - 🚫 FORBIDDEN to write files to disk — that's step-06
36
+ - 💬 Approach: Load template, populate from inventory, present for review
37
+ - 📋 Mark any sections with insufficient data as best-effort
38
+
39
+ ## EXECUTION PROTOCOLS:
40
+
41
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
42
+ - 💾 Set state: skill_content, context_snippet, metadata_json
43
+ - 📖 Load {skillTemplateData} for section structure and format specs
44
+ - 🚫 Do not write files — only assemble content in memory
45
+
46
+ ## CONTEXT BOUNDARIES:
47
+
48
+ - Previous step provided: extraction_inventory (exports, description, manifest_data, confidence)
49
+ - Also available: resolved_url, repo_name, language, scope_hint
50
+ - Focus: compilation and assembly only
51
+ - This step presents output for review — user gets a checkpoint before validation
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. Load Skill Template
58
+
59
+ Load {skillTemplateData} to understand:
60
+ - SKILL.md required and optional sections
61
+ - context-snippet.md two-line format (ADR-L)
62
+ - metadata.json field requirements
63
+
64
+ ### 2. Assemble SKILL.md
65
+
66
+ Using the template structure, populate each section from extraction_inventory:
67
+
68
+ **Required sections:**
69
+ - **Overview:** Package name, repository, language, source authority, generation date
70
+ - **Description:** From extraction_inventory.description (README-derived)
71
+ - **Key Exports:** From extraction_inventory.exports — list each with name, type, brief description
72
+ - **Usage Patterns:** From extraction_inventory.usage_patterns (README examples)
73
+
74
+ **Optional sections (include when data available):**
75
+ - **Configuration:** If configuration options were found in source
76
+ - **Dependencies:** Key dependencies from manifest
77
+ - **Notes:** Caveats, limitations, extraction confidence level
78
+
79
+ **If confidence is low:**
80
+ - Include a note: "This skill was generated with limited source data. Consider running create-skill for a more thorough compilation."
81
+
82
+ ### 3. Generate Context Snippet
83
+
84
+ Create context-snippet.md in ADR-L two-line format (~30 tokens):
85
+
86
+ ```
87
+ {skill_name}: {top-5 exports as comma-separated list}
88
+ → {skills_output_folder}/{skill_name}/SKILL.md
89
+ ```
90
+
91
+ **If fewer than 5 exports:** Use all available exports.
92
+ **If no exports:** Use key features from description instead.
93
+
94
+ ### 4. Generate Metadata JSON
95
+
96
+ Create metadata.json:
97
+
98
+ ```json
99
+ {
100
+ "name": "{repo_name}",
101
+ "version": "0.1.0",
102
+ "source_authority": "community",
103
+ "source_repo": "{resolved_url}",
104
+ "source_package": "{package_name from manifest}",
105
+ "language": "{language}",
106
+ "generated_by": "quick-skill",
107
+ "generated_date": "{current date}",
108
+ "exports_count": {number of exports found},
109
+ "confidence": "{extraction confidence}"
110
+ }
111
+ ```
112
+
113
+ ### 5. Present Compiled Output for Review
114
+
115
+ "**Compilation complete. Review before validation:**
116
+
117
+ ---
118
+
119
+ **SKILL.md Preview:**
120
+
121
+ {Display the full assembled SKILL.md content}
122
+
123
+ ---
124
+
125
+ **context-snippet.md:**
126
+
127
+ {Display the two-line snippet}
128
+
129
+ ---
130
+
131
+ **metadata.json:**
132
+
133
+ {Display the JSON}
134
+
135
+ ---
136
+
137
+ **Extraction confidence:** {confidence}
138
+ **Exports documented:** {count}
139
+
140
+ Review the output above. When ready, continue to validation."
141
+
142
+ ### 6. Present MENU OPTIONS
143
+
144
+ Display: **Select:** [C] Continue to Validation
145
+
146
+ #### Menu Handling Logic:
147
+
148
+ - IF C: Load, read entire file, then execute {nextStepFile}
149
+ - IF Any other: Help user adjust compiled output, then redisplay menu
150
+
151
+ #### EXECUTION RULES:
152
+
153
+ - ALWAYS halt and wait for user input after presenting compiled output
154
+ - ONLY proceed to validation when user selects 'C'
155
+ - User can request changes to the compiled output before proceeding
156
+
157
+ ## CRITICAL STEP COMPLETION NOTE
158
+
159
+ ONLY WHEN the user reviews the compiled output and selects 'C' will you load and read fully `{nextStepFile}` to execute validation.
160
+
161
+ ---
162
+
163
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
164
+
165
+ ### ✅ SUCCESS:
166
+
167
+ - SKILL.md assembled with all available sections populated
168
+ - context-snippet.md generated in correct two-line ADR-L format
169
+ - metadata.json generated with source_authority: community
170
+ - Compiled output presented for user review
171
+ - User confirms readiness before proceeding to validation
172
+
173
+ ### ❌ SYSTEM FAILURE:
174
+
175
+ - Writing files to disk (that's step-06)
176
+ - Skipping the review checkpoint
177
+ - Not following template structure from {skillTemplateData}
178
+ - Hallucinating exports or data not in extraction_inventory
179
+
180
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: 'step-05-validate'
3
+ description: 'Validate compiled SKILL.md, context-snippet, and metadata against agentskills.io spec'
4
+
5
+ nextStepFile: './step-06-write.md'
6
+ ---
7
+
8
+ # Step 5: Validate
9
+
10
+ ## STEP GOAL:
11
+
12
+ To validate the compiled SKILL.md, context-snippet.md, and metadata.json against the agentskills.io specification at community tier. Report any gaps or issues. This is advisory validation — issues are reported but do not block output.
13
+
14
+ ## MANDATORY EXECUTION RULES (READ FIRST):
15
+
16
+ ### Universal Rules:
17
+
18
+ - 🛑 NEVER generate content without user input
19
+ - 📖 CRITICAL: Read the complete step file before taking any action
20
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
21
+ - 📋 YOU ARE A FACILITATOR, not a content generator
22
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
23
+
24
+ ### Role Reinforcement:
25
+
26
+ - ✅ You are a rapid skill compiler performing quality checks
27
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
28
+ - ✅ Community-tier validation — lighter than official requirements
29
+ - ✅ Report issues honestly but don't block output
30
+
31
+ ### Step-Specific Rules:
32
+
33
+ - 🎯 Focus only on validating the compiled output
34
+ - 🚫 FORBIDDEN to modify the compiled content — report issues only
35
+ - 💬 Approach: Check each requirement, report findings, proceed
36
+ - 📋 Validation failures are advisory — user can proceed regardless
37
+
38
+ ## EXECUTION PROTOCOLS:
39
+
40
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
41
+ - 💾 Set state: validation_result (pass/fail, issues_list)
42
+ - 📖 Check against community-tier requirements
43
+ - 🚫 Do not block output on validation issues
44
+
45
+ ## CONTEXT BOUNDARIES:
46
+
47
+ - Previous step provided: skill_content (SKILL.md), context_snippet, metadata_json
48
+ - Focus: validation only, not modification
49
+ - Community tier has lighter requirements than official
50
+ - Dependencies: compiled output from step-04
51
+
52
+ ## MANDATORY SEQUENCE
53
+
54
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
55
+
56
+ ### 1. Validate SKILL.md Structure
57
+
58
+ Check that SKILL.md has these required sections populated:
59
+
60
+ - [ ] **Overview section** present with package name, repo, language, authority
61
+ - [ ] **Description section** present with non-empty content
62
+ - [ ] **Key Exports section** present (may be empty if confidence is low)
63
+ - [ ] **Usage Patterns section** present (may have README fallback)
64
+
65
+ **For each missing or empty required section, log an issue.**
66
+
67
+ ### 2. Validate Context Snippet Format
68
+
69
+ Check context-snippet.md format compliance:
70
+
71
+ - [ ] **Two-line format** — first line has skill name and exports, second line has path pointer
72
+ - [ ] **First line** matches pattern: `{name}: {exports list}`
73
+ - [ ] **Second line** matches pattern: ` → {path}/SKILL.md`
74
+ - [ ] **Approximate token count** is ~30 tokens or less
75
+
76
+ **If format is wrong, log an issue.**
77
+
78
+ ### 3. Validate Metadata JSON
79
+
80
+ Check metadata.json has required fields:
81
+
82
+ - [ ] `name` — present, non-empty
83
+ - [ ] `version` — present (should be "0.1.0")
84
+ - [ ] `source_authority` — must be "community"
85
+ - [ ] `source_repo` — present, valid GitHub URL
86
+ - [ ] `language` — present, non-empty
87
+ - [ ] `generated_by` — must be "quick-skill"
88
+ - [ ] `generated_date` — present
89
+ - [ ] `exports_count` — present, number
90
+ - [ ] `confidence` — present
91
+
92
+ **For each missing or invalid field, log an issue.**
93
+
94
+ ### 4. Report Validation Results
95
+
96
+ "**Validation complete:**
97
+
98
+ **SKILL.md:** {pass/issues found}
99
+ {list any issues}
100
+
101
+ **context-snippet.md:** {pass/issues found}
102
+ {list any issues}
103
+
104
+ **metadata.json:** {pass/issues found}
105
+ {list any issues}
106
+
107
+ **Overall:** {pass / N issues found}
108
+
109
+ {If issues found:}
110
+ These issues are advisory for community-tier skills. You can proceed to write output or go back to adjust.
111
+
112
+ **Proceeding to write output...**"
113
+
114
+ Set `validation_result` with pass/fail status and issues list.
115
+
116
+ ### 5. Auto-Proceed to Write
117
+
118
+ #### Menu Handling Logic:
119
+
120
+ - After validation report, immediately load, read entire file, then execute {nextStepFile}
121
+
122
+ #### EXECUTION RULES:
123
+
124
+ - This is an auto-proceed step — validation is advisory
125
+ - Proceed directly to write step after reporting results
126
+
127
+ ## CRITICAL STEP COMPLETION NOTE
128
+
129
+ ONLY WHEN validation checks are complete and results reported will you load and read fully `{nextStepFile}` to execute file writing.
130
+
131
+ ---
132
+
133
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
134
+
135
+ ### ✅ SUCCESS:
136
+
137
+ - All three outputs validated against requirements
138
+ - Issues reported clearly with specific details
139
+ - Community-tier validation applied (not official-tier strictness)
140
+ - validation_result set with pass/fail and issues list
141
+ - Auto-proceeding to write step
142
+
143
+ ### ❌ SYSTEM FAILURE:
144
+
145
+ - Modifying compiled content instead of just reporting
146
+ - Blocking output on validation issues (advisory only)
147
+ - Skipping validation checks
148
+ - Not reporting found issues
149
+
150
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: 'step-06-write'
3
+ description: 'Write output files to skills folder and display completion summary'
4
+ ---
5
+
6
+ # Step 6: Write Output
7
+
8
+ ## STEP GOAL:
9
+
10
+ To write the compiled SKILL.md, context-snippet.md, and metadata.json to the skills output folder and display a completion summary with next step recommendations.
11
+
12
+ ## MANDATORY EXECUTION RULES (READ FIRST):
13
+
14
+ ### Universal Rules:
15
+
16
+ - 🛑 NEVER generate content without user input
17
+ - 📖 CRITICAL: Read the complete step file before taking any action
18
+ - 📋 YOU ARE A FACILITATOR, not a content generator
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 rapid skill compiler delivering the final output
24
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
25
+ - ✅ Precision file writing — correct paths, correct content
26
+ - ✅ This is the final step — deliver cleanly and recommend next actions
27
+
28
+ ### Step-Specific Rules:
29
+
30
+ - 🎯 Focus only on writing files and displaying summary
31
+ - 🚫 FORBIDDEN to modify content — write exactly what was compiled
32
+ - 💬 Approach: Create directory, write files, confirm, summarize
33
+ - 📋 If write fails, hard halt with error details
34
+
35
+ ## EXECUTION PROTOCOLS:
36
+
37
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
38
+ - 💾 Write three files to {skills_output_folder}/{repo_name}/
39
+ - 📖 File I/O required for directory creation and file writing
40
+ - 🚫 This is the final step — no next step to load
41
+
42
+ ## CONTEXT BOUNDARIES:
43
+
44
+ - Previous steps provided: skill_content, context_snippet, metadata_json, validation_result
45
+ - Also available: resolved_url, repo_name, language, skills_output_folder
46
+ - Focus: file writing and completion only
47
+ - This is the FINAL step — workflow ends here
48
+
49
+ ## MANDATORY SEQUENCE
50
+
51
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
52
+
53
+ ### 1. Create Output Directory
54
+
55
+ Create the skill output directory:
56
+
57
+ ```
58
+ {skills_output_folder}/{repo_name}/
59
+ ```
60
+
61
+ If directory already exists, confirm with user before overwriting:
62
+
63
+ "**Directory `{skills_output_folder}/{repo_name}/` already exists.** Overwrite existing files? [Y/N]"
64
+
65
+ ### 2. Write SKILL.md
66
+
67
+ Write the compiled SKILL.md content to:
68
+
69
+ ```
70
+ {skills_output_folder}/{repo_name}/SKILL.md
71
+ ```
72
+
73
+ Confirm: "Written: SKILL.md"
74
+
75
+ ### 3. Write context-snippet.md
76
+
77
+ Write the context snippet to:
78
+
79
+ ```
80
+ {skills_output_folder}/{repo_name}/context-snippet.md
81
+ ```
82
+
83
+ Confirm: "Written: context-snippet.md"
84
+
85
+ ### 4. Write metadata.json
86
+
87
+ Write the metadata JSON to:
88
+
89
+ ```
90
+ {skills_output_folder}/{repo_name}/metadata.json
91
+ ```
92
+
93
+ Confirm: "Written: metadata.json"
94
+
95
+ ### 5. Handle Write Failures
96
+
97
+ **If any file write fails — HARD HALT:**
98
+
99
+ "**Write failed:** Could not write to `{file_path}`.
100
+
101
+ Error: {error details}
102
+
103
+ Please check:
104
+ - Does the output directory exist and is it writable?
105
+ - Is there sufficient disk space?
106
+ - Are there permission issues?"
107
+
108
+ ### 6. Display Completion Summary
109
+
110
+ "**Quick Skill complete.**
111
+
112
+ **Skill:** {repo_name}
113
+ **Language:** {language}
114
+ **Source:** {resolved_url}
115
+ **Authority:** community
116
+ **Confidence:** {extraction confidence}
117
+
118
+ **Files written:**
119
+ - `{skills_output_folder}/{repo_name}/SKILL.md`
120
+ - `{skills_output_folder}/{repo_name}/context-snippet.md`
121
+ - `{skills_output_folder}/{repo_name}/metadata.json`
122
+
123
+ **Exports documented:** {count}
124
+ **Validation:** {pass / N issues (advisory)}
125
+
126
+ ---
127
+
128
+ **Recommended next steps:**
129
+
130
+ 1. **test-skill** (advisory) — Run cognitive completeness verification on the generated skill
131
+ 2. **export-skill** — Package and distribute the skill with platform-aware context injection
132
+
133
+ **Note:** This is a best-effort community skill. For deeper analysis with AST-verified exports and provenance tracking, use the full **create-skill** workflow with a skill brief."
134
+
135
+ ### 7. End Workflow
136
+
137
+ This is the final step. The workflow is complete.
138
+
139
+ No next step to load. Session ends here.
140
+
141
+ ---
142
+
143
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
144
+
145
+ ### ✅ SUCCESS:
146
+
147
+ - Output directory created (or overwrite confirmed)
148
+ - All three files written successfully
149
+ - Completion summary displayed with file paths
150
+ - Next step recommendations provided
151
+ - Workflow ends cleanly
152
+
153
+ ### ❌ SYSTEM FAILURE:
154
+
155
+ - Modifying content during write (write exactly what was compiled)
156
+ - Not handling write failures with hard halt
157
+ - Not displaying completion summary
158
+ - Attempting to load a next step (this is final)
159
+
160
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.