rewrite
Stage 1/2 - Orchestrate a legacy application rewrite workflow by analyzing modernization assessments and coordinating specialized skills.
Skill by sapientcoffee
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/sapientcoffee-rewrite
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/rewrite
What's inside
- Skill name
rewrite- Description
- Stage 1/2 - Orchestrate a legacy application rewrite workflow by analyzing modernization assessments and coordinating specialized skills.
- License
- Apache-2.0
- Instructions
- 84 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# ☕ Skill: Application Rewrite Brew Protocol
You are executing the **Application Rewrite Brew Protocol**. Rewriting a legacy application requires a structured, risk-mitigated, and language-agnostic approach that guarantees functional parity, resolves architectural technical debt, and maintains compliance with the perfect brew state machine (Stages 0 to 9).
This skill provides a generic orchestrator that walks through analyzing legacy assessment reports (regardless of language or framework), extracting domain details, establishing parity requirements, slicing the monolith, and coordinating implementation using existing specialized repository skills.
---
## 🛠️ Unified Workspace Skills Mapping
An application rewrite leverages the repository's suite of specialized autonomous barista swarm skills:
1. **Assessment & Scanning (Phase 1):** Use the `assess` skill to run codebase pre-scans, check active credentials, select `codmod` intents, and execute the remote assessment.
2. **Requirements & Discovery (Phase 2):** Use the `feature` / `write-prd` skill to initialize directories, draft `02_PRD.md`, and compile the master `visual-dashboard.html`.
3. **Parity Extraction (Phase 3):** Use the `research` skill to do blind, factual extraction of legacy models, endpoints, and business rules to build `docs/glossary.md` and `docs/visual-glossary.html`.
4. **Domain Architecture (Phase 4):** Use the `domain-modeling` skill to define target bounded contexts and architectural decisions.
5. **Socratic Alignment (Phase 4):** Use the `grill` / `grilling` skill to stress-test your rewrite specification and implementation plan.
6. **Execution & Kanban Planning (Phase 5):** Use the `kanban` skill to cut vertical slices, conduct dependency mapping, and generate interactive Kanban tracking boards.
7. **TDD Code Generation (Phase 7):** Use `generate-code` to write backend/frontend codebase slices and `audit-code` for QA compliance.
8. **Testing & Dev Hosting (Phase 7):** Use `dev` to run local backend/frontend servers, and `test-api` to execute local verification suites.
9. **Walkthrough & Recording (Phase 8):** Use the `record` skill to capture high-fidelity terminal playbacks and walkthroughs.
10. **Delivery & Branching (Phase 9):** Use the `worktree` skill and `github-workflow` to manage isolated branches and open clean pull requests.
---
## 🧭 Generic & Flexible Step-by-Step Protocol
### Step 1: Ingest Assessment Report & Establish Baseline (Language-Agnostic)
1. **Locate Assessment:** Look for a pre-generated assessment report (e.g., `modernization_report.html`, `petclinic-standard-report-3.6.html`, or a JSON metadata export). If none exists, run the `assess` skill using the `assess` command to generate one.
2. **Determine Source Stack & Target Runtime:**
- Identify the source language and frameworks (e.g., legacy Java/Spring, .NET Framework / C#, C/C++, COBOL, mainframe, or modern monolith).
- Identify the target modernized platform (e.g., Java 21/Spring Boot 3.x, .NET Core/8/9, Go, Node.js/TypeScript).
- Identify the target compute environment (e.g., Cloud Run, Google Kubernetes Engine (GKE), App Engine) and data tier (e.g., Google Cloud SQL, Cloud Spanner, Cloud Memorystore).
3. **Extract Metric Summaries:**
- Note codebase scale (Lines of Code (LOC) and file counts).
- Map external dependencies, runtime frameworks, and build engines (e.g., Maven, Gradle, MSBuild, dotnet CLI, npm).
4. **Identify Architectural Technical Debt & Strategic Drivers:**
- **Coupling & Cohesion:** Are business rules, data access, and UI tightly coupled? (e.g., database queries embedded directly within MVC/Web controllers or .aspx/Thymeleaf pages).
- **State & Scalability:** Is the application limited by single-node in-memory state or local sessions that prevent horizontal scalability?
- **Security Posture:** Are there hardcoded secrets, plain-text connection strings, or unrestricted actuator/metrics endpoints?
- **Concurrency & Performance:** Are blocking I/O calls limiting throughput? (e.g., synchronous database queries or single-threaded loops).
### Step 2: Initialize Plan & Parity Requirements (Stage 2 - PRD)
1. **Initialize Versioned Directory:**
- Determine a target slug name (e.g., `rewrite-<app-slug>`).
- Create the versioned path: `plans/<slug>/<YYYY-MM-DD_HHMM>/`.
2. **Draft the PRD (`02_PRD.md` & `visual-dashboard.html`):**
- Incorporate the report findings and strategic recommendations directly.
- Mandate strict API, input validation, and layout/view parity for existing screens and routes.
- Specify **Non-Goals** (e.g., "We are NOT adding new user features in this pass; this is a strict rewrite for technical modernization, security, and performance").
- Follow the **Dual-Write Requirement** (Rule 5) via `python3 scripts/manage_dashboard.py mirror --plan-dir "plans/<slug>/<timestamp>"` to mirror `visual-dashboard.html` and `02_PRD.md` to system artifacts as `00_visual-dashboard.html` and `02_prd.md` respectively.
### Step 3: Domain Extraction & Ubiquitous Glossary (Stage 3 - Extraction)
1. **Launch Research Subagent:** Run the `research` skill to scan the legacy code and extract factual specifications:
- **Legacy Models & Schemas:** Map database schemas, table layouts, core entity relationships, and value objects.
- **Legacy API & Entry Surfaces:** Extract the full catalog of entry points (HTTP routes, SOAP/WSDL endpoints, MVC controllers, file ingestion jobs, or CLI interfaces).
2. **Publish the Ubiquitous Glossary:**
- Create `docs/glossary.md` and `docs/visual-glossary.html` documenting domain terms, business rules, validations, and API contracts.
- Mirror these to the system artifacts folder as `01_visual-glossary.html` (Rule 5).
### Step 4: Target Domain Modeling & Socratic Alignment (Stage 4 - Spec)
1. **Architect Target Models:** Use the `domain-modeling` skill to design target entity classes, repositories, and services aligned with your modern target runtime's idioms (e.g., adopting Java Records, .NET primary constructors, asynchronous/non-blocking patterns, or lightweight serverless handlers).
2. **Decouple Business Logic:** Introduce explicit service boundaries or domain services to completely isolate core business rules from Web/HTTP handlers or database persistence classes.
3. **Draft `04_SPEC.md` & `04_visual-spec.html`:** Document the target system design, data architecture, security hardening (e.g., Secret Manager, identity providers), and SRE/observability integrations. Mirror to system artifacts.
4. **Conduct Socratic Grill:** Execute the `grill` / `grilling` skill to stress-test your design and ensure all edge cases are answered before writing code.
### Step 5: Decompose Monolith into Logical Vertical Slices (Stage 5 - Execution Plan)
1. **Vertical Slicing Rules:** Do NOT plan a monolithic rewrite. Cut the application into logical, independent vertical slices.
2. **Draft the Slice-Based Execution Plan (`05_PLAN.md`):**
- Establish physical contract signatures first.
- Categorize tasks into `[Serial]` and parallelizable (`[Parallel]`) chunks.
- **Generalized Slicing Pattern:**
- **Slice 0 (Common Foundation & Infrastructure):** Target build system configuration, runtime properties, schema migrations, shared entity models/base structures, and cloud secret integrations.
- **Slice 1 (Low-Dependency Domain Lookup Services):** Read-only lookups or simple lookup subdomains (e.g., metadata, specialties, taxonomies). Serves to validate pipeline compilation, data access, and routing.
- **Slice 2 (Core Transactional Subdomains):** Main domain services handling state mutations, validation rules, and heavy transactions.
- **Slice 3 (Cross-Cutting Concerns & Security):** Centralized error handling, internationalization, logging filters, authentication/authorization layers, and metrics/actuator monitoring.
- **Slice 4 (Scalability & Decoupled Integrations):** Distributed session handling, external caches, connection pooling adjustments, or decoupled UI (Single Page Application) integrations.
3. **Generate Kanban Visuals:** Use the `kanban` skill to generate an interactive board and Mermaid diagram to map slices and track progress. Mirror `05_PLAN.md` to system artifacts.
### Step 6: Human Gate & Execution (Stages 6 to 9)
1. **Halt for Approval:** Present the PRD, Spec, and Slice Execution Plan to the user. Require explicit "approve" verification.
2. **Slice-by-Slice Implementation:** Execute using TDD via `/tdd` (silent on success) utilizing the `generate-code` and `audit-code` skills to build and verify each slice.
3. **Walkthrough Proof:** Capture terminal playbacks or page tests with the `record` command.
4. **Isolated Branch Delivery:** Build production packages, isolate branch slices using the `worktree` command, and create elegant PRs using `gh` via the `github-workflow` skill.From sapientcoffee/bean-to-cup, Apache-2.0.
More from sapientcoffee/bean-to-cup
- 0.521score
assess
sapientcoffee
Exposes the app modernization assessment skill, performing agentic codebase scans, GCP credential verification, cost estimation checks, and executing the…
SkillBFreshness: BClaude Code +9 - 0.512score
kanban
sapientcoffee
Stage 7 - Generates an interactive Kanban board (Markdown & HTML) and Mermaid flow to visualize and track the status of implementation slices.
SkillBFreshness: BClaude Code +9 - 0.469score
chaos-mitigation
sapientcoffee
Phase 7 - Detects, analyzes, and mitigates active chaos events in the `press-service` using logs and runbooks.
SkillCFreshness: CClaude Code +9 - 0.469score
dev
sapientcoffee
Start the local development environment (backend and frontend)
SkillCFreshness: CClaude Code +9 - 0.467score
deploy-app
sapientcoffee
Phase 7 - Acts as DevOps to automatically detect the application stack, install necessary dependencies, and host the application locally.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 11
- Last commit (this folder)
- Aug 5, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/sapientcoffee/bean-to-cup
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from sapientcoffee
- 0.526score
harness-immunizer
sapientcoffee
Velocity Harness Patch self-healing mechanism.
SkillBFreshness: BClaude Code +9 - 0.526score
cycle-telemetry
sapientcoffee
Velocity Chess Clock telemetry tracker.
SkillBFreshness: BClaude Code +9 - 0.526score
code-hygiene
sapientcoffee
Deterministic local code hygiene runner.
SkillBFreshness: BClaude Code +9 - 0.524score
github-workflow
sapientcoffee
Phase 9 - Provides the process for raising git commits, checking branches, and creating PRs using the gh CLI.
SkillBFreshness: BClaude Code +9 - 0.521score
git-delivery
sapientcoffee
Provides an emoji-powered, good-practice delivery pipeline to verify code quality, craft conventional atomic commits, and compile premium "What, Why, How"…
SkillBFreshness: BClaude Code +9 - 0.521score
record
sapientcoffee
Record terminal interactions and compile them to animated GIFs.
SkillBFreshness: BClaude Code +9
Cite this page
rewrite skill. Agent Mart. https://agentmart.dev/skills/sapientcoffee-rewrite (last updated 2026-10-24)