Files
code-crispies/.wave/pipelines/plan-scope.yaml
Michael Czechowski ab6dabd542
Some checks failed
CI / ci (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
fix(ci): correct image digest separator
2026-04-30 12:20:26 +02:00

188 lines
5.8 KiB
YAML

kind: WavePipeline
metadata:
name: plan-scope
description: "Decompose an epic into well-scoped child issues"
release: true
skills:
- gh-cli
- software-design
requires:
tools:
- gh
input:
source: cli
example: "re-cinq/wave 184"
schema:
type: string
description: "GitHub repository with epic issue number (e.g. 'owner/repo 42')"
steps:
- id: fetch-epic
persona: "gitea-analyst"
model: claude-haiku
workspace:
type: worktree
branch: "{{ pipeline_id }}"
exec:
type: prompt
source: |
Input: {{ input }}
Parse the input: extract the repo (first token) and the epic issue number (second token).
Execute these steps:
1. Fetch the epic issue with full details:
{{ forge.cli_tool }} issue view <NUMBER> --repo <REPO> --json number,title,body,labels,url,comments,author,state
2. List existing open issues to check for duplicates:
{{ forge.cli_tool }} issue list --repo <REPO> --limit 50 --json number,title,labels,url
Analyze the epic:
- Determine if this is truly an epic/umbrella issue (contains multiple work items)
- Identify the key themes and work areas
- Estimate overall complexity
- Count how many sub-issues should be created (3-10)
- List existing issues to avoid creating duplicates
output_artifacts:
- name: epic_assessment
path: .wave/artifact.json
type: json
required: true
retry:
policy: none
max_attempts: 1
handover:
contract:
type: json_schema
schema_path: .wave/contracts/epic-assessment.schema.json
validate: true
must_pass: true
on_failure: retry
allow_recovery: true
recovery_level: progressive
progressive_validation: false
- id: scope-and-create
persona: "gitea-scoper"
dependencies: [fetch-epic]
memory:
inject_artifacts:
- step: fetch-epic
artifact: epic_assessment
as: assessment
workspace:
type: worktree
branch: "{{ pipeline_id }}"
exec:
type: prompt
source: |
The assessment artifact contains the epic analysis. Use it to create well-scoped child issues.
Input: {{ input }}
Parse the repo from the input (first token).
For each planned sub-issue, write the body to a temp file and create the issue safely:
cat > /tmp/issue-body.md <<'ISSUE_EOF'
<body content here>
ISSUE_EOF
{{ forge.cli_tool }} issue create --repo <REPO> --title '<title>' --body-file /tmp/issue-body.md --label "<labels>"
Each sub-issue body MUST include:
- A "Parent: #<epic_number>" reference line
- A clear Summary section
- Acceptance Criteria as a checkbox list
- Dependencies on other sub-issues if applicable
- Scope Notes for what is explicitly excluded
After creating all issues, capture each issue's number and URL from the creation output.
Record the results with fields: parent_issue (number, url, repository),
created_issues (array of number, title, url, labels, success, complexity, dependencies),
total_created, total_failed.
output_artifacts:
- name: scope_plan
path: .wave/artifact.json
type: json
required: true
outcomes:
- type: issue
extract_from: .wave/artifact.json
json_path: .created_issues[*].url
label: "First Sub-Issue"
retry:
policy: none
max_attempts: 1
handover:
contract:
type: json_schema
schema_path: .wave/contracts/scope-plan.schema.json
validate: true
must_pass: true
on_failure: retry
allow_recovery: true
recovery_level: progressive
progressive_validation: false
- id: verify-report
persona: "gitea-analyst"
dependencies: [scope-and-create]
memory:
inject_artifacts:
- step: scope-and-create
artifact: scope_plan
as: results
- step: fetch-epic
artifact: epic_assessment
as: assessment
workspace:
type: worktree
branch: "{{ pipeline_id }}"
exec:
type: prompt
source: |
Verify the created sub-issues and compile a verification report.
Input: {{ input }}
Parse the repo (first token) and epic number (second token).
Step 1: For each created issue in the results, verify it exists:
{{ forge.cli_tool }} issue view <N> --repo <REPO> --json number,title,body,labels
Check that each issue:
- Exists and is open
- Has acceptance criteria in the body
- References the parent epic
Step 2: This step is READ-ONLY. Do NOT post comments -- the github-analyst
persona does not have write permissions. Instead, include a pre-rendered markdown
summary in the output JSON that a commenter persona could post later.
Create a markdown summary with a checklist of all sub-issues (- [ ] #<number> <title>).
Step 3: Compile the verification report with fields:
parent_issue (number, url), verified_issues (array of number, title, url, exists,
has_acceptance_criteria, references_parent), summary (total_verified, total_valid,
total_issues_created, comment_posted, comment_url).
output_artifacts:
- name: scope_report
path: .wave/artifact.json
type: json
required: true
retry:
policy: none
max_attempts: 1
handover:
contract:
type: json_schema
schema_path: .wave/contracts/scope-report.schema.json
validate: true
must_pass: true
on_failure: retry
allow_recovery: true
recovery_level: progressive
progressive_validation: false