This file provides instructions and context for AI coding agents working on this project.
This project uses bd (beads) for issue tracking. Run bd prime to see full workflow context and commands.
bd ready # Find available work
bd show <id> # View issue details
bd update <id> --claim # Claim work
bd close <id> # Complete work- Use
bdfor ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists - Run
bd primefor detailed command reference and session close protocol - Use
bd rememberfor persistent knowledge — do NOT use MEMORY.md files
When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.
MANDATORY WORKFLOW:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- PUSH TO REMOTE - This is MANDATORY:
git pull --rebase bd dolt push git push git status # MUST show "up to date with origin" - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- Work is NOT complete until
git pushsucceeds - NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds
npm install # install deps
npm run build # tsc + scripts/build-agents.mjs (composes 25 tp-* agents)
npx vitest run # full unit suite (~1300 tests)
npx tsc --noEmit # type-check onlyThe build step regenerates agents/tp-*.md from templates/agents/.
Never hand-edit files in agents/ — edit the template + shared
fragments (_shared-preamble.md, _response-contract.md) and rebuild.
src/index.ts— CLI entry + every hook command (hook-read,hook-pre-task,hook-post-task,hook-bootstrap, …) andstartServer(projectRoot detection).src/server.ts— MCP dispatcher (createServer). Every tool case goes through theSessionCachefor cross-call dedup.src/hooks/— pure decide-functions per hook (pre-bash, pre-grep, pre-task, pre-edit, post-bash, post-task, session-start) + therunHookEntryPointsafe-runner.src/ast-index/— wrapper around the bundledast-indexbinary.src/core/— event-log, error-log, validation, agent-matcher.templates/agents/→scripts/build-agents.mjs→agents/.
- Planning docs live in
docs/superpowers/plans/; specs indocs/superpowers/specs/; design notes indocs/design/; ADRs indocs/adr/. There is no.docs/directory — ignore any older reference to one. - Hook decide-functions are pure (input → decision); the thin
index.tscase does stdin read + stdout write +process.exit(0). Telemetry writes are best-effort and must never throw out of a hook. - Undocumented Claude Code fields: confirm presence in the installed
CC bundle before shipping (see
docs/reference/cc-undocumented-fields.md). Never let an unverified field ride the same release as working hooks.