Commit befcc8d
committed
* feat(#71): tool-native skill sync — Gemini dir-symlink, Windsurf injection, Copilot per-file, apc unsync
- Add SKILL_DIR = ~/.gemini/skills/ — Gemini natively reads <name>/SKILL.md subdirs
- Dir-symlink on apc sync; new installs appear immediately
- No native skills dir; inject ## APC Skills section into global_rules.md
- sync_skills_dir(): writes managed block (<!-- apc-skills-start/end --> markers)
- apply_installed_skill(): regenerates block when new skill installed
- unsync_skills(): removes the managed block cleanly
- sync_skills_dir(): creates per-file symlinks in ~/.github/instructions/
<name>.instructions.md → ~/.apc/skills/<name>/SKILL.md
- apply_installed_skill(): creates one symlink for the new skill
- unsync_skills(): removes all apc-managed .instructions.md symlinks
- apply_installed_skill(name): default no-op for dir-symlink tools
- unsync_skills(): default removes dir symlink, recreates empty dir
- record_tool_sync(sync_method): records non-dir-symlink syncs
- sync_method property: returns sync method from stored dir_sync data
- _propagate_to_synced_tools(): after save_skill_file(), finds all synced
tools not in explicit targets and calls apply_installed_skill()
- apc unsync [TOOL...] --all --yes
- Calls unsync_skills() per tool, clears dir_sync from manifest
* fix: remove --target/-t from apc install; propagate to ALL synced tools
The --target flag was a legacy concept from when skills were copied into
each tool's directory. With dir-symlink + sync registry, skills always
land in ~/.apc/skills/ and propagate via sync — the target is irrelevant.
Changes:
- Drop --target/-t option from entirely
- _propagate_to_synced_tools() no longer takes explicit_targets arg —
calls apply_installed_skill() for every synced tool unconditionally
- Dir-symlink tools: still a no-op (symlink already propagates)
- Windsurf/Copilot: correctly get apply_installed_skill() even if they
were previously the only flag passed to --target
- Success message updated: 'to ~/.apc/skills/' instead of tool list
- Tests: replaced -t/--target usage with plain -y; updated target-all
test to test_install_saves_to_apc_skills
* fix: ruff format test_docker_integration.py (lint CI)
* test: 42 unit tests for tool-native sync (Gemini, Windsurf, Copilot, apc unsync)
* test: 15 docker integration tests for Windsurf injection + Copilot per-file sync
Also fixes sync_skills() to correctly record sync method for non-dir tools:
- record_dir_sync() only called when SKILL_DIR is set
- record_tool_sync(SYNC_METHOD) called for Windsurf (injection) and Copilot (per-file-symlink)
- SYNC_METHOD class attr added to BaseApplier (default: dir-symlink)
- WindsurfApplier.SYNC_METHOD = 'injection'
- CopilotApplier.SYNC_METHOD = 'per-file-symlink'
Windsurf tests (8):
- sync creates injection block in global_rules.md
- global_rules.md is a real file, not a symlink
- existing rules preserved when block appended
- apc install propagates to synced Windsurf (regenerates block)
- resync replaces stale block without duplicates
- unsync removes APC block cleanly
- unsync preserves surrounding rule content
- status reflects windsurf as synced
Copilot tests (7):
- sync creates .instructions.md symlinks in ~/.github/instructions/
- symlinks resolve to correct ~/.apc/skills/<name>/SKILL.md target
- apc install propagates to synced Copilot (creates new symlink)
- instructions dir is a real dir, not a dir-level symlink
- unsync removes all .instructions.md symlinks
- unsync preserves manually created (non-symlink) .instructions.md files
- resync after new installs refreshes all symlinks
* fix: remove unused imports call, pytest (lint)
* feat: apc skill remove — propagates deletion to Windsurf + Copilot
When a skill is removed from ~/.apc/skills/:
- Dir-symlink tools (Claude Code, OpenClaw, Gemini, Cursor): automatic —
the skill dir vanishes from the symlink with no extra action.
- Windsurf: regenerates global_rules.md block; removed skill omitted.
- Copilot: removes the now-dangling .instructions.md symlink.
New:
- skills.delete_skill_file(name): removes ~/.apc/skills/<name>/ tree
- BaseApplier.remove_installed_skill(name): default no-op
- WindsurfApplier.remove_installed_skill(name): regenerate block
- CopilotApplier.remove_installed_skill(name): delete symlink
- install.propagate_remove_to_synced_tools(name): calls remove_installed_skill
for all synced tools (mirrors _propagate_to_synced_tools pattern)
- apc skill remove NAME [NAME...] [--yes]: new CLI command
Tests (18 new):
- 10 unit tests: BaseApplier no-op, Windsurf regenerate, Copilot symlink
removal, propagate_remove_to_synced_tools (all synced, skip unsynced,
exception isolation)
- 8 docker integration tests: Windsurf block updated after remove, block
kept with remaining skills, empty block after last skill, Copilot symlink
deleted, other symlinks kept, ~/.apc/skills/ deleted, unknown skill warning,
no-sync path safe
1 parent 1579d5c commit befcc8d
File tree
13 files changed
+1808
-101
lines changed- src
- appliers
- tests
13 files changed
+1808
-101
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
178 | 213 | | |
179 | 214 | | |
180 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| |||
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
99 | 172 | | |
100 | 173 | | |
101 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
100 | 178 | | |
101 | 179 | | |
102 | 180 | | |
| |||
0 commit comments