Orient — Read CLAUDE.md for project conventions. Scan directory
structure for scope. Determine project type (monorepo, single app,
library, plugin).
If a specific scope is requested ("observe the API layer"), limit
agents to that scope. Otherwise, assess the full project.
Announce: [OBSERVE] Scanning {scope} across 5 dimensions
Spawn assessors — 5 parallel agents via Task tool.
Each agent receives: project scope + CLAUDE.md conventions +
dimension instructions. Each produces findings as:
{severity} — {file}:{line} — {finding} — {evidence}
digraph observe {
rankdir=LR
orient -> types
orient -> patterns
orient -> tests
orient -> deps
orient -> dead
types -> health
patterns -> health
tests -> health
deps -> health
dead -> health
}
Type Safety — "How sound is the type system?"
Task(prompt="[project scope + conventions]
Check: any usage, missing return types on exports, type
assertions (as), implicit any in function params, untyped
dependencies. Run tsc --noEmit if tsconfig exists. Count
type coverage: typed exports / total exports.
Report findings as BLOCKER/WARNING/SUGGESTION with evidence.",
subagent_type="general-purpose")
Pattern Compliance — "Does the code follow its own conventions?"
Task(prompt="[project scope + CLAUDE.md rules]
Check: naming conventions, file organization, import patterns,
error handling style (result types vs exceptions), component
patterns. Identify the DOMINANT pattern per category, then
flag deviations. Drift = minority pattern diverging from majority.
Report findings with evidence.",
subagent_type="general-purpose")
Test Coverage — "What's untested?"
Task(prompt="[project scope]
Check: run test coverage if available. Identify critical paths
without tests (auth, payments, data mutations). Flag test files
that exist but are empty or have only skipped tests. Count:
tested modules / total modules.
Report findings with evidence.",
subagent_type="general-purpose")
Dependency Health — "Are dependencies current and clean?"
Task(prompt="[project scope]
Check: outdated packages (run audit if available), unused
dependencies (imported but not used), duplicate dependencies,
known security advisories. Compare lock file age.
Report findings with evidence.",
subagent_type="general-purpose")
Dead Code — "What's unused?"
Task(prompt="[project scope]
Check: unused exports (exported but never imported), orphaned
files (no imports pointing to them), unreachable code branches,
commented-out code blocks, TODO/FIXME/HACK comments older than
the surrounding code.
Report findings with evidence.",
subagent_type="general-purpose")
Report — Emit health card:
[OBSERVE] Health: {score}/100 | {date} | Scope: {scope}
Type Safety: {OK/WARNING/BLOCKER} — {top finding or "Clean"}
Pattern Compliance: {OK/WARNING/BLOCKER} — {top finding or "Clean"}
Test Coverage: {OK/WARNING/BLOCKER} — {top finding or "Clean"}
Dependencies: {OK/WARNING/BLOCKER} — {top finding or "Clean"}
Dead Code: {OK/WARNING/BLOCKER} — {top finding or "Clean"}
satisfaction: {score} | confidence: {high/med/low} | basis: {measurement/observation/inspection}
Confidence: high if tools ran (type checker, test suite); med if file
analysis only; low if sampling.
Below the card: per dimension, list all findings grouped by severity.
BLOCKERs include remediation hints.
[EXTRACT] Key insight: [one reusable finding ≤15w]