fallow

Analyzes JS/TS codebases for dead code, duplication, complexity, and architecture violations.

Updated Nov 25, 2024
One-click install
npx skills add https://github.com/cbrostrom/dotfiles --skill fallow-cbrostrom
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fallow
Source: https://github.com/cbrostrom/dotfiles/tree/main/stow/agents/.agents/skills/fallow
Command: npx skills add https://github.com/cbrostrom/dotfiles --skill fallow-cbrostrom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fallow, and includes references (resource) components.

What problem does it solve? JavaScript and TypeScript projects accumulate unused files, exports, dependencies, and duplicated code over time, making PRs risky and refactors hard to prioritize. This Skill runs the fallow static analyzer and interprets its structured JSON output so you can audit code health, assess changed-code risk, and safely remove dead code. ## Core Features & Use Cases - Dead Code Detection: Find unused files, exports, types, dependencies, enum members, and circular dependencies across the whole project or only changed files. - Duplication & Complexity Analysis: Detect copy-paste clones with multiple detection modes, surface complexity hotspots, coverage gaps, and refactoring targets. - Safe Auto-Fix: Preview removals with fallow fix --dry-run, then apply with --yes, with built-in drift protection and low-confidence export safeguards. - Use Case: Before merging a PR, run fallow audit --base main to get a severity-aware quality gate covering dead code, duplication, and complexity limited to the changed files. ## Quick Start Ask the agent to run fallow dead-code analysis on this repository and summarize the unused files, exports, and dependencies it finds.

Frequently Asked Questions about fallow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused code in a TypeScript project?▼

Run fallow dead-code with --format json --quiet to detect unused files, exports, types, dependencies, and enum members. Use filter flags like --unused-exports to narrow results, or --trace to debug why a specific export is flagged.

How do I check a PR for new dead code before merging?▼

Run fallow dead-code --changed-since main --fail-on-issues to report only issues in files changed since the base ref. For a combined gate covering dead code, duplication, and complexity, use fallow audit --base main.

Does fallow work in monorepos with pnpm workspaces?▼

Yes, fallow auto-detects workspaces from package.json or pnpm-workspace.yaml and builds the full cross-workspace module graph. Use --workspace to scope reported issues to one package while imports between packages stay resolved.

Why does fallow fix fail with exit code 2 in CI?▼

The fix command requires --yes in non-TTY environments like CI pipelines and agent subprocesses. Always preview with --dry-run first, then apply with fallow fix --yes --format json --quiet.

How do I handle false positives from dynamic imports?▼

Fallow uses syntactic analysis without the TypeScript compiler, so fully dynamic imports are not resolved. Add an inline suppression comment like // fallow-ignore-next-line unused-export, or declare patterns in the dynamicallyLoaded config option.

Can fallow replace knip or jscpd?▼

Yes, fallow migrate auto-detects knip and jscpd configs and converts rules, ignore patterns, and duplication settings to a fallow config. Preview the conversion with fallow migrate --dry-run before writing.