skills/brownfield-greenfield/SKILL.md
Use when evaluating an existing project to understand what it does and what a fresh start would look like — extracts the intent graph from brownfield code, identifies pain points, strips technology choices, redesigns with current best practices, and presents a side-by-side comparison so the user can decide what (if anything) to change. Also use when inheriting an unfamiliar codebase and needing to understand its intent and constraints before making changes.
npx skillsauth add ahmedhamadto/software-forge brownfield-greenfieldInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Structured analysis that answers: "If I were starting from scratch today, knowing what I know now, what would I do differently?" This is NOT a mandate to rewrite. It is a decision-support tool that extracts what the system does, separates that from how it does it, proposes a modern alternative, and lets the user compare both side-by-side before deciding.
The user always decides. This skill recommends, never mandates.
brainstorming or ddia-design instead)systematic-debugging)writing-plans then executing-plans)Work through five phases sequentially. Each phase feeds the next. Do not skip phases.
digraph brownfield_greenfield {
rankdir=TB;
node [shape=box, style=rounded];
extract [label="Phase 1: Extract\n(Brownfield Analysis)"];
abstract [label="Phase 2: Abstract\n(Strip Technology)"];
redesign [label="Phase 3: Redesign\n(Greenfield Architecture)"];
compare [label="Phase 4: Compare\n(Side-by-Side Diff)"];
discuss [label="Phase 5: Discuss\n(Decision Support)"];
extract -> abstract -> redesign -> compare -> discuss;
user_input [label="User Input\n(Constraints, Pain Points)", shape=note];
user_input -> extract;
user_decision [label="User Decides\n(Accept / Reject / Partial)", shape=diamond];
discuss -> user_decision;
}
Scan the existing project to build the intent graph. This is the foundation — everything downstream depends on getting this right.
What to extract:
| Category | Description | How to Find It | |----------|-------------|----------------| | Business intents | What problems does this system solve? (user auth, order processing, notifications) | Read route handlers, service classes, domain models, README | | Data flows | How does data move? (ingestion, processing, storage, presentation) | Trace from entry points (API routes, event handlers) through to persistence | | Integration boundaries | What external systems does it talk to? (payment providers, email, third-party APIs) | Search for HTTP clients, SDK imports, env vars with URLs/keys | | Patterns in use | What architectural patterns exist? (MVC, microservices, event-driven, CQRS) | Examine directory structure, class hierarchies, messaging infrastructure | | Constraints | What hard constraints exist? (regulatory, performance SLAs, data residency, backward compat) | Check compliance docs, SLA definitions, deployment configs, ask the user | | Pain points | What causes friction? (slow deploys, flaky tests, scaling bottlenecks, tech debt) | Git churn analysis, CI build times, ask the user | | Team structure | How does the team map to the codebase? (Conway's Law implications) | Ask the user, check CODEOWNERS, examine commit author distribution |
Extraction techniques:
git log --format=format: --name-only | sort | uniq -c | sort -rn | head -30docs/, architecture/, ADRs, or READMEsOutput: A structured intent graph document covering all seven categories above.
Convert the extraction into a technology-agnostic intent graph. The goal is to separate what the system does from how it does it.
Abstraction rules:
Replace specific technologies with generic capabilities:
Replace specific frameworks with patterns:
Preserve constraints as-is (regulatory requirements are technology-independent)
Preserve data flow shapes (event-driven stays event-driven if that's the intent)
Preserve performance characteristics that are requirements, not implementation details
Classification — the hard part:
For every technology choice and pattern, classify it:
| Classification | Criteria | Example | |---------------|----------|---------| | Intentional | Architecture docs justify it; used consistently; aligns with known constraints; recent commits show deliberate investment | Choosing PostgreSQL for JSONB support to handle semi-structured data | | Accidental | Only used in one area while different patterns used elsewhere; no docs or commit messages explain it; version years out of date; team actively works around friction it causes | jQuery in one page while React is used everywhere else | | Unknown | Could be either; constraint may have expired; choice predates current team | A specific message queue that nobody remembers choosing |
For "Unknown" items, ask the user. Do not guess. Present the item with context and let them classify it.
Output: A technology-agnostic intent document where every item is classified as intentional, accidental, or resolved-unknown.
Using the intent graph from Phase 2, design a fresh architecture as if starting today.
Design principles:
Coverage checklist (15-domain taxonomy):
Ensure the greenfield design addresses each applicable domain:
For each domain, justify the choice by referencing the intent graph. Every decision should trace back to a business intent or constraint.
Output: A complete greenfield architecture proposal with justifications for each domain.
Produce a structured comparison between the brownfield reality and the greenfield proposal.
For each domain in the taxonomy, document:
| Field | Description | |-------|-------------| | Brownfield (Current) | What exists today, including version and pattern | | Greenfield (Proposed) | What the fresh design recommends | | Change description | What specifically changes and WHY (not just "it's better") | | Migration cost | One of: trivial / moderate / significant / rewrite | | Risk level | One of: low / medium / high / critical | | Intermediate states | Can this change be deployed incrementally? What do the in-between states look like? |
Migration cost definitions:
Risk level definitions:
Output: A comparison matrix covering all applicable domains with cost and risk data.
Present the comparison and help the user make decisions. Structure recommendations into four buckets:
Quick Wins (Do Now) Changes where: migration cost is trivial or moderate AND risk is low or medium AND impact is meaningful. These are the "no-brainer" improvements.
Phased Migration (Plan For) Changes where: migration cost is moderate or significant AND a clear incremental path exists AND each intermediate state is deployable and functional. Include a rough sequencing order.
Accept As-Is (Leave Alone) Things where: the brownfield choice is still reasonable OR migration cost outweighs the benefit OR the team has more important things to work on. Explicitly calling out "this is fine" prevents unnecessary churn.
Rewrite Required (Only If...) Changes where: the migration cost is "rewrite" level. State the conditions under which this would be justified (scaling cliff, end-of-life dependency, security vulnerability with no patch). Never recommend a rewrite without a clear triggering condition.
Cost summary:
Output: Categorised recommendations with effort estimates and a clear decision framework.
Save the complete analysis to docs/plans/YYYY-MM-DD-<project>-brownfield-greenfield.md:
# Brownfield to Greenfield Analysis: [Project Name]
**Date:** YYYY-MM-DD
**Analyst:** [who ran this]
**Codebase:** [repo URL or path]
## Phase 1: Intent Graph
### Business Intents
[What the system does, technology-free]
### Data Flows
[How data moves, technology-free]
### Integration Boundaries
[External systems and contracts]
### Constraints
[Hard constraints that any redesign must respect]
### Pain Points
[What causes friction today]
### Team Structure
[How the team maps to the codebase]
## Phase 2: Abstracted Architecture
[Technology-agnostic description with intentional/accidental classification]
## Phase 3: Greenfield Proposal
[Fresh architecture using current best practices, with justifications]
## Phase 4: Comparison Matrix
| Domain | Brownfield (Current) | Greenfield (Proposed) | Change | Migration Cost | Risk |
|--------|---------------------|----------------------|--------|---------------|------|
| Language & Runtime | [current] | [proposed] | [what/why] | [cost] | [risk] |
| Package Management | ... | ... | ... | ... | ... |
| Framework & Pattern | ... | ... | ... | ... | ... |
| Database & Data | ... | ... | ... | ... | ... |
| Auth | ... | ... | ... | ... | ... |
| API Layer | ... | ... | ... | ... | ... |
| Frontend / UI | ... | ... | ... | ... | ... |
| State Management | ... | ... | ... | ... | ... |
| Testing | ... | ... | ... | ... | ... |
| CI/CD | ... | ... | ... | ... | ... |
| Infrastructure | ... | ... | ... | ... | ... |
| Observability | ... | ... | ... | ... | ... |
| Security | ... | ... | ... | ... | ... |
| Documentation | ... | ... | ... | ... | ... |
| Developer Experience | ... | ... | ... | ... | ... |
## Phase 5: Recommendations
### Quick Wins (Do Now)
[High impact, low cost changes with effort estimates]
### Phased Migration (Plan For)
[Changes that can happen incrementally, with sequencing]
### Accept As-Is (Leave Alone)
[Things that are not worth changing, with justification]
### Rewrite Required (Only If...)
[Changes that need significant effort — triggering conditions stated]
### Cost Summary
- Quick wins only: [effort estimate]
- Quick wins + phased migration: [effort estimate]
- Full greenfield rewrite: [effort estimate]
## Decision Log
- **[Topic]:** Chose [X] over [Y] because [reasoning].
- **Rejected:** [Alternative] — [why it was rejected].
| Anti-pattern | Why It Fails | What to Do Instead | |-------------|-------------|-------------------| | Treating this as a mandate to rewrite | Rewrites fail more often than they succeed; most value comes from targeted improvements | Present options and let the user choose their investment level | | Ignoring migration cost | The best architecture is worthless if you cannot get there from here | Every recommendation must include a realistic cost estimate | | Assuming brownfield choices were wrong | They may have been right for the constraints that existed at the time | Classify as intentional/accidental before judging | | Proposing tech the team cannot maintain | A Haskell rewrite for a JavaScript team creates a staffing crisis | Match the greenfield design to the team's actual capabilities | | Stripping constraints that are still active | Regulatory and contractual obligations do not expire because you wish they would | Verify every constraint's current status before removing it | | Ignoring Conway's Law | Architecture that fights team structure will lose | Factor team boundaries into the greenfield design | | Skipping intermediate states | Each step of a phased migration must be independently deployable | Map out every intermediate state and verify it works | | Greenfield-for-the-sake-of-greenfield | Changing things that work just because they are old wastes effort and introduces risk | Only propose changes where the delta justifies the cost |
testing
Craft stunning macOS desktop experiences with SwiftUI — cinematic animations, particle systems, glass materials, and wallpaper-grade visual design. Use like `/apple-craftsman A minimalist weather widget with aurora particle effects`.
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when testing a web application for security vulnerabilities, before deployment or during security review — guides through a structured 10-phase penetration testing methodology covering mapping, authentication, session management, access controls, injection, logic flaws, and server configuration.
data-ai
Engineer system prompts for LiveKit voice agents with multilingual support. Use when creating or optimizing AI agent conversation flows.