Spec to Repo
A delivery-focused skill that bridges product spec to repository work.
Where PRD-writing skills focus on what to build, this skill focuses on
how to break it down for execution — the ticket decomposition,
branch strategy, PR sequencing, and acceptance criteria that make a
spec actually ship.
When to use this skill
- Translating a PRD or feature brief into a sequence of tickets
- Designing the branch + PR sequence for a multi-week feature
- Auditing an existing ticket decomposition for risk (big tickets, hidden dependencies)
- Defining definition-of-done that covers code, tests, docs, telemetry
- Planning incremental shipping (feature flags, canaries, dark-launch)
- Reviewing a decomposition before sprint planning to avoid mid-sprint surprises
Inputs the advisor expects
- The PRD or spec document
- Target ship window (1 sprint? 1 month? 1 quarter?)
- Engineering team size + composition (FE, BE, ML, mobile)
- Risk profile (greenfield vs production-impacting)
- Feature-flag and rollout posture
Clarify First
Before generating the repo plan, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
Workflows
Workflow 1 — Decompose a PRD into tickets
- Pull the PRD; identify the user-facing capabilities.
- Run
prd_to_tickets_decomposer.py with the user stories + technical
notes to surface a candidate ticket tree (epic → tickets → subtasks)
with size estimates and dependencies.
- Manually review; tune for team-specific patterns.
python3 spec-to-repo/scripts/prd_to_tickets_decomposer.py \
--input prd.json --format markdown
Workflow 2 — Validate the branch and PR plan
- Capture proposed branch + PR sequence.
- Run
pr_scope_analyzer.py to flag oversized PRs, missing tests,
missing telemetry, and risky merges.
- Adjust before opening PRs.
python3 spec-to-repo/scripts/pr_scope_analyzer.py \
--input pr_plan.json --format markdown
Workflow 3 — Lint branch names against convention
- Capture branch list (e.g.,
git branch --list).
- Run
branch_naming_validator.py to flag non-conformant names.
python3 spec-to-repo/scripts/branch_naming_validator.py \
--input branches.txt --format markdown
Decision frameworks
Ticket sizing
| Size |
Effort |
Description |
| XS |
< 0.5 day |
Trivial; usually skip ticketing |
| S |
0.5–1 day |
One simple change |
| M |
1–3 days |
Single feature, well-scoped |
| L |
3–5 days |
Multi-day work; should split if possible |
| XL |
> 5 days |
Always split — too big for confident estimate |
A ticket that's L or XL almost always hides a missing decomposition. Push
back on yourself.
The ticket tree
Epic — large product feature ("Notifications v2")
├── Story — user-facing capability ("As a user I can mute by channel")
│ ├── Ticket — one engineering work item (backend, frontend, infra)
│ │ └── Subtask — atomic step (optional)
Most orgs:
- Epic ≈ PRD-sized scope
- Story ≈ one user-facing slice
- Ticket ≈ one PR (or pair of PRs: BE + FE)
The "vertical slice"
Best ticket: ships a small user-visible improvement end-to-end.
- Backend change + frontend change + tests + telemetry + docs in one ship
- Better than: BE-only ticket waiting for FE-only ticket waiting for QA
When you can't slice vertically (e.g., backend is weeks before frontend):
- Use feature flags to ship behind a switch
- Dark-launch backend to validate before frontend
- Communicate the lag explicitly
PR sequencing
For a multi-PR feature:
- PR 1 — Infrastructure / scaffolding (no behavior change)
- PR 2 — Backend changes (behind flag; no frontend uses it)
- PR 3 — Frontend changes (behind flag; tests pass with flag on/off)
- PR 4 — Telemetry + analytics events
- PR 5 — Documentation + runbook
- PR 6 — Flag enablement (small change; reviewable cleanly)
Each PR < 400 lines if possible. Reviewability collapses above 400.
Definition of done
Per ticket:
- Code: written, reviewed, merged
- Tests: unit + integration as appropriate
- Telemetry: events fired (and verified)
- Docs: README / runbook / API doc updated as needed
- Accessibility: meets the project bar
- Feature flag: configured (if applicable)
- Rollout plan: defined for non-flagged ships
Per epic:
- All tickets complete
- Feature behind flag in production for 1+ week (if risky)
- Flag enabled for X% (canary), then ramped
- Telemetry shows expected behavior
- Customer-facing comms drafted (if applicable)
Common engagements
"Help me decompose this PRD"
- List user-facing capabilities (1-line each).
- For each, list the backend, frontend, infra, telemetry, docs work.
- Estimate; flag anything > 3 days for further breakdown.
- Sequence: scaffolding first, behavior next, flag enablement last.
- Identify cross-team dependencies; engage before sprint start.
"Our team is shipping huge PRs"
- Audit the last 10 PRs: median size, P95 size.
- Identify the patterns: monolithic services + flag-less work + slow review.
- Pilot: feature flags + ticket-first decomposition + PR size SLA.
- Track: median PR size + lead time week-over-week.
"Help me plan the rollout"
- Define a successful launch criterion (e.g., < 0.5% error rate at 50%).
- Identify the kill switch (feature flag or quick-revert).
- Plan ramps: 1% → 5% → 25% → 50% → 100% with bake time.
- Define rollback criteria + comms plan.
- Coordinate with on-call + support.
Anti-patterns to avoid
- Decomposition as wishful thinking. "3-day estimate" with no break-down is a 2-week-actual.
- Sequential ticket tree (everyone waits). Plan parallel paths.
- Hidden dependencies on other teams. Surface them in decomposition.
- No feature flag. Shippable in chunks but every change goes to all users immediately.
- PRs > 1000 lines. Reviewability dies; bugs hide.
- DoD that's just "code merged." Forgets tests, docs, telemetry.
- Ticket = a day of work. Sometimes tickets are 30 minutes; sometimes 3 days.
References
references/spec-to-ticket-decomposition.md — patterns for breaking specs into tickets
references/branch-strategy-for-features.md — branching, feature flags, dark-launch
references/pr-discipline-and-conventions.md — PR size, review, definition-of-done
Related skills
product-team/agile-product-owner — sprint planning, prioritization
engineering/feature-flags-architect — flag strategy
engineering/observability-designer — SLO / telemetry
c-level-advisor/vpe-advisor — broader delivery context
project-management/ skills — ticket / sprint management tooling
1---2name: spec-to-repo3description: Translate product specs (PRDs, user stories) into a ship-ready repo plan: ticket decomposition, branch strategy, and PR sequencing. Use when breaking a PRD into tickets or designing the branch/PR sequence.4license: MIT + Commons Clause5---6
7# Spec to Repo
8
9A delivery-focused skill that bridges product spec to repository work.
10Where PRD-writing skills focus on what to build, this skill focuses on
11**how to break it down for execution** — the ticket decomposition,
12branch strategy, PR sequencing, and acceptance criteria that make a
13spec actually ship.
14
15## When to use this skill
16
17- Translating a **PRD or feature brief** into a sequence of tickets
18- Designing the **branch + PR sequence** for a multi-week feature
19- Auditing an existing **ticket decomposition** for risk (big tickets, hidden dependencies)
20- Defining **definition-of-done** that covers code, tests, docs, telemetry
21- Planning **incremental shipping** (feature flags, canaries, dark-launch)
22- Reviewing a **decomposition before sprint planning** to avoid mid-sprint surprises
23
24## Inputs the advisor expects
25
26- The PRD or spec document
27- Target ship window (1 sprint? 1 month? 1 quarter?)
28- Engineering team size + composition (FE, BE, ML, mobile)
29- Risk profile (greenfield vs production-impacting)
30- Feature-flag and rollout posture
31
32## Clarify First
33
34Before generating the repo plan, confirm these inputs. If any is unknown or vague, ASK — do not assume:
35
36- [ ] **The PRD or spec** — the user-facing capabilities to decompose (drives the epic→ticket tree)
37- [ ] **Target ship window** — one sprint, month, or quarter (drives ticket sizing and PR sequencing)
38- [ ] **Team composition** — FE, BE, ML, mobile (decides parallel paths and vertical-slice tickets)
39- [ ] **Feature-flag and rollout posture** — flagged/dark-launch vs direct ship (drives PR sequencing and definition-of-done)
40
41Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
42
43## Workflows
44
45### Workflow 1 — Decompose a PRD into tickets
46
471. Pull the PRD; identify the user-facing capabilities.
482. Run `prd_to_tickets_decomposer.py` with the user stories + technical
49 notes to surface a candidate ticket tree (epic → tickets → subtasks)
50 with size estimates and dependencies.
513. Manually review; tune for team-specific patterns.
52
53```bash
54python3 spec-to-repo/scripts/prd_to_tickets_decomposer.py \
55 --input prd.json --format markdown
56```
57
58### Workflow 2 — Validate the branch and PR plan
59
601. Capture proposed branch + PR sequence.
612. Run `pr_scope_analyzer.py` to flag oversized PRs, missing tests,
62 missing telemetry, and risky merges.
633. Adjust before opening PRs.
64
65```bash
66python3 spec-to-repo/scripts/pr_scope_analyzer.py \
67 --input pr_plan.json --format markdown
68```
69
70### Workflow 3 — Lint branch names against convention
71
721. Capture branch list (e.g., `git branch --list`).
732. Run `branch_naming_validator.py` to flag non-conformant names.
74
75```bash
76python3 spec-to-repo/scripts/branch_naming_validator.py \
77 --input branches.txt --format markdown
78```
79
80## Decision frameworks
81
82### Ticket sizing
83
84| Size | Effort | Description |
85|------|--------|-------------|
86| XS | < 0.5 day | Trivial; usually skip ticketing |
87| S | 0.5–1 day | One simple change |
88| M | 1–3 days | Single feature, well-scoped |
89| L | 3–5 days | Multi-day work; should split if possible |
90| XL | > 5 days | Always split — too big for confident estimate |
91
92A ticket that's L or XL almost always hides a missing decomposition. Push
93back on yourself.
94
95### The ticket tree
96
97```
98Epic — large product feature ("Notifications v2")
99├── Story — user-facing capability ("As a user I can mute by channel")
100│ ├── Ticket — one engineering work item (backend, frontend, infra)
101│ │ └── Subtask — atomic step (optional)
102```
103
104Most orgs:
105- Epic ≈ PRD-sized scope
106- Story ≈ one user-facing slice
107- Ticket ≈ one PR (or pair of PRs: BE + FE)
108
109### The "vertical slice"
110
111Best ticket: ships a small user-visible improvement end-to-end.
112- Backend change + frontend change + tests + telemetry + docs in one ship
113- Better than: BE-only ticket waiting for FE-only ticket waiting for QA
114
115When you can't slice vertically (e.g., backend is weeks before frontend):
116- Use feature flags to ship behind a switch
117- Dark-launch backend to validate before frontend
118- Communicate the lag explicitly
119
120### PR sequencing
121
122For a multi-PR feature:
123
1241. **PR 1 — Infrastructure / scaffolding** (no behavior change)
1252. **PR 2 — Backend changes** (behind flag; no frontend uses it)
1263. **PR 3 — Frontend changes** (behind flag; tests pass with flag on/off)
1274. **PR 4 — Telemetry + analytics events**
1285. **PR 5 — Documentation + runbook**
1296. **PR 6 — Flag enablement** (small change; reviewable cleanly)
130
131Each PR < 400 lines if possible. Reviewability collapses above 400.
132
133### Definition of done
134
135Per ticket:
136- Code: written, reviewed, merged
137- Tests: unit + integration as appropriate
138- Telemetry: events fired (and verified)
139- Docs: README / runbook / API doc updated as needed
140- Accessibility: meets the project bar
141- Feature flag: configured (if applicable)
142- Rollout plan: defined for non-flagged ships
143
144Per epic:
145- All tickets complete
146- Feature behind flag in production for 1+ week (if risky)
147- Flag enabled for X% (canary), then ramped
148- Telemetry shows expected behavior
149- Customer-facing comms drafted (if applicable)
150
151## Common engagements
152
153### "Help me decompose this PRD"
1541. List user-facing capabilities (1-line each).
1552. For each, list the backend, frontend, infra, telemetry, docs work.
1563. Estimate; flag anything > 3 days for further breakdown.
1574. Sequence: scaffolding first, behavior next, flag enablement last.
1585. Identify cross-team dependencies; engage before sprint start.
159
160### "Our team is shipping huge PRs"
1611. Audit the last 10 PRs: median size, P95 size.
1622. Identify the patterns: monolithic services + flag-less work + slow review.
1633. Pilot: feature flags + ticket-first decomposition + PR size SLA.
1644. Track: median PR size + lead time week-over-week.
165
166### "Help me plan the rollout"
1671. Define a successful launch criterion (e.g., < 0.5% error rate at 50%).
1682. Identify the kill switch (feature flag or quick-revert).
1693. Plan ramps: 1% → 5% → 25% → 50% → 100% with bake time.
1704. Define rollback criteria + comms plan.
1715. Coordinate with on-call + support.
172
173## Anti-patterns to avoid
174
175- **Decomposition as wishful thinking.** "3-day estimate" with no break-down is a 2-week-actual.
176- **Sequential ticket tree (everyone waits).** Plan parallel paths.
177- **Hidden dependencies on other teams.** Surface them in decomposition.
178- **No feature flag.** Shippable in chunks but every change goes to all users immediately.
179- **PRs > 1000 lines.** Reviewability dies; bugs hide.
180- **DoD that's just "code merged."** Forgets tests, docs, telemetry.
181- **Ticket = a day of work.** Sometimes tickets are 30 minutes; sometimes 3 days.
182
183## References
184
185- `references/spec-to-ticket-decomposition.md` — patterns for breaking specs into tickets
186- `references/branch-strategy-for-features.md` — branching, feature flags, dark-launch
187- `references/pr-discipline-and-conventions.md` — PR size, review, definition-of-done
188
189## Related skills
190
191- `product-team/agile-product-owner` — sprint planning, prioritization
192- `engineering/feature-flags-architect` — flag strategy
193- `engineering/observability-designer` — SLO / telemetry
194- `c-level-advisor/vpe-advisor` — broader delivery context
195- `project-management/` skills — ticket / sprint management tooling