Feature Development
End-to-end feature implementation from documentation to working code. Automatically detects and applies the appropriate engineering role based on the project's tech stack.
1. Receive and Parse Documentation
Gather all input documentation provided by the user:
- Accepted formats: PRD, ARD (Architecture Decision Record), design doc, implementation plan, ticket/issue, or any structured feature specification
- Read every provided document thoroughly
- Extract and organize:
- Goal: what the feature does (1–2 sentences)
- Requirements: functional and non-functional
- Acceptance criteria: how to verify the feature works
- Implementation plan: ordered steps, architecture decisions, data models, API contracts
- Constraints: performance, security, compatibility, dependencies
- Out of scope: what this feature explicitly does NOT cover
Check for an existing implementation plan. Search the documentation, linked files, and project directory for an implementation plan (file named *plan*, *implementation*, or a plan section inside the PRD/ARD). If one exists — it is the authority. Proceed to Step 2 with the existing plan loaded.
If the documentation is ambiguous or incomplete, ask the user before proceeding.
2. Detect Tech Stack and Apply Role
Determine the project's tech stack and apply the appropriate engineering role:
- Read project's
AGENTS.md — look for tech stack declaration (language, framework, runtime)
- Scan project files — check
package.json, pom.xml, *.csproj, requirements.txt, go.mod, Cargo.toml, or equivalent to confirm
- Role matching — select the relevant Windsurf role guidance based on the detected stack and file ownership:
- If multiple specializations match (e.g., fullstack) — apply all relevant roles
- If no specialization role exists — fall back to base engineering principles
- Announce the detected stack and applied role(s) to the user for confirmation
Examples:
- Next.js + TypeScript →
frontend-engineer role applies
- Spring Boot →
java-engineer role applies
- Python + FastAPI →
python-engineer role applies
- Terraform / Docker / K8s →
devops-engineer role applies
- Cloud architecture / landing zones / networking / multi-cloud →
cloud-architect role applies
- GitHub Actions / CI/CD pipelines / deployment strategy →
devops-architect role applies
- React Native / Flutter / iOS / Android →
mobile-engineer role applies
- ETL / Spark / dbt / Airflow / data pipelines →
data-engineer role applies
- SQL / database schema / migrations / query optimization →
db-engineer role applies
- ARCHITECTURE.md / system design / component boundaries →
system-architect role applies
- LLM / RAG / agents / memory / multi-agent / AI pipelines →
ml-engineer role applies + consult context-engineering skill for context pipeline design
3. Analyze Codebase Context
Before writing any code, understand the existing codebase:
- Project structure — directory layout, module boundaries, entry points
- Existing patterns — naming conventions, error handling, logging, testing approach
- Dependencies — installed packages, available libraries, version constraints
- Related code — files and modules the new feature will interact with, extend, or modify
- Test infrastructure — test framework, test file locations, existing test patterns
Map how the new feature fits into the existing architecture. Identify:
- Files to create (new modules, components, tests)
- Files to modify (integration points, routes, configs)
- Files to not touch (unrelated code — minimize blast radius)
4. Resolve Implementation Plan
If a plan already exists (from documentation, PRD, ARD, or plan skill output):
- Use it as-is. Do NOT rewrite, reorder, or simplify it
- Follow it STRICTLY — step by step, in the exact order specified
- Present the loaded plan to the user for confirmation before proceeding
If no plan exists:
- Create one from scratch based on the parsed requirements and codebase analysis
When creating a plan, break the feature into ordered, atomic implementation steps:
- Number each step sequentially
- Each step = one logical unit of work (one file or one cohesive change across tightly coupled files)
- Order by dependency — implement foundations before consumers
- Interleave test steps with implementation (do not defer all tests to the end)
Present the plan to the user:
Feature: [name]
Stack: [detected] | Role: [applied]
Plan source: [loaded from <file> | created from scratch]
Steps:
1. [description] → [file(s)]
2. [description] → [file(s)]
...
N. [description] → [file(s)]
Wait for user approval before proceeding. The user may reorder, add, remove, or modify steps.
5. Implement
Execute the approved plan STRICTLY step by step. Do not skip steps, reorder steps, or combine steps.
If the plan needs correction (a step is blocked, wrong, or a new step is needed):
- STOP implementation immediately
- Explain to the user what happened and why the plan needs to change
- Propose the specific correction (add/remove/modify steps)
- Wait for user approval
- Update the plan document if one exists as a file
- Resume implementation from the corrected point
Never silently deviate from the plan. Every deviation requires explicit user approval.
For each step:
- State what you are about to do (step number, file, change summary)
- Write code following:
- Project's existing patterns and conventions
- Active role's guidelines (stack-specific best practices)
- Documentation's architecture decisions and constraints
- Verify the code compiles/parses without errors after each step
- If a step introduces a new dependency — install it immediately
Rules:
- Minimal, focused changes — do not refactor unrelated code
- Follow existing code style (indentation, naming, imports)
- Add imports at the top of files
- Production-quality code — no TODOs, no placeholders, no stubs (unless the plan explicitly calls for them)
- If you encounter an unexpected issue — stop and consult the user
6. Write Tests
For each implemented component, write tests following the project's test infrastructure:
- Unit tests — business logic, utilities, data transformations
- Integration tests — API endpoints, database queries, service interactions
- Component tests (frontend) — UI components with user interactions
- Cover both happy path and edge cases (error handling, boundary values, empty states)
- Run the tests and verify they pass
If the documentation specifies acceptance criteria, write tests that directly verify each criterion.
7. Verify
Run the full verification sequence:
- Build/compile — project builds without errors or warnings
- Lint — run the project's linter if configured
- Test — run the full test suite (new + existing) to catch regressions
- Acceptance check — review implementation against documentation's acceptance criteria
Checklist:
If any check fails — fix the issue and re-verify.
8. Summary
Present the completed work:
- Feature: what was implemented
- Stack / Role: detected tech stack and applied role(s)
- Files changed: list of created and modified files with brief descriptions
- Tests: number of tests added, pass status
- Acceptance criteria: status of each criterion (met / partially met / not met)
- Notes: deviations from original plan, trade-offs, follow-up items
Integration
- Precedes:
run-tests skill, pre-commit skill, create-pr skill
- Planning:
plan skill (produces the implementation plan this workflow executes)
- Skills:
test-strategy skill (test strategy), code-review skill (review standards), context-engineering skill (context pipelines, RAG, agent harness, production checklists — for AI/LLM features), worktree-isolation skill (branch isolation via git worktree)
1---2name: feature-dev-23description: Develop a feature from documentation (PRD, ARD, design doc, implementation plan) with automatic role detection based on project tech stack4---56# Feature Development78End-to-end feature implementation from documentation to working code. Automatically detects and applies the appropriate engineering role based on the project's tech stack.910## 1. Receive and Parse Documentation1112Gather all input documentation provided by the user:1314- **Accepted formats**: PRD, ARD (Architecture Decision Record), design doc, implementation plan, ticket/issue, or any structured feature specification15- Read every provided document thoroughly16- Extract and organize:17 - **Goal**: what the feature does (1–2 sentences)18 - **Requirements**: functional and non-functional19 - **Acceptance criteria**: how to verify the feature works20 - **Implementation plan**: ordered steps, architecture decisions, data models, API contracts21 - **Constraints**: performance, security, compatibility, dependencies22 - **Out of scope**: what this feature explicitly does NOT cover2324**Check for an existing implementation plan.** Search the documentation, linked files, and project directory for an implementation plan (file named `*plan*`, `*implementation*`, or a plan section inside the PRD/ARD). If one exists — it is the authority. Proceed to Step 2 with the existing plan loaded.2526If the documentation is ambiguous or incomplete, ask the user before proceeding.2728## 2. Detect Tech Stack and Apply Role2930Determine the project's tech stack and apply the appropriate engineering role:31321. **Read project's `AGENTS.md`** — look for tech stack declaration (language, framework, runtime)332. **Scan project files** — check `package.json`, `pom.xml`, `*.csproj`, `requirements.txt`, `go.mod`, `Cargo.toml`, or equivalent to confirm343. **Role matching** — select the relevant Windsurf role guidance based on the detected stack and file ownership:35 - If multiple specializations match (e.g., fullstack) — apply all relevant roles36 - If no specialization role exists — fall back to base engineering principles374. **Announce** the detected stack and applied role(s) to the user for confirmation3839**Examples:**40- Next.js + TypeScript → `frontend-engineer` role applies41- Spring Boot → `java-engineer` role applies42- Python + FastAPI → `python-engineer` role applies43- Terraform / Docker / K8s → `devops-engineer` role applies44- Cloud architecture / landing zones / networking / multi-cloud → `cloud-architect` role applies45- GitHub Actions / CI/CD pipelines / deployment strategy → `devops-architect` role applies46- React Native / Flutter / iOS / Android → `mobile-engineer` role applies47- ETL / Spark / dbt / Airflow / data pipelines → `data-engineer` role applies48- SQL / database schema / migrations / query optimization → `db-engineer` role applies49- ARCHITECTURE.md / system design / component boundaries → `system-architect` role applies50- LLM / RAG / agents / memory / multi-agent / AI pipelines → `ml-engineer` role applies + consult `context-engineering` skill for context pipeline design5152## 3. Analyze Codebase Context5354Before writing any code, understand the existing codebase:55561. **Project structure** — directory layout, module boundaries, entry points572. **Existing patterns** — naming conventions, error handling, logging, testing approach583. **Dependencies** — installed packages, available libraries, version constraints594. **Related code** — files and modules the new feature will interact with, extend, or modify605. **Test infrastructure** — test framework, test file locations, existing test patterns6162Map how the new feature fits into the existing architecture. Identify:63- Files to **create** (new modules, components, tests)64- Files to **modify** (integration points, routes, configs)65- Files to **not touch** (unrelated code — minimize blast radius)6667## 4. Resolve Implementation Plan6869<plan_policy>70An implementation plan is MANDATORY. Never start coding without an approved plan.7172**If a plan already exists** (from documentation, PRD, ARD, or `plan` skill output):73- Use it as-is. Do NOT rewrite, reorder, or simplify it74- Follow it STRICTLY — step by step, in the exact order specified75- Present the loaded plan to the user for confirmation before proceeding7677**If no plan exists:**78- Create one from scratch based on the parsed requirements and codebase analysis79</plan_policy>8081When creating a plan, break the feature into ordered, atomic implementation steps:82831. Number each step sequentially842. Each step = one logical unit of work (one file or one cohesive change across tightly coupled files)853. Order by dependency — implement foundations before consumers864. Interleave test steps with implementation (do not defer all tests to the end)8788Present the plan to the user:8990```91Feature: [name]92Stack: [detected] | Role: [applied]93Plan source: [loaded from <file> | created from scratch]94Steps:95 1. [description] → [file(s)]96 2. [description] → [file(s)]97 ...98 N. [description] → [file(s)]99```100101Wait for user approval before proceeding. The user may reorder, add, remove, or modify steps.102103## 5. Implement104105Execute the approved plan STRICTLY step by step. Do not skip steps, reorder steps, or combine steps.106107<plan_adherence>108**Hard rules:**109- Follow the plan in the EXACT order approved by the user110- Complete each step fully before moving to the next111- Do not add steps that are not in the plan112- Do not skip steps you consider unnecessary113- Do not silently modify the plan's intent114115**If the plan needs correction** (a step is blocked, wrong, or a new step is needed):1161. STOP implementation immediately1172. Explain to the user what happened and why the plan needs to change1183. Propose the specific correction (add/remove/modify steps)1194. Wait for user approval1205. Update the plan document if one exists as a file1216. Resume implementation from the corrected point122123Never silently deviate from the plan. Every deviation requires explicit user approval.124</plan_adherence>125126**For each step:**1271. State what you are about to do (step number, file, change summary)1282. Write code following:129 - Project's existing patterns and conventions130 - Active role's guidelines (stack-specific best practices)131 - Documentation's architecture decisions and constraints1323. Verify the code compiles/parses without errors after each step1334. If a step introduces a new dependency — install it immediately134135**Rules:**136- Minimal, focused changes — do not refactor unrelated code137- Follow existing code style (indentation, naming, imports)138- Add imports at the top of files139- Production-quality code — no TODOs, no placeholders, no stubs (unless the plan explicitly calls for them)140- If you encounter an unexpected issue — stop and consult the user141142## 6. Write Tests143144For each implemented component, write tests following the project's test infrastructure:1451461. **Unit tests** — business logic, utilities, data transformations1472. **Integration tests** — API endpoints, database queries, service interactions1483. **Component tests** (frontend) — UI components with user interactions1494. Cover both **happy path** and **edge cases** (error handling, boundary values, empty states)1505. Run the tests and verify they pass151152If the documentation specifies acceptance criteria, write tests that directly verify each criterion.153154## 7. Verify155156Run the full verification sequence:1571581. **Build/compile** — project builds without errors or warnings1592. **Lint** — run the project's linter if configured1603. **Test** — run the full test suite (new + existing) to catch regressions1614. **Acceptance check** — review implementation against documentation's acceptance criteria162163**Checklist:**164- [ ] All acceptance criteria from the documentation are met165- [ ] No new warnings or errors in build output166- [ ] All tests pass (new and existing)167- [ ] No unrelated files were modified168- [ ] Code follows project conventions and active role's guidelines169170If any check fails — fix the issue and re-verify.171172## 8. Summary173174Present the completed work:175176- **Feature**: what was implemented177- **Stack / Role**: detected tech stack and applied role(s)178- **Files changed**: list of created and modified files with brief descriptions179- **Tests**: number of tests added, pass status180- **Acceptance criteria**: status of each criterion (met / partially met / not met)181- **Notes**: deviations from original plan, trade-offs, follow-up items182183## Integration184185- **Precedes**: `run-tests` skill, `pre-commit` skill, `create-pr` skill186- **Planning**: `plan` skill (produces the implementation plan this workflow executes)187- **Skills**: `test-strategy` skill (test strategy), `code-review` skill (review standards), `context-engineering` skill (context pipelines, RAG, agent harness, production checklists — for AI/LLM features), `worktree-isolation` skill (branch isolation via git worktree)