Skip to content

Commit 7e4d71c

Browse files
committed
feat(core): add replaces field to SkillDefinition for extension skill override
## Intent When an extension contributes domain-specific skills (e.g. `sabdx-architecture`) that supersede generic baseline skills provided by `codemcp-workflows-skilled` (e.g. `architecture`), both sets were previously included in the resolved skills list — resulting in duplicate, redundant skills shown at setup and installed into the project. This change allows extension authors to declare which generic skills their domain skill replaces, so the resolver can produce a clean, non-redundant final list. ## Key changes - `InlineSkill` and `ExternalSkill` now accept an optional `replaces?: string[]` field listing the names of skills the declaring skill supersedes. - The resolver post-processes the merged skills list: it collects all replaced names into a Set, deduplicates by name (last-writer-wins), then filters out any skill whose name appears in the replaced set. The result is the effective, non-redundant skills list. - The `replaces` field is a resolver-level concern only — it is never written to SKILL.md frontmatter and does not appear in the lock file (which records the post-dedup list). - With the sadb-agentic-template extension declaring `replaces` on all five lifecycle skills, the setup wizard reduces from 13 → 8 skills for the sabdx-frontend scenario. ## Dependencies and side effects - The `replaces` field is purely additive — existing extension files without it continue to work unchanged. - `writeInlineSkills()` in `util.ts` required no changes: it only reads `name`, `description`, and `body`, so `replaces` is silently ignored during file writing.
1 parent f19820d commit 7e4d71c

9 files changed

Lines changed: 558 additions & 2 deletions

File tree

.beads/issues.jsonl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@
8484
{"id":"ade-8.3","title":"Fix","description":"Implement the solution based on your analysis: - If exists: Follow the design from it - Otherwise: Elaborate design options and present them to the user Before implementing, assess the approach: - How critical is this system? What is the blast radius if the fix causes issues? - Should this be a minimal fix or a more comprehensive solution? Make targeted changes that address the root cause without introducing new issues. Be careful to maintain existing functionality while fixing the bug.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T08:52:50.645347+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T08:52:50.645347+01:00","dependencies":[{"issue_id":"ade-8.3","depends_on_id":"ade-8","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-8.3","depends_on_id":"ade-8.2","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
8585
{"id":"ade-8.4","title":"Verify","description":"Test the fix thoroughly to ensure the original bug is resolved and no new issues were introduced. Run existing tests, create new ones if needed, and verify the solution is robust.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T08:52:50.824002+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T08:52:50.824002+01:00","dependencies":[{"issue_id":"ade-8.4","depends_on_id":"ade-8","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-8.4","depends_on_id":"ade-8.3","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
8686
{"id":"ade-8.5","title":"Finalize","description":"Ensure code quality and documentation accuracy through systematic cleanup and review. **STEP 1: Code Cleanup** Systematically clean up development artifacts: - Remove all temporary debug output statements used during bug investigation (console logging, print statements, debug output functions) - Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred - Remove completed TODOs and convert remaining ones to proper issue tracking if needed - Remove temporary debugging code, test code blocks, and commented-out code - Ensure proper error handling replaces temporary debug logging **STEP 2: Documentation Review** Review and update documentation to reflect the bug fix: - If exists, update it if design details were refined or changed during the fix - Compare documentation against the actual bug fix implementation - Update only the documentation sections that have functional changes - Remove references to investigation iterations, progress notes, and temporary decisions - Ensure documentation describes the final fixed state, not the debugging process - Ask the user to review document updates **STEP 3: Final Validation** - Run existing tests to ensure cleanup didn't break functionality - Verify documentation accuracy with a final review - Ensure bug fix is ready for production - Update task progress and mark completed work as you finalize the bug fix","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T08:52:50.99667+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T08:52:50.99667+01:00","dependencies":[{"issue_id":"ade-8.5","depends_on_id":"ade-8","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-8.5","depends_on_id":"ade-8.4","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
87+
{"id":"ade-9","title":"ade: epcc (development-plan-extension-override-skills.md)","description":"Responsible vibe engineering session using epcc workflow for ade","status":"open","priority":2,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:16:22.460649+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:16:22.460649+01:00"}
88+
{"id":"ade-9.1","title":"Explore","description":"Research the codebase to understand existing patterns and gather context about the problem space. - If uncertain about conventions or rules, ask the user about them - Read relevant files and documentation - If exists: Understand and document requirements there - Otherwise: Document requirements in your task management system Focus on understanding without writing code yet. Document your findings and create tasks as needed.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:16:22.605996+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:16:22.605996+01:00","dependencies":[{"issue_id":"ade-9.1","depends_on_id":"ade-9","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
89+
{"id":"ade-9.2","title":"Plan","description":"Create a detailed implementation strategy based on your exploration: - If exists: Base your strategy on requirements from it - Otherwise: Use existing task context Break down the work into specific, actionable tasks. Consider edge cases, dependencies, and potential challenges. - If architectural changes needed and exists: Document in - Otherwise: Create tasks to track architectural decisions - If exists: Adhere to the design in it - Otherwise: Elaborate design options and present them to the user Document the planning work thoroughly and create implementation tasks as part of the code phase as needed.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:16:22.745983+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:16:22.745983+01:00","dependencies":[{"issue_id":"ade-9.2","depends_on_id":"ade-9","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.2","depends_on_id":"ade-9.1","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
90+
{"id":"ade-9.3","title":"Code","description":"Follow your plan to build the solution: - If exists: Follow the design from it - Otherwise: Elaborate design options and present them to the user - If exists: Build according to the architecture from it - Otherwise: Elaborate architectural options and present them to the user - If exists: Ensure requirements from it are met - Otherwise: Ensure existing requirements are met based on your task context Write clean, well-structured code with proper error handling. Prevent regression by building, linting, and executing existing tests. Stay flexible and adapt the plan as you learn more during implementation. Update task progress and create new tasks as needed.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:16:22.881145+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:16:22.881145+01:00","dependencies":[{"issue_id":"ade-9.3","depends_on_id":"ade-9","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3","depends_on_id":"ade-9.2","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
91+
{"id":"ade-9.3.1","title":"Add replaces?: string[] to InlineSkill and ExternalSkill in types.ts","status":"closed","priority":1,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:56.87809+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:25:09.682568+01:00","closed_at":"2026-03-20T11:25:09.682568+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.1","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
92+
{"id":"ade-9.3.2","title":"Post-process skills in resolver: dedup by name + filter replaced names","status":"closed","priority":1,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:57.036539+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:25:26.025057+01:00","closed_at":"2026-03-20T11:25:26.025057+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.2","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3.2","depends_on_id":"ade-9.3.1","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
93+
{"id":"ade-9.3.3","title":"Write resolver tests: replaces dedup, ordering, no-op when replaces empty","status":"closed","priority":1,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:57.182342+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:26:32.609547+01:00","closed_at":"2026-03-20T11:26:32.609547+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.3","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3.3","depends_on_id":"ade-9.3.2","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
94+
{"id":"ade-9.3.4","title":"Update skillsWriter spec: pass-through of replaces field","status":"closed","priority":2,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:57.338918+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:27:04.797258+01:00","closed_at":"2026-03-20T11:27:04.797258+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.4","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3.4","depends_on_id":"ade-9.3.1","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
95+
{"id":"ade-9.3.5","title":"Update writeInlineSkills: ignore replaces field when writing SKILL.md","status":"closed","priority":2,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:57.510647+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:27:13.986652+01:00","closed_at":"2026-03-20T11:27:13.986652+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.5","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3.5","depends_on_id":"ade-9.3.1","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
96+
{"id":"ade-9.3.6","title":"Update ade.extensions.mjs example with replaces declarations","status":"closed","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:21:57.649406+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:28:51.412822+01:00","closed_at":"2026-03-20T11:28:51.412822+01:00","close_reason":"Closed","dependencies":[{"issue_id":"ade-9.3.6","depends_on_id":"ade-9.3","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.3.6","depends_on_id":"ade-9.3.2","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
97+
{"id":"ade-9.4","title":"Commit","description":"Ensure code quality and documentation accuracy through systematic cleanup and review. **STEP 1: Code Cleanup** Systematically clean up development artifacts: 1. **Remove Debug Output**: Search for and remove all temporary debug output statements used during development. Look for language-specific debug output methods (console logging, print statements, debug output functions). Remove any debugging statements that were added for development purposes. 2. **Review TODO/FIXME Comments**: - Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred - Remove completed TODOs - Convert remaining TODOs to proper issue tracking if needed 3. **Remove Debugging Code Blocks**: - Remove temporary debugging code, test code blocks, and commented-out code - Clean up any experimental code that's no longer needed - Ensure proper error handling replaces temporary debug logging **STEP 2: Documentation Review** Review and update documentation to reflect final implementation: 1. **Update Long-Term Memory Documents**: Based on what was actually implemented: - If exists: Update it if requirements changed during development - If exists: Update it if architectural impacts were identified - If exists: Update it if design details were refined or changed - Otherwise: Document any changes in the plan file 2. **Compare Against Implementation**: Review documentation against actual implemented functionality 3. **Update Changed Sections**: Only modify documentation sections that have functional changes 4. **Remove Development Progress**: Remove references to development iterations, progress notes, and temporary decisions 5. **Focus on Final State**: Ensure documentation describes the final implemented state, not the development process 6. **Ask User to Review Document Updates** **STEP 3: Final Validation** - Run existing tests to ensure cleanup didn't break functionality - Verify documentation accuracy with a final review - Ensure code is ready for production/delivery Update task progress and mark completed work as you finalize the feature.","status":"open","priority":3,"issue_type":"task","owner":"github@beimir.net","created_at":"2026-03-20T11:16:23.028674+01:00","created_by":"Oliver Jägle","updated_at":"2026-03-20T11:16:23.028674+01:00","dependencies":[{"issue_id":"ade-9.4","depends_on_id":"ade-9","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"ade-9.4","depends_on_id":"ade-9.3","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}

.beads/last-touched

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ade-8.5
1+
ade-9.3.6
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"conversationId": "ade-extension-override-skills-d44z9p",
3+
"projectPath": "/Users/oliverjaegle/projects/privat/codemcp/ade",
4+
"epicId": "ade-9",
5+
"phaseTasks": [
6+
{
7+
"phaseId": "explore",
8+
"phaseName": "Explore",
9+
"taskId": "ade-9.1"
10+
},
11+
{
12+
"phaseId": "plan",
13+
"phaseName": "Plan",
14+
"taskId": "ade-9.2"
15+
},
16+
{
17+
"phaseId": "code",
18+
"phaseName": "Code",
19+
"taskId": "ade-9.3"
20+
},
21+
{
22+
"phaseId": "commit",
23+
"phaseName": "Commit",
24+
"taskId": "ade-9.4"
25+
}
26+
],
27+
"createdAt": "2026-03-20T10:16:23.345Z",
28+
"updatedAt": "2026-03-20T10:16:23.345Z"
29+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Development Plan: ade (extension-override-skills branch)
2+
3+
*Generated on 2026-03-20 by Vibe Feature MCP*
4+
*Workflow: [epcc](https://mrsimpson.github.io/responsible-vibe-mcp/workflows/epcc)*
5+
6+
## Goal
7+
Allow extension-contributed skills to declare that they replace/supersede generic baseline skills registered by the process option (`codemcp-workflows-skilled`). The resolver should deduplicate the final skills list so that only the effective (non-replaced) skills are shown and installed.
8+
9+
## Explore
10+
<!-- beads-phase-id: ade-9.1 -->
11+
### Tasks
12+
- [x] Understand current skill registration flow (process → recipe → skills writer → LogicalConfig)
13+
- [x] Identify the exact duplication: `codemcp-workflows-skilled` registers 5 generic skills; architecture extensions like `sabdx-frontend` register domain-specific replacements with different names
14+
- [x] Evaluate solution options (replaces field, baseline priority, excludes at option level)
15+
- [x] Agree on preferred approach: `replaces?: string[]` on `SkillDefinition`
16+
17+
### Phase Entrance Criteria:
18+
*(initial phase — no prior phase)*
19+
20+
## Plan
21+
<!-- beads-phase-id: ade-9.2 -->
22+
### Tasks
23+
24+
*Tasks managed via `bd` CLI*
25+
26+
### Phase Entrance Criteria:
27+
- [ ] The problem is clearly understood: duplicate generic + domain-specific skills shown at setup
28+
- [ ] At least two solution alternatives have been evaluated
29+
- [ ] The preferred approach (`replaces` field on `SkillDefinition`) is agreed upon
30+
- [ ] Scope is clear: which files are touched
31+
32+
## Code
33+
<!-- beads-phase-id: ade-9.3 -->
34+
### Tasks
35+
36+
*Tasks managed via `bd` CLI*
37+
38+
### Phase Entrance Criteria:
39+
- [ ] Concrete implementation plan is documented (what changes in which file)
40+
- [ ] Edge cases are identified (ordering, name-collision, TUI display)
41+
- [ ] Test strategy is defined
42+
43+
## Commit
44+
<!-- beads-phase-id: ade-9.4 -->
45+
### Tasks
46+
- [ ] Squash WIP commits: `git reset --soft <first commit of this branch>`. Then, create a conventional commit. In the message, first summarize the intentions and key decisions from the development plan. Then, add a brief summary of the key changes and their side effects and dependencies.
47+
48+
*Tasks managed via `bd` CLI*
49+
50+
### Phase Entrance Criteria:
51+
- [ ] All implementation tasks are done and tests pass
52+
- [ ] The `replaces` field works end-to-end (resolver deduplicates, TUI shows reduced list)
53+
- [ ] No regressions in existing resolver tests
54+
55+
## Key Decisions
56+
57+
### KD-1: Add `replaces?: string[]` to `SkillDefinition`
58+
Both `InlineSkill` and `ExternalSkill` get an optional `replaces` field. Extension authors list the generic skill names they supersede. Deduplication happens as a post-processing step in the resolver (`resolve()` in `resolver.ts`).
59+
60+
### KD-2: Deduplication strategy — last-writer-wins + replaces set
61+
After all provisions are merged, the resolver:
62+
1. Builds a Set of all names that appear in any skill's `replaces` array.
63+
2. Deduplicates by name (last occurrence wins, preserving insertion order otherwise) using a Map.
64+
3. Filters out any skill whose `name` is in the replaced-names Set.
65+
66+
This means: if `sabdx-architecture` declares `replaces: ["architecture"]`, the generic `architecture` skill is dropped. The final list contains `sabdx-architecture` only.
67+
68+
### KD-3: Skill file names on disk — unchanged
69+
Skills are written to `.ade/skills/<name>/SKILL.md` by `writeInlineSkills()` in `util.ts`.
70+
- The generic `architecture` skill → `.ade/skills/architecture/SKILL.md`
71+
- The replacing `sabdx-architecture` skill → `.ade/skills/sabdx-architecture/SKILL.md`
72+
73+
Because `architecture` is filtered out **before** `writeInlineSkills()` is called, **no file is written for `architecture`**. Only `sabdx-architecture/SKILL.md` ends up on disk. The `replaces` field is a resolver-level concern; it does not need to be written to SKILL.md frontmatter.
74+
75+
### KD-4: `replaces` field is stripped before writing SKILL.md
76+
`writeInlineSkills()` uses the skill's `name`, `description`, and `body` for the SKILL.md frontmatter. The `replaces` field is simply ignored during file writing — no changes needed in `util.ts`.
77+
78+
### KD-5: `replaces` field is NOT persisted in `config.lock.yaml`
79+
The lock file records `logical_config`, which is the *post-dedup* skills list. Replaced skills never appear in the lock file.
80+
81+
### KD-6: Ordering — extensions should register skills after process
82+
The resolver processes facets in `sortFacets()` order. The `architecture` facet comes after `process`, so extension skills are appended after the generic ones. The last-writer-wins Map dedup naturally lets extension skills win. But `replaces` is independent of ordering — it is an explicit declaration.
83+
84+
## Notes
85+
86+
### Full flow for the sadb-frontend scenario
87+
1. `codemcp-workflows-skilled` recipe runs → appends to `result.skills`: `[starting-project, architecture, application-design, coding, testing]`
88+
2. `sabdx-frontend` recipe runs → appends: `[sabdx-tasks, sabdx-starting-project{replaces:["starting-project"]}, sabdx-architecture{replaces:["architecture"]}, sabdx-application-design{replaces:["application-design"]}, sabdx-coding{replaces:["coding"]}, sabdx-testing{replaces:["testing"]}, tdd]`
89+
3. `conventional-commits` recipe runs → appends: `[conventional-commits]`
90+
4. Raw merged list: 13 skills
91+
5. Post-dedup (name Map + replaces filter): 8 skills remain — `[sabdx-tasks, sabdx-starting-project, sabdx-architecture, sabdx-application-design, sabdx-coding, sabdx-testing, tdd, conventional-commits]`
92+
6. `writeInlineSkills()` writes SKILL.md files for the 6 inline sabdx-* skills under `.ade/skills/<name>/`
93+
7. `installSkills()` installs all 8 into `.agentskills/skills/`
94+
95+
### What files exist on disk after setup
96+
- `.ade/skills/sabdx-tasks/SKILL.md`
97+
- `.ade/skills/sabdx-starting-project/SKILL.md`
98+
- `.ade/skills/sabdx-architecture/SKILL.md`
99+
- `.ade/skills/sabdx-application-design/SKILL.md`
100+
- `.ade/skills/sabdx-coding/SKILL.md`
101+
- `.ade/skills/sabdx-testing/SKILL.md`
102+
- NO `.ade/skills/architecture/SKILL.md` (replaced, never written)
103+
- NO `.ade/skills/starting-project/SKILL.md` (replaced, never written)
104+
- etc.
105+
106+
### The `tdd` skill from the extension — no `replaces` needed
107+
`tdd` is an external skill (`source: "mrsimpson/skills-coding"`) and there is no generic `tdd` skill in `codemcp-workflows-skilled`. No clash.
108+
109+
---
110+
*This plan is maintained by the LLM and uses beads CLI for task management. Tool responses provide guidance on which bd commands to use for task management.*

0 commit comments

Comments
 (0)