A reverse engineering toolkit that lets you shift gears in your codebase.
Transform any application into a fully-specified, spec-driven project with complete control - whether you're shifting to a new tech stack or taking the wheel on existing code.
Two paths, complete control:
π Greenfield: Extract business logic from your legacy app, then rebuild in a modern stack using tech-agnostic specs.
βοΈ Brownfield: Transform your existing codebase into a spec-driven project and manage it with GitHub Spec Kit going forward.
Start in reverse (engineering), shift through 6 gears, and cruise into spec-driven development!
Free and open source. Support development to keep the gears turning! βπ
- Quick Start - Get started in 5 minutes!
- Installation Guide - Detailed installation for all platforms
- Plugin Guide - Claude Code plugin usage
- MCP Guide - MCP server for VSCode/Copilot
- Web Guide - Using in Claude Code Web (browser)
- Batch Processing - Process multiple projects efficiently
Reverse Engineering Meets Manual Control - StackShift provides a systematic, 6-gear process to:
- π First Gear: Analyze - Detect tech stack and assess completeness
- π Second Gear (Reverse!): Reverse Engineer - Extract comprehensive documentation
- π Third Gear: Create Specifications - Transform into GitHub Spec Kit format
- π Fourth Gear: Gap Analysis - Identify what's missing or incomplete
- β¨ Fifth Gear: Complete Specification - Resolve ambiguities and clarifications
- π Sixth Gear: Implement - Build features from specs!
Two Paths - Choose Your Route:
stateDiagram-v2
[*] --> Analyze
Analyze --> ReverseEngineer: Gear 2
ReverseEngineer --> CreateSpecs: Gear 3
CreateSpecs --> GapAnalysis: Gear 4
GapAnalysis --> CompleteSpec: Gear 5
CompleteSpec --> Implement: Gear 6
Analyze --> CruiseControl: auto mode
Implement --> [*]
CruiseControl --> [*]
Last generated: 2025-11-17T17:24:53.600Z
Use when: Rebuilding in a different tech stack or platform
Approach: Extract business logic ONLY (tech-agnostic)
- Focus on WHAT the system does, not HOW
- Framework-agnostic specifications
- Can implement in any technology
- Perfect for platform migrations
Example: "Extract business logic from Rails app to rebuild in Next.js"
Use when: Managing existing codebase with GitHub Spec Kit
Approach: Extract business logic + technical implementation (tech-prescriptive)
- Document both WHAT and HOW
- Capture exact tech stack, versions, file paths
- Enables
/speckit.analyzevalidation - Perfect for ongoing spec-driven development
Two Modes:
- Standard: Create specs for current state (as-is)
- Upgrade π: Create specs + upgrade all dependencies to latest versions
Example: "Add GitHub Spec Kit to existing Next.js app for spec-driven management" Example (Upgrade): "Spec this legacy app AND upgrade everything to modern versions"
Result: A fully-documented, specification-driven application ready for enterprise development.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Shift Through 6 Gears β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Gear 1: Initial Analysis + Route Selection β
β ββ Run AST analysis (parse codebase, save to cache) β
β ββ Detect technology stack β
β ββ Identify application type β
β ββ Map directory structure β
β ββ Choose your route: Greenfield or Brownfield? β
β β β
β βββββββββββββββββββ¬βββββββββββββββββββββ β
β β β β β
β Greenfield Brownfield β β
β (Tech-Agnostic) (Tech-Prescriptive) β β
β β β β β
β βΌ βΌ β β
β Gear 2: Reverse Engineer (Reverse Gear! π) β
β ββ Extract business logic ONLY βββ Greenfield β
β ββ OR business logic + tech details βββ Brownfield β
β ββ Enhanced with AST: auto-extract APIs & logic β
β ββ Generate 9 comprehensive docs β
β β β
β βΌ β
β Gear 3: Create Specifications β
β ββ Initialize .specify/ (GitHub Spec Kit) β
β ββ Agnostic constitution βββ Greenfield β
β ββ OR prescriptive constitution βββ Brownfield β
β ββ Auto-detect status from AST (β
/β οΈ/β) β
β ββ Generate feature specs with actual signatures β
β β β
β βΌ β
β Gear 4: Gap Analysis β
β ββ Read cached AST roadmap (instant) β
β ββ Identify missing features with confidence scores β
β ββ Brownfield: ~100% match initially β
β ββ Greenfield: All features marked MISSING β
β β β
β βΌ β
β Gear 5: Complete Specification β
β ββ Use /speckit.clarify β
β ββ Answer clarifications (evidence-based from AST) β
β ββ Define missing details β
β ββ Prioritize implementation β
β β β
β βΌ β
β Gear 6: Implement from Spec (Kick it into 6th! π) β
β ββ Use /speckit.tasks & /speckit.implement β
β ββ Greenfield: Build in new stack β
β ββ Brownfield: Fill gaps in existing β
β ββ Verify with AST (signatures, stubs, tests) β
β ββ Achieve 100% completion - cruise into production! β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Recommended for: Regular use, local development
Install as a Claude Code plugin for interactive skills and workflow tracking:
# In Claude Code
> /plugin marketplace add jschulte/claude-plugins
> /plugin install stackshiftRestart Claude Code. Skills will now be available:
analyze- Initial Analysisreverse-engineer- Reverse Engineercreate-specs- Create Specificationsgap-analysis- Gap Analysiscomplete-spec- Complete Specificationimplement- Implement from Spec
Usage:
Skills auto-activate based on context, or invoke explicitly:
# Auto-activation
User: "I need to reverse engineer this codebase"
Claude: [analyze skill activates automatically]
# Explicit invocation
Just ask naturally: "Run initial analysis" or "Analyze this codebase"
- Claude Code with plugin support
- Git repository with existing codebase
- Node.js 18+ (for state management scripts)
- ~2-4 hours total time for complete process
With Plugin (Recommended):
# Navigate to your project
cd /path/to/your/project
# Start Claude Code
# Skills will guide you through the process automaticallySimply say: "I want to reverse engineer this application" and Claude will guide you through all 6 steps.
Initial Configuration:
StackShift will ask a few questions upfront:
- Route: Greenfield or Brownfield?
- Transmission: Manual or Cruise Control?
- (If Cruise Control) Clarifications strategy & implementation scope
- (If Greenfield) Target tech stack
All answers saved to .stackshift-state.json - configure once, use throughout!
Progress Tracking:
# Check which gear you're in
node ~/.claude/plugins/stackshift/plugin/scripts/state-manager.js progressWithout Plugin (Manual):
If not using the plugin, use the web bootstrap for manual execution:
# 1. Clone StackShift
git clone https://github.com/jschulte/stackshift.git
# 2. Use web bootstrap prompt
cat web/WEB_BOOTSTRAP.md
# Copy and paste into Claude.ai or Claude Code Web
# Or use the legacy prompts (for reference):
cat legacy/original-prompts/01-initial-analysis.mdRecommended: Use the web bootstrap or plugin for the best experience.
Recommended for: Quick analysis, trying before installing, working on any device
# In Claude Code Web (https://claude.ai/code)
1. Connect to your GitHub account
2. Select your repo from the dropdown
3. Copy-paste web/WEB_BOOTSTRAP.md
4. Hit enter and shift through the gears! πSee web/README.md for complete instructions.
Benefits:
- βοΈ Works in browser (any device)
- π No installation required
- π Full cruise control support
- πΎ Download specs when complete
Recommended for: VSCode users, GitHub Copilot users
# Configure in VSCode settings.json
{
"mcp.servers": {
"stackshift": {
"command": "npx",
"args": ["-y", "stackshift-mcp"]
}
}
}See mcp-server/README.md for complete instructions.
StackShift asks this question in Gear 1 (Initial Analysis):
Which path best aligns with your goals?
A) Greenfield: Build new app based on business logic
- Extract business requirements only (tech-agnostic)
- Can implement in any stack
- Focus: WHAT the system does
B) Brownfield: Manage this app with Spec Kit
- Extract business logic + technical details (prescriptive)
- Manage existing codebase with specs
- Focus: WHAT it does + HOW it's implemented
Perfect for:
- π Platform migrations - Rails β Next.js, PHP β Python, Monolith β Microservices
- ποΈ Technology modernization - Rebuild with modern stack
- π± Cross-platform - Web app β Mobile app using same business logic
- β»οΈ Clean slate - Start fresh with better architecture
- π― Team flexibility - Let new team choose their preferred stack
Results in:
- Specifications that describe business requirements only
- No framework or library mentions
- Can be implemented in ANY technology
- Example: "User authentication with email/password" (not "JWT via passport.js")
Perfect for:
- π Spec-driven management - Add GitHub Spec Kit to existing codebase
- π Validation - Use
/speckit.analyzeto ensure specs match code - β¬οΈ Planned upgrades - Manage framework/dependency upgrades via specs
- π§ Gradual refactoring - Spec-driven modernization of existing app
- π₯ Team onboarding - Use prescriptive specs as documentation
Results in:
- Specifications that describe business requirements + exact implementation
- Framework, library, version details included
/speckit.analyzevalidates code matches specs- Example: "User authentication using JWT via jose 5.1.0, bcrypt 5.1.1, stored in httpOnly cookies"
| Aspect | Greenfield (A) | Brownfield (B) |
|---|---|---|
| Focus | WHAT only | WHAT + HOW |
| Tech Stack | Any (your choice) | Current (documented) |
| Specifications | Agnostic | Prescriptive |
| Implementation | Build new | Manage existing |
| Flexibility | High | Constrained to current stack |
| Validation | Manual | /speckit.analyze automated |
| Use Case | Platform migration | Ongoing development |
stackshift/
βββ README.md β You are here
βββ .claude-plugin/
β βββ marketplace.json β Plugin marketplace config
βββ plugin/
β βββ .claude-plugin/
β β βββ plugin.json β Plugin metadata
β βββ skills/
β β βββ analyze/ β Step 1: Initial Analysis
β β β βββ SKILL.md β Skill definition
β β β βββ operations/ β Sub-operations
β β βββ reverse-engineer/ β Step 2: Reverse Engineer
β β βββ create-specs/ β Step 3: Create Specifications
β β βββ gap-analysis/ β Step 4: Gap Analysis
β β βββ complete-spec/ β Step 5: Complete Specification
β β βββ implement/ β Step 6: Implement from Spec
β βββ templates/ β Spec templates
β β βββ feature-spec-template.md
β β βββ constitution-agnostic-template.md
β β βββ constitution-prescriptive-template.md
β β βββ implementation-status-template.md
β βββ scripts/
β βββ state-manager.js β Progress tracking
βββ web/ β Web prompts (for manual use)
β βββ WEB_BOOTSTRAP.md β Bootstrap for claude.ai
β βββ convert-reverse-engineering-to-speckit.md
βββ legacy/
βββ original-prompts/ β Legacy manual prompts (archived)
Why use the plugin over manual prompts?
β Auto-activation - Skills activate based on context, no copy-paste needed β Progress tracking - State management tracks where you are (which gear) β Resume capability - Pick up where you left off if interrupted β Guided experience - StackShift knows the full context and next steps β Templates included - Access all templates without file operations β Updates - Get improvements via plugin updates β Smooth shifting - Seamless transitions between steps
What it does:
- Runs AST analysis - Parses codebase with Babel, saves to
.stackshift-analysis/ - Detects programming language and framework
- Identifies application type (web, mobile, API, etc.)
- Maps directory structure
- Finds configuration files
- Estimates codebase size and completeness
Output:
analysis-report.mdwith tech stack summary.stackshift-analysis/cache directory:roadmap.md- Gap analysis with confidence scoresraw-analysis.json- Full AST data (functions, classes, APIs)summary.json- Metadata and timestamps
- Quick assessment of what exists
AST Cache Benefits:
- β Parse codebase ONCE in Gear 1
- β All other gears read from cache (instant)
- β Auto-refresh if stale (> 1 hour)
- β 50-90% performance improvement
Plugin Skill: /stackshift:analyze
Manual: Use web/WEB_BOOTSTRAP.md (Gear 1)
What it does:
- Deep codebase analysis using specialized agents
- Enhanced with AST cache - Auto-extracts APIs, business logic from parsed code
- Extracts all data models, API endpoints, components
- Documents configuration, infrastructure, operations
- Analyzes technical debt and test coverage
- Generates 9 comprehensive documents
Output:
docs/reverse-engineering/
βββ functional-specification.md (Business logic, requirements)
βββ integration-points.md (External services, APIs, dependencies)
βββ configuration-reference.md (All config options)
βββ data-architecture.md (Data models, API contracts)
βββ operations-guide.md (Deployment, infrastructure)
βββ technical-debt-analysis.md (Issues, improvements)
βββ observability-requirements.md (Monitoring, logging)
βββ visual-design-system.md (UI/UX patterns)
βββ test-documentation.md (Testing requirements)
Plugin Skill: /stackshift:reverse-engineer
Manual: Use web/WEB_BOOTSTRAP.md (Gear 2)
What it does:
- Transforms reverse-eng docs into formal specifications
- Creates feature specs (F001-F0XX format)
- Marks implementation status (β
COMPLETE,
β οΈ PARTIAL, β MISSING) - Generates OpenAPI specification for APIs
- Creates JSON Schemas for data models
- Sets up GitHub Spec Kit structure
Output:
specs/
βββ features/
β βββ F001-user-authentication.md (β
COMPLETE)
β βββ F002-data-management.md (β οΈ PARTIAL)
β βββ F003-advanced-features.md (β MISSING)
β βββ ...
βββ api/
β βββ openapi.yaml (Complete API spec)
βββ data/
β βββ schemas/ (JSON Schemas)
βββ implementation-status.md (Gap summary)
βββ constitution.md (Project principles)
Plugin Skill: /stackshift:create-specs
Manual: Use web/WEB_BOOTSTRAP.md (Gear 3)
What it does:
- Compares specifications against implementation
- Identifies incomplete features
- Lists missing UI components
- Highlights technical debt
- Creates
[NEEDS CLARIFICATION]markers for ambiguities - Generates prioritized gap list
Output:
specs/gap-analysis.md
βββ Missing Features (not started)
βββ Partial Features (backend done, UI missing)
βββ Technical Debt (needs improvement)
βββ Clarifications Needed (ambiguous requirements)
βββ Prioritized Implementation Plan
Plugin Skill: /stackshift:gap-analysis
Manual: Use web/WEB_BOOTSTRAP.md (Gear 4)
What it does:
- Interactive conversation to fill specification gaps
- Claude asks clarifying questions about missing features
- You provide details on UX, UI, behavior, priorities
- Specifications updated with your answers
[NEEDS CLARIFICATION]markers resolved- Final, complete specification created
Example Questions:
- "Analytics dashboard is missing - what charts do you want?"
- "Should offline sync be priority P0 or P2?"
- "For photo upload, drag-drop or click to browse?"
- "Species input: free-text or autocomplete dropdown?"
Output:
- Complete, unambiguous specifications
- No
[NEEDS CLARIFICATION]markers remaining - Clear implementation roadmap
- Prioritized feature list
Plugin Skill: /stackshift:complete-spec
Manual: Use web/WEB_BOOTSTRAP.md (Gear 5)
What it does:
- Systematically implements missing features from specs
- Works through prioritized list (P0 β P1 β P2)
- Checks off items as completed
- Validates implementation against specification
- Achieves 100% completion
Approach:
# For each missing feature:
1. Review specification
2. Implement according to spec
3. Test against acceptance criteria
4. Mark as complete
5. Move to next featureOutput:
- Fully implemented application
- All specs marked β COMPLETE
- Test coverage at target levels
- Production-ready codebase
Plugin Skill: /stackshift:implement
Manual: Use web/WEB_BOOTSTRAP.md (Gear 6)
This toolkit works for:
- Frontend frameworks: React, Vue, Angular, Svelte
- Backend: Node.js, Python, Ruby, Go, Java
- Databases: SQL, NoSQL, any data store
- React Native, Flutter, Swift, Kotlin
- Adapts documentation to mobile-specific patterns
- REST, GraphQL, gRPC
- Generates OpenAPI/AsyncAPI specs
- Documents service contracts
- Breaks into logical modules
- Creates specifications per domain
- Identifies bounded contexts
- Works even with minimal documentation
- Infers behavior from code
- Creates modernization roadmap
Use this toolkit if:
- β You have an existing codebase (partial or complete)
- β Documentation is lacking or outdated
- β You want to establish spec-driven development
- β You need to understand what's implemented vs. missing
- β You want a systematic approach to completion
- β You're using AI coding agents (Claude Code, Copilot, etc.)
This toolkit is NOT for:
- β Brand new projects (use GitHub Spec Kit from the start)
- β Throwaway prototypes
- β Applications you plan to completely rewrite
- Commit current state - Create a clean git state
- Create a branch - Don't work on main
- Set aside time - Steps 1-5 take ~2-4 hours
- Have context ready - Know your app's purpose and users
- Follow prompts in order - Each step builds on previous
- Don't skip Step 5 - The interactive refinement is crucial
- Be thorough with clarifications - Vague specs = buggy implementations
- Review generated specs - Validate accuracy before implementing
- Keep specs updated - Update specs when adding features
- Use spec-driven workflow - New features start with specs
- Run periodically - Re-run on major refactors or after acquisitions
- Make sure you're in the project root directory
- Check that config files aren't gitignored
- Explicitly mention unusual config locations
- Step 5 is where you correct inaccuracies
- Use
[NEEDS CLARIFICATION]to mark uncertain areas - Review and refine before implementing
- Break large monoliths into modules
- Run toolkit per module/microservice
- Increase context window (use Claude Sonnet 4.5)
- Manually add to
specs/features/ - Use templates in
templates/folder - Re-run Step 4 with hints about what's missing
After running this toolkit, you should have:
- β 100% documentation coverage - Every feature documented
- β Clear implementation status - Know exactly what exists
- β Formal specifications - Unambiguous feature definitions
- β Identified gaps - Complete list of missing pieces
- β Implementation roadmap - Prioritized plan to completion
- β Spec-driven workflow - Established for future development
This toolkit is designed to be:
- Generic - Works for any application
- Extensible - Add your own prompts/templates
- Shareable - Use across teams and organizations
Improvements welcome:
- Fork this toolkit
- Add/improve prompts or templates
- Share back with community
- Help others achieve spec-driven development
- GitHub Spec Kit - Official spec-driven development toolkit
- OpenAPI Specification - API specification standard
- JSON Schema - Data validation standard
- Architecture Decision Records - Document key decisions
This toolkit is provided as-is for use in any project. Adapt and modify as needed for your organization.
This toolkit was created to solve a real problem: transforming partially-complete applications into fully-specified, enterprise-grade codebases.
Encountered an issue or have a suggestion?
- π Found a bug? Open an issue
- π‘ Have an idea? Start a discussion
- π§ Want to contribute? Submit a pull request
The toolkit improves with real-world usage and community feedback!
Happy Shifting! ππ¨
Start in reverse (engineering), shift through 6 gears, cruise into spec-driven development.