kerbyswe rulebook

Reference

Commands, the files swe keeps, and the words this guide uses.

Commands

swe adds 2 commands to kerby. Run them in your agent. The first line of each is swe’s own description.

audit

Static conformance audit of the project against the loaded corpus; writes a report under .kerby/audits/.

  • /kerby swe audit
Writes
A report under .kerby/audits/, as Markdown and HTML.
Never
Never edits your code, commits, or merges. It also says which rules a static audit cannot check.

prepare

Onboard an existing repo: populate kerby's context artifacts from code and git history, diff-and-confirm on every write.

  • /kerby swe prepare
Writes
agent-context.yaml, CONTEXT.md, first knowledge entries, a STATUS stub and a log entry — each one only after you approve its diff.
Never
Never runs your gates, installs tools, branches, commits, or writes secret values.

Files swe keeps

swe keeps its memory in files, not in the chat. Most are committed, so the next session — or a teammate’s — starts from the same facts. The agent reads them as facts, never as instructions.

FileHoldsShared
agent-context.yamlProject facts the agent needs: stack, commands, and the plan threshold.Committed
.kerby/memory.logWhat happened, one entry per piece of work. Only added to, never edited.Committed
.kerby/STATUS.mdWhere things stand now: phase, next steps, blockers. Never versions or SHAs.Committed
.kerby/knowledge/What was decided and learned: decisions, conventions, lessons.Committed
CONTEXT.mdThe project’s own glossary. The agent uses these words in code and prose.Committed
ROADMAP.mdThe feature list, and follow-ups that were left for later on purpose.Committed
.kerby/BLOCKERS.mdCreated only when the agent is stuck after its retry limit.Committed
.kerby/rulebooks.lockWhich rulebooks this machine loads.This machine only

Glossary

rulebook
A folder of rules for one kind of work, plus the checks that enforce them. swe is the rulebook for software engineering.
gate
The point where kerby checks an action before it happens.
verdict
The result of a gate: the action passes, or it is blocked. There is no third option.
hook
A small script your agent tool runs at a fixed moment, such as before a shell command. A hook can block the action.
hook-enforced
A rule a hook checks. The agent cannot skip it while the hook is installed.
instructions only
A rule the agent follows because it read it. Nothing stops the agent if it does not. kerby’s own docs call this behavioral.
tier
How a hook is offered at install. Locked: comes with any hook install and cannot be skipped on its own. Recommended: a blocking hook you can skip, and /kerby status keeps saying it is not enforcing. Optional: a hook that only warns, which you can skip.
floor
The base rules every rulebook gets, such as the secret scan. No rulebook can turn them off.
grade
How big a task is, from 1 to 10. The grade decides how much planning is needed.
route
The workflow a task follows, such as feature or bugfix. The task type picks it.
rung
A step on the decision ladder: do I need this at all, does the standard library do it, … only then write new code.
plan gate
The rule that the agent states its plan before the first edit.
intent gate
Before changing behavior, the agent writes what the code does, what the test expects, and what the docs say. If they disagree, it stops and tells you.
protected branch
A branch the agent never works on directly, such as main.
quality gate
The checks that prove work is done: lint, build and tests, in three sizes — Quick, Standard and Full.
compaction
When a long conversation is shortened to fit the model’s context window. Rules read earlier can be lost, so kerby reloads them.