bashkit
AGENTS.md325 starsChanged 55 days agoMITView on GitHub
Telegraph. Drop filler/grammar. Min tokens. Fix root cause. Unsure: read more code; if stuck, ask w/ short options. Unrecognized changes: assume other agent; keep going. If causes issues, stop + ask. knowledge/ is the canonical OKF bundle and persistent project memory. Read relevant knowledge before changing behavior, and update it in the same change when decisions, behavior, constraints, threats, tests, or operations change. New durable engineering knowledge belongs there; see knowledge/knowledge-contract.md for the maintenance contract and the OKF v0.2 rules…
- Reads credentials
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 31,774 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 repository6 other files it gives its agents.
- .deepsec/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- maintainSkill
- process-issuesSkill
- shipSkill
- bashkitSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
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 13
Always make sure you are working on top of latest main from remote.
- Distinctive: line 17
No backward compat needed (internal code)
- Distinctive: line 18
Write failing test before fixing bug
- Distinctive: line 74
Add "See also" cross-links when creating new guides
- Very specific: line 79
Run cargo doc --open to preview rustdoc changes
- Very specific: line 83
All design decisions in knowledge/ - no undocumented choices
- Distinctive: line 85
Don't stop until e2e works - verify before declaring done
- Very specific: line 87
No silent deferral - TODO or WTF comment with explanation
- Distinctive: line 88
Verify crate assumptions before planning to use them
- Very specific: line 183
Run via cargo bench --bench <name> or just bench-parallel / just bench-sqlite.
- Very specific: line 188
Run via just bench. Historical results go in crates/bashkit-bench/results/, named bench-<runner>-<moniker>-<timestamp>.{json,md}.
- Very specific: line 191
When adding a new criterion bench, save its first run under crates/bashkit/benches/results/ so future runs have a baseline to diff against.
- Very specific: line 193
Do not mix criterion .md files into crates/bashkit-bench/results/.
- Distinctive: line 222
Update knowledge if behavior or durable project facts change
- Distinctive: line 234
NEVER merge when CI is red: No exceptions.
- Distinctive: line 243
NEVER add links to Claude sessions in PR body or commits
- Very specific: line 247
All commits (incl. merge commits) attributed to the real human user, never a bot/agent identity, no AI Co-authored-by trailers, no …
- Distinctive: line 265
Prefer small, shippable PRs.
- Distinctive: line 266
When asked to create separate PRs, follow that instruction, do not bundle unrelated changes.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Coding-agent guidance
Style
Telegraph. Drop filler/grammar. Min tokens.
Critical Thinking
Fix root cause. Unsure: read more code; if stuck, ask w/ short options. Unrecognized changes: assume other agent; keep going. If causes issues, stop + ask.
Principles
- Always make sure you are working on top of latest main from remote. Especially in worktrees: fetch
origin/main, then rebase or recreate the worktree on top of it before editing. - Important decisions as comments on top of file
- Code testable, smoke testable, runnable locally
- Small, incremental PR-sized changes
- No backward compat needed (internal code)
- Write failing test before fixing bug
Knowledge
knowledge/ is the canonical OKF bundle and persistent project memory. Read relevant knowledge before changing behavior, and update it in the same change when decisions, behavior, constraints, threats, tests, or operations change. New durable engineering knowledge belongs there; see knowledge/knowledge-contract.md for the maintenance contract and the OKF v0.2 rules (just check-okf enforces them).
| Knowledge | Description |
| knowledge-contract | Knowledge maintenance rules + OKF v0.2 conformance rules |
| foundations/architecture | Core interpreter architecture, module structure |
| foundations/parser | Bash syntax parser design |
| foundations/vfs | Virtual filesystem abstraction |
| operations/testing | Testing strategy and patterns |
| foundations/builtins | Builtin command design (trait, ShellRef, ExecutionPlan) |
| security/security-testing | Fail-point injection for security testing |
| security/threat-model | Security threats and mitigations |
| foundations/parallel-execution | Threading model, Arc usage |
| foundations/snapshot-history | Snapshot object graph: commits, forks, chunked binary deltas, version + capability rules |
| operations/documentation | Rustdoc guides, embedded markdown |
| operations/release-process | Version tagging, crates.io + PyPI + npm publishing |
| operations/limitations | Negative spec: intentional gaps (L-* IDs), partial features, POSIX stance |
| integrations/tool-contract | Public LLM Tool trait contract |
| integrations/script-analysis | Static pre-execution script introspection for permission gating |
| integrations/git-support | Sandboxed git operations on VFS |
| runtimes/python-builtin | Embedded Python via Monty, security, resource limits |
| runtimes/cpython-wasm | Real CPython 3.14 on WASI (Wizer snapshot, Pulley AOT), WASI-on-VFS host, limits |
| operations/eval | LLM eval study on the mira framework, dataset format, scoring |
| operations/oils-spec | Upstream Oils spec suite pass rate vs real bash (just oils-spec) |
| operations/maintenance | Pre-release maintenance requirements |
| runtimes/node-package | Native JavaScript package, runtime callbacks, caller context and worker-thread safety |
| runtimes/python-package | Python package, PyPI wheels, platform matrix |
| integrations/scripted-tool-orchestration | Compose ToolDef+callback pairs into OrchestratorTool via bash scripts |
| integrations/ssh-support | Sandboxed SSH/SCP/SFTP operations |
| runtimes/zapcode-runtime | Embedded TypeScript via ZapCode, VFS bridging, resource limits |
| security/request-signing | Transparent Ed25519 request signing (bot-auth) per RFC 9421 |
| integrations/interactive-shell | Interactive REPL mode with rustyline line editing |
| integrations/in-process-terminal | In-memory PTY-like Terminal (feature terminal), screen text, vi builtin |
| runtimes/markkit-fetchkit-builtins | markkit/fetchkit builtins: same CLI via upstream run(args, host), VFS + allowlist |
| runtimes/sqlite-builtin | Embedded SQLite via Turso (MemoryIO + VfsIO backends, dot-commands) |
| runtimes/coreutils-args-port | Codegen port of uutils clap definitions + uucore modules |
| security/credential-injection | Per-host HTTP credential injection without exposing secrets |
| security/http-transport | Pluggable HTTP transport: route curl/wget via host egress boundary |
| operations/performance-results | Benchmark/eval result locations and /benches site aggregation contract |
| operations/dependencies | Dependency policy: trims in effect, and what is deliberately not reimplemented |
| runtimes/emscripten-wheels | Reduced-feature Pyodide/Emscripten Python wheel |
| runtimes/non-js-wasm | Wasm component with no JS engine and no WASI (Hyperlight micro-VM guest) |
| runtimes/browser-package | Slim single-threaded wasm package (@everruns/bashkit-wasm) for browsers + JS runtimes, no COOP/COEP |
| runtimes/c-api | Versioned native C ABI, ownership rules, packaging, and compatibility boundaries |
| runtimes/jaq-json-vendor | Vendored jaq-json (jq value type), its memory meter, and upstream sync |
Documentation
- Public docs live in
docs/, user-facing articles (security, guides, etc.) - Rustdoc guides live in
crates/bashkit/docs/as markdown files - Rustdoc guides embedded via
include_str!(seeknowledge/operations/documentation.md) - Edit
crates/bashkit/docs/*.md, not the doc modules inlib.rs - Add "See also" cross-links when creating new guides
- Cross-tree links must be source-relative (
../crates/bashkit/docs/jq.md, not a barejq.md), the site rewrites by basename and hides the breakage, GitHub does not. Titles/descriptions go insite/src/pages/docs/_meta.ts, never in markdown frontmatter. Enforced byjust check-doc-links - Run
cargo doc --opento preview rustdoc changes
Bashkit Principles
- All design decisions in
knowledge/- no undocumented choices - Everything runnable and testable - no theoretical code
- Don't stop until e2e works - verify before declaring done
- Examples tested in CI - must pass
- No silent deferral -
TODOorWTFcomment with explanation - Verify crate assumptions before planning to use them
Cloud Agent Setup
./scripts/init-cloud-env.sh # Install just + gh
just build # Build projectSecrets via Doppler
DOPPLER_TOKEN is pre-configured. Fetch secrets with:
curl -s "https://api.doppler.com/v3/configs/config/secret?name=SECRET_NAME" \
-u "$DOPPLER_TOKEN:" | python3 -c "import sys,json; print(json.load(sys.stdin)['value']['raw'])"Common secrets: GITHUB_TOKEN, ANTHROPIC_API_KEY
For gh CLI, set GH_TOKEN:
export GH_TOKEN=$(curl -s "https://api.doppler.com/v3/configs/config/secret?name=GITHUB_TOKEN" \
-u "$DOPPLER_TOKEN:" | python3 -c "import sys,json; print(json.load(sys.stdin)['value']['raw'])")Maintenance invocation
"Run maintenance" (including "maintainace" / "maintaiance") means analyze, fix, validate, and ship through green CI and squash-merge. Use the maintain and ship skills. Do not stop at a report, local commit, or deferral issues. Analysis-only requires an explicit request. Preserve security contracts and never merge red CI.
Local Dev
just --list # All commands
just build # Build
just test # Run tests
just check # fmt + clippy + test
just pre-pr # Pre-PR checksDo not run cargo test --all-features as a single invocation. Not
exercised in CI; statically links every embedded interpreter and enables
failpoints (global state, needs --test-threads=1); the parallel link
step exceeds sandbox/cloud-runner memory and the supervisor kills the
shell. Use just check / just pre-pr, or slice by feature the way CI
does (see .github/workflows/ci.yml):
cargo test --workspace --lib --bins --tests --features http_client,ssh,sqlite
cargo test --workspace --doc --features http_client,ssh,sqlite
cargo test --features realfs -p bashkit --test realfs_tests -p bashkit-cli
cargo test --features failpoints --test security_failpoint_tests -- --test-threads=1
cargo test --test proptest_security -- --test-threads=1
cargo test --features ssh -p bashkit --test ssh_builtin_testsPython is tested via pytest (.github/workflows/python.yml), TypeScript
via cargo run --example typescript_external_functions --features typescript.
Bashkit's integration tests live under crates/bashkit/tests/integration/
and are aggregated by crates/bashkit/tests/integration/main.rs into a single binary.
New behavioral tests go there. A small number of files stay as top-level
tests/*.rs because they need their own binary (process-global env
mutation, --test-threads=1, ssh-only feature isolation), the list and
criteria live in knowledge/operations/testing.md.
Rust
- Stable Rust, version pinned in
rust-toolchain.toml(bump deliberately; match the new version indtolnay/rust-toolchain@<version>refs across.github/workflows/*so CI can't be broken by a same-day rustc release) cargo fmtandcargo clippy -- -D warnings- License checks:
cargo deny check(seedeny.toml)
Stderr from builtins must not leak internal Debug shapes
TM-INF-022 in knowledge/security/threat-model.md. No {:?}/{:#?} in
crates/bashkit/src/builtins/; use Display or a domain formatter
(reference: format_compile_errors in builtins/jq/errors.rs); cap
diagnostics ≤ 1 KB; test-only Debug needs // debug-ok: <reason>.
Enforced by cargo test (static scan, per-tool assert_no_leak, fuzz
invariants), see bashkit::testing rustdoc for the layers.
New library-wrapping builtin: add a no_leak_* test (see jq/tests.rs);
fuzz targets must use bashkit::testing::fuzz_exec(...), not bare
bash.exec(...).
Benches
Two distinct harnesses, two distinct result locations, keep them separate.
- Criterion benches for the
bashkitcrate live incrates/bashkit/benches/. Run viacargo bench --bench <name>orjust bench-parallel/just bench-sqlite. Historical results go incrates/bashkit/benches/results/, namedcriterion-<bench>-<moniker>-<timestamp>.md. Thebench-parallel.shandbench-sqlite.shscripts write there. bashkit-benchharness (bashkit vs real bash) lives incrates/bashkit-bench/. Run viajust bench. Historical results go incrates/bashkit-bench/results/, namedbench-<runner>-<moniker>-<timestamp>.{json,md}.
When adding a new criterion bench, save its first run under
crates/bashkit/benches/results/ so future runs have a baseline to diff against.
Do not mix criterion .md files into crates/bashkit-bench/results/.
Python
- Python package in
crates/bashkit-python/ - Linter/formatter:
ruff(config inpyproject.toml) ruff check crates/bashkit-pythonandruff format --check crates/bashkit-python- Tests:
pytest crates/bashkit-python/tests/ -v(requiresmaturin developfirst) - CI:
.github/workflows/python.yml(lint, test on 3.9/3.12/3.13, build wheel)
Windows wheel signing checks: .github/workflows/windows-signing.yml runs
python -m unittest discover -s scripts/tests -p test_windows_signing.py -v
with pinned wheel tooling on Windows. Packaging tests also run on other hosts;
WinVerifyTrust tests require Windows. Production signing prerequisites and the
unsigned/signed artifact boundary live in knowledge/runtimes/python-package.md.
The manual windows-signing-smoke.yml workflow tests the actual Azure signer
through the same reusable job as publication, from a main-reachable test tag,
and emits a validation wheel without publishing. See the release knowledge.
Pre-PR Checklist
just pre-pr(runs 2-4 automatically)cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningsjust test(feature-sliced; nevercargo test --all-featuresin one invocation, see Local Dev)- Unit tests cover both positive (expected behavior) and negative (error handling, edge cases) scenarios
- Security tests if change touches user input, parsing, sandboxing, or permissions (see
knowledge/security/security-testing.md) - Compatibility/differential tests if change affects Bash behavior parity (compare against real Bash)
- Rebase on main:
git fetch origin main && git rebase origin/main(for worktrees: verify the worktreeHEADis on latestorigin/mainbefore editing) - Update knowledge if behavior or durable project facts change
- CI green before merge
- Resolve all PR comments
cargo bench --bench parallel_executionif touching Arc/async/Interpreter/builtins (seeknowledge/foundations/parallel-execution.md)just bench-sqliteif touching the sqlite builtin or its VFS/IO bridge (seeknowledge/runtimes/sqlite-builtin.md) 13a.cargo bench -p bashkit --bench snapshot_historyif touching snapshot/commit/checkout code (seeknowledge/foundations/snapshot-history.md); never regenerate existing files incrates/bashkit/tests/fixtures/snapshots/just benchif changes might impact performance (interpreter, builtins, tools)ruff check crates/bashkit-python && ruff format --check crates/bashkit-pythonif touching Python code
CI
- GitHub Actions. Check via
ghtool. - NEVER merge when CI is red. No exceptions.
Commits
Conventional Commits: type(scope): description
Types: feat, fix, docs, refactor, test, chore
- Updates to
knowledge/andAGENTS.md: usechoretype - NEVER add links to Claude sessions in PR body or commits
Commit Attribution
All commits (incl. merge commits) attributed to the real human user,
never a bot/agent identity, no AI Co-authored-by trailers, no
"generated by" text. Verify git config user.name/user.email are
human before committing; if missing or bot-like, set from
$GIT_USER_NAME/$GIT_USER_EMAIL. If those are also missing, stop and
ask, never commit with a default/bot identity. Pre-push script warns on
bot-like author names.
PRs
Squash and Merge. Use .github/pull_request_template.md for the description.
Center the description on functional change and impact, not a code-location walkthrough (the diff shows that). Add a Before / After with proof, CLI output, logs, differential-test results, or screenshots for UI, whenever behavior changes.
NEVER add links to Claude sessions in PR body or commits. Never attribute commit or merge commit to coding agents, always use real user.
- Prefer small, shippable PRs. Split large changes into independent, reviewable units.
- When asked to create separate PRs, follow that instruction, do not bundle unrelated changes.
See CONTRIBUTING.md for details.
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.

