agentleFS
icantcodefyiicantcodefyi/sakuralang/compiler/AGENTS.md

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.

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
  1. Distinctive:

    No phase reads the filesystem.

    line 35
  2. Distinctive:

    Every diagnostic uses a stable code from design §12.3 with a primary span.

    line 36
  3. Very specific:

    All agents share one git index, so always commit with explicit paths: git commit -m "…" -- <your paths> (this records only those paths even …

    line 42

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 --all

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>.

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 with git config core.hooksPath .githooks) rejects pushes whose compiler/Cargo.lock doesn't match the committed Cargo.toml files. 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 as dep.workspace = true. Keep edits minimal; re-read the file right before editing it.

Rules

  • Dependency direction is strict (design §14.1). sakura_types never 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: insta snapshots for trees, diagnostics, IR and emitted JS; .sak programs in compiler/tests/ui (expected diagnostics) and compiler/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 check git show --stat HEAD lists only your files. Before pushing, commit your work, then run git fetch origin main, git rebase origin/main and the gates as separate steps, and push only if each one exited 0 (a piped or chained failure has published untested commits before). Never use git stash: refs/stash is shared by every worktree, so another agent's pop can 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.

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.