agentleFS
r3bl-orgr3bl-org/r3bl-open-core/build-infra/AGENTS.md

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

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

    When working on changes to this crate, follow this workflow:

    line 35
  2. Distinctive:

    After making changes, run these checks in order:

    line 63
  3. Distinctive:

    Test the installed binary with actual files

    line 71
  4. Distinctive:

    Follow the standard Rust module organization:

    line 75
  5. Distinctive:

    Write unit tests for individual functions

    line 83
  6. Very specific:

    Write integration tests in tests/ directory for end-to-end flows

    line 84
  7. Very specific:

    Use test fixtures in tests/test_data/ for complex test cases

    line 85
  8. Very specific:

    Add // rustdoc-fmt: skip to any .rs file to exclude it from cargo rustdoc-fmt processing.

    line 108
  9. Distinctive:

    Check which binary is being executed:

    line 117

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

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

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

Or from the workspace root:

cargo install --path build-infra --force

Why This Matters

  • The binaries in ~/.cargo/bin are separate files from your source code
  • Running cargo build or cargo build --release only compiles the code in target/
  • Without cargo install, the old binary in ~/.cargo/bin will 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:

  1. Make code changes
  2. Run tests to verify logic:

    cargo test --lib
    cargo test --all-targets
  3. Install the updated binary:

    cargo install --path . --force
  4. Test 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:

  1. cargo check - Fast typecheck
  2. cargo build - Compile in debug mode
  3. cargo test --lib - Run unit tests
  4. cargo test --all-targets - Run all tests (including integration tests)
  5. cargo clippy -- -D warnings - Lint with clippy
  6. cargo install --path . --force - Install updated binary
  7. Test the installed binary with actual files

Module Organization

Follow the standard Rust module organization:

  • Private implementation modules
  • Public re-exports in mod.rs for clean API
  • See root AGENTS.md for 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 tests

Skipping 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-fmt

Compare the timestamp with your last code change. If it's older, run:

cargo install --path . --force

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

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.