/open-source-prep:open-source-prepfrom open-source-prep
Scans a private codebase and full git history for secrets/PII, fixes .gitignore, generates LICENSE, README, CONTRIBUTING, and other standard repo artifacts. Automates safe steps and gates irreversible actions like history rewrite and publishing behind human confirmation.
Ships in open-source-prep. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Take a private repository from "not shareable" to "safely public." This is a guided, phase-ordered checklist. Two rules govern everything:
git rm --cached, editing .gitignore. These can be reviewed and undone, so don't make the
user babysit them.Work the phases in order. It's fine to skip a phase the repo already satisfies — say so and move on. At the end, give the user a single go/no-go summary.
Why history matters more than the current files: making a repo public exposes every past commit on every branch, not just the current tree. A secret that was committed and later "deleted" is still sitting in history — and on GitHub it stays reachable by commit SHA even after a force-push, in clones, and in forks. So the current tree and the full history are two separate surfaces, and both must be checked.
Establish where you are before changing anything.
git rev-parse --show-toplevel.git status --short, current branch, whether a
remote exists (git remote -v), and roughly how much history there is (git rev-list --count --all).State the plan in one line ("I'll scan for secrets, sort out .gitignore, add a license and the standard docs, then flag anything that needs your sign-off") and proceed.
Run the bundled scanner. It's read-only, dependency-free (ripgrep if present, else grep), and covers both surfaces plus a high-risk-filename sweep:
bash "${CLAUDE_PLUGIN_ROOT}/skills/open-source-prep/scripts/scan_secrets.sh" <repo_path>
(Use --worktree-only for a fast pre-check, --history-only to re-scan history after edits.)
Interpreting results — every hit is a human-triage item, not an auto-fix:
.env, *.pem, id_rsa, credentials, …) → if TRACKED, untrack it
in Phase 2; if untracked, make sure .gitignore covers it so it's never git add-ed.Never call a hit a false positive on the user's behalf without showing it to them. Summarize what was found, grouped by surface, and get their read before treating anything as safe.
If the scan is clean, say so plainly ("no obvious secrets in tree or history") and note that a
clean scan is reassuring but not proof — a quick manual skim of config/ and any *.json creds is
still worth it.
.gitignore (auto)The single most common open-sourcing mistake lives here, so be precise about the mechanics:
.gitignoreonly affects untracked files. Adding an already-committed file to.gitignoredoes not stop Git from tracking it — the file keeps getting published. To actually untrack it you must remove it from the index.
For each file that should not be in the public repo (secrets, local config, build output, large binaries, editor cruft):
git rm --cached <path> # stop tracking, KEEP the local copy (safe & reversible)
# then add <path> (or a glob) to .gitignore so it isn't re-added
Use git rm -r --cached <dir> for directories. This only removes the file from the current
commit forward — if the file also contains secrets that are already in history, it still needs
Phase 6. Say that explicitly so the user isn't lulled into thinking git rm --cached scrubbed the
past.
Build/refresh .gitignore from assets/gitignore-additions.txt (language-agnostic starters:
env files, credentials, OS/editor junk, common build dirs). Merge, don't clobber, an existing one.
Two checks that are legal, not technical — so surface them clearly and let the user judge.
git shortlog -sne to list who has commits. Work-for-hire / an employment IP
agreement can mean the employer owns the code — company projects usually need explicit
approval. If any of this is uncertain, flag it as a blocker for the user to resolve.See references/right-to-release.md for the checklist and the exact commands.
A public repo with no LICENSE is not open source. Code is under exclusive copyright by default; making the repo public (or letting people view/fork it) grants no legal right to use, modify, or distribute. Adding a LICENSE file is what makes it reusable.
Help the user pick — the decision is short. See references/licenses.md for the full chooser and
license texts. Quick guide:
| Goal | License |
|---|---|
| Maximally permissive, minimal fuss (default) | MIT |
| Permissive and an explicit patent grant (corporate / patent-exposed code) | Apache-2.0 |
| Require derivatives to stay open (copyleft) | GPLv3 |
| Copyleft that also covers network/SaaS use | AGPLv3 |
Once chosen, write LICENSE at the repo root from the template in references/licenses.md,
filling in the current year and copyright holder. If they're unsure, recommend MIT and explain the
one tradeoff that usually matters (MIT lets others build closed-source versions; GPL prevents that).
Create the community-health files a healthy public repo is expected to have. Draft each from the
templates in assets/, then tailor to this project (name, purpose, real setup steps) — a
template checked in verbatim reads worse than none.
Core (always):
README.md — what it does, why it matters, how to install/run, where to get help. This is the
front door; spend the most effort here. (assets/README.template.md)LICENSE — from Phase 4.CONTRIBUTING.md — how to set up, branch, test, and submit changes. (assets/CONTRIBUTING.template.md)CODE_OF_CONDUCT.md — the Contributor Covenant, with the user's contact email filled in.
(assets/CODE_OF_CONDUCT.template.md)SECURITY.md — how to privately report a vulnerability. (assets/SECURITY.template.md)Optional (offer; add if it fits):
.github/ISSUE_TEMPLATE/ + PULL_REQUEST_TEMPLATE.md — from assets/.CHANGELOG.md — Keep a Changelog format. (assets/CHANGELOG.template.md)CITATION.cff — only for research/academic software.Pull actual details (project name, description, language, run commands) from the repo — read the
manifest/README/entrypoint rather than inventing. Fill every {{PLACEHOLDER}}; never leave one in
a committed file.
Only relevant if Phase 1 found secrets in history. Do not run any rewrite command yourself until the user explicitly confirms — it rewrites commit hashes for the bad commit and everything after it, invalidates commit/tag signatures, and forces every clone/fork to reset.
Order of operations to walk the user through (details in references/history-rewrite.md):
HEAD by default.git-filter-repo (GitHub's recommendation; v2.47+
has --sensitive-data-removal) or BFG Repo-Cleaner for bulk password/blob removal. Give the
exact command, but let the user run it.Present this as a plan and stop for confirmation. If the user isn't ready, that's fine — record it as an open blocker in the final summary.
Publishing is outward-facing and effectively irreversible (search engines, clones, and forks cache public code instantly). Never flip visibility or push to a public remote without an explicit green light.
Before you even offer to publish, confirm the go/no-go checklist is clean:
.gitignore covers secrets/build artifacts; no sensitive file still trackedWhen the user confirms, remind them that GitHub turns on free automatic secret scanning for public repos — a useful backstop, but it runs after exposure, so it never replaces the pre-release scan.
Give one compact status block the user can act on:
Open-source readiness: <READY | BLOCKED>
✓ done: <phases completed>
⚠ needs you: <gated/advisory items — rotations, history rewrite, contributor consent>
✗ blockers: <anything that must be resolved before going public>
Next step: <the single most important action>
Be honest: if secrets are still in history or right-to-release is unconfirmed, the verdict is BLOCKED even if everything else is done.
scripts/scan_secrets.sh — the read-only secret/PII scanner (Phase 1).references/licenses.md — license chooser + full MIT text and pointers for Apache/GPL/AGPL.references/right-to-release.md — ownership & dependency-license audit checklist (Phase 3).references/history-rewrite.md — git-filter-repo / BFG commands and caveats (Phase 6).references/secret-patterns.md — what the scanner looks for and how to extend it.assets/ — templates for README, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, CHANGELOG, issue/PR
templates, and .gitignore starters.assets/CHANGELOG.template.md (opens in a new tab)assets/CODE_OF_CONDUCT.template.md (opens in a new tab)assets/CONTRIBUTING.template.md (opens in a new tab)assets/ISSUE_TEMPLATE/bug_report.md (opens in a new tab)assets/ISSUE_TEMPLATE/feature_request.md (opens in a new tab)assets/PULL_REQUEST_TEMPLATE.md (opens in a new tab)assets/README.template.md (opens in a new tab)assets/SECURITY.template.md (opens in a new tab)assets/gitignore-additions.txt (opens in a new tab)references/history-rewrite.md (opens in a new tab)references/licenses.md (opens in a new tab)references/right-to-release.md (opens in a new tab)references/secret-patterns.md (opens in a new tab)scripts/scan_secrets.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
open-source, repo-prep, secret-scanning, license, git-history
npx claudepluginhub andrew54068/claude-plugins --plugin open-source-prepOther plugins' skills for the same job