betterspec
CLI Reference

betterspec impact

Show what specs and capabilities reference a file or path

betterspec impact

Show what specs and capabilities reference a given file or directory path. Useful before refactoring — quickly see which changes and capabilities are connected to what you're about to touch.

Usage

betterspec impact <path> [options]

Arguments

ArgumentDescription
pathFile or directory path to search for references

Options

OptionDescription
-C, --cwd <path>Run as if betterspec was started in the given path

How it works

A fast, deterministic scan — no AI required:

  1. Searches all spec files for each active and archived change (proposal.md, specs/requirements.md, specs/scenarios.md, design.md, tasks.md)
  2. Searches all registered capabilities for file references
  3. Reports exactly which changes and spec files mention the path, and which capabilities list it

Example

$ betterspec impact src/auth/jwt.ts

╭─ Impact: src/auth/jwt.ts ──────────────────────────────────────────╮
 Changes (2)                                                         │
   add-jwt-auth (archived)                                           │
 proposal.md
 design.md
   add-refresh-tokens (in-progress)                                  │
 specs/requirements.md
 tasks.md

 Capabilities (1)                                                    │
   auth JWT token generation and validation
 src/auth/jwt.ts
╰─────────────────────────────────────────────────────────────────────╯

No references found:

$ betterspec impact src/utils/format.ts

╭─ Impact: src/utils/format.ts ──────────────────────────────────────╮
 No references found in specs or capabilities.
╰─────────────────────────────────────────────────────────────────────╯

Tip

betterspec impact tells you what knows about a file. Your AI tool can then use that context to reason about what might break and what docs to update.

On this page