agentleFS
b0deab0dea/cockpit/AGENTS.md

cockpit

AGENTS.md4 starsChanged 7 days agoMITView on GitHub

For AI coding agents and humans changing cockpit itself. Contribution process (changesets, review) is in CONTRIBUTING.md. cockpit owns the environment for agent-driven work across several product repositories, and none of the product code. It brings the product up against live working copies, gives every agent tool the same instructions, skills, guards and permissions, and grades finished work with something other than the thing that did the work. It is not a planning tool and not a sandbox. No client or…

  • 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 31,774 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 repository4 other files it gives its agents.

The file

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

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

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Common:

    No client or employer names, private hostnames, real registries, credentials or internal URLs, in code, comments, fixtures, tests, commit …

    line 15
  2. Very specific:

    Only these root surfaces are tracked.

    line 40
  3. Distinctive:

    Run adjacent owner tests, review non-adjacent dependents, and typecheck before reporting a behaviour change.

    line 81
  4. Distinctive:

    Configuration that parses and does nothing is a defect: If a harness offers no mechanism for a restriction, emit nothing and record the gap.

    line 91
  5. Distinctive:

    Detectors over assertions: Prefer a check that can go red to a paragraph that claims.

    line 95
  6. Distinctive:

    Comments explain why: Keep comments that record the failure motivating a design.

    line 98
  7. Very specific:

    After changing command-table.ts, schema.ts, a shipped skill or guard, or a diagnostic code: run npm run references and commit the …

    line 105
  8. Very specific:

    Never write counts, tool versions, dates or line numbers in prose: link to the generated page, package.json or the schema.

    line 107
  9. Very specific:

    Add a changeset for package changes: npx changeset.

    line 108

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

AGENTS.md

For AI coding agents and humans changing cockpit itself. Contribution process (changesets, review) is in CONTRIBUTING.md.

What this is

cockpit owns the environment for agent-driven work across several product repositories, and none of the product code. It brings the product up against live working copies, gives every agent tool the same instructions, skills, guards and permissions, and grades finished work with something other than the thing that did the work. It is not a planning tool and not a sandbox.

Non-negotiable: nothing consumer-identifying in the tracked tree

No client or employer names, private hostnames, real registries, credentials or internal URLs, in code, comments, fixtures, tests, commit messages or docs. Fixtures are synthetic: when a real system teaches you something, encode the property in a synthetic fixture and write the lesson in a comment, never paste the artefact.

The hygiene scan (node scripts/hygiene-scan.ts, also run by npm test) has two classes. Credential shapes and private paths are universal, so CI enforces them. Consumer names are site-specific and absent from this tree, so CI cannot catch a site-name leak: that class is enforced only where a maintainer-held private site-identifier list is present. A green CI is not evidence on that class. If the scan fires, anonymise; never narrow the scan.

Publish product truth, not development ceremony: tracked files do not name private tooling, plan or task identifiers, sessions or local planning paths. Anything generated or machine-local is ignored in the same change that introduces it. Working material that needs real names lives in the ignored internal/; if your checkout has an internal/AGENTS.md, read it before research or design work. A public clone has none and needs none.

Two surface estates, never mixed

Working on cockpitCockpit working on a consumer's business
WhereAGENTS.md, CLAUDE.md, .agents/skills, .claude/skills (symlink to .agents/skills)packages/cockpit/surfaces/
Authoredby hand, nothing generates themtemplates rendered per cockpit from the registry

A skill about the cockpit.toml schema belongs on the left; one about driving a stack belongs on the right. Only these root surfaces are tracked; the harness settings directories are not published (enforced by tree-hygiene.test.ts).

Layout

PathWhat
packages/cockpitthe CLI: config, registry, codegen, drift, init
packages/cockpit/surfacesshipped templates rendered into a consumer's cockpit
.agents/skillsskills for working on cockpit itself
fixtures/registriessynthetic registries, the round-trip corpus
docsuser and contributor documentation

Environment code map

StepOwner
Declare and loadpackages/cockpit/src/schema.ts validates declarations; packages/cockpit/src/config/load.ts binds source bytes and path.
Observepackages/cockpit/src/environment/{setup-observation,git-observation,runtime,ports,lifecycle-stage}.ts produce bounded evidence; packages/cockpit/src/docs/ reads living documents and decision records for docs check.
Decidepackages/cockpit/src/environment/observations.ts evaluates health; lifecycle.ts, claims.ts and reclaim.ts in the same directory decide permitted work; packages/cockpit/src/guards/policy-change.ts decides whether a cockpit.toml edit widens what agents may do.
Sequencepackages/cockpit/src/environment/application/ orders setup, lifecycle, health, doctor, logs, guard and destructive operations, one module per command family. Thin command modules forward its outcomes.
Execute and postcheckpackages/cockpit/src/environment-exec/execute.ts owns process mechanics. Owner modules authenticate the resulting observations before application publishes state.
Bind and testpackages/cockpit/src/cli.ts supplies production dependencies and renders outcomes. Adjacent *.test.ts files exercise each owner; .dependency-cruiser.mjs holds the import-graph rules and packages/cockpit/src/architecture.test.ts runs them beside the confinement checks a graph cannot express.

Extend an owner at its existing seam. A new command goes in the command table and CLI binding; it does not get a second process runner or an independent health verdict.

Commands

npm ci --ignore-scripts
npm run test:changed -- <base-commit>  # tests that import or read what changed, both tiers
npm run test:fast                      # fast project only
npm test -- <test file>                # targeted run; bare `npm test` is both projects
npm run typecheck
npm run lint:docs                      # cockpit:ref targets, codes, glossary links, docs indexes
npm run lint:markdown                  # markdownlint
npm run lint:links                     # lychee, offline; needs lychee installed
npm run references                     # regenerate generated docs (see Keep docs current)

Run adjacent owner tests, review non-adjacent dependents, and typecheck before reporting a behaviour change. Locally, run targeted tests and let CI confirm the full suite, which includes the slow tier; run it locally only when a shared seam changes.

Conventions

  • TypeScript owns decisions and bounded process dispatch; shell owns shared scripts. Config, validation, registry, codegen, drift and state live in the CLI. Every child process crosses environment-exec/execute.ts. Compose scripts, guards and hooks stay shell: several agent tools invoke them directly and they must run identically under all of them.
  • Configuration that parses and does nothing is a defect. If a harness offers no mechanism for a restriction, emit nothing and record the gap.
  • Say where a value came from. Anything inferred carries a provenance and a stated reason, and is surfaced for confirmation.
  • Detectors over assertions. Prefer a check that can go red to a paragraph that claims; where a claim cannot be checked mechanically, say so.
  • Fail closed. A missing dependency, unparseable field or unreadable file exits with a reason.
  • Comments explain why. Keep comments that record the failure motivating a design; do not restate them elsewhere.
  • Every bug fix lands with a test that fails without it. One test pins one public behaviour; extend the closest existing case.

Keep docs current

  • After changing command-table.ts, schema.ts, a shipped skill or guard, or a diagnostic code: run npm run references and commit the regenerated pages with the change. CI fails while they differ.
  • A user-visible behaviour change updates the hand-written page that owns that fact in the same change; find the owner through the docs/README.md index (grep the old wording).
  • Never write counts, tool versions, dates or line numbers in prose: link to the generated page, package.json or the schema.
  • Add a changeset for package changes: npx changeset.

Harness capabilities

Support for each agent tool is a matrix of capabilities; a cell is enforced, instructed, generated (emitted, never checked) or unavailable (nothing emitted). Establish which by driving the tool, not by reading its docs or symbols. Follow .agents/skills/verify-harness-capability/SKILL.md, keep a deliberately broken control file beside the real one, never claim a capability the matrix has not measured, and date every measurement. The matrix is docs/capability-matrix.md.

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.