diff --git a/lessons%2Fpatterns%2Fsync-entire-plugin-directory-not-individual-files.-.md b/lessons%2Fpatterns%2Fsync-entire-plugin-directory-not-individual-files.-.md new file mode 100644 index 0000000..ac75aa4 --- /dev/null +++ b/lessons%2Fpatterns%2Fsync-entire-plugin-directory-not-individual-files.-.md @@ -0,0 +1,52 @@ +# Sync ENTIRE Plugin Directory, Not Individual Files + +## Date +2026-02-02 + +## Summary + +When syncing source changes to the installed marketplace, use `rsync` to sync the ENTIRE plugins directory. Do NOT cherry-pick individual files. + +## What I Did Wrong + +1. Made changes that touched agents, commands, skills, and other files +2. Only synced agent files: `for f in plugins/*/agents/*.md; do cp "$f" ...` +3. Installed marketplace was in INCONSISTENT STATE +4. Plugin failed to load +5. Wasted user's time debugging the wrong thing + +## The Fix + +```bash +rsync -av --exclude='.git' --exclude='.venv' --exclude='node_modules' \ + plugins/ ~/.claude/plugins/marketplaces/leo-claude-mktplace/plugins/ +``` + +## Why This Matters + +A commit often touches MULTIPLE file types: +- Agent frontmatter +- Command files +- Skill files +- Hook scripts +- plugin.json + +Cherry-picking only some files leaves the marketplace in a broken state where files reference things that don't exist or have mismatched versions. + +## Rule + +**ALWAYS use rsync to sync the entire plugins directory after ANY change.** + +Never do: +- `cp` of individual files +- Selective syncing based on what you THINK changed + +## Stupid Mistake Count + +This is yet another instance of me assuming I know what changed instead of just syncing everything properly. + +--- +**Tags:** sync, rsync, marketplace, plugin-updates, stupid-mistakes + +--- +**Tags:** sync, rsync, marketplace, plugin-updates, stupid-mistakes \ No newline at end of file