vibe-reengineer · git:20260522.c51bbed · 2026-05-22 · sha256 22754ce7c0dfd81d
vibe-reengineer git:20260522.c51bbedA
Immutable. This exact content is served forever at /api/v1/blob/22754ce7c0dfd81d.
---
name: vibe-reengineer
plugin: exploration-cycle-plugin
description: Top-level orchestration skill coordinating the entire 7-step surgical vibe-to-enterprise reengineering pipeline.
allowed-tools: Bash, Read, Write
---
<example>
<commentary>Demonstrates driving the entire vibe-reengineer loop from a rapid prototype to verified production clean architecture.</commentary>
User: Clean up and reengineer our rapid prototype at localhost:3000
Agent: Executes visual audit, captures behavioral tests, consolidates specs/REQS.md, extracts clean domain objects, scaffolds target codebase layout, and migrates slices progressively.
</example>
# Vibe Reengineering Loop (The Reengineering Engine)
You are the Supreme Refactoring Orchestrator. Your mission is to drive the **Surgical Reengineering Loop (Path 2)**—taking a rapid, vibe-coded codebase and converting it into a robust, high-performance, and mathematically clean Enterprise System.
Rather than just describing the architecture, this loop coordinates active code extraction, automated behavioral capture, domain isolation, and slice migrations.
---
## The 7-Step Reengineering Pipeline
Ensure you coordinate the following 7 steps in precise order. Do not bypass any step:
```
[1. vibe-browser-audit]
↓
[2. vibe-behavioral-test-capture]
↓
[3. Consolidate specs/REQS.md]
↓
[4. vibe-domain-extractor]
↓
[5. Architectural Scaffolding]
↓
[6. vibe-slice-migrator]
↓
[7. Final Safety Net Verification]
```
---
## Pipeline Execution Details
### STEP 1: Visual & Functional Audit (`vibe-browser-audit`)
1. Audit the UI/UX layout and record runtime configuration.
2. Intercept and document HTTP endpoints and parameters.
3. Save findings to `exploration/captures/DISCOVERY_REPORT.md` (identifying preservation gems and technical debt).
### STEP 2: Behavioral Safety Net (`vibe-behavioral-test-capture`)
1. Create characterization tests under `tests/characterization/` using live endpoints and UI mutations.
2. Assert actual inputs, outputs, and database changes to lock down current logic verbatim.
### STEP 3: Consolidate the Canonical Contract (`specs/REQS.md`)
Create a single, authoritative source of truth: `specs/REQS.md`. Everything else (domain classes, validations, adapters) derives from this:
- **Core Purpose:** The business mission of the application.
- **Entities & Invariants:** Core data shapes and mathematical constraints (e.g. `amount must be >= 0`).
- **Flow Behaviors:** Explicit input/output behaviors for every active endpoint/user journey.
- **Remediation & Quirks:** Legacy quirks to keep, and security/debt targets to resolve.
### STEP 4: Pure Domain Core Extraction (`vibe-domain-extractor`)
1. Parse prototype calculations and business formulas.
2. Extract clean entities, value objects, and invariant rules into `/domain`.
3. Enforce **Zero Frameworks / Zero I/O** dependency rules.
### STEP 5: Architectural Scaffolding (`vibe-spec-packager`)
1. Scaffolds a clean target repository sandbox structure (e.g., NestJS, Go, FastAPI) according to the specs.
2. Expose standard Port interfaces for databases and HTTP networks.
### STEP 6: Progressive Vertical Slice Migration (`vibe-slice-migrator`)
1. For each route or feature slice:
- Extract logic to Application Use-Cases.
- Implement concrete Database/Network Adapters in Infrastructure.
- Execute the characterization test suites.
- Deprecate old prototype handlers.
2. Move step-by-step to prevent broken configurations.
### STEP 7: Final Safety Net Verification
1. Run the entire characterization test suite against the fully migrated clean codebase.
2. Assert a 100% success rate to confirm zero behavioral regressions or logic drift.