river-review
CLAUDE.md7 starsChanged 5 months agoMITView on GitHub
Repo rules: Follow all sections in AGENTS.md, imported below so Claude Code loads it even though this CLAUDE.md exists. This file adds only Claude Code-specific work policy. Approval follows the risk tiers in ADR-016; AGENTS.md "Edit Scope" summarizes them. After completing a task, state concisely: If a check fails, show the failure output and proposed fix before applying. The ledger docs/development/guard-ledger.yaml is the SSoT for this list under its guards: key — it records each guard's mechanization level, verifiedBy paths,…
- Reads credentials
- Deletes or force-pushes
- Installs packages
- Commits and pushes
In this repository140 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- static/llms.txtllms.txt
- ask-codexSkill
- river-review-disciplineSkill
- skill-creatorSkill
- skill-ops-plannerSkill
- skill-optimizerSkill
- commandsSkill
- adversarial-reviewSkill
- review-teamSkill
- river-review-architectureSkill
- river-review-codeSkill
- river-review-docsSkill
- river-review-frontendSkill
- river-review-performanceSkill
- river-review-security-auditSkill
- river-review-securitySkill
- river-reviewSkill
- river-review-testingSkill
- unknown-coverage-reviewSkill
- Coverage and Failure Path GapsSkill
- Flaky Test Risk CheckSkill
- GitHub Actions Workflow Security ReviewSkill
- Standard Review Policy for DownstreamSkill
- Test Assertion Effectiveness 常に PASS するテストの検出Skill
- Test Presence for Changed CodeSkill
- Test Naming and StructureSkill
- テスト観点レビュー(差分ドリブン)Skill
- a11y Accessible Name BasicsSkill
- Agent Skill Bridge ReviewSkill
- Altitude Generalization GuardSkill
- API Compatibility and Test Gap ReviewSkill
- Assumption Resolution Trace Plan の前提解消トレーサビリティSkill
- Async Correctness 非同期処理の正しさ検証Skill
- Behavior-Structure Separation 振る舞い変更と構造変更の分離・外部挙動維持Skill
- Closure Scope Retention GuardSkill
- Component Variants / States Documentation コンポーネント状態の文書化Skill
- Configuration File ReviewSkill
- Cross-File Leakage リファクタ後の caller 側残骸検出Skill
- Design Source-of-Truth Conformance デザイン定義準拠Skill
- Design System Component Reuse GuardSkill
- Design Token EnforcementSkill
- Detector Detection Power 検査器の検出力の検証Skill
- Documentation Hygiene ドキュメント衛生Skill
- End-to-End Wiring 末端到達・貫通の検証Skill
- Existing-Pattern Conformance 既存パターン準拠の確認Skill
- Firebase Security Rules ReviewSkill
- Fix Scope Integrity 指摘対応ループのスコープ逸脱・前提破壊検出Skill
- GitHubレビューコメント対応(修正案つき)Skill
- Hallucinated Reference 幻覚的参照の実在確認Skill
- Hello Skill (Always-On Sample)Skill
- i18n Unused Key ReviewSkill
- Impact Evidence Coverage 影響・失敗系・外部依存の証拠充足Skill
- Independent Review SynthesisSkill
- Invisible Unicode Injection Scan 不可視 Unicode コード注入検出Skill
- Knowledge-to-Code Alignment 新知識のコード反映・設計知識の保全Skill
- Laravel Eloquent N+1 and Query Efficiency ReviewSkill
- Laravel Mass Assignment and Authorization ReviewSkill
- The first 60 shown.
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Only Claude Code behavior policy belongs here.
- Distinctive: line 9
Never restate AGENTS.md content.
- Distinctive: line 15
Stage 1: agents do not merge: No agent merges a PR on any tier, including field.
- Very specific: line 16
Proceed autonomously: read-only exploration, running commands listed in .claude/settings.json allow list, and hill or field changes through …
- Distinctive: line 24
Do not add features, patterns, or dependencies not explicitly requested.
- Distinctive: line 25
If a task seems too large for one session, propose a plan and get approval first.
- Distinctive: line 29
After completing a task, state concisely:
- Distinctive: line 35
If a check fails, show the failure output and proposed fix before applying.
- Distinctive: line 41
Read before referencing: Do not cite file contents, function names, or line numbers without first reading the file.
- Distinctive: line 42
Run before claiming: Do not assert that tests pass or lint succeeds without running the command and showing output.
- Distinctive: line 43
No silent skips: If a required validation fails, report it — do not silently omit it from the report.
- Very specific: line 44
Search before inventing: When uncertain about a convention, search skills/, docs/, and existing code before creating a new pattern.
- Very specific: line 46
Research before proposing: Do not create GitHub issues without first confirming the feature is not already implemented.
- Very specific: line 47
Propagate signatures: When adding parameters to pipeline functions (generateReview, verifyFinding, buildExecutionPlan), consult …
- Very specific: line 48
Plan merge order: When creating multiple PRs that touch overlapping files, run /plan-merge-order before merging to minimize rebase cost.
- Very specific: line 70
When a retrospective identifies a recurring mistake or missing guardrail, follow the codification process in …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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
Claude Code Project Guide (river-review)
Repo rules: Follow all sections in AGENTS.md, imported below so Claude Code loads it even though this CLAUDE.md exists. This file adds only Claude Code-specific work policy.
@AGENTS.md
<!-- Maintenance: repo-wide rules belong in AGENTS.md.
Only Claude Code behavior policy belongs here.
Never restate AGENTS.md content. -->Decision Policy
Approval follows the risk tiers in ADR-016; AGENTS.md "Edit Scope" summarizes them.
- Stage 1: agents do not merge. No agent merges a PR on any tier, including field. See the No agent merge in stage 1 guard.
- Proceed autonomously: read-only exploration, running commands listed in
.claude/settings.jsonallow list, and hill or field changes through PR creation. A cliff operation follows the next item even when it matches the allow list. - Ask before acting: cliff changes and operations (the ADR-016 tier table, including modifying AGENTS.md or CLAUDE.md and changing dependencies), architectural changes, any destructive git operation, changes touching
src/that may break skill or schema alignment, running commands not in allow list.- 承認済みの実行計画は個別確認を覆う。 ユーザーが計画を承認したら、その計画に含まれる、確認が要る
src/の編集を 1 件ずつ確認し直さない。計画外の、確認が要るsrc/編集、計画からの逸脱、計画の途中で見つかった別件は従来どおり確認する。この但し書きが無いと、承認済みの計画でも各ステップの着手前に停止してしまう(2026-09-09 のparseArgs分割で 1 回発生)。
- 承認済みの実行計画は個別確認を覆う。 ユーザーが計画を承認したら、その計画に含まれる、確認が要る
Change Policy
- One logical change per branch. Do not bundle unrelated fixes.
- Minimal diff — do not refactor, reformat, or annotate code outside the task scope.
- Do not add features, patterns, or dependencies not explicitly requested.
- If a task seems too large for one session, propose a plan and get approval first.
Reporting
After completing a task, state concisely:
- What changed (files and purpose).
- What was verified (commands run and results).
- What needs human review (assumptions, edge cases, cliff paths touched).
If a check fails, show the failure output and proposed fix before applying.
AI Misoperation Guards
The ledger
docs/development/guard-ledger.yamlis the SSoT for this list under itsguards:key — it records each guard's mechanization level,verifiedBypaths, andreviewAfterdate, and the required checkMeta consistencyfails when the two drift. Add, rename, or remove a guard in the ledger and here in the same PR; retire perdocs/development/improvement-flow.mdStep 9. The same file also tracks timed decisions that are not guards underdecisions:(deprecated assets, workflows under observation, temporary exclusions) — those have no bullet here, andMeta consistencychecks only that eachtarget:path still exists (#1843).
- Read before referencing: Do not cite file contents, function names, or line numbers without first reading the file.
- Run before claiming: Do not assert that tests pass or lint succeeds without running the command and showing output.
- No silent skips: If a required validation fails, report it — do not silently omit it from the report.
- Search before inventing: When uncertain about a convention, search
skills/,docs/, and existing code before creating a new pattern. - Diff only what exists: In reviews, do not comment on code that is not in the diff.
- Research before proposing: Do not create GitHub issues without first confirming the feature is not already implemented. See
/propose-issue. This guard decides whether the issue should exist at all; Fact-check what you author covers whether its body is accurate. - Propagate signatures: When adding parameters to pipeline functions (
generateReview,verifyFinding,buildExecutionPlan), consultdocs/development/pipeline-params-checklist.mdto avoid call-site gaps. - Plan merge order: When creating multiple PRs that touch overlapping files, run
/plan-merge-orderbefore merging to minimize rebase cost. - Commit before branch switches: Before
git checkout/git switchwith uncommitted work, create a throwaway safety commit on a new branch:git switch -c wip/<topic> && git add -A && git commit -m "wip" --no-verify. Stash-then-switch chains have lost work when combined with the lint-staged auto-stash. Before creating that commit in a worktree you did not open yourself, checkListAgentsfor a live parallel session: uncommitted work under.claude/worktrees/or/tmpis more often a peer session mid-edit than a dead worker's remains, and a rescue commit on someone else's in-flight branch is an unrequested write to their work (2026-09-03,/private/tmp/wt-1978was committed as abandoned while its owning session was still editing it). Does not authorizegit stash drop,git reset --hard, orgit push --force— those remain prohibited per AGENTS.md Safety. - Verify git output before chaining: Extends Run before claiming. After
git commit,git push,git switch, andgh pr merge, read the branch name, commit hash, and status line in the output and confirm they match the intended target before running the next command. Verify withgit status -sborgit rev-parse --abbrev-ref HEADif the output is ambiguous. The same rule applies to the ref you are about to measure:git worktree add <path> <branch>andgit switch <branch>resolve a local branch that may lag its remote, so confirmgit rev-parse <branch>equalsgit rev-parse origin/<branch>before you verify anything against it. Verifying a stale local ref and reporting the result as fact has produced a public claim that a merged fix "does not exist" (2026-09-03, a worker's pushed commit read as absent because the local branch was 1 commit behind origin). - Verify gh active account before write ops: The active
ghaccount can silently switch froms977043(this repo) tokominem-unilabo(work). Before everyghwrite op, rungh api user --jq .login | grep -q s977043 || gh auth switch -u s977043. Treat a 404 /Could not resolve to a Repository/ permission error on anyghcall — reads included — as an account switch first, never as "the repo/PR does not exist": re-run the guard command, then retry.gh auth switchis cliff under ADR-016, with one exception until stage 2:gh auth switch -u s977043by this guard and its hook..claude/hooks/gh-account-guard.shchecks and switches the account before gh read and write ops (a failed switch blocks writes; reads only warn). Calls naming another owner via-R/--repoor arepos/<owner>/api path,gh auth, and reads aftercd/GH_REPO=or outside this repo are exempt; terminal runs outside the Bash tool are not covered — keep the session-start account check. History:docs/development/guard-details.md. - Merge-time checks: Before
gh pr merge, work throughdocs/governance.md§ "PR レビューとマージ" > "マージ前チェックリスト" (the SSoT for how to judge each item): CI green (gh pr checks), comment disposition from both thepulls/<N>/commentsandissues/<N>/commentsendpoints (npm run check:comment-disposition -- <N>paginates both and exits 1 if any human comment exists), blocking labels (gh pr view <N> --json labels;blockedstops the merge and only its author removes it — a same-account PR cannot receive a formal Request changes, so labels are the substitute),/preflightfor multi-PR / workflow-pin work, and.nvmrc-matchednpm run build:actionwhen touchingrunners/github-action/src/**. See alsoskills/midstream/gh-address-comments/SKILL.mdanddocs/development/dist-check-rebuild-guide.md. - No agent merge in stage 1: Under ADR-016 stage 1, an agent does not merge a PR on any tier, by any path (
gh pr merge,scripts/merge-chain.sh,gh apimerge endpoints, graphql, orgit pushtomain). Merge procedures elsewhere in this file, indocs/governance.md, and in.claude/commands/(including/release-kickand/merge-check) describe what a human runs; an agent may run their read-only checks and report the result. Nothing mechanically enforces this yet (ADR-016 P2 adds a supplementary hook), and moving to stage 2 is a cliff change. - Strict-mode batch merge: With
strict: trueprotection (gh api repos/OWNER/REPO/branches/main/protection --jq .required_status_checks.strict), update ALL remaining branches to the sameorigin/mainSHA at once (gh api --method PUT repos/OWNER/REPO/pulls/<N>/update-branch) before the chain, then merge one-by-one as each CI passes. On a lock-file-only 422: check the branch out,git merge origin/main,npm install --package-lock-only, commit, and fast-forwardgit push(the one lockfile regeneration ADR-016 allows, as a cliff change). Never rebase, force-push, or open a replacement PR. Rationale:docs/development/guard-details.md. - Dep bump peerDeps check: After editing
package.jsonto bump a package version, runnpm install --dry-run(ornpm ls --depth=1post-install) to surface newly required peer deps, including transitive ones thatnpm info peerDependenciesmisses. Add missing peers topackage.jsonin the same commit to avoid build failures on first CI run. - Review-doc SSoT sync:
docs/review/viewpoints.mdanddocs/review/output-format.mddeclarepages/reference/review-policy.md(ja+en) as their 出典/source. When changing review criteria, output sections, or severity vocabulary in the derived docs, updatereview-policy.md(both languages) in the same PR — otherwise the derived docs drift from the SSoT (#1196/#1197). - Verify agent completion reports: Report quality is NOT evidence of execution — background agents have fabricated entire completion reports. Before accepting delegated work as done, verify from the parent side:
git ls-remote --exit-code --heads origin refs/heads/<branch>(plainls-remoteexits 0 on a missing ref),gh pr view <N> --json url,git log/git statusin the agent worktree, andlsthe key new files. On a fabrication send ONE corrective re-instruction; if it recurs, take over inline or spawn a fresh agent. Re-derive a read-only agent's conclusions and aggregate figures from a primary source before acting on or quoting them. Checklist:/verify-agent-report; history:docs/development/guard-details.md. N of N required checks are expected= bot/GITHUB_TOKEN push: 必須チェックが全て緑なのにgh pr mergeがN of N required status checks are expected(BLOCKED)で拒否するときは、bot がGITHUB_TOKENで head を push したことを疑う(release-please とAuto Rebuild Action Dist。dependabot PR でも起きる)。判定は head を押したアカウントで行い、PR が open のうちに診断する。脱出は force-push ではなく自分のアカウントからの push で CI を発火させることで、gh pr merge --adminでは迂回できない(enforce_admins: true)。- 診断は
scripts/pr-unstall.sh <N>(dry-run。40 文字の head SHA で runs がaction_requiredかを判定)、脱出は人間がscripts/pr-unstall.sh --execute <N>を実行する(ADR-016 の崖。エージェントは実行せず、診断結果を報告する。release-please head は kick、それ以外は自アカウントで update-branch)。update-branch が 422 を返したら、人間が自分のアカウントから空コミットを push する。 - 診断コマンド・脱出手順・注意点は
docs/runbook/bot-pushed-head-kick.mdが SSoT。
- 診断は
- Import the SSoT, never re-derive it: A concept shared by more than one
src/libmodule has exactly one implementation, and a new module must import it rather than write an equivalent. Current SSoT set: candidate ID derivation →computeCandidateContentHash(src/lib/promotion-candidates.mjs;computeCandidateIdinsrc/lib/shadow-aggregate.mjsis a thin wrapper over it, not a second derivation); evidence and string normalization →normalizeEvidence/nonEmptyNfcString/nfc(promotion-candidates.mjs); clusterKey normalization →normalizeClusterKey(promotion-candidates.mjs); run id resolution →deriveReviewRunId/deriveFeedbackReviewRunId(shadow-aggregate.mjs). Delegated workers fail this reliably, even after reading the neighbouring module. A test must cross-check the existing production path, not the new code path: assert the new module's ID equals the onebuildProposedCandidateproduces for the same evidence. History:docs/development/guard-details.md. - Fact-check what you author: Extends Verify agent completion reports outbound: issue bodies and worker instructions you write as organizer or main agent are review targets too. Before publishing, re-derive every number, quotation, and premise from a primary source (the real file, API response, or original article — never memory or an earlier summary); quote values you just measured. For a same/different premise, read both definitions and confirm they share a namespace and a unit. When an instruction adds an exclusion or condition, name the failure case that must stay blocked and confirm it still is. Treat a worker's report of a self-contradictory instruction or disagreeing data as a signal to re-verify, not to restate. Cite the source inline (
file:line, command, or URL)./propose-issuecarries the issue-body version. - Execute what you document: Extends Run before claiming to the procedures you publish. Run every procedure, command, and workaround once before it ships, from its reader's state, and confirm it reaches the promised end state; a workaround must clear every gate, not move the failure to another required check. Reproduce any repository state the procedure depends on (upstream, worktree, branch protection) first. If running it for real is destructive or irreversible, use a sandbox repo or disposable target and state which steps were and were not exercised — never run a destructive command on the live repository for this guard.
- Check what the previous change pinned: Run
git log --follow -8 --format='%ci %h %s' -- <path>before editing a file or CI job. If 2 or more of those 8 commits changed how the file interprets its inputs, treat the tests as silent about every form not already pinned: confirm the form you are changing has a row on the side matching its expected exit status (VALID_CASESmust keep succeeding,CASESmust keep failing) and add the missing row before the change. Forsrc/cli.mjsthe pinned set istests/cli-usage-error-exit-codes.test.mjs; its header comment (:75-85) is the SSoT for pin scope and requires updatingEXPECTED_CONTRACT_COUNTSwith any expectation change. History:docs/development/guard-details.md. - An input shape is not a safety argument: Never conclude that a defect is out of scope because "real git does not emit that shape", and never treat the size of a regression sweep as evidence of coverage. Before writing that a shape is unreachable, name the code path that would produce it and grep for callers — one path is enough to refute it. Before writing that a shape is harmless, state which shapes the measured population actually contained; a count is not a band list. Known diff-parsing bands: git default / git
--unified=0/ git--cc/ non-git (diff -u -r) / hand-written with declared-vs-actual mismatch — treat the list as incomplete and say which bands you covered. History:docs/development/guard-details.md.
Improvement Flow
When a retrospective identifies a recurring mistake or missing guardrail, follow the codification process in docs/development/improvement-flow.md (retrospect → classify → draft → self-review → multi-agent review → PR → save memory). The resulting guards are tracked in docs/development/guard-ledger.yaml; their origins are in docs/development/guard-details.md.
Tooling
| Component | Location | Behavior |
| Permissions | .claude/settings.json | Defines allow/ask/deny command lists |
| Rules | .claude/rules/ | Loaded every session unless scoped with paths: frontmatter (globs: is ignored). review-core.md is intentionally unscoped; see .claude/rules-README.md |
| Hooks | .claude/hooks/ (README) | 4 hooks: no-force-push.sh, gh-account-guard.sh, and denied-read-guard.sh (PreToolUse, matcher Bash; the last blocks Bash reads of paths denied by Read(...) rules); format.sh (PostToolUse — prettier on .tool_input.file_path, falling back to git diff when absent) |
| Sub-agent | agents/river-review.md | Distributed plugin agent (top-level per #996); Read, Grep, Glob, Bash |
| Worker discipline | docs/development/worker-discipline-template.md | Copy-paste discipline block for delegated worker prompts |
Custom Commands
| Command | Purpose |
/check | Run quality checks (lint + test) |
/pr | Draft PR description |
/skill | Find or create skill definition |
/review-local | Self-review current diff |
/challenge | Adversarial review (pre-mortem, war game) |
/review-team | Parallel multi-role review with consensusLevel and Tech Lead report |
/setup-team | Set up River Review in a project (.river/rules.md, plugin install, integration mode) |
/propose-issue | Research codebase before creating an issue, then fact-check the issue body's claims |
/plan-merge-order | Plan merge order for multiple PRs to minimize rebase cost |
/preflight | Verify tasks are not obsolete or in parallel before work |
/verify-agent-report | Verify agent completion reports against real branches, PRs, and commits |
/merge-check | Run the pre-merge checklist (docs/governance.md) against a PR number |
/register-plugin-asset | Register a new distributed command/agent/agent-skill into the plugin manifests and validate |
/release-kick | Drive a release-please PR from BLOCKED unblock through merge and release verification |
/range-review | Review a git range with 3 parallel read-only perspectives, reproduce findings, and propose dispositions |
Details: distributed commands (/check /pr /skill /review-local /challenge /review-team /setup-team) live in top-level commands/ (plugin surface, per #996); repo-dev commands (/propose-issue /plan-merge-order /preflight /verify-agent-report /merge-check /register-plugin-asset /release-kick /range-review) stay in .claude/commands/.
Note: the distributed commands resolve only when river-review is installed as a plugin. When working inside this repo directly, Claude Code auto-discovers project commands from
.claude/commands/only — so the seven distributed commands are not available as in-repo slash commands (the repo-dev commands are).
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.

