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,481 @@
|
|
|
1
|
+
---
|
|
2
|
+
conversionFrom: 'src/workflows/create-stack-skill/create-stack-skill.spec.md'
|
|
3
|
+
originalFormat: 'spec-placeholder'
|
|
4
|
+
stepsCompleted: ['step-00-conversion', 'step-02-classification', 'step-03-requirements', 'step-04-tools', 'step-05-plan-review', 'step-06-design', 'step-07-foundation', 'step-08-build-step-01', 'step-09-build-next-step', 'step-10-confirmation']
|
|
5
|
+
created: 2026-02-27
|
|
6
|
+
status: VALIDATED
|
|
7
|
+
approvedDate: 2026-02-27
|
|
8
|
+
confirmationDate: 2026-02-27
|
|
9
|
+
confirmationType: conversion
|
|
10
|
+
coverageStatus: complete
|
|
11
|
+
validationStatus: COMPLETE
|
|
12
|
+
validationDate: 2026-02-27
|
|
13
|
+
validationReport: validation-report.md
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Workflow Creation Plan
|
|
17
|
+
|
|
18
|
+
## Conversion Source
|
|
19
|
+
|
|
20
|
+
**Original Path:** src/workflows/create-stack-skill/create-stack-skill.spec.md
|
|
21
|
+
**Original Format:** Specification placeholder (spec.md) β not a running workflow, a design blueprint
|
|
22
|
+
**Detected Structure:** Single specification document defining a 9-step create-only workflow for generating consolidated stack skills with integration patterns
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Original Workflow Analysis
|
|
27
|
+
|
|
28
|
+
### Goal (from source)
|
|
29
|
+
|
|
30
|
+
Consolidated project stack skill with integration patterns. Analyzes a project's dependency manifests, detects significant libraries, discovers co-import integration points, and produces a consolidated stack skill. The stack SKILL.md focuses on integration patterns β how libraries connect in THIS specific codebase. References/ contain per-library subsets and integration pair documentation. Absorbs analyze-stack internally.
|
|
31
|
+
|
|
32
|
+
### Original Steps (Complete List)
|
|
33
|
+
|
|
34
|
+
**Step 01:** detect-manifests - Find and parse dependency files (package.json, requirements.txt, Cargo.toml, etc.)
|
|
35
|
+
**Step 02:** rank-dependencies - Rank libraries by import frequency, present ranked list for user confirmation
|
|
36
|
+
**Step 03:** scope-confirmation - User confirms which dependencies to include in the stack skill
|
|
37
|
+
**Step 04:** parallel-extract - Extract per-library documentation in parallel (uses max_parallel_generation)
|
|
38
|
+
**Step 05:** detect-integrations - Find co-import patterns and integration points between libraries
|
|
39
|
+
**Step 06:** compile-stack - Assemble the main stack SKILL.md with integration layer
|
|
40
|
+
**Step 07:** generate-references - Write per-library reference files and integration pair documentation
|
|
41
|
+
**Step 08:** validate - Validate output against specification
|
|
42
|
+
**Step 09:** report - Display stack summary with integration graph
|
|
43
|
+
|
|
44
|
+
### Output / Deliverable
|
|
45
|
+
|
|
46
|
+
Multi-file document-producing workflow:
|
|
47
|
+
- `{skills_output_folder}/{project}-stack/SKILL.md` β Main skill: integration patterns + conventions
|
|
48
|
+
- `{skills_output_folder}/{project}-stack/context-snippet.md` β Compressed stack index for context loading
|
|
49
|
+
- `{skills_output_folder}/{project}-stack/metadata.json` β Metadata with `skill_type: "stack"`
|
|
50
|
+
- `{skills_output_folder}/{project}-stack/references/{library}.md` β Per-library reference subsets
|
|
51
|
+
- `{skills_output_folder}/{project}-stack/references/integrations/{pair}.md` β Cross-library integration patterns
|
|
52
|
+
|
|
53
|
+
### Input Requirements
|
|
54
|
+
|
|
55
|
+
**Required:**
|
|
56
|
+
- Project root with dependency manifests
|
|
57
|
+
|
|
58
|
+
**Optional:**
|
|
59
|
+
- Explicit dependency list (skip auto-detection)
|
|
60
|
+
- Scope overrides per library
|
|
61
|
+
|
|
62
|
+
### Key Instructions to LLM
|
|
63
|
+
|
|
64
|
+
- Uses `manifest_reader` for dependency detection
|
|
65
|
+
- ADR-D: compositional architecture β modular, composable design
|
|
66
|
+
- ADR-E: smart scope with developer confirmation β auto-detect then confirm with user
|
|
67
|
+
- Primary agent: Ferris (Architect mode)
|
|
68
|
+
- Step 04 uses `max_parallel_generation` for parallel extraction
|
|
69
|
+
- Create-only mode (steps-c/ only)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Conversion Notes
|
|
74
|
+
|
|
75
|
+
**What works well in original:**
|
|
76
|
+
- Clear 9-step pipeline with logical progression (detect β rank β confirm β extract β analyze β compile β write β validate β report)
|
|
77
|
+
- Smart scope approach: auto-detect then user confirms
|
|
78
|
+
- Multi-file output structure with clear separation (main skill, context snippet, metadata, references)
|
|
79
|
+
- Integration-focused architecture β not just listing libraries but mapping how they connect
|
|
80
|
+
- Parallel extraction capability for performance
|
|
81
|
+
|
|
82
|
+
**What needs improvement:**
|
|
83
|
+
- Spec is a placeholder β no actual step file implementations exist
|
|
84
|
+
- No collaborative conversation patterns defined
|
|
85
|
+
- No menu handling or user interaction points specified beyond step 03
|
|
86
|
+
- No data files, templates, or schemas defined
|
|
87
|
+
- No error handling or fallback patterns
|
|
88
|
+
|
|
89
|
+
**Compliance gaps identified:**
|
|
90
|
+
- No workflow.md entry point file
|
|
91
|
+
- No step files with proper frontmatter (name, description, nextStepFile)
|
|
92
|
+
- No MANDATORY EXECUTION RULES sections
|
|
93
|
+
- No EXECUTION PROTOCOLS sections
|
|
94
|
+
- No menu handling logic defined
|
|
95
|
+
- No state tracking (stepsCompleted) integration
|
|
96
|
+
- No data/ folder with schemas or templates
|
|
97
|
+
- Missing web_bundle consideration for step file sizes
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Memory-Informed Discovery Notes
|
|
102
|
+
|
|
103
|
+
### Preserve (from established SKF patterns)
|
|
104
|
+
|
|
105
|
+
- 9-step pipeline with integration-centric design (mapping library connections, not just listing)
|
|
106
|
+
- Multi-file output structure matching SKF conventions (SKILL.md, context-snippet.md, metadata.json, references/)
|
|
107
|
+
- User confirmation gate at step 03 aligns with ADR-E smart scope pattern
|
|
108
|
+
- Parallel extraction at step 04 architecturally sound for multi-library processing
|
|
109
|
+
- Logical progression: detect β rank β confirm β extract β analyze β compile β write β validate β report
|
|
110
|
+
|
|
111
|
+
### Address (gaps identified from memory)
|
|
112
|
+
|
|
113
|
+
- `manifest_reader` does not exist β needs self-contained dependency detection with fallback chain (npm/PyPI/crates.io/Cargo registry APIs β file parsing β web search)
|
|
114
|
+
- No forge-tier awareness β must implement Quick/Forge/Deep tier behavior matching create-skill, quick-skill, test-skill, export-skill patterns
|
|
115
|
+
- No tool bridge specifications β needs gh_bridge (all tiers), ast_bridge (Forge/Deep), qmd_bridge (Deep only)
|
|
116
|
+
- No error handling matrix β needs hard halt / graceful degradation / silent skip / advisory categories
|
|
117
|
+
- "Absorbs analyze-stack internally" undefined β must define concrete analyze-stack functionality within steps 01-05
|
|
118
|
+
- SKF module config.yaml does not exist yet β setup-forge prerequisite must create it
|
|
119
|
+
|
|
120
|
+
### Add (enhancements from ecosystem patterns)
|
|
121
|
+
|
|
122
|
+
- Forge-tier dependent extraction: Quick = source reading + basic import counting; Forge = ast_bridge for structural co-import detection; Deep = qmd_bridge for temporal integration evolution
|
|
123
|
+
- Confidence tier labeling (T1 AST-verified, T1-low source reading, T2 QMD-enriched) matching create-skill pattern
|
|
124
|
+
- Workflow chaining: prerequisite = setup-forge; downstream = test-skill, export-skill
|
|
125
|
+
- Positive capability framing in reporting ("Stack forged: {name} β {lib_count} libraries, {integration_count} integration patterns")
|
|
126
|
+
- Error handling matrix following established 7-scenario pattern from create-skill design
|
|
127
|
+
|
|
128
|
+
### Audience
|
|
129
|
+
|
|
130
|
+
- Ferris in Architect mode β consistent with spec and all SKF creation workflows
|
|
131
|
+
- Target: developers wanting consolidated view of how their project's dependencies integrate
|
|
132
|
+
- Phase 1b (Entry Points) build priority
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Classification Decisions
|
|
137
|
+
|
|
138
|
+
**Workflow Name:** create-stack-skill
|
|
139
|
+
**Target Path:** src/workflows/create-stack-skill/ (spec) / _bmad-output/bmb-creations/workflows/create-stack-skill/ (build output)
|
|
140
|
+
|
|
141
|
+
**4 Key Decisions:**
|
|
142
|
+
1. **Document Output:** false β compile-then-write action pattern (collects data steps 01-05, compiles step 06, writes step 07), consistent with create-skill classification
|
|
143
|
+
2. **Module Affiliation:** skf β SKF module, consistent with all Skill Forge workflows
|
|
144
|
+
3. **Session Type:** single-session β consistent with all SKF workflows; subprocess calls (max_parallel_generation) handle heavy lifting outside main context
|
|
145
|
+
4. **Lifecycle Support:** create-only β stack skills regenerated fresh when dependencies change, no incremental editing
|
|
146
|
+
|
|
147
|
+
**Structure Implications:**
|
|
148
|
+
- `steps-c/` only β no edit or validate folders
|
|
149
|
+
- Standard init step (no step-01b continuation)
|
|
150
|
+
- No stepsCompleted tracking in output (non-document, action-based)
|
|
151
|
+
- SKF module variables: `skills_output_folder`, `forge_data_folder`, `forge-tier`
|
|
152
|
+
- Subprocess support needed for `max_parallel_generation` at step 04
|
|
153
|
+
- Installed path: `{project-root}/_bmad/skf/workflows/create-stack-skill`
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Requirements
|
|
158
|
+
|
|
159
|
+
**Flow Structure:**
|
|
160
|
+
- Pattern: linear pipeline
|
|
161
|
+
- Phases: detect β rank β confirm β extract β analyze β compile β write β validate β report
|
|
162
|
+
- Estimated steps: 9 (matching spec)
|
|
163
|
+
- No looping or branching β straight through with confirmation gates
|
|
164
|
+
|
|
165
|
+
**User Interaction:**
|
|
166
|
+
- Style: mostly autonomous with strategic gates
|
|
167
|
+
- Decision points:
|
|
168
|
+
- Gate 1 (Step 03): Scope confirmation β user confirms library list after ranking
|
|
169
|
+
- Gate 2 (Step 06): Compile checkpoint β review assembled SKILL.md integration layer before writing
|
|
170
|
+
- Checkpoint frequency: 2 gates in 9-step pipeline (steps 03, 06)
|
|
171
|
+
|
|
172
|
+
**Inputs Required:**
|
|
173
|
+
- Required: Project root with dependency manifests (package.json, requirements.txt, Cargo.toml, go.mod, etc.)
|
|
174
|
+
- Required: setup-forge completed β forge-tier.yaml with tier and available tools
|
|
175
|
+
- Optional: Explicit dependency list (skip auto-detection)
|
|
176
|
+
- Optional: Scope overrides per library (include/exclude specific exports)
|
|
177
|
+
|
|
178
|
+
**Output Specifications:**
|
|
179
|
+
- Type: action (multi-file generation)
|
|
180
|
+
- Deliverable files in `{skills_output_folder}/{project}-stack/`:
|
|
181
|
+
- SKILL.md β Integration patterns + conventions (main skill)
|
|
182
|
+
- context-snippet.md β Compressed stack index (~30 tokens per lib, ADR-L)
|
|
183
|
+
- metadata.json β skill_type: "stack", library list, integration pair count
|
|
184
|
+
- references/{library}.md β Per-library API surface and key patterns
|
|
185
|
+
- references/integrations/{pair}.md β Cross-library integration patterns
|
|
186
|
+
- Workspace artifacts in `{forge_data_folder}/{project}-stack/`:
|
|
187
|
+
- provenance-map.json β Source tracking per library extraction
|
|
188
|
+
- evidence-report.md β Extraction evidence and confidence breakdown
|
|
189
|
+
- Frequency: single run per project (re-run when dependencies change)
|
|
190
|
+
|
|
191
|
+
**Success Criteria:**
|
|
192
|
+
- All confirmed libraries have reference files generated
|
|
193
|
+
- Integration pairs documented for detected co-import patterns
|
|
194
|
+
- SKILL.md has meaningful integration layer (not concatenated library docs)
|
|
195
|
+
- All content has confidence tier labels (T1/T1-low/T2)
|
|
196
|
+
- context-snippet.md within target token budget
|
|
197
|
+
- metadata.json valid against agentskills.io spec
|
|
198
|
+
- Positive capability framing: "Stack forged: {name} β {lib_count} libraries, {integration_count} integration patterns"
|
|
199
|
+
|
|
200
|
+
**Instruction Style:**
|
|
201
|
+
- Overall: prescriptive
|
|
202
|
+
- Notes: Mechanical compilation pipeline with Ferris Architect mode. Steps 01-02, 04-09 are autonomous processing. Only step 03 has collaborative scope confirmation. Matches create-skill and quick-skill prescriptive patterns.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Tools Configuration
|
|
207
|
+
|
|
208
|
+
**Core BMAD Tools:**
|
|
209
|
+
- **Party Mode:** excluded β prescriptive mechanical pipeline, no creative facilitation needed
|
|
210
|
+
- **Advanced Elicitation:** excluded β same reasoning, consistent with all SKF workflows
|
|
211
|
+
- **Brainstorming:** excluded β same reasoning
|
|
212
|
+
|
|
213
|
+
**LLM Features:**
|
|
214
|
+
- **Web-Browsing:** included β fetching library documentation during extraction (Phase 3), checking registry APIs during manifest resolution (Phase 1)
|
|
215
|
+
- **File I/O:** included β essential for reading manifests (Phase 1) and writing all output files (Phase 6)
|
|
216
|
+
- **Sub-Agents:** excluded β not needed for linear pipeline
|
|
217
|
+
- **Sub-Processes:** included β essential for Phase 3 parallel extraction via max_parallel_generation
|
|
218
|
+
|
|
219
|
+
**Memory:**
|
|
220
|
+
- Type: single-session
|
|
221
|
+
- Tracking: sidecar-file (forge-tier.yaml from setup-forge, read-only)
|
|
222
|
+
|
|
223
|
+
**External Integrations (pre-detected by setup-forge):**
|
|
224
|
+
- `gh_bridge` (all tiers) β GitHub API for repository access and source reading
|
|
225
|
+
- `ast_bridge` (Forge/Deep tiers) β ast-grep for structural import/export analysis and co-import detection
|
|
226
|
+
- `qmd_bridge` (Deep tier only) β QMD for temporal integration evolution patterns
|
|
227
|
+
- `skills_ref` β agentskills.io spec for validation (Step 08)
|
|
228
|
+
|
|
229
|
+
**Installation Requirements:**
|
|
230
|
+
- None new β all tools pre-detected by setup-forge prerequisite workflow
|
|
231
|
+
- User preference: no additional installation needed
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Workflow Design
|
|
236
|
+
|
|
237
|
+
### File Structure
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
create-stack-skill/
|
|
241
|
+
βββ workflow.md (entry point, Ferris Architect mode)
|
|
242
|
+
βββ data/
|
|
243
|
+
β βββ manifest-patterns.md (detection patterns per language ecosystem)
|
|
244
|
+
β βββ integration-patterns.md (co-import detection rules and known pairs)
|
|
245
|
+
β βββ stack-skill-template.md (SKILL.md section structure)
|
|
246
|
+
βββ steps-c/
|
|
247
|
+
βββ step-01-init.md (Init Non-Continuable with discovery)
|
|
248
|
+
βββ step-02-detect-manifests.md (Middle Simple, auto-proceed)
|
|
249
|
+
βββ step-03-rank-and-confirm.md (Middle Simple, P2 Gate 1)
|
|
250
|
+
βββ step-04-parallel-extract.md (Middle Simple, auto-proceed, subprocess)
|
|
251
|
+
βββ step-05-detect-integrations.md (Middle Simple, auto-proceed)
|
|
252
|
+
βββ step-06-compile-stack.md (Middle Simple, P2 Gate 2)
|
|
253
|
+
βββ step-07-generate-output.md (Middle Simple, auto-proceed)
|
|
254
|
+
βββ step-08-validate.md (Middle Simple, auto-proceed)
|
|
255
|
+
βββ step-09-report.md (Final)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Step Sequence Table
|
|
259
|
+
|
|
260
|
+
| Step | Name | Type | Menu | Key Refs |
|
|
261
|
+
|------|------|------|------|----------|
|
|
262
|
+
| 01 | init | Init Non-Continuable (discovery) | P3 auto-proceed | skfConfig, forgeTierFile |
|
|
263
|
+
| 02 | detect-manifests | Middle Simple | P3 auto-proceed | manifestPatterns |
|
|
264
|
+
| 03 | rank-and-confirm | Middle Simple | P2 C-only (Gate 1) | β |
|
|
265
|
+
| 04 | parallel-extract | Middle Simple | P3 auto-proceed | β |
|
|
266
|
+
| 05 | detect-integrations | Middle Simple | P3 auto-proceed | integrationPatterns |
|
|
267
|
+
| 06 | compile-stack | Middle Simple | P2 C-only (Gate 2) | stackSkillTemplate |
|
|
268
|
+
| 07 | generate-output | Middle Simple | P3 auto-proceed | β |
|
|
269
|
+
| 08 | validate | Middle Simple | P3 auto-proceed | β |
|
|
270
|
+
| 09 | report | Final | No nextStepFile | β |
|
|
271
|
+
|
|
272
|
+
### Step Action Plans
|
|
273
|
+
|
|
274
|
+
**Step 01 (init):**
|
|
275
|
+
- Load SKF module config from `_bmad/skf/config.yaml`
|
|
276
|
+
- Load forge-tier.yaml from sidecar: determine Quick/Forge/Deep tier and available tools
|
|
277
|
+
- Validate prerequisites: forge-tier.yaml exists, project root accessible
|
|
278
|
+
- Accept optional explicit dependency list (skip auto-detection if provided)
|
|
279
|
+
- Accept optional scope overrides per library
|
|
280
|
+
- Display init summary: project name, tier, available tools
|
|
281
|
+
- Auto-proceed to step 02
|
|
282
|
+
|
|
283
|
+
**Step 02 (detect-manifests):**
|
|
284
|
+
- Scan project root for dependency manifest files using manifest-patterns.md:
|
|
285
|
+
- JavaScript: package.json, package-lock.json
|
|
286
|
+
- Python: requirements.txt, setup.py, pyproject.toml, Pipfile
|
|
287
|
+
- Rust: Cargo.toml
|
|
288
|
+
- Go: go.mod
|
|
289
|
+
- Java: pom.xml, build.gradle
|
|
290
|
+
- Ruby: Gemfile
|
|
291
|
+
- (extensible via data file)
|
|
292
|
+
- Parse each manifest to extract dependency names and version constraints
|
|
293
|
+
- If explicit dependency list provided in step 01, skip detection and use that list
|
|
294
|
+
- Report: found X manifests, Y total dependencies
|
|
295
|
+
- Auto-proceed to step 03
|
|
296
|
+
|
|
297
|
+
**Step 03 (rank-and-confirm) β Gate 1:**
|
|
298
|
+
- Count import/require statements per dependency across codebase (Pattern 1 subprocess grep)
|
|
299
|
+
- Rank dependencies by import frequency (descending)
|
|
300
|
+
- Filter out trivially-used dependencies (< threshold imports)
|
|
301
|
+
- Present ranked table: library name, import count, manifest source
|
|
302
|
+
- User confirms which dependencies to include/exclude
|
|
303
|
+
- Gate 1: P2 C-only to confirm scope and proceed
|
|
304
|
+
|
|
305
|
+
**Step 04 (parallel-extract):**
|
|
306
|
+
- For each confirmed dependency, launch subprocess extraction (Pattern 4 parallel, max_parallel_generation):
|
|
307
|
+
- Quick tier: Read source files importing the library, extract usage patterns via source reading
|
|
308
|
+
- Forge tier: ast_bridge for structural export analysis, function signatures, type definitions
|
|
309
|
+
- Deep tier: qmd_bridge for temporal usage evolution, deprecated patterns, API migration history
|
|
310
|
+
- Each subprocess returns: library name, key exports, usage patterns, confidence tier label
|
|
311
|
+
- Aggregate results, report extraction summary (X libraries extracted, confidence distribution)
|
|
312
|
+
- Auto-proceed to step 05
|
|
313
|
+
|
|
314
|
+
**Step 05 (detect-integrations):**
|
|
315
|
+
- For each pair of confirmed libraries, detect co-import patterns:
|
|
316
|
+
- Files that import both libraries (Pattern 1 subprocess grep)
|
|
317
|
+
- Shared type definitions between libraries
|
|
318
|
+
- Middleware/pipeline chains involving multiple libraries
|
|
319
|
+
- Configuration bridges (one library configuring another)
|
|
320
|
+
- Event handler patterns crossing library boundaries
|
|
321
|
+
- Use integration-patterns.md for known integration pattern templates
|
|
322
|
+
- Build integration graph: nodes = libraries, edges = integration points with descriptions
|
|
323
|
+
- Auto-proceed to step 06
|
|
324
|
+
|
|
325
|
+
**Step 06 (compile-stack) β Gate 2:**
|
|
326
|
+
- Load stack-skill-template.md for SKILL.md section structure
|
|
327
|
+
- Compile SKILL.md:
|
|
328
|
+
- Header: project name, library count, integration summary
|
|
329
|
+
- Integration layer: cross-cutting patterns, middleware chains, shared types, config bridges
|
|
330
|
+
- Per-library sections: key exports, usage conventions, gotchas, confidence annotations
|
|
331
|
+
- Confidence tier labels throughout (T1 AST-verified, T1-low source reading, T2 QMD-enriched)
|
|
332
|
+
- Present compiled SKILL.md preview to user for review
|
|
333
|
+
- Gate 2: P2 C-only to confirm compilation and proceed to writing
|
|
334
|
+
|
|
335
|
+
**Step 07 (generate-output):**
|
|
336
|
+
- Write all deliverable files to `{skills_output_folder}/{project}-stack/`:
|
|
337
|
+
- SKILL.md (from compilation)
|
|
338
|
+
- context-snippet.md (~30 tokens per library, ADR-L two-line format)
|
|
339
|
+
- metadata.json (skill_type: "stack", library list, integration pair count, version)
|
|
340
|
+
- references/{library}.md for each confirmed library
|
|
341
|
+
- references/integrations/{pair}.md for each detected integration pair
|
|
342
|
+
- Write workspace artifacts to `{forge_data_folder}/{project}-stack/`:
|
|
343
|
+
- provenance-map.json (source tracking per library extraction)
|
|
344
|
+
- evidence-report.md (extraction evidence and confidence breakdown)
|
|
345
|
+
- Auto-proceed to step 08
|
|
346
|
+
|
|
347
|
+
**Step 08 (validate):**
|
|
348
|
+
- Validate output against agentskills.io spec via skills_ref
|
|
349
|
+
- Check: SKILL.md structure, metadata.json required fields, reference file completeness
|
|
350
|
+
- Verify all confidence tier labels present
|
|
351
|
+
- Report validation results (pass/fail with specific findings)
|
|
352
|
+
- Advisory: show warnings but continue to report
|
|
353
|
+
- Auto-proceed to step 09
|
|
354
|
+
|
|
355
|
+
**Step 09 (report) β Final:**
|
|
356
|
+
- Display: "Stack forged: {name} β {lib_count} libraries, {integration_count} integration patterns"
|
|
357
|
+
- Show confidence distribution table (T1/T1-low/T2 counts with descriptions)
|
|
358
|
+
- List all output files with purposes
|
|
359
|
+
- Conditional warnings display (only if warnings exist)
|
|
360
|
+
- Recommend next workflows: [TS] Test Skill, [ES] Export Skill
|
|
361
|
+
- Workflow complete
|
|
362
|
+
|
|
363
|
+
### Data Flow
|
|
364
|
+
|
|
365
|
+
```
|
|
366
|
+
step-01: tier, tools, optional_dep_list
|
|
367
|
+
β step-02: manifests[], raw_dependencies[]
|
|
368
|
+
β step-03: confirmed_dependencies[] (user-approved scope)
|
|
369
|
+
β step-04: per_library_extractions[] (exports, patterns, confidence)
|
|
370
|
+
β step-05: integration_graph {pairs[], shared_types[], chains[]}
|
|
371
|
+
β step-06: skill_content (compiled SKILL.md)
|
|
372
|
+
β step-07: written_files[] (all output artifacts)
|
|
373
|
+
β step-08: validation_result {pass/fail, findings[]}
|
|
374
|
+
β step-09: summary (console report)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Error Handling Matrix
|
|
378
|
+
|
|
379
|
+
| Scenario | Response |
|
|
380
|
+
|----------|----------|
|
|
381
|
+
| Missing forge-tier.yaml | Hard halt: "Run setup-forge first" |
|
|
382
|
+
| No manifests found | Hard halt: "No dependency manifests detected in project" |
|
|
383
|
+
| Inaccessible source code | Hard halt: "Cannot access source repository" |
|
|
384
|
+
| Library extraction failure (single) | Graceful degradation: skip library, note in report |
|
|
385
|
+
| No integrations detected | Graceful: "No co-import patterns found, stack contains library summaries only" |
|
|
386
|
+
| Validation failures | Advisory: show warnings, continue to report |
|
|
387
|
+
| Individual file write failure | Hard halt per file |
|
|
388
|
+
|
|
389
|
+
### Workflow Chaining
|
|
390
|
+
|
|
391
|
+
- **Prerequisites:** setup-forge (required β provides forge-tier.yaml)
|
|
392
|
+
- **Optional inputs:** skill-brief.yaml files for individual libraries (from brief-skill)
|
|
393
|
+
- **Downstream:** [TS] test-skill (recommended), [ES] export-skill (recommended)
|
|
394
|
+
- No prerequisites from brief-skill or create-skill (this is an independent entry point)
|
|
395
|
+
|
|
396
|
+
### Subprocess Optimization
|
|
397
|
+
|
|
398
|
+
| Step | Pattern | Operation | Returns |
|
|
399
|
+
|------|---------|-----------|---------|
|
|
400
|
+
| 03 | Pattern 1 (Grep) | Count imports per library across codebase | `{library: import_count}` pairs |
|
|
401
|
+
| 04 | Pattern 4 (Parallel) | Per-library extraction (max_parallel_generation) | Structured extraction per library |
|
|
402
|
+
| 05 | Pattern 1 (Grep) | Co-import file detection per library pair | File lists with co-imports |
|
|
403
|
+
|
|
404
|
+
Fallback for all: if subprocess unavailable, perform operations in main context thread.
|
|
405
|
+
|
|
406
|
+
### Role and Persona
|
|
407
|
+
|
|
408
|
+
- Ferris Architect mode β prescriptive precision execution
|
|
409
|
+
- Speed-first, zero hallucination: all content traces to actual code with file:line citations
|
|
410
|
+
- No creative facilitation, no A/P menus
|
|
411
|
+
- Positive capability framing in reporting
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Foundation Build Complete
|
|
416
|
+
|
|
417
|
+
**Created:**
|
|
418
|
+
- Folder structure at: `_bmad-output/bmb-creations/workflows/create-stack-skill/`
|
|
419
|
+
- `workflow.md` β Entry point with Ferris Architect mode, SKF config loading, zero-hallucination rules
|
|
420
|
+
- `data/manifest-patterns.md` β Detection patterns for 8 language ecosystems with import counting rules
|
|
421
|
+
- `data/integration-patterns.md` β 6 integration pattern types with detection signals and output format
|
|
422
|
+
- `data/stack-skill-template.md` β SKILL.md structure, context-snippet format, metadata.json schema, reference file structures
|
|
423
|
+
|
|
424
|
+
**Configuration:**
|
|
425
|
+
- Workflow name: create-stack-skill
|
|
426
|
+
- Continuable: no (single-session)
|
|
427
|
+
- Document output: no (action-based, multi-file generation)
|
|
428
|
+
- Mode: create-only (steps-c/ only)
|
|
429
|
+
- No output template needed (non-document)
|
|
430
|
+
|
|
431
|
+
**Next Steps:**
|
|
432
|
+
- Step 8: Build step-01-init.md
|
|
433
|
+
- Step 9: Build remaining steps 02-09 (iterative)
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Step 01 Build Complete
|
|
438
|
+
|
|
439
|
+
**Created:**
|
|
440
|
+
- steps-c/step-01-init.md
|
|
441
|
+
|
|
442
|
+
**Step Configuration:**
|
|
443
|
+
- Type: Init Non-Continuable (with input discovery for forge-tier.yaml)
|
|
444
|
+
- Input Discovery: yes (forge-tier.yaml from sidecar, optional explicit dependency list)
|
|
445
|
+
- Menu: P3 auto-proceed (no A/P, no user interaction)
|
|
446
|
+
- Next Step: step-02-detect-manifests
|
|
447
|
+
|
|
448
|
+
**No supporting files needed** β data files already created in foundation (manifest-patterns.md, integration-patterns.md, stack-skill-template.md)
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Steps 02-09 Build Complete
|
|
453
|
+
|
|
454
|
+
**All workflow steps built in sequence:**
|
|
455
|
+
|
|
456
|
+
| Step | File | Type | Menu |
|
|
457
|
+
|------|------|------|------|
|
|
458
|
+
| 02 | step-02-detect-manifests.md | Middle Simple | P3 auto-proceed |
|
|
459
|
+
| 03 | step-03-rank-and-confirm.md | Middle Simple | P2 C-only (Gate 1) |
|
|
460
|
+
| 04 | step-04-parallel-extract.md | Middle Simple | P3 auto-proceed |
|
|
461
|
+
| 05 | step-05-detect-integrations.md | Middle Simple | P3 auto-proceed |
|
|
462
|
+
| 06 | step-06-compile-stack.md | Middle Simple | P2 C-only (Gate 2) |
|
|
463
|
+
| 07 | step-07-generate-output.md | Middle Simple | P3 auto-proceed |
|
|
464
|
+
| 08 | step-08-validate.md | Middle Simple | P3 auto-proceed |
|
|
465
|
+
| 09 | step-09-report.md | Final | No nextStepFile |
|
|
466
|
+
|
|
467
|
+
**Subprocess Optimization Applied:**
|
|
468
|
+
- Step 03: Pattern 1 (Grep) β import counting across codebase
|
|
469
|
+
- Step 04: Pattern 4 (Parallel) β per-library extraction via max_parallel_generation
|
|
470
|
+
- Step 05: Pattern 1 (Grep) β co-import file detection per library pair
|
|
471
|
+
|
|
472
|
+
**User Gates:**
|
|
473
|
+
- Gate 1 (Step 03): Scope confirmation β user confirms library list after ranking
|
|
474
|
+
- Gate 2 (Step 06): Compile checkpoint β review SKILL.md integration layer before writing
|
|
475
|
+
|
|
476
|
+
**Supporting Files (created in foundation):**
|
|
477
|
+
- data/manifest-patterns.md β 8 ecosystem detection patterns
|
|
478
|
+
- data/integration-patterns.md β 6 integration type classifications
|
|
479
|
+
- data/stack-skill-template.md β SKILL.md, context-snippet, metadata, reference structures
|
|
480
|
+
|
|
481
|
+
**All 9 workflow steps + 3 data files + workflow.md entry point = complete workflow build.**
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-stack-skill
|
|
3
|
+
description: Consolidated project stack skill with integration patterns
|
|
4
|
+
web_bundle: true
|
|
5
|
+
installed_path: '{project-root}/_bmad/skf/workflows/create-stack-skill'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Stack Skill
|
|
9
|
+
|
|
10
|
+
**Goal:** Analyze a project's dependency manifests, detect significant libraries, discover co-import integration points, and produce a consolidated stack skill documenting how libraries connect in THIS specific codebase.
|
|
11
|
+
|
|
12
|
+
**Your Role:** In addition to your name, communication_style, and persona, you are also a dependency analyst and integration architect operating in Ferris Architect mode. You bring expertise in dependency analysis, cross-library integration patterns, and compositional architecture, while the user brings their project knowledge and scope preferences. Execute with prescriptive precision β every finding must trace to actual code with file:line citations.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## WORKFLOW ARCHITECTURE
|
|
17
|
+
|
|
18
|
+
This uses **step-file architecture** for disciplined execution:
|
|
19
|
+
|
|
20
|
+
### Core Principles
|
|
21
|
+
|
|
22
|
+
- **Micro-file Design**: Each step is a self-contained instruction file that must be followed exactly
|
|
23
|
+
- **Just-In-Time Loading**: Only the current step file is in memory β never load future step files until told to do so
|
|
24
|
+
- **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
|
|
25
|
+
- **Append-Only Building**: Build outputs by accumulating state across steps
|
|
26
|
+
- **Zero Hallucination**: All extracted content must trace to actual source code β no inferred or assumed patterns
|
|
27
|
+
|
|
28
|
+
### Step Processing Rules
|
|
29
|
+
|
|
30
|
+
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
|
31
|
+
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
|
32
|
+
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
|
33
|
+
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
|
34
|
+
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
|
35
|
+
|
|
36
|
+
### Critical Rules (NO EXCEPTIONS)
|
|
37
|
+
|
|
38
|
+
- π **NEVER** load multiple step files simultaneously
|
|
39
|
+
- π **ALWAYS** read entire step file before execution
|
|
40
|
+
- π« **NEVER** skip steps or optimize the sequence
|
|
41
|
+
- π― **ALWAYS** follow the exact instructions in the step file
|
|
42
|
+
- βΈοΈ **ALWAYS** halt at menus and wait for user input
|
|
43
|
+
- π **NEVER** create mental todo lists from future steps
|
|
44
|
+
- βοΈ **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
|
|
45
|
+
- β
YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## INITIALIZATION SEQUENCE
|
|
50
|
+
|
|
51
|
+
### 1. Module Configuration Loading
|
|
52
|
+
|
|
53
|
+
Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
|
|
54
|
+
|
|
55
|
+
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `skills_output_folder`, `forge_data_folder`, `sidecar_path`
|
|
56
|
+
|
|
57
|
+
### 2. First Step Execution
|
|
58
|
+
|
|
59
|
+
Load, read the full file and then execute `./steps-c/step-01-init.md` to begin the workflow.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Managed Section Format (ADR-J)
|
|
2
|
+
|
|
3
|
+
## Marker Format
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
<!-- SKF:BEGIN updated:{YYYY-MM-DD} -->
|
|
7
|
+
[SKF Skills]|{n} skills|{m} stack
|
|
8
|
+
|IMPORTANT: Prefer documented APIs over training data.
|
|
9
|
+
|
|
|
10
|
+
|{skill-snippet-1}
|
|
11
|
+
|
|
|
12
|
+
|{skill-snippet-2}
|
|
13
|
+
<!-- SKF:END -->
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Platform Target Files
|
|
17
|
+
|
|
18
|
+
| Platform | Flag Value | Target File |
|
|
19
|
+
|----------|-----------|-------------|
|
|
20
|
+
| Claude | `claude` (default) | CLAUDE.md |
|
|
21
|
+
| Cursor | `cursor` | .cursorrules |
|
|
22
|
+
| Copilot | `copilot` | AGENTS.md |
|
|
23
|
+
|
|
24
|
+
## Three-Case Logic
|
|
25
|
+
|
|
26
|
+
### Case 1: Create (No File Exists)
|
|
27
|
+
|
|
28
|
+
Target file does not exist. Create new file with managed section only.
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
<!-- SKF:BEGIN updated:{date} -->
|
|
32
|
+
{managed section content}
|
|
33
|
+
<!-- SKF:END -->
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Case 2: Append (File Exists, No Section)
|
|
37
|
+
|
|
38
|
+
Target file exists but contains no `<!-- SKF:BEGIN` marker. Append managed section at end of file.
|
|
39
|
+
|
|
40
|
+
1. Read existing file content
|
|
41
|
+
2. Append two blank lines
|
|
42
|
+
3. Append managed section with markers
|
|
43
|
+
4. Write file
|
|
44
|
+
|
|
45
|
+
### Case 3: Regenerate (Existing Section)
|
|
46
|
+
|
|
47
|
+
Target file contains `<!-- SKF:BEGIN` and `<!-- SKF:END -->` markers. Replace content between markers.
|
|
48
|
+
|
|
49
|
+
1. Read existing file content
|
|
50
|
+
2. Find `<!-- SKF:BEGIN` line (preserve everything before it)
|
|
51
|
+
3. Find `<!-- SKF:END -->` line (preserve everything after it)
|
|
52
|
+
4. Replace everything between markers (inclusive) with new managed section
|
|
53
|
+
5. Write file
|
|
54
|
+
|
|
55
|
+
## Regeneration: Full Index Rebuild
|
|
56
|
+
|
|
57
|
+
When regenerating (Case 3), rebuild the COMPLETE skill index:
|
|
58
|
+
|
|
59
|
+
1. Scan `{skills_output_folder}/*/context-snippet.md` for all exported skills
|
|
60
|
+
2. Count total skills and stack skills
|
|
61
|
+
3. Assemble all snippets into managed section
|
|
62
|
+
4. Sort alphabetically by skill name
|
|
63
|
+
5. Update the header line with correct counts
|
|
64
|
+
|
|
65
|
+
## Safety Rules
|
|
66
|
+
|
|
67
|
+
- NEVER modify content outside the `<!-- SKF:BEGIN/END -->` markers
|
|
68
|
+
- ALWAYS preserve existing file content above and below markers
|
|
69
|
+
- ALWAYS verify file was written correctly after write
|
|
70
|
+
- If write fails, report error β do not attempt partial writes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Context Snippet Format (ADR-L)
|
|
2
|
+
|
|
3
|
+
## Format Rules
|
|
4
|
+
|
|
5
|
+
- One format always β two-line per skill
|
|
6
|
+
- No adaptive format switching (consistent for agent parsing)
|
|
7
|
+
- ~30 tokens per skill target
|
|
8
|
+
- T1-now content only (AST-current, no annotations)
|
|
9
|
+
|
|
10
|
+
## Single Skill Snippet Template
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
{skill-name} β skills/{skill-name}/
|
|
14
|
+
exports: {export-1}, {export-2}, {export-3}, {export-4}, {export-5}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Stack Skill Snippet Template
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
{project}-stack β skills/{project}-stack/
|
|
21
|
+
stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
|
|
22
|
+
integrations: {pattern-1}, {pattern-2}, {pattern-3}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **exports**: Top 5 most-used exports from metadata.json `exports` array
|
|
28
|
+
- **stack**: Component versions from metadata.json `components` for stack skills
|
|
29
|
+
- **integrations**: Co-import patterns from metadata.json `integrations` for stack skills
|
|
30
|
+
- If fewer than 5 exports exist, list all available
|
|
31
|
+
- If no exports data available, omit the exports line (name + path only)
|
|
32
|
+
- Skill path is relative to project root
|