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.
- package/.nvmrc +1 -0
- package/LICENSE +26 -0
- package/README.md +213 -0
- package/docs/404.md +20 -0
- package/docs/agents.md +73 -0
- package/docs/architecture.md +301 -0
- package/docs/examples.md +144 -0
- package/docs/getting-started.md +198 -0
- package/docs/index.md +75 -0
- package/docs/workflows.md +190 -0
- package/package.json +109 -0
- package/src/agents/forger.agent.yaml +93 -0
- package/src/forger/README.md +17 -0
- package/src/forger/forge-tier.yaml +13 -0
- package/src/forger/preferences.yaml +10 -0
- package/src/knowledge/agentskills-spec.md +158 -0
- package/src/knowledge/confidence-tiers.md +153 -0
- package/src/knowledge/manual-section-integrity.md +156 -0
- package/src/knowledge/overview.md +56 -0
- package/src/knowledge/progressive-capability.md +120 -0
- package/src/knowledge/provenance-tracking.md +163 -0
- package/src/knowledge/skf-knowledge-index.csv +9 -0
- package/src/knowledge/skill-lifecycle.md +150 -0
- package/src/knowledge/zero-hallucination.md +101 -0
- package/src/module-help.csv +12 -0
- package/src/module.yaml +22 -0
- package/src/workflows/README.md +148 -0
- package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
- package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
- package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
- package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
- package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
- package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
- package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
- package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
- package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
- package/src/workflows/analyze-source/validation-report.md +657 -0
- package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
- package/src/workflows/analyze-source/workflow.md +61 -0
- package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
- package/src/workflows/audit-skill/data/severity-rules.md +52 -0
- package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
- package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
- package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
- package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
- package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
- package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
- package/src/workflows/audit-skill/validation-report.md +545 -0
- package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
- package/src/workflows/audit-skill/workflow.md +63 -0
- package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
- package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
- package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
- package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
- package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
- package/src/workflows/brief-skill/validation-report.md +630 -0
- package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
- package/src/workflows/brief-skill/workflow.md +57 -0
- package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
- package/src/workflows/create-skill/data/skill-sections.md +166 -0
- package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
- package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
- package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
- package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
- package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
- package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
- package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
- package/src/workflows/create-skill/validation-report.md +189 -0
- package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
- package/src/workflows/create-skill/workflow.md +52 -0
- package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
- package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
- package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
- package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
- package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
- package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
- package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
- package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
- package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
- package/src/workflows/create-stack-skill/validation-report.md +401 -0
- package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
- package/src/workflows/create-stack-skill/workflow.md +59 -0
- package/src/workflows/export-skill/data/managed-section-format.md +70 -0
- package/src/workflows/export-skill/data/snippet-format.md +32 -0
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
- package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
- package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
- package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
- package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
- package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
- package/src/workflows/export-skill/validation-report.md +263 -0
- package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
- package/src/workflows/export-skill/workflow.md +56 -0
- package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
- package/src/workflows/quick-skill/data/skill-template.md +66 -0
- package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
- package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
- package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
- package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
- package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
- package/src/workflows/quick-skill/validation-report.md +543 -0
- package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
- package/src/workflows/quick-skill/workflow.md +56 -0
- package/src/workflows/setup-forge/data/tier-rules.md +50 -0
- package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
- package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
- package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
- package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
- package/src/workflows/setup-forge/validation-report.md +504 -0
- package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
- package/src/workflows/setup-forge/workflow.md +49 -0
- package/src/workflows/test-skill/data/output-section-formats.md +96 -0
- package/src/workflows/test-skill/data/scoring-rules.md +74 -0
- package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
- package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
- package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
- package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
- package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
- package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
- package/src/workflows/test-skill/templates/test-report-template.md +24 -0
- package/src/workflows/test-skill/validation-report.md +390 -0
- package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
- package/src/workflows/test-skill/workflow.md +57 -0
- package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
- package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
- package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
- package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
- package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
- package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
- package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
- package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
- package/src/workflows/update-skill/validation-report.md +559 -0
- package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
- package/src/workflows/update-skill/workflow.md +56 -0
- package/tools/cli/commands/install.js +33 -0
- package/tools/cli/commands/status.js +195 -0
- package/tools/cli/commands/uninstall.js +226 -0
- package/tools/cli/commands/update.js +63 -0
- package/tools/cli/lib/compiler.js +306 -0
- package/tools/cli/lib/ide-commands.js +244 -0
- package/tools/cli/lib/installer.js +307 -0
- package/tools/cli/lib/manifest.js +109 -0
- package/tools/cli/lib/ui.js +277 -0
- package/tools/cli/lib/version-check.js +86 -0
- package/tools/cli/skf-cli.js +45 -0
- package/tools/skf-npx-wrapper.js +36 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-01-load-skill'
|
|
3
|
+
description: 'Load skill artifacts and validate spec compliance before export'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-02-package.md'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 1: Load Skill
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
To load the target skill's artifacts, validate they meet agentskills.io spec compliance, parse export flags, and confirm with the user before proceeding to packaging.
|
|
13
|
+
|
|
14
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
15
|
+
|
|
16
|
+
### Universal Rules:
|
|
17
|
+
|
|
18
|
+
- 🛑 NEVER proceed without user confirmation of the loaded skill
|
|
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
|
+
- ⚙️ 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
|
|
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 delivery and packaging specialist in Ferris Delivery mode
|
|
27
|
+
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
|
|
28
|
+
- ✅ Precise and efficient — validate thoroughly, report clearly
|
|
29
|
+
- ✅ User brings the skill path and export preferences
|
|
30
|
+
|
|
31
|
+
### Step-Specific Rules:
|
|
32
|
+
|
|
33
|
+
- 🎯 Focus only on loading, validating, and confirming the skill
|
|
34
|
+
- 🚫 FORBIDDEN to modify any skill files — this is read-only
|
|
35
|
+
- 🚫 FORBIDDEN to write any output files yet — packaging starts in step-02
|
|
36
|
+
- 💬 Present a clear summary of what was found for user confirmation
|
|
37
|
+
|
|
38
|
+
## EXECUTION PROTOCOLS:
|
|
39
|
+
|
|
40
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
41
|
+
- 💾 Hold all loaded data in context for subsequent steps
|
|
42
|
+
- 📖 Validate against agentskills.io spec requirements
|
|
43
|
+
- 🚫 Hard halt if required files are missing — do not proceed with incomplete skill
|
|
44
|
+
|
|
45
|
+
## CONTEXT BOUNDARIES:
|
|
46
|
+
|
|
47
|
+
- Available: SKF module config (skills_output_folder, forge_data_folder)
|
|
48
|
+
- Focus: Skill discovery, loading, and validation
|
|
49
|
+
- Limits: Read-only — no file writes in this step
|
|
50
|
+
- Dependencies: Skill must have been created by create-skill or update-skill
|
|
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. Parse Export Arguments
|
|
57
|
+
|
|
58
|
+
"**Starting skill export...**"
|
|
59
|
+
|
|
60
|
+
Determine the skill to export and any flags:
|
|
61
|
+
|
|
62
|
+
**Skill Path Discovery:**
|
|
63
|
+
- If user provided a skill name or path as argument, use that
|
|
64
|
+
- If not provided, search `{skills_output_folder}/*/SKILL.md` for available skills
|
|
65
|
+
- If multiple skills found, present list and ask user to select
|
|
66
|
+
- If no skills found, halt: "No skills found in {skills_output_folder}/. Run create-skill first."
|
|
67
|
+
|
|
68
|
+
**Flag Parsing:**
|
|
69
|
+
- `--platform` flag: Check if provided (claude/cursor/copilot). Default: `claude`
|
|
70
|
+
- `--dry-run` flag: Check if provided. Default: `false`
|
|
71
|
+
|
|
72
|
+
"**Skill:** {skill-name}
|
|
73
|
+
**Platform:** {platform} ({target-file})
|
|
74
|
+
**Dry Run:** {yes/no}"
|
|
75
|
+
|
|
76
|
+
### 2. Load and Validate Skill Artifacts
|
|
77
|
+
|
|
78
|
+
Load all files from the skill directory `{skills_output_folder}/{skill-name}/`:
|
|
79
|
+
|
|
80
|
+
**Required Files (hard halt if missing):**
|
|
81
|
+
- `SKILL.md` — The main skill document
|
|
82
|
+
- `metadata.json` — Machine-readable skill metadata
|
|
83
|
+
|
|
84
|
+
**Optional Files (note presence):**
|
|
85
|
+
- `references/` — Progressive disclosure directory
|
|
86
|
+
- `context-snippet.md` — Existing snippet (will be regenerated)
|
|
87
|
+
|
|
88
|
+
**Validation Checks:**
|
|
89
|
+
1. `SKILL.md` exists and is non-empty
|
|
90
|
+
2. `metadata.json` exists and is valid JSON
|
|
91
|
+
3. `metadata.json` contains required fields: `name`, `version`, `skill_type`, `source_authority`, `exports`, `generation_date`, `confidence_tier`
|
|
92
|
+
4. `metadata.json.exports` is a non-empty array (warn if empty — graceful handling)
|
|
93
|
+
|
|
94
|
+
**If any required validation fails:**
|
|
95
|
+
"**Export cannot proceed.** Missing or invalid: {list failures}
|
|
96
|
+
Run create-skill to generate a complete skill first."
|
|
97
|
+
|
|
98
|
+
### 3. Read Skill Metadata
|
|
99
|
+
|
|
100
|
+
Extract from `metadata.json`:
|
|
101
|
+
- `name` — Skill display name
|
|
102
|
+
- `skill_type` — `single` or `stack`
|
|
103
|
+
- `source_authority` — `official`, `internal`, or `community`
|
|
104
|
+
- `exports` — Array of exported functions/types
|
|
105
|
+
- `generation_date` — When the skill was last generated
|
|
106
|
+
- `confidence_tier` — Quick/Forge/Deep
|
|
107
|
+
|
|
108
|
+
**For stack skills, also extract:**
|
|
109
|
+
- `components` — Array of dependencies with versions
|
|
110
|
+
- `integrations` — Array of co-import patterns
|
|
111
|
+
|
|
112
|
+
### 4. Check Forge Configuration
|
|
113
|
+
|
|
114
|
+
Load `{forge_data_folder}/forge-config.yaml` (if exists):
|
|
115
|
+
- Check `passive_context` setting
|
|
116
|
+
- If `passive_context: false` — note that steps 03-04 (snippet + context update) will be skipped
|
|
117
|
+
|
|
118
|
+
### 5. Present Skill Summary
|
|
119
|
+
|
|
120
|
+
"**Skill loaded and validated.**
|
|
121
|
+
|
|
122
|
+
| Field | Value |
|
|
123
|
+
|-------|-------|
|
|
124
|
+
| **Name** | {name} |
|
|
125
|
+
| **Type** | {skill_type} |
|
|
126
|
+
| **Authority** | {source_authority} |
|
|
127
|
+
| **Confidence** | {confidence_tier} |
|
|
128
|
+
| **Exports** | {count} functions/types |
|
|
129
|
+
| **Generated** | {generation_date} |
|
|
130
|
+
| **References** | {count files or 'none'} |
|
|
131
|
+
|
|
132
|
+
**Export Configuration:**
|
|
133
|
+
| Setting | Value |
|
|
134
|
+
|---------|-------|
|
|
135
|
+
| **Platform** | {platform} → {target-file} |
|
|
136
|
+
| **Dry Run** | {yes/no} |
|
|
137
|
+
| **Passive Context** | {enabled/disabled} |
|
|
138
|
+
|
|
139
|
+
**Top Exports:**
|
|
140
|
+
{list top 5 exports from metadata}
|
|
141
|
+
|
|
142
|
+
**Is this the correct skill to export?**"
|
|
143
|
+
|
|
144
|
+
### 6. Present MENU OPTIONS
|
|
145
|
+
|
|
146
|
+
Display: "**Select:** [C] Continue to packaging"
|
|
147
|
+
|
|
148
|
+
#### Menu Handling Logic:
|
|
149
|
+
|
|
150
|
+
- IF C: Proceed with loaded skill data, then load, read entire file, then execute {nextStepFile}
|
|
151
|
+
- IF Any other: help user respond, then [Redisplay Menu Options](#6-present-menu-options)
|
|
152
|
+
|
|
153
|
+
#### EXECUTION RULES:
|
|
154
|
+
|
|
155
|
+
- ALWAYS halt and wait for user input after presenting menu
|
|
156
|
+
- ONLY proceed to next step when user selects 'C'
|
|
157
|
+
|
|
158
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
159
|
+
|
|
160
|
+
ONLY WHEN the user confirms the correct skill is loaded by selecting 'C' will you load and read fully `{nextStepFile}` to execute packaging.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
165
|
+
|
|
166
|
+
### ✅ SUCCESS:
|
|
167
|
+
|
|
168
|
+
- Skill path resolved (from argument or discovery)
|
|
169
|
+
- All required files loaded and validated
|
|
170
|
+
- metadata.json parsed with required fields
|
|
171
|
+
- Export flags parsed (platform, dry-run)
|
|
172
|
+
- Forge config checked for passive_context
|
|
173
|
+
- Clear summary presented to user
|
|
174
|
+
- User confirms correct skill
|
|
175
|
+
|
|
176
|
+
### ❌ SYSTEM FAILURE:
|
|
177
|
+
|
|
178
|
+
- Proceeding without finding SKILL.md or metadata.json
|
|
179
|
+
- Not validating metadata.json fields
|
|
180
|
+
- Not checking forge-config for passive_context opt-out
|
|
181
|
+
- Proceeding without user confirmation
|
|
182
|
+
- Modifying any skill files (read-only step)
|
|
183
|
+
|
|
184
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-02-package'
|
|
3
|
+
description: 'Build agentskills.io-compliant package structure from skill artifacts'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-03-generate-snippet.md'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 2: Package
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
To assemble and validate an agentskills.io-compliant package structure from the loaded skill artifacts, ensuring all required components are present and properly formatted for distribution.
|
|
13
|
+
|
|
14
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
15
|
+
|
|
16
|
+
### Universal Rules:
|
|
17
|
+
|
|
18
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
19
|
+
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
|
|
20
|
+
- ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
21
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
|
|
22
|
+
|
|
23
|
+
### Role Reinforcement:
|
|
24
|
+
|
|
25
|
+
- ✅ You are a delivery and packaging specialist in Ferris Delivery mode
|
|
26
|
+
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
|
|
27
|
+
- ✅ Precise validation — ensure package meets ecosystem standards
|
|
28
|
+
|
|
29
|
+
### Step-Specific Rules:
|
|
30
|
+
|
|
31
|
+
- 🎯 Focus only on package structure assembly and validation
|
|
32
|
+
- 🚫 FORBIDDEN to modify SKILL.md content — package what exists
|
|
33
|
+
- 💬 This is a deterministic packaging step — auto-proceed when complete
|
|
34
|
+
|
|
35
|
+
## EXECUTION PROTOCOLS:
|
|
36
|
+
|
|
37
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
38
|
+
- 💾 Hold validated package structure in context for subsequent steps
|
|
39
|
+
- 📖 Validate all required agentskills.io fields
|
|
40
|
+
- 🚫 Warn on non-critical issues but do not halt
|
|
41
|
+
|
|
42
|
+
## CONTEXT BOUNDARIES:
|
|
43
|
+
|
|
44
|
+
- Available: Skill metadata, SKILL.md, metadata.json from step-01
|
|
45
|
+
- Focus: Package structure validation and assembly
|
|
46
|
+
- Limits: Do not modify source files — validate and assemble only
|
|
47
|
+
- Dependencies: Step-01 must have loaded and validated the skill
|
|
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. Validate Package Structure
|
|
54
|
+
|
|
55
|
+
Verify the skill directory contains the expected agentskills.io package layout:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
{skills_output_folder}/{skill-name}/
|
|
59
|
+
├── SKILL.md ← Required: Active skill document
|
|
60
|
+
├── metadata.json ← Required: Machine-readable metadata
|
|
61
|
+
├── context-snippet.md ← Will be generated/updated in step-03
|
|
62
|
+
└── references/ ← Optional: Progressive disclosure
|
|
63
|
+
├── {function-a}.md
|
|
64
|
+
└── {function-b}.md
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Check each component:**
|
|
68
|
+
1. `SKILL.md` — Verify has frontmatter with `name` field
|
|
69
|
+
2. `metadata.json` — Verify required agentskills.io fields:
|
|
70
|
+
- `name` (string, non-empty)
|
|
71
|
+
- `version` (string, semver format preferred)
|
|
72
|
+
- `skill_type` ("single" or "stack")
|
|
73
|
+
- `source_authority` ("official", "internal", or "community")
|
|
74
|
+
- `exports` (array)
|
|
75
|
+
- `generation_date` (ISO date string)
|
|
76
|
+
- `confidence_tier` ("Quick", "Forge", or "Deep")
|
|
77
|
+
3. `references/` — If exists, check at least one .md file present
|
|
78
|
+
|
|
79
|
+
### 2. Validate Metadata Completeness
|
|
80
|
+
|
|
81
|
+
Check metadata.json for recommended (non-required) fields:
|
|
82
|
+
|
|
83
|
+
- `description` — Brief skill description
|
|
84
|
+
- `source_repo` — Source repository URL
|
|
85
|
+
- `language` — Primary language of source code
|
|
86
|
+
- `ast_node_count` — Number of AST nodes analyzed
|
|
87
|
+
- `tool_versions` — Tools used during generation
|
|
88
|
+
|
|
89
|
+
**For each missing recommended field:** Note as warning, do not halt.
|
|
90
|
+
|
|
91
|
+
### 3. Assess Package Readiness
|
|
92
|
+
|
|
93
|
+
Determine package status:
|
|
94
|
+
|
|
95
|
+
**READY:** All required files present, all required metadata fields valid
|
|
96
|
+
**WARNINGS:** Ready but with missing recommended fields or empty references/
|
|
97
|
+
**NOT READY:** Missing required files or required metadata fields (should not reach here — step-01 would have halted)
|
|
98
|
+
|
|
99
|
+
### 4. Report Package Status
|
|
100
|
+
|
|
101
|
+
"**Package structure validated.**
|
|
102
|
+
|
|
103
|
+
**Status:** {READY / WARNINGS}
|
|
104
|
+
|
|
105
|
+
**Required Components:**
|
|
106
|
+
- SKILL.md: ✅
|
|
107
|
+
- metadata.json: ✅ ({count} required fields valid)
|
|
108
|
+
- references/: {✅ present ({count} files) / ⚠️ not present}
|
|
109
|
+
|
|
110
|
+
{If warnings:}
|
|
111
|
+
**Warnings:**
|
|
112
|
+
- {list missing recommended fields}
|
|
113
|
+
|
|
114
|
+
**Package is ready for snippet generation.**"
|
|
115
|
+
|
|
116
|
+
### 5. Proceed to Snippet Generation
|
|
117
|
+
|
|
118
|
+
Display: "**Proceeding to snippet generation...**"
|
|
119
|
+
|
|
120
|
+
#### Menu Handling Logic:
|
|
121
|
+
|
|
122
|
+
- After package validation completes, immediately load, read entire file, then execute {nextStepFile}
|
|
123
|
+
|
|
124
|
+
#### EXECUTION RULES:
|
|
125
|
+
|
|
126
|
+
- This is an auto-proceed step with no user choices
|
|
127
|
+
- Proceed directly to next step after validation
|
|
128
|
+
|
|
129
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
130
|
+
|
|
131
|
+
ONLY WHEN package validation is complete will you load and read fully `{nextStepFile}` to execute snippet generation.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
136
|
+
|
|
137
|
+
### ✅ SUCCESS:
|
|
138
|
+
|
|
139
|
+
- All required package components validated
|
|
140
|
+
- All required metadata.json fields checked
|
|
141
|
+
- Warnings noted for missing recommended fields
|
|
142
|
+
- Package status clearly reported
|
|
143
|
+
- Auto-proceed to step-03
|
|
144
|
+
|
|
145
|
+
### ❌ SYSTEM FAILURE:
|
|
146
|
+
|
|
147
|
+
- Not checking all required files
|
|
148
|
+
- Not validating metadata.json fields
|
|
149
|
+
- Halting on non-critical warnings (should warn and continue)
|
|
150
|
+
- Modifying any source files
|
|
151
|
+
- Not auto-proceeding after validation
|
|
152
|
+
|
|
153
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-03-generate-snippet'
|
|
3
|
+
description: 'Generate context-snippet.md in compressed two-line format per ADR-L'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-04-update-context.md'
|
|
6
|
+
snippetFormatData: '../data/snippet-format.md'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Step 3: Generate Snippet
|
|
10
|
+
|
|
11
|
+
## STEP GOAL:
|
|
12
|
+
|
|
13
|
+
To generate or update context-snippet.md for the skill in the compressed two-line format defined by ADR-L, targeting ~30 tokens per skill with T1-now content only.
|
|
14
|
+
|
|
15
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
16
|
+
|
|
17
|
+
### Universal Rules:
|
|
18
|
+
|
|
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
|
+
- ⚙️ 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
|
|
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 delivery and packaging specialist in Ferris Delivery mode
|
|
27
|
+
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
|
|
28
|
+
- ✅ Compress precisely — every token in a snippet must earn its place
|
|
29
|
+
|
|
30
|
+
### Step-Specific Rules:
|
|
31
|
+
|
|
32
|
+
- 🎯 Focus only on generating the context-snippet.md content
|
|
33
|
+
- 🚫 FORBIDDEN to include T2 annotations or temporal context — T1-now only
|
|
34
|
+
- 💬 This is a deterministic generation step — auto-proceed when complete
|
|
35
|
+
- 📋 If `passive_context: false` was detected in step-01, SKIP this step entirely and auto-proceed to step-04
|
|
36
|
+
|
|
37
|
+
## EXECUTION PROTOCOLS:
|
|
38
|
+
|
|
39
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
40
|
+
- 💾 Write context-snippet.md to skill directory (or hold in context if dry-run)
|
|
41
|
+
- 📖 Load {snippetFormatData} for format template
|
|
42
|
+
- 🚫 Strict adherence to ADR-L format — no deviations
|
|
43
|
+
|
|
44
|
+
## CONTEXT BOUNDARIES:
|
|
45
|
+
|
|
46
|
+
- Available: Skill metadata (name, exports, skill_type, components, integrations) from step-01
|
|
47
|
+
- Focus: Snippet generation in exact ADR-L format
|
|
48
|
+
- Limits: T1-now content only, ~30 tokens target
|
|
49
|
+
- Dependencies: Step-01 metadata, step-02 package validation
|
|
50
|
+
|
|
51
|
+
## MANDATORY SEQUENCE
|
|
52
|
+
|
|
53
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
54
|
+
|
|
55
|
+
### 1. Check Passive Context Setting
|
|
56
|
+
|
|
57
|
+
**If `passive_context: false` was detected in step-01:**
|
|
58
|
+
|
|
59
|
+
"**Passive context disabled in forge-config.yaml. Skipping snippet generation.**"
|
|
60
|
+
|
|
61
|
+
Auto-proceed immediately to {nextStepFile}.
|
|
62
|
+
|
|
63
|
+
**If `passive_context: true` (default):** Continue to step 2.
|
|
64
|
+
|
|
65
|
+
### 2. Load Snippet Format
|
|
66
|
+
|
|
67
|
+
Load {snippetFormatData} and read the format template for the skill type.
|
|
68
|
+
|
|
69
|
+
### 3. Generate Snippet Content
|
|
70
|
+
|
|
71
|
+
**For single skills (`skill_type: "single"`):**
|
|
72
|
+
|
|
73
|
+
Select top 5 exports from metadata.json `exports` array (by order as listed — assumed most important first).
|
|
74
|
+
|
|
75
|
+
Generate:
|
|
76
|
+
```
|
|
77
|
+
{skill-name} → skills/{skill-name}/
|
|
78
|
+
exports: {export-1}, {export-2}, {export-3}, {export-4}, {export-5}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**If fewer than 5 exports:** List all available.
|
|
82
|
+
**If no exports:** Omit the exports line entirely:
|
|
83
|
+
```
|
|
84
|
+
{skill-name} → skills/{skill-name}/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**For stack skills (`skill_type: "stack"`):**
|
|
88
|
+
|
|
89
|
+
Generate:
|
|
90
|
+
```
|
|
91
|
+
{project}-stack → skills/{project}-stack/
|
|
92
|
+
stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
|
|
93
|
+
integrations: {pattern-1}, {pattern-2}, {pattern-3}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Verify Token Count
|
|
97
|
+
|
|
98
|
+
Estimate token count of generated snippet (approximate: words * 1.3).
|
|
99
|
+
|
|
100
|
+
- Target: ~30 tokens per skill
|
|
101
|
+
- Warning threshold: >50 tokens
|
|
102
|
+
- If exceeding warning threshold, trim exports list or integration patterns to fit
|
|
103
|
+
|
|
104
|
+
### 5. Write or Preview Snippet
|
|
105
|
+
|
|
106
|
+
**If dry-run mode:**
|
|
107
|
+
|
|
108
|
+
"**[DRY RUN] context-snippet.md would be written to:**
|
|
109
|
+
`{skills_output_folder}/{skill-name}/context-snippet.md`
|
|
110
|
+
|
|
111
|
+
**Content:**
|
|
112
|
+
```
|
|
113
|
+
{generated snippet content}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Estimated tokens:** {count}"
|
|
117
|
+
|
|
118
|
+
Hold content in context for step-04.
|
|
119
|
+
|
|
120
|
+
**If NOT dry-run:**
|
|
121
|
+
|
|
122
|
+
Write the generated content to `{skills_output_folder}/{skill-name}/context-snippet.md`.
|
|
123
|
+
|
|
124
|
+
"**context-snippet.md written.**
|
|
125
|
+
**Path:** `{skills_output_folder}/{skill-name}/context-snippet.md`
|
|
126
|
+
**Estimated tokens:** {count}"
|
|
127
|
+
|
|
128
|
+
### 6. Proceed to Context Update
|
|
129
|
+
|
|
130
|
+
Display: "**Proceeding to context update...**"
|
|
131
|
+
|
|
132
|
+
#### Menu Handling Logic:
|
|
133
|
+
|
|
134
|
+
- After snippet generation completes, immediately load, read entire file, then execute {nextStepFile}
|
|
135
|
+
|
|
136
|
+
#### EXECUTION RULES:
|
|
137
|
+
|
|
138
|
+
- This is an auto-proceed step with no user choices
|
|
139
|
+
- Proceed directly to next step after generation
|
|
140
|
+
|
|
141
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
142
|
+
|
|
143
|
+
ONLY WHEN snippet generation is complete (or skipped due to passive_context opt-out) will you load and read fully `{nextStepFile}` to execute context update.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
148
|
+
|
|
149
|
+
### ✅ SUCCESS:
|
|
150
|
+
|
|
151
|
+
- Snippet format loaded from {snippetFormatData}
|
|
152
|
+
- Content generated matching exact ADR-L format
|
|
153
|
+
- Token count estimated and within target
|
|
154
|
+
- File written (or previewed in dry-run)
|
|
155
|
+
- Passive context opt-out correctly handled (skip when disabled)
|
|
156
|
+
- Auto-proceed to step-04
|
|
157
|
+
|
|
158
|
+
### ❌ SYSTEM FAILURE:
|
|
159
|
+
|
|
160
|
+
- Deviating from ADR-L two-line format
|
|
161
|
+
- Including T2 annotations or temporal context
|
|
162
|
+
- Not checking passive_context setting
|
|
163
|
+
- Not estimating token count
|
|
164
|
+
- Halting for user input (auto-proceed step)
|
|
165
|
+
|
|
166
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|