bmad-module-skill-forge 0.8.4 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +5 -3
  2. package/docs/bmad-synergy.md +183 -0
  3. package/docs/concepts.md +30 -2
  4. package/docs/examples.md +57 -17
  5. package/docs/getting-started.md +17 -0
  6. package/docs/how-it-works.md +143 -29
  7. package/docs/index.md +1 -1
  8. package/docs/workflows.md +43 -5
  9. package/package.json +1 -1
  10. package/src/README.md +47 -0
  11. package/src/agents/forger.agent.yaml +8 -0
  12. package/src/knowledge/agentskills-spec.md +3 -0
  13. package/src/knowledge/overview.md +1 -0
  14. package/src/knowledge/provenance-tracking.md +3 -0
  15. package/src/knowledge/skf-knowledge-index.csv +1 -0
  16. package/src/knowledge/skill-lifecycle.md +19 -7
  17. package/src/knowledge/version-paths.md +243 -0
  18. package/src/module-help.csv +2 -0
  19. package/src/workflows/README.md +9 -1
  20. package/src/workflows/analyze-source/data/skill-brief-schema.md +4 -0
  21. package/src/workflows/audit-skill/steps-c/step-01-init.md +10 -6
  22. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +1 -1
  23. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +1 -1
  24. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +1 -1
  25. package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +1 -1
  26. package/src/workflows/audit-skill/steps-c/step-06-report.md +1 -1
  27. package/src/workflows/brief-skill/data/skill-brief-schema.md +11 -0
  28. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +24 -1
  29. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +10 -0
  30. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +9 -0
  31. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +14 -1
  32. package/src/workflows/create-skill/data/skill-sections.md +2 -0
  33. package/src/workflows/create-skill/data/source-resolution-protocols.md +40 -4
  34. package/src/workflows/create-skill/steps-c/step-03-extract.md +1 -1
  35. package/src/workflows/create-skill/steps-c/step-05-compile.md +1 -0
  36. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +48 -32
  37. package/src/workflows/create-skill/steps-c/step-08-report.md +8 -7
  38. package/src/workflows/create-stack-skill/data/compose-mode-rules.md +12 -6
  39. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +4 -1
  40. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +11 -5
  41. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +1 -1
  42. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +1 -1
  43. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +40 -23
  44. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +6 -3
  45. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +5 -3
  46. package/src/workflows/drop-skill/steps-c/step-01-select.md +298 -0
  47. package/src/workflows/drop-skill/steps-c/step-02-execute.md +290 -0
  48. package/src/workflows/drop-skill/steps-c/step-03-report.md +135 -0
  49. package/src/workflows/drop-skill/workflow.md +63 -0
  50. package/src/workflows/export-skill/data/managed-section-format.md +33 -8
  51. package/src/workflows/export-skill/data/snippet-format.md +16 -4
  52. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +46 -7
  53. package/src/workflows/export-skill/steps-c/step-02-package.md +2 -2
  54. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +39 -7
  55. package/src/workflows/export-skill/steps-c/step-04-update-context.md +185 -13
  56. package/src/workflows/export-skill/steps-c/step-05-token-report.md +2 -2
  57. package/src/workflows/export-skill/steps-c/step-06-summary.md +26 -7
  58. package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +10 -0
  59. package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +2 -0
  60. package/src/workflows/quick-skill/steps-c/step-05-validate.md +1 -1
  61. package/src/workflows/quick-skill/steps-c/step-06-write.md +30 -14
  62. package/src/workflows/refine-architecture/steps-c/step-01-init.md +8 -3
  63. package/src/workflows/rename-skill/steps-c/step-01-select.md +281 -0
  64. package/src/workflows/rename-skill/steps-c/step-02-execute.md +391 -0
  65. package/src/workflows/rename-skill/steps-c/step-03-report.md +132 -0
  66. package/src/workflows/rename-skill/workflow.md +64 -0
  67. package/src/workflows/test-skill/steps-c/step-01-init.md +14 -6
  68. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +1 -1
  69. package/src/workflows/update-skill/data/remote-source-resolution.md +18 -4
  70. package/src/workflows/update-skill/steps-c/step-01-init.md +15 -8
  71. package/src/workflows/update-skill/steps-c/step-06-write.md +43 -13
  72. package/src/workflows/update-skill/steps-c/step-07-report.md +7 -5
  73. package/src/workflows/verify-stack/steps-c/step-01-init.md +8 -3
  74. package/tools/cli/lib/ui.js +24 -2
@@ -0,0 +1,243 @@
1
+ # Version-Aware Paths
2
+
3
+ ## Principle
4
+
5
+ Skills are stored in a version-nested directory structure that allows multiple versions to coexist. Each version directory contains a self-contained agentskills.io-compliant skill package. All workflows resolve skill paths through canonical templates defined here, ensuring consistency across the pipeline and compatibility with `skill.sh` / `npx skills` distribution tooling.
6
+
7
+ ## Rationale
8
+
9
+ Without version-aware paths:
10
+ - Updating a skill for cognee v0.6.0 overwrites the v0.5.0 skill — users pinned to v0.5.0 lose their instructions
11
+ - Audit and provenance comparisons cannot span version boundaries
12
+ - Skills cannot be distributed to registries that serve multiple versions
13
+
14
+ With version-aware paths:
15
+ - Multiple versions coexist under `{skill-name}/` — no data loss on update
16
+ - Provenance, evidence, and test reports are preserved per-version
17
+ - The inner `{skill-name}/` directory is a standalone agentskills.io package, directly installable via `npx skills add`
18
+
19
+ ## Path Templates
20
+
21
+ All workflows MUST use these templates when constructing paths. Never hardcode paths to skill artifacts.
22
+
23
+ ### skills_output_folder (Deliverables)
24
+
25
+ | Template | Resolves To | Usage |
26
+ |----------|------------|-------|
27
+ | `{skill_package}` | `{skills_output_folder}/{skill-name}/{version}/{skill-name}/` | Skill package root — where SKILL.md, metadata.json, context-snippet.md, references/, scripts/, assets/ live |
28
+ | `{skill_group}` | `{skills_output_folder}/{skill-name}/` | Parent directory for all versions of a skill |
29
+ | `{active_skill}` | `{skills_output_folder}/{skill-name}/active/{skill-name}/` | Resolved via `active` symlink — stable path to the current version |
30
+
31
+ ### forge_data_folder (Workspace Artifacts)
32
+
33
+ | Template | Resolves To | Usage |
34
+ |----------|------------|-------|
35
+ | `{forge_version}` | `{forge_data_folder}/{skill-name}/{version}/` | Version-specific workspace artifacts — provenance-map.json, evidence-report.md, extraction-rules.yaml, test-report |
36
+ | `{forge_group}` | `{forge_data_folder}/{skill-name}/` | Parent directory — contains skill-brief.yaml (version-independent) and version subdirectories |
37
+
38
+ ### Platform Paths (Unchanged — Flat)
39
+
40
+ | Platform | Root Path |
41
+ |----------|-----------|
42
+ | `claude` | `.claude/skills/{skill-name}/` |
43
+ | `cursor` | `.cursor/skills/{skill-name}/` |
44
+ | `copilot` | `.agents/skills/{skill-name}/` |
45
+ | _(legacy)_ | `skills/{skill-name}/` |
46
+
47
+ Platform paths are **not versioned**. The export workflow resolves the active version from the manifest and references its `{skill_package}` when building the managed section. The snippet `root:` always uses the flat platform path.
48
+
49
+ ## Directory Structure
50
+
51
+ ### skills_output_folder
52
+
53
+ ```
54
+ {skills_output_folder}/
55
+ .export-manifest.json
56
+ {skill-name}/
57
+ active -> {version}
58
+ {version}/
59
+ {skill-name}/
60
+ SKILL.md
61
+ metadata.json
62
+ context-snippet.md
63
+ references/
64
+ scripts/
65
+ assets/
66
+ {older-version}/
67
+ {skill-name}/
68
+ ...
69
+ {project}-stack/
70
+ active -> {version}
71
+ {version}/
72
+ {project}-stack/
73
+ SKILL.md
74
+ metadata.json
75
+ context-snippet.md
76
+ references/
77
+ integrations/
78
+ ```
79
+
80
+ The inner `{skill-name}/` directory IS the agentskills.io-compliant skill package. The version directory is an organizational wrapper. The `name` field in SKILL.md frontmatter matches the inner directory name — spec compliance is preserved.
81
+
82
+ ### forge_data_folder
83
+
84
+ ```
85
+ {forge_data_folder}/
86
+ {skill-name}/
87
+ skill-brief.yaml
88
+ {version}/
89
+ provenance-map.json
90
+ evidence-report.md
91
+ extraction-rules.yaml
92
+ test-report-{skill-name}.md
93
+ ```
94
+
95
+ `skill-brief.yaml` stays at `{forge_group}` level — the brief is a workflow input that defines extraction scope, not a versioned output.
96
+
97
+ ## Version Resolution
98
+
99
+ ### Writing Workflows (CS, QS, SS, US)
100
+
101
+ When writing artifacts, resolve `{version}` from the skill brief's `version` field (CS, SS), the extraction inventory (QS), or the updated metadata (US). Then:
102
+
103
+ 1. Create `{skill_group}` if it does not exist
104
+ 2. Create `{skill_package}` (including all parent directories)
105
+ 3. Write all deliverables to `{skill_package}`
106
+ 4. Create `{forge_version}` if it does not exist
107
+ 5. Write all workspace artifacts to `{forge_version}`
108
+ 6. Create or update the `active` symlink at `{skill_group}/active` pointing to `{version}`
109
+
110
+ ### Reading Workflows (EX, AS, TS, VS, RA)
111
+
112
+ When reading artifacts, resolve the skill path using the export manifest:
113
+
114
+ 1. Read `{skills_output_folder}/.export-manifest.json`
115
+ 2. Look up the skill name in `exports`
116
+ 3. Read `active_version` to get the target version
117
+ 4. Resolve to `{skill_package}` using the active version
118
+ 5. If manifest does not contain the skill: check for `active` symlink at `{skill_group}/active`
119
+ 6. If neither manifest nor symlink: fall back to flat-path resolution (migration — see below)
120
+
121
+ ### Manifest-Driven Snippet Scanning (EX Step-04)
122
+
123
+ Replace the glob-based snippet scan (`{skills_output_folder}/*/context-snippet.md`) with manifest-driven resolution:
124
+
125
+ 1. Read export manifest
126
+ 2. For each skill in the exported skill set: resolve `active_version` to get `{skill_package}`
127
+ 3. Read `{skill_package}/context-snippet.md`
128
+ 4. Filter and assemble as before
129
+
130
+ ## Export Manifest v2
131
+
132
+ The export manifest gains version awareness:
133
+
134
+ ```json
135
+ {
136
+ "schema_version": "2",
137
+ "exports": {
138
+ "skill-name": {
139
+ "active_version": "0.6.0",
140
+ "versions": {
141
+ "0.5.0": {
142
+ "platforms": ["claude"],
143
+ "last_exported": "2026-03-15",
144
+ "status": "archived"
145
+ },
146
+ "0.6.0": {
147
+ "platforms": ["claude", "copilot"],
148
+ "last_exported": "2026-04-04",
149
+ "status": "active"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ **Fields:**
158
+ - `schema_version`: `"2"` — enables v1-to-v2 migration detection
159
+ - `active_version`: The version whose `{skill_package}` supplies the context snippet for the managed section. Must match exactly one version with `status: "active"`
160
+ - `versions.{v}.status`: `"active"` (currently exported), `"archived"` (previously exported, retained on disk), `"deprecated"` (dropped via drop-skill workflow, excluded from all exports), `"draft"` (created but never exported)
161
+ - `versions.{v}.platforms`: Array of platforms this version was last exported to
162
+ - `versions.{v}.last_exported`: ISO date of the last export
163
+
164
+ **Only one version per skill can have `status: "active"` at any time.**
165
+
166
+ ## Skill Management Operations
167
+
168
+ Two workflows operate on the version-aware structure for skill lifecycle management:
169
+
170
+ ### Rename (RS - Rename Skill)
171
+
172
+ Renames a skill across all versions. Because the agentskills.io spec requires `name` to match parent directory name, a rename is a coordinated move across:
173
+ 1. Outer `{skill_group}` directory: `{skills_output_folder}/{old-name}/` → `{skills_output_folder}/{new-name}/`
174
+ 2. Inner `{skill-name}/` directories inside each version: `{version}/{old-name}/` → `{version}/{new-name}/`
175
+ 3. `SKILL.md` frontmatter `name:` field (in every version)
176
+ 4. `metadata.json` `name` field (in every version)
177
+ 5. `context-snippet.md` root paths and display name (in every version)
178
+ 6. `provenance-map.json` `skill_name` field (in every version under `{forge_group}`)
179
+ 7. `{forge_group}` directory: `{forge_data_folder}/{old-name}/` → `{forge_data_folder}/{new-name}/`
180
+ 8. Export manifest: remove old key, add new key with same version data
181
+ 9. Platform context files (CLAUDE.md, AGENTS.md, .cursorrules): rebuild managed sections
182
+
183
+ Rename is transactional — copy-verify-delete pattern. If any step fails, old skill remains intact. See `workflows/rename-skill/`.
184
+
185
+ ### Drop (DS - Drop Skill)
186
+
187
+ Drops a specific version or the entire skill with two modes:
188
+
189
+ **Soft drop (default):** Sets version status to `"deprecated"` in the export manifest. Files remain on disk. Export-skill excludes deprecated versions from all platform context files. Reversible by manually editing manifest back to `"active"`/`"archived"`.
190
+
191
+ **Hard drop (`--purge`):** Same as soft drop, plus deletes the version directory (`{skill_package}`) and forge data directory (`{forge_version}`). Irreversible.
192
+
193
+ **Active version guard:** Cannot drop the active version when other versions exist. The user must either switch active to another version first, or drop all versions at once.
194
+
195
+ **Skill-level drop:** Removes the entire `{skill_group}` from the manifest. If purge, also deletes `{skill_group}` and `{forge_group}` directories.
196
+
197
+ See `workflows/drop-skill/`.
198
+
199
+ ## Version Sanitization
200
+
201
+ Directory names use the semver version with `+{build}` metadata stripped:
202
+
203
+ | Source Version | Directory Name | Rule |
204
+ |---------------|---------------|------|
205
+ | `1.0.0` | `1.0.0` | Clean — no transformation |
206
+ | `0.5.0-beta.1` | `0.5.0-beta.1` | Pre-release preserved |
207
+ | `1.0.0-rc.2+build.456` | `1.0.0-rc.2` | Build metadata stripped per semver spec |
208
+ | `2.0.0+20260404` | `2.0.0` | Build metadata stripped |
209
+
210
+ Build metadata does not affect version precedence per the semver specification and is stripped to avoid filesystem issues with the `+` character.
211
+
212
+ ## Migration: Flat to Versioned
213
+
214
+ When a reading workflow encounters a skill at the flat path (`{skills_output_folder}/{skill-name}/SKILL.md` exists directly — no version subdirectory), it auto-migrates:
215
+
216
+ 1. Read `metadata.json` from the flat path to get the `version` field
217
+ 2. Create the versioned directory: `{skill_group}/{version}/{skill-name}/`
218
+ 3. Move all package files (SKILL.md, metadata.json, context-snippet.md, references/, scripts/, assets/) into the versioned location
219
+ 4. Create the `active` symlink: `{skill_group}/active -> {version}`
220
+ 5. If `{forge_data_folder}/{skill-name}/` contains provenance artifacts at the flat level (not in a version subdirectory):
221
+ - Create `{forge_version}`
222
+ - Move provenance-map.json, evidence-report.md, extraction-rules.yaml, test-report into `{forge_version}`
223
+ - Leave skill-brief.yaml at `{forge_group}` (it is already version-independent)
224
+ 6. If `.export-manifest.json` exists and lacks `schema_version`:
225
+ - Migrate to v2 schema: wrap existing entries with `active_version` and `versions` structure
226
+ - Set `schema_version: "2"`
227
+ 7. Report migration to user: "Migrated {skill-name} from flat to versioned layout ({version})"
228
+
229
+ **Migration preserves all content** — [MANUAL] sections, provenance, evidence reports, and scripts/assets are moved, not re-generated.
230
+
231
+ ## Anti-Patterns
232
+
233
+ - Hardcoding `{skills_output_folder}/{skill-name}/SKILL.md` without version resolution — always use `{skill_package}` template
234
+ - Storing `skill-brief.yaml` inside a version directory — the brief is version-independent
235
+ - Versioning platform root paths — platform paths stay flat, version lives in the forge workspace
236
+ - Using glob patterns to discover snippets across all versions — use the export manifest to resolve the active version
237
+ - Creating version directories with `+` in the name — strip build metadata
238
+
239
+ ## Related Fragments
240
+
241
+ - [agentskills-spec.md](agentskills-spec.md) — the format that `{skill_package}` contents must comply with
242
+ - [skill-lifecycle.md](skill-lifecycle.md) — how versioned artifacts flow through the pipeline
243
+ - [provenance-tracking.md](provenance-tracking.md) — provenance is version-bound and stored per-version in `{forge_version}`
@@ -9,6 +9,8 @@ skf,anytime,Update Skill,US,,_bmad/skf/workflows/skillforge/update-skill/workflo
9
9
  skf,anytime,Audit Skill,AS,,_bmad/skf/workflows/skillforge/audit-skill/workflow.md,skf_audit_skill,false,ferris,Audit Mode,"Drift detection between skill and current source code",,"drift report",
10
10
  skf,anytime,Test Skill,TS,,_bmad/skf/workflows/skillforge/test-skill/workflow.md,skf_test_skill,false,ferris,Audit Mode,"Cognitive completeness verification — quality gate before export",,"completeness score",
11
11
  skf,anytime,Export Skill,EX,,_bmad/skf/workflows/skillforge/export-skill/workflow.md,skf_export_skill,false,ferris,Delivery Mode,"Package for distribution and inject context into CLAUDE.md/AGENTS.md/.cursorrules",skills_output_folder,"agentskills.io package",
12
+ skf,anytime,Rename Skill,RS,,_bmad/skf/workflows/skillforge/rename-skill/workflow.md,skf_rename_skill,false,ferris,Management Mode,"Rename a skill across all its versions — transactional copy-verify-delete with platform context rebuild",skills_output_folder,"renamed skill group",
13
+ skf,anytime,Drop Skill,DS,,_bmad/skf/workflows/skillforge/drop-skill/workflow.md,skf_drop_skill,false,ferris,Management Mode,"Drop a specific skill version or an entire skill — soft (deprecate) or hard (purge) with platform context rebuild",skills_output_folder,"updated manifest",
12
14
  skf,anytime,Verify Stack,VS,,_bmad/skf/workflows/skillforge/verify-stack/workflow.md,skf_verify_stack,false,ferris,Audit Mode,"Pre-code stack feasibility verification against architecture and PRD documents",forge_data_folder,"feasibility-report-{project_name}.md",
13
15
  skf,anytime,Refine Architecture,RA,,_bmad/skf/workflows/skillforge/refine-architecture/workflow.md,skf_refine_architecture,false,ferris,Architect Mode,"Improve architecture doc using verified skill data and VS feasibility findings",output_folder,"refined-architecture-{project_name}.md",
14
16
  skf,anytime,Workflow Status,WS,,,skf_workflow_status,false,ferris,Reference,"Show current lifecycle position, active skill briefs, and forge tier status",,lifecycle status,
@@ -1,6 +1,6 @@
1
1
  # SKF Workflows
2
2
 
3
- Twelve workflows covering the full skill lifecycle — from source discovery through verified export, with pre-code architecture verification.
3
+ Fourteen workflows covering the full skill lifecycle — from source discovery through verified export, with pre-code architecture verification and post-distribution management.
4
4
 
5
5
  All workflows are triggered via Ferris (`@Ferris <code>`) and execute as step-by-step sequences with just-in-time step loading.
6
6
 
@@ -20,6 +20,8 @@ All workflows are triggered via Ferris (`@Ferris <code>`) and execute as step-by
20
20
  | AS | [audit-skill](audit-skill/workflow.md) | 6 | Audit | Drift detection between skill and current source code |
21
21
  | TS | [test-skill](test-skill/workflow.md) | 7 | Audit | Cognitive completeness verification — quality gate before export |
22
22
  | EX | [export-skill](export-skill/workflow.md) | 6 | Delivery | Package for distribution, inject into CLAUDE.md/AGENTS.md |
23
+ | RS | [rename-skill](rename-skill/workflow.md) | 3 | Management | Rename a skill across all versions (transactional copy-verify-delete) |
24
+ | DS | [drop-skill](drop-skill/workflow.md) | 3 | Management | Drop specific versions or whole skill (soft deprecate or hard purge) |
23
25
 
24
26
  ## Typical Flows
25
27
 
@@ -53,6 +55,12 @@ SF → CS×N (per library) → VS → RA → SS (compose) → TS → EX
53
55
  AS → US → TS → EX
54
56
  ```
55
57
 
58
+ **Management:**
59
+
60
+ ```
61
+ RS or DS → EX
62
+ ```
63
+
56
64
  ## Knowledge vs. Data
57
65
 
58
66
  The module uses two kinds of reference material, loaded just-in-time during workflow execution:
@@ -26,7 +26,9 @@ Defines the output contract for skill-brief.yaml files generated by analyze-sour
26
26
  | doc_urls | array | `{url, label}` objects | Documentation URLs for T3 content. Required when `source_type: "docs-only"` |
27
27
  | `scripts_intent` | string | `detect` / `none` / free-text | Describes whether scripts should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip scripts), or a free-text description of expected scripts (e.g., "CLI validation tools in bin/"). |
28
28
  | `assets_intent` | string | `detect` / `none` / free-text | Describes whether assets should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip assets), or a free-text description of expected assets (e.g., "JSON schemas in schemas/"). |
29
+ | `target_version` | string | Semantic version (`X.Y.Z` or `X.Y.Z-prerelease`) | User-specified target version. When present, overrides auto-detection and becomes the skill's version. Recommended for docs-only skills where auto-detection is unavailable. |
29
30
  | `source_authority` | string | `official` / `community` / `internal` | Default `community`. Set to `official` only when the skill creator is the library maintainer. Forced to `community` when `source_type: "docs-only"`. |
31
+ | `source_ref` | string | Git ref (tag/branch/HEAD) | Resolved git ref used for source access. Set automatically during tag resolution — do not set manually. |
30
32
 
31
33
  When `source_type: "docs-only"`:
32
34
  - `source_repo` becomes optional (set to doc site URL for reference)
@@ -49,6 +51,8 @@ If detection succeeds, use the detected version. If it fails or returns a non-se
49
51
 
50
52
  The create-skill workflow (step-03-extract) also performs version reconciliation at extraction time — if the source version has changed since the brief was created, the extraction step warns and uses the source version.
51
53
 
54
+ **Target version override:** When `target_version` is present in the brief, it takes precedence over auto-detection. Auto-detection still runs for informational purposes (displayed as "Detected version" alongside the user-specified "Target version"), but the `target_version` value is used as the brief's `version` field. This is particularly useful for docs-only skills (where no package manifest exists) and when the user wants to compile a skill for a specific older version.
55
+
52
56
  **Pre-release handling:** If the detected version contains a pre-release tag (e.g., `1.0.0-beta.0`, `2.0.0-rc.1`), preserve it as-is. Pre-release tags are valid semver and must not be stripped. When comparing versions during reconciliation, use semver-aware comparison that respects pre-release ordering.
53
57
 
54
58
  ## Scope Object
@@ -3,7 +3,7 @@ name: 'step-01-init'
3
3
  description: 'Load existing skill, provenance map, and detect forge tier for drift analysis'
4
4
 
5
5
  nextStepFile: './step-02-re-index.md'
6
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
6
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
7
7
  templateFile: '../data/drift-report-template.md'
8
8
  ---
9
9
 
@@ -63,14 +63,18 @@ Load the existing skill artifacts, provenance map, and forge tier configuration
63
63
 
64
64
  Which skill would you like to audit? Please provide the skill name or path."
65
65
 
66
- **If user provides skill name (not full path):**
67
- - Resolve to `{skills_output_folder}/{skill_name}/`
66
+ **If user provides skill name (not full path) — version-aware path resolution (see [knowledge/version-paths.md](../../../knowledge/version-paths.md)):**
67
+ 1. Read `{skills_output_folder}/.export-manifest.json` and look up the skill name in `exports` to get `active_version`
68
+ 2. If found: resolve to `{skill_package}` = `{skills_output_folder}/{skill_name}/{active_version}/{skill_name}/`
69
+ 3. If not in manifest: check for `active` symlink at `{skills_output_folder}/{skill_name}/active` — resolve to `{skill_group}/active/{skill_name}/`
70
+ 4. If neither: fall back to flat path `{skills_output_folder}/{skill_name}/`. If SKILL.md exists at the flat path, auto-migrate per `knowledge/version-paths.md` migration rules
71
+ 5. Store the resolved path as `{resolved_skill_package}`
68
72
 
69
73
  **If user provides full path:**
70
74
  - Use as provided
71
75
 
72
76
  **Validate:** Check that `SKILL.md` exists at the resolved path.
73
- - If missing → "Skill not found at `{resolved_path}`. Check the path and try again."
77
+ - If missing → "Skill not found at `{resolved_skill_package}`. Check the path and try again."
74
78
  - If found → Continue
75
79
 
76
80
  ### 2. Load Forge Tier
@@ -103,13 +107,13 @@ Load the following from the skill directory:
103
107
 
104
108
  ### 4. Load Provenance Map
105
109
 
106
- Search for provenance map at `{forge_data_folder}/{skill_name}/provenance-map.json`
110
+ Search for provenance map at `{forge_data_folder}/{skill_name}/{active_version}/provenance-map.json` (i.e., `{forge_version}/provenance-map.json`). If not found at the versioned path, fall back to `{forge_data_folder}/{skill_name}/provenance-map.json`:
107
111
 
108
112
  **If found:**
109
113
  - Load and extract: export list, file mappings, extraction timestamps, confidence tiers
110
114
  - Record provenance map age (days since last extraction)
111
115
 
112
- **If missing:**
116
+ **If missing at both paths:**
113
117
  - "No provenance map found for `{skill_name}`. This skill may not have been created by create-skill."
114
118
  - "**Degraded mode available:** I can perform text-based comparison without provenance data. Findings will have T1-low confidence."
115
119
  - "**[D]egraded mode** — proceed with text-diff only"
@@ -3,7 +3,7 @@ name: 'step-02-re-index'
3
3
  description: 'Re-scan source code with current tier tools to build fresh extraction snapshot'
4
4
 
5
5
  nextStepFile: './step-03-structural-diff.md'
6
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
6
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
7
7
  ---
8
8
 
9
9
  # Step 2: Re-Index Source
@@ -3,7 +3,7 @@ name: 'step-03-structural-diff'
3
3
  description: 'Compare original provenance map extractions against current scan to detect structural drift'
4
4
 
5
5
  nextStepFile: './step-04-semantic-diff.md'
6
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
6
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
7
7
  ---
8
8
 
9
9
  # Step 3: Structural Diff
@@ -3,7 +3,7 @@ name: 'step-04-semantic-diff'
3
3
  description: 'Compare QMD knowledge context for meaning-level changes (Deep tier only, skip at Quick/Forge/Forge+)'
4
4
 
5
5
  nextStepFile: './step-05-severity-classify.md'
6
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
6
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
7
7
  ---
8
8
 
9
9
  # Step 4: Semantic Diff
@@ -3,7 +3,7 @@ name: 'step-05-severity-classify'
3
3
  description: 'Grade every drift finding by severity using classification rules'
4
4
 
5
5
  nextStepFile: './step-06-report.md'
6
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
6
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
7
7
  severityRulesFile: '../data/severity-rules.md'
8
8
  ---
9
9
 
@@ -2,7 +2,7 @@
2
2
  name: 'step-06-report'
3
3
  description: 'Finalize drift report with audit summary, remediation suggestions, and provenance metadata'
4
4
 
5
- outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
5
+ outputFile: '{forge_version}/drift-report-{timestamp}.md'
6
6
  ---
7
7
 
8
8
  # Step 6: Generate Report
@@ -22,7 +22,9 @@
22
22
  | doc_urls | array | `{url, label}` objects | Documentation URLs for T3 content. Required when `source_type: "docs-only"` |
23
23
  | `scripts_intent` | string | `detect` / `none` / free-text | Describes whether scripts should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip scripts), or a free-text description of expected scripts (e.g., "CLI validation tools in bin/"). |
24
24
  | `assets_intent` | string | `detect` / `none` / free-text | Describes whether assets should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip assets), or a free-text description of expected assets (e.g., "JSON schemas in schemas/"). |
25
+ | `target_version` | string | Semantic version (`X.Y.Z` or `X.Y.Z-prerelease`) | User-specified target version. When present, overrides auto-detection and becomes the skill's version. Recommended for docs-only skills where auto-detection is unavailable. |
25
26
  | `source_authority` | string | `official` / `community` / `internal` | Default `community`. Set to `official` only when the skill creator is the library maintainer. Forced to `community` when `source_type: "docs-only"`. |
27
+ | `source_ref` | string | Git ref (tag/branch/HEAD) | Resolved git ref used for source access. Set automatically during tag resolution — do not set manually. |
26
28
 
27
29
  When `source_type: "docs-only"`:
28
30
  - `source_repo` becomes optional (set to doc site URL for reference)
@@ -45,6 +47,8 @@ If detection succeeds, use the detected version. If it fails or returns a non-se
45
47
 
46
48
  The create-skill workflow (step-03-extract) also performs version reconciliation at extraction time — if the source version has changed since the brief was created, the extraction step warns and uses the source version.
47
49
 
50
+ **Target version override:** When `target_version` is present in the brief, it takes precedence over auto-detection. Auto-detection still runs for informational purposes (displayed as "Detected version" alongside the user-specified "Target version"), but the `target_version` value is used as the brief's `version` field. This is particularly useful for docs-only skills (where no package manifest exists) and when the user wants to compile a skill for a specific older version.
51
+
48
52
  **Pre-release handling:** If the detected version contains a pre-release tag (e.g., `1.0.0-beta.0`, `2.0.0-rc.1`), preserve it as-is. Pre-release tags are valid semver and must not be stripped. When comparing versions during reconciliation, use semver-aware comparison that respects pre-release ordering.
49
53
 
50
54
  ## Scope Object Structure
@@ -88,6 +92,8 @@ scope:
88
92
  exclude:
89
93
  - "{pattern}"
90
94
  notes: "{optional-scope-notes}"
95
+ # target_version: "X.Y.Z" # Optional: overrides auto-detection when specified
96
+ # source_ref: "v0.5.0" # Auto-resolved — do not set manually
91
97
  # Optional: documentation URLs for T3 content (required when source_type: "docs-only")
92
98
  # doc_urls:
93
99
  # - url: "https://docs.example.com/api"
@@ -131,7 +137,12 @@ Assets: {assets_intent}
131
137
 
132
138
  Source Authority: {source_authority}
133
139
 
140
+ {If target_version is set:}
141
+ Target Version: {target_version} (user-specified)
142
+ Detected Version: {detected_version or "N/A"}
143
+ {Else:}
134
144
  Version: {version}
145
+ {End if}
135
146
  Created: {created}
136
147
  Created by: {created_by}
137
148
  ```
@@ -96,7 +96,7 @@ Let's get started."
96
96
  Provide one of:
97
97
  - A **GitHub URL** (e.g., `https://github.com/org/repo`)
98
98
  - A **local path** (e.g., `/path/to/project`)
99
- - **Documentation URLs** for a docs-only skill (e.g., `https://docs.cognee.ai/`) — use this when no source code is available (SaaS, closed-source)
99
+ - **Documentation URLs** for a docs-only skill (e.g., `https://docs.stripe.com/api`) — use this when no source code is available (SaaS, closed-source)
100
100
 
101
101
  **Target:**"
102
102
 
@@ -123,6 +123,26 @@ Default to `"community"` if user does not specify or skips. For `docs-only` skil
123
123
 
124
124
  Confirm the target.
125
125
 
126
+ ### 3b. Gather Target Version
127
+
128
+ "**Are you targeting a specific version of this library?**
129
+ (Leave blank to auto-detect from source)"
130
+
131
+ {If source_type is "docs-only":}
132
+ "Since this is a docs-only skill with no source code, specifying the version is recommended — otherwise it defaults to 1.0.0."
133
+
134
+ Wait for user response.
135
+
136
+ **If user provides a version:** Store as `target_version`. Set `version` to this value.
137
+ **If blank:** Proceed without `target_version` — version will be auto-detected in step 02.
138
+
139
+ {If target_version was set AND doc_urls are being collected (either docs-only primary or supplemental):}
140
+
141
+ "**You're targeting version {target_version}. Do these documentation URLs correspond to that version?** [Y/N]"
142
+
143
+ - **If Y:** Proceed.
144
+ - **If N:** "Please provide the correct documentation URLs for version {target_version}." Re-collect doc_urls.
145
+
126
146
  ### 4. Gather User Intent
127
147
 
128
148
  "**What's your intent for this skill?**
@@ -167,6 +187,8 @@ Wait for confirmation or alternative.
167
187
  - **Skill name:** {confirmed name}
168
188
  - **Source type:** {source or docs-only}
169
189
  - **Source authority:** {official/community/internal}
190
+ {If target_version set:}
191
+ - **Target version:** {target_version} (user-specified)
170
192
  {If doc_urls collected:}
171
193
  - **Doc URLs:** {count} supplemental documentation URLs
172
194
  - **Forge tier:** {tier}
@@ -203,6 +225,7 @@ ONLY WHEN C is selected and target repository is confirmed will you load and rea
203
225
  - Skill name derived and confirmed
204
226
  - Scope hints noted (if provided)
205
227
  - Source type and source authority captured
228
+ - Target version captured (if provided)
206
229
  - User ready to proceed to analysis
207
230
 
208
231
  ### ❌ SYSTEM FAILURE:
@@ -161,6 +161,10 @@ If CCC is unavailable or returns no results: skip this subsection silently.
161
161
 
162
162
  ### 4b. Detect Source Version
163
163
 
164
+ **If `target_version` was provided in step 01:**
165
+ - Display: "**Target version:** {target_version} (user-specified)"
166
+ - Still run auto-detection below for informational purposes.
167
+
164
168
  Attempt to auto-detect the source version using the rules from the skill-brief-schema.md Version Detection section:
165
169
 
166
170
  **For Python:** Check `pyproject.toml` `[project] version` (static) → if `dynamic = ["version"]`, check `__init__.py` for `__version__` → `_version.py` if exists → `setup.py` `version=` → `git describe --tags --abbrev=0`
@@ -173,6 +177,12 @@ Attempt to auto-detect the source version using the rules from the skill-brief-s
173
177
 
174
178
  Display: "**Detected version:** {version or 'Not detected — will default to 1.0.0'}"
175
179
 
180
+ {If target_version was provided AND auto-detected version differs:}
181
+ "**Note:** Detected version ({detected_version}) differs from your target version ({target_version}). Using target version."
182
+
183
+ {If target_version was provided:}
184
+ Store `target_version` as the brief's `version` field (overrides auto-detection).
185
+
176
186
  If detection fails or returns a non-semver value: note that version will default to `"1.0.0"` and the user can override in step 04.
177
187
 
178
188
  ### 5. Report Analysis Summary
@@ -68,6 +68,7 @@ Compile all gathered data from steps 01-03 into the complete brief:
68
68
 
69
69
  - **name:** {skill name from step 01}
70
70
  - **version:** {auto-detected from source, or "1.0.0" if not found — see schema for detection rules}
71
+ - **target_version:** {target_version from step 01, if set}
71
72
  - **source_repo:** {target repo from step 01}
72
73
  - **language:** {detected/confirmed language from steps 02-03}
73
74
  - **description:** {derived from user intent in step 01}
@@ -121,7 +122,12 @@ Assets: {assets_intent}
121
122
 
122
123
  Source Authority: {source_authority}
123
124
 
125
+ {If target_version is set:}
126
+ Target Version: {target_version} (user-specified)
127
+ Detected Version: {detected_version or "N/A"}
128
+ {Else:}
124
129
  Version: {version}
130
+
125
131
  Created: {created}
126
132
  Created by: {created_by}
127
133
  ```
@@ -144,6 +150,9 @@ Flag any fields that may need review:
144
150
  {If any scope patterns seem broad or narrow:}
145
151
  "**Note:** {specific observation about scope breadth}."
146
152
 
153
+ {If target_version is set AND detected_version exists AND they differ:}
154
+ "**Note:** Target version ({target_version}) differs from detected source version ({detected_version}). The target version will be used for compilation."
155
+
147
156
  "**This is your last chance to make changes before writing the file.**
148
157
 
149
158
  You can:
@@ -67,12 +67,19 @@ If `{forge_data_folder}` is not set or doesn't exist:
67
67
 
68
68
  ### 3. Generate skill-brief.yaml
69
69
 
70
+ **Resolve the `version` field before generating the YAML:**
71
+
72
+ - If `target_version` was set in step 01 (the user explicitly asked for a specific version), use `target_version` as the value of the `version` field. This is the authoritative version for create-skill.
73
+ - Otherwise, use the auto-detected source version from step 02, or `1.0.0` if none was detected.
74
+
75
+ `target_version` and `version` must never carry different values in the written brief. When the user provided a `target_version`, also include it as a separate `target_version` field so downstream tooling can distinguish "user-requested" from "auto-detected" without re-deriving the provenance — but its value must be identical to `version`.
76
+
70
77
  Generate the YAML file using the approved field values and the schema template:
71
78
 
72
79
  ```yaml
73
80
  ---
74
81
  name: "{approved skill name}"
75
- version: "{detected source version or 1.0.0}"
82
+ version: "{resolved version — target_version if set, else detected source version, else 1.0.0}"
76
83
  source_type: "{source or docs-only}"
77
84
  source_repo: "{approved source repo or doc site URL}"
78
85
  language: "{approved language}"
@@ -92,6 +99,12 @@ scope:
92
99
 
93
100
  **Conditional optional field inclusion:**
94
101
 
102
+ **If `target_version` was set in step 01:**
103
+ Include the `target_version` field in the generated YAML — its value MUST be identical to the `version` field above:
104
+ ```yaml
105
+ target_version: "{target_version — same value as version}"
106
+ ```
107
+
95
108
  **If `source_type: "docs-only"` OR supplemental `doc_urls` were collected:**
96
109
  Include the `doc_urls` array (uncommented) in the generated YAML:
97
110
  ```yaml
@@ -196,6 +196,7 @@ Indexed pipe-delimited format for CLAUDE.md managed section (~80-120 tokens per
196
196
  "source_repo": "{github-url}",
197
197
  "source_root": "{resolved-source-path}",
198
198
  "source_commit": "{commit-hash}",
199
+ "source_ref": "{source_ref or null}",
199
200
  "confidence_tier": "{Quick|Forge|Forge+|Deep}",
200
201
  "spec_version": "1.3",
201
202
  "generation_date": "{ISO-8601}",
@@ -264,6 +265,7 @@ Each reference file includes:
264
265
  "skill_name": "{name}",
265
266
  "source_repo": "{url}",
266
267
  "source_commit": "{hash}",
268
+ "source_ref": "v0.5.0",
267
269
  "generated_at": "{ISO-8601}",
268
270
  "entries": [
269
271
  {