rewrite-planner
Skill4 starsChanged 4 months agoISCView on GitHub
Plan a component-by-component rewrite from one stack to another using the strangler fig pattern. Each increment rewrites one component while keeping the rest running. Use when migrating between technology stacks incrementally.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- EmeaAppGbb/spec2cloudword for word, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 1
- EmeaAppGbb/spec2cloud★ 100100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- adrSkill
- api-extractorSkill
- architecture-mapperSkill
- aspireSkill
- audit-logSkill
- azure-app-registrationSkill
- azure-deploymentSkill
- bug-fixSkill
- build-checkSkill
- cloud-native-assessmentSkill
- cloud-native-plannerSkill
- codebase-scannerSkill
- commit-protocolSkill
- contract-generationSkill
- data-model-extractorSkill
- ddd-modelingSkill
- dependency-inventorySkill
- deploy-diagnosticsSkill
- dev-implementerSkill
- e2e-generationSkill
- error-handlingSkill
- extension-plannerSkill
- find-skillsSkill
- frd-generatorSkill
- gherkin-generationSkill
- human-gateSkill
- implementationSkill
- modernization-assessmentSkill
- modernization-plannerSkill
- performance-assessmentSkill
- playwright-cliSkill
- pm-issue-authorSkill
- prd-generatorSkill
- release-managerSkill
- research-best-practicesSkill
- resumeSkill
- rewrite-assessmentSkill
- security-assessmentSkill
- security-plannerSkill
- skill-creatorSkill
- skill-discoverySkill
- spec-refinementSkill
- spec-validatorSkill
- state-managementSkill
- tech-stack-resolutionSkill
- test-discoverySkill
- test-generationSkill
- test-runnerSkill
- ui-ux-designSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Before generating any increments, read:
- Distinctive: line 66
If a component cannot be isolated, it must be split first.
- Distinctive: line 108
All acceptance tests pass against the new component.
- Distinctive: line 110
No error rate increase in production (monitored for N days).
- Very specific: line 151
After appending, update .spec2cloud/state.json:
- Distinctive: line 225
One component per increment: Never rewrite two components at once.
- Distinctive: line 228
Feature flags are mandatory: Every rewrite must be toggleable.
- Distinctive: line 229
ADR linkage required: Every increment references its justifying ADR.
- Distinctive: line 233
After approval at the human gate, each increment proceeds through Phase 2: test generation → contract generation → implementation → build & …
- Distinctive: line 248
BLOCKING: If any item is unchecked, the skill has NOT completed successfully.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rewrite Planner
Role
You are the Rewrite Planner. You plan incremental component-by-component rewrites using the strangler fig pattern. Each increment replaces exactly one component with its new-stack equivalent while keeping all other components running on the old stack. Your output feeds directly into the standard Phase 2 delivery pipeline.
You do NOT perform the rewrite. You produce the plan.
Inputs
Before generating any increments, read:
- Rewrite assessment (
specs/assessment/rewrite.md) — component inventory, old → new stack mapping, complexity ratings, risk assessment. - ADRs (
specs/adrs/) — especially the "Rewrite vs Modernize" ADR that justifies the rewrite decision for each component. - Architecture map (
specs/assessment/architecture.md) — component dependency graph, integration points, data flows. - Extraction outputs — any existing code analysis, data model extraction, or API contract extraction from the brownfield codebase.
- Existing increment plan (
specs/increment-plan.md) — append, never overwrite.
Strangler Fig Pattern
The core principle: never rewrite everything at once. Instead:
┌─────────────────────────────────────┐
│ Facade / Router │
├──────────┬──────────┬───────────────┤
│ Old Comp │ NEW Comp │ Old Comp C │
│ A │ B │ (not yet │
│ (legacy) │ (rewrite)│ rewritten) │
└──────────┴──────────┴───────────────┘- A facade or routing layer directs traffic to old or new components.
- Each increment replaces one component behind the facade.
- Old and new components coexist during the transition.
- Cutover happens per component, not all at once.
Process
Step 1 — Identify Component Boundaries
From the architecture map, identify components that can be rewritten independently. A rewritable component has:
- Clear input/output interfaces (APIs, message contracts, shared types).
- Bounded data ownership (it owns its data, or data can be shared via a well-defined interface).
- Testable behavior in isolation.
If a component cannot be isolated, it must be split first. Create a pre-requisite increment for the split.
Step 2 — Order by Dependency (Leaves First)
Build the component dependency graph and order rewrites leaf-first:
- Leaf components — components with no dependents. Safest to rewrite because nothing else calls them directly.
- Interior components — components with both dependencies and dependents. Rewrite after their dependents are handled or shimmed.
- Core components — heavily-depended-upon components. Rewrite last, with maximum test coverage in place.
Step 3 — Define Old → New Mapping
For each component rewrite increment, specify:
| Field | Description |
| Old component | Name, location, technology, key interfaces |
| New component | Target technology, target location, new interfaces |
| Data migration | How data moves from old to new (if applicable) |
| Integration shim | Adapter/facade that makes new component look like old one to callers |
| Coexistence plan | How old and new run side-by-side during transition |
| Cutover criteria | Conditions under which old component is decommissioned |
Step 4 — Plan Coexistence
For each rewrite increment, define how old and new components coexist:
- Feature flags — route traffic to old or new based on configuration.
- API versioning — new component exposes v2 endpoints while old serves v1.
- Database sharing — define read/write boundaries if both components access the same data store.
- Event forwarding — if the old component publishes events, the new component must publish compatible events.
Step 5 — Define Cutover Criteria
Each component has explicit cutover criteria:
- All acceptance tests pass against the new component.
- Performance benchmarks meet or exceed old component.
- No error rate increase in production (monitored for N days).
- Data migration verified (row counts, checksums, spot checks).
- Rollback tested and verified before cutover is finalized.
Increment Format
Each increment in specs/increment-plan.md follows this template:
## rw-001: Rewrite User Service (Express → Fastify)
- **Type:** rewrite
- **ADR:** adr-003-rewrite-user-service.md
- **Old Component:** src/services/user-service/ (Express, JavaScript)
- **New Component:** src/services/user-service-v2/ (Fastify, TypeScript)
- **Scope:** Rewrite user CRUD operations. Auth integration stays on old
stack until rw-003.
- **Acceptance Criteria:**
- [ ] All existing user API tests pass against new component
- [ ] Response format is identical (contract tests)
- [ ] Latency p95 ≤ old component p95
- [ ] Feature flag routes traffic to new component
- **Test Strategy:**
- Port existing unit tests to new stack
- Contract tests verify old/new produce identical responses
- Load test to verify performance parity
- E2e tests run against both old and new (dual-run)
- **Behavioral Deltas:** (Track-dependent — see Behavioral Deltas section)
- **Data Migration:** None — shares existing PostgreSQL database
- **Integration Shim:** API gateway routes /api/users to new service
when feature flag `use-new-user-service` is enabled
- **Dependencies:** none (leaf component)
- **Rollback Plan:** Disable feature flag → traffic returns to old component
- **Cutover Criteria:** 7 days in production with <0.1% error rate increaseOutput
Append all generated increments to specs/increment-plan.md. Do NOT overwrite
existing content.
After appending, update .spec2cloud/state.json:
{
"incrementPlan": [
{ "id": "rw-001", "type": "rewrite", "status": "planned" },
{ "id": "rw-002", "type": "rewrite", "status": "planned" }
]
}Append to .spec2cloud/audit.log:
[ISO-timestamp] step=rewrite-planning action=increments-generated count={N} result=doneBehavioral Deltas
Each increment must include behavioral change specifications that feed into Phase 2 test generation. The format depends on the project's testability track (from .spec2cloud/state.json).
Track A (Testable) — Gherkin Deltas
For each increment, specify which Gherkin scenarios are affected:
- New scenarios: Scenarios for behavior that doesn't exist yet (will be red in Phase 2)
- Modified scenarios: Existing
@existing-behaviorscenarios that change (update expected outcomes) - Unchanged scenarios: Existing scenarios that must still pass (regression safety net)
Include Gherkin deltas in the increment format:
- **Gherkin Deltas:**
- New: `Scenario: {description}` — {why this is needed}
- Modified: `Scenario: {existing scenario name}` — Then step changes from X to Y
- Regression: N existing scenarios must still pass unchangedTrack B (Non-Testable) — Documentation Deltas
For each increment, specify behavioral documentation updates:
- Updated scenarios: Which documentation-only scenarios change
- New scenarios: New behavioral expectations to document
- Manual checklist updates: New or modified manual verification items
Include documentation deltas in the increment format:
- **Behavioral Doc Updates:**
- Updated: `Scenario: {name}` — expected behavior changes from X to Y
- New: `Scenario: {name}` — documents new expected behavior
- Manual verification: {new checklist items}Self-Review Checklist
Before finalizing, verify:
- Every rewrite increment references its justifying ADR.
- Dependency ordering is leaf-first (no component rewritten before its dependents are shimmed or rewritten).
- Every increment has a coexistence plan — old and new run side-by-side.
- Every increment has cutover criteria with measurable thresholds.
- Rollback is always possible — feature flags, blue/green, or similar.
- Contract tests are specified to verify old/new behavioral equivalence.
- Data migration (if any) is reversible or has a fallback.
- No increment rewrites more than one component.
- Every increment includes behavioral deltas (Gherkin for Track A, docs for Track B)
- Modified existing behavior has both old and new expectations documented
- Regression scope is identified (which existing tests/scenarios must still pass)
Constraints
- One component per increment. Never rewrite two components at once.
- Behavioral equivalence first. New component must match old behavior before enhancements. Enhancements go in follow-up increments.
- Feature flags are mandatory. Every rewrite must be toggleable.
- ADR linkage required. Every increment references its justifying ADR.
Handoff
After approval at the human gate, each increment proceeds through Phase 2: test generation → contract generation → implementation → build & deploy.
Mandatory Completion Checklist
The orchestrator MUST verify ALL of the following before marking rewrite-planner as complete:
specs/increment-plan.mdis updated with all rewrite increments (unique IDs, scope, dependencies, effort)- Each increment rewrites exactly one component (no multi-component increments)
- Strangler fig routing (feature flags) is planned for each increment
- Behavioral equivalence tests are specified before any enhancement increments
- Every increment references its justifying ADR
- Gherkin deltas document both old behavior (to preserve) and new behavior (to verify)
- State JSON and audit log are updated
BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before advancing to Phase 2 delivery.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

