Skip to content

feat: add update skill for safe cc10x upgrades#15

Open
IdoGil-boop wants to merge 1 commit intoromiluz13:mainfrom
IdoGil-boop:feat/update-skill
Open

feat: add update skill for safe cc10x upgrades#15
IdoGil-boop wants to merge 1 commit intoromiluz13:mainfrom
IdoGil-boop:feat/update-skill

Conversation

@IdoGil-boop
Copy link
Copy Markdown

Summary

Adds a new update skill (plugins/cc10x/skills/update/SKILL.md) that automates the cc10x update cycle while preserving local modifications to cached skill files.

Problem

Users who customize cached skill files (especially cc10x-router/SKILL.md) lose their modifications every time the plugin updates, since the update overwrites the cache with fresh files from the marketplace repo.

Solution

A 5-phase workflow:

  1. Discovery — Reads installed_plugins.json + marketplace.json, fetches upstream, displays version status table + changelog preview
  2. Stash — Diffs every cached file against the marketplace source (before git pull), saves unified patches + full backups to a timestamped directory
  3. Pull & Rebuildgit pull --ff-only, copies plugin files to new cache directory, updates registry JSON via python3
  4. Rebasepatch --dry-run each saved diff; applies clean patches automatically, asks user per conflict via AskUserQuestion
  5. Verify — Validates cache structure + registry consistency, displays before/after summary table

Design decisions

Choice Rationale
diff/patch over git stash Cache directory isn't a git repo
python3 for JSON mutation Portable — no jq dependency (requires Homebrew on macOS)
AskUserQuestion at 3 gates only Proceed? / Old cache cleanup? / Per-conflict resolution
Move, never delete Old caches go to timestamped backup dir, never rm -rf
Diff before pull Isolates user changes from upstream changes

Triggers

update cc10x, upgrade cc10x, pull cc10x, sync plugin, refresh cc10x, check for updates

Test plan

  • Run skill when already up-to-date — should detect and offer re-sync
  • Manually modify a cached file, then run skill — should stash diff, pull, and rebase patch
  • Introduce a conflict (modify same lines as upstream) — should ask user per conflict
  • Verify installed_plugins.json is correctly updated after run
  • Verify backup directory contains patches + originals

🤖 Generated with Claude Code

Adds a new skill that automates the cc10x update cycle while preserving
local modifications to cached skill files. The workflow:

1. Discovery — reads registry + marketplace, fetches upstream, shows status
2. Stash — diffs cache vs marketplace source (before pull), saves patches
3. Pull & Rebuild — git pull, copies to new cache, updates registry JSON
4. Rebase — dry-run patches, applies clean ones, asks user per conflict
5. Verify — validates cache structure + registry, shows summary

Key design decisions:
- diff/patch over git stash (cache isn't a git repo)
- python3 for JSON mutation (portable, no jq dependency)
- AskUserQuestion at 3 gates only (proceed, cleanup, conflicts)
- Move-never-delete: old caches go to timestamped backup dir

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant