agentleFS
addyosmaniaddyosmani/factory/template/CLAUDE.md

factory / template

CLAUDE.md171 starsChanged 3 months agoMITView on GitHub

This repository runs a software factory. Read docs/factory/CONTRACT.md, then docs/factory/CHARTER.md, before acting. The contract is shared with Codex through AGENTS.md; it is the source of truth for queue semantics and non-negotiable rules. For first-time setup and the local dry run, follow docs/factory/README.md. The live queue is GitHub issue labels plus factory-handoff:v1 comments. docs/factory/QUEUE.md is a snapshot for humans and audit, so an unmerged snapshot must never be used as the handoff between routines. 1. Never merge. GitHub branch protection is…

  • Installs packages

The file

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

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep this short and specific.

    line 17
  2. Distinctive:

    Stop and hand back to a human when any of these is true:

    line 50
  3. Very specific:

    Write one immutable record under docs/factory/runs/ using its documented format.

    line 64
  4. Very specific:

    Commit messages and PR bodies are written for someone who was not in this session and cannot ask you what you were thinking.

    line 69

≈ “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.

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

<PROJECT NAME>

<One paragraph: what this is and who depends on it.>

Commands

<install>        # e.g. pnpm install
<dev>            # e.g. pnpm dev
<test>           # e.g. pnpm test
./.claude/scripts/gates.sh full   # the factory's deterministic verdict

Conventions

<Language, framework, module layout, patterns to follow, patterns to avoid. Keep this short and specific. Vague style guidance produces vague code.>


Factory rules

This repository runs a software factory. Read docs/factory/CONTRACT.md, then docs/factory/CHARTER.md, before acting. The contract is shared with Codex through AGENTS.md; it is the source of truth for queue semantics and non-negotiable rules. For first-time setup and the local dry run, follow docs/factory/README.md.

Read first

The live queue is GitHub issue labels plus factory-handoff:v1 comments. docs/factory/QUEUE.md is a snapshot for humans and audit, so an unmerged snapshot must never be used as the handoff between routines.

Non-negotiable

  1. Never merge. GitHub branch protection is the enforcement boundary; the local hook is a second layer.
  2. Never edit factory policy unless the human explicitly asks in this session. Protected paths are listed in the contract.
  3. Never modify an existing test in an unattended run. An interactive change needs explicit human approval and a human read.
  4. Gates fail closed. Quote the FACTORY_GATES: line verbatim. RED, MISCONFIGURED, and required skips all block progress.
  5. Verification uses a fresh context. Delegate to factory-verifier.
  6. Claim one live issue per run. Win the deterministic remote-branch claim described in the contract, then replace factory:ready-to-implement with factory:in-progress.

Stopping conditions

Stop and hand back to a human when any of these is true:

  • gates went red twice on the same item
  • the work turns out to touch a LOAD_BEARING path
  • the diff would exceed the charter's line limit
  • the item is still ambiguous after one clarification attempt
  • the review queue is already at the charter's limit

The last one is the important one and the easiest to ignore. The constraint on this factory is not how many agents can run in parallel. It is how many decisions are pending a human's judgment at once. When that queue is full, producing more is not progress.

State lives in files, not conversations

Write one immutable record under docs/factory/runs/ using its documented format. Update GitHub labels for operational state. Sessions end and transcripts are not the queue.

Writing for the next reader

Commit messages and PR bodies are written for someone who was not in this session and cannot ask you what you were thinking. On a client-production repo, assume that reader is not the author and the time is six months from now.

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.