check-pr
無料Check an externally created PR for coding rule violations against memory/INDEX.md atoms and docs/architecture/code-review-rules.md.
日本語の概要は準備中です。原文の説明を表示しています。
Autonomous Reforge-guided refactor workflow for the Humans repository. Use when the user wants Codex to target a section such as Shifts, Users, Teams, Tickets, Camps, or Store, create a dedicated worktree/branch from origin/main, run iterative architecture-focused improvements, score each stage with Reforge, gate commits through a score-blind read-only architecture review, append score and verdict details to commit messages after review acceptance, push progress, and open a PR when the loop reaches stasis.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Run a higher-autonomy refactor pass for one Humans section. This is the v2 tech-debt loop: Reforge supplies deterministic score pressure to the implementer/coordinator, and a separate score-blind architecture-review pass decides whether the change is worth keeping without seeing the metric movement.
origin/main, create refactor/YYYY-MM-DD-<section>-N, and attach .claude/worktrees/refactor-YYYY-MM-DD-<section>-N.local/refactor-runs/<run-id>/.reforge stop before and after every Reforge call. Do not use daemon mode.If resuming, continue the existing refactor worktree/branch only when the user clearly refers to it.
Before editing, spend a short, bounded pass (about five minutes for a familiar section) identifying the section's intended shape. Do this even when Reforge has obvious point targets; the score is secondary to the section architecture.
Build a section thesis with:
<Section>Info DTO; if a cache
exists, the cached value is usually the primary read model (UserInfo,
TeamInfo, CampInfo, etc.)I<Section>ServiceRead or equivalent, with a goal of a small
primitive surface: primary read(s), settings, search, and occasionally one
narrow lookup; projections and predicates are deletion candidates<Section>SettingsInfo when section settings are
read externally; avoid scattered settings scalar methodsBefore starting the meat of the refactor, share the thesis and candidate direction with the user when they are available. For explicitly autonomous or overnight runs, write the thesis to the run notes/PR and proceed without blocking, but let that thesis govern the candidate ledger.
Default repo-backed-section target:
Repository-backed section => read surface + write surface + primary <Section>Info.
Cross-section reads use I<Section>ServiceRead and DTO facts.
Cross-section writes/orchestration use the write/full surface only when the
caller is intentionally performing a command.
For autonomous or end-of-day runs, do not stop after the first failed implementations. Unless the user gives a shorter budget, work for at least 60 minutes before declaring stasis. If an implementation is rejected, switch search strategy and continue.
Before stasis is allowed, the run must have:
Two failed patches in a row are a signal that the search strategy is too shallow, not proof that the section has no valuable work.
ApplyTo, ToDto, RenderWith, BuildSummary, SaveAsync, or service-delegating wrappers are score-gaming unless they enforce real invariants, validation, state transitions, or domain policy already owned by that type.Reforge is a candidate-selection and checkpoint tool, not the definition of success. A lower score is useful only after the score-blind architecture review accepts the diff.
Capture baseline scores before editing:
reforge stop | Out-Null
reforge surface-score --solution Humans.slnx --format Json --all --top-symbols 200 > local\refactor-runs\<run-id>\stage00-all.json
reforge stop | Out-Null
reforge surface-score --solution Humans.slnx --group <Section> --format Json --all --top-symbols 200 > local\refactor-runs\<run-id>\stage00-section.json
reforge stop | Out-Null
For each candidate stage, write stageNN-all.json and stageNN-section.json. Use scripts/reforge_delta.py to summarize score movement for commit messages and status updates.
Measure value as:
target improvement + 2 * outside-target improvement, where improvement means score decrease; an outside-target regression of 5 cancels 10 target points<Section>Info/read DTO is not the same
as creating a new DTO; it is often the preferred move when it lets callers
derive projections/predicates without DB or service-specific readsNever keep a patch only to hit a percentage target. If the remaining ledger is only reducible through score-gaming, stop and report that safe score reduction is exhausted.
First build a candidate ledger from the section thesis. Do this before editing:
--all --top-symbols 200.<Section>Info/read shard. If not, name
the missing fact and decide whether that fact belongs on the canonical read
model.members, dependencies, injected, callers, audit-surface,
audit-downstream, and implementations.rg to inspect call sites and duplicate call structures.Search at least these categories before declaring stasis:
<Section>Info DTOIs..., Get...Summary, Build...Data, and
scalar lookup methodsThen repeat until stasis:
dotnet build Humans.slnx --disable-build-servers -v q -clp:ErrorsOnly.Stasis means the autonomy floor has been met and the remaining ledger is exhausted, blocked by hard limits, score-negative without architectural upside, or too speculative to change without user/product input. A run may stop early only when the user explicitly asks, the repo cannot build for reasons outside the branch, or continuing risks data/schema/contract changes the user did not authorize.
Use a separate read-only pass after every candidate stage. Prefer a subagent when multi-agent tools are available; otherwise perform an explicit second-pass review without editing. Read architecture-reviewer.md for the prompt and JSON contract.
The architecture reviewer must be score-blind. Do not provide Reforge before/after scores, rule deltas, weighted values, point savings, "this improved score" framing, or suspicious-improvement labels to the reviewer. The implementer/coordinator still computes those values for candidate selection and commit messages, but the review verdict must be based on the diff and architecture rules alone.
Inputs to the reviewer:
Reviewer verdicts:
accept: commit/push.rework: change the patch and rerun tests/Reforge/review.reject: abandon the patch or redesign before committing.Treat Reforge as candidate-selection pressure, not review evidence. Good consolidation removes duplicated call structures, uses canonical read DTOs, and replaces interfaces with small data where appropriate. Bad consolidation hides domain verbs behind generic action/mode dispatchers, grows god methods, moves complexity to private helpers, or shifts debt out of the target section.
The reviewer must reject patches whose main effect is moving methods into a new
helper/static class, replacing parameters with a DTO bag, or reducing a score
without deleting a concept. Acceptable read-model growth should usually add
facts to the existing <Section>Info/read shard, not create another projection
service.
The reviewer must also reject request/command/DTO "behavior" whose body only assigns fields, formats current fields, creates a DTO from the same fields, or delegates to a service. Accept only when the type owns a real invariant, validation rule, state transition, normalization rule, or domain policy that callers should not duplicate.
After the reviewer returns accept, attach the Reforge deltas and weighted value
to the commit message. If the reviewer returns rework or reject, do not use
score movement to argue with the verdict; fix, redesign, or abandon the patch and
rerun tests/Reforge/review.
Every accepted commit must include a score and review appendix:
<short imperative subject>
Reforge:
- Target: <Section> <before> -> <after> (<delta>); surface <delta>, internal <delta>
- Overall: <before> -> <after> (<delta>); surface <delta>, internal <delta>
- Weighted value: <target improvement + 2x outside-target improvement>
Architecture-review:
- Verdict: accept
- Grade: good|neutral
- Score-gaming risk: none|low|medium
- Reason: <one or two concise sentences>
Verification:
- <commands run and result>
Push after each accepted commit. If a PR does not exist by the time the user asks or the loop reaches stasis, open a draft PR with cumulative score movement, verification, and any commits the reviewer marked as tradeoffs.
I<Section>ServiceRead, a mutation/full write surface, and a primary <Section>Info DTO. Some sections may have explicit read shards keyed differently; document the shard and keep it cohesive.<Section>Info/read shard over adding a service predicate/projection/scalar lookup.IUserServiceRead, ITeamServiceRead, and section view DTOs for cross-section reads.public input types with mostly internal state as a smell on service interfaces; decorators and cross-assembly callers should not need result objects or side channels to recover data the input already contained.<Section>Info or a known read shard?" If yes, add missing facts to the
read model if needed, update callers, and delete the method.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Check an externally created PR for coding rule violations against memory/INDEX.md atoms and docs/architecture/code-review-rules.md.
日本語の概要は準備中です。原文の説明を表示しています。
Two-phase memory hygiene. Phase 1: scan external Claude Code memory (~/.claude/projects/<slug>/memory/) for durable rules to migrate into the repo and entries already duplicated by repo atoms. Phase 2: audit in-repo memory/, CLAUDE.md, docs/architecture/, and docs/sections/ for dead links, duplication, drift, and bloat.
日本語の概要は準備中です。原文の説明を表示しています。
Review, repair and steward the nightly Codex debt-sweep PR (branch codex/daily-debt/<date>). Judges every commit GOOD / REPAIR / REVERT, triages the bot review findings through /fix, lands one round-1 commit, files follow-up issues, then stewards the PR itself with a 3-round ceiling. Run by the 08:00 UTC cloud routine; also '/debt-review', '/debt-review 1789'.
日本語の概要は準備中です。原文の説明を表示しています。
Autonomous themed tech-debt cleanup. Reads docs/architecture/debt-ledger.yml, rotates to the least-recently-served debt theme, works it for a time budget (default 2h) or until drained, opens one PR, and asks judgment questions inline at the end. Use for daily debt burndown without Peter pointing at a target: grandfathered analyzer rules, architecture-test baselines, obsolete-field reads, cross-section stitching.
日本語の概要は準備中です。原文の説明を表示しています。
Scrap and regenerate the in-flight EF migrations on the current branch as one consolidated migration. Use when migrations have accumulated mid-development cruft (added/removed columns, stacked add-column-to-existing-table fixes, hand-edited SQL that needs to come out, schema changes that should have been one migration but ended up as five), or when the branch has merged main and its migrations are now stuck mid-chain so `dotnet ef migrations remove` is unsafe. Triggers on phrases like 'regen the migrations', 'redo these migrations', 'scrap and regen migrations', 'consolidate the in-flight migrations', 'redo the migration stack', or any time an agent hits the mid-chain situation in `memory/architecture/migration-regen-after-rebase.md`.
日本語の概要は準備中です。原文の説明を表示しています。
Use when a sprint tracking issue (label `sprint`) on peterdrier/Humans needs working — routine-fired cloud runs, or any unattended session told to execute the sprint queue.
日本語の概要は準備中です。原文の説明を表示しています。