|
1 | 1 | --- |
2 | 2 | description: Set up or update AI coding configurations |
3 | 3 | argument-hint: [update] |
4 | | -version: 2.0.1 |
| 4 | +version: 2.1.0 |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | # AI Coding Configuration |
@@ -293,6 +293,87 @@ claude plugin install skills@ai-coding-config |
293 | 293 | Offer: "Migrate to new plugin structure (Recommended)" or "Skip migration" |
294 | 294 | </plugin-migration-check> |
295 | 295 |
|
| 296 | +<local-duplicate-cleanup> |
| 297 | +Check for local file duplication when marketplace plugins are installed. |
| 298 | + |
| 299 | +**Detection method:** Read `~/.claude/plugins/installed_plugins.json` to see if marketplace plugins are installed (core, agents, skills). If plugins are installed, check if the user also has local copies in their project. |
| 300 | + |
| 301 | +Check for these local directories: |
| 302 | +- `.claude/commands/` (as a real directory, not symlink) |
| 303 | +- `.claude/agents/` (as a real directory, not symlink) |
| 304 | +- `.claude/skills/` (as a real directory, not symlink) |
| 305 | + |
| 306 | +**Why this happens:** Some projects were set up before the marketplace approach. They have local copies of commands/agents/skills that are now outdated and create confusion because they override the marketplace versions. |
| 307 | + |
| 308 | +**Critical constraint:** Only remove files that are duplicates of marketplace content. Preserve any custom commands, agents, or skills the user created themselves. |
| 309 | + |
| 310 | +**Duplicate identification strategy:** |
| 311 | + |
| 312 | +For each directory type (commands, agents, skills): |
| 313 | +1. Use Glob to list files in the marketplace plugin install path |
| 314 | +2. Use Glob to list files in the local project directory |
| 315 | +3. Compare the two lists to identify exact filename matches |
| 316 | +4. Only remove the duplicates |
| 317 | + |
| 318 | +Example paths to check: |
| 319 | +- Commands: `~/.claude/plugins/cache/ai-coding-config/core/*/commands/` vs `.claude/commands/` |
| 320 | +- Agents: `~/.claude/plugins/cache/ai-coding-config/agents/*/agents/` vs `.claude/agents/` |
| 321 | +- Skills: `~/.claude/plugins/cache/ai-coding-config/skills/*/skills/` vs `.claude/skills/` |
| 322 | + |
| 323 | +Get the plugin version from installed_plugins.json to construct the correct path. |
| 324 | + |
| 325 | +**Exception:** Never remove `.claude/commands/ai-coding-config.md` even if it's a duplicate - this file needs to stay in the project. |
| 326 | + |
| 327 | +**User communication and choice:** |
| 328 | + |
| 329 | +If duplicates are found, explain the situation clearly: |
| 330 | + |
| 331 | +"I found duplicate files in your project. You have local copies of commands/agents/skills that are also available through the Claude Code plugin marketplace. |
| 332 | + |
| 333 | +**What's the plugin marketplace?** |
| 334 | + |
| 335 | +The Claude Code plugin marketplace is a centralized system where commands, agents, and skills are installed once globally and automatically stay up to date. Instead of copying files into each project, plugins are installed to `~/.claude/plugins/` and shared across all your projects. |
| 336 | + |
| 337 | +Benefits: |
| 338 | +- Auto-updates when you run `/ai-coding-config update` |
| 339 | +- One source of truth across all projects |
| 340 | +- No manual file copying or syncing needed |
| 341 | + |
| 342 | +Read more: https://github.com/TechNickAI/ai-coding-config#plugin-marketplace |
| 343 | + |
| 344 | +**Your situation:** |
| 345 | + |
| 346 | +You have local files that duplicate marketplace content. Local files override marketplace versions, which means: |
| 347 | +- Your local copies don't auto-update |
| 348 | +- You might be using outdated versions |
| 349 | +- It's confusing which version is actually running |
| 350 | + |
| 351 | +**Found duplicates:** |
| 352 | +[List specific duplicate files with their locations, e.g.:] |
| 353 | +- `.claude/commands/autotask.md` |
| 354 | +- `.claude/agents/code-reviewer.md` |
| 355 | +- `.claude/skills/research.md` |
| 356 | + |
| 357 | +**Custom files that will be preserved:** |
| 358 | +[List files that exist locally but not in marketplace, e.g.:] |
| 359 | +- `.claude/agents/logo-fetcher.md` (your custom agent) |
| 360 | +- `.claude/commands/ai-coding-config.md` (required in project) |
| 361 | + |
| 362 | +**Recommendation:** Remove the duplicate files and rely on the marketplace plugins. Your custom files will be preserved." |
| 363 | + |
| 364 | +Use AskUserQuestion to present the choice: |
| 365 | +- "Remove duplicates and use marketplace (Recommended)" - Explanation: "Delete duplicate files, keep custom files, rely on marketplace for updates" |
| 366 | +- "Keep both" - Explanation: "Local files will continue to override marketplace versions" |
| 367 | + |
| 368 | +If user chooses to remove duplicates: |
| 369 | +- Use individual `rm` commands for each duplicate file |
| 370 | +- Confirm what was removed |
| 371 | +- Confirm what was preserved (ai-coding-config.md + any custom files) |
| 372 | +- Remind: "You're now using marketplace plugins. Run `/ai-coding-config update` anytime to get the latest versions." |
| 373 | + |
| 374 | +The goal is to eliminate confusion by removing duplicates while preserving custom work and educating the user about the marketplace approach. |
| 375 | +</local-duplicate-cleanup> |
| 376 | + |
296 | 377 | <claude-code-update> |
297 | 378 | For Claude Code users with plugins installed: |
298 | 379 |
|
|
0 commit comments