agentleFS
sakhujarohansakhujarohan/keel/AGENTS.md

keel

AGENTS.md1 starsChanged 6 months agoMITView on GitHub

This file is the operating context. Any agent — Claude Code, Codex, Cursor, Gemini, Aider, or a human — can read this single file and run the full lifecycle with no other context. CLAUDE.md and GEMINI.md are symlinks to this file so every tool loads the same instructions. Keel is a deterministic, gated workflow for building software with one or more AI agents — from a raw problem statement to shipped, reviewed code. It is designed so the same steps…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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
  1. Distinctive:

    When in doubt, stop at the gate and ask.

    line 17
  2. Very specific:

    Claude Code: run /kickoff and follow the prompts.

    line 58
  3. Very specific:

    Every run keeps a specs/<run>/STATUS.md — the *captain's log* — so work survives across sessions and agents:

    line 71
  4. Very specific:

    Traceability end-to-end, expressed readably: Every requirement has an ID (R1, R2, …) — but IDs are *light labels on prose*, concentrated in …

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Keel — Agentic Development Lifecycle

This file is the operating context. Any agent — Claude Code, Codex, Cursor, Gemini, Aider, or a human — can read this single file and run the full lifecycle with no other context. CLAUDE.md and GEMINI.md are symlinks to this file so every tool loads the same instructions.

Keel is a deterministic, gated workflow for building software with one or more AI agents — from a raw problem statement to shipped, reviewed code. It is designed so the same steps produce the same quality every run, whether you have a week or an afternoon.

It is not tied to any language, framework, or domain. The tech stack is chosen during a run, as a gated step — never assumed up front.


Prime Directive

Follow the lifecycle in order. Each phase ends in a GATE. Never proceed past a gate without the human's explicit sign-off.

The gates exist to stop the single most common and most expensive failure in AI-assisted development: an agent designing or coding before the problem is locked, latching onto a partial reading, and producing work that has to be torn down when the real requirements surface.

When in doubt, stop at the gate and ask. A blocked agent costs minutes; a wrong design costs the session.


The Lifecycle at a Glance

#PhaseArtifact (from templates/)Gate — human sign-off
0Kickoffspecs/<run>/context.md— (renderer bootstrapped here)
1Requirementsspecs/<run>/requirements.mdG1 — Requirements Lock (clarify loop + all assumptions confirmed + Literal Mandates captured)
2High-Level Designspecs/<run>/hld.mdG2 — HLD sign-off
3Stack Selectionspecs/<run>/stack.md + conventions.mdG3 — Stack Lock
4Low-Level Designspecs/<run>/features/<feature>/lld.mdG4 — LLD sign-off (per feature)
5Spec-Compliance Reviewspecs/<run>/features/<feature>/spec-check.mdG5 — Spec-Compliance Lock (LLD vs. Literal Mandates; per feature)
6Task Breakdownspecs/<run>/features/<feature>/tasks.mdreview
7Build & Testcode + tests—
8Harden & Reviewreview-checklist.md, ADRs in decisions/G6 — Ship review

The full per-phase playbook — inputs, activities, exit criteria — is in workflow/lifecycle.md. Read it before running a phase. For time-boxed or rapid work, read workflow/fast-path.md, which compresses the artifacts without removing the gates.


Anti-Patterns This Workflow Exists to Prevent

Name them out loud when you catch one. Each maps to a gate or principle that prevents it.

  • Premature design — proposing architecture before requirements are locked. Prevented by G1.
  • Scope-latch — anchoring on an early or partial reading of the problem and missing requirements that surface later. Prevented by the Phase-1 clarify loop and explicit out-of-scope list.
  • Silent-assumption — proceeding on a default the human never confirmed, baking it into the design without surfacing it. Prevented by G1's confirmed-assumptions rule; the clarify loop is mandatory.
  • Requirements-drift — a new requirement appears mid-build and silently invalidates the design. Handled by looping back to the earliest affected gate, not patching forward.
  • Gate-skipping — jumping to code because the problem "looks simple." Prevented by the Prime Directive.
  • Context-loss — a later phase forgetting the rationale of an earlier one. Prevented by traceability IDs that flow requirement → design → task → test.
  • Over-engineering — speculative abstraction for needs that do not exist yet. Prevented by the smallest-correct-solution principle.
  • Invented facts — fabricating a number, constraint, or capability. If unknown, write UNKNOWN and ask. Never guess a fact.
  • Spec-divergence — an ADR or LLD choice that silently contradicts a Literal Mandate (e.g. choosing 204 when the spec says 201; leaking fields the spec forbids). The spec wins; fix the design. Caught by G5 (Spec-Compliance Lock) and the G6 Spec-Compliance Ledger.
  • Vibe-coding — writing code with no spec to trace it to. Every line of code traces to a task; every task traces to a requirement.

How to Start a Run

Claude Code: run /kickoff and follow the prompts. The phase commands are /kickoff → /requirements → /hld → /stack → /lld → /spec-check → /tasks → /implement → /review. Session commands: /resume at the start, /status to refresh the dashboard, /handoff before you stop.

Any other agent: open workflow/lifecycle.md and execute Phase 0. Create specs/<run>/ for this piece of work (<run> = a short kebab-case name for the feature or project).

Phase 0 establishes three things and writes them to specs/<run>/context.md:

  1. Mode — new project (greenfield) · feature or change in an existing codebase.
  2. Time budget — drives whether you use the standard path or the fast path.
  3. Rigor profile — prototype, standard, or production (see below).

Run State & Continuity

Every run keeps a specs/<run>/STATUS.md — the captain's log — so work survives across sessions and agents:

  • Source of truth = artifact frontmatter. Each artifact carries a small YAML block (phase, gate, status, updated). When a gate passes, its artifact is set to status: signed-off.
  • STATUS.md has two zones. ## Now is a derived snapshot (phase, gate line, task rollup, next action) — regenerated, never hand-edited. ## Session log is append-only, newest on top — one entry per work session.
  • Commands: /status regenerates Now from the frontmatter + tasks; /handoff (session end) appends a log entry and prints a git-anchored resume packet; /resume (session start) re-orients from STATUS.md + git and confirms the next step. Agents without these commands do the same by hand.

Rigor Profiles

Production rigor is modular, not all-or-nothing. A profile sets a default level for each engineering concern (tests, observability, resilience, security, docs, CI, performance). Pick one at kickoff:

  • prototype — validate an idea fast. Core-path tests, basic logging, minimal ceremony.
  • standard — a real, maintainable service. Unit + integration tests, structured logging, input validation, ADRs.
  • production — ship at scale. Adds contract/e2e tests, metrics + tracing, resilience patterns, threat model, full CI/CD, SLOs.

Per-concern overrides are expected. "standard, but production-level observability" is a valid, common choice — record it in context.md. See profiles/ for the full axis-by-axis definition.


Operating Principles

These hold in every phase. The full constitution is in principles.md.

  1. Specs are the source of truth. Code is the expression of the spec. When intent changes, change the spec first, then flow it down.
  2. Traceability end-to-end, expressed readably. Every requirement has an ID (R1, R2, …) — but IDs are light labels on prose, concentrated in the Validation Ledger, never ID-soup. A human must be able to read any artifact without decoding IDs.
  3. Tests prove behavior. Tests are written against acceptance criteria, not against the implementation.
  4. Smallest correct solution. Solve the locked requirements and nothing more. Add abstraction when a second caller exists, not before.
  5. No invented facts. Unknowns are marked UNKNOWN and raised, never guessed.
  6. Load-bearing decisions are recorded as ADRs in decisions/.
  7. Human owns intent; agent owns execution. Gates are where intent is confirmed. Between gates, the agent works autonomously.

Multi-Agent Operation

Keel runs with one agent or many. When parallelizing:

  • All agents read this file first, plus the specific specs/<run>/ artifact for their task.
  • Split at the task layer (Phase 5). tasks.md is dependency-ordered; tasks with no unmet dependencies can run concurrently (independent "waves"). Two agents must not edit the same file in the same wave.
  • Roles are optional but useful for larger work: a designer agent owns Phases 1–4 (specs and diagrams), builder agents own Phase 6 tasks, a reviewer agent owns Phase 7 (Claude Code: the reviewer subagent in .claude/agents/). Each role still respects the gates.
  • Context travels in the artifacts, not in chat history. A builder agent must be able to complete a task from lld.md + tasks.md alone. If it can't, the design is underspecified — loop back to G4.

File Map

AGENTS.md            ← this file: operating context (CLAUDE.md, GEMINI.md → symlinks)
README.md            ← human-facing intro + how to detach into its own repo
principles.md        ← the constitution: principles + named anti-patterns
profiles/            ← rigor profiles (prototype / standard / production) + the axes
workflow/
  lifecycle.md       ← the full 8-phase gated playbook (read before each phase)
  fast-path.md       ← compressed overlay for time-boxed / rapid work
templates/           ← fill-in skeleton for every artifact a phase produces
.claude/commands/    ← Claude Code slash commands that drive each phase
.claude/agents/      ← Claude Code subagents (e.g. reviewer for Phase 7)
tools/               ← optional toolchain setup — diagrams via the Kroki MCP (tools/diagrams.md)
skills/              ← optional reusable capability modules (SKILL.md pattern)
specs/               ← per-run artifacts + STATUS.md (the captain's log), one folder per run
decisions/           ← ADRs accumulate here across runs

Agent-Agnostic Setup

AGENTS.md is the canonical instruction file (the cross-tool open standard read natively by Codex, Cursor, Copilot, Gemini, Aider, Windsurf, and more). CLAUDE.md and GEMINI.md are symlinks to it, so Claude Code and Gemini load the identical context. Claude Code additionally gets the /commands in .claude/commands/; every other agent drives the same flow straight from workflow/lifecycle.md. There is no tool-specific logic in the workflow itself — only in how each tool is invoked.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.