risk-score
Skill29 starsChanged 8 months agoMITView on GitHub
Score how risky a pull request or branch is with fixed rules, and reply with the result as JSON. Use when asked how risky a PR, branch, or diff is, or to gate CI on PR risk.
- Reads credentials
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- stevepolitodesign/skillsedited, first seen Nov 8, 2026
- samsam007b/claude-code-standards-kittheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- stevepolitodesign/skills★ 10100% same
Wrote their own version · 1
- samsam007b/claude-code-standards-kit★ 2same 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 repository14 other files it gives its agents.
- ask-claudeSkill
- commitSkill
- diff-explainerSkill
- domain-modelSkill
- eli5Skill
- implement-with-tddSkill
- multi-lens-reviewSkill
- preparatory-refactorSkill
- prSkill
- rubber-duckSkill
- shipSkill
- sliceSkill
- traceSkill
- understandSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 90
If the diff command fails, reply with one JSON object instead, and still nothing else:
- Distinctive: line 100
Use the command's own error message.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Risk score
This runs in CI, where something reads the JSON and decides whether a PR needs
a second reviewer or can merge. That only works if the same diff gets the same
score every time. So the score comes from scripts/score.py, never from you.
Your job is getting the right diff into the script and handing back what it prints, untouched. If a rule looks wrong for this PR, that's a change to the script, made in a PR of its own. Bending one score breaks the thing CI trusts.
1. Pick the diff
$ARGUMENTS decides:
A number, or a GitHub PR URL: the PR.
gh pr diff <number or url> --color=never- Anything else non-empty: a base branch to compare the current branch with.
Empty: the base is
origin/$GITHUB_BASE_REFwhen that's set (GitHub Actions sets it onpull_requestruns), else whatgit symbolic-ref --short refs/remotes/origin/HEADprints, elsemain.git -c core.quotePath=false diff --no-color --no-ext-diff --find-renames <base>...HEAD
The flags pin the output format, so a user's git config can't change the score. Three dots means the diff since the branch left the base, which is what a PR shows. Uncommitted changes aren't part of a PR, so they aren't scored.
2. Score it
Pipe the diff straight in. Don't save, trim, or filter it first; the script already skips lockfiles and generated files where they shouldn't count.
git ... | python3 <this skill's directory>/scripts/score.pyThe script reads only the diff, never git history, so a shallow CI checkout works as long as the diff command does.
3. Reply
Reply with exactly what the script printed: one JSON object, no code fence,
nothing before or after. Something like jq parses your reply, so a sentence
of commentary breaks the job that called you.
{
"score": 7,
"level": "high",
"files_changed": 3,
"lines_changed": 41,
"signals": [
{
"rule": "migration",
"points": 2,
"reason": "Changes the database schema",
"files": ["migrations/20261103_drop_legacy_status.js"]
},
{
"rule": "destructive_migration",
"points": 3,
"reason": "Drops, renames, or rewrites existing columns, tables, or rows",
"files": ["migrations/20261103_drop_legacy_status.js"]
},
{
"rule": "untested_code",
"points": 2,
"reason": "Changes code without changing any tests",
"files": ["src/orders.js"]
}
]
}That holds when the user calls the change small, safe, or urgent, too. Their read of the PR isn't an input to the score.
If the diff command fails, reply with one JSON object instead, and still nothing else:
{
"error": "git diff origin/main...HEAD failed: no merge base",
"hint": "Check out with fetch-depth: 0, or pass the PR number."
}Use the command's own error message. "No merge base" in CI almost always means a shallow checkout; the hint above is the fix. Never score a different diff than the one asked for to get around an error.
Rules
For reading results, not for scoring by hand. Levels: 0–2 low, 3–5 medium, 6+ high.
| Rule | Points | Fires when |
large_diff | 1 / 2 / 3 | 50 / 200 / 500+ lines changed, lockfiles, vendored, and generated files excluded |
many_files | 1 / 2 | 10 / 25+ files changed |
migration | 2 | A file in a migrations folder (Rails, Django, Laravel, Knex, Ecto, EF Core, Flyway, Liquibase, Alembic, Prisma) or a .sql file changes |
destructive_migration | 3 | A migration adds a drop, rename, column change, truncate, or delete, in any of those tools' syntax or plain SQL |
sensitive_path | 3 | A code file's path names auth, sessions, passwords, permissions, secrets, or payments |
dependencies | 2 | A manifest or lockfile changes (package.json, go.mod, pyproject.toml, Gemfile, *.csproj, ...) |
infra_config | 2 | CI, Docker, Terraform, .env, or app config changes (config/, settings.py, application.yml, appsettings.json) |
untested_code | 2 | Code changes and no test file does |
tests_removed | 2 | Test files lose more lines than they gain |
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.

