Skip to content
forbiddenlinkPublic

About

npm CLI that gives your codebase a voice: health, history and personality reports, plus an MCP server

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

234 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Specter

npm version Build Status

Give your codebase a voice.
A local code-intelligence CLI for understanding change impact and prioritizing refactors.
74 commands. 14 MCP tools. 19 personality modes. 1 graph built from your code and git history.


What makes Specter different

Specter combines source relationships with git history to make change risk and refactoring priorities actionable:

The Problem Specter's Answer
"Cyclomatic complexity: 45" Where the hotspots are + why they matter
"Tech debt exists" Prioritized hotspots based on complexity and change frequency
"Bus factor: 1" Who owns what + what breaks if they leave
Numbers without context Evidence an AI coding assistant can use to explain risk
# Install and get started in 30 seconds
npm install -g @purplegumdropz/specter
specter scan && specter next

# Or try without installing
npx @purplegumdropz/specter-roast

Watch 30-second demo →


Examples

Find the code that is slowing your team down

specter hotspots              # Complexity × Churn = Refactoring Priority
specter cost                  # Tech debt in dollars ($510k/year)
specter bus-factor            # Who leaves = what breaks?

Understand why code exists

specter why src/utils/api.ts  # Git history + patterns + context
specter ask "What are the main architectural patterns?"
specter ask "What would break if I changed this file?"

Get insights with personality

specter health --personality mentor   # Educational explanations
specter health --personality critic   # Brutal honesty
specter roast                         # Comedic codebase roast

Claude Code: change-risk briefs before every edit

Before Claude edits a file, Specter tells it what the file's git history knows and the code does not show. Example output:

Specter change-risk brief for components/pages/pricing/PricingPageClient.tsx:
- Usually changes together with: components/pages/home/HomePageClient.tsx (55% of its changes, 28 commits, no import link). Check whether they need the same change. In this repo such predictions held 26% of the time.

In this example, two files with no import between them changed together in 28 commits. Nothing in the code shows that link, and the brief states its own measured hit rate.

It stays silent for unremarkable files, and tells Claude about each file once per session. Research on context files for coding agents found that overview-style context raised cost without improving results, while specific, actionable instructions do get followed (Gloaguen et al., 2026, arXiv:2602.11988).

Note: specter brief, specter backtest and the plugin are on main but not yet published. npm latest is 1.1.1 (npm view @purplegumdropz/specter version) while package.json is at 1.3.0. Until the next release, build from source (see CONTRIBUTING.md) to use them.

npm install -g @purplegumdropz/specter
specter scan                                   # once per repo; later scans are incremental
claude plugin marketplace add forbiddenlink/specter
claude plugin install specter@specter

The plugin adds a PreToolUse hook on Edit|Write, which injects the brief, and a SessionStart hook, which refreshes the graph in the background. Both do nothing in repos without a .specter/ graph.

How accurate is it? Run specter backtest on your repo. It replays history and checks each co-change prediction against what actually changed in the same commit, using the evaluation design of Zimmermann et al., ROSE. Precision varies by repository, and single-file commits count as misses whenever a partner was predicted. Run it before you rely on the brief.

Every scan measures this for its own repo, and the brief drops co-change hints in repos where they prove unreliable. To see exactly what Claude would be told about a file, run specter brief <file>.

GitHub Copilot CLI Integration

Let AI assistants analyze your codebase directly:

# Add to Copilot CLI
copilot mcp add specter -- npx -y -p @purplegumdropz/specter specter-mcp

# Then use natural language
copilot -p "Use specter to find complexity hotspots"
copilot -p "Use specter to suggest refactoring for the most complex file"

14 MCP tools for file relationships, complexity hotspots, dead code detection, impact analysis, bus factor, code archaeology, and more.

6 prompt templates: specter:introduce, specter:review, specter:onboard, specter:refactor-plan, specter:standup-summary, specter:health-check

See .github/instructions/specter-copilot.instructions.md for the full Copilot CLI integration guide, and plugin/ for the plugin manifest and MCP tool implementations.


Command Reference

Health & Diagnostics

Command What it tells you
health Overall codebase health (0-100) with complexity distribution
scan Build the knowledge graph (run this first!)
doctor Environmental diagnostics
status Graph freshness and stats
vitals Real-time vital signs

Hotspots & Risk Analysis

Command What it reveals
hotspots Complexity × Churn heatmap
bus-factor Who owns critical code? Replacement risk?
coupling Hidden dependencies that change together
cycles Circular dependencies
drift Duplicate/diverged patterns
cost Tech debt in dollars
risk Risk analysis for staged changes
knowledge-map Team expertise heatmap

Metrics & Trends

Command Measures
velocity Complexity growth per week
trajectory Project health trends
trends Historical health with sparklines
dora DORA metrics
predict PR impact prediction

Intelligent Search & Q&A

Command Use case
ask <question> Natural language Q&A
search <query> Semantic code search
who <file> Find experts for any file
why <file> Explain why code exists
explain-hotspot Deep dive on hotspots
suggest-refactor AI refactoring suggestions

Team & Workflow

Command Purpose
morning Daily standup briefing
standup Generate standup notes
precommit Risk check before committing
compare Health between branches
review <pr> AI-powered PR review
reviewers Suggest PR reviewers
safe Safe zones for new contributors
danger High-risk danger zones
report Comprehensive markdown report

Fun & Shareable

Command Vibe
roast Comedic codebase roast
tinder Dating profile (green/red flags)
horoscope Daily code horoscope
wrapped Spotify Wrapped-style review
fortune Tarot-style three-card spread
dna Visual DNA fingerprint
anthem AI-generated theme song
fame Compare to famous projects
origin AI-generated origin story
confess <file> File confesses its sins
obituary <file> Memorial for deleted files
seance Summon deleted code spirits
meme Generate meme from metrics
blame-game Gamified blame awards

Utilities

Command Purpose
init Interactive project setup
init-hooks Install git hooks
dashboard Interactive web visualization
diagram Architecture diagrams (ASCII, Mermaid, D2)
changelog Generate changelog
breaking-changes Detect breaking changes
achievements Unlock 18 badges
streaks Daily usage streaks
leaderboard Team gamification
watch Real-time file monitoring
tour Guided walkthrough
fix [file] Actionable fix suggestions

Output Formats

All analysis commands support structured output:

specter health --json              # Machine-readable
specter hotspots --json            # Parse in scripts/CI
specter dora --json | jq '.score'  # Extract specific fields

19 Personality Modes

Add --personality <mode> to any command:

Mode Tone Best for
default Balanced, professional Daily use
mentor Educational, explains why Learning
critic Harsh, points out flaws Honest feedback
historian Focuses on evolution Understanding decisions
cheerleader Positive, encouraging Team morale
minimalist Brief, data-only Automation
noir Hard-boiled detective Fun presentations
therapist Gentle, understanding Sensitive topics
roast Brutal comedy Entertainment
dramatic Epic narrator Presentations
ghost Deleted code voice Historical analysis
executive Business-focused, ROI Leadership reports
zen Calm, minimalist wisdom Mindful reviews
pirate Swashbuckling nautical Fun presentations
motivational High energy encouragement Team morale
sage Ancient wisdom, philosophical Deep analysis
hacker Terminal/security aesthetic Security reviews
poet Lyrical, metaphorical Creative presentations
valley Silicon Valley startup bro Startup teams

CI/CD Integration

# Fail build if health drops
specter health --exit-code --threshold 70

# Fail on circular dependencies
specter cycles --exit-code

# Check PR impact
specter predict --branch feature/my-change

GitHub Actions

name: Specter Analysis
on: [pull_request]
jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: npx @purplegumdropz/specter scan --json
      - run: npx @purplegumdropz/specter health --json --exit-code --threshold 60
      - run: npx @purplegumdropz/specter predict --branch ${{ github.head_ref }}

Accessibility

Specter supports colorblind-friendly mode:

specter health --accessible
# or
SPECTER_ACCESSIBLE=true specter health

Data Storage

Specter creates a .specter/ directory (auto-added to .gitignore):

.specter/
  graph.json      # Knowledge graph
  metadata.json   # Quick-access metadata
  streaks.json    # Usage streaks and achievements
  history/        # Health snapshots over time

Requirements

  • Node.js 20+
  • Git repository (optional, for history features)
  • ~50MB disk for typical projects

Your source graph and git analysis stay on your machine. Specter only exports telemetry when you explicitly configure an OTLP endpoint; AI commands require the provider credentials you choose to set.


Documentation

Guide Topic
Copilot instructions GitHub Copilot CLI integration guide
Contributing How to contribute
Security Security policy

License

MIT


Built by Liz Stein
"I am the ghost in your git history."

About

npm CLI that gives your codebase a voice: health, history and personality reports, plus an MCP server

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages