An agentic linter for Reasonix, DeepSeek's Go terminal agent. It runs as a Reasonix hook and lints every pending edit the agent makes — blocking a bad change before it lands and feeding the reason back to the model so it self-corrects.
This is a port of bully (originally a Claude Code plugin). The evaluation engine is reused unchanged; only the thin layer bridging harness ↔ engine is Reasonix-native. Python, stdlib-only.
- Deterministic rules (
engine: script/ast) — run on every edit in aPreToolUsehook. Anerrorviolation blocks the edit (exit 2); the agent gets anAGENTIC LINT -- blockedmessage and fixes it. - Semantic rules (
engine: semantic) — judgement calls. The edit pauses once; the agent evaluates the diff via thebully-evaluatorsubagent, logs a verdict, and the clean re-issue is admitted (a session verdict cache breaks the loop). - Session rules (
engine: session) — invariants across a whole turn's changed-set (e.g. "touchingsrc/requires a CHANGELOG entry"), enforced at the next prompt.
pip install -e ".[dev]" # or: export PYTHONPATH="$PWD/src"
python3 -m bully doctor # verify wiring + skill discoveryIn another project, point its reasonix.toml [skills] paths at this repo's
skills/, wire the hooks in .reasonix/settings.json (see this repo's copy), and
add a .bully.yml. bully doctor walks you through any gaps.
- Create rules:
/bully-init(or hand-write.bully.yml— seedocs/rule-authoring.mdandexamples/rules/). - Trust the config:
python3 -m bully trust. - Work normally in Reasonix. Bully interrupts only when a rule fires; the playbook
for those interruptions is
REASONIX.mdand thebullyskill.
bash scripts/lint.sh # ruff + shellcheck + pytest + hook dogfoodManual end-to-end check against a real Reasonix + DeepSeek key:
docs/live-smoke.md.
src/bully/— engine (copied verbatim) + the Reasonix seam (harness/reasonix.py,cli/reasonix_hook.py,diff/pending.py,state/verdict_cache.py).skills/— six skills:bully,bully-init,bully-author,bully-review(inline) andbully-evaluator,bully-scheduler(runAs: subagent).docs/—rule-authoring.md,telemetry.md,live-smoke.md, and the port design underdocs/superpowers/.