pi-rust
AGENTS.md32 starsChanged 44 days agoMITView on GitHub
All documents are listed in docs/INDEX.md.
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 35,117 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 repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/ci-release.mdcCursor rule
- .cursor/rules/parity.mdcCursor rule
- .cursor/rules/pi-js-node.mdcCursor rule
- .cursor/rules/pi-rust.mdcCursor rule
- ci-triageSkill
- node-compat-gapSkill
- parity-checkSkill
- port-upstream-commitSkill
- ship-releaseSkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Very specific: line 4
After code changes run cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, and the tests of the crates you changed.
- Very specific: line 7
Keep comments short and only where the code cannot say it.
- Very specific: line 9
Commit messages use Conventional Commits (feat(scope): ..., fix: ..., feat!: for breaking changes).
- Distinctive: line 10
Never commit unless asked.
- Very specific: line 15
When you port an upstream commit, write upstream <sha> with the 9-character SHA in the commit message, for example fix(ai): recover from …
- Distinctive: line 34
All documents are listed in docs/INDEX.md.
- Distinctive: line 38
Ask before adding a dependency, pushing to main, merging, or changing GitHub settings.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
Development Rules
- Rust-only port of the TypeScript pi harness. Keep JSON field names, session files, and config paths compatible with upstream pi.
- After code changes run
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings, and the tests of the crates you changed. Before a PR runcargo test --workspace --locked --no-fail-fast. Fix every warning. - Tests must not use real provider APIs or keys: use
pi_ai::providers::fauxor a local mock HTTP server. - Providers emit events only through
pi_ai::MessageBuilder, and every stream must end withDoneorError. - Keep comments short and only where the code cannot say it. No
unsafecode. - Regenerate
crates/pi-ai/models.jsonfrom upstream catalog data instead of editing many entries by hand. - Commit messages use Conventional Commits (
feat(scope): ...,fix: ...,feat!:for breaking changes); the release workflow derives versions and CHANGELOG.md from them. Never edit versions or CHANGELOG.md by hand; usecargo xtask. - Never commit unless asked.
Parity with upstream
- Upstream is
earendil-works/pion GitHub.docs/parity/upstream.jsonrecords the upstream commit this port has caught up to. - When you port an upstream commit, write
upstream <sha>with the 9-character SHA in the commit message, for examplefix(ai): recover from Copilot request-size overflow (upstream 73f8de80b). The parity report marks a commit as ported only on that exact text, so do not writeupstream <sha>for a commit you did not port. - Record accepted differences in
docs/parity/allowlist.jsonwith a reason, and open gaps indocs/parity/GAPS.md. User-facing differences also go in the README section "Differences from upstream pi". cargo xtask parity --upstream <checkout>writes the gap report. The Parity workflow runs it daily and updates the issue labeledparity-report.
Playbooks
| Task | Read |
| Find gaps, port upstream commits | docs/parity/README.md |
| Change edit diffs, patches, or word highlights | docs/parity/jsdiff.md |
| Close a Node API gap in the extension runtime | docs/agents/node-compat.md |
| Diagnose a CI failure or a flaky test | docs/agents/ci-triage.md |
| Ship a change | docs/agents/release.md |
| Run the scheduled gap review | docs/agents/daily-gap-check.md |
| Change the Cursor or Google Antigravity provider | docs/providers/subscription-providers.md |
Change a fancy-regex markdown rule in pi-tui | crates/pi-tui/docs/fancy-regex.md |
| Change Markdown code block detection or Mermaid streaming | crates/pi-tui/docs/marked-code-blocks.md |
Change RSA in node:crypto | crates/pi-js/docs/rsa.md |
All documents are listed in docs/INDEX.md.
Shared state
- Ask before adding a dependency, pushing to
main, merging, or changing GitHub settings. Opening a PR from a branch is fine when the task asks for one. - One change per PR. Name the upstream commits or
unsupported.rsentries it closes.
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.

