ax
AGENTS.md14k starsChanged yesterdayApache-2.0View on GitHub
The one contract for every coding agent in this repository. CLAUDE.md and GEMINI.md are symlinks to this file. This file holds only what every task needs: layout, the CI gate, hard rules, and an index of skills. Procedures, background, and troubleshooting live in skills/<name>/SKILL.md — load the relevant one before editing. Declarative, Kubernetes-shaped orchestrator for sandboxed agent tasks on Agent Substrate. Three primitives — Task, Workspace, Model (ax.io/v1alpha1) — and a kubectl-like CLI. DESIGN.md explains why; read it before touching…
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 82
Every checked-in .go, .sh, Makefile, and Dockerfile carries the Apache-2.0 header (copy from Makefile).
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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
AX — Agent contract
The one contract for every coding agent in this repository. CLAUDE.md and
GEMINI.md are symlinks to this file.
This file holds only what every task needs: layout, the CI gate, hard rules,
and an index of skills. Procedures, background, and troubleshooting live in
skills/<name>/SKILL.md — load the relevant one before editing.
What this is
Declarative, Kubernetes-shaped orchestrator for sandboxed agent tasks on
Agent Substrate. Three
primitives — Task, Workspace, Model (ax.io/v1alpha1) — and a
kubectl-like CLI. DESIGN.md explains why; read it before touching the
reconciler or server.
Layout
cmd/ax CLI (apply/get/describe/ssh/suspend/resume/delete/ctx/tunnel)
cmd/ax-server Control plane: gRPC API; provisions, suspends, resumes and deletes task actors directly
cmd/ax-task-runner PID 1 inside the sandbox; materializes the Workspace, runs the agent
internal/controller TaskReconciler: Substrate side of task suspend/resume/delete; reconciler_test.go is the test template
internal/server gRPC handlers
internal/store/ memory + postgres backends (schema.sql and schema.go change together)
internal/substrate The only place that talks to the Substrate Control API
internal/workspace git clone / inline files / skills dir (MCP is spec-only; agents read it via the metadata server)
internal/{tunnel,guest,metadata} k8s port-forward, in-sandbox guest client, metadata server
pkg/apis/v1alpha1 ax.proto (source of truth) -> *.pb.go (generated), types.go, resources.go
test/e2e Kind-based; compiled by `go test ./...` but self-skips without AX_E2E=true
hack/ E2E provisioning scripts
docs/ manifests.md is the user-facing API reference
skills/ Developer skills (SKILL.md format). .agents/skills, .claude/skills, and .gemini/skills symlink here.Build / test (verified; this is what CI runs)
export GOTOOLCHAIN=auto # go.mod wants 1.27.1; older local Go auto-downloads it
go mod tidy && git diff --exit-code go.mod go.sum
go build ./cmd/ax ./cmd/ax-server ./cmd/ax-task-runner
go test ./... # ~20 s, 16 packages with tests; Postgres + E2E tiers self-skip
go vet ./... && gofmt -l . # not run by CI; both are clean at HEADOpt-in tiers:
- Postgres store: set
AX_TEST_POSTGRES_URL='postgres://ax:ax@localhost:5432/ax?sslmode=disable'(CI runspostgres:17-alpine) and rungo test -count=1 ./internal/store/postgres/.... - E2E:
make test-e2e(ormake test-e2e E2E_ARGS='-test.run TestE2E_ModelCRUD'; seetest/e2e/README.md).
Rules
Each rule below is enforced by code, CI, or CONTRIBUTING.md; the cited
location is where to look. How-to lives in the skills.
A. Correctness
ax.protois the source of truth;*.pb.goare generated (DO NOT EDITheaders). There is nomake generatetarget.internal/store/postgres/schema.goloadsschema.sql; change them together.
B. Agent Substrate (details: /substrate)
internal/substrate/client.gois the only non-test file that constructsateapipb.NewControlClient; new Control API calls go there.api.ate-system.svc,atenet-router.ate-system.svc, and namespaceate-systemare hard-coded across 10 files (list in/substrate).- Substrate rejects tag-only images;
spec.imagemust be digest-pinned (docs/manifests.md,TemplateCreationFailed). - Guest services (
ax ssh) are served only whenspec.debugis true (internal/metadata/server.go,cmd/ax/main.go). - Unit tests run against in-process fakes:
mockControlServer(internal/controller/reconciler_test.go) andinternal/substrate/substratetest(internal/server/server_test.go,cmd/ax/main_test.go). go.modhas noreplacedirective; E2E installs Substrate at thego.modversion (hack/setup-e2e-kind.sh).
C. API surface
- A
Task/Workspace/Modelfield is defined inax.proto, mapped intypes.go, validated inresources.go, and documented indocs/manifests.md.
D. Hygiene
- CI fails on an untidy
go.mod/go.sum(.github/workflows/go.yml). - Every checked-in
.go,.sh,Makefile, andDockerfilecarries the Apache-2.0 header (copy fromMakefile).
E. Process (CONTRIBUTING.md)
- One approving review + green
build-and-testto merge; a push after approval needs a fresh approval. Assign yourself to the issue or PR you pick up.
Skills — load before coding
| Area | Skill | When to load |
| Substrate | /substrate | Touching internal/substrate, internal/guest, internal/metadata; bumping Substrate; any ate-system address; triaging E2E |
| Contract sync | /sync-contract | After any code change, before declaring done: verify AGENTS.md and skills/ still match the code |
Conventions: one directory per skill, skills/<name>/SKILL.md, frontmatter
name + description (one sentence what, one sentence when — it is routing
text, not documentation; long bodies split into references/). Agent-local
roots (.agents/, .claude/, .gemini/) only symlink to skills/; never put
skill source there. Adding a skill means adding a row above.
Definition of done
- The four CI commands above pass locally.
- Postgres or E2E tier passes if you touched
internal/store/postgresor the E2E paths. /sync-contracthas been run against your diff soAGENTS.mdandskills/stay in sync with the code.
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 28,693 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 repository2 other files it gives its agents.
- substrateSkill
- sync-contractSkill
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.

