@houseofwolvesllc/claude-scrum-skill 1.5.1 → 1.7.0

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.
@@ -9,10 +9,17 @@ Scaffold a complete GitHub Project from one or more PRD or spec documents, or ad
9
9
 
10
10
  ## Before You Start
11
11
 
12
- 1. Read `references/CONVENTIONS.md` in this skill's directory for all project management standards including label taxonomy, branch strategy, issue templates, custom fields, and executor assignment guidelines. Follow these conventions exactly.
13
- 2. **Terminology:** Always refer to milestones as **"epics"** in all user-facing text, summaries, and conversational output. The word "milestone" should only appear in GitHub API commands and code never in communication with the user.
14
- 3. Confirm the `gh` CLI is authenticated by running `gh auth status`.
15
- 4. Identify the target repository. If the user doesn't specify, ask which repo to use.
12
+ 1. Read `../shared/references/CONVENTIONS.md` for all project management standards including label taxonomy, branch strategy, issue templates, custom fields, and executor assignment guidelines. Follow these conventions exactly.
13
+ 2. Read `../shared/config.json` to determine the scaffolding mode (`scaffolding` key: `"local"`, `"github"`, `"jira"`, or `"trello"`, default: `"local"`). If `"local"`, also read the `paths.backlog` value (default: `.claude-scrum-skill/backlog`). Also read these scaffolding-control keys (fall back to defaults silently if missing):
14
+ - `scaffold.two_pass_threshold_words` (default `5000`) PRD word count above which two-pass mode auto-triggers. See Mode Detection.
15
+ - `scaffold.design_spike_enabled` (default `true`) global enable switch for the design-spike pre-epic. See Design-Spike Epic.
16
+ - `paths.context` (default `.claude-scrum-skill/context`) — where per-epic CONTEXT.md files written by the design-spike epic live.
17
+ 3. Read `../shared/references/PROVIDERS.md` for provider-specific API commands when operating in remote mode (GitHub, Jira, or Trello).
18
+ 4. **Terminology:** Always refer to milestones as **"epics"** in all user-facing text, summaries, and conversational output. The word "milestone" should only appear in API commands and code — never in communication with the user.
19
+ 5. **If `scaffolding: "github"`:** Confirm the `gh` CLI is authenticated by running `gh auth status`. Identify the target repository. If the user doesn't specify, ask which repo to use.
20
+ 6. **If `scaffolding: "jira"`:** Verify `JIRA_SITE`, `JIRA_EMAIL`, and `JIRA_API_TOKEN` environment variables are set. Read `jira.project_key` from config.json. Verify auth per PROVIDERS.md.
21
+ 7. **If `scaffolding: "trello"`:** Verify `TRELLO_API_KEY` and `TRELLO_TOKEN` environment variables are set. Read `trello.board_id` from config.json. Verify auth per PROVIDERS.md.
22
+ 8. **If `scaffolding: "local"`:** Skip authentication. No external service required — the backlog is file-based.
16
23
 
17
24
  ## Input
18
25
 
@@ -20,8 +27,697 @@ The user provides `$ARGUMENTS` which should be one or more file paths to PRD or
20
27
 
21
28
  Read all provided documents thoroughly before proceeding.
22
29
 
30
+ ### PRD Frontmatter Overrides
31
+
32
+ PRD authors can preempt the auto-detected scaffolding behavior via YAML
33
+ frontmatter at the top of the PRD document:
34
+
35
+ ```yaml
36
+ ---
37
+ title: My Project
38
+ scaffold_mode: two-pass # force two-pass even for a small PRD
39
+ design_spike: false # suppress the design-spike epic even when triggered
40
+ ---
41
+ ```
42
+
43
+ Allowed values:
44
+
45
+ - `scaffold_mode`: `single-pass` | `two-pass` (omit to use the word-count
46
+ heuristic in Mode Detection)
47
+ - `design_spike`: `true` | `false` (omit to use the auto-injection rules
48
+ in Design-Spike Epic)
49
+
50
+ ### CLI Flags
51
+
52
+ Equivalent flags can be passed alongside the PRD path:
53
+
54
+ - `--mode single-pass` / `--mode two-pass` — overrides any frontmatter or
55
+ word-count heuristic for the scaffolding mode.
56
+ - `--design-spike` / `--no-design-spike` — overrides any frontmatter or
57
+ auto-injection rule for the design-spike epic.
58
+
59
+ There is no formal CLI argument parser — Claude Code skills receive a
60
+ single free-text `$ARGUMENTS` string. The executing agent scans
61
+ `$ARGUMENTS` for these flag strings (exact match) and treats each
62
+ recognized flag as a trigger source at the precedence noted below.
63
+ Invalid or empty flag values (e.g., `--mode` with no value, or
64
+ `--mode three-pass`) are ignored, and the next trigger source in
65
+ precedence applies.
66
+
67
+ Trigger precedence (highest first): CLI flag → PRD frontmatter → config /
68
+ heuristic. Whatever wins is announced before scaffolding begins so the
69
+ user understands why a given path was taken.
70
+
71
+ ## Mode Detection
72
+
73
+ Before invoking any per-backend procedure, decide whether to run scaffolding
74
+ in **single-pass** mode (the original behavior — one agent reads the whole
75
+ PRD and produces all epics + stories) or **two-pass** mode (skeleton
76
+ extraction followed by per-epic elaboration subagents). Two-pass mode keeps
77
+ per-epic context tight on large PRDs, so the last epic's stories are as
78
+ well-specified as the first.
79
+
80
+ ### Trigger Evaluation (in order, first match wins)
81
+
82
+ 1. **CLI flag:**
83
+ - `--mode single-pass` → force single-pass
84
+ - `--mode two-pass` → force two-pass
85
+ 2. **PRD frontmatter override:**
86
+ - `scaffold_mode: single-pass` → force single-pass
87
+ - `scaffold_mode: two-pass` → force two-pass
88
+ 3. **Word count heuristic:**
89
+ - Count words in the PRD body (whitespace-delimited; exclude frontmatter).
90
+ - Read `scaffold.two_pass_threshold_words` from `../shared/config.json`
91
+ (default `5000`; if the key is missing, use the default silently).
92
+ - If word count exceeds the threshold → two-pass.
93
+ - Otherwise → single-pass.
94
+
95
+ ### Announce the Decision
96
+
97
+ Before proceeding to any procedure, announce the mode and the trigger
98
+ reason so the user understands why the heuristic chose what it chose:
99
+
100
+ ```
101
+ PRD analysis:
102
+ Word count: 8,420 (threshold: 5000) → triggering two-pass mode
103
+
104
+ Pass 1: extracting epic skeleton...
105
+ ```
106
+
107
+ If an override forced the decision, mention that explicitly:
108
+
109
+ ```
110
+ PRD analysis:
111
+ Frontmatter override: scaffold_mode: single-pass → forcing single-pass
112
+ ```
113
+
114
+ ### Routing
115
+
116
+ - **Single-pass** → continue to the per-backend procedure (Local / Jira /
117
+ Trello / GitHub) and run its existing Parse the PRD step against the
118
+ whole PRD.
119
+ - **Two-pass** → run the Two-Pass Procedure (below) first, then continue
120
+ to the per-backend procedure with the assembled story list.
121
+
122
+ ## Two-Pass Procedure
123
+
124
+ When Mode Detection selects two-pass, run this procedure before the
125
+ per-backend creation steps. The output is the same shape as a single-pass
126
+ parse would produce: an assembled list of epics + their stories, ready for
127
+ the backend to create issues/files. Backends consume the same shape, so the
128
+ per-backend creation logic does not change.
129
+
130
+ ### Pass 1 — Skeleton Extraction
131
+
132
+ A single agent reads the whole PRD and produces a structured manifest. The
133
+ manifest is held in orchestrator context — it is NOT persisted to disk.
134
+
135
+ **Manifest shape (YAML):**
136
+
137
+ ```yaml
138
+ project:
139
+ name: <string>
140
+ description: <string>
141
+ global_preamble: |
142
+ <multi-line markdown excerpt — project overview, glossary,
143
+ cross-cutting non-functional requirements that every epic should know>
144
+ non_functional_requirements: [<string>]
145
+ epics:
146
+ - name: <string>
147
+ slug: <kebab-case string>
148
+ description: <one-paragraph string>
149
+ slice:
150
+ start_line: <int>
151
+ end_line: <int>
152
+ depends_on: [<epic-slug>]
153
+ shared_design_concerns:
154
+ - <string describing naming/layout/type/pattern this epic introduces
155
+ that other epics may consume>
156
+ ```
157
+
158
+ Pass 1 produces NO story-level detail. Its job is structural — identify
159
+ epic boundaries, capture inter-epic dependencies, and extract the shared
160
+ global context that every Pass 2 subagent will need. The
161
+ `shared_design_concerns` list feeds the Design-Spike Epic procedure when
162
+ that is triggered.
163
+
164
+ ### Auto-Downgrade
165
+
166
+ After Pass 1 completes, evaluate the epic count:
167
+
168
+ - **≤ 2 epics** → downgrade to single-pass elaboration: spawn one Pass 2
169
+ subagent that handles all epics together. The two-pass overhead is not
170
+ justified at this scale, and inter-epic coordination is easier in a
171
+ single context. Announce the downgrade.
172
+ - **> 2 epics** → proceed to per-epic Pass 2 spawning.
173
+
174
+ ### Pass 2 — Per-Epic Elaboration
175
+
176
+ Spawn one subagent per epic. Each subagent receives a focused context:
177
+
178
+ - The **global preamble** from Pass 1 (project overview, glossary, NFRs)
179
+ - Its **assigned epic's PRD slice**, extracted using `slice.start_line`
180
+ and `slice.end_line` from the manifest
181
+ - A **skeleton summary** of sibling epics (name, slug, one-paragraph
182
+ description, dependencies) — for cross-epic dependency awareness, NOT
183
+ for elaboration
184
+
185
+ Each Pass 2 subagent produces the complete story list for its epic:
186
+
187
+ - Story titles
188
+ - Acceptance criteria
189
+ - Technical context
190
+ - Story points (per CONVENTIONS.md guidelines)
191
+ - Executor assignment (per CONVENTIONS.md guidelines)
192
+ - Persona designation (local mode: the `persona` frontmatter field; GitHub/Jira/Trello modes: a `persona:*` label — see CONVENTIONS.md "Persona Labels" and PERSONAS.md for the canonical set)
193
+ - Dependency declarations (`blocked_by`, `blocks`)
194
+ - All other required frontmatter fields
195
+
196
+ **Concurrency cap:** Up to 3 Pass 2 subagents in parallel (matches
197
+ `/project-orchestrate` Step 3 convention). Additional epics queue and
198
+ start as earlier ones complete.
199
+
200
+ ### Story Assembly
201
+
202
+ After all Pass 2 subagents return, assemble their outputs into a single
203
+ backlog before handing off to the per-backend creation logic:
204
+
205
+ 1. **Collect** every story from every Pass 2 output, preserving each
206
+ story's epic association.
207
+ 2. **Detect slug collisions** by exact string match across all stories.
208
+ If two or more stories share a slug, rename all-but-the-first by
209
+ prepending the epic slug: `<epic-slug>-<original-slug>`. Log every
210
+ rename so the user sees the resolution.
211
+ 3. **Resolve cross-epic dependencies** declared in story `blocked_by`
212
+ and `blocks` fields. If a dependency references a slug that was
213
+ renamed in step 2, update the reference.
214
+ 4. **Emit the assembled list** in the same shape a single-pass parse
215
+ would have produced. The per-backend creation logic consumes this
216
+ shape unchanged.
217
+
218
+ ### Failure Handling
219
+
220
+ Scaffolding must degrade gracefully — it must never abort on a Pass 1 or
221
+ Pass 2 failure.
222
+
223
+ **Pass 1 failure:**
224
+
225
+ 1. Retry once with identical input.
226
+ 2. If the second attempt fails, log the failure and fall back to
227
+ single-pass scaffolding: run the per-backend procedure's Parse the PRD
228
+ step against the whole PRD as if two-pass had never been triggered.
229
+ 3. Announce the fallback clearly:
230
+
231
+ ```
232
+ Pass 1 failed twice; falling back to single-pass scaffolding for this PRD.
233
+ ```
234
+
235
+ **Pass 2 subagent failure:**
236
+
237
+ 1. Retry the failed subagent once with the original prompt plus the failure
238
+ context appended.
239
+ 2. If the second attempt fails, do NOT abort the whole scaffold:
240
+ - Write the affected epic's epic-level metadata (`_epic.md` in local
241
+ mode, milestone in remote modes) using the Pass 1 skeleton data.
242
+ - Generate placeholder stories for the affected epic with
243
+ `status: needs-context` and a note explaining the Pass 2 failure.
244
+ Use the existing `needs-context` status signal label from
245
+ CONVENTIONS.md.
246
+ - Sibling Pass 2 subagents continue unaffected.
247
+ 3. Surface every retry attempt and final outcome (success / fallback /
248
+ needs-context) in the skill's user-facing output so the user knows what
249
+ landed cleanly versus what needs hand-completion.
250
+
251
+ ## Design-Spike Epic
252
+
253
+ A **design-spike epic** is a research-driven pre-epic that produces written
254
+ design artifacts (an ADR + per-implementation-epic CONTEXT.md files) before
255
+ any implementation work begins. It auto-injects at position 0 of the
256
+ scaffold when triggered, giving every subsequent implementation subagent a
257
+ shared anchor for naming, file layout, types, and patterns. See
258
+ CONVENTIONS.md → Epic Structure → Design-Spike Epic for the broader rationale.
259
+
260
+ ### Trigger Evaluation (in order, first match wins)
261
+
262
+ 1. **CLI flag:**
263
+ - `--no-design-spike` → suppress.
264
+ - `--design-spike` → force.
265
+ 2. **PRD frontmatter override:**
266
+ - `design_spike: false` → suppress the design-spike epic.
267
+ - `design_spike: true` → force it.
268
+ 3. **Global enable switch:**
269
+ - Read `scaffold.design_spike_enabled` from `../shared/config.json`
270
+ (default `true`; missing key falls back to default silently).
271
+ - If `false` globally, skip the design-spike regardless of remaining
272
+ signals (the CLI flag and frontmatter overrides above already won
273
+ before reaching this rule if either was set).
274
+ 4. **Auto-trigger:**
275
+ - Two-pass mode was selected AND Pass 1 produced more than one
276
+ implementation epic → auto-inject.
277
+
278
+ If none of the above fire, skip the design-spike epic.
279
+
280
+ ### Idempotency Check
281
+
282
+ Before injecting, check whether a design-spike epic already exists in the
283
+ target project. Detection is by canonical signal (label/field), not by
284
+ title — the title is configurable but the signal is fixed.
285
+
286
+ - **Local mode:** Scan `<paths.backlog>/*/[_]epic.md` frontmatter for
287
+ `epic_type: design-spike`.
288
+ - **GitHub mode:** Query open milestones whose issues carry the
289
+ `type:design-spike` label.
290
+ - **Jira mode:** Query Epic-type issues labeled `type:design-spike`.
291
+ - **Trello mode:** Query lists whose cards carry the `type:design-spike`
292
+ label.
293
+
294
+ If an existing design-spike epic is found, skip injection and reuse it
295
+ for `blocked_by` references on the new implementation stories.
296
+
297
+ ### Skeleton Augmentation
298
+
299
+ When the design-spike epic is to be injected, modify the skeleton produced
300
+ by Pass 1 (or, in single-pass mode, the parsed epic list) before per-epic
301
+ elaboration runs:
302
+
303
+ 1. **Prepend a new epic at position 0** with:
304
+ - Default title: `Architecture & Design` (overridable; not load-bearing).
305
+ - Detection signal: label `type:design-spike` (remote backends) and
306
+ `epic_type: design-spike` in `_epic.md` frontmatter (local mode).
307
+ - Description sourced from the project description + the union of all
308
+ implementation epics' `shared_design_concerns` (from the Pass 1
309
+ manifest).
310
+ 2. **Generate the design-spike stories** to be elaborated by a Pass 2
311
+ subagent with `persona: research`:
312
+ - One **ADR-authoring story** producing the project's foundational ADR
313
+ at `<paths.adr>/NNNN-<slug>.md`. The ADR number is the next available
314
+ in the existing ADR sequence (see `/project-orchestrate` Step 16 for
315
+ the shared numbering pool).
316
+ - One **CONTEXT.md-authoring story per implementation epic**, each
317
+ producing `<paths.context>/<epic-slug>/CONTEXT.md` from the template
318
+ at `shared/templates/CONTEXT-template.md`. The story body lists the
319
+ `shared_design_concerns` for that epic so the research subagent has
320
+ concrete inputs.
321
+ 3. **Wire `blocked_by` references** on every implementation story:
322
+ - Each implementation story gets `blocked_by` references to the
323
+ design-spike story that produces its epic's CONTEXT.md.
324
+ - Sprint planning then naturally excludes implementation stories until
325
+ their CONTEXT.md exists — no additional gate logic required.
326
+
327
+ ### Artifact Storage
328
+
329
+ ADR and CONTEXT.md files are committed to the `development` branch via
330
+ the filesystem in ALL four backends. Git is the universal substrate; this
331
+ keeps the artifact location uniform regardless of which backend the
332
+ backlog lives in.
333
+
334
+ - ADR location: `<paths.adr>/NNNN-<slug>.md`
335
+ - CONTEXT.md location: `<paths.context>/<epic-slug>/CONTEXT.md`
336
+
337
+ Remote backends (GitHub, Jira, Trello) MAY additionally surface links to
338
+ these files via milestone/epic descriptions for discoverability — but the
339
+ committed files are the single source of truth. If the description link
340
+ becomes stale (e.g., file renamed), the filesystem path wins.
341
+
342
+ ### Auto-Injection of References
343
+
344
+ When the design-spike epic is part of the scaffold, every implementation
345
+ story's Technical Context section receives an appended line referencing
346
+ the artifacts that will be produced:
347
+
348
+ ```
349
+ See [<paths.context>/<epic-slug>/CONTEXT.md] and [<paths.adr>/NNNN-<slug>.md] for shared architectural decisions.
350
+ ```
351
+
352
+ The paths use the resolved `paths.context` and `paths.adr` config values
353
+ (not hardcoded strings) and the ADR number assigned during skeleton
354
+ augmentation. Auto-injection happens during Story Assembly, after Pass 2
355
+ produces stories but before per-backend creation runs.
356
+
23
357
  ## Scaffold Procedure
24
358
 
359
+ Read `../shared/config.json` to determine mode. If `scaffolding` is `"local"`,
360
+ follow the **Local Scaffold Procedure** below. Otherwise follow the
361
+ **GitHub Scaffold Procedure**.
362
+
363
+ ---
364
+
365
+ ## Local Scaffold Procedure
366
+
367
+ When `scaffolding: "local"`, create the entire backlog as local markdown files
368
+ instead of GitHub issues, milestones, and project boards.
369
+
370
+ ### Local Step 1: Parse the PRD
371
+
372
+ **If two-pass mode was selected** (see Mode Detection), the Two-Pass
373
+ Procedure has already produced the assembled epic + story list. Skip this
374
+ step's parsing work and proceed to Step 2 with the assembled list as input.
375
+
376
+ **If single-pass mode was selected**, do this step as before: extract
377
+ project name, epics, stories, dependencies, and technical context. Present
378
+ the summary and ask the user to confirm.
379
+
380
+ ### Local Step 2: Detect Existing Backlog
381
+
382
+ Check if the configured backlog directory already exists:
383
+
384
+ ```bash
385
+ ls <backlog-path>/PROJECT.md 2>/dev/null
386
+ ```
387
+
388
+ **If found**, read `PROJECT.md` and list existing epic directories. Present
389
+ options (same as GitHub mode):
390
+
391
+ ```
392
+ Existing local backlog detected:
393
+ Project: <name>
394
+ Epics:
395
+ - <epic-slug>/ (N stories)
396
+ ...
397
+
398
+ How should the PRD stories be added?
399
+ 1. Create new epic(s) from this PRD
400
+ 2. Add stories to an existing epic
401
+ 3. Mix — map each PRD section to a new or existing epic
402
+ ```
403
+
404
+ **If not found**, proceed with full scaffold.
405
+
406
+ ### Local Step 3: Create Project File
407
+
408
+ Create `<backlog-path>/PROJECT.md`:
409
+
410
+ ```markdown
411
+ ---
412
+ name: <Project Name>
413
+ created: <ISO timestamp>
414
+ sprints: []
415
+ ---
416
+
417
+ # <Project Name>
418
+
419
+ <Project description from PRD>
420
+ ```
421
+
422
+ ### Local Step 4: Create Epic Directories
423
+
424
+ For each epic, create `<backlog-path>/<epic-slug>/`:
425
+
426
+ ```markdown
427
+ <!-- <backlog-path>/<epic-slug>/_epic.md -->
428
+ ---
429
+ title: <Epic Name>
430
+ slug: <epic-slug>
431
+ status: open
432
+ created: <ISO timestamp>
433
+ ---
434
+
435
+ # <Epic Name>
436
+
437
+ <Epic description from PRD>
438
+ ```
439
+
440
+ ### Local Step 5: Create Story Files
441
+
442
+ For each story, create a numbered file in the epic directory. Use sequential
443
+ numbering within each epic: `001-<story-slug>.md`, `002-<story-slug>.md`, etc.
444
+
445
+ ```markdown
446
+ <!-- <backlog-path>/<epic-slug>/001-<story-slug>.md -->
447
+ ---
448
+ title: <Story title>
449
+ epic: <epic-slug>
450
+ status: backlog
451
+ executor: claude | human | cowork
452
+ priority: P0-critical | P1-high | P2-medium | P3-low
453
+ points: <fibonacci estimate>
454
+ labels:
455
+ - type:story
456
+ - executor:<type>
457
+ - <priority>
458
+ - epic:<epic-slug>
459
+ - ready-for-work
460
+ persona: impl | ops | research
461
+ blocked_by: []
462
+ blocks: []
463
+ sprint: null
464
+ ---
465
+
466
+ ## Objective
467
+
468
+ <What this accomplishes — one clear sentence>
469
+
470
+ ## Acceptance Criteria
471
+
472
+ - [ ] <Specific, testable criterion>
473
+ - [ ] <Specific, testable criterion>
474
+
475
+ ## Technical Context
476
+
477
+ <Architecture notes, relevant files, approach guidance>
478
+
479
+ ## Dependencies
480
+
481
+ - **Blocked by:** <epic-slug>/NNN-slug or "none">
482
+ - **Blocks:** <epic-slug>/NNN-slug or "none">
483
+ ```
484
+
485
+ Use the same executor assignment and story point guidelines from
486
+ CONVENTIONS.md as in GitHub mode.
487
+
488
+ ### Local Step 6: Generate Summary
489
+
490
+ ```
491
+ ## Project Scaffold Complete (Local Mode)
492
+
493
+ **Project:** <name>
494
+ **Backlog path:** <backlog-path>/
495
+ **Mode:** Local file-based backlog
496
+
497
+ ### Epics
498
+ - <epic-slug>/ — <N> stories, <total points> points
499
+ ...
500
+
501
+ ### Story Breakdown by Executor
502
+ - executor:claude — <N> stories (<points> points)
503
+ - executor:human — <N> stories (<points> points)
504
+ - executor:cowork — <N> stories (<points> points)
505
+
506
+ ### Next Steps
507
+ 1. Review stories in <backlog-path>/
508
+ 2. Adjust priorities, executors, or points by editing frontmatter
509
+ 3. Note: Sprint planning, status tracking, and orchestration currently
510
+ require `scaffolding: "github"`. Set that in config.json and run
511
+ `/project-scaffold` again to push the backlog to GitHub when ready.
512
+ ```
513
+
514
+ **No branches, labels, or GitHub Project are created in local mode.**
515
+
516
+ ---
517
+
518
+ ## Jira Scaffold Procedure
519
+
520
+ When `scaffolding: "jira"`, use the Jira REST API to create epics, stories,
521
+ and sprints. Refer to `../shared/references/PROVIDERS.md` for all API calls.
522
+
523
+ ### Jira Step 1: Parse the PRD
524
+
525
+ Same routing as Local Step 1: if two-pass mode was selected, the Two-Pass
526
+ Procedure has already produced the assembled list — proceed to Step 2 with
527
+ that list. If single-pass mode, parse the PRD inline as in Local Step 1 /
528
+ GitHub Step 1.
529
+
530
+ ### Jira Step 2: Ensure Project Exists
531
+
532
+ Read `jira.project_key` from `../shared/config.json`.
533
+
534
+ **If the key is empty or not set**, create the project:
535
+
536
+ ```bash
537
+ # Get the current user's account ID for project lead
538
+ ACCOUNT_ID=$(curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
539
+ "$JIRA_SITE/rest/api/3/myself" | jq -r '.accountId')
540
+
541
+ # Derive a project key from the PRD project name (uppercase, max 10 chars)
542
+ PROJECT_KEY=$(echo "<Project Name>" | tr '[:lower:]' '[:upper:]' | tr -cd 'A-Z' | head -c 10)
543
+
544
+ # Create a Scrum software project
545
+ curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
546
+ -H "Content-Type: application/json" \
547
+ -X POST "$JIRA_SITE/rest/api/3/project" \
548
+ -d '{
549
+ "key": "'$PROJECT_KEY'",
550
+ "name": "<Project Name>",
551
+ "projectTypeKey": "software",
552
+ "projectTemplateKey": "com.pyxis.greenhopper.jira:gh-scrum-template",
553
+ "leadAccountId": "'$ACCOUNT_ID'"
554
+ }'
555
+ ```
556
+
557
+ After creation, save the key back to `../shared/config.json` under
558
+ `jira.project_key` so subsequent skills don't need to create it again.
559
+
560
+ **If the key is set**, verify the project exists and check for existing epics:
561
+
562
+ ```bash
563
+ curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
564
+ "$JIRA_SITE/rest/api/3/search?jql=project=<PROJECT_KEY>+AND+issuetype=Epic+AND+status!=Done&fields=summary,status"
565
+ ```
566
+
567
+ If epics exist, present options to add to existing or create new (same UX as
568
+ GitHub mode).
569
+
570
+ ### Jira Step 3: Create Epics
571
+
572
+ Create an Epic issue for each epic in the PRD. Capture the epic key returned.
573
+
574
+ ### Jira Step 4: Create Stories
575
+
576
+ Create Story issues linked to their parent epic. Apply labels for executor,
577
+ priority, and persona. Set story points via the appropriate custom field.
578
+
579
+ Note: Discover the epic link field ID and story points field ID at runtime:
580
+ ```bash
581
+ curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" "$JIRA_SITE/rest/api/3/field" \
582
+ | jq '.[] | select(.name=="Epic Link" or .name=="Story Points")'
583
+ ```
584
+
585
+ ### Jira Step 5: Create Sprint
586
+
587
+ ```bash
588
+ # Find the Scrum board for this project
589
+ BOARD_ID=$(curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
590
+ "$JIRA_SITE/rest/agile/1.0/board?projectKeyOrId=<PROJECT_KEY>" \
591
+ | jq '.values[] | select(.type=="scrum") | .id')
592
+ ```
593
+
594
+ If a Scrum board exists, use it. If the project was just created with the
595
+ Scrum template, the board is created automatically.
596
+
597
+ Create the first sprint on the board:
598
+
599
+ ```bash
600
+ curl -s -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
601
+ -H "Content-Type: application/json" \
602
+ -X POST "$JIRA_SITE/rest/agile/1.0/sprint" \
603
+ -d '{
604
+ "name": "Sprint 1",
605
+ "originBoardId": '$BOARD_ID',
606
+ "goal": "<sprint goal from PRD>"
607
+ }'
608
+ ```
609
+
610
+ ### Jira Step 6: Create Branch Structure
611
+
612
+ Same as GitHub mode — git operations are independent of the issue tracker.
613
+ Create `development` and `release/<epic-slug>` branches.
614
+
615
+ ### Jira Step 7: Generate Summary
616
+
617
+ Same format as GitHub mode, replacing GitHub-specific links with Jira URLs:
618
+ - Project board: `$JIRA_SITE/jira/software/projects/<KEY>/boards/<id>`
619
+ - Epics: `$JIRA_SITE/browse/<EPIC-KEY>`
620
+
621
+ ---
622
+
623
+ ## Trello Scaffold Procedure
624
+
625
+ When `scaffolding: "trello"`, use the Trello REST API to create lists (epics),
626
+ cards (stories), and labels. Refer to `../shared/references/PROVIDERS.md` for
627
+ all API calls.
628
+
629
+ ### Trello Step 1: Parse the PRD
630
+
631
+ Same routing as Local Step 1: if two-pass mode was selected, the Two-Pass
632
+ Procedure has already produced the assembled list — proceed to Step 2 with
633
+ that list. If single-pass mode, parse the PRD inline as in Local Step 1 /
634
+ GitHub Step 1.
635
+
636
+ ### Trello Step 2: Ensure Board Exists
637
+
638
+ Read `trello.board_id` from `../shared/config.json`.
639
+
640
+ **If the ID is empty or not set**, create the board:
641
+
642
+ ```bash
643
+ # Create a new board with no default lists (we'll create our own)
644
+ BOARD_ID=$(curl -s -X POST "https://api.trello.com/1/boards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
645
+ -d "name=<Project Name>&defaultLists=false" | jq -r '.id')
646
+ ```
647
+
648
+ After creation, save the board ID back to `../shared/config.json` under
649
+ `trello.board_id` so subsequent skills don't need to create it again.
650
+
651
+ **If the ID is set**, check for existing lists:
652
+
653
+ ```bash
654
+ curl -s "https://api.trello.com/1/boards/<board-id>/lists?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN&filter=open"
655
+ ```
656
+
657
+ If lists exist, present options to add to existing or create new (same UX as
658
+ GitHub mode).
659
+
660
+ ### Trello Step 3: Create Labels
661
+
662
+ Trello has a fixed color palette. Map priority and executor labels:
663
+
664
+ ```bash
665
+ # Create labels on the board
666
+ curl -s -X POST "https://api.trello.com/1/boards/<board-id>/labels?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
667
+ -d "name=executor:claude&color=blue"
668
+ curl -s -X POST "https://api.trello.com/1/boards/<board-id>/labels?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
669
+ -d "name=executor:human&color=yellow"
670
+ curl -s -X POST "https://api.trello.com/1/boards/<board-id>/labels?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
671
+ -d "name=P0-critical&color=red"
672
+ curl -s -X POST "https://api.trello.com/1/boards/<board-id>/labels?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
673
+ -d "name=P1-high&color=orange"
674
+ # ... etc
675
+ ```
676
+
677
+ ### Trello Step 4: Create Epic Lists
678
+
679
+ Create one list per epic. Position Backlog and Done lists at the edges:
680
+
681
+ ```bash
682
+ curl -s -X POST "https://api.trello.com/1/lists?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
683
+ -d "name=<Epic Name>&idBoard=<board-id>&pos=bottom"
684
+ ```
685
+
686
+ ### Trello Step 5: Create Story Cards
687
+
688
+ Create a card per story in the appropriate epic list:
689
+
690
+ ```bash
691
+ curl -s -X POST "https://api.trello.com/1/cards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
692
+ -d "name=<title>&desc=<body with acceptance criteria>&idList=<epic-list-id>&idLabels=<label-ids>"
693
+ ```
694
+
695
+ Story points: If custom fields power-up is enabled, set via:
696
+ ```bash
697
+ curl -s -X PUT "https://api.trello.com/1/cards/<card-id>/customField/<field-id>/item?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
698
+ -H "Content-Type: application/json" \
699
+ -d '{"value":{"number":"<points>"}}'
700
+ ```
701
+
702
+ Otherwise, prefix the card title: `[5] <Story title>`.
703
+
704
+ ### Trello Step 6: Create Branch Structure
705
+
706
+ Same as GitHub mode — git operations are independent of the issue tracker.
707
+
708
+ ### Trello Step 7: Generate Summary
709
+
710
+ Same format as GitHub mode, replacing links with Trello URLs.
711
+
712
+ **Trello limitations note:** Trello has no native sprints, dependencies, or
713
+ milestone progress tracking. These are managed via list naming conventions
714
+ and card descriptions. For full sprint lifecycle support, consider GitHub or
715
+ Jira mode.
716
+
717
+ ---
718
+
719
+ ## GitHub Scaffold Procedure
720
+
25
721
  Execute these steps in order:
26
722
 
27
723
  ### Step 0: Detect Existing Project Context
@@ -63,7 +759,12 @@ Ask the user to choose and, if option 2 or 3, which epic(s) to target.
63
759
 
64
760
  ### Step 1: Parse the PRD
65
761
 
66
- Extract the following from the PRD document(s):
762
+ **If two-pass mode was selected** (see Mode Detection), the Two-Pass
763
+ Procedure has already produced the assembled epic + story list. Skip the
764
+ inline parsing below and proceed to Step 2 with that list as input.
765
+
766
+ **If single-pass mode was selected**, extract the following from the PRD
767
+ document(s):
67
768
 
68
769
  - **Project name** — used for the GitHub Project title (if creating new)
69
770
  - **Epics** — major bodies of work; each becomes a milestone (unless mapped to an existing one)
@@ -109,6 +810,11 @@ gh label create "P0-critical" --color "b60205" --repo <owner/repo>
109
810
  gh label create "P1-high" --color "d93f0b" --repo <owner/repo>
110
811
  gh label create "P2-medium" --color "fbca04" --repo <owner/repo>
111
812
  gh label create "P3-low" --color "0e8a16" --repo <owner/repo>
813
+
814
+ # Persona labels
815
+ gh label create "persona:ops" --color "1D76DB" --description "Ops/infra posture — idempotency, rollback, least privilege" --repo <owner/repo> 2>/dev/null
816
+ gh label create "persona:research" --color "D4C5F9" --description "Research posture — produce a document, not code" --repo <owner/repo> 2>/dev/null
817
+ gh label create "source:review" --color "BFDADC" --description "Issue created from automated review findings" --repo <owner/repo> 2>/dev/null
112
818
  ```
113
819
 
114
820
  ### Step 3: Create Epics (Milestones + Labels)