docs: add AGENTS.md - #3576
Conversation
Maka already reads AGENTS.md — buildWorkspaceInstructionsPromptFragment injects the nearest one into the system prompt — but the repository has never had its own, so an agent working here starts with no context beyond the source tree. The file points rather than restates. Setup, the package map, contribution policy and architecture all have owners already, so duplicating them would create a second source of truth that goes stale unnoticed. What it keeps is the short list of things that are currently written down nowhere: that every workspace tests against compiled dist/ rather than src/, that Biome formats the tree except apps/desktop and packages/ui because desktop's source-contract tests regex-match exact source shapes, that some files are generated, and the working method the project's review habits already imply. Kept under the 6000-character limit that workspace-instructions.ts enforces on this very file, so Maka does not truncate its own instructions. The ASF header alone accounts for 13% of that budget. CLAUDE.md is a symlink to AGENTS.md, matching apache/airflow and the pattern the Claude Code documentation recommends: each agent CLI reads exactly one filename — Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Gemini CLI reads GEMINI.md — so one canonical file plus a link avoids two copies that drift. Generated-by: Claude Code Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds repository-level guidance for coding agents through AGENTS.md.
Changes:
- Documents testing, formatting, generated files, licensing, and workflow conventions.
- Links to existing setup, contribution, architecture, and tooling documentation.
- Includes notes to clarify the
CLAUDE.mdsymlink claim and@maka/evaltest command.
Suppressed comments (6)
AGENTS.md:33
buildWorkspaceInstructionsPromptFragmentdoes not search ancestor directories: it reads only the exact sessioncwd(plus~/.maka) and the three filenames there. Calling this the “nearest” file is misleading for a session started in a nested directory, where the repository-rootAGENTS.mdis not loaded; please document the actual scope.
Maka reads this file itself — `buildWorkspaceInstructionsPromptFragment` injects the nearest
`AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` into the system prompt — so it is live product input, not
only documentation. It is also truncated past 6000 characters, which is the hard reason to keep it
short.
AGENTS.md:82
- Generated artifacts are not limited to
*.generated.ts: the repository also generates the theme artifacts, the surface/test inventories, andapps/desktop/bundled-tools.json. As written, an agent can miss those and hand-edit build outputs; describe the suffix as one naming convention and include the other generated classes.
- **Some files are generated.** They match `*.generated.ts`; regenerate rather than hand-edit.
AGENTS.md:85
- “Every source file” contradicts the header policy: it deliberately excludes generated files, third-party source, fixtures, templates, and other non-Maka files; for example,
packages/core/src/model-metadata.generated.tsis undersrc/but is excluded. Following this advice could add headers to byte-sensitive or regenerated files, so qualify the rule and link the exclusion policy.
- **Every source file needs the ASF license header.** `npm run check:asf-headers` audits the whole
checkout, so stray untracked files can fail it. `node scripts/asf-license-headers.mjs write` adds
missing headers.
AGENTS.md:33
- This file explicitly says it is injected into the system prompt, so adding it changes model prompt behavior for sessions in this repository even though no runtime source changed. That conflicts with the checklist's “Does this PR entail a change in behavior? No”; mark it Yes or clarify that the checkbox excludes prompt inputs.
Maka reads this file itself — `buildWorkspaceInstructionsPromptFragment` injects the nearest
`AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` into the system prompt — so it is live product input, not
only documentation. It is also truncated past 6000 characters, which is the hard reason to keep it
short.
AGENTS.md:56
- The heading is broader than the documented test contract:
@maka/eval'stest:distalso runs severalpython3 harbor/test_*.pysuites directly from source. Scope this section to TypeScript/Node tests so contributors editing those Python tests are not given a false workflow.
## Tests run from `dist/`, not `src/`
AGENTS.md:52
- The opening paragraph says this file avoids restating documentation owned elsewhere, but this section repeats the Runtime Host and Runtime Event Log invariants already stated in
ARCHITECTURE.md:24andARCHITECTURE.md:45. Keeping a second copy can drift; replace it with a pointer to those sections or move the agent-specific warning into the architecture owner.
- **Runtime Host is the only execution authority.** Desktop, TUI, CLI, and eval all execute through
it. A change that seems to need its own runtime is a design discussion, not an implementation
detail.
- **The Runtime Event Log is the source of truth**, and sessions, UI, model context, and recovery
are projections over it. Context pruning and compaction change what the next inference sees; they
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The first draft leaned so hard on "link, do not restate" that it stopped being usable on its own: no install step, no build command, no way to run the tests, and not one sentence saying what Maka is. An agent could read it end to end and still not be able to start. Restores the sections the format is for — project overview, repository layout, setup, development workflow, testing, code style, build and release, CI gates, PR conventions — while keeping references for the prose that other documents own. Commands belong here: they are the executable part, and CI catches them when they drift. Also corrects three things review caught. Generated artifacts are not only *.generated.ts; the ASF header rule has a reviewed exclusion list rather than covering every file; and not every workspace defines a test script. Adds the loading scope of workspace instructions, which is exactly cwd and ~/.maka with no ancestor walk — a session started in a subdirectory does not pick this file up at all. Generated-by: Claude Code Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Astro-Han
left a comment
There was a problem hiding this comment.
Reviewed at exact head fa72ed03bbf1bce0f563a78186fbc03fbf5b5cff.
Coverage: every factual claim the document makes about this repository, checked against the working tree at this head. Not covered: wording and style, and GitHub UI behaviour (for example how a PR title actually renders in a squash commit).
Result: no P0–P3 findings. Everything checked was accurate.
Spot-check of what was verified
- Node
engines >= 22.19.0, andci.ymlon node 24. Grepshells out torgviapackages/runtime/src/workspace-executor.ts:457.- The layout table's 10 workspaces plus
scripts/match the rootworkspacesfield. - The build order in the doc,
core → storage → mcp → runtime → runtime-host → computer-use → eval → cli → ui → desktop, matches the rootbuildscript exactly, includingcomputer-usebeforeeval. - Every script named in the doc exists:
dev,dev:full,rebuild,test:dist,test:dist:serial,lint,format,format:check,typecheck,check:asf-headers,check:release,check:asf-npm,check:asf-source,astryx:theme,astryx:surface-inventory:write,windows:inventory,release:cli:pack,smoke, and therelease:asf:source|verify|signtrio. - "Tests run from
dist/" matches each package'stest= clean + build +node --test dist/…;@maka/evalcorrectly has onlytest:distand chains the Python harbor suites. - Biome's dual role, the absence of any ESLint/Prettier config, and the single-quote / always-semicolon / 2-space / 100-column settings. The formatter excludes
apps/desktopandpackages/uiwhile still linting them, with the reason commented atbiome.jsonc:50;licenses/**andbundled-tools.jsonare excluded as byte-sensitive. - ASF header counts measured at this head: 2745 covered / 130 excluded, against the doc's "about 2,750 / about 130".
- Squash is the only merge method enabled on the repository.
- The CONTRIBUTING.md policy the doc paraphrases — AI review does not count, and the Generated-by trailer requirement — matches the source.
- "Maka reads it":
buildWorkspaceInstructionsPromptFragmentinjects it into the system prompt, andreadWorkspaceInstructionsreads only files directly under the given root, so the stated scope (session cwd plus~/.maka, no ancestor traversal) is correct.CLAUDE.mdis a symlink toAGENTS.md.
Why this is a comment and not an approval
Hosted checks have not run on this head — check-runs total_count is 0. Not-run is not green, so the CI gate is not cleared regardless of the review outcome. Happy to convert this to an approval once checks go terminal green.
Summary
Maka already reads
AGENTS.md—buildWorkspaceInstructionsPromptFragmentinjects it into the system prompt — but the repository has never had its own. An agent working here starts with nothing but the source tree.It covers what the AGENTS.md format is for: project overview, repository layout, setup, development workflow, testing, code style, build and release, the CI gate list, PR conventions, and a working method. Commands are written out rather than deferred to
package.json, because they are the executable part and CI catches them when they drift; prose that other documents own — contribution policy, architecture — stays a link.Some of it is only recorded in code today: that every workspace tests against compiled
dist/rather thansrc/, that Biome formats the tree exceptapps/desktopandpackages/uibecause desktop's source-contract tests regex-match exact source shapes, and that workspace instructions load from exactlycwdand~/.makawith no ancestor walk.CLAUDE.mdis a symlink to it. Each agent CLI reads one filename — Claude Code readsCLAUDE.md, Codex readsAGENTS.md, Gemini CLI readsGEMINI.md— so one canonical file plus a link avoids two copies that drift.apache/airflowdoes the same.Verification
npm run check:asf-headers,npm run lint,npm run format:checkall pass. Every path the file links to was checked to exist.The file is 13,091 characters, which is in the normal range for this format —
apache/kafkais 9.7 KB,apache/iceberg13 KB,apache/airflow35 KB.Known interaction
With the symlink present, Maka injects the same content twice — once as
AGENTS.md, once asCLAUDE.md— becausereadWorkspaceInstructionsreads every candidate name and never compares them:That is a pre-existing gap rather than something this PR introduces, and it is filed separately. Other agents avoid it either by reading a single filename (Claude Code, Codex, Gemini CLI), by first-match-wins (opencode, Pi), or by content-digest deduplication (DeepSeek Harness, which ships the same symlink). If reviewers would rather not land the symlink before that fix, dropping
CLAUDE.mdfrom this PR is a one-file change and the rest stands on its own.AI use
Select exactly one:
Tool(s) and scope: Claude Code — surveyed the repo and comparable projects, drafted the file, and verified each claim against the file it names.
Checklist
Does this PR entail a change in behavior?
No runtime source changes, but this file is prompt input for Maka sessions run in this repository, so adding it changes model behaviour here. Flagging it rather than treating the checkbox as docs-only.
Question for maintainers: the workspace-instruction size cap
MAX_WORKSPACE_INSTRUCTION_FILE_CHARSis 6000 andMAX_WORKSPACE_INSTRUCTIONS_PROMPT_CHARSis 14000, so Maka truncates this file at roughly 46% of its length and appends[instructions truncated]. Everything from "Build, packaging and release" onward is cut.An earlier revision of this PR was compressed to fit. That turned out to be the wrong trade: it removed the install step, the build command, how to run tests, and any statement of what Maka is — which is most of what the format exists to provide. Optimising a file whose audience is every agent against one consumer's cap degraded it for all of them.
The cap also looks low against comparable projects. Of the ASF repositories that ship an
AGENTS.md,apache/kafka(9.7 KB),opendal(8.5 KB),seatunnel(7.3 KB),pekko(7.3 KB),doris(12 KB),iceberg(13 KB),flink(23 KB),spark(20 KB),superset(16 KB),camel(33 KB) andairflow(35 KB) all exceed 6000 characters; onlypaimon,datafusionandgravitinofit under it. For comparison, Claude Code loads aCLAUDE.mdup to 4 MiB. The mandatory ASF licence header alone consumes 793 characters, 13% of the current per-file budget.Three options, and I do not have a strong view on which is right:
Happy to open a separate issue if this is worth pursuing; it is out of scope for this PR either way.