- Work only inside this repository; create and use
scratchpad/for temporary files. - Do not read, write, or search outside the repo unless the user explicitly asks.
- Do not edit forbidden paths:
AGENTS.md,.githooks/,harness/,preferences/.github/,pyproject.toml. The gate enforces this. - Do not make assumptions. Check the code before moving forward.
- The quality minimum is code in
harness/gate.py(forbidden to agents). Leave it unchallenged. - Strengthen tests and coverage. Pass lint, type, and gate checks.
- Avoid lint suppressions, type-ignores, skipped/xfail tests, or broad exception swallowing.
- Never run destructive git commands (
rm -rf,git reset --hard,git branch -D) unless the user explicitly asks; verify each risky step. - Never bypass or reconfigure git hooks.
- ralph harness preflight runs on commit => fast lint + format check + plus loop containment.
- Run
harness preflightoften, runharness gatebefore pushing - Done means: no forbidden path touched; ralph harness gate is green; your chosen spec and
docs/PROJECT_STATUS.mdreflect what was built.
- Every agent-maintained
.md(docs/PROJECT_STATUS,docs/specs/) stays under 100 lines — distill for the next agent.
- At <=40% of your context window, stop expanding scope.
- Update
docs/PROJECT_STATUS.mdwith new state, checks, commit/branch, blockers, and next steps. - Update your spec.
- Leave the repo resumable.
- Commit through the gate, push, then merge when safe.
- Update
Verify assumptions. Surface confusion. Note tradeoffs.
Before implementing:
- State assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Request clarity.
- Review source code and tests.
Only the minimum code that solves the problem
- Strict scope compliance.
- Readable and reusable code.
- Prune code written for unlikely error paths.
- Be clear, not clever.
- Avoid sprawl. 200 lines could be 25: rewrite.
Ask: "Would a human say this is over-engineered?" Then simplify.
Touch minimal surfaces. Clean up only your own mess.
- Don't "improve" adjacent code.
- Don't refactor code that wasn't assigned.
- If you notice unrelated dead code, mention it - don't delete it.
- Remove imports/variables/functions that YOUR changes orphaned.
Acceptance criteria: Each changed line traces directly to the user's request.
- Write simple, readable Python.
- Prefer module-level functions. Reserve classes for changed state on data grouped with behavior.
- Avoid bloat like:
- wrapping literals in their constructors (
"x", notstr("x");[], notlist([])) - repeated string normalization (
.strip()later followed by.replace()) - overly defensive checks
- unecessary
.sortorsorted()
- wrapping literals in their constructors (
- Focus on readability and functionality first, rather than micro-optimizations.
- Be pragmatic
- Prioritize the big picture
- Emphasize readability
- Keep code lightweight and linear => do NOT be pedantic