repo-hardening
Skill4 starsChanged 4 months agoMITView on GitHub
Set a repository up so it cannot merge broken code and cannot quietly rot: continuous integration, automated dependency updates, a protected default branch, and the CI check made a required gate. Use when the user says \"/repo-hardening\", \"harden this repo\", \"set up CI\", \"protect main\", \"add branch protection\", \"enable Dependabot\", or when a project is about to become public or start deploying from its default branch. Ordering matters — a required status check can only be added after that check has run once.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- aymardkouakou/claude-gh-skillstheir own version, first seen Nov 8, 2026
- edloidas/skillstheir own version, first seen Nov 1, 2026
- assisjp/specflowtheir own version, first seen Nov 1, 2026
- davisbuilds/dojotheir own version, first seen Nov 1, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- assisjp/specflow★ 17same name
- edloidas/skills★ 2same name
- aymardkouakou/claude-gh-skills★ 1same name
- davisbuilds/dojo★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- axiomatic-inductionSkill
- generate-prSkill
- genesisSkill
- git-commitSkill
- parallel-workSkill
- security-auditSkill
- sourcesSkill
- test-gateSkill
- todoSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Add a workflow that runs the project's own gate on every pull request and on pushes to the default branch.
- Distinctive: line 38
The run command comes from the project, not from a guess: Read CLAUDE.md §Commands, then the manifest's scripts.
- Distinctive: line 70
Leave off, unless the project actually needs them: required reviewers, code owners, linear history, signed commits.
- Distinctive: line 75
Only now, and only after the step-2 workflow has completed at least once — the check has to exist by name before it can be required.
- Distinctive: line 86
Do not assume the settings took.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repo hardening — make broken code unmergeable
Four things, in this order. The order is not cosmetic: step 4 depends on the check from step 2 having actually run, and doing it earlier fails with a confusing error.
Assumes a repository hosted on GitHub with a default branch that deploys or releases. Adapt the mechanics for another host; the four properties are the same everywhere.
Every step here changes settings on a hosted repository the user owns. Propose the set, then apply on their go-ahead. Nothing in this skill is urgent enough to justify surprising someone with a changed merge policy.
1. Automated dependency updates
Turn on the host's dependency alerts and automatic security updates, and commit a config that also opens
routine (non-security) update PRs on a schedule. Group them — a weekly batch is reviewable, thirty individual
PRs are not. A scaffolded project already has that config at .github/dependabot.yml; check its ecosystem
matches the stack, and that a project with several manifests has a block per directory.
The alerts are a repository setting and the config is a file: turning on one without the other looks the same from the outside as doing both, and neither half announces the absence of the other.
Why it earns its place: a dependency advisory is the one class of problem that arrives on someone else's schedule rather than yours.
2. Continuous integration
Add a workflow that runs the project's own gate on every pull request and on pushes to the default branch. A
scaffolded project already has one at .github/workflows/ci.yml; a project that does not gets it written now,
with the same properties.
The run command comes from the project, not from a guess. Read CLAUDE.md §Commands, then the manifest's
scripts. Use what is actually there — the test command if the project has tests, otherwise the build, which at
least catches a type or compile error. A CI job that runs nothing is worse than none, because it goes green and
implies something was checked.
Pin the runtime version rather than floating it, and cache the dependency install. If there is no lockfile, use
the install command that tolerates that, and say so — a ci-style install will fail without one.
Four properties are worth naming because each is invisible when wrong:
- Only the triggers the flow needs. Where a working branch reaches the default branch through a pull
request,
pull_requestalready covers it; adding a push trigger for that branch runs everything twice per commit. A repository that commits straight to its default branch keeps only the push line. permissions: contents: read, plus whatever a specific job genuinely needs. The default token is broader than most workflows use.- A
concurrencygroup withcancel-in-progress, so a new commit supersedes the run in flight. - Full history where a check reads it.
actions/checkoutclones a single commit; anything asking git when a file last changed — a docs freshness check, a changed-files filter, a tag-derived version — needsfetch-depth: 0or it reads a one-commit repository dated today and answers wrongly.
Open this as a pull request rather than pushing to the default branch. The workflow file is on the branch, so it runs against its own PR — which is how you find out whether it passes before it can block anything. A red result here is the point: it has surfaced a real failure that was already there.
3. Protect the default branch
A ruleset on the default branch: restrict deletions, block force pushes, require a pull request before merging.
Required approvals: zero, for a solo project. Setting it to one on a repository with a single maintainer locks that person out of merging their own pull requests, with no way through except disabling the rule they just set. Set it to one when there is a second person.
Leave off, unless the project actually needs them: required reviewers, code owners, linear history, signed commits. Each adds friction that has to be paid on every change.
4. Make CI a required check
Only now, and only after the step-2 workflow has completed at least once — the check has to exist by name before it can be required. Add it to the ruleset, and require branches to be up to date before merging.
The requirement names the job, so the job's name is now an interface. Renaming it detaches the rule, which then passes on a workflow that no longer runs. Rename the two together or neither.
This is the step that converts CI from advisory to a gate: the default branch can no longer receive code that does not build or does not pass its tests.
Verify it worked
Do not assume the settings took. Confirm:
- A pull request shows the CI check running, and shows it as required.
- A direct push to the default branch is refused.
- The dependency config is on the default branch and the host reports the feature enabled.
Report what you turned on, and what remains a human step.
Worth considering, not defaults
- A CI badge in the README — free signal that the project is maintained.
- Auto-merging dependency PRs once CI passes. Reasonable on a library. On a repository whose default branch deploys straight to production, it ships dependency changes with nobody looking. Suggest it only once the person has watched the pipeline work for a while.
- Secret scanning with push protection, and code scanning — free on public repositories, and worth enabling the moment a repository becomes public.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

