Introduction
Necro finds anti-pattern code and proposes LLM-assisted fixes. This first release focuses on the hardest axis to get right: dead code in TypeScript.
The name is forensic. Findings are triaged into tiers; each one ships an
evidence chain — an autopsy declaring cause of death. Code that only tests
keep alive is on life support (test-only). Removing dead code (planned
--fix) is exhumation.
The problem with dead-code tools
Section titled “The problem with dead-code tools”Dead code means “unreachable from any entry point.” Pure-static tools must make a binary alive/dead call, and when they’re unsure they either flag good code (false positive, the trust-killer) or stay silent (false negative).
Necro’s edge is refusing to guess. It adds a third maybe tier and
quarantines ambiguous code — dynamic imports, reflection, public API — with
reasons, instead of falsely killing it.
What Necro does
Section titled “What Necro does”- Finds unreferenced TypeScript symbols using the compiler API (via ts-morph), not text matching — so it follows re-exports, type-only imports, and barrel files.
- Classifies every finding as
certain/likely/maybe, ships an evidence chain per finding, and surfaces thetest-onlyverdict. - Reads your real test-runner config and folds lcov coverage into the verdict.
- Analyzes beyond dead code: complexity detectors, CRAP × churn risk hotspots, and Type-2 duplication.
- Acts on findings:
fixsafely removescertain-dead code;triageandrefactorbring an opt-in LLM layer (refactors verified in a scratch worktree). - Exposes a read-only MCP server so AI agents can call necro’s verdicts and verify their own edits.
What it doesn’t do yet
Section titled “What it doesn’t do yet”SARIF output, --fail-on build gating, more framework plugins (Next.js,
NestJS), monorepo workspace edges, and Python support are on the
roadmap — not yet available.