12-dimension diagnostic. Adaptive surgical teams. Zero side effects.
Created by Anup Karanjkar ยท 12+ years building digital products
scalpel-16x9.mp4
|
The Problem AI agents write code without understanding your project. They guess your stack, your patterns, your conventions. Guessing at scale = bugs at scale. |
The Solution Scalpel gives any AI agent deep project intelligence before it writes a single line of code. Plug in. Diagnose. Operate. Unplug. |
# 30 seconds to surgical precision
cd your-project
git clone https://github.com/anupmaster/scalpel.git .scalpel && .scalpel/install.sh
# Then in any AI agent:
> Hi Scalpel, start workRun the standalone scanner. No subscription. No API keys. No tokens. Pure bash.
./scanner.sh # Pretty terminal output
./scanner.sh --json # Machine-readable JSON
./scanner.sh --ci # GitHub Actions annotations
./scanner.sh --markdown # Markdown report for PRs
./scanner.sh --score-only # Just the number: "83" โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SCALPEL โ Codebase Vitals โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Project : acme-dashboard โ
โ Stack : Next.js 14 ยท TypeScript ยท Tailwind ยท Prisma โ
โ Database : PostgreSQL via Supabase (23 tables) โ
โ Auth : Auth.js v5 โ
โ Deploy : Vercel (CI: GitHub Actions) โ
โ Tests : 0 files CRITICAL (None) โ
โ Tech Debt : 47 TODOs ยท 12 FIXMEs ยท 3 HACKs โ
โ Git Health : 1247 commits ยท 5 branches ยท 3 contributors โ
โ Bundle : 284MB node_modules ยท 12MB dist โ
โ Security : 2 issues found โ
โ โ
โ HEALTH SCORE: 64/100 โ Needs Improvement โ
โ [###############---------] โ
โ โ
โ Top 3 Priorities: โ
โ 1. Add test infrastructure (0% coverage) โ
โ 2. Fix 2 security vulnerabilities in dependencies โ
โ 3. Reduce bundle size (tree-shake unused imports) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This report alone is worth the install. Screenshot it. Share it. Put it in your README.
PHASE 0 โ PRE-FLIGHT
Reads previous session memory. Loads your config.
"Returning to acme-dashboard. Last session: health 48 โ 74."
PHASE 1 โ DIAGNOSE (2 min, fully autonomous)
Scans 12 dimensions: stack, architecture, git forensics,
database, auth, infra, tests, security, and more.
Outputs the Codebase Vitals report.
PHASE 2 โ CONSULT
Asks 5-7 surgical questions that only YOU can answer.
Memory-aware: skips what was already addressed.
PHASE 3 โ ASSEMBLE
Designs a custom surgical team for YOUR project.
Not a template. Adaptive specialists with file jurisdiction.
PHASE 4 โ OPERATE
Spawns parallel agents in isolated git worktrees.
Monitors quality. Scores each agent. Terminates drift.
PHASE 5 โ CLOSE
Delivery report. Session memory saved.
"Monitor for regressions? Debrief a surgeon? Done?"
Scalpel doesn't use templates. It reads your project and designs the right team:
Your Project Your Surgical Team
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DB + API + Frontend โ Data Layer ยท API ยท Frontend ยท Guardian
Frontend-heavy SaaS โ Components ยท State ยท Performance ยท Guardian
Drowning in tech debt โ Debt Liquidator ยท Tests ยท Deps ยท Guardian
Early-stage prototype โ Foundation ยท Test Infra ยท CI/CD ยท Guardian
Bug investigation โ 3 Hypothesis Investigators ยท Guardian
Each surgeon gets file jurisdiction (no merge conflicts), worktree isolation (parallel work), and a quality score starting at 100. Score drops below 50? Terminated and work redistributed.
| # | Dimension | What It Discovers |
|---|---|---|
| 1 | Project DNA | Framework, language, dependencies, versions, monorepo structure |
| 2 | Architecture | Entry points, routing, data flow, state management, styling |
| 3 | Git Forensics | Commit velocity, branching strategy, deleted files, abandoned work |
| 4 | Infrastructure | Docker, CI/CD, deployment target, reverse proxy, IaC |
| 5 | Database | ORM, schema, migrations history, seed data, table count |
| 6 | Testing | Runner, coverage, E2E scenarios, test health |
| 7 | Auth & Security | Provider, protected routes, RBAC, exposed secrets scan |
| 8 | Integrations | Payments, email, storage, analytics, monitoring |
| 9 | Agent Ecosystem | Existing CLAUDE.md, agents, commands, MCP servers, hooks |
| 10 | Code Quality | Linting, formatting, pre-commit hooks, strict mode, TODO count |
| 11 | Performance | Bundle size, image optimization, caching, rendering strategy |
| 12 | Documentation | README quality, API docs, JSDoc coverage, ADRs |
| Agent | Status | How to Install |
|---|---|---|
| Claude Code | โ | ./install.sh --claude โ .claude/agents/scalpel.md |
| Codex CLI | โ | ./install.sh --codex โ AGENTS.md |
| Gemini CLI | โ | ./install.sh --gemini โ GEMINI.md |
| Cursor | โ | ./install.sh --cursor โ .cursorrules |
| Windsurf | โ | ./install.sh --windsurf โ .windsurfrules |
| Aider | โ | ./install.sh --aider โ conventions file |
| OpenCode | โ | ./install.sh --opencode โ agent config |
./install.sh # Auto-detects your agent
./install.sh --all # Install for everythingOption 1: Clone and plug in
git clone https://github.com/anupmaster/scalpel.git ~/scalpel
cd your-project && ~/scalpel/install.shOption 2: Global install (available everywhere)
mkdir -p ~/.claude/agents
curl -fsSL https://raw.githubusercontent.com/anupmaster/scalpel/main/src/scalpel.md \
-o ~/.claude/agents/scalpel.mdOption 3: Just the scanner
curl -fsSL https://raw.githubusercontent.com/anupmaster/scalpel/main/src/scanner.sh \
-o scanner.sh && chmod +x scanner.sh
./scanner.sh /path/to/any/projectThen:
claude # or codex, gemini, cursor, windsurf, aider, opencode
> Hi Scalpel, start workBlock unhealthy code from merging. Automatically.
# .github/workflows/scalpel.yml
name: Scalpel Health Check
on: [pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: anupmaster/scalpel@v2
with:
fail-below: 60 # Block merge if health drops below 60
comment: true # Post Vitals as PR commentEvery PR gets a before/after health score comparison posted as a comment. Set your threshold. Enforce it.
Scalpel monitors every teammate in real-time:
| Violation | Points |
|---|---|
| Removed or downgraded existing functionality | -25 |
| Simplified output/UI below original quality | -25 |
| Introduced a regression (existing tests fail) | -20 |
| Broke the build | -15 |
| Modified file outside jurisdiction | -10 |
Used any type or skipped error handling |
-10 |
| Ignored established project patterns | -10 |
Left console.log in production code |
-5 |
Score < 70 โ Scalpel re-issues instructions with corrections.
Score < 50 โ Agent terminated. Work redistributed.
The harshest penalties are for quality downgrades, not build breaks. A broken build is obvious. A silent feature removal ships unnoticed and erodes trust.
Scalpel is designed like a forensic USB toolkit:
Plug in โ install.sh (auto-detects your agent)
Do work โ Diagnose, assemble team, operate
Plug out โ uninstall.sh --purge
Zero trace โ your git history never shows Scalpel was there
What Scalpel NEVER touches: your CLAUDE.md, your agents, your package.json, your git history.
What Scalpel leaves behind: improved code. That's it.
| Feature | Impact |
|---|---|
| Standalone Scanner | 12-dimension diagnostic from terminal. Zero AI, zero tokens. |
| 60% Fewer Tokens | Scanner + effort-level routing = massive cost reduction |
| Session Memory | .scalpel/memory.jsonl โ Scalpel learns across sessions |
| 7 Agent Adapters | Claude Code, Codex, Gemini, Cursor, Windsurf, Aider, OpenCode |
| Continuous Monitoring | /loop regression detection during long sessions |
| Post-Surgery Q&A | Ask any surgeon about their decisions after delivery |
| GitHub Action | Automated PR health checks with merge gating |
| Extensible Config | scalpel.config.json โ custom dimensions, roles, scoring |
| Anti-Regression System | Agents can never silently remove or downgrade features. Mandatory before/after verification. |
scalpel/
โโโ src/
โ โโโ scalpel.md # Agent brain โ orchestration prompt
โ โโโ scanner.sh # Standalone scanner (pure bash, zero deps)
โ โโโ adapters/ # 6 agent-specific adapters
โ โโโ codex.md
โ โโโ gemini.md
โ โโโ cursor.cursorrules
โ โโโ windsurf.md
โ โโโ aider.md
โ โโโ opencode.md
โโโ schemas/
โ โโโ config.schema.json # Config validation schema
โโโ tests/
โ โโโ scanner/ # 36-assertion test suite
โโโ docs/
โ โโโ SPECIFICATION.md # Technical specification
โ โโโ CONFIGURATION.md # Config customization guide
โ โโโ BLUEPRINT-V2.md # Development blueprint
โโโ examples/ # Real-world usage examples
โ โโโ nextjs-ecommerce.md
โ โโโ parallel-debugging.md
โ โโโ scan-only-health-check.md
โโโ .github/
โ โโโ workflows/
โ โโโ scalpel-scan.yml # Example CI workflow
โโโ action.yml # GitHub Action definition
โโโ scalpel.config.json # Default extensible config
โโโ install.sh # One-command plug-in (auto-detects agent)
โโโ uninstall.sh # Zero-trace removal
โโโ NOTICE # Authorship declaration
โโโ CHANGELOG.md # Version history
โโโ CONTRIBUTING.md # Contribution guide
โโโ LICENSE # MIT
โโโ README.md
Customize every aspect of Scalpel with scalpel.config.json:
{
"scan": {
"custom": [{ "name": "a11y-audit", "command": "npx axe-linter src/", "scoring": { "pass": 5 } }]
},
"team": {
"custom_roles": [{ "name": "i18n-specialist", "trigger": "i18n/ directory exists" }]
},
"scoring": {
"custom_rules": [{ "name": "no-console", "check": "grep -rn console src/components/", "deduction": -5 }]
}
}Full reference: docs/CONFIGURATION.md
Scalpel is open source and built for the community. Contributions welcome:
- New scan dimensions โ accessibility, i18n, GraphQL, mobile
- Stack-specific configs โ Next.js, Django, Rails, Rust, Flutter, Laravel
- Adapter improvements โ better Cursor, Windsurf, Aider support
- Scoring rules โ new quality violations to catch
- Community configs โ share your
scalpel.config.jsonin awesome-scalpel
See CONTRIBUTING.md for the full guide.
MIT โ Use it however you want.
"Understand everything before touching anything."
The biggest failure mode in AI-assisted development isn't bad code generation โ it's good code generation without context. An AI that writes perfect TypeScript but doesn't know you use Zustand instead of Redux, or deploys to Railway instead of Vercel, or follows conventional commits instead of squash merges, will create technically correct code that's architecturally wrong.
Scalpel makes project intelligence the first step, not an afterthought.
Sutures โ Breakpoints for AI Agents
The first open-source, framework-agnostic visual debugger with live intervention for multi-agent systems. Pause any agent, see what it sees, inject fixes, fork reality.
Scalpel cuts into your codebase. Sutures traces how everything connects.
If Scalpel saved you time, consider giving it a star.
It helps other developers find this tool.
Created by Anup Karanjkar ยท anupkaranjkar.com