Guardrails

READ_BEFORE_WRITE

Always read files before editing. Understand existing patterns.

COMPILE_CHECK

After editing .clj files: clojure -M -e "(require 'namespace :reload)"

LINT_CHECK

Run clj-kondo --lint src test before commit.

SELECTIVE_TESTS

Tests are slow (~8 min). Don't run full suite after every task.

Low-risk changes (compile-check only):

High-risk changes (run selective tests):

clj -X:test :nses '[com.getorcha.foo-test]' 2>&1 | grep -E "(FAIL in|ERROR in|Execution error|failed because)"

PHASE_END_TESTS

Run full test suite only when completing the last task of a phase:

clj -X:test 2>&1 | grep -E "(FAIL in|ERROR in|Execution error|failed because)"

If phase tests fail, fix before proceeding to next phase.

SPECIFIC_STAGING

Never git add -A. Stage specific files by name.

ONE_TASK_ONLY

Complete one task, commit, output CONTINUE. Don't continue to next.

NO_SECRETS

Never commit .env, credentials, API keys.