Skip to content
Skills Library
AI & agents · Automation

cc-stack-sync

/cc-stack-sync

Idempotent update of an existing Claude Code setup — re-fingerprint the repo, propagate updates to sub-repos, refresh docs/context, section-merge CLAUDE.md/README.md, fix configuration drift. Use this skill whenever the user runs /cc-sync, asks to "update the claude setup", "propagate to sub-repos", "fix drift", "resync", or reports that the .claude/ directory has gone stale.

Repository
claude ↗
Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
1
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Idempotent update of an existing Claude Code setup — re-fingerprint the repo, propagate updates to sub-repos, refresh docs/context, section-merge CLAUDE.md/README.md, fix configuration drift. Use this skill whenever the user runs /cc-sync, asks to "update the claude setup", "propagate to sub-repos", "fix drift", "resync", or reports that the .claude/ directory has gone stale.

Triggers from the description

update the claude setuppropagate to sub-reposfix driftresync
Original author description

Idempotent update of an existing Claude Code setup — re-fingerprint the repo, propagate updates to sub-repos, refresh docs/context, section-merge CLAUDE.md/README.md, fix configuration drift. Use this skill whenever the user runs /cc-sync, asks to "update the claude setup", "propagate to sub-repos", "fix drift", "resync", or reports that the .claude/ directory has gone stale.

How it works

  1. What sync does
  2. Section-merge protocol for CLAUDE.md
  3. Drift detection (--fix-drift)
  4. Sub-repo propagation
  5. docs/context/ scaffolding
  6. Sync state file
  7. MCP delegation
  8. Anti-patterns
  9. Reference
Original SKILL.md headings · 107 lines, 588 words
SKILL.md preview
---
name: cc-stack-sync
description: Idempotent update of an existing Claude Code setup — re-fingerprint the repo, propagate updates to sub-repos, refresh docs/context, section-merge CLAUDE.md/README.md, fix configuration drift. Use this skill whenever the user runs /cc-sync, asks to "update the claude setup", "propagate to sub-repos", "fix drift", "resync", or reports that the .claude/ directory has gone stale.
---

# Claude Code Sync

Updates an existing setup without blowing away user customizations. Idempotent — safe to run weekly, monthly, or on a schedule.

## What sync does

1. **Re-fingerprint**: scan the repo for stack changes since last setup. New framework? New DB? New CI/CD tool?
2. **Delta propagation**: push plugin rule updates (`cc-always.md`, `cc-patterns.md`) into the repo's `.claude/rules/`.
3. **Section-merge CLAUDE.md**: update the "Build & Test", "Tech Stack", "Key Paths" sections if stack changed; leave custom sections alone.
4. **Fix drift** (`--fix-drift` flag): find config that drifted from plugin defaults — missing hooks, missing MCP servers, outdated skill versions — and repair.
5. **Propagate to sub-repos**: for monorepos, walk workspace children and apply changes to their `.claude/` dirs.
6. **Scaffold docs/context/** (if absent): create the 22-template knowledge base that complements `.claude/`.
7. **Auto-install LSPs**: detect missing LSP servers from the stack and offer install commands.
8. **Persist sync state**: write `.claude/sync-state.json` with timestamp, plugin version, delta summary.

## Section-merge protocol for CLAUDE.md

CLAUDE.md sections are identified by `## ` headings. Sync protocol:

| Section | Action |
|---|---|
| `## Build & Test` | Replace (regenerated from fingerprint) |
| `## Tech Stack` | Replace |
| `## Key Paths` | Replace |
| `## Architecture` | Preserve (user-curated) |
| `## Conventions` | Merge (preserve user additions, update detected items) |
| `## Don't Touch` | Merge (preserve user additions) |
| `## Knowledge Library` (Obsidian) | Replace if managed-by-plugin marker present |
| Any other section | Preserve as-is |

Managed sections carry a `<!-- plugin:cc-setup managed -->` marker. Unmarked sections are never touched.

## Drift detection (`--fix-drift`)

Compares current state to plugin baseline:

| Check | Fix |
|---|---|
| Missing `.claude/rules/cc-always.md` | Copy from plugin |
| Missing `.claude/rules/cc-obsidian-intro.md` | Copy from plugin |
| `cc-patterns.md` older than plugin's | Offer update (user confirms) |
| Hook script path doesn't match registered hook | Reconcile or remove dead registration |
| Settings allowlist has entries for removed tools | Prune |
| MCP server in `.mcp.json` has no backing install | Warn |
| Skills in `.claude/skills/` belong to old plugin version | Offer replacement |

Never deletes user-added config. All destructive fixes require explicit confirmation.

## Sub-repo propagation

For monorepos (turbo/nx/lerna/pnpm-workspaces), sync walks workspace packages and:

1. If package has its own `.claude/` → sync it (same protocol as root).
2. If package has no `.claude/` → create a minimal one that references the root's CLAUDE.md.
3. Generate per-package CLAUDE.md stubs for LOC > 10k packages.

## docs/context/ scaffolding

If `docs/context/` does not exist, create from 22 templates:
- `docs/context/README.md`
- `docs/context/architecture/overview.md`
- `docs/context/architecture/modules.md`
- `docs/context/conventions/code-style.md`
- `docs/context/conventions/git-workflow.md`
- `docs/context/conventions/testing.md`
- `docs/context/decisions/0001-use-claude-code.md`
- `docs/context/runbooks/deploy.md`
- `docs/context/runbooks/rollback.md`
- `docs/context/glossary.md`
- ... (full list via `cc_kb_docs_context_templates`)

## Sync state file

`.claude/sync-state.json`:

```json
{
  "version": "1.0",
  "last_synced": "2026-04-16T14:00:00Z",
  "plugin_version": "8.0.0",
  "stack_fingerprint": "node-ts-nextjs-postgres-prisma-jest-vercel",
  "sub_repos_synced": 0,
  "drift_fixed": ["added missing cc-obsidian-intro.md", "pruned 2 dead hook registrations"],
  "next_check_due": "2026-05-16"
}
```

## MCP delegation

| Need | Tool |
|---|---|
| Hook pack recommendations after stack change | `cc_docs_hook_pack_recommend(signals)` |
| LSP config for newly detected language | `cc_kb_lsp_config(language)` |
| Topology for new work patterns | `cc_docs_team_topology_recommend(...)` |

## Anti-patterns

- Running sync without reading `.claude/sync-state.json` → can't tell what changed since last sync.
- `--fix-drift` without user confirmation → destroys custom config that looks like drift.
- Syncing sub-repos without their owners' awareness → surprises.
- Re-running setup instead of sync → overwrites user customizations.

## Reference

- [drift-rubric.md](references/drift-rubric.md) — what counts as drift vs. valid customization

Versions

The database has no other skills named cc-stack-sync.

Database snapshot: 13.11.2026 · package version cb07e2cc5db9 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100repo
    Update repository documentation (README.md, docs/, CLAUDE.md) based on session changes by dispatching the up-docs-propagate-repo sub-agent. This skill should be used when the user runs /up-docs:repo.
  • 100cc-stack-setup
    Deploy or audit the full 5-layer Claude Code stack (CLAUDE.md + skills + hooks + agents + memory) in a repository. Use this skill whenever the user runs /cc-setup, asks to "set up Claude Code on this repo", "configure a new repo for Claude", "audit my Claude Code setup",…
  • 90update-rules
    This skill should be used when the user asks to \"update rules\", \"sync rules\", \"update AGENTS.md\", \"update CLAUDE.md\", \"refresh rules\", \"update project config\", \"sync templates\", \"update vibe rules\", \"check for rule updates\", \"update user rules\", \"update…
  • 100agents-md-generator
    Generate or update an AGENTS.md / CLAUDE.md / context file for a repo. Use when the user says "set up CLAUDE.md", "generate AGENTS.md", "write a context file for this repo", "document this codebase for AI agents", or when a fresh repo has none. Also use when an existing context…
  • 100update-plugins
    Check which Claude Code marketplaces and plugin installs (user, project and local scope, across all project folders) are out of date, recommend what to update, and update what the user confirms. Use when the user asks to update plugins, check for plugin updates, or sync plugin versions across repos.
  • 100sync-docs
    Use when the user asks to sync, update, or refresh CLAUDE.md, AGENTS.md, SKILL.md, and README.md to reflect recent commits or PRs. Triggers on phrases like "sync docs", "update CLAUDE.md", "update AGENTS.md", "update SKILL.md", "update README", "reflect recent changes", or "document the recent PRs".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.