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,135 @@
1
+ ---
2
+ name: 'step-03-report'
3
+ description: 'Report drop operation results'
4
+ ---
5
+
6
+ # Step 3: Report Drop Results
7
+
8
+ ## STEP GOAL:
9
+
10
+ Present a clear, final summary of what the drop workflow changed — manifest state, platform context files, deleted directories, disk freed, and remaining versions — so the user can verify the outcome and know whether any manual follow-up is required.
11
+
12
+ ## MANDATORY EXECUTION RULES (READ FIRST):
13
+
14
+ ### Universal Rules:
15
+
16
+ - 🛑 NEVER modify any files in this step — report only
17
+ - 📖 CRITICAL: Read the complete step file before taking any action
18
+ - 📋 YOU ARE A FACILITATOR, summarizing what step-02 already executed
19
+ - ⚙️ 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
20
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
21
+
22
+ ### Role Reinforcement:
23
+
24
+ - ✅ You are Ferris in Management mode — summarizing a destructive operation with precision
25
+ - ✅ Be explicit about what changed and what did not — no glossing over partial failures
26
+ - ✅ Surface recovery guidance when any stage in step-02 reported an error
27
+
28
+ ### Step-Specific Rules:
29
+
30
+ - 🎯 Focus only on reporting the results stored in context by step-02
31
+ - 🚫 FORBIDDEN to re-execute any part of the drop
32
+ - 🚫 FORBIDDEN to hide verification errors or failed platform rebuilds
33
+ - 💬 Present the final state clearly, including remaining versions for the affected skill
34
+
35
+ ## EXECUTION PROTOCOLS:
36
+
37
+ - 🎯 Render the report using the context values set in step-02 (`target_skill`, `target_versions`, `drop_mode`, `is_skill_level`, `files_deleted`, `disk_freed`, `manifest_updated`, `platform_files_updated`, `platform_files_failed`, `verification_errors`)
38
+ - 📖 For the "remaining versions" section, re-read `{skills_output_folder}/.export-manifest.json` (already updated by step-02) to show the current state
39
+ - 💬 Include the reversibility note only when `drop_mode == "deprecate"`
40
+
41
+ ## CONTEXT BOUNDARIES:
42
+
43
+ - Available: All decision and result values stored in context by step-01 and step-02, plus the updated export manifest on disk
44
+ - Focus: Rendering the final report
45
+ - Limits: No file writes, no deletions, no further execution
46
+ - Dependencies: Step-02 must have completed (or attempted all stages) and stored its results
47
+
48
+ ## MANDATORY SEQUENCE
49
+
50
+ **CRITICAL:** Follow this sequence exactly.
51
+
52
+ ### 1. Determine Remaining Versions
53
+
54
+ **If `is_skill_level == true`:**
55
+
56
+ Set `remaining_versions_display = "(skill fully removed)"`.
57
+
58
+ **If `is_skill_level == false`:**
59
+
60
+ Read `{skills_output_folder}/.export-manifest.json` and look up `exports.{target_skill}.versions`. Build a human-readable list of every remaining version with its status, with the active one marked:
61
+
62
+ ```
63
+ - 0.1.0 (deprecated)
64
+ - 0.5.0 (archived)
65
+ - 0.6.0 (active) *
66
+ ```
67
+
68
+ ### 2. Render the Report
69
+
70
+ Display the following block, filling in values from context:
71
+
72
+ ```
73
+ **Drop operation complete.**
74
+
75
+ Operation: {Deprecate | Purge}
76
+ Skill: {target_skill}
77
+ Version(s): {comma-separated target_versions or "ALL"}
78
+
79
+ Changes:
80
+ - Manifest updated: {yes | no}
81
+ - Platform files rebuilt: {list from platform_files_updated, or "(none)"}
82
+ {if platform_files_failed is non-empty:}
83
+ - Platform files FAILED: {list from platform_files_failed}
84
+ {if drop_mode == "purge":}
85
+ - Files deleted: {list from files_deleted, or "(none — nothing on disk)"}
86
+ - Disk space freed: {disk_freed}
87
+
88
+ Remaining versions for {target_skill}:
89
+ {remaining_versions_display}
90
+
91
+ {if drop_mode == "deprecate":}
92
+ **Note:** Files remain on disk. This operation is reversible by manually editing
93
+ `{skills_output_folder}/.export-manifest.json` and changing the version's `status`
94
+ field back to `"active"` or `"archived"`, then re-running `[EX] Export Skill` to
95
+ restore the managed section entry.
96
+
97
+ {if verification_errors is non-empty:}
98
+ **Verification warnings:**
99
+ {list each verification error}
100
+ These require manual review — see the error-handling guidance in step-02.
101
+ ```
102
+
103
+ ### 3. Close the Workflow
104
+
105
+ After rendering the report, the workflow is complete. Do not load any further step file — there is no `nextStepFile`.
106
+
107
+ ## CRITICAL STEP COMPLETION NOTE
108
+
109
+ This is the final step. Once the report has been rendered, the drop-skill workflow is finished. Do not re-run any earlier step automatically — if the user wants another drop, they should re-invoke the workflow from the top.
110
+
111
+ ---
112
+
113
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
114
+
115
+ ### ✅ SUCCESS:
116
+
117
+ - Report rendered with operation type, skill, version(s), and mode
118
+ - Manifest update outcome clearly stated (yes/no)
119
+ - Platform files rebuilt listed (and failures surfaced when present)
120
+ - Purge mode: files deleted and disk freed reported
121
+ - Soft drop: reversibility note included with concrete instructions
122
+ - Remaining versions for the affected skill accurately listed from the updated manifest (or "(skill fully removed)" for skill-level drops)
123
+ - Verification warnings surfaced, not hidden
124
+ - No further file writes or executions performed
125
+
126
+ ### ❌ SYSTEM FAILURE:
127
+
128
+ - Hiding failed platform rebuilds or verification errors
129
+ - Reporting "complete" when step-02 partially failed without flagging it
130
+ - Reading stale manifest data instead of the post-drop state
131
+ - Re-executing any part of the drop workflow
132
+ - Omitting the reversibility note in soft drop mode
133
+ - Displaying remaining versions from memory rather than from the updated manifest
134
+
135
+ **Master Rule:** The report must be an honest, complete summary of what step-02 actually did. Every partial failure must be visible so the user knows exactly what manual follow-up, if any, is required.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: drop-skill
3
+ description: "Drop (deprecate or purge) skill versions. Soft drop keeps files; hard drop deletes them. Active version guarded."
4
+ web_bundle: true
5
+ installed_path: '{project-root}/_bmad/skf/workflows/skillforge/drop-skill'
6
+ ---
7
+
8
+ # Drop Skill
9
+
10
+ **Goal:** Drop a specific skill version or an entire skill, either as a soft deprecation (manifest-only, files retained) or a hard purge (files deleted). Ensures platform context files are rebuilt to exclude dropped versions.
11
+
12
+ **Your Role:** In addition to your name, communication_style, and persona, you are also Ferris in Delivery/Management mode — a destructive operation specialist who enforces safety guards. You treat every drop as potentially irreversible and require explicit user confirmation before touching the manifest or the filesystem. You protect the active version, keep the export manifest consistent with on-disk state, and ensure that downstream platform context files (CLAUDE.md / AGENTS.md / .cursorrules) are rebuilt so dropped versions disappear cleanly.
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 is a part of an overall workflow 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
+ - **Safety-First Destruction**: Every destructive action is preceded by an explicit user confirmation gate; nothing is deleted silently
26
+ - **Manifest-Driven Truth**: The export manifest is the source of truth for what exists and what is active; the filesystem is updated to match
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
+ - 🛡️ **NEVER** delete files without explicit user confirmation in purge mode
46
+ - 🛡️ **NEVER** drop an active version when other non-deprecated versions exist — enforce the active version guard
47
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
48
+
49
+ ---
50
+
51
+ ## INITIALIZATION SEQUENCE
52
+
53
+ ### 1. Module Configuration Loading
54
+
55
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
56
+
57
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
58
+ - `skills_output_folder`, `forge_data_folder`, `sidecar_path`
59
+ - Generate and store `timestamp` as the current date-time in `YYYYMMDD-HHmmss` format. This value is fixed for the entire workflow run and must not be regenerated in subsequent steps.
60
+
61
+ ### 2. First Step Execution
62
+
63
+ Load, read the full file and then execute `./steps-c/step-01-select.md` to begin the workflow.
@@ -18,9 +18,31 @@
18
18
 
19
19
  | Platform | Flag Value | Target File |
20
20
  |----------|-----------|-------------|
21
- | Claude | `claude` (default) | CLAUDE.md |
21
+ | Copilot | `copilot` (default) | AGENTS.md |
22
+ | Claude | `claude` | CLAUDE.md |
22
23
  | Cursor | `cursor` | .cursorrules |
23
- | Copilot | `copilot` | AGENTS.md |
24
+
25
+ ## IDE → Platform Mapping (config.yaml `ides` list)
26
+
27
+ The installer writes installer-specific IDE identifiers to `config.yaml` under the `ides` key (not platform values). Any workflow that rebuilds platform context files from `config.yaml` MUST map each entry to a platform before looking up its target file.
28
+
29
+ | config.yaml IDE value | Platform | Target File | Rationale |
30
+ |----------------------|----------|-------------|-----------|
31
+ | `claude-code` | `claude` | CLAUDE.md | native — reads `CLAUDE.md` and `.claude/skills/` |
32
+ | `cursor` | `cursor` | .cursorrules | native — reads `.cursorrules` and `.cursor/skills/` |
33
+ | `github-copilot` | `copilot` | AGENTS.md | native — reads `AGENTS.md` and `.agents/skills/` |
34
+ | `codex` | `copilot` | AGENTS.md | OpenAI Codex reads `AGENTS.md` (same convention as copilot) |
35
+ | `cline` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
36
+ | `roo` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
37
+ | `windsurf` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
38
+ | `other` | `copilot` | AGENTS.md | generic AGENTS.md fallback |
39
+ | _(any unknown value)_ | `copilot` | AGENTS.md | warn: "Unknown IDE '{value}' in config.yaml — defaulting to copilot" |
40
+
41
+ **Deduplication:** When multiple IDE entries map to the same platform (e.g. `codex` and `cline` both → `copilot`), deduplicate so each platform is processed exactly once. Report the deduplication to the user.
42
+
43
+ **Missing `ides` key:** If the `ides` key is absent from `config.yaml`, treat it as an empty list. If the resulting platform set is empty (no recognized entries), fall back to `["copilot"]`.
44
+
45
+ This mapping is the single source of truth. Workflows that need it: `export-skill/step-01` (resolves `target_platforms` for the export), `drop-skill/step-02` and `rename-skill/step-02` (rebuild platform context files after a management operation).
24
46
 
25
47
  ## Four-Case Logic
26
48
 
@@ -62,13 +84,16 @@ Target file contains `<!-- SKF:BEGIN` but no matching `<!-- SKF:END -->` marker.
62
84
 
63
85
  ## Regeneration: Full Index Rebuild
64
86
 
65
- When regenerating (Case 3), rebuild the COMPLETE skill index:
87
+ When regenerating (Case 3) or creating/appending (Cases 1-2), rebuild the skill index from the **exported skill set** only:
88
+
89
+ 1. Read `{skills_output_folder}/.export-manifest.json` (v2 schema — see [knowledge/version-paths.md](../../../knowledge/version-paths.md)) to determine which skills have been explicitly exported and their `active_version` (if no manifest exists, only the current export target qualifies)
90
+ 2. For each skill in the exported set, resolve the snippet at `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/context-snippet.md` (i.e., `{skill_package}/context-snippet.md`). Do NOT use glob patterns across version directories — always resolve via manifest `active_version` or `active` symlink
91
+ 3. Count total skills and stack skills (from filtered set only)
92
+ 4. Assemble filtered snippets into managed section
93
+ 5. Sort alphabetically by skill name
94
+ 6. Update the header line with correct counts
66
95
 
67
- 1. Scan `{skills_output_folder}/*/context-snippet.md` for all exported skills
68
- 2. Count total skills and stack skills
69
- 3. Assemble all snippets into managed section
70
- 4. Sort alphabetically by skill name
71
- 5. Update the header line with correct counts
96
+ **Rationale:** create-skill and update-skill also write `context-snippet.md` as a build artifact, but only export-skill is the publishing gate (ADR-K). The `.export-manifest.json` file tracks which skills have passed through export-skill, preventing draft skills from leaking into the agent's passive context.
72
97
 
73
98
  ## Safety Rules
74
99
 
@@ -1,5 +1,17 @@
1
1
  # Context Snippet Format (Vercel-Aligned Indexed Format)
2
2
 
3
+ ## Platform Root Path Mapping
4
+
5
+ The snippet `root:` path must reflect the platform-specific skills directory:
6
+
7
+ | Platform | Root Path Prefix |
8
+ |----------|-----------------|
9
+ | `claude` | `.claude/skills/` |
10
+ | `cursor` | `.cursor/skills/` |
11
+ | `copilot` | `.agents/skills/` |
12
+
13
+ The root path in context-snippet.md on disk uses the **first platform in `target_platforms`** (the first entry from config.yaml IDE mapping, or the explicit `--platform` flag value if provided). When assembling managed sections for other platforms, step-04 rewrites root paths to match the target platform.
14
+
3
15
  ## Format Rules
4
16
 
5
17
  - Indexed pipe-delimited format per skill — retrieval instruction + file map + inline gotchas
@@ -13,7 +25,7 @@
13
25
  ## Single Skill Snippet Template
14
26
 
15
27
  ```markdown
16
- [{skill-name} v{version}]|root: skills/{skill-name}/
28
+ [{skill-name} v{version}]|root: {platform_root}{skill-name}/
17
29
  |IMPORTANT: {skill-name} v{version} — read SKILL.md before writing {skill-name} code. Do NOT rely on training data.
18
30
  |quick-start:{SKILL.md#quick-start}
19
31
  |api: {top exports with () for functions, comma-separated}
@@ -21,7 +33,7 @@
21
33
  |gotchas: {2-3 most critical pitfalls or breaking changes, inline}
22
34
  ```
23
35
 
24
- - **Line 1:** Skill name + version + root path — version signals training data staleness
36
+ - **Line 1:** Skill name + version + platform-aware root path — version signals training data staleness
25
37
  - **Line 2 (IMPORTANT):** Retrieval instruction — always present
26
38
  - **Line 3 (quick-start):** Anchor pointer to Quick Start section
27
39
  - **Line 4 (api):** Top exports from metadata.json `exports` array (up to 10, with `()` for functions)
@@ -31,7 +43,7 @@
31
43
  ## Stack Skill Snippet Template
32
44
 
33
45
  ```markdown
34
- [{project}-stack v{version}]|root: skills/{project}-stack/
46
+ [{project}-stack v{version}]|root: {platform_root}{project}-stack/
35
47
  |IMPORTANT: {project}-stack — read SKILL.md before writing integration code. Do NOT rely on training data.
36
48
  |stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
37
49
  |integrations: {pattern-1}, {pattern-2}
@@ -48,4 +60,4 @@
48
60
  - If fewer exports than the limit, list all available
49
61
  - If no exports data available, omit the api line
50
62
  - Section anchors must be verified against actual SKILL.md headings during generation. For split-body skills (where `references/` exists and `## Full` headings are stubs), if a heading is missing from SKILL.md, rewrite the anchor to point to the reference file path (preferred). Omit the anchor line only if the heading cannot be found in either SKILL.md or `references/*.md`
51
- - Skill path is relative to project root
63
+ - Skill path is relative to project root and uses the platform-specific root prefix (see Platform Root Path Mapping above)
@@ -59,23 +59,59 @@ To load the target skill's artifacts, validate they meet agentskills.io spec com
59
59
 
60
60
  Determine the skill to export and any flags:
61
61
 
62
- **Skill Path Discovery:**
62
+ **Skill Path Discovery (version-aware — see [knowledge/version-paths.md](../../../knowledge/version-paths.md)):**
63
63
  - If user provided a skill name or path as argument, use that
64
- - If not provided, search `{skills_output_folder}/*/SKILL.md` for available skills
64
+ - If not provided, discover available skills using the export manifest:
65
+ 1. Read `{skills_output_folder}/.export-manifest.json` — list skill names from `exports`
66
+ 2. For each skill group directory in `{skills_output_folder}/`, check for `{skill_group}/active/{skill-name}/SKILL.md`
67
+ 3. If neither manifest nor `active` symlink yields results, fall back to flat path: `{skills_output_folder}/{skill-name}/SKILL.md`
65
68
  - If multiple skills found, present list and ask user to select
66
69
  - If no skills found, halt: "No skills found in {skills_output_folder}/. Run create-skill first."
67
70
 
68
71
  **Flag Parsing:**
69
- - `--platform` flag: Check if provided (claude/cursor/copilot). Default: `claude`
72
+ - `--platform` flag: Check if explicitly provided (claude/cursor/copilot)
70
73
  - `--dry-run` flag: Check if provided. Default: `false`
71
74
 
75
+ **Platform Resolution:**
76
+
77
+ If `--platform` is explicitly provided, use that single platform as the sole target. If other IDEs are configured in config.yaml, emit a note: "**Note:** Exporting to {platform} only. config.yaml also lists: {other-ides}. Run without `--platform` to export to all configured IDEs."
78
+
79
+ If `--platform` is NOT provided, read the `ides` list from config.yaml and map each IDE to a target platform. Every IDE the installer offers has an explicit mapping — no silent skips.
80
+
81
+ | config.yaml IDE value | Platform | Rationale |
82
+ |----------------------|----------|-----------|
83
+ | `claude-code` | `claude` | native — reads `CLAUDE.md` and `.claude/skills/` |
84
+ | `cursor` | `cursor` | native — reads `.cursorrules` and `.cursor/skills/` |
85
+ | `github-copilot` | `copilot` | native — reads `AGENTS.md` and `.agents/skills/` |
86
+ | `codex` | `copilot` | OpenAI Codex reads `AGENTS.md` (same convention as copilot) |
87
+ | `cline` | `copilot` | uses `AGENTS.md` as a fallback context file |
88
+ | `roo` | `copilot` | uses `AGENTS.md` as a fallback context file |
89
+ | `windsurf` | `copilot` | uses `AGENTS.md` as a fallback context file |
90
+ | `other` | `copilot` | generic AGENTS.md fallback |
91
+ | Any other value | `copilot` | warn: "Unknown IDE '{value}' in config.yaml — defaulting to copilot (AGENTS.md)" |
92
+
93
+ When the same platform is produced by multiple IDE entries (e.g. both `codex` and `cline` map to `copilot`), deduplicate so each platform appears in `target_platforms` only once. Report the deduplication: "Multiple IDEs target the same platform — exporting to {platform} once."
94
+
95
+ **Missing-key handling:** If the `ides` key is absent from config.yaml (older installation or manually edited file), treat it as an empty list.
96
+
97
+ - If mapping produces one or more platforms (after dedup), store as `target_platforms` list
98
+ - If mapping produces zero platforms (empty ides list and no recognized entries), fall back to `["copilot"]` with note: "No IDEs configured in config.yaml — defaulting to copilot (AGENTS.md / .agents/skills/)."
99
+
72
100
  "**Skill:** {skill-name}
73
- **Platform:** {platform} ({target-file})
101
+ **Platform(s):** {platform-list} ({target-file-list})
74
102
  **Dry Run:** {yes/no}"
75
103
 
76
104
  ### 2. Load and Validate Skill Artifacts
77
105
 
78
- Load all files from the skill directory `{skills_output_folder}/{skill-name}/`:
106
+ Resolve the skill's versioned path before loading artifacts:
107
+
108
+ 1. Read `{skills_output_folder}/.export-manifest.json` and look up `{skill-name}` in `exports` to get `active_version`
109
+ 2. If found: resolve to `{skill_package}` = `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/`
110
+ 3. If not in manifest: check for `active` symlink at `{skills_output_folder}/{skill-name}/active` — resolve to `{skill_group}/active/{skill-name}/`
111
+ 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
112
+ 5. Store the resolved path as `{resolved_skill_package}` for all subsequent artifact loading
113
+
114
+ Load all files from `{resolved_skill_package}`:
79
115
 
80
116
  **Required Files (hard halt if missing):**
81
117
  - `SKILL.md` — The main skill document
@@ -117,7 +153,7 @@ Load `{sidecar_path}/preferences.yaml` (if exists):
117
153
 
118
154
  ### 4b. Check Test Report (Quality Gate)
119
155
 
120
- Search for a test report at `{forge_data_folder}/{skill_name}/test-report-{skill_name}.md`:
156
+ Search for a test report at `{forge_data_folder}/{skill_name}/{active_version}/test-report-{skill_name}.md` (i.e., `{forge_version}/test-report-{skill_name}.md`). If not found at the versioned path, fall back to `{forge_data_folder}/{skill_name}/test-report-{skill_name}.md`:
121
157
 
122
158
  **If test report found:**
123
159
  - Read frontmatter `testResult` and `score`
@@ -146,7 +182,8 @@ Continue to step 5 regardless — this is advisory, not blocking.
146
182
  **Export Configuration:**
147
183
  | Setting | Value |
148
184
  |---------|-------|
149
- | **Platform** | {platform} → {target-file} |
185
+ | **Platform(s)** | {platform-list} → {target-file-list} |
186
+ | **Explicit --platform** | {yes (user-specified) / no (from config.yaml)} |
150
187
  | **Dry Run** | {yes/no} |
151
188
  | **Passive Context** | {enabled/disabled} |
152
189
 
@@ -183,6 +220,7 @@ ONLY WHEN the user confirms the correct skill is loaded by selecting 'C' will yo
183
220
  - All required files loaded and validated
184
221
  - metadata.json parsed with required fields
185
222
  - Export flags parsed (platform, dry-run)
223
+ - config.yaml ides list consumed for multi-platform resolution when --platform not provided
186
224
  - Forge config checked for passive_context
187
225
  - Clear summary presented to user
188
226
  - User confirms correct skill
@@ -193,6 +231,7 @@ ONLY WHEN the user confirms the correct skill is loaded by selecting 'C' will yo
193
231
  - Not validating metadata.json fields
194
232
  - Not checking preferences.yaml for passive_context opt-out
195
233
  - Proceeding without user confirmation
234
+ - Ignoring config.yaml ides list when no --platform flag is provided
196
235
  - Modifying any skill files (read-only step)
197
236
 
198
237
  **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -52,10 +52,10 @@ To assemble and validate an agentskills.io-compliant package structure from the
52
52
 
53
53
  ### 1. Validate Package Structure
54
54
 
55
- Verify the skill directory contains the expected agentskills.io package layout:
55
+ Verify the skill package at `{resolved_skill_package}` (resolved in step-01 via manifest or `active` symlink — see [knowledge/version-paths.md](../../../knowledge/version-paths.md)) contains the expected agentskills.io package layout:
56
56
 
57
57
  ```
58
- {skills_output_folder}/{skill-name}/
58
+ {skill_package} = {skills_output_folder}/{skill-name}/{version}/{skill-name}/
59
59
  ├── SKILL.md ← Required: Active skill document
60
60
  ├── metadata.json ← Required: Machine-readable metadata
61
61
  ├── context-snippet.md ← Will be generated/updated in step-03
@@ -66,6 +66,30 @@ Auto-proceed immediately to {nextStepFile}.
66
66
 
67
67
  Load {snippetFormatData} and read the format template for the skill type.
68
68
 
69
+ ### 2.5. Check Existing Snippet
70
+
71
+ Before generating new snippet content, check for a prior snippet:
72
+
73
+ 1. Read `{resolved_skill_package}/context-snippet.md` if it exists (resolved in step-01 — see [knowledge/version-paths.md](../../../knowledge/version-paths.md))
74
+ 2. If it exists, extract the `|gotchas:` line (if any). Trim leading whitespace and the `|gotchas:` prefix, then capture the remaining content as `prior_gotchas_content`.
75
+ 3. **Detect the carry-forward marker:** If `prior_gotchas_content` starts with the token `[CARRIED]` (whitespace-insensitive), set `prior_gotchas_already_carried = true` and strip the marker before storing the remainder. Otherwise set `prior_gotchas_already_carried = false`.
76
+ 4. **Distinguish empty from absent:** If the `|gotchas:` line exists but has no non-whitespace content after the prefix, treat it as **absent** — set `prior_gotchas = null`. Only a non-empty value counts as a prior gotchas line worth carrying forward.
77
+ 5. If no prior snippet exists at all, set `prior_gotchas = null` and `prior_gotchas_already_carried = false`.
78
+
79
+ These values will be used as a fallback in section 3 if new gotchas cannot be derived. The `[CARRIED]` marker provides a **hard one-cycle expiry**: gotchas that were already carried once will be dropped on the next carry-forward attempt rather than preserved indefinitely.
80
+
81
+ ### 2.7. Resolve Platform Root Path
82
+
83
+ Using the first platform in `target_platforms` (resolved in step-01), resolve the root path prefix:
84
+
85
+ | Platform | `{platform_root}` |
86
+ |----------|-------------------|
87
+ | `claude` | `.claude/skills/` |
88
+ | `cursor` | `.cursor/skills/` |
89
+ | `copilot` | `.agents/skills/` |
90
+
91
+ Store `{platform_root}` for use in snippet generation. The context-snippet.md written to disk uses this platform's root path.
92
+
69
93
  ### 3. Generate Snippet Content
70
94
 
71
95
  **For single skills (`skill_type: "single"`):**
@@ -74,11 +98,15 @@ Load {snippetFormatData} and read the format template for the skill type.
74
98
  2. Select top exports (up to 10 for Deep tier, 5 otherwise). Append `()` to function names.
75
99
  3. Read SKILL.md to extract: heading slugs for `#quick-start` and `#key-types`, inline summary of key types (~10 words)
76
100
  4. **Anchor verification (split-body awareness):** For each section anchor (`#quick-start`, `#key-types`), verify the heading exists in SKILL.md. If a `references/` directory exists and `## Full` headings in SKILL.md are absent or stubs (indicating split-body, not a stack skill's structural references), rewrite the anchor to point to the reference file path (e.g., `references/{file}.md#key-types`). If the heading cannot be resolved in either location, omit that anchor line from the snippet.
77
- 5. Derive gotchas from: T2-future annotations in evidence report (breaking changes), async requirements, version-specific behavior. If no gotchas, omit the gotchas line.
101
+ 5. Derive gotchas from: T2-future annotations in evidence report (breaking changes), async requirements, version-specific behavior.
102
+ - **If new gotchas are derived:** Use them (they supersede any prior gotchas). Write as `|gotchas: {pitfall-1}, {pitfall-2}` with no marker.
103
+ - **If NO new gotchas are derived BUT `prior_gotchas` exists AND `prior_gotchas_already_carried == false`:** First carry-forward cycle — preserve the prior gotchas line, prefixing the value with `[CARRIED]` so the next export can detect that expiry has been reached. Write as `|gotchas: [CARRIED] {prior gotchas content}`. Emit warning: "**Gotchas preserved from prior export (one-cycle carry-forward).** These gotchas will be DROPPED on the next export unless new gotchas are derived or you manually refresh them. Review now if they are still applicable."
104
+ - **If NO new gotchas are derived AND `prior_gotchas` exists AND `prior_gotchas_already_carried == true`:** Expiry reached — drop the gotchas line entirely. Emit warning: "**Stale gotchas dropped** — the prior gotchas were already carried forward once and cannot be derived from the current evidence report. The snippet now has no gotchas line. If the prior gotchas are still relevant, re-add them to the evidence report's T2-future section and re-run export."
105
+ - **If NO new gotchas derived AND no `prior_gotchas`:** Omit the gotchas line.
78
106
 
79
107
  Generate:
80
108
  ```
81
- [{skill-name} v{version}]|root: skills/{skill-name}/
109
+ [{skill-name} v{version}]|root: {platform_root}{skill-name}/
82
110
  |IMPORTANT: {skill-name} v{version} — read SKILL.md before writing {skill-name} code. Do NOT rely on training data.
83
111
  |quick-start:{SKILL.md#quick-start}
84
112
  |api: {export-1}(), {export-2}(), {export-3}, {export-4}(), {export-5}
@@ -88,19 +116,21 @@ Generate:
88
116
 
89
117
  **If fewer exports than limit:** List all available.
90
118
  **If no exports:** Omit the api line.
91
- **If no gotchas derivable:** Omit the gotchas line.
119
+ **If no gotchas derivable AND no prior gotchas to carry forward:** Omit the gotchas line.
92
120
 
93
121
  **For stack skills (`skill_type: "stack"`):**
94
122
 
95
123
  Generate:
96
124
  ```
97
- [{project}-stack v{version}]|root: skills/{project}-stack/
125
+ [{project}-stack v{version}]|root: {platform_root}{project}-stack/
98
126
  |IMPORTANT: {project}-stack — read SKILL.md before writing integration code. Do NOT rely on training data.
99
127
  |stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
100
128
  |integrations: {pattern-1}, {pattern-2}
101
129
  |gotchas: {pitfall-1}, {pitfall-2}
102
130
  ```
103
131
 
132
+ **Stack skill gotchas carry-forward:** Same one-cycle expiry logic as single skills. If no new gotchas derived and `prior_gotchas_already_carried == false`, preserve with the `[CARRIED]` prefix. If already carried once (`prior_gotchas_already_carried == true`), drop the line and warn loudly. See the single-skill steps for the complete protocol.
133
+
104
134
  ### 4. Verify Token Count
105
135
 
106
136
  Estimate token count of generated snippet (approximate: words * 1.3).
@@ -114,7 +144,7 @@ Estimate token count of generated snippet (approximate: words * 1.3).
114
144
  **If dry-run mode:**
115
145
 
116
146
  "**[DRY RUN] context-snippet.md would be written to:**
117
- `{skills_output_folder}/{skill-name}/context-snippet.md`
147
+ `{resolved_skill_package}/context-snippet.md`
118
148
 
119
149
  **Content:**
120
150
  ```
@@ -127,10 +157,10 @@ Hold content in context for step-04.
127
157
 
128
158
  **If NOT dry-run:**
129
159
 
130
- Write the generated content to `{skills_output_folder}/{skill-name}/context-snippet.md`.
160
+ Write the generated content to `{resolved_skill_package}/context-snippet.md`.
131
161
 
132
162
  "**context-snippet.md written.**
133
- **Path:** `{skills_output_folder}/{skill-name}/context-snippet.md`
163
+ **Path:** `{resolved_skill_package}/context-snippet.md`
134
164
  **Estimated tokens:** {count}"
135
165
 
136
166
  ### 6. Proceed to Context Update
@@ -162,10 +192,12 @@ ONLY WHEN snippet generation is complete (or skipped due to passive_context opt-
162
192
  - Token count estimated and within target
163
193
  - File written (or previewed in dry-run)
164
194
  - Passive context opt-out correctly handled (skip when disabled)
195
+ - Prior gotchas checked and carried forward when new derivation yields nothing (with warning)
165
196
  - Auto-proceed to step-04
166
197
 
167
198
  ### ❌ SYSTEM FAILURE:
168
199
 
200
+ - Silently dropping prior gotchas without checking for carry-forward
169
201
  - Deviating from Vercel-aligned indexed format
170
202
  - Including T2 annotations or temporal context
171
203
  - Not checking passive_context setting