Skip to content

R-Hatim/hrih-skills / skills/review-router

review-router

Verified

Decide how much human review a code change needs, judged from the change itself rather than its author, and tell the human exactly what to read first. Use it to triage, route or risk-rate a pull request, merge request, branch, commit range or diff, and for questions like 'does this need a human?', 'how risky is this PR?', 'can this auto-merge?', 'who should look at this?', or when agent-written changes arrive faster than people can read them. It sets a tier (low, medium or high) from a deterministic floor of sensitive paths plus judgement about intent, blast radius and reversibility, pairs every risk with the check that covers it, points at the three hunks to read first, and learns from human overrides through a REVIEW-LESSONS.md file read from the base branch. Skip it for a line-by-line bug hunt (use a code review tool), for style or lint questions, and for code that isn't in git.

FileKindSize
SKILL.mdskill md9.5 KB
references/lessons.mdmarkdown7.1 KB
references/router-policy.mdmarkdown3.2 KB
scripts/diff_facts.pyscript19.0 KB
scripts/lessons.pyscript18.9 KB

references/router-policy.md

View on GitHub
# Tuning the floor: `.review/policy.json`

`scripts/diff_facts.py` ships with default categories that set a minimum review tier. A repo can tune them with `.review/policy.json`. Like the lessons file, it's read from the **base branch**, so a change can't relax the rules it's judged by. Editing the policy is itself a `review-config` change that needs a human.

## Shape

```json
{
  "large_change_lines": 400,
  "huge_change_lines": 1000,
  "categories": {
    "payments": { "tier": "high", "words": ["payment", "billing", "invoice", "ledger", "payout"] },
    "billing-ui": { "tier": "medium", "why": "shows prices to customers", "globs": ["web/src/pricing/**"] },
    "public-api": null
  }
}
```

- A category you name replaces the default with the same name, field by field; `null` removes a default category.
- `tier`: `low`, `medium` or `high`, the minimum for any change touching a match.
- `globs`: whole-path patterns. `*` stays inside one folder, `**` crosses folders.
- `words`: whole words in any path segment. camelCase and snake_case are split first, so `accessToken.ts` matches `token` but `tokenizer.py` doesn't.
- `human: true`: a human must approve any change touching a match, whatever the tier. The defaults set it for CI workflows and for files that instruct reviewers and agents (`REVIEW-LESSONS.md`, `.review/`, `CODEOWNERS`, `AGENTS.md`, `CLAUDE.md`, `.claude/`, `.cursor/`).
- `why`: one line shown in the report.
- `large_change_lines`: above this many changed lines (excluding lockfiles and generated files) the floor is at least medium. `huge_change_lines`: above this, the report suggests splitting the change.

## Defaults and the thinking behind them

| Category | Floor | Why |
|---|---|---|
| review-config | high, human | Files that tell reviewers and agents what to do are the easiest place to hide a change in the rules. |
| ci | high, human | Workflows run with the pipeline's secrets. |
| auth | high | Sessions, tokens, permissions, secrets, crypto, CORS, row-level security. |
| payments | high | Money moves. |
| data-migration | high | Stored data changes shape, often irreversibly. |
| infra | high | Deployment and runtime configuration, `.env` files. |
| dependencies | medium | New third-party code runs with your permissions. |
| public-api | medium | Other code and people depend on the contract. |

## Keep the floor small

A path list is a weak router on its own. In Meta's published replay, expert-chosen sensitive paths caught 38% of outage-causing changes at the same gating level where a learned risk model caught about 61%. A floor that covers half the repo trains people to ignore it. Use the floor for the few places where a mistake is expensive no matter how small the diff, and let judgement and `risk` lessons do the rest.

Two habits from teams that run this at scale are worth copying:

- **Log overrides.** When someone merges past the router's tier, record who and why. Cloudflare's reviewers can "break glass" around their blocking bot; it's used on well under 1% of changes and every use is logged. Here, the record is a lesson or a note in the PR.
- **Watch reverts by tier.** If changes the router called low start getting reverted, raise the floor for those paths (a `risk` lesson does it without editing the policy) until the rate settles.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall