Skip to content

Repository review

An evidence-driven review of the actual state of the repository, or of one change to it, before meaningful engineering work is recommended or done.

majordomus://skill/repo-review active version 1reviewevidenceinvariantsdrift

the worker needs

  • a checkout of the repository with git history available
  • the scope under review, or the whole repository when none is given
  • the effective context for every path in scope (majordomus context resolve <path>)

the procedure leaves

  • findings, each with severity, evidence, location, the smallest correct fix and the evidence that would prove it
  • the list of what was checked, including the areas where nothing was found

Purpose

Establish what is true about the repository before changing it. A worker that has not looked starts "helping" by adding a layer nobody asked for; this procedure makes the looking explicit, bounded and reportable. It reviews reality, not style: whether the code does what the documents say, whether the guarantees are backed by tests, whether the generated files match their sources, and whether the boundaries the repository declares are the ones the code keeps.

When to use

  • before implementing an issue, to check that the repository is where the issue assumes;
  • on a diff or a branch, before it is called done;
  • on a subsystem or the whole repository, when the question is "what is actually here";
  • on the generated surfaces (documents, projections, site data), when drift is suspected.

Not this skill: writing the fix, reviewing prose for tone, or estimating effort.

Procedure

Work through the sections in order. Each one names what to read and what to look for. Record every finding the moment it is observed, with the file and line it was observed in; do not wait for the end to reconstruct evidence from memory.

1. Scope and context

  1. Read the effective context for every path in scope: the root instruction file, the rules that apply, and the scoped documents from the root down to the directory (majordomus context resolve <path>, majordomus rules list). Note which rules are machine-enforced and which are enforced by a reviewer only; the second kind is where review earns its keep.
  2. Establish the change set: the branch and worktree, the diff against its base, and the history of the files it touches. Read the surrounding implementation, not only the changed lines; a correct line in a wrong function is a wrong change.
  3. State the scope in the report exactly as it was reviewed. Anything outside it is not covered, and the report says so.

2. Correctness

Look for behaviour that is wrong now, or that becomes wrong the first time the environment is not the happy path:

  • a violated invariant the repository states (a rule, a schema, a documented contract);
  • an incomplete state transition, or a record that can be left half-written;
  • an assumption the code makes that its inputs do not guarantee;
  • persistence gaps: what is lost on restart, on a partial failure, on a second run;
  • non-idempotent mutation: a command whose second run does something different;
  • a hidden fallback, a swallowed error, a "warn and continue" where the contract says stop;
  • two places that hold the same truth and can disagree.

3. Canonical and derived state

For every artifact in scope decide which it is: canonical, generated, cached, or unrelated. Then check that the derived ones can be regenerated deterministically from the canonical ones, that a stale one is detectable by a command that fails, and that nothing writes from a projection back into its source. A generated file that carries no mark saying so, and no check that fails when it is stale, is a second source of truth waiting to happen. Run the repository's drift checks rather than reasoning about them.

4. Testing and evidence

For every behaviour the change claims, find the test that exercises it from the outside. Look for:

  • a claim with no test, or a test that asserts an implementation detail instead of the behaviour;
  • a mock standing in for the very boundary the claim is about;
  • a skipped or ignored test, or a check that reports success having examined nothing;
  • documentation that promises more than the tests prove;
  • a regression that the change could introduce and that no case would catch.

Run the tests that cover the scope. A test result you did not observe is not evidence.

5. Architecture and boundaries

Check the change against the boundaries the repository declares: provider-specific content in provider-neutral places, a policy duplicated instead of referenced, a dependency added without a stated need, an abstraction with one caller, infrastructure that solves a problem nobody recorded, and data maintained by hand where it could be derived. Name the declaration the change violates; a boundary that exists only in the reviewer's taste is not a finding.

6. Performance

Only where performance is a stated contract or a hot path: read the benchmark evidence, look for repeated parsing, scanning or generation inside a loop, and measure before concluding. A performance finding without a measurement is speculation and is labelled as such.

7. Documentation

Check that the documents describing the scope match its behaviour today, that generated documents are in sync with their sources, that examples still run, that a guarantee's status is honest, and that nothing on a roadmap is described as an existing capability.

Output

The report has three parts, in this order.

Scope reviewed. What was read, which commands were run, and what was deliberately not covered.

Findings, most severe first. Each one carries:

fieldcontent
severityFAIL — must be fixed before the work is accepted; WARN — should be fixed, does not block; INFO — an observation with no required action
titleone line
evidencewhat was observed, quoted or measured, with path:line
what is wrongthe fact, separated from the inference drawn from it
why it mattersthe failure it causes, or the invariant it breaks
smallest fixthe least change that corrects it
proofthe test, check or command that would show the fix holds

Mark every sentence as one of: observed fact, inference, recommendation, speculation. Never promote an inference to a fact by leaving the label off.

What was checked and found sound. The areas of the procedure that produced no finding, named, so that an empty findings list is distinguishable from a review that did not look. If there are no substantive findings, say so in those words.

Never invent a finding to make the review look useful, and never omit one to make the change look ready.

Examples

Read from examples/ beside the skill; the title is each file's first heading.

Review a subsystem

.ai/repo/skills/repo-review/examples/review-a-subsystem.md

Review one directory and the documents that describe it, whether or not anything in it changed recently. Scope is the directory; the report names the documents it was checked against.

Apply the repo-review skill to lib/knowledge.sh, lib/knowledge.awk and docs/CLI.md's
knowledge section. Question: does the documented behaviour match the implementation,
and is every documented behaviour covered by a case under test/cases/?

Review an implementation against its issue

.ai/repo/skills/repo-review/examples/review-against-an-issue.md

Review a branch against the issue it claims to complete: the acceptance criteria, the declared paths, and the evidence the issue requires.

Apply the repo-review skill to branch feature/x against issue I0042
(majordomus plan show I0042). For each acceptance criterion, name the test that proves it
or report that none does. Report any file the branch touched outside the issue's paths.

Review the current diff

.ai/repo/skills/repo-review/examples/review-current-diff.md

Review the working tree and the staged changes against the base branch before they are committed. Scope is the diff; everything else is read for context and not reviewed.

Apply the repo-review skill to the current diff against master.
Scope: the files changed in the worktree. Report FAIL findings first.

Review generated files and documents for drift

.ai/repo/skills/repo-review/examples/review-generated-synchronisation.md

Review whether every generated surface matches its canonical source right now, by running the repository's own drift checks and reading what they do not cover.

Apply the repo-review skill to the generated surfaces: run scripts/generate-site-data
--check and majordomus generate --check, then read the documents under docs/ that
describe behaviour and compare them with the commands they describe. Report every
claim a document makes that no check or test would catch if it became false.

Review the whole repository's architecture

.ai/repo/skills/repo-review/examples/review-repository-architecture.md

Review the repository against the boundaries it declares: canonical sources, generated projections, provider neutrality, and the rules that are enforced by a reviewer only.

Apply the repo-review skill to the whole repository. Concentrate on sections 3 and 5 of
the procedure: every generated artifact and the check that fails when it is stale, and
every declared boundary and the code that keeps it. List the rules that are not
machine-enforced and say for each whether the tree honours it today.

Where this comes from

canonical file
.ai/repo/skills/repo-review/SKILL.md
content hash
6300cad27089e2bb72860d7db2c692199e849ddaaf7b3b522bd80a2ad614e5db
contract
share/schemas/majordomus/skill/skill.v1.schema.json
also served as
MCP resource majordomus://skill/repo-review · majordomus skills show repo-review

This page is generated from the file above by scripts/generate-site-data; editing the page changes nothing, editing the file changes every surface.