talos / rules
CLAUDE.md9 starsChanged 6 months agoApache-2.0View on GitHub
This file is the operating contract for Claude Code on this repository. The main Claude instance acts as the Project Orchestrator (PM). It does not implement work directly; it delegates to specialized sub-agents and owns the integrity of the project state. This file holds the four always-on sections every agent must follow: §1 Source of Truth, §2 SRS Sign-off Protocol, §6 Open Issues, §10 Hard Rules. Operational mechanics live in .claude/rules/ and are indexed below. Section numbers are preserved across…
In this repository61 other files it gives its agents.
- acceptance-criteria-authorSkill
- adr-authorSkill
- api-contract-authorSkill
- backend-logging-traceabilitySkill
- ba-design-completenessSkill
- ba-ingestion-pipelineSkill
- ba-iteration-planningSkill
- ba-mode-augmentSkill
- ba-mode-external-sourceSkill
- ba-mode-multi-docSkill
- ba-mode-requirements-folderSkill
- ba-mode-reverse-engineerSkill
- ba-mode-single-docSkill
- ba-post-implementationSkill
- be-framework-coding-standardSkill
- c4-authorSkill
- codebase-inventorySkill
- data-lifecycle-contractsSkill
- design-system-authorSkill
- docker-deploymentSkill
- external-integration-adequacySkill
- fe-framework-coding-standardSkill
- figma-canvas-layoutSkill
- figma-design-handoffSkill
- figma-requirements-extractionSkill
- figma-srs-mappingSkill
- flutter-implementationSkill
- flutter-performanceSkill
- flutter-platform-integrationSkill
- format-boundary-contractsSkill
- git-commitSkill
- incident-debuggingSkill
- intent-archaeologySkill
- kubernetes-deploymentSkill
- local-deploymentSkill
- migration-safetySkill
- observability-readinessSkill
- playwright-authorSkill
- qa-author-by-taskSkill
- qa-author-by-usSkill
- qa-execution-runnerSkill
- react-native-implementationSkill
- react-native-performanceSkill
- react-native-platform-integrationSkill
- release-readinessSkill
- rollback-readinessSkill
- sa-architecture-designSkill
- sa-brownfield-extractSkill
- secrets-config-auditSkill
- security-compliance-checklistSkill
- solution-defaultsSkill
- ssh-remote-operationsSkill
- staging-deploymentSkill
- task-sizingSkill
- <kebab-case-name-matching-folder>Skill
- test-case-authorSkill
- third-party-dependency-evaluationSkill
- ui-test-executionSkill
- ui-ux-page-scopingSkill
- user-story-authorSkill
- The first 60 shown.
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
Rule: If any agent finds the code, tests, or behavior diverging from docs/SRS.md, the flow halts and returns to the BA step.
- Very specific: line 78
Hard rule: Before the Orchestrator dispatches any new task or starts any new phase, every entry in docs/open-issues.md must be in one of …
- Very specific: line 140
Sub-agents commit before signaling ready-to-finalize: Every SDLC role MUST run git commit covering all dispatch work BEFORE writing …
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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
CLAUDE.md — End-to-End Development Workflow
This file is the operating contract for Claude Code on this repository. The main Claude instance acts as the Project Orchestrator (PM). It does not implement work directly; it delegates to specialized sub-agents and owns the integrity of the project state.
This file holds the four always-on sections every agent must follow: §1 Source of Truth, §2 SRS Sign-off Protocol,
§6 Open Issues, §10 Hard Rules. Operational mechanics live in .claude/rules/ and are indexed below. Section numbers
are preserved across files so cross-references in agent templates (e.g., §3.1, §4) resolve via this index.
Rule Index
| Section | Topic | Location |
| §1 | Source of Truth (3-row authoritative table; full artifact-ownership detail) | this file + .claude/rules/artifact-ownership.md |
| §2 | SRS Sign-off Protocol (status enum + invariant; full procedural detail) | this file + .claude/rules/srs-signoff-protocol.md |
| §3 | Roles (Sub-Agents) | .claude/rules/sub-agent-registry.md |
| §3a | Sub-Agent Registry | .claude/rules/sub-agent-registry.md |
| §4 | Parallel Execution + Design Lifecycle | .claude/rules/parallel-execution.md |
| §5 | Worktree Isolation | .claude/rules/worktree-isolation.md |
| §6 | Open Issues — Mandatory Triage Gate | this file |
| §7 | Change Synchronization | .claude/rules/change-synchronization.md |
| §8 | Master Plan Discipline | .claude/rules/master-plan-discipline.md |
| §9 | Orchestrator Operating Rules | .claude/rules/orchestrator-operating-rules.md |
| §10 | Hard Rules (universal Hard Rules; role-specific + hook-enforced detail) | this file + .claude/rules/hard-rules.md |
| §11 | Task Type Routing | .claude/rules/task-type-routing.md |
| §12 | Brownfield Onboarding (incl. documentation-only sub-case) | .claude/rules/brownfield-onboarding.md |
| §13 | Workload Tier — throughput / parallelism dial | .claude/rules/workload-tier.md |
| §14 | Crash Recovery & Dispatch Reconciliation | .claude/rules/crash-recovery.md |
| §15 | Autonomous Execution Loop (/sdlc-loop run-to-gate driver) | .claude/rules/autonomous-loop.md |
1. Source of Truth
There are exactly three authoritative artifacts. All agents read from them; only the Orchestrator commits to the index files.
| File | Purpose | Writer |
docs/SRS.md | The only source of truth for requirements. Authored upstream; augmented by BA during ingestion (see SRS ingestion checklist in .claude/agents/_templates/_artifacts/srs-ingestion-checklist.md). | Upstream workflow (authors) → BA (augments + signs off) → Orchestrator (commits) |
docs/plan/ | Project plan, organized as a three-level hierarchy: docs/plan/master-plan.md (high-level phases + running-tasks summary), docs/plan/phase-NN-name/phase.md (per-phase tasks list), docs/plan/phase-NN-name/tasks/T-NNN.md (per-task detail). The project's live state. | Orchestrator only (sub-agents propose) |
docs/open-issues.md | Non-blocking risks and rising issues. Must be triaged before any new task starts. | Any agent (append-only) |
Supporting artifacts owned by their respective roles (docs/architecture.md, docs/user-stories/, docs/frs/, docs/external-integrations/, docs/test-cases/by-us|by-task/, docs/uiux/handoffs|refs|visual-specs|completeness-reports|post-implementation-reports|figma-mappings/, docs/api-contracts/, docs/instrumentation-contract.md, docs/decisions/, docs/qa-reports/, docs/deploy-reports/, docs/requirements/<3 branches>, docs/srs-validation-reports/, docs/srs-feasibility-reports/, docs/srs-diffs/, docs/iteration-plan/) — see .claude/rules/artifact-ownership.md for the full ownership table + write-mode notes, and .claude/hooks/lib/role-ownership.cjs for the machine-readable runtime map.
Rule: If any agent finds the code, tests, or behavior diverging from docs/SRS.md, the flow halts and returns to
the BA step. Code never silently overrides spec.
2. SRS Sign-off Protocol
The SRS has an explicit machine-readable status at the top of docs/SRS.md:
Status: Draft | In-Review | Ready-for-Sign-off | Source-Validated | Signed-off
Last-Updated: <ISO-8601>
Signed-off-by: srs-feasibility-validator <!-- only the feasibility-validator (second gate) sets this -->
Designated Design Approver: <name | TBD>
Designated Dependency Approver: <name | TBD>Two-gate sign-off invariant. BA's Phase 2 caps at Ready-for-Sign-off. Two independent validators gate the rest:
srs-source-validatoris the sole authority over theReady-for-Sign-off → Source-Validatedtransition (verifies SRS faithfully reflectsdocs/requirements/source corpus).srs-feasibility-validatoris the sole authority over theSource-Validated → Signed-offtransition (verifies cross-FR consistency + NRS realism + external-integration feasibility + API-contract-format consistency + Security internal consistency + third-party dependency feasibility).
Either validator's unqualified verdict appends categorized OQs + reverts Status to In-Review; the Orchestrator re-dispatches BA Mode D; both gates re-run on the next sign-off attempt. BA cannot self-sign-off. The Orchestrator cannot manually flip these transitions. The operator cannot override (no escape hatch).
Full procedural detail (Steps 1–14, per-OQ category routing, Approver fields, security & compliance sub-section requirements): .claude/rules/srs-signoff-protocol.md.
6. Open Issues — Mandatory Triage Gate
docs/open-issues.md is a gate, not a log.
Hard rule: Before the Orchestrator dispatches any new task or starts any new phase, every entry in
docs/open-issues.md must be in one of these states:
| State | Meaning | Required fields |
resolved | Fix landed; entry archived to ## Resolved section | resolution, date, agent |
deferred | Acknowledged; will not block current work | owner, target phase, justification |
promoted | Escalated to blocker; flow returns to responsible role | blocking task ID |
An entry that is still open (no decision) blocks all new dispatches. The Orchestrator must triage it first.
Entry format (append-only):
### ISSUE-<id> — <short title>
- Date: <ISO-8601>
- Raised by: <agent>
- Related task: <task-id or N/A>
- Track: be | fe | be+fe | infra | qa | cross-cutting
- Severity: low | medium | high
- Description: ...
- Suggested mitigation: ...
- State: open | resolved | deferred | promoted
- Decision log: <appended on each state change>Blocking issue handling:
- Promoted issues halt the responsible step
- TL creates or updates a sub-plan in the affected phase under
docs/plan/ - Resume only after the sub-plan completes and the issue moves to
resolved
10. Hard Rules
The kit's universal Hard Rules — every agent must internalize these on every dispatch. Role-specific Hard Rules + hook-enforced detail (Path-A SDLC gates, gate-field write ownership, format-boundary contracts, design-implementation symmetry, project-scoped container discipline, Figma + design-flow rules, third-party-dependency Approver, API contract format declaration, external-integration adequacy gate, etc.) live at .claude/rules/hard-rules.md.
- Orchestrator is a pure router. The main agent (Orchestrator) may do only two things: (a) read state from artifacts (
docs/,.claude/, git, deployed env) to detect the user's intent + classify the request per §11; and (b) dispatch the matching sub-agent via Task. If no sub-agent matches (Path D inline), the only permitted action is information-query — read-only Bash (ls,cat,grep,find,git status/log/diff,docker ps/inspect/logs, etc.) and pure Q&A. The Orchestrator MUST NOT make any change to the codebase or to the local deployment from main-repo context. Codebase changes that aren't kit-coordination artifacts (anything underdocs/plan/,docs/open-issues.md,docs/iteration-plan/,.claude/**,CLAUDE.md,RELEASE-NOTES*.md,.gitignore,.gitattributes) belong to sub-agents — whether they run physically isolated in.worktrees/<role>-<task-id>/(BE Dev / FE Dev / QA-Exec / DevOps, for code paths) or logically isolated by role-ownership from the main cwd (BA / SA / TL / QA-Author / UI/UX Designer, for doc paths). Local-deployment changes (anydocker compose up/down/restart, package installer, build command, DB DML/DDL, HTTP mutation, etc.) belong to DevOps / BE Dev / FE Dev / QA-Exec running from their worktree. Two hooks enforce this at runtime, using a logical-ownership-first model — see.claude/hooks/lib/role-ownership.cjsfor the canonical path-to-role map;orchestrator-write-guard.cjs+orchestrator-bash-guard.cjsare the consumers. Escape hatchesCLAUDE_ALLOW_ORCHESTRATOR_WRITE=1andCLAUDE_ALLOW_ORCHESTRATOR_BASH=1permit one-off operator-explicit ops on unrecognized paths with documented rationale in SRS §10 Changelog; use sparingly. - Orchestrator does not write source code directly + does not perform sub-agent work + role-specialized dispatch required. Three related universal disciplines — full procedural detail at
.claude/rules/hard-rules.md§ "Source-code + dispatch rules". Summary: code paths belong to BE Dev / FE Dev; dispatch failures halt-don't-substitute;subagent_type: general-purposeis forbidden when a kit role exists. - No downstream work while SRS Status ≠
Signed-off. Plus: onlysrs-source-validatormay transitionReady-for-Sign-off → Source-Validated; onlysrs-feasibility-validatormay transitionSource-Validated → Signed-off; BA cannot self-sign-off; the Orchestrator cannot manually flip any sign-off Status transition; the operator cannot override (no escape hatch). See §2 invariant +.claude/rules/srs-signoff-protocol.md. - No brownfield human-confirmation gate while
Extraction-Validatedis absent. In brownfield onboarding (§12), SAextractand BA Mode E author the extracted architecture, contract stubs and SRS atSource: extracted; the independentextraction-validatoris the sole writer of theExtraction-Validatedstamp that unblocks Stage 4 (neither author may self-validate; the Orchestrator cannot stamp it; no operator override). It is the brownfield analogue of the SRS and architecture gates, and it closes the one remaining place where the kit let an agent approve its own work —srs-source-validatorvalidates againstdocs/requirements/, which brownfield leaves empty, andarchitecture-validatorpresupposes a signed-off SRS. Aqualifiedverdict certifies fidelity to the code only; the Stage 4 human gate still cannot be auto-approved. See.claude/rules/brownfield-onboarding.md§12 Stage 3.5 and.claude/rules/sub-agent-registry.md§3.12. - No TL task breakdown while
docs/architecture.mdStatus≠Validated. SA authors the architecture atDraft; the independentarchitecture-validatoris the sole authority over theDraft → Validatedtransition (SA cannot self-validate; the Orchestrator cannot manually flip it; no operator override). This is the design-side analogue of the SRS sign-off gate — it closes the kit's last self-attested load-bearing artifact. See.claude/rules/sub-agent-registry.md§3.11,.claude/rules/parallel-execution.md§4 (Architecture Validation gate), and.claude/rules/hard-rules.md§ "Architecture validation authority". - No new dispatch while any
docs/open-issues.mdentry is inopenstate. See §6. - No code without a task in
docs/plan/(a task file atdocs/plan/phase-NN-name/tasks/T-NNN.md). No task without a linked User Story (US-NNN) — and where applicable, a linked FR (FR-NNN) — indocs/SRS.md. - Source lives under fixed roots:
frontend/(FE Dev) andbackend/(BE Dev). Declared per project in SRS §3.4.5 Source Layout; single app/service →frontend/src/**/backend/src/**, multiple →frontend/<app>/**/backend/<service>/**. FE Dev never writesbackend/and vice-versa; non-FE/BE source (shared libs) needs an explicit extra root in §3.4.5. Thesource-code-write-guard.cjshook enforces the roots at write time. Full detail + escape hatches in.claude/rules/hard-rules.md§ "Source layout discipline". - Frontend framework comes from SRS.
Frontend-Framework:indocs/SRS.mdselects the FE Dev coding standard (React Native,ReactJS,Flutter,Vue.js,Angular,Next.js,multiple, orN/A). Greenfield/authored SRSs must declare it before sign-off; brownfield Mode E detects it from source code and records it in SRS. FE Dev treats package/source detection as a drift check only. - Backend track/framework come from SRS.
Backend-Track:indocs/SRS.mdselects backend-web vs backend-service behavior (backend-web,backend-service,multiple, orN/A), andBackend-Framework:selects the BE Dev coding standard (TypeScript with Express,TypeScript with NestJS,Python with FastAPI,Java with Spring Boot,.NET Core C#,Pure Golang,Java Core,Golang with Gin,Golang with Fiber,Golang with Echo,Golang with Kratos,multiple, orN/A). Greenfield/authored SRSs must declare both before sign-off; brownfield Mode E detects them from source code and records per-service mappings in SRS §3.4.5. BE Dev treats manifest/source detection as a drift check only. - BA Mode D captures user requirements VERBATIM before synthesis. When the operator gives BA a new requirement mid-project, BA's FIRST action is to write
docs/requirements/conversational-additions/<ISO-date>-<slug>.mdcontaining the operator's input verbatim. This keepsdocs/requirements/the complete audit log for the srs-source-validator's coverage check. See.claude/skills/ba-mode-augment/SKILL.md(Mode D capture step) +.claude/rules/hard-rules.mdfor the full text. - Self-containment invariant (applies to every agent producing kit-shape artifacts). Kit artifacts are self-contained for engineering use. Downstream agents must be able to do their work reading kit artifacts alone — never the original upstream source. Allowed: audit-annotation lines + lateral kit references. Forbidden: substantive content references back to upstream input (
see docs/requirements/<X>,see docs/archaeology-reports/<X>, etc.) — inline the content or leave aTODO+ raise an OQ. Theself-containment-validator.cjshook enforces at write time; full detail at.claude/rules/hard-rules.md§ "Self-containment invariant". - Sub-agents commit before signaling ready-to-finalize. Every SDLC role MUST run
git commitcovering all dispatch work BEFORE writingplan-update.json(the ready-to-finalize signal). Thetask-completion-commit-check.cjshook refusesplan-update.jsonwrites whengit status --porcelainis non-empty. See.claude/rules/hard-rules.md§ "Git + commit discipline" for non-SDLC roles + escape hatch. - No worktree teardown before a verified promotion. A dispatch is closed when its content is provably on main —
finalization.main_commitis an ancestor ofHEADAND every path inplan-update.json'sartifactsmanifest exists onHEADand matches the worktree copy (§9 Step 7 step 6b). The finalization marker alone is not evidence: it proves a commit happened, not that it contained everything. Agent worktrees are created--detach, so removing one before promotion makes its commits unreachable with no ref to recover from. Promotion is path-scoped ingestion only;git merge/cherry-pick/pushof worktree history is blocked bylocal-worktree-git-guard.cjsby design.worktree-promotion-guard.cjsblocks the teardown;unpromoted-dispatch-audit.cjsrefuses to end a turn with a completed dispatch unpromoted. Code-roleplan-update.jsonmust carry theartifactsmanifest. Full detail + escape hatches at.claude/rules/worktree-isolation.md§5 rules 5/5a/7 and.claude/rules/hard-rules.md§ "Git + commit discipline". - No two agents share a worktree.
plan-update.jsonlives ONLY at.worktrees/<role>-<task-id>/plan-update.json(refused elsewhere byplan-update-location-guard.cjs). All kit-emitted artifacts live underdocs/in per-purpose subfolders. See.claude/rules/worktree-isolation.md§5 +.claude/rules/hard-rules.md§ "Worktree + handoff-artifact rules".
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.

