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.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- verify-harness-capabilitySkill
- adopt-cockpitSkill
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
- Common: line 15
No client or employer names, private hostnames, real registries, credentials or internal URLs, in code, comments, fixtures, tests, commit …
- Very specific: line 40
Only these root surfaces are tracked.
- Distinctive: line 81
Run adjacent owner tests, review non-adjacent dependents, and typecheck before reporting a behaviour change.
- Distinctive: line 91
Configuration that parses and does nothing is a defect: If a harness offers no mechanism for a restriction, emit nothing and record the gap.
- Distinctive: line 95
Detectors over assertions: Prefer a check that can go red to a paragraph that claims.
- Distinctive: line 98
Comments explain why: Keep comments that record the failure motivating a design.
- Very specific: line 105
After changing command-table.ts, schema.ts, a shipped skill or guard, or a diagnostic code: run npm run references and commit the …
- Very specific: line 107
Never write counts, tool versions, dates or line numbers in prose: link to the generated page, package.json or the schema.
- Very specific: line 108
Add a changeset for package changes: npx changeset.
≈ “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.
Files
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 cockpit | Cockpit working on a consumer's business | |
| Where | AGENTS.md, CLAUDE.md, .agents/skills, .claude/skills (symlink to .agents/skills) | packages/cockpit/surfaces/ |
| Authored | by hand, nothing generates them | templates 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
| Path | What |
packages/cockpit | the CLI: config, registry, codegen, drift, init |
packages/cockpit/surfaces | shipped templates rendered into a consumer's cockpit |
.agents/skills | skills for working on cockpit itself |
fixtures/registries | synthetic registries, the round-trip corpus |
docs | user and contributor documentation |
Environment code map
| Step | Owner |
| Declare and load | packages/cockpit/src/schema.ts validates declarations; packages/cockpit/src/config/load.ts binds source bytes and path. |
| Observe | packages/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. |
| Decide | packages/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. |
| Sequence | packages/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 postcheck | packages/cockpit/src/environment-exec/execute.ts owns process mechanics. Owner modules authenticate the resulting observations before application publishes state. |
| Bind and test | packages/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: runnpm run referencesand 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.mdindex (grep the old wording). - Never write counts, tool versions, dates or line numbers in prose: link to the generated page,
package.jsonor 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.
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.

