specrails-core 4.6.4 → 4.6.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/commands/enrich.md +109 -214
- package/dist/installer/phases/scaffold.js +152 -153
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/docs/deployment.md +1 -1
- package/package.json +1 -2
- package/schemas/profile.v1.json +1 -9
- package/templates/agents/sr-architect.md +9 -6
- package/templates/codex-skills/enrich/SKILL.md +3 -3
- package/templates/codex-skills/implement/SKILL.md +75 -8
- package/templates/codex-skills/rails/sr-architect/SKILL.md +33 -7
- package/templates/codex-skills/rails/sr-developer/SKILL.md +6 -3
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +57 -5
- package/templates/commands/specrails/enrich.md +36 -213
- package/templates/commands/specrails/implement.md +22 -10
- package/templates/commands/specrails/reconfig.md +1 -10
- package/templates/commands/specrails/retry.md +2 -1
- package/templates/skills/rails/sr-architect/SKILL.md +0 -234
- package/templates/skills/rails/sr-developer/SKILL.md +0 -210
- package/templates/skills/rails/sr-merge-resolver/SKILL.md +0 -197
- package/templates/skills/rails/sr-reviewer/SKILL.md +0 -320
- package/templates/skills/sr-auto-propose-backlog-specs/SKILL.md +0 -275
- package/templates/skills/sr-batch-implement/SKILL.md +0 -292
- package/templates/skills/sr-compat-check/SKILL.md +0 -275
- package/templates/skills/sr-get-backlog-specs/SKILL.md +0 -199
- package/templates/skills/sr-implement/SKILL.md +0 -1205
- package/templates/skills/sr-refactor-recommender/SKILL.md +0 -216
- package/templates/skills/sr-why/SKILL.md +0 -106
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sr-get-backlog-specs
|
|
3
|
-
description: "sr:get-backlog-specs — View product-driven backlog from GitHub Issues and propose top 3 for implementation."
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: "Requires GitHub CLI (gh)."
|
|
6
|
-
metadata:
|
|
7
|
-
author: specrails
|
|
8
|
-
version: "1.0"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Display the product-driven backlog by reading issues/tickets from the configured backlog provider ({{BACKLOG_PROVIDER_NAME}}). These are feature ideas generated through VPC-based product discovery — evaluated against user personas. Use `/specrails:auto-propose-backlog-specs` to generate new ideas.
|
|
13
|
-
|
|
14
|
-
**Input:** $ARGUMENTS (optional: comma-separated areas to filter. If empty, show all.)
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Phase 0: Environment Pre-flight
|
|
19
|
-
|
|
20
|
-
Verify the backlog provider is accessible:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
{{BACKLOG_PREFLIGHT}}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
If the backlog provider is unavailable, stop and inform the user.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Execution
|
|
31
|
-
|
|
32
|
-
Launch a **single** sr-product-analyst agent (`subagent_type: sr-product-analyst`) to read and prioritize the backlog.
|
|
33
|
-
|
|
34
|
-
The product-analyst receives this prompt:
|
|
35
|
-
|
|
36
|
-
> You are reading the product-driven backlog from {{BACKLOG_PROVIDER_NAME}} and producing a prioritized view.
|
|
37
|
-
|
|
38
|
-
1. **Fetch all open product-driven backlog items:**
|
|
39
|
-
```bash
|
|
40
|
-
{{BACKLOG_FETCH_CMD}}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
2. **Parse each issue/ticket** to extract metadata from the body:
|
|
44
|
-
- **Area**: from `area:*` label
|
|
45
|
-
- **Persona Fit**: from the body's Overview table — extract per-persona scores and total
|
|
46
|
-
- **Effort**: from the body's Overview table (High/Medium/Low)
|
|
47
|
-
- **Description**: from the body's "Feature Description" section
|
|
48
|
-
- **User Story**: from the body's "User Story" section
|
|
49
|
-
|
|
50
|
-
3. **Parse prerequisites for each issue:**
|
|
51
|
-
- Locate the row whose first cell matches `**Prerequisites**` in the issue body's Overview table.
|
|
52
|
-
- If the cell value is `None`, `-`, or empty: set `prereqs = []` for this issue.
|
|
53
|
-
- Otherwise: extract all tokens matching `#\d+` from the cell and set `prereqs = [<numbers>]`.
|
|
54
|
-
- If a prerequisite number does not appear in the fetched issue list, treat it as already satisfied (externally closed). Do not include it in the DAG.
|
|
55
|
-
|
|
56
|
-
4. **Build dependency graph and detect cycles:**
|
|
57
|
-
- Construct a directed graph where edge `(A → B)` means "issue A must complete before issue B".
|
|
58
|
-
- For each issue with a non-empty `prereqs` list, add an edge from each prerequisite to the issue.
|
|
59
|
-
- Run depth-first cycle detection:
|
|
60
|
-
- Maintain `visited` and `rec_stack` sets.
|
|
61
|
-
- For each unvisited node, run DFS. If a node in `rec_stack` is encountered, a cycle exists.
|
|
62
|
-
- Collect all cycle members into `CYCLE_MEMBERS`.
|
|
63
|
-
- If `CYCLE_MEMBERS` is non-empty, prepare a warning block to render before the backlog table:
|
|
64
|
-
```
|
|
65
|
-
> **Warning: Circular dependency detected in backlog.**
|
|
66
|
-
> The following issues form a cycle and cannot be safely ordered:
|
|
67
|
-
> #A -> #B -> #A
|
|
68
|
-
> Review these issues and correct the Prerequisites fields.
|
|
69
|
-
```
|
|
70
|
-
- Compute `in_degree[issue]` for all issues (count of prerequisite edges pointing to each issue from other open backlog issues).
|
|
71
|
-
|
|
72
|
-
5. **Compute safe implementation order (Kahn's topological sort):**
|
|
73
|
-
- Exclude `CYCLE_MEMBERS` from this computation.
|
|
74
|
-
- Initialize `ready` = all non-cycle issues where `in_degree == 0`.
|
|
75
|
-
- Sort `ready` by Total Persona Score descending.
|
|
76
|
-
- Build `WAVES = []`:
|
|
77
|
-
```
|
|
78
|
-
while ready is non-empty:
|
|
79
|
-
WAVES.append(copy of ready)
|
|
80
|
-
next_ready = []
|
|
81
|
-
for each issue in ready:
|
|
82
|
-
for each dependent D of issue (edges issue → D):
|
|
83
|
-
in_degree[D] -= 1
|
|
84
|
-
if in_degree[D] == 0: next_ready.append(D)
|
|
85
|
-
sort next_ready by Total Persona Score descending
|
|
86
|
-
ready = next_ready
|
|
87
|
-
```
|
|
88
|
-
- Store `WAVE_1 = WAVES[0]` (the set of immediately startable features).
|
|
89
|
-
|
|
90
|
-
6. **Group by area**.
|
|
91
|
-
|
|
92
|
-
7. **Sort within each area by Total Persona Score (descending)**, then by Effort (Low > Medium > High) as tiebreaker.
|
|
93
|
-
|
|
94
|
-
8. **Display** as a formatted table per area, then **propose the top 3 items from `WAVE_1`** (features with all prerequisites satisfied) for implementation. If fewer than 3 are in `WAVE_1`, show as many as available and add: "Note: Only {N} feature(s) are available to start immediately — remaining features have unmet prerequisites."
|
|
95
|
-
|
|
96
|
-
[If `CYCLE_MEMBERS` is non-empty, render the cycle warning block immediately before the first area table.]
|
|
97
|
-
|
|
98
|
-
Render each area table with the following format:
|
|
99
|
-
- Append `[blocked]` to the issue title cell if `in_degree[issue] > 0` and the issue is not in `CYCLE_MEMBERS`.
|
|
100
|
-
- Append `[cycle]` to the issue title cell if the issue is in `CYCLE_MEMBERS`.
|
|
101
|
-
- `Prereqs` cell: list prerequisite issue numbers as `#N, #M`, or `—` if none.
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
## Product-Driven Backlog
|
|
105
|
-
|
|
106
|
-
{N} open issues | Source: VPC-based product discovery
|
|
107
|
-
Personas: {{PERSONA_NAMES_WITH_ROLES}}
|
|
108
|
-
|
|
109
|
-
### {Area Name}
|
|
110
|
-
|
|
111
|
-
| # | Issue | {{PERSONA_SCORE_HEADERS}} | Total | Effort | Prereqs |
|
|
112
|
-
|---|-------|{{PERSONA_SCORE_SEPARATORS}}|-------|--------|---------|
|
|
113
|
-
| 1 | #42 Feature name [blocked] | ... | X/{{MAX_SCORE}} | Low | #12, #17 |
|
|
114
|
-
| 2 | #43 Other feature | ... | X/{{MAX_SCORE}} | High | — |
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Recommended Next Sprint (Top 3)
|
|
119
|
-
|
|
120
|
-
Ranked by VPC persona score / effort ratio:
|
|
121
|
-
|
|
122
|
-
| Priority | Issue | Area | {{PERSONA_SCORE_HEADERS}} | Total | Effort | Rationale |
|
|
123
|
-
|----------|-------|------|{{PERSONA_SCORE_SEPARATORS}}|-------|--------|-----------|
|
|
124
|
-
|
|
125
|
-
### Selection criteria
|
|
126
|
-
- Cross-persona features (both 4+/5) prioritized over single-persona
|
|
127
|
-
- Low effort preferred over high effort at same score
|
|
128
|
-
- Critical pain relief weighted higher than gain creation
|
|
129
|
-
|
|
130
|
-
Run `/specrails:implement` to start implementing these items.
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
9. **Render Safe Implementation Order section** after the Recommended Next Sprint table:
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Safe Implementation Order
|
|
139
|
-
|
|
140
|
-
Features grouped by wave. All features in a wave can start in parallel.
|
|
141
|
-
Features in wave N must complete before wave N+1 begins.
|
|
142
|
-
|
|
143
|
-
| Wave | Issue | Title | Prereqs | Score | Effort |
|
|
144
|
-
|------|-------|-------|---------|-------|--------|
|
|
145
|
-
| 1 | #N | ... | — | X/{{MAX_SCORE}} | Low |
|
|
146
|
-
| 2 | #M | ... | #N | X/{{MAX_SCORE}} | Medium |
|
|
147
|
-
|
|
148
|
-
To implement in this order:
|
|
149
|
-
/specrails:batch-implement <issue-refs in wave order> --deps "<A> -> <B>, <C> -> <D>, ..."
|
|
150
|
-
|
|
151
|
-
[If no edges exist in the DAG, omit the --deps clause:]
|
|
152
|
-
/specrails:batch-implement <issue-refs>
|
|
153
|
-
|
|
154
|
-
[If CYCLE_MEMBERS is non-empty, append:]
|
|
155
|
-
Cycle members excluded from ordering: #A, #B
|
|
156
|
-
Fix the Prerequisites fields in these issues to include them.
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Issue refs in the `/specrails:batch-implement` command are listed in wave order (wave 1 first, then wave 2, etc.), sorted by persona score within each wave. The `--deps` string is constructed from all edges in the DAG: `"A -> B"` for each edge, comma-separated. If the backlog has no dependencies at all (DAG has no edges), the section still renders showing all features in wave 1 and the `--deps` clause is omitted.
|
|
160
|
-
|
|
161
|
-
10. If no issues exist:
|
|
162
|
-
```
|
|
163
|
-
No product-driven backlog issues found. Run `/specrails:auto-propose-backlog-specs` to generate feature ideas.
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
7. **[Orchestrator]** After the product-analyst completes, write issue snapshots to `.claude/backlog-cache.json`.
|
|
167
|
-
|
|
168
|
-
**Guard:** If `GH_AVAILABLE=false` (from Phase 0 pre-flight), print `[backlog-cache] Skipped — GH unavailable.` and return. Do not attempt the write.
|
|
169
|
-
|
|
170
|
-
**Fetch all open backlog issues in one call:**
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
gh issue list --label "product-driven-backlog" --state open --json number,title,state,assignees,labels,body,updatedAt
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
For each issue in the result, build a snapshot object:
|
|
177
|
-
- `number`: integer issue number
|
|
178
|
-
- `title`: issue title string
|
|
179
|
-
- `state`: `"open"` or `"closed"`
|
|
180
|
-
- `assignees`: array of assignee login names, sorted alphabetically
|
|
181
|
-
- `labels`: array of label names, sorted alphabetically
|
|
182
|
-
- `body_sha`: SHA-256 of the raw body string — compute with:
|
|
183
|
-
```bash
|
|
184
|
-
echo -n "{body}" | sha256sum | cut -d' ' -f1
|
|
185
|
-
```
|
|
186
|
-
If `sha256sum` is not available, fall back to `openssl dgst -sha256 -r` or `shasum -a 256`.
|
|
187
|
-
- `updated_at`: the `updatedAt` value from the GitHub API response
|
|
188
|
-
- `captured_at`: current local time in ISO 8601 format
|
|
189
|
-
|
|
190
|
-
**Merge strategy:** If `.claude/backlog-cache.json` already exists and is valid JSON, read it and merge: new snapshot entries overwrite existing entries by issue number key; entries for issue numbers not in the current fetch are preserved (they may be needed by an in-progress `/specrails:implement` run). If the file does not exist or is malformed, create it fresh.
|
|
191
|
-
|
|
192
|
-
Write the merged result back to `.claude/backlog-cache.json` with:
|
|
193
|
-
- `schema_version`: `"1"`
|
|
194
|
-
- `provider`: `"github"`
|
|
195
|
-
- `last_updated`: current ISO 8601 timestamp
|
|
196
|
-
- `written_by`: `"get-backlog-specs"`
|
|
197
|
-
- `issues`: the merged map keyed by string issue number
|
|
198
|
-
|
|
199
|
-
If the write fails (e.g., `.claude/` directory does not exist): print `[backlog-cache] Warning: could not write cache. Continuing.` Do not abort.
|