Vibe Skill
Purpose: Is this code ready to ship?
Three steps:
- Complexity analysis — Find hotspots (radon, gocyclo)
- Bug hunt audit — Systematic sweep for concrete bugs
- Council validation — Multi-model judgment
Quick Start
$vibe # validates recent changes
$vibe recent # same as above
$vibe src/auth/ # validates specific path
$vibe --quick recent # fast inline check, no agent spawning
$vibe --deep recent # 3 judges instead of 2
$vibe --sweep recent # deep audit: per-file explorers + council
$vibe --mixed recent # cross-vendor (Claude + Codex)
$vibe --preset=security-audit src/auth/ # security-focused review
$vibe --explorers=2 recent # judges with explorer sub-agents
$vibe --debate recent # two-round adversarial review
Execution Steps
Project reviewer config: If .agents/reviewer-config.md exists, its full config (reviewers, plan_reviewers, skip_reviewers) is passed to council for judge selection. See $council Step 1b.
Crank Checkpoint Detection
Before scanning for changed files via git diff, check if a crank checkpoint exists:
if [ -f .agents/vibe-context/latest-crank-wave.json ]; then
echo "Crank checkpoint found — using files_changed from checkpoint"
FILES_CHANGED=$(jq -r '.files_changed[]' .agents/vibe-context/latest-crank-wave.json 2>/dev/null)
WAVE_COUNT=$(jq -r '.wave' .agents/vibe-context/latest-crank-wave.json 2>/dev/null)
echo "Wave $WAVE_COUNT checkpoint: $(echo "$FILES_CHANGED" | wc -l | tr -d ' ') files changed"
fi
When a crank checkpoint is available, use its files_changed list instead of re-detecting via git diff. This ensures vibe validates exactly the files that crank modified.
Step 1: Determine Target
If target provided: Use it directly.
If no target or "recent": Auto-detect from git:
# Check recent commits
git diff --name-only HEAD~3 2>/dev/null | head -20
If nothing found, ask user.
Pre-flight: If no files found: Return immediately with: "PASS (no changes to review) — no modified files detected." Do NOT spawn agents for empty file lists.
Step 1.5: Fast Path (--quick mode)
If --quick flag is set, skip Steps 2a through 2e as heavy pre-processing, plus 2.5 and 2f, and jump to Step 4 with inline council after Steps 2.3, 2.4, 2g, and Step 3. Domain checklists, compiled-prevention loading, test-pyramid inventory, and inline product context are cheap and high-value, so they still run in quick mode. Complexity analysis (Step 2) still runs — it's cheap and informative.
Why: Steps 2.5 and 2a–2f add 30–90 seconds of pre-processing that mainly feed multi-judge council packets. In --quick mode (single inline agent), those inputs are not worth the cost, but test-pyramid and product-context checks still shape the inline review meaningfully.
Step 2: Run Complexity Analysis
Filter by language present in the change set first. Run only the analyzers whose language actually appears in the diff. A docs/shell/BATS-only epic must NOT trigger gocyclo against the entire cli/ tree (it has hung in past runs); a Python-free epic must NOT trigger radon.
# Detect which languages are present in the diff (or in <path> for full audits).
# Use `git diff --name-only <base>...HEAD` for a PR; fall back to listing
# files under <path> when no diff base is available.
mkdir -p .agents/council
HAS_GO=false; HAS_PY=false
DIFF_FILES="$(git diff --name-only "${BASE:-HEAD~1}"...HEAD 2>/dev/null || find <path> -type f)"
echo "$DIFF_FILES" | grep -q '\.go$' && HAS_GO=true
echo "$DIFF_FILES" | grep -q '\.py$' && HAS_PY=true
echo "$(date -Iseconds) preflight: HAS_GO=$HAS_GO HAS_PY=$HAS_PY" >> .agents/council/preflight.log
For Python (only when HAS_PY=true):
if [ "$HAS_PY" = "true" ]; then
echo "$(date -Iseconds) preflight: checking radon" >> .agents/council/preflight.log
if ! which radon >> .agents/council/preflight.log 2>&1; then
echo "⚠️ COMPLEXITY SKIPPED: radon not installed (pip install radon)"
else
radon cc <path> -a -s 2>/dev/null | head -30
radon mi <path> -s 2>/dev/null | head -30
fi
else
echo "ℹ️ COMPLEXITY SKIPPED: no .py files in diff"
fi
For Go (only when HAS_GO=true):
if [ "$HAS_GO" = "true" ]; then
echo "$(date -Iseconds) preflight: checking gocyclo" >> .agents/council/preflight.log
if ! which gocyclo >> .agents/council/preflight.log 2>&1; then
echo "⚠️ COMPLEXITY SKIPPED: gocyclo not installed (go install github.com/fzipp/gocyclo/cmd/gocyclo@latest)"
else
gocyclo -over 10 <path> 2>/dev/null | head -30
fi
else
echo "ℹ️ COMPLEXITY SKIPPED: no .go files in diff"
fi
For other languages: Skip complexity with explicit note: "⚠️ COMPLEXITY SKIPPED: No analyzer for <language>"
Interpret results:
| Score | Rating | Action | |-------|--------|--------| | A (1-5) | Simple | Good | | B (6-10) | Moderate | OK | | C (11-20) | Complex | Flag for council | | D (21-30) | Very complex | Recommend refactor | | F (31+) | Untestable | Must refactor |
Include complexity findings in council context.
Step 2.3: Load Domain-Specific Checklists
Detect code patterns in the target files and load matching domain-specific checklists from standards/references/:
| Trigger | Checklist | Detection | |---------|-----------|-----------| | SQL/ORM code | sql-safety-checklist.md | Files contain SQL queries, ORM imports (database/sql, sqlalchemy, prisma, activerecord, gorm, knex), or migration files in changeset | | LLM/AI code | llm-trust-boundary-checklist.md | Files import anthropic, openai, google.generativeai, or match llm, prompt, completion patterns | | Concurrent code | race-condition-checklist.md | Files use goroutines, threading, asyncio, multiprocessing, sync.Mutex, concurrent.futures, or shared file I/O patterns | | Codex skills | codex-skill.md | Files under skills-codex/, or files matching *codex*SKILL.md, convert.sh, skills-codex-overrides/, or converter scripts |
For each matched checklist, load it by reading the file and include relevant items in the council packet as context.domain_checklists. Multiple checklists can be loaded simultaneously.
Skip silently if no patterns match. This step runs in both --quick and full modes (domain checklists are cheap to load and high-value).
Step 2.4: Compiled Prevention Check
Before reading .agents/rpi/next-work.jsonl, load compiled prevention context from .agents/pre-mortem-checks/.md and .agents/planning-rules/.md when they exist. This is the primary reusable-prevention surface for review.
Use the tracked contracts in docs/contracts/finding-compiler.md and docs/contracts/finding-registry.md:
- prefer compiled pre-mortem checks and planning rules first
- rank by severity,
applicable_whenoverlap, language overlap, changed-file overlap, and literal target-text overlap - keep the ranking order consistent with
$planand$pre-mortem; do not invent a separate review-only heuristic - cap at top 5 findings / compiled files
- if compiled outputs are missing, incomplete, or fewer than the matched finding set, fall back to
.agents/findings/registry.jsonl - fail open:
- missing compiled directory or registry -> skip silently
- empty compiled directory or registry -> skip silently
- malformed line -> warn and ignore that line
- unreadable file -> warn once and continue without findings
Include matched entries in the council packet as known_risks / checklist context with:
idpatterndetection_questionchecklist_item
Step 2.5: Prior Findings Check
Skip if --quick (see Step 1.5).
Read .agents/rpi/next-work.jsonl and find unconsumed items with