/github-practices:github-practicesfrom github-practices
Audits a GitHub repository against good practices for branching (trunk-based or Gitflow), pull requests, issues, rulesets, CODEOWNERS, conventional commits, labels and releases, and applies only the changes the user approves. Use when asked to audit or configure a repo, choose a branching model, validate a branch name, protect the main branch, prepare issue and PR templates, configure Dependabot or set up release-please.
Ships in github-practices. 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.
Audits a repo and applies only what is approved. It does not impose a branching model: it picks one from the repo and explains why.
Mandatory gate before any write to GitHub (gh api -X POST|PUT|PATCH|DELETE, gh repo edit, gh label create|delete, push, PR): the request must carry a written OK for THAT specific change (for example "apply the ruleset"). A blanket OK ("I approve all the changes") covers only the change types the request names or that you already showed with their undo. Asking for the goal ("I want to protect main") is NOT that OK. Without it, your reply ends with the command, its undo and the question "shall I apply it?", even if nobody is there to answer. For agents that support permission rules, the block in assets/agent-permissions/ enforces the same gate.
main must be protected, or Dependabot, secret scanning or release-please enabled.Copyable checklist:
- [ ] Audit the repo in read-only mode
- [ ] Present the report by severity (high, medium, low)
- [ ] Choose the branching model and explain why
- [ ] Apply only what is approved, change by change
- [ ] Re-audit and confirm the gap is closed
Run the audit script, do not read it:
python3 "${CLAUDE_SKILL_DIR}/scripts/audit.py" --repo owner/name --path . --prs 30
In Claude Code the path is ${CLAUDE_SKILL_DIR}/scripts/audit.py. In other agents, use the path of the directory where this skill is installed. --json prints JSON to stdout (redirect it to a file if you want to keep it). The audit is read-only: it changes nothing on GitHub.
If the repo has no templates, workflows or rulesets, do not treat it as an error: that is the normal starting point and the report must say so.
Sort the findings by severity and give the recommended model with its reasons.
develop)..gitmessage).Also state what could not be checked: insufficient permissions, rulesets unavailable on a private repo (403), history without enough PRs.
When in doubt, TBD:
main only, short branches, squash): personal or single-person repos, services with continuous deployment, any case without grouped versions.main and develop as default): planned releases grouping several features, several collaborators, old versions still maintained.If the repo already uses a model and there is no clear contradiction, respect it. The default branch must match the model. Details in references/branching.md.
Separate two kinds of change, because they carry different risk.
Repo files (templates, workflows, versioned configuration):
internal/github-practices-setup from the default branch.assets/.github/... goes to .github/....CONTRIBUTING.md and it contradicts this flow, CONTRIBUTING.md wins: adapt and say so in the report.Remote configuration (rulesets, default branch, merge methods, labels, Dependabot):
Run audit.py again and compare with the initial report. A change is done when it disappears from the report, not when the command returns zero. Anything that depends on traffic or time (flow metrics) is declared pending. The ruleset asset does not include status checks on purpose, because their names depend on each CI: protection.status-checks stays low until stable checks exist.
internal/github-practices-setup branch with a draft PR, never straight to the default branch.CONTRIBUTING.md, the repo wins.References (read only the one you need):
| File | When to read it |
|---|---|
| references/branching.md | Choose TBD or Gitflow, set the default branch, name branches, decide squash or merge commit, hotfix and baselines |
| references/pull-requests.md | Open or review a PR, size, scope, template |
| references/commits-and-release.md | Conventional Commits, signing, breaking and skip-release labels, release-please |
| references/repo-config.md | Remote changes: default branch, merge methods, labels, rulesets, Dependabot and secret scanning |
| references/metrics.md | Read the flow report and its thresholds without turning them into a judgement |
Scripts (run them, do not read them):
| File | What for |
|---|---|
| scripts/audit.py | Read-only audit with --repo, --path, --prs, --json |
| scripts/branch_name.py | Validate branch repo against prefix, issue and length |
Assets (copy, do not edit):
| File | What to copy |
|---|---|
| assets/rulesets/tbd.json | Ruleset for the default branch in TBD |
| assets/rulesets/gitflow.json | Ruleset for main and develop in Gitflow |
| assets/.github/pull_request_template.md | PR template |
| assets/.github/ISSUE_TEMPLATE/bug.yml | Bug issue form with kind/bug |
| assets/.github/ISSUE_TEMPLATE/feature.yml | Feature issue form with kind/feature |
| assets/.github/ISSUE_TEMPLATE/config.yml | Disables blank issues |
| assets/labels.json | Labels kind/*, breaking, skip-release |
| assets/CODEOWNERS.example | CODEOWNERS if there is more than one maintainer |
| assets/.gitmessage | Commit template with Why and How |
| assets/release-please-config.json | release-please configuration |
| assets/.release-please-manifest.json | Initial version manifest |
| assets/.github/workflows/release-please.yml | release-please workflow |
| assets/.github/dependabot.yml | Dependabot version updates |
| assets/agent-permissions/ | Permission block that stops the agent at the first GitHub write |
assets/CODEOWNERS.example (opens in a new tab)assets/agent-permissions/claude-settings.json (opens in a new tab)assets/agent-permissions/opencode.json (opens in a new tab)assets/labels.json (opens in a new tab)assets/release-please-config.json (opens in a new tab)assets/rulesets/gitflow.json (opens in a new tab)assets/rulesets/tbd.json (opens in a new tab)references/branching.md (opens in a new tab)references/commits-and-release.md (opens in a new tab)references/metrics.md (opens in a new tab)references/pull-requests.md (opens in a new tab)references/repo-config.md (opens in a new tab)scripts/audit.py (opens in a new tab)scripts/branch_name.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub idiagovaleta/github-practices --plugin github-practices