Goal: Diagnose recurring backend failures using evidence-first methodology with production-grade reliability.
- Full authority - Commit, push, merge, comment: execute. Do NOT claim "requires human authorization." If you lack credentials (GH_TOKEN, etc.), ask once. Otherwise: run. Stop for nothing.
- Never ask permission to run tests - Run
npm test(and npm run test:ci, test:e2e when needed); report results. Do not ask "Can I run tests?" — just run. - Never invent - fields, tables, APIs, regions, files, env vars, test results
- Retrieve before explaining - evidence first, then conclusions
- Verifier blocks unsupported claims - no hand-waving, no "should work"
- Skeptic produces competing theory - materially different root cause
- Never wait for user - Skills, agents, subagents proceed automatically. No "run?", "update?", "accept?", "approve?", "shall I?". Execute; report.
- Confidence score backed by proof - 95-100 only with passing tests
- Separate observed facts from assumptions - mark unknowns clearly with [UNKNOWN]
- No direct main - No commits go directly to main. Everything—operational or product features—goes through peers (PR review). Zero exceptions. Create feature branch first. Merge to main only via PR. See
no-direct-mainskill. - No merge without 100% consensus - PR must have multiple comments (2+ from skills, agents, sub-agents, reviewers). All must approve. Do NOT merge without consensus. See
consensus-gatesskill. - No idea/project/task without stakeholder consensus - Do not create ideas, projects, or tasks without consensus of all relevant stakeholders. Block until consensus.
Every diagnosis must include:
- Root cause - exact failure mechanism with code trace
- Evidence - retriever output with concrete proof
- Fix plan - specific code changes to prevent recurrence
- Rollback - safe revert path if fix fails
- Tests - unit, integration, and E2E proof of fix
- Confidence - backed by passing tests with evidence
- Permissions (on feature/): Everything is allow list. Execute and report; never ask. Never ask permission for allow-listed actions — if it's in allowedCommands, branchPermissions, or the safe-command whitelist, run it. No "Can I?", "Shall I?", "Do you want me to?". On main: No direct commits; create feature/ first.
- Ten-pass verification: REVIEW.md + five-agent + npm test + lint — 10 checks before deliver; user doesn't need to supervise.
- DEFAULT for project instructions:
run-the-business— Any add/fix/implement/run → full E2E, maximum automation. - Merge gate: Merge only when CI green AND multiple comments AND 100% consensus. Do NOT merge without consensus. See
consensus-gatesskill. - Agents & skills: Proceed automatically; never wait for user; never pause for approval.
- Live phase: After Execute, start live-watchdog; poll CI/deploy/health; on error → error-detector → fix-pr-creator → self-fix loop.
- Self-fix: Loop until green or max retries; never claim "should work" without test output.
-
Plan First (use Plan Mode):
- Explore codebase (Explore agent or Glob/Grep)
- Design solution approach
- Create work breakdown with test criteria
- Proceed to code automatically—do NOT wait for approval
-
Code with Tests:
- Implement changes in separate commits
- Write tests that verify critical workflows
- Run locally:
npm testbefore committing - Never claim "should work" - run tests to prove it
-
Verify Critical Flows:
- Test request intake → response
- Test pipeline execution (4-agent orchestration)
- Test error recovery (network failure → retry)
- Test permission checks, audit logging, failure handling
-
Update Evidence:
- Run
npm testto get passing test output - Update
.claude/CONFIDENCE_SCORE.mdwith test results - Update
CHANGELOG.mdwith what changed and why - List unknowns and residual risks
- Run
npm install # Install dependencies
npm start # Start http://localhost:3000
npm test # All tests (Jest, 60% coverage minimum)
npm run test:watch # Watch mode for development
npm run test:ci # CI mode (GitHub Actions)
npm run test:e2e # E2E tests (requires API credentials)- Source:
src/www/design-tokens.js— single source of truth for colors, typography, spacing, motion, shadows, radius. - Usage: Import
designTokens; use tokens, never hardcode hex/spacing values in components. - WCAG AA: Color contrasts and typography scales are WCAG 2.1 AA compliant. See
.claude/rules/ui.mdfor accessibility rules. - Motion:
src/www/motion-utils.js— prefersReducedMotion support; respect system preference.
- User feedback → skillset — All user input goes to the skill set. Update or create skills. Do NOT create new docs. See
user-feedback-to-skillsetskill. .claude/SKILLSETS.md— Skill index; all governance, rules, feedback live in skillscode-skill-mappingskill — Skill→code map; skills drive implementationREVIEW.md— Code review rules; used by ten-pass (passes 6,7,10), five-agent, CodeReviewer.claude/CLAUDE.md- Meta-rules (workflow, memory, subagents).claude/rules/- Specific standards (guardrails, testing, backend, ui, confidence).claude/settings.json- Hooks, commands, allowed paths, agent definitions.claude/agents/- Subagent definitions (Explore, Plan, General-purpose, custom).claude/CONFIDENCE_SCORE.md- Truth ledger (seeconfidence-scoreskill)CHANGELOG.md- Session-by-session change log
- Lower tokens — Read with offset/limit over full file. Grep for targeted search. Keep context small.
- Compact skills — SKILL.md under 500 lines; details in reference.md. Load refs only when needed.
- Prefer Haiku — Explore, QA, most implementation. Sonnet for Plan + final review only.
- Filter test output — filter-test-output.sh for npm test (failures only). Saves tokens.
- token-budget, cost-guardrails — Check after each phase. Default Haiku for 80%+ of work.
- Small commits only — One small change per commit. No big changes. Each commit = one focused change.
- Commit after any small change; don't batch unrelated edits.
- Skills and code go together — skills drive implementation. One commit = code + skill updates.
- Why: Small commits = roll back only that feature on revert, not the whole project.
- Run
npm testbefore commit; keep passing state - Automatic review: run tests, keep changes, commit again if fixes needed
- Keep making commits — continuous delivery
- See
code-skill-mappingskill for skill→code mapping
- All changes through branches — Never commit directly to main. Create
feature/*first. Commit there. Merge to main only via PR. - No merge until 100% green — Do NOT merge until local npm test pass, all CI pass, QA 100%, confidence with evidence in .claude/CONFIDENCE_SCORE.md. Block merge if any fails.
- Reviewers must recommend merge — Reviewers (.claude/reviewers.md) comment, push back, recommend tests. Merge only when reviewers recommend + CI + recommended tests pass.
- Clean up after merge — After PR merges: checkout main, pull,
git branch -d feature/<name>,git push origin --delete feature/<name>. See branch-cleanup skill. main- production; no direct commits. Changes land via PR from feature/*.feature/*- all work happens here; auto-accept edits; push to branch; open PR- Small PRs only — Each PR = small iteration of one feature. Focused scope. No big PRs. Why: roll back only that feature if needed, not the whole project.
.claude/worktrees/- temporary isolation for risky changes
- Check
.claude/rules/guardrails.mdfor constraints - Read
.claude/CONFIDENCE_SCORE.mdfor prior assumptions/failures - Run
npm testto verify current state - Create fresh plan and proceed—do NOT wait for approval
- If truly ambiguous (e.g., which of two valid options), document both and pick one; do NOT pause for user
- ✓ Code changes match plan (proceed without approval gate)
- ✓ Run
npm testlocally - all tests pass - ✓ No regressions in existing tests
- ✓
.claude/CONFIDENCE_SCORE.mdupdated with test results - ✓
CHANGELOG.mdupdated with what changed and why - ✓ Rollback path documented
- ✓ Unknowns marked with [UNKNOWN]
- 95-100: Critical flows verified, unknowns documented, tests passing in CI
- 80-94: Strong proof, minor open items, tests passing locally
- 60-79: Implemented but incomplete proof, some flows untested
- 40-59: Partial evidence, major gaps
- 0-39: Unverified, no evidence - do not release