codepremise kit
Make your coding agents write the map
The kit teaches your agents to maintain a .codepremise/ folder — business-logic claims mapped to code — while they work. One command, run from the root of your repo:
curl -fsSL https://codepremise.dev/install.sh | shThen commit the new files. From then on, open any PR of that repo here by swapping the domain: github.com/o/r/pull/1 → codepremise.dev/o/r/pull/1.
What lands in your repo
How each agent is kept honest
Claude Code
Discovers the skill via .claude/skills/ links; a PostToolUse hook re-checks every claim touching an edited file and feeds the warning straight back to the agent mid-run.
Codex
Reads the same skill from .agents/skills/; the hooks engine runs the check on PostToolUse and feeds it back to the model.
Cursor
Reads the same skill from .agents/skills/; the afterFileEdit hook records staleness in the audit log.
The backstop for all three: node .codepremise/validate.mjs fails when any claim lies about the code — run it in CI to make truthfulness a merge requirement.
Already have a codebase? Bootstrap the map
For existing repos, open your agent in the repo and say “bootstrap the codepremise map”. The bootstrap skill mines your past agent conversations (the reasoning behind old changes was recorded at generation time — it’s in the session transcripts) and git history for authentic whys, ranks the load-bearing code, and then interviews you — mostly quick confirmations, not open questions — to fill what mining couldn’t source. Claims nobody can explain are listed instead of invented: that list is your repo’s real risk register.
How the map works, in one paragraph
One JSON file per claim in .codepremise/nodes/: a plain-language what and why, pointing at code by file + line range + a hash of those exact lines. Behavior change → the agent amends the claim. Pure refactor → it re-affirms only the pointers, which reviewers see as an explicit “behavior-preserving” statement. Claims connect through typed links — parent rule, flow step, depends-on — and the viewer warns when unrelated rules share lines. Before editing, agents ask the map for the blast radius: node .codepremise/validate.mjs . --impact src/file.ts:12-24.