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
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 33,398 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 repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ask-brokSkill
- brok-contextSkill
- code-reviewSkill
- commit-messageSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grill-with-docsSkill
- implementSkill
- prSkill
- retroSkill
- setup-brokspaceSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- write-shardSkill
- write-skillSkill
- grillingSkill
- grill-meSkill
- handoffSkill
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
- Very specific: line 39
No native toolchain? Use the dev container: docker build -t brok-dev .devcontainer then run cargo inside it with this repository and its …
- Very specific: line 41
Before calling work done, run fmt, clippy (-D warnings) and tests for both feature sets when you touched brok-index or feature-gated code.
- Very specific: line 48
No panics on user input. unwrap/expect only where an invariant guarantees it, and say why in the expect message.
- Very specific: line 55
Commit messages and PR titles follow Conventional Commits with the crate as scope: feat(index): ..., fix(bus): ....
- Distinctive: line 56
No em-dashes in prose (docs, skills, changelog, comments).
- Very specific: line 60
Every change reaches main through staging, the default branch:
- Very specific: line 67
Commit in small steps with Conventional Commits.
- Distinctive: line 68
Before pushing, run the fmt, clippy and test commands from "Build and test" above.
- Very specific: line 80
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 …
- Very specific: line 82
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.
- Very specific: line 88
keep skills/README.md and the bucket README.md (grouped into User-invoked and Model-invoked) in sync.
- Very specific: line 89
keep the ask-brok router skill accurate.
- Very specific: line 90
make sure brok skill list shows it (skills are embedded at build time).
≈ “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.
Files
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 --allNo 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,thiserrorfor typed errors) and never print. Onlybrok-clitalks to the terminal (crates/brok-cli/src/ui.rs). Error messages tell the user what to do next. - No panics on user input.
unwrap/expectonly where an invariant guarantees it, and say why in theexpectmessage. unsafeis denied workspace-wide. The exceptions (memory-mapping immutable Arrow files, returning freed memory withmalloc_trimon Linux, and the inheritance of standard handles on Windows) each carry aSAFETY: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- Branch from staging:
git fetch origin && git switch -c <type>/<topic> origin/staging(for examplefeat/kotlin-chunker,fix/empty-config). - Commit in small steps with Conventional Commits. End every commit message with a
Co-Authored-By:trailer naming the agent, for exampleCo-Authored-By: Claude <noreply@anthropic.com>: the PR gets theai-agentlabel from it. - Before pushing, run the fmt, clippy and test commands from "Build and test" above.
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 --squashThe PR merges itself once
ubuntu-latest (default),ubuntu-latest (lean),macos-latest (default),windows-latest (default),MSRV (1.89, lean)andpolicy / titlepass and review conversations are resolved. No approval is needed.- 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.mdand the bucketREADME.md(grouped into User-invoked and Model-invoked) in sync; - keep the
ask-brokrouter skill accurate; - make sure
brok skill listshows 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).
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.

