core practice · coding

Build a scoped repository instruction map

Implement instructionMap() for a repository with a root AGENTS.md and a packages/api/AGENTS.md. Return {root, api, precedence, checks}. root must contain exactly three concise repository-wide invariants. api must contain exactly two API-only refinements and must not repeat a root rule. precedence must explain in at least eight words that nearer instructions refine broader instructions without silently overriding direct task intent. checks must list two runnable validation commands.

The mechanism

Instructions form a scoped configuration tree. Broad rules establish invariants, nearer files refine behavior for a subtree, and direct task intent supplies the leaf-level objective. A useful instruction is discoverable, non-contradictory, and paired with the command or artifact that proves compliance.

Study Repository Instruction Topology

Expected evidence

A non-duplicative instruction tree with explicit precedence and executable checks.

Try this drill in the practice workspace →

Hints when you need them
  • Put stable invariants high in the tree and package-specific commands near the owned files.
  • A validation command is more useful than prose such as 'make sure tests pass'.

Watch for these mistakes

  • Putting every rule in one root document until relevant guidance is buried
  • Repeating the same rule at multiple scopes and letting copies drift
  • Writing preferences that cannot be checked while omitting the actual validation command

Check the sources

Browse all practice briefs