approval-flow
CLAUDE.md1 starsChanged 4 months agoMITView on GitHub
Follow AGENTS.md first. This file is a short Claude-specific reminder. An ADR may clarify architecture. It may not weaken the assignment or approved requirements. On dev, docs/planning/V4_PLAN.md is the plan-of-record (Human-approved 2026-07-13); the assignment, requirements, and lecture teachings stay the top authority. main is frozen per M2 and governed by docs/planning/BASELINE_PLAN.md/docs/SCOPE.md. V2_PLAN.md and V3_PLAN.md are historical. Build the minimum assignment system, not a production platform. Keep exactly three business services: Keep assignment-mandatory F1-F10, M1-M18, and D1-D7. Keep the approved Human…
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- update-project-docsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
32 rules. About 0 are common, 26 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
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 3
Follow AGENTS.md first. This file is a short Claude-specific reminder.
- Distinctive: line 24
Keep exactly three business services:
- Very specific: line 30
Keep assignment-mandatory F1-F10, M1-M18, and D1-D7.
- Distinctive: line 42
Do not add write tools, payment tools, approval tools, rejection tools, workflow mutation tools, or irreversible side-effect tools to the …
- Distinctive: line 43
Do not let the LLM approve, reject, pay, create authority, enforce policy, mutate Workflow state, or bypass human approval.
- Distinctive: line 45
Keep the router deterministic.
- Distinctive: line 47
Keep human approval authority separate from AI advisory output.
- Distinctive: line 61
Use the skills available to you: check for and invoke the relevant skill (planning, TDD, debugging, verification, code review) and announce …
- Distinctive: line 63
Before coding, present a short plan and surface every decision that needs making, with options and a recommendation.
- Distinctive: line 67
Use focused TDD for observable mandatory behavior:
- Distinctive: line 69
Add a focused failing test.
- Distinctive: line 75
Use smoke checks for Docker, static UI shell, simple config, Dapr wiring, health, OpenAPI, and documentation formatting.
- Distinctive: line 77
Stop when the assigned task is complete.
- Distinctive: line 96
If another file is needed, explain why before reading it.
- Distinctive: line 98
Do not re-read all docs unless scope is unclear or the task explicitly requires it.
- Distinctive: line 104
Run review diagnostics as simple, separate commands.
- Distinctive: line 106
Run verification commands one at a time.
- Very specific: line 108
Do not chain commands with &&, ;, pipes, command substitution, shell loops, or multiline scripts unless the Human Developer explicitly …
- Very specific: line 110
Do not create or run temporary scratchpad Python scripts from /private/tmp, Claude scratchpad folders, or other generated temp paths.
- Very specific: line 112
Do not ask for one large chained Bash command that combines echo, grep, git, ls, variable assignment, pipes, and multiline python3 -c.
- Distinctive: line 130
If a complex diagnostic is truly needed, ask first and explain why simple commands are not enough.
- Distinctive: line 136
Prefer clear, direct code over clever abstractions.
- Distinctive: line 150
Do not require production-scale infrastructure, generalized frameworks, extra abstraction layers, or speculative scalability work unless …
- Distinctive: line 170
Keep business authority explicit during review:
- Very specific: line 179
Use tools/test.sh as the canonical repo-local pytest command.
- Distinctive: line 206
Prefer focused tests for the changed area first.
- Distinctive: line 207
Run related service tests only if shared behavior changed.
- Distinctive: line 208
Run the full relevant pytest suite only if needed for final confidence.
- Distinctive: line 209
Do not run Docker/Compose unless infrastructure, gateway, Dapr, or browser UI behavior changed.
- Very specific: line 227
Do not edit docs/PRODUCT_DILEMMA.md unless explicitly assigned.
- Distinctive: line 229
Do not edit assignment sources.
- Distinctive: line 231
Do not commit, push, merge, or create pull requests without Human Developer authorization.
≈ “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
ApprovalFlow Instructions for Claude
Follow AGENTS.md first. This file is a short Claude-specific reminder.
Authority Order
- Assignment-faithful wording in
docs/REQUIREMENTS.md - Approved Human Developer decisions in
docs/REQUIREMENTS.md docs/SCOPE.md(V1 baseline only)- Accepted decisions in
ADR.md docs/ARCHITECTURE.mddocs/planning/BASELINE_PLAN.md(frozenmain) ·docs/planning/V4_PLAN.md(currentdevwork; V2/V3 plans historical)AGENTS.mdCLAUDE.md
An ADR may clarify architecture. It may not weaken the assignment or approved requirements.
On dev, docs/planning/V4_PLAN.md is the plan-of-record (Human-approved 2026-07-13); the assignment, requirements, and lecture teachings stay the top authority. main is frozen per M2 and governed by docs/planning/BASELINE_PLAN.md/docs/SCOPE.md. V2_PLAN.md and V3_PLAN.md are historical.
Scope
Build the minimum assignment system, not a production platform.
Keep exactly three business services:
- Workflow
- Decision
- Payment
Keep assignment-mandatory F1-F10, M1-M18, and D1-D7. Keep the approved Human Developer gates named in docs/REQUIREMENTS.md: all-20 fixture conformance, INV-1009, INV-1014A/B, INV-1015, exact duplicate correction behavior, trusted server-side approver identity, trusted payment authority, non-overridable hard stops, and durable compensation visibility.
N1-N5 and B1-B3 are deferred unless explicitly assigned.
Safety Rules
- AI is advisory.
- Deterministic Python owns the final route.
- AI output and browser input cannot authorize payment.
- The real LLM-backed AI provider must use a bounded Tool Call Agent Loop only inside the AI advisory layer.
- Review that the loop remains advisory-only.
- Review that policy facts come through read-only policy tools backed by deterministic Python policy code, not by feeding the full policy document into the LLM prompt.
- Do not add write tools, payment tools, approval tools, rejection tools, workflow mutation tools, or irreversible side-effect tools to the LLM tool registry.
- Do not let the LLM approve, reject, pay, create authority, enforce policy, mutate Workflow state, or bypass human approval.
- Review that no write, payment, approval, rejection, or state-mutation tools are exposed to the LLM.
- Keep the router deterministic.
- Review that deterministic routing remains final authority.
- Keep human approval authority separate from AI advisory output.
- Review that explicit policy violations cannot be overridden by LLM output.
- Request-body
approver_idcannot override server identity. - Human approval cannot override deterministic hard stops.
- Human approval after
AI_PROVIDER_ERRORis allowed only when deterministic checks succeeded and no hard stop applies. - Decision creates trusted authority.
- Payment validates authority before reservation or payment.
- Exact duplicates stay terminal, including linked corrections with the same fingerprint.
- Failed release after reservation remains
COMPENSATION_PENDING.
Work Rule
Work only on the assigned PLAN task.
Use the skills available to you: check for and invoke the relevant skill (planning, TDD, debugging, verification, code review) and announce it.
Before coding, present a short plan and surface every decision that needs making, with options and a recommendation. No silent decisions: if you are choosing, ask and wait for approval. Surface new decisions mid-task the same way.
Work efficiently: grep to locate, then read only the relevant ranges instead of reloading whole files or re-reading established docs; batch independent tool calls in one turn.
Use focused TDD for observable mandatory behavior:
- Add a focused failing test.
- Capture RED evidence.
- Implement the smallest change.
- Capture GREEN evidence.
- Refactor only while green.
Use smoke checks for Docker, static UI shell, simple config, Dapr wiring, health, OpenAPI, and documentation formatting.
Stop when the assigned task is complete. Do not add optional features, extra abstractions, extra endpoints, production hardening, or unrelated refactors.
Documentation Completion Gate
After each task or meaningful feature group is completed, update the project documents before final handoff. The relevant PLAN file is a mandatory status target every time. Then check every other relevant architecture/demo/evidence file affected by the task, including README.md, docs/ARCHITECTURE.md, ADR.md, docs/RECORDING_SCRIPT.md, and docs/evidence/.
Mark what is complete, pending, deferred, planned, or future. Clearly distinguish implemented behavior from target architecture, and remove stale references to renamed files or old commands. Do not edit assignment sources or docs/PRODUCT_DILEMMA.md unless explicitly assigned.
Speed / Scope Review Rules
Review narrowly. Do not re-audit completed tasks.
Inspect only:
- files changed by Codex
- tests changed by Codex
- required docs for the assigned task
- generated run artifacts needed for this review
If another file is needed, explain why before reading it.
Do not re-read all docs unless scope is unclear or the task explicitly requires it.
Review whether Codex made the smallest change that satisfies the assigned task.
Review Command Style
Run review diagnostics as simple, separate commands.
Run verification commands one at a time.
Do not chain commands with &&, ;, pipes, command substitution, shell loops, or multiline scripts unless the Human Developer explicitly approves.
Do not create or run temporary scratchpad Python scripts from /private/tmp, Claude scratchpad folders, or other generated temp paths.
Do not ask for one large chained Bash command that combines echo, grep, git, ls, variable assignment, pipes, and multiline python3 -c.
The Human Developer's Claude permissions are intentionally scoped to simple commands. Chained commands may trigger unnecessary permission prompts.
Prefer:
git status --short
grep -n "Speed / Scope" AGENTS.md CLAUDE.md
python3 -m py_compile services/decision/router.pyAvoid:
echo "status" && git status --short && DIR=$(ls -d services/* | head -1) && python3 -c "..."If a complex diagnostic is truly needed, ask first and explain why simple commands are not enough. If approved, split it into separate commands and briefly explain why each command is needed.
Code Quality Review Rules
Review whether the code is simple enough for a human beginner/intermediate Python developer to read and explain.
Prefer clear, direct code over clever abstractions.
Check for:
- clear names
- small functions
- straightforward control flow
- useful validation
- appropriate error handling
- useful logging when behavior needs traceability
- configuration only when the task needs it
- short comments for non-obvious decisions
- tests that explain the expected behavior
Do not require production-scale infrastructure, generalized frameworks, extra abstraction layers, or speculative scalability work unless the assigned task explicitly needs it.
Best-practice feedback should improve clarity, safety, and maintainability without expanding scope.
Refactoring Review Rules
Accept refactoring when it is behavior-preserving and directly improves clarity, safety, or maintainability for the assigned task.
Flag refactoring when it:
- changes behavior without saying so
- expands the assigned task
- introduces unnecessary abstractions
- weakens deterministic authority boundaries
- hides behavior changes inside cleanup
- makes tests pass through fixture-specific hacks
- mixes product changes with broad cleanup
For large refactors, verify that public API behavior, response shapes, route/status/state transitions, deterministic authority boundaries, and existing tests are preserved.
Keep business authority explicit during review:
- AI may advise or extract evidence only.
- Deterministic code owns routing and policy enforcement.
- Payment authority must be trusted and server-created.
- Human approval cannot override deterministic hard stops.
Verification Budget Review
Use tools/test.sh as the canonical repo-local pytest command. It runs pytest
through .venv/bin/python when available and falls back to python3; do not
rely on globally installed pytest.
For all tests, run:
tools/test.shFor focused tests, run:
tools/test.sh path/to/test_file.py
tools/test.sh path/to/test_file.py -qThe whole-suite run must go through tools/test.sh, which runs each service in
its own process. A bare .venv/bin/python -m pytest -q across all services
fails at collection because the services share top-level package names
(accessors, engines, managers, ledger, contracts) that collide on one
sys.path. For a single service or file the direct venv call is fine:
.venv/bin/python -m pytest services/decision/tests -q- Prefer focused tests for the changed area first.
- Run related service tests only if shared behavior changed.
- Run the full relevant pytest suite only if needed for final confidence.
- Do not run Docker/Compose unless infrastructure, gateway, Dapr, or browser UI behavior changed.
Do not stage. Do not commit. Do not push.
Reviews
Human Developer review is required after each task or meaningful feature group.
Independent review is required after any task that touches a safety-critical boundary — the deterministic routing/ceiling boundary, cross-service contracts, payment authority validation or reservation, the AI advisory layer, or the final integrated system. In V2 that maps to T3 (contracts boundary), T4 (Decision ledger/state machine), T5 (MAF advisory), Optional Task B (Payment/ETag reserve), and T7 (final integrated gate). Do not require independent review after every small task.
Documentation and Git
Claude may edit README.md during implementation.
Agents may edit ADR wording only when assigned and must preserve the Human Developer's decision. Do not silently change ADR meaning.
Do not edit docs/PRODUCT_DILEMMA.md unless explicitly assigned.
Do not edit assignment sources.
Do not commit, push, merge, or create pull requests without Human Developer authorization.
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.

