Relationships
#1056 extension pull only materializes skills for the primary tool, deletes other enrolled tools' copies
Opened by jeremy · 7/9/2026· Shipped 7/10/2026
Summary
In a repo enrolled in more than one AI tool (.swamp.yaml tools: with 2+ entries), swamp extension pull (and sibling commands) only ever materializes an extension's skills for tools[0] — the "primary" tool. Worse, because pull diffs against the lockfile's previously-recorded file paths, re-pulling after the primary tool changes actively deletes the previous primary's skill files rather than leaving them alone or writing to both.
Root cause
resolvePrimaryTool()(src/domain/repo/primary_tool.ts:35-37) always returnsmarker.tools[0]. There is no concept of "all enrolled tools" for skill materialization — only a single primary one.- Every skill-writing command resolves that single primary tool and reads/writes only its skills directory:
extension_pull.ts:245-246, plusextension_update.ts,extension_rm.ts,extension_list.ts,extension_source_add.ts,extension_source_rm.ts,doctor_extensions.ts. None of these accept a--toolflag to target a specific enrolled tool. repo_service.ts:156-160documents the intended UX: when a new tool is enrolled viaswamp repo upgrade --tool <a> --tool <b>,extensionsToReinstallis surfaced so the renderer can advise "re-runswamp extension pull <name>to install for<newTool>" (seerepo_init.ts:250-254). This advice assumes pull is additive per-tool. It isn't — pull always targetstools[0]regardless of which tool the message names, and it deletes whatever the previous primary's files were.
Repro
swamp repo init --tool kiro(single tool)swamp extension pull <ext-with-skills>— skills land in.kiro/skills/swamp repo upgrade --tool claude --tool kiro— adds claude, warns: "N extension(s) installed for the previous tool were NOT copied to claude. Re-runswamp extension pull <name>to install for claude: ..."- Follow the advice:
swamp extension pull <ext-with-skills> --force - Observe: skills now exist under
.claude/skills/(tools[0] is nowclaude), AND the log reports removing.kiro/skills/<skill>as "no longer in" the new version — kiro's copies are gone.
Impact
Any swamp repo enrolled in 2+ AI tools can only ever have extension-provided skills materialized for one tool at a time. There's no supported way to keep multiple enrolled tools' extension skills in sync, and the built-in remediation message actively makes it worse for the non-primary tool by deleting its copies on the next pull/update/rm.
Suggested fix
resolveSkillsDir/resolvePrimaryTool callers that mutate the skills directory (pull, update, rm, source_add, source_rm) should fan out to resolveSkillsDir(repoDir, tool) for every tool in marker.tools, not just tools[0], mirroring the (currently unused for this purpose) resolveUniqueGlobalSkillsDirs pattern already used for global skill dirs (skill_dirs.ts:82-95).
Environment
swamp 20260708.163706.0-sha.a3be0656
Shipped
Click a lifecycle step above to view its details.