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,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-04-update-context'
|
|
3
|
+
description: 'Update managed section in CLAUDE.md/AGENTS.md with three-case logic per ADR-J'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-05-token-report.md'
|
|
6
|
+
managedSectionData: '../data/managed-section-format.md'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Step 4: Update Context
|
|
10
|
+
|
|
11
|
+
## STEP GOAL:
|
|
12
|
+
|
|
13
|
+
To update the managed `<!-- SKF:BEGIN/END -->` section in the platform-appropriate context file (CLAUDE.md/AGENTS.md/.cursorrules) using the three-case logic defined by ADR-J, rebuilding the complete skill index from all exported skills.
|
|
14
|
+
|
|
15
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
16
|
+
|
|
17
|
+
### Universal Rules:
|
|
18
|
+
|
|
19
|
+
- 🛑 NEVER modify content outside `<!-- SKF:BEGIN/END -->` markers
|
|
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
|
+
- ⚙️ 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 delivery and packaging specialist in Ferris Delivery mode
|
|
28
|
+
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
|
|
29
|
+
- ✅ Surgical precision required — existing file content MUST be preserved
|
|
30
|
+
- ✅ User confirms changes before any writes to shared context files
|
|
31
|
+
|
|
32
|
+
### Step-Specific Rules:
|
|
33
|
+
|
|
34
|
+
- 🎯 Focus only on the managed section update in the target context file
|
|
35
|
+
- 🚫 FORBIDDEN to modify ANY content outside `<!-- SKF:BEGIN -->` and `<!-- SKF:END -->` markers
|
|
36
|
+
- 🚫 FORBIDDEN to write without user confirmation — this modifies shared project files
|
|
37
|
+
- 💬 Show a clear diff preview before writing
|
|
38
|
+
- 📋 If `passive_context: false` was detected in step-01, SKIP this step entirely and auto-proceed
|
|
39
|
+
|
|
40
|
+
## EXECUTION PROTOCOLS:
|
|
41
|
+
|
|
42
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
43
|
+
- 💾 Load {managedSectionData} for format template and three-case logic
|
|
44
|
+
- 📖 Rebuild the COMPLETE skill index — not just the current skill
|
|
45
|
+
- 🚫 ZERO data loss — verify preserved content before and after write
|
|
46
|
+
|
|
47
|
+
## CONTEXT BOUNDARIES:
|
|
48
|
+
|
|
49
|
+
- Available: Skill metadata from step-01, context-snippet.md from step-03, platform flag
|
|
50
|
+
- Focus: Three-case detection and managed section update
|
|
51
|
+
- Limits: Only modify content between markers — preserve everything else
|
|
52
|
+
- Dependencies: Step-03 must have generated the snippet (or step skipped if passive_context off)
|
|
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. Check Passive Context Setting
|
|
59
|
+
|
|
60
|
+
**If `passive_context: false` was detected in step-01:**
|
|
61
|
+
|
|
62
|
+
"**Passive context disabled in forge-config.yaml. Skipping context update.**"
|
|
63
|
+
|
|
64
|
+
Auto-proceed immediately to {nextStepFile}.
|
|
65
|
+
|
|
66
|
+
**If `passive_context: true` (default):** Continue to step 2.
|
|
67
|
+
|
|
68
|
+
### 2. Load Managed Section Format
|
|
69
|
+
|
|
70
|
+
Load {managedSectionData} and read the complete format template and three-case logic.
|
|
71
|
+
|
|
72
|
+
### 3. Determine Target File
|
|
73
|
+
|
|
74
|
+
Based on the `--platform` flag parsed in step-01:
|
|
75
|
+
|
|
76
|
+
| Platform | Target File |
|
|
77
|
+
|----------|-------------|
|
|
78
|
+
| `claude` (default) | CLAUDE.md |
|
|
79
|
+
| `cursor` | .cursorrules |
|
|
80
|
+
| `copilot` | AGENTS.md |
|
|
81
|
+
|
|
82
|
+
Resolve target file path at project root: `{project-root}/{target-file}`
|
|
83
|
+
|
|
84
|
+
### 4. Rebuild Complete Skill Index
|
|
85
|
+
|
|
86
|
+
Scan `{skills_output_folder}/*/context-snippet.md` to find ALL exported skills (not just the current one).
|
|
87
|
+
|
|
88
|
+
**If no context-snippet.md files are found:** Generate managed section with zero skills — header only, no skill entries.
|
|
89
|
+
|
|
90
|
+
For each found context-snippet.md:
|
|
91
|
+
1. Read snippet content
|
|
92
|
+
2. Add to skill index
|
|
93
|
+
|
|
94
|
+
**Sort skills alphabetically by name.**
|
|
95
|
+
|
|
96
|
+
Count totals:
|
|
97
|
+
- Total skills (single type)
|
|
98
|
+
- Total stack skills
|
|
99
|
+
|
|
100
|
+
### 5. Generate Managed Section
|
|
101
|
+
|
|
102
|
+
Assemble the complete managed section:
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
<!-- SKF:BEGIN updated:{current-date} -->
|
|
106
|
+
[SKF Skills]|{n} skills|{m} stack
|
|
107
|
+
|IMPORTANT: Prefer documented APIs over training data.
|
|
108
|
+
|
|
|
109
|
+
|{skill-snippet-1}
|
|
110
|
+
|
|
|
111
|
+
|{skill-snippet-2}
|
|
112
|
+
|
|
|
113
|
+
|{skill-snippet-N}
|
|
114
|
+
<!-- SKF:END -->
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 6. Detect Case and Prepare Changes
|
|
118
|
+
|
|
119
|
+
**Check target file at `{project-root}/{target-file}`:**
|
|
120
|
+
|
|
121
|
+
**Case 1: Create (file does not exist)**
|
|
122
|
+
- Action: Create new file with managed section only
|
|
123
|
+
- Diff: Show entire managed section as new content
|
|
124
|
+
|
|
125
|
+
**Case 2: Append (file exists, no `<!-- SKF:BEGIN` marker found)**
|
|
126
|
+
- Action: Read existing content, append managed section at end
|
|
127
|
+
- Diff: Show managed section being appended after existing content
|
|
128
|
+
- Preserved: ALL existing content untouched
|
|
129
|
+
|
|
130
|
+
**Case 3: Regenerate (file contains `<!-- SKF:BEGIN` and `<!-- SKF:END -->`)**
|
|
131
|
+
- Action: Replace everything between markers (inclusive) with new managed section
|
|
132
|
+
- Diff: Show old managed section vs new managed section
|
|
133
|
+
- Preserved: ALL content before `<!-- SKF:BEGIN` and after `<!-- SKF:END -->`
|
|
134
|
+
|
|
135
|
+
### 7. Present Change Preview
|
|
136
|
+
|
|
137
|
+
"**Context update prepared.**
|
|
138
|
+
|
|
139
|
+
**Target:** `{project-root}/{target-file}`
|
|
140
|
+
**Case:** {1: Create / 2: Append / 3: Regenerate}
|
|
141
|
+
**Skills in index:** {n} skills, {m} stack
|
|
142
|
+
|
|
143
|
+
**Changes:**
|
|
144
|
+
|
|
145
|
+
{Show diff preview:}
|
|
146
|
+
- For Case 1: Show full file content to be created
|
|
147
|
+
- For Case 2: Show `...existing content preserved...\n\n{managed section}`
|
|
148
|
+
- For Case 3: Show old section vs new section with surrounding context preserved
|
|
149
|
+
|
|
150
|
+
**Content outside markers:** {preserved / n/a (new file)}
|
|
151
|
+
|
|
152
|
+
**Ready to write changes?**"
|
|
153
|
+
|
|
154
|
+
### 8. Present MENU OPTIONS
|
|
155
|
+
|
|
156
|
+
**If dry-run mode:**
|
|
157
|
+
|
|
158
|
+
"**[DRY RUN] No files will be written. Preview above shows what would change.**
|
|
159
|
+
|
|
160
|
+
**Proceeding to token report...**"
|
|
161
|
+
|
|
162
|
+
Auto-proceed to {nextStepFile}.
|
|
163
|
+
|
|
164
|
+
**If NOT dry-run:**
|
|
165
|
+
|
|
166
|
+
Display: "**Select:** [C] Continue — write changes to {target-file}"
|
|
167
|
+
|
|
168
|
+
#### Menu Handling Logic:
|
|
169
|
+
|
|
170
|
+
- IF C: Write the changes to target file, verify write succeeded, then load, read entire file, then execute {nextStepFile}
|
|
171
|
+
- IF Any other: help user respond, then [Redisplay Menu Options](#8-present-menu-options)
|
|
172
|
+
|
|
173
|
+
#### EXECUTION RULES:
|
|
174
|
+
|
|
175
|
+
- ALWAYS halt and wait for user input after presenting menu
|
|
176
|
+
- ONLY proceed to next step when user selects 'C'
|
|
177
|
+
- In dry-run mode, auto-proceed without writing
|
|
178
|
+
|
|
179
|
+
### 9. Write and Verify (Non-Dry-Run Only)
|
|
180
|
+
|
|
181
|
+
After user confirms with 'C':
|
|
182
|
+
|
|
183
|
+
1. Write the file using the appropriate case logic
|
|
184
|
+
2. Re-read the written file
|
|
185
|
+
3. Verify `<!-- SKF:BEGIN` and `<!-- SKF:END -->` markers are present
|
|
186
|
+
4. Verify content outside markers is unchanged (for Cases 2 and 3)
|
|
187
|
+
5. Report: "**{target-file} updated successfully.** Verified: markers present, external content preserved."
|
|
188
|
+
|
|
189
|
+
**If verification fails:**
|
|
190
|
+
"**WARNING: Write verification failed.** {describe issue}. File may need manual review."
|
|
191
|
+
|
|
192
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
193
|
+
|
|
194
|
+
ONLY WHEN the user confirms changes by selecting 'C' (or auto-proceed in dry-run) and the write is verified will you load and read fully `{nextStepFile}` to execute the token report.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
199
|
+
|
|
200
|
+
### ✅ SUCCESS:
|
|
201
|
+
|
|
202
|
+
- Managed section format loaded from {managedSectionData}
|
|
203
|
+
- Target file correctly determined from platform flag
|
|
204
|
+
- Complete skill index rebuilt from all exported skills
|
|
205
|
+
- Correct case detected (create/append/regenerate)
|
|
206
|
+
- Clear diff preview shown to user
|
|
207
|
+
- User confirmation received before writing
|
|
208
|
+
- Write verified — markers present, external content preserved
|
|
209
|
+
- Passive context opt-out correctly handled (skip when disabled)
|
|
210
|
+
- Dry-run correctly handled (preview only, no writes)
|
|
211
|
+
|
|
212
|
+
### ❌ SYSTEM FAILURE:
|
|
213
|
+
|
|
214
|
+
- Modifying content outside `<!-- SKF:BEGIN/END -->` markers
|
|
215
|
+
- Not rebuilding the COMPLETE skill index (only adding current skill)
|
|
216
|
+
- Writing without user confirmation
|
|
217
|
+
- Not verifying write after completion
|
|
218
|
+
- Not detecting the correct case (create/append/regenerate)
|
|
219
|
+
- Losing existing file content during write
|
|
220
|
+
- Not skipping when passive_context is disabled
|
|
221
|
+
|
|
222
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. ZERO data loss in target files is NON-NEGOTIABLE.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-05-token-report'
|
|
3
|
+
description: 'Calculate and report token counts for all export artifacts'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-06-summary.md'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 5: Token Report
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
To calculate approximate token counts for all exported artifacts and present a clear report showing the token cost of each component, helping users understand the context budget impact of their skills.
|
|
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
|
+
- ✅ Report clearly — token counts inform developers' context budget decisions
|
|
28
|
+
|
|
29
|
+
### Step-Specific Rules:
|
|
30
|
+
|
|
31
|
+
- 🎯 Focus only on token counting and reporting
|
|
32
|
+
- 🚫 FORBIDDEN to modify any files — read-only measurement
|
|
33
|
+
- 💬 This is a deterministic reporting step — auto-proceed when complete
|
|
34
|
+
|
|
35
|
+
## EXECUTION PROTOCOLS:
|
|
36
|
+
|
|
37
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
38
|
+
- 💾 Hold token counts in context for the summary step
|
|
39
|
+
- 📖 Use consistent estimation method across all files
|
|
40
|
+
- 🚫 No file writes — measurement only
|
|
41
|
+
|
|
42
|
+
## CONTEXT BOUNDARIES:
|
|
43
|
+
|
|
44
|
+
- Available: All artifacts from steps 01-04 (SKILL.md, metadata.json, context-snippet.md, managed section content)
|
|
45
|
+
- Focus: Token estimation and reporting
|
|
46
|
+
- Limits: Estimates only — exact counts vary by tokenizer
|
|
47
|
+
- Dependencies: Steps 01-04 must have completed (or been skipped where appropriate)
|
|
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. Calculate Token Counts
|
|
54
|
+
|
|
55
|
+
For each artifact, estimate tokens using the heuristic: **words * 1.3** (approximate for GPT/Claude tokenizers).
|
|
56
|
+
|
|
57
|
+
**Artifacts to measure:**
|
|
58
|
+
|
|
59
|
+
1. **context-snippet.md** — The compressed snippet (if generated)
|
|
60
|
+
2. **Managed section** — The complete `<!-- SKF:BEGIN/END -->` block (all skills, not just this one)
|
|
61
|
+
3. **SKILL.md** — The full active skill document
|
|
62
|
+
4. **metadata.json** — The machine-readable metadata
|
|
63
|
+
5. **references/** — Total across all reference files (if present)
|
|
64
|
+
6. **Full package total** — Sum of all above
|
|
65
|
+
|
|
66
|
+
**If passive_context was disabled:** Skip context-snippet.md and managed section measurements, note as "N/A (disabled)".
|
|
67
|
+
|
|
68
|
+
### 2. Present Token Report
|
|
69
|
+
|
|
70
|
+
"**Token Report**
|
|
71
|
+
|
|
72
|
+
| Artifact | Words | Est. Tokens | Notes |
|
|
73
|
+
|----------|-------|-------------|-------|
|
|
74
|
+
| context-snippet.md | {n} | ~{t} | Passive context (always-on) |
|
|
75
|
+
| Managed section (all skills) | {n} | ~{t} | In {target-file}, all {count} skills |
|
|
76
|
+
| SKILL.md | {n} | ~{t} | Active skill (on-trigger) |
|
|
77
|
+
| metadata.json | {n} | ~{t} | Machine-readable |
|
|
78
|
+
| references/ | {n} | ~{t} | {count} files |
|
|
79
|
+
| **Package total** | **{n}** | **~{t}** | **All artifacts combined** |
|
|
80
|
+
|
|
81
|
+
**Context Budget Impact:**
|
|
82
|
+
- **Always-on cost:** ~{managed-section-tokens} tokens (managed section in {target-file})
|
|
83
|
+
- **On-trigger cost:** ~{skill-tokens} tokens (when SKILL.md is loaded)
|
|
84
|
+
- **Full disclosure cost:** ~{total-tokens} tokens (if references/ also loaded)
|
|
85
|
+
|
|
86
|
+
**Benchmark:** Target is ~30 tokens per skill in managed section. Current: ~{snippet-tokens} tokens."
|
|
87
|
+
|
|
88
|
+
### 3. Proceed to Summary
|
|
89
|
+
|
|
90
|
+
Display: "**Proceeding to export summary...**"
|
|
91
|
+
|
|
92
|
+
#### Menu Handling Logic:
|
|
93
|
+
|
|
94
|
+
- After token report is displayed, immediately load, read entire file, then execute {nextStepFile}
|
|
95
|
+
|
|
96
|
+
#### EXECUTION RULES:
|
|
97
|
+
|
|
98
|
+
- This is an auto-proceed step with no user choices
|
|
99
|
+
- Proceed directly to next step after reporting
|
|
100
|
+
|
|
101
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
102
|
+
|
|
103
|
+
ONLY WHEN the token report is displayed will you load and read fully `{nextStepFile}` to execute the export summary.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
108
|
+
|
|
109
|
+
### ✅ SUCCESS:
|
|
110
|
+
|
|
111
|
+
- All artifacts measured with consistent heuristic
|
|
112
|
+
- Clear table format with words and estimated tokens
|
|
113
|
+
- Context budget impact explained (always-on vs on-trigger vs full)
|
|
114
|
+
- Benchmark comparison for managed section target
|
|
115
|
+
- Passive context opt-out correctly handled (skip snippet/section measurements)
|
|
116
|
+
- Auto-proceed to step-06
|
|
117
|
+
|
|
118
|
+
### ❌ SYSTEM FAILURE:
|
|
119
|
+
|
|
120
|
+
- Not measuring all artifacts
|
|
121
|
+
- Inconsistent estimation method
|
|
122
|
+
- Not explaining context budget impact
|
|
123
|
+
- Modifying any files (read-only step)
|
|
124
|
+
- Not auto-proceeding after report
|
|
125
|
+
|
|
126
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-06-summary'
|
|
3
|
+
description: 'Display export summary with distribution instructions'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 6: Summary
|
|
7
|
+
|
|
8
|
+
## STEP GOAL:
|
|
9
|
+
|
|
10
|
+
To present a complete export summary showing all files written, token counts, and provide distribution instructions based on the skill's source authority. This is the final step — workflow ends here.
|
|
11
|
+
|
|
12
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
13
|
+
|
|
14
|
+
### Universal Rules:
|
|
15
|
+
|
|
16
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
17
|
+
- ⚙️ 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
|
|
18
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
|
|
19
|
+
|
|
20
|
+
### Role Reinforcement:
|
|
21
|
+
|
|
22
|
+
- ✅ You are a delivery and packaging specialist in Ferris Delivery mode
|
|
23
|
+
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
|
|
24
|
+
- ✅ Clear and complete — the user should know exactly what happened and what to do next
|
|
25
|
+
|
|
26
|
+
### Step-Specific Rules:
|
|
27
|
+
|
|
28
|
+
- 🎯 Focus only on summarizing what was done and providing next steps
|
|
29
|
+
- 🚫 FORBIDDEN to write any additional files — summary is console-only
|
|
30
|
+
- 💬 This is the final step — end with clear completion signal
|
|
31
|
+
|
|
32
|
+
## EXECUTION PROTOCOLS:
|
|
33
|
+
|
|
34
|
+
- 🎯 Follow the MANDATORY SEQUENCE exactly
|
|
35
|
+
- 📖 Compile results from all previous steps
|
|
36
|
+
- 🚫 No file writes — console output only
|
|
37
|
+
- ✅ End workflow gracefully
|
|
38
|
+
|
|
39
|
+
## CONTEXT BOUNDARIES:
|
|
40
|
+
|
|
41
|
+
- Available: All data from steps 01-05 (metadata, package status, snippet, context update, token counts)
|
|
42
|
+
- Focus: Summary compilation and distribution instructions
|
|
43
|
+
- Limits: No new operations — reporting only
|
|
44
|
+
- Dependencies: All previous steps
|
|
45
|
+
|
|
46
|
+
## MANDATORY SEQUENCE
|
|
47
|
+
|
|
48
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
49
|
+
|
|
50
|
+
### 1. Compile Export Summary
|
|
51
|
+
|
|
52
|
+
"**Export Complete{if dry-run: ' (Dry Run)'}**
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
**Skill:** {skill-name}
|
|
57
|
+
**Type:** {skill_type} | **Authority:** {source_authority} | **Tier:** {confidence_tier}
|
|
58
|
+
**Platform:** {platform} → {target-file}
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### Files {if dry-run: 'Previewed' else: 'Written'}
|
|
63
|
+
|
|
64
|
+
| File | Status | Tokens |
|
|
65
|
+
|------|--------|--------|
|
|
66
|
+
| context-snippet.md | {✅ written / ⚠️ skipped (passive off) / 👁️ previewed} | ~{t} |
|
|
67
|
+
| {target-file} managed section | {✅ updated (case {n}) / ⚠️ skipped / 👁️ previewed} | ~{t} |
|
|
68
|
+
| Package structure | ✅ validated | ~{t} total |
|
|
69
|
+
|
|
70
|
+
**Total context cost:** ~{always-on-tokens} tokens always-on, ~{on-trigger-tokens} tokens on-trigger"
|
|
71
|
+
|
|
72
|
+
### 2. Distribution Instructions
|
|
73
|
+
|
|
74
|
+
**Based on `source_authority` from metadata:**
|
|
75
|
+
|
|
76
|
+
**If `official`:**
|
|
77
|
+
|
|
78
|
+
"### Distribution: Official Ecosystem
|
|
79
|
+
|
|
80
|
+
Your skill is ready for the agentskills.io ecosystem.
|
|
81
|
+
|
|
82
|
+
**Publish:**
|
|
83
|
+
```
|
|
84
|
+
npx skills publish {skill-name}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Others can install with:**
|
|
88
|
+
```
|
|
89
|
+
npx skills add {skill-name}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Before publishing, ensure:**
|
|
93
|
+
- Source repo URL is correct in metadata.json
|
|
94
|
+
- You have publish access to the agentskills.io registry
|
|
95
|
+
- SKILL.md has been reviewed for accuracy"
|
|
96
|
+
|
|
97
|
+
**If `internal`:**
|
|
98
|
+
|
|
99
|
+
"### Distribution: Internal
|
|
100
|
+
|
|
101
|
+
Your skill is committed to the project's `skills/` directory and ships with your code.
|
|
102
|
+
|
|
103
|
+
**Team members** will automatically have access when they pull the latest changes.
|
|
104
|
+
|
|
105
|
+
**To update team context:** Ensure {target-file} is committed with the managed section update."
|
|
106
|
+
|
|
107
|
+
**If `community`:**
|
|
108
|
+
|
|
109
|
+
"### Distribution: Community (Local)
|
|
110
|
+
|
|
111
|
+
Your skill is generated from an external dependency for local use.
|
|
112
|
+
|
|
113
|
+
**Location:** `{skills_output_folder}/{skill-name}/`
|
|
114
|
+
**Scope:** This project only — not for publishing to agentskills.io
|
|
115
|
+
|
|
116
|
+
**Note:** Community skills are generated from third-party source code. Only `official` skills (generated by the library maintainer) should be published to the ecosystem."
|
|
117
|
+
|
|
118
|
+
### 3. Dry Run Reminder (If Applicable)
|
|
119
|
+
|
|
120
|
+
**If dry-run mode was active:**
|
|
121
|
+
|
|
122
|
+
"### Dry Run Complete
|
|
123
|
+
|
|
124
|
+
No files were written. To run the export for real:
|
|
125
|
+
|
|
126
|
+
**Re-run without `--dry-run`** to write all files."
|
|
127
|
+
|
|
128
|
+
### 4. Recommended Next Steps
|
|
129
|
+
|
|
130
|
+
"### Next Steps
|
|
131
|
+
|
|
132
|
+
- **audit-skill** — Run periodic integrity checks to detect drift between skill and source
|
|
133
|
+
- **update-skill** — After refactoring source code, regenerate the skill
|
|
134
|
+
- **test-skill** — Verify skill completeness and accuracy"
|
|
135
|
+
|
|
136
|
+
### 5. Workflow Complete
|
|
137
|
+
|
|
138
|
+
"---
|
|
139
|
+
|
|
140
|
+
**Skill forged and delivered.** ⚒️"
|
|
141
|
+
|
|
142
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
143
|
+
|
|
144
|
+
This is the final step. The workflow is complete. No further steps to load.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
149
|
+
|
|
150
|
+
### ✅ SUCCESS:
|
|
151
|
+
|
|
152
|
+
- Complete summary with all files and their status
|
|
153
|
+
- Token counts included from step-05
|
|
154
|
+
- Distribution instructions appropriate for source_authority
|
|
155
|
+
- Dry-run correctly indicated (if applicable)
|
|
156
|
+
- Recommended next workflows listed
|
|
157
|
+
- Clear workflow completion signal
|
|
158
|
+
|
|
159
|
+
### ❌ SYSTEM FAILURE:
|
|
160
|
+
|
|
161
|
+
- Missing files from summary
|
|
162
|
+
- Wrong distribution instructions for source_authority
|
|
163
|
+
- Not indicating dry-run status
|
|
164
|
+
- Writing additional files (console-only step)
|
|
165
|
+
- Not ending the workflow cleanly
|
|
166
|
+
|
|
167
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|