Files
librenotes/.wave/pipelines/feature.yaml
Michael Czechowski fc24f9a8ab Add Wave general-purpose pipelines
ADR, changelog, code-review, debug, doc-sync, explain, feature,
hotfix, improve, onboard, plan, prototype, refactor, security-scan,
smoke-test, speckit-flow, supervise, test-gen, and more.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:02:36 +01:00

202 lines
5.6 KiB
YAML

kind: WavePipeline
metadata:
name: feature
description: "Plan, implement, test, and commit a feature to a new branch"
release: false
input:
source: cli
example: "add a --dry-run flag to the run command"
steps:
- id: explore
persona: navigator
workspace:
mount:
- source: ./
target: /project
mode: readonly
exec:
type: prompt
source: |
Explore the codebase to plan this feature: {{ input }}
## Exploration
1. **Understand the request**: What is being asked? Assess scope
(small = 1-2 files, medium = 3-7, large = 8+).
2. **Find related code**: Use Glob and Grep to find files related
to the feature. Note paths, relevance, and key symbols.
3. **Identify patterns**: Read key files. Document conventions that
must be followed (naming, error handling, testing patterns).
4. **Map affected modules**: Which packages are directly/indirectly affected?
5. **Survey tests**: Find related test files, testing patterns, gaps.
6. **Assess risks**: Breaking changes, performance, security implications.
Produce a structured JSON result matching the contract schema.
output_artifacts:
- name: exploration
path: .wave/output/exploration.json
type: json
handover:
contract:
type: json_schema
source: .wave/output/exploration.json
schema_path: .wave/contracts/feature-exploration.schema.json
on_failure: retry
max_retries: 2
- id: plan
persona: planner
dependencies: [explore]
memory:
inject_artifacts:
- step: explore
artifact: exploration
as: context
workspace:
mount:
- source: ./
target: /project
mode: readonly
exec:
type: prompt
source: |
Create an implementation plan for this feature.
Feature: {{ input }}
The codebase exploration has been injected into your workspace. Read it first.
Break the feature into ordered implementation steps:
1. For each step: what to do, which files to modify, acceptance criteria
2. Dependencies between steps
3. What tests to write
4. Complexity estimate per step (S/M/L)
Produce a structured JSON result matching the contract schema.
output_artifacts:
- name: plan
path: .wave/output/plan.json
type: json
handover:
contract:
type: json_schema
source: .wave/output/plan.json
schema_path: .wave/contracts/feature-plan.schema.json
on_failure: retry
max_retries: 2
- id: implement
persona: craftsman
dependencies: [plan]
memory:
inject_artifacts:
- step: explore
artifact: exploration
as: context
- step: plan
artifact: plan
as: plan
workspace:
type: worktree
branch: "feat/{{ pipeline_id }}"
exec:
type: prompt
source: |
Implement the feature on this isolated worktree branch.
The codebase exploration and implementation plan have been injected into your
workspace. Read them both before starting.
Feature: {{ input }}
## Process
1. **Implement step by step** following the plan:
- Follow existing codebase patterns identified in exploration
- Write tests alongside implementation
- After each significant change, verify it compiles: `go build ./...`
2. **Run full test suite**:
```bash
go test ./... -count=1
```
Fix any failures before proceeding.
3. **Commit**:
```bash
git add <specific-files>
git commit -m "<commit_message_suggestion from plan>
Implementation following plan:
- S01: <title>
- S02: <title>
..."
```
Commit changes to the worktree branch.
handover:
contract:
type: test_suite
command: "{{ project.test_command }}"
must_pass: true
on_failure: retry
max_retries: 3
output_artifacts:
- name: result
path: .wave/output/result.md
type: markdown
# ── Publish ─────────────────────────────────────────────────────────
- id: publish
persona: craftsman
dependencies: [implement]
memory:
inject_artifacts:
- step: implement
artifact: result
as: result
workspace:
type: worktree
branch: "feat/{{ pipeline_id }}"
exec:
type: prompt
source: |
PUBLISH — push the branch and create a pull request.
## Steps
1. Push the branch:
```bash
git push -u origin HEAD
```
2. Create a pull request using the implementation result as context:
```bash
gh pr create --title "feat: $(git log --format=%s -1)" --body-file .wave/artifacts/result
```
output_artifacts:
- name: pr-result
path: .wave/output/pr-result.json
type: json
handover:
contract:
type: json_schema
source: .wave/output/pr-result.json
schema_path: .wave/contracts/pr-result.schema.json
must_pass: true
on_failure: retry
max_retries: 2
outcomes:
- type: pr
extract_from: .wave/output/pr-result.json
json_path: .pr_url
label: "Pull Request"