agentleFS
brokspacebrokspace/brok/AGENTS.md

brok

AGENTS.md12 starsChanged 27 days agoApache-2.0View on GitHub

Operating guide for coding agents and contributors working in brokspace/brok: the brok CLI, the event bus, the indexer, the shard runtime and the built-in skills. Brokspace is a local-first productivity platform for personal and corporate workspaces. Keep it simple and zero-config: domain-specific behaviour belongs in shards (standalone event-driven mini-agents) and integrations (coding agents through skills and MCP, local LLMs, git, storage), not in the core. Read SCOPE.md before proposing new core features. Shared vocabulary lives in GLOSSARY.md: use its terms…

  • Commits and pushes

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

13 rules. About 0 are common, 2 are distinctive, and 11 are 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.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    No native toolchain? Use the dev container: docker build -t brok-dev .devcontainer then run cargo inside it with this repository and its …

    line 39
  2. Very specific:

    Before calling work done, run fmt, clippy (-D warnings) and tests for both feature sets when you touched brok-index or feature-gated code.

    line 41
  3. Very specific:

    No panics on user input. unwrap/expect only where an invariant guarantees it, and say why in the expect message.

    line 48
  4. Very specific:

    Commit messages and PR titles follow Conventional Commits with the crate as scope: feat(index): ..., fix(bus): ....

    line 55
  5. Distinctive:

    No em-dashes in prose (docs, skills, changelog, comments).

    line 56
  6. Very specific:

    Every change reaches main through staging, the default branch:

    line 60
  7. Very specific:

    Commit in small steps with Conventional Commits.

    line 67
  8. Distinctive:

    Before pushing, run the fmt, clippy and test commands from "Build and test" above.

    line 68
  9. Very specific:

    Never push to staging or main (both reject it), force-push a branch someone else pushed to, open or merge PRs into main, or merge with …

    line 80
  10. Very specific:

    Do not commit a Cargo.lock change that only adds [[patch.unused]]: it comes from the local ../.cargo/config.toml patch, and CI rejects it.

    line 82
  11. Very specific:

    keep skills/README.md and the bucket README.md (grouped into User-invoked and Model-invoked) in sync.

    line 88
  12. Very specific:

    keep the ask-brok router skill accurate.

    line 89
  13. Very specific:

    make sure brok skill list shows it (skills are embedded at build time).

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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

AGENTS.md

Operating guide for coding agents and contributors working in brokspace/brok: the brok CLI, the event bus, the indexer, the shard runtime and the built-in skills.

Brokspace is a local-first productivity platform for personal and corporate workspaces. Keep it simple and zero-config: domain-specific behaviour belongs in shards (standalone event-driven mini-agents) and integrations (coding agents through skills and MCP, local LLMs, git, storage), not in the core. Read SCOPE.md before proposing new core features.

Layout

crates/
  brok-core/    workspace discovery, .brokspace/ layout, brok.yml, partitions, git helpers
  brok-bus/     local event bus: listener, sessions, router actor, token auth and topic ACLs
  brok-index/   chunking (tree-sitter), Arrow schema, BM25, stores, embeddings, hybrid search
  brok-shard/   shard registry, installer, sandbox environment, supervisor
  brok-cli/     the `brok` binary, one module per subcommand (src/cmd/)
  brok-bench/   developer tool (not published): reproducible resource benchmarks, see docs/benchmarks.md
skills/         built-in Agent Skills (SKILL.md), embedded in the binary
  engineering/  daily code work
  productivity/ daily non-code workflow
docs/           user and contributor docs; docs/adr/ holds decisions, docs/agents/ holds agent config
scripts/        bootstrap (polyrepo dev setup) and install scripts
.out-of-scope/  rejected ideas and why (read before proposing)

Shared vocabulary lives in GLOSSARY.md: use its terms in code, docs, issues and commit messages (for example "partition", never "shard of the index").

Build and test

Brokspace is a polyrepo. brok-sdk is consumed from crates.io; for local development the repositories sit side by side and a parent .cargo/config.toml patches brok-sdk to the sibling checkout:

./scripts/bootstrap.sh            # Windows: .\scripts\bootstrap.ps1 (clones siblings, writes ../.cargo/config.toml)
cargo test --no-default-features  # pure-Rust build: text chunking, Arrow store, BM25. Always works.
cargo test                        # default features: tree-sitter, LanceDB, ONNX Runtime (needs a C compiler + protoc)
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all

No native toolchain? Use the dev container: docker build -t brok-dev .devcontainer then run cargo inside it with this repository and its siblings mounted (see CONTRIBUTING.md). LanceDB needs about 6 GB of RAM to compile; use -j 4 on small machines.

Before calling work done, run fmt, clippy (-D warnings) and tests for both feature sets when you touched brok-index or feature-gated code.

Changing indexing, search, the daemon or anything that costs CPU, memory or disk? Measure it with brok-bench before and after, and put both numbers in the PR (see docs/benchmarks.md).

Conventions

  • Libraries return errors with context (anyhow::Context, thiserror for typed errors) and never print. Only brok-cli talks to the terminal (crates/brok-cli/src/ui.rs). Error messages tell the user what to do next.
  • No panics on user input. unwrap/expect only where an invariant guarantees it, and say why in the expect message.
  • unsafe is denied workspace-wide. The exceptions (memory-mapping immutable Arrow files, returning freed memory with malloc_trim on Linux, and the inheritance of standard handles on Windows) each carry a SAFETY: comment. Adding one needs the same.
  • Cross-platform is first class (Linux, macOS, Windows). Stored paths are workspace relative with / separators. Mind named pipes, file locks and antivirus locks on Windows (fsutil::move_dir).
  • Public items have doc comments. Module docs explain the why.
  • Tests exercise behaviour through public interfaces with real I/O in temp dirs (see crates/brok-index/tests/pipeline.rs, crates/brok-bus/tests/bus.rs). No mocks of our own internals.
  • New dependencies: prefer pure Rust; anything needing a C toolchain goes behind a cargo feature so the lean build keeps working.
  • Protocol and manifest types live in brok-sdk (a separate repository and a public contract). Additive changes only, unless an ADR covers the migration.
  • Commit messages and PR titles follow Conventional Commits with the crate as scope: feat(index): ..., fix(bus): ....
  • No em-dashes in prose (docs, skills, changelog, comments). Rewrite the sentence with a comma, colon or period instead.

Git workflow

Every change reaches main through staging, the default branch:

your branch --PR, squash--> staging --release PR, merge commit--> main --> tag
  1. Branch from staging: git fetch origin && git switch -c <type>/<topic> origin/staging (for example feat/kotlin-chunker, fix/empty-config).
  2. Commit in small steps with Conventional Commits. End every commit message with a Co-Authored-By: trailer naming the agent, for example Co-Authored-By: Claude <noreply@anthropic.com>: the PR gets the ai-agent label from it.
  3. Before pushing, run the fmt, clippy and test commands from "Build and test" above.
  4. Push, open the PR against staging with the template filled in, and turn on auto-merge:

    git push -u origin HEAD
    gh pr create --base staging --fill
    gh pr merge --auto --squash

    The PR merges itself once ubuntu-latest (default), ubuntu-latest (lean), macos-latest (default), windows-latest (default), MSRV (1.89, lean) and policy / title pass and review conversations are resolved. No approval is needed.

  5. A check failed? Read it (gh pr checks --watch, gh run view --log-failed), fix it on the same branch and push; auto-merge stays on. Cannot fix it? Say what you tried in a PR comment and stop. Never weaken or skip a check to get green.

Never push to staging or main (both reject it), force-push a branch someone else pushed to, open or merge PRs into main, or merge with --admin. The release PR into main is opened by the Promote workflow and merged by a maintainer.

Do not commit a Cargo.lock change that only adds [[patch.unused]]: it comes from the local ../.cargo/config.toml patch, and CI rejects it. Restore the file (git restore Cargo.lock) before committing.

Skills

Built-in skills under skills/ use the Agent Skills format (<name>/SKILL.md with name and description frontmatter, plus agents/openai.yaml). A skill is either user-invoked (disable-model-invocation: true, the human types /name) or model-invoked (the agent may reach for it on its own). Whenever you add, rename or remove a skill:

  • keep skills/README.md and the bucket README.md (grouped into User-invoked and Model-invoked) in sync;
  • keep the ask-brok router skill accurate;
  • make sure brok skill list shows it (skills are embedded at build time).

Install the skills into your own coding agent with brok skill export (see brok setup agents).

Agent skills configuration

  • Issue tracker: GitHub Issues on brokspace/brok, driven with gh. See docs/agents/issue-tracker.md.
  • Triage labels: canonical role names map to label strings in docs/agents/triage-labels.md. Judge every issue against SCOPE.md; rejected enhancements get a file in .out-of-scope/.
  • Domain docs: glossary in GLOSSARY.md, decisions in docs/adr/ (one file per decision, NNNN-kebab-title.md).

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.