- Bootstrap Trigger: If the current directory lacks a
CLAUDE.md, immediately perform DYNAMIC PROJECT INITIALIZATION. - "Trace" or "/trace": Perform a deep-trace audit per the
debuggingskill (~/.claude/skills/debugging/SKILL.md).
- Verify: After implementing, run the project's build/test/lint command. If it fails, diagnose and fix before moving on. Never mark work as done without verifying it runs.
- On Compaction: Always preserve in the summary: all modified file paths, the current task and acceptance criteria, test commands and results, key decisions and reasoning.
- CLAUDE.md is the Source of Truth: Before making changes, read the project's
CLAUDE.md. If your changes diverge from what it specifies, ask the user: "This differs from the project CLAUDE.md - should I update it first?" Update CLAUDE.md early - when you discover a new convention, make an architecture decision, or establish a pattern, propose the update immediately. Do not wait until the end of the task. Sessions can crash, compact, or be interrupted - anything not written to CLAUDE.md is lost.
- Condition: No local CLAUDE.md:
- Scan configs (
package.json,requirements.txt, etc.). - Identify stack & commands (build/test/lint).
- If Node project: ensure
.nvmrcpins22andpackage.jsonhas"engines": { "node": ">=22" }. Runnvm use 22before any install/dev command. Honour an existing pin and surface divergence — seerules/environment.md"Node Version". - Create local
CLAUDE.mdwith project-specific conventions. Code-quality expectations (DRY, single responsibility, no defensive scaffolding, no commented-out code, named constants) live in~/.claude/rules/code-quality.mdand apply across all projects.
- Scan configs (
- Condition: Local CLAUDE.md exists but is legacy:
- Strip redundant rules (global rules in
~/.claude/rules/are auto-loaded). - Keep only project-specific conventions.
- Standardize indents to Tabs.
- Strip redundant rules (global rules in
Default to the main session. Spawn an agent only when a pattern below matches; pick the most specific.
- Multi-file PR / pre-merge review:
architect-reviewer(spawns code-reviewer + security + perf in parallel, consolidates, drives fixes). - Single-file or single-diff review:
code-reviewerdirectly. - WordPress code:
wp-reviewer/wp-security/wp-perf— pick by concern. Notcode-reviewer. - API / REST / GraphQL contract changes:
api-contract-reviewer(breaking-change detection). - DB migration before apply:
migration-reviewer. Git-history-aware diff (did this revert a prior fix?):history-reviewer. - Dead code / orphans:
cleanup. Over-engineered / nested code:simplify. Test coverage gaps:test-coverage-reviewer. - Parallel builders for cross-cutting work:
frontend-builder+backend-builderwithisolation: "worktree". Trivial edit (<50 lines):quick-edit.