r3bl-open-core / build-infra
AGENTS.md485 starsChanged 2 months agoApache-2.0View on GitHub
This crate provides CLI tools for the r3bl workspace. After making code changes, you must reinstall the binary for the changes to take effect. This crate provides command-line tools (binaries) that are installed to ~/.cargo/bin: Always run this command to install the updated binary: Or from the workspace root: When working on changes to this crate, follow this workflow: After making changes, run these checks in order: Follow the standard Rust module organization: Add // rustdoc-fmt: skip to any .rs…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository29 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- rust-analyzer-mcp-server/AGENTS.mdAGENTS.md
- task/AGENTS.mdAGENTS.md
- analyze-log-filesSkill
- analyze-performanceSkill
- audit-taskSkill
- batch-refactor-with-sub-agentsSkill
- check-bounds-safetySkill
- check-code-qualitySkill
- check-test-coverageSkill
- code-reviewSkill
- concurrency-safetySkill
- create-commit-messageSkill
- create-prSkill
- design-philosophySkill
- fast-string-allocationsSkill
- fix-issueSkill
- merge-prSkill
- organize-modulesSkill
- organize-testsSkill
- release-crateSkill
- remove-crate-prefixSkill
- review-prSkill
- run-clippySkill
- safe-renamingSkill
- test-cross-platformSkill
- write-documentationSkill
- write-structured-tracingSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
When working on changes to this crate, follow this workflow:
- Distinctive: line 63
After making changes, run these checks in order:
- Distinctive: line 71
Test the installed binary with actual files
- Distinctive: line 75
Follow the standard Rust module organization:
- Distinctive: line 83
Write unit tests for individual functions
- Very specific: line 84
Write integration tests in tests/ directory for end-to-end flows
- Very specific: line 85
Use test fixtures in tests/test_data/ for complex test cases
- Very specific: line 108
Add // rustdoc-fmt: skip to any .rs file to exclude it from cargo rustdoc-fmt processing.
- Distinctive: line 117
Check which binary is being executed:
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Claude Code Instructions for r3bl-build-infra
This crate provides CLI tools for the r3bl workspace. After making code changes, you must reinstall the binary for the changes to take effect.
Important: Binary Installation Workflow
This crate provides command-line tools (binaries) that are installed to ~/.cargo/bin:
cargo-rustdoc-fmt: Format markdown tables and links in rustdoc comments
After Making Code Changes
Always run this command to install the updated binary:
cargo install --path . --forceOr from the workspace root:
cargo install --path build-infra --forceWhy This Matters
- The binaries in
~/.cargo/binare separate files from your source code - Running
cargo buildorcargo build --releaseonly compiles the code intarget/ - Without
cargo install, the old binary in~/.cargo/binwill be executed - This can lead to confusing situations where your code changes don't appear to work
Testing Workflow
When working on changes to this crate, follow this workflow:
- Make code changes
Run tests to verify logic:
cargo test --lib cargo test --all-targetsInstall the updated binary:
cargo install --path . --forceTest the installed binary:
# Test cargo-rustdoc-fmt on an actual file cd .. && cargo rustdoc-fmt tui/src/some/file.rs
Development Guidelines
Code Quality Checklist
After making changes, run these checks in order:
cargo check- Fast typecheckcargo build- Compile in debug modecargo test --lib- Run unit testscargo test --all-targets- Run all tests (including integration tests)cargo clippy -- -D warnings- Lint with clippycargo install --path . --force- Install updated binary- Test the installed binary with actual files
Module Organization
Follow the standard Rust module organization:
- Private implementation modules
- Public re-exports in
mod.rsfor clean API - See root
AGENTS.mdfor general Rust guidelines
Testing Best Practices
- Write unit tests for individual functions
- Write integration tests in
tests/directory for end-to-end flows - Use test fixtures in
tests/test_data/for complex test cases - Include both positive and negative test cases
Project Structure
build-infra/
├── src/
│ ├── bin/ # Binary entry points
│ │ └── cargo-rustdoc-fmt.rs
│ ├── cargo_rustdoc_fmt/ # cargo-rustdoc-fmt implementation
│ │ ├── cli_arg.rs # CLI argument parsing
│ │ ├── processor.rs # File processing orchestration
│ │ ├── extractor.rs # Rustdoc block extraction
│ │ ├── link_converter.rs # Link conversion and aggregation
│ │ ├── table_formatter.rs # Markdown table formatting
│ │ └── validation_tests/ # Integration tests with fixtures
│ └── common/ # Shared utilities
└── tests/ # Integration testsSkipping Files
Add // rustdoc-fmt: skip to any .rs file to exclude it from cargo rustdoc-fmt
processing. Place it after the copyright line. All source files in cargo_rustdoc_fmt/
use this marker because their doc comments discuss the formatter's own concepts (e.g.,
CSI, ANSI) which would be incorrectly linkified.
Debugging Tips
Binary Not Using Latest Code?
Check which binary is being executed:
which cargo-rustdoc-fmt
ls -la ~/.cargo/bin/cargo-rustdoc-fmtCompare the timestamp with your last code change. If it's older, run:
cargo install --path . --forceTest Shows Different Behavior Than Binary?
This usually means you forgot to run cargo install. Tests use the compiled code directly
from target/, but the binary in ~/.cargo/bin is a separate file.
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.

