Sync repos

From thatrebeccarae/claude-marketing · View interactive version

Sync repos is an AI agent skill from the GitHub repository thatrebeccarae/claude-marketing. Manage public/private repository pairs. Verify parity, detect drift, run sync scripts, and validate no sensitive data leaks to the public repo. Use for projects that maintain separate dev and public repositories.

How to use this skill

Skill file

Sync Repos

Manage public/private repository pairs. Verify parity between a dev (private) repo and its public counterpart, detect drift, run sync scripts, validate results, and ensure no PII or secrets leak to the public side.

Install

claude install-skill https://github.com/thatrebeccarae/claude-skills/tree/main/sync-repos

When to Use

Usage

If paths are omitted, prompt the user for them. Look for .syncignore or scripts/sync-public.conf in the dev repo to auto-detect the pair.

Procedure

Check Mode

  1. Validate paths. Confirm both paths exist and contain .git/ directories. Abort with a clear message if either is not a git repo.
  1. Detect sync script. Look for scripts/sync-public.sh, scripts/sync-public.conf, or .syncignore in the dev repo. Report whether a sync mechanism exists.
  1. Compare file lists. Generate sorted file lists for both repos (excluding .git/, node_modules/, dist/). Categorize differences:
  1. Check last sync timestamp. If scripts/sync-public.sh exists, check its last execution time via the most recent commit in the public repo that matches a sync pattern. Compare against the latest commit in the dev repo.
  1. Report. Present a summary table:

Sync Mode

  1. Run check first. Execute the full check procedure above. If no drift is detected, report "already in sync" and stop.
  1. Locate sync script. Look for scripts/sync-public.sh in the dev repo. If not found, ask the user whether to run setup mode to create one.
  1. Preview the sync. Show what the sync script will do — files to copy, exclusions, text replacements. Require user confirmation before proceeding.
  1. Execute the sync script. Run from the dev repo root:

```bash

bash scripts/sync-public.sh

```

Capture stdout and stderr. If the script exits non-zero, report the error and stop.

  1. Post-sync validation. After the script completes:
  1. Report results. Summarize:

Setup Mode

  1. Scan the dev repo. Identify files and directories that should NOT sync to public:
  1. Generate sync-public.conf. Create a config file with:
  1. Generate sync-public.sh. Create the sync script using the rsync-based template from REFERENCE.md. Include:
  1. User review. Display the generated config and script. Wait for explicit approval before writing.
  1. Write files. Save scripts/sync-public.sh (chmod +x) and scripts/sync-public.conf to the dev repo.

Common Exclusion Patterns

These patterns are excluded from sync by default. Append project-specific patterns as needed.

| Pattern | Reason |

|---------|--------|

| .git/ | Git history stays separate |

| .env, .env.* | Secrets and environment config |

| .planning/ | Internal planning docs |

| .claude/ | Claude Code project config |

| CLAUDE_CONTEXT.md | Internal agent context |

| data/ | Local data / databases |

| dist/, node_modules/ | Build artifacts |

| *.pem, *.key | Private key material |

| *.plist | macOS service config |

| scripts/sync-public.* | Sync infrastructure itself |

| briefs/ | Internal content briefs |

| config/soul.md | Personal agent config |

Key Principles

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.