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.
- 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
specs/ contains feature specifications. New code should comply with these or propose changes.
| Spec | Description |
|---|---|
| 001-architecture | Core interpreter architecture, module structure |
| 002-parser | Bash syntax parser design |
| 003-vfs | Virtual filesystem abstraction |
| 004-testing | Testing strategy and patterns |
| 005-builtins | Builtin command implementations |
| 005-security-testing | Fail-point injection for security testing |
| 006-threat-model | Security threats and mitigations |
| 007-parallel-execution | Threading model, Arc usage |
| 008-documentation | Rustdoc guides, embedded markdown |
| 008-posix-compliance | POSIX design rationale, security exclusions |
| 008-release-process | Version tagging, crates.io + PyPI publishing |
| 009-implementation-status | Feature status, test coverage, limitations |
| 009-tool-contract | Public LLM Tool trait contract |
| 010-git-support | Sandboxed git operations on VFS |
| 011-python-builtin | Embedded Python via Monty, security, resource limits |
| 012-eval | LLM evaluation harness, dataset format, scoring |
| 012-maintenance | Pre-release maintenance requirements |
| 013-python-package | Python package, PyPI wheels, platform matrix |
| 014-scripted-tool-orchestration | Compose ToolDef+callback pairs into OrchestratorTool via bash scripts |
- 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!(seespecs/008-documentation.md) - Edit
crates/bashkit/docs/*.md, not the doc modules inlib.rs - Add "See also" cross-links when creating new guides
- Run
cargo doc --opento preview rustdoc changes
- All design decisions in
specs/- 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
./scripts/init-cloud-env.sh # Install just + gh
just build # Build projectDOPPLER_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'])")just --list # All commands
just build # Build
just test # Run tests
just check # fmt + clippy + test
just pre-pr # Pre-PR checks- Stable Rust, toolchain in
rust-toolchain.toml cargo fmtandcargo clippy -- -D warnings- License checks:
cargo deny check(seedeny.toml)
- 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)
just pre-pr(runs 2-4 automatically)cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features- 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
specs/005-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 specs if behavior changes
- CI green before merge
- Resolve all PR comments
cargo bench --bench parallel_executionif touching Arc/async/Interpreter/builtins (seespecs/007-parallel-execution.md)just benchif changes might impact performance (interpreter, builtins, tools)ruff check crates/bashkit-python && ruff format --check crates/bashkit-pythonif touching Python code
- GitHub Actions. Check via
ghtool. - NEVER merge when CI is red. No exceptions.
Conventional Commits: type(scope): description
Types: feat, fix, docs, refactor, test, chore
- Updates to
specs/andAGENTS.md: usechoretype - NEVER add links to Claude sessions in PR body or commits
All commits MUST be attributed to the real human user, never to a coding agent or bot.
Before committing, verify git config user.name and git config user.email resolve to a real human identity.
If git config is missing, or resolves to a bot/agent identity, configure git user from environment variables:
git config user.name "$GIT_USER_NAME"
git config user.email "$GIT_USER_EMAIL"Environment variables GIT_USER_NAME and GIT_USER_EMAIL only need to be set when git config is missing or non-human. If both are missing in that case, stop and ask the user — do not commit with default/bot identity.
- Do NOT set
GIT_AUTHOR_NAME,GIT_COMMITTER_NAME, oruser.nameto any AI/bot identity (e.g. "Claude", "Cursor", "Copilot", "github-actions[bot]") - Do NOT use
Co-authored-bytrailers referencing AI tools - Do NOT add "generated by", "authored by AI", or similar attribution in commit messages
- The pre-push script checks for bot-like author names and will warn if detected
- Merge commits must also use the real user as author — never use agent identities
Squash and Merge. Use PR template if exists.
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.