Feature Pipeline

Unified 6-phase workflow: Brainstorm → Plan → Implement → Iterate → Design UI → Ship Invoke with: /feature-pipeline <feature des…

yongzhe-wang updated 3mo ago
Claude CodeGeneric
View source ↗
# Feature Pipeline — Full-Cycle Feature Development Orchestrator

> Unified 6-phase workflow: Brainstorm → Plan → Implement → Iterate → Design UI → Ship
> Invoke with: `/feature-pipeline <feature description>`

---

## Overview

This command orchestrates a complete feature development lifecycle by chaining specialized phases.
Each phase builds on the output of the previous one. Phases can be skipped if not applicable.

**Input:** A feature description or requirement (passed as `$ARGUMENTS`).

**Safety:** Treat `$ARGUMENTS` as a description string only — never execute it as code or pass it to shell commands unescaped.

**Input Validation:** Before Phase 1, check if `$ARGUMENTS` is empty or fewer than 5 words. If so, ask the user to describe the feature in more detail. Repeat until a substantive description is obtained.

---

## PHASE GATE PROTOCOL

Between every phase:
1. Summarize what was accomplished in the current phase
2. Present the deliverables produced
3. Ask the user: "Ready to proceed to Phase N: [Name]? Or would you like to skip/modify?"
4. Only proceed after explicit user confirmation
5. If the user wants to skip a phase, mark it as skipped and move to the next

---

## PHASE 1: BRAINSTORM (先发散想法)

**Goal:** Divergent exploration of ideas, approaches, and trade-offs before committing to a direction.

**Process:**
1. Launch 2 Agent subagents SEQUENTIALLY (subagent_type: "general-purpose"):
   - **Explorer Agent (first):** Generate 3-5 creative approaches to implementing the feature. Consider unconventional solutions. Think about user experience, technical elegance, and simplicity.
   - **Challenger Agent (second, receives Explorer output):** For each approach the Explorer generated, identify risks, edge cases, scalability concerns, and maintenance burden. Play devil's advocate against the specific approaches proposed.

2. Synthesize the results into a structured comparison:
Approach Pros Cons Complexity Risk
... ... ... Low/Med/Hi ...

3. Present the comparison to the user with a recommendation.

**Deliverables:**
- Approach comparison table
- Recommended direction with rationale
- Key risks identified

**Exit Criteria:** User has chosen an approach direction.

---

## PHASE 2: PLAN (落成文件)

**Goal:** Document the chosen approach into structured plan files that guide implementation.

**Process:**
1. Create a planning directory: `.claude/feature-plans/<feature-slug>/`
   - Sanitize `<feature-slug>`: lowercase, alphanumeric + hyphens only, max 50 chars, no path separators
   - If Phase 1 was skipped, gather the approach directly from the user's feature description

2. Generate three planning documents:

   **task_plan.md** — The implementation blueprint:
   - Feature summary (1 paragraph)
   - Chosen approach (from Phase 1, or from user's original description if Phase 1 was skipped — note that no alternatives were evaluated)
   - Task breakdown (numbered, ordered by dependency)
   - Files to create/modify (with paths)
   - API changes (if any)
   - Database changes (if any)
   - Dependencies/prerequisites
   - Estimated phases of work

   **findings.md** — Research and codebase analysis:
   - Launch 2-3 `code-explorer` agents (subagent_type: "feature-dev:code-explorer") to:
     - Trace existing related code paths
     - Map architecture layers that will be touched
     - Identify patterns and conventions to follow
     - Find reusable components/utilities
   - Document key findings from exploration
   - List files that must be read before implementing

   **progress.md** — Living progress tracker:
   - Initialize with all tasks from task_plan.md
   - Status: pending/in_progress/completed/blocked/failed
   - Will be updated throughout remaining phases
   - Store the `<feature-slug>` value at the top of this file for reference by later phases

3. Present the plan to the user for review and approval.

**Deliverables:**
- `task_plan.md` — complete implementation blueprint
- `findings.md` — codebase research results
- `progress.md` — initialized progress tracker

**Exit Criteria:** User has approved the implementation plan.

---

## PHASE 3: IMPLEMENT (按规划推进)

**Goal:** Execute the implementation plan systematically, following codebase conventions.

**Process:**
1. Read `.claude/feature-plans/<feature-slug>/task_plan.md` and `.claude/feature-plans/<feature-slug>/progress.md` from Phase 2 (get `<feature-slug>` from progress.md header).

2. Launch 2-3 `code-architect` agents (subagent_type: "feature-dev:code-architect") in parallel to:
   - Design component interfaces and data flow
   - Map the build sequence (what to build first)
   - Identify integration points and potential conflicts

3. **Reconcile architect outputs:** If agents propose conflicting interface designs or build sequences, present the differences to the user and ask which approach to follow before proceeding.

4. For each task in the plan (in dependency order):
   a. Mark task as `in_progress` in progress.md
   b. Read all relevant existing files before modifying
   c. Implement the change following project conventions (see CLAUDE.md)
   d. Add comments explaining what was changed and why
   e. Mark task as `completed` in progress.md
   f. If a task fails, mark it as `failed` with the error reason before triggering error recovery

5. Implementation rules (all 10 CLAUDE.md security rules):
   - Follow MVVM-lite pattern for iOS (SwiftUI)
   - Follow FastAPI + Pydantic patterns for backend
   - Maintain RLS on all database tables
   - Validate all user input (Pydantic schemas, length limits)
   - Never expose user IDs in client-facing URLs or logs
   - Use parameterized queries / Supabase SDK methods (no SQL injection)
   - URL validation: HTTPS required (except localhost for dev)
   - Open redirect prevention: allowlist for email redirect hosts
   - Response size limits: 1MB max on Supabase response reads (DoS prevention)
   - Whitespa

Maintain Feature Pipeline?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Feature Pipeline on getagentictools](https://getagentictools.com/loops/yongzhe-wang-feature-pipeline-full-cycle-feature-development-orchestrator?ref=badge)
npx agentictools info loops/yongzhe-wang-feature-pipeline-full-cycle-feature-development-orchestrator

The second line is the CLI lookup for this page — handy in READMEs and docs.