valent-pipeline 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valent-pipeline",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: v3-setup-backlog
3
+ description: 'Convert epics and stories into pipeline-ready backlog and story input files. Use when the user says "setup backlog", "import stories", "v3 setup", "prepare stories", or provides an epics/stories document to load into the pipeline.'
4
+ argument-hint: '<path-to-epics-file or epic-id>'
5
+ ---
6
+
7
+ # v3 Backlog Setup
8
+
9
+ Convert an epics and stories document (any format — markdown, YAML, PRD extract, or pasted text) into the two things the pipeline needs:
10
+
11
+ 1. **`pipeline-backlog.yaml`** — ordered priority queue of stories with dependencies
12
+ 2. **`stories/{story-id}/story.md`** — individual story input files with ACs in Given-When-Then format
13
+
14
+ ## Step 1: Find the Source
15
+
16
+ Check what the user provided:
17
+ - If they gave a file path, read it
18
+ - If they pasted text, use it directly
19
+ - If they gave an epic ID, ask where the epics/stories document is
20
+
21
+ The source can be in any format — a PRD, a BMAD epics file, a Jira export, a markdown list, a spreadsheet paste, etc. Your job is to extract stories from whatever they give you.
22
+
23
+ ## Step 2: Read Pipeline Config
24
+
25
+ Read `v3/pipeline-config.yaml` to get:
26
+ - `project.story_directory` — where to create story folders (default: `./stories`)
27
+ - `project.backlog_path` — where to write the backlog (default: `./pipeline-backlog.yaml`)
28
+ - `project.type` — affects which testing profiles are relevant
29
+
30
+ ## Step 3: Extract Stories
31
+
32
+ From the source document, identify each story and extract:
33
+
34
+ | Field | Required | Source |
35
+ |---|---|---|
36
+ | Story ID | Yes | Use existing IDs if present, or generate `{EPIC-PREFIX}-{NNN}` pattern |
37
+ | Epic | Yes | The epic this story belongs to |
38
+ | Title | Yes | One-line summary |
39
+ | User story | Yes | "As a [role] I want [capability] so that [benefit]" |
40
+ | Acceptance criteria | Yes | Testable conditions — convert to Given-When-Then if not already |
41
+ | Priority | Yes | Integer, lower = higher. Derive from epic order + story order within epic |
42
+ | Dependencies | No | Which stories must ship before this one can start (`depends_on`) |
43
+ | Optional inputs | No | UX spec, architecture notes, scenario outlines if mentioned |
44
+
45
+ **Priority assignment:** First story in first epic = 1, second story = 2, etc. Stories within the same epic are ordered by their natural sequence. Cross-epic dependencies use `depends_on`.
46
+
47
+ **Dependency detection:** Look for:
48
+ - Explicit "depends on" or "requires" references
49
+ - Implicit: "API endpoint" stories should ship before "UI that calls the API" stories
50
+ - Schema/migration stories should ship before stories that use those tables
51
+ - Ask the user to confirm any inferred dependencies
52
+
53
+ ## Step 4: Present Summary for Approval
54
+
55
+ Before writing any files, show the user:
56
+
57
+ ```
58
+ Epic: {EPIC-NAME}
59
+ {STORY-ID}: {title} [priority: {N}] {depends_on if any}
60
+ {STORY-ID}: {title} [priority: {N}]
61
+ ...
62
+
63
+ Epic: {EPIC-NAME}
64
+ ...
65
+
66
+ Total: {N} stories across {M} epics
67
+ Dependencies: {list any depends_on relationships}
68
+ ```
69
+
70
+ Ask: "Does this look right? Any stories to add, remove, reorder, or re-prioritize?"
71
+
72
+ ## Step 5: Write Backlog
73
+
74
+ Write `{backlog_path}` (default: `pipeline-backlog.yaml`):
75
+
76
+ ```yaml
77
+ # Pipeline Backlog
78
+ # Generated by v3-setup-backlog from {source document name}
79
+ # Priority: lower number = higher priority
80
+
81
+ items:
82
+ - id: "KANBAN-001"
83
+ type: story
84
+ status: pending
85
+ priority: 1
86
+ epic: "KANBAN-MVP"
87
+ title: "Create a new card via the API"
88
+ depends_on: []
89
+
90
+ - id: "KANBAN-002"
91
+ type: story
92
+ status: pending
93
+ priority: 2
94
+ epic: "KANBAN-MVP"
95
+ title: "Fetch all cards grouped by status"
96
+ depends_on: ["KANBAN-001"]
97
+
98
+ # ... more stories
99
+ ```
100
+
101
+ ## Step 6: Write Story Input Files
102
+
103
+ For each story, create `{story_directory}/{story-id}/story.md`:
104
+
105
+ ```markdown
106
+ # {Story Title}
107
+
108
+ ## User Story
109
+
110
+ As a {role} I want {capability} so that {benefit}.
111
+
112
+ ## Acceptance Criteria
113
+
114
+ ### AC-1: {short name}
115
+ **Given** {precondition}
116
+ **When** {action}
117
+ **Then** {expected outcome}
118
+
119
+ ### AC-2: {short name}
120
+ **Given** {precondition}
121
+ **When** {action}
122
+ **Then** {expected outcome}
123
+
124
+ {additional ACs...}
125
+
126
+ ## Notes
127
+
128
+ {Any architecture notes, UX references, or constraints from the source document}
129
+ ```
130
+
131
+ **AC formatting rules:**
132
+ - Each AC gets an ID (`AC-1`, `AC-2`, ...) — the pipeline references these throughout
133
+ - Convert bullet-point ACs to Given-When-Then format
134
+ - Keep them testable — every AC must be verifiable by automated tests
135
+ - If an AC is vague ("the UI should look good"), flag it and ask the user to clarify or remove it
136
+ - Include error/edge cases as separate ACs, not just happy paths
137
+
138
+ ## Step 7: Initialize Knowledge Base
139
+
140
+ Scan the repo to build the curated knowledge files that the Knowledge Agent uses at runtime. Write these to `knowledge/curated/`:
141
+
142
+ ### `project-context.md`
143
+ Scan the repo and generate:
144
+ - Project name and purpose (from README, package.json, or ask the user)
145
+ - Directory layout (top-level structure)
146
+ - Tech stack (from `v3/pipeline-config.yaml` + detected from package.json, tsconfig, etc.)
147
+ - Database schema (from Prisma schema, migrations, or SQL files if present)
148
+ - Existing API endpoints (from route files if present)
149
+ - Environment setup (from docker-compose, Dockerfile, .env.example if present)
150
+
151
+ ### `code-conventions.md`
152
+ Scan existing source code and extract:
153
+ - Import patterns (ESM vs CJS, path aliases)
154
+ - Naming conventions (camelCase, snake_case, file naming)
155
+ - Project structure patterns (routes, services, controllers, etc.)
156
+ - Test file organization and patterns
157
+ - Error handling patterns
158
+ - Any linting config (.eslintrc, .prettierrc, biome.json)
159
+
160
+ ### `api-reference.md` (if API endpoints exist)
161
+ Scan route files and generate:
162
+ - Method, path, request/response shapes
163
+ - Validation rules
164
+ - Auth requirements
165
+ - Status codes
166
+
167
+ If the repo is empty or brand new (no source code yet), create minimal placeholder files noting "No existing code detected — Knowledge Agent will update these as stories ship."
168
+
169
+ ## Step 8: Report
170
+
171
+ After writing all files, summarize:
172
+
173
+ ```
174
+ Created:
175
+ - {backlog_path} ({N} stories)
176
+ - {N} story input files in {story_directory}/
177
+ - knowledge/curated/project-context.md
178
+ - knowledge/curated/code-conventions.md
179
+ - knowledge/curated/api-reference.md (if applicable)
180
+
181
+ Next steps:
182
+ - Review story files and refine ACs if needed
183
+ - Review knowledge/curated/ files for accuracy
184
+ - Run /v3-run-story {first-story-id} to start
185
+ - Or run /v3-run-epic {epic-id} to run the whole epic
186
+ ```
187
+
188
+ ## Rules
189
+
190
+ - **Always ask for confirmation** before writing files (Step 4)
191
+ - **Preserve the user's story IDs** if they exist — don't rename them
192
+ - **Flag ambiguous ACs** — better to ask than to generate untestable criteria
193
+ - **Don't invent stories** — only create what's in the source document
194
+ - **Don't modify existing backlog entries** — if `pipeline-backlog.yaml` already has items, append new ones after the existing highest priority number