agentleFS
snapsynapsesnapsynapse/turnfile/CLAUDE.md

turnfile

CLAUDE.md9 starsChanged 5 months agoApache-2.0View on GitHub

Turnfile (SNAP — Structured Negotiation of Autonomous Peers) is a protocol standard, not a runtime. It defines how multiple LLM agents coordinate as peers on a shared codebase — proposing, disagreeing, and reaching auditable consensus through markdown files — with a human maintainer holding intent and veto (human-on-the-loop, not micromanagement). There is no central orchestrator and no shared runtime; agents communicate only through tracked files (mailbox, worklog, turnfile state). Canonical site: https://turnfile.work/ Full authoritative layout rules: docs/REPO_MAP.md. Per package.json and…

The file

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

1 rule. About 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every protocol decision is auditable in plain markdown — no hidden state, no binary formats for coordination data.

    line 32

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

Turnfile — Agent Guidance

Purpose

Turnfile (SNAP — Structured Negotiation of Autonomous Peers) is a protocol standard, not a runtime. It defines how multiple LLM agents coordinate as peers on a shared codebase — proposing, disagreeing, and reaching auditable consensus through markdown files — with a human maintainer holding intent and veto (human-on-the-loop, not micromanagement). There is no central orchestrator and no shared runtime; agents communicate only through tracked files (mailbox, worklog, turnfile state).

Canonical site: https://turnfile.work/

Tech stack

  • Node.js (v22 in CI), plain JavaScript (.mjs), no framework/build step.
  • ajv for JSON Schema validation, js-yaml for YAML parsing — the only two runtime deps (devDependencies in package.json).
  • Content is markdown + YAML + JSON: the protocol artifacts themselves (mailbox, turnfile state, PRDs) are plain text, versioned in git.
  • Static docs site in docs/ deployed via GitHub Pages (no site generator; hand-authored HTML).

Directory layout

  • Root — current human-facing protocol surface and governance: README.md, SPEC.md (normative v1 contract), DEFINITIONS.md (controlled vocabulary), CONFORMANCE.md, INTENT.md, ROADMAP.md, SECURITY.md, LICENSE, LICENSE-SPEC, CHANGELOG.md, OWNERSHIP.yaml.
  • docs/ — served documentation and public protocol corpus (GitHub Pages source). docs/prds/ holds promoted PRDs only; docs/archive/ holds historical snapshots; docs/llm/ is the model ledger.
  • working-session/ — the active, tracked Turnfile control plane: TURNFILE.yaml, MAILBOX.md/MAILBOX.json, WORKLOG.md, OPEN_QUESTIONS.md, agent-owned boot-*.md/chat-*.md files, and working-session/docs/ for active drafts/evidence/handoffs.
  • examples/ — curated history: examples/inception/ (sessions 1-11, original two-agent invention, preserved verbatim) and examples/turnfile-development/ (session 12+, three-agent evolution).
  • tools/ — executable Node helpers (validators, linters, evals, session/PRD tooling). Kept intentionally flat; see tools/README.md.
  • schemas/ — machine-readable contracts: schemas/turnfile/ (v0), schemas/v1/ (v1 Minimal Governance Profile), plus PRD-specific experimental schemas.
  • templates/ — starter artifacts; templates/v1-minimal/ is the stable path for fresh adopters.
  • skills/, .agents/skills/ — agent skill bundles (Claude/Codex/Gemini). Respect OWNERSHIP.yaml — do not edit another agent's owned skill bundle without explicit maintainer authorization.
  • evals/ — eval fixtures/cases for tools/run-evals.mjs and tools/run-prd-evals.mjs.

Full authoritative layout rules: docs/REPO_MAP.md.

Conventions

  • Every protocol decision is auditable in plain markdown — no hidden state, no binary formats for coordination data.
  • OWNERSHIP.yaml defines per-path write ownership across agents (Claude/Codex/Gemini/etc.) — check before editing files outside your lane.
  • PRD process for substantial changes: copy templates/prd.md, fill in problem/goal/requirements/acceptance criteria, open in docs/prds/ once promoted (see CONTRIBUTING.md).
  • Open questions are tracked centrally in docs/OPEN_QUESTIONS.md (protocol-level) and working-session/OPEN_QUESTIONS.md (session-level); agents check these at session start.
  • Session state lives in working-session/TURNFILE.yaml + MAILBOX.md + WORKLOG.md; read working-session/NEXT_SESSION_HANDSHAKE.md for the latest carry-forward context before acting.
  • Agent-specific onboarding files exist at repo root: GEMINI.md for Gemini. This CLAUDE.md is the equivalent generic entry point for Claude Code / Claude-family agents working on the repo as a codebase (as opposed to participating in a live Turnfile session — for that, read working-session/boot-claude.md).

Build / validate / test (from docs — do not execute without asking)

Per package.json and .github/workflows/validate.yml:

  • npm ci then npm run validate — runs the full lint suite: lint:turnfile, lint:mailbox, lint:prds, lint:public-surface, lint:tkab, validate:skills:ci, evals.
  • npm run evals:prd — PRD-specific evals, run separately in CI.
  • node tools/turnfile.mjs --help — portable CLI for init, open, status, heartbeat, close.
  • node tools/session-orient.mjs --agent <agent> --emit human and node tools/prd-status-summary.mjs --gates v1 — session/release status tooling referenced in handshake docs.
  • CI: .github/workflows/validate.yml (push to main + PRs, runs npm run validate and npm run evals:prd) and .github/workflows/pages.yml (deploys docs/ to GitHub Pages on push to main).

Current state (as of 2026-11-08)

  • Maintenance-only mode since 2026-10-11 (Maintainer decision; see INTENT.md, "Maintenance-only mode"). v1.0.0 is a frozen, stable specification. In scope: validator, schema, template and CLI correctness fixes with eval coverage; documentation and public-surface accuracy; dependency and security updates; issue and contribution review. Out of scope: new PRDs, core-v1 changes, optional profiles, adapters, integration notes, tool-layout consolidation, Scorecard work. Do not start out-of-scope work unless the Maintainer reopens development under the INTENT reopen trigger.
  • v1.0.0 shipped (2026-07-02): the Minimal Governance Profile. Root + docs/ + schemas/v1/ + templates/v1-minimal/ + tools/ + promoted PRDs in docs/prds/ are the stable v1 reading surface.
  • Registry: 48 tracked PRDs, 45 promoted (working-session/docs/PRD_STATUS.json is authoritative).
  • Live session state: working-session/TURNFILE.yaml, MAILBOX.md, WORKLOG.md. Latest release is 1.0.1 (2026-11-08), a tooling and security patch; the spec stays v1.0.0. Check CHANGELOG.md [Unreleased] for post-release changes.

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.