Rename gerbil_ MCP tool references to jerboa_ in CLAUDE.md
ober
3b3290a337907e594685d1f1b6c53277215fb444
new file mode 100644 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,50 @@ +# jerboa-code — Project Instructions + +## MANDATORY: Editing .ss Files + +**ALWAYS use `jerboa_balanced_replace` (MCP tool) instead of `Edit` when modifying `.ss` Scheme source files.** + +It validates parenthesis balance before AND after the change, rejecting edits that break balance. This prevents the most common class of bug in this project. + +``` +# Workflow for every .ss edit: +1. jerboa_balanced_replace (dry_run: true) — preview +2. jerboa_balanced_replace (dry_run: false) — apply +3. jerboa_check_balance — confirm file is clean +``` + +If you need to add a new top-level `def`/`def`/`defstruct` form, prefer appending with `jerboa_balanced_replace` on a known anchor string rather than writing free-form code with `Edit`. + +After ALL edits to .ss files, run `jerboa_check_balance` on every modified file before attempting `make build`. + +## NEVER COMMIT THESE FILES + +**`jcode.json` contains live API keys. It is in `.gitignore`. NEVER stage or commit it.** + +Do not commit any file matching: `*.json` in the project root, `.env`, `*secret*`, `*key*`, `*token*` unless you have read its full contents and confirmed it has no credentials. + +When committing, always run `git diff --cached` and scan for key-shaped strings (`sk-`, `AIza`, `Bearer `) before confirming. + +## Build + +```bash +make build # compiles src/ → lib/ via jerbuild +make test # runs test/run.ss +make run # interactive agent REPL +``` + +Entry point: `main.ss`. Source lives under `src/jcode/`. + +## Architecture + +``` +src/jcode/ + core/ agent.ss config.ss log.ss message.ss session.ss + provider/ provider.ss + tool/ registry.ss file.ss bash.ss web.ss batch.ss + ui/ cli.ss +``` + +## Language + +This is Jerboa Scheme compiled by jerbuild. Files are `.ss`. Never write `.sls` — those are generated output in `lib/`. See `~/.claude/CLAUDE.md` for the full Jerboa language reference.