sakuralang / compiler
AGENTS.md4 starsChanged 24 days agoApache-2.0View on GitHub
The Sakura Lang compiler is a Cargo workspace. docs/design.md is the authority for syntax and semantics; §13 (compilation model) and §14 (crates, interfaces, milestones) are the implementation plan. Several agents build in parallel. Use your own target dir to avoid lock contention: CARGO_TARGET_DIR=target/<your-crate> cargo test -p <your-crate>. Each crate has one owner at a time. Edit only crates you own. If you need a change in another crate's public interface, append a dated entry to compiler/REQUESTS.md (who, what, why) and…
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 32,671 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 repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/sakura/assets/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/sakura/assets/CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- sakuraSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Distinctive: line 35
No phase reads the filesystem.
- Distinctive: line 36
Every diagnostic uses a stable code from design §12.3 with a primary span.
- Very specific: line 42
All agents share one git index, so always commit with explicit paths: git commit -m "…" -- <your paths> (this records only those paths even …
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 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
Compiler agents guide
The Sakura Lang compiler is a Cargo workspace. docs/design.md is the authority for syntax and semantics;
§13 (compilation model) and §14 (crates, interfaces, milestones) are the implementation plan.
Commands (run from compiler/)
cargo build
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --allSeveral agents build in parallel. Use your own target dir to avoid lock contention:
CARGO_TARGET_DIR=target/<your-crate> cargo test -p <your-crate>.
Ownership
Each crate has one owner at a time. Edit only crates you own. If you need a change in another
crate's public interface, append a dated entry to compiler/REQUESTS.md (who, what, why) and code
against your own temporary adapter until it lands. Never rewrite another owner's code.
- A pre-push hook (
.githooks/pre-push, enabled withgit config core.hooksPath .githooks) rejects pushes whosecompiler/Cargo.lockdoesn't match the committedCargo.tomlfiles. The working-tree lockfile may hold other agents' uncommitted dependencies: stage only your own hunks (git add -p compiler/Cargo.lock). - Shared files (
Cargo.toml,Cargo.lock): add workspace dependencies under[workspace.dependencies]with the latest stable version from crates.io, then reference them asdep.workspace = true. Keep edits minimal; re-read the file right before editing it.
Rules
- Dependency direction is strict (design §14.1).
sakura_typesnever depends on rowan or serde_json. - No phase reads the filesystem; inputs arrive as an in-memory snapshot.
- Every diagnostic uses a stable code from design §12.3 with a primary span. Never renumber codes.
- Malformed input must produce diagnostics, never a panic or a hang.
- Tests:
instasnapshots for trees, diagnostics, IR and emitted JS;.sakprograms incompiler/tests/ui(expected diagnostics) andcompiler/tests/semantics(expected stdout). Review every snapshot diff; never bulk-accept. - Commits: small Conventional Commits scoped by crate, e.g.
feat(syntax): parse match arms. All agents share one git index, so always commit with explicit paths:git commit -m "…" -- <your paths>(this records only those paths even if someone else has staged files), then checkgit show --stat HEADlists only your files. Before pushing, commit your work, then rungit fetch origin main,git rebase origin/mainand the gates as separate steps, and push only if each one exited 0 (a piped or chained failure has published untested commits before). Never usegit stash:refs/stashis shared by every worktree, so another agent'spopcan take your changes; save a patch or commit to a temporary branch.
CI coverage
Compiler-directory changes select the Rust partitions, MSRV, backend parity, native and editor jobs, plus website and documentation checks. A cancelled main run does not discard its outstanding changes; the next push compares against the last green CI commit. See the CI policy before interpreting a docs-only push that still selects compiler jobs.
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.

