@yandy-r/ycc-opencode 6.5.0 → 6.6.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.
- package/README.md +11 -4
- package/agents/code-finder.md +1 -1
- package/agents/planner.md +1 -2
- package/agents/pr-evidence-collector.md +99 -0
- package/agents/root-cause-analyzer.md +1 -1
- package/index.js +9 -0
- package/package.json +1 -1
- package/registration.json +67 -0
- package/shared/references/standalone-dispatch.md +4 -1
- package/shared/references/target-capability-matrix.md +170 -30
- package/shared/references/worktree-strategy.md +7 -21
- package/skills/bundle-author/scripts/scaffold-skill.sh +9 -0
- package/skills/bundle-release/scripts/release_versions.py +19 -1
- package/skills/code-report/SKILL.md +0 -2
- package/skills/code-report/templates/report-structure.md +0 -2
- package/skills/compatibility-audit/SKILL.md +8 -4
- package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +75 -5
- package/skills/compatibility-audit/scripts/audit-target-features.sh +15 -9
- package/skills/feature-research/SKILL.md +1 -1
- package/skills/feature-research/scripts/validate-spec.sh +0 -4
- package/skills/formatters/references/templates/lint-autofix.yml.tmpl +7 -7
- package/skills/formatters/references/templates/lint.yml.tmpl +11 -11
- package/skills/formatters/scripts/bundle/go-tools.sh +73 -41
- package/skills/formatters/scripts/bundle/init-formatters.sh +1 -1
- package/skills/formatters/scripts/bundle/lib/modified-files.sh +0 -5
- package/skills/git-workflow/SKILL.md +1 -0
- package/skills/git-workflow/templates/agent-prompts.md +5 -6
- package/skills/git-workflow/templates/documentation-decision.md +1 -3
- package/skills/git-workflow/templates/pr-template.md +1 -3
- package/skills/go-patterns/references/design-and-tooling.md +16 -13
- package/skills/go-testing/references/advanced-testing.md +2 -2
- package/skills/implement-plan/references/agent-task-prompt.md +18 -20
- package/skills/implement-plan/scripts/parse-dependencies.sh +3 -9
- package/skills/init/templates/git/gitignore.tmpl +2 -0
- package/skills/init/templates/github/workflows/pr-title.yml.tmpl +1 -1
- package/skills/orchestrate/SKILL.md +1 -1
- package/skills/orchestrate/references/dispatch-playbook.md +1 -1
- package/skills/parallel-plan/SKILL.md +6 -10
- package/skills/plan-workflow/SKILL.md +3 -3
- package/skills/plan-workflow/references/plan-structure.md +1 -3
- package/skills/plan-workflow/scripts/validate-workflow-plan.sh +2 -8
- package/skills/pr-evidence/SKILL.md +138 -0
- package/skills/pr-evidence/references/perf-evidence.md +119 -0
- package/skills/pr-evidence/references/pr-body-and-hosting.md +112 -0
- package/skills/pr-evidence/references/ui-evidence.md +152 -0
- package/skills/pr-evidence/scripts/bench_report.py +331 -0
- package/skills/pr-evidence/scripts/capture-ui.mjs +311 -0
- package/skills/pr-evidence/scripts/classify-change.sh +135 -0
- package/skills/prp-plan/SKILL.md +4 -5
- package/skills/prp-plan/scripts/validate-prp-plan.sh +1 -11
- package/skills/prp-pr/SKILL.md +4 -0
- package/skills/releaser/references/ci-optimization-checklist.md +1 -1
- package/skills/releaser/references/ci-templates/docker-release.yml +8 -8
- package/skills/releaser/references/ci-templates/generic-release.yml +5 -5
- package/skills/releaser/references/ci-templates/go-release.yml +4 -4
- package/skills/releaser/references/ci-templates/node-release.yml +8 -8
- package/skills/releaser/references/ci-templates/python-release.yml +8 -8
- package/skills/releaser/references/ci-templates/rust-release.yml +10 -10
- package/skills/rust-testing/references/advanced-testing.md +1 -1
- package/skills/shared-context/SKILL.md +6 -10
- package/skills/ts-testing/references/advanced-testing.md +4 -4
- package/skills/visual-recap/SKILL.md +3 -4
|
@@ -41,12 +41,12 @@ Use the built-in structure for each doc type from the docs-git-committer agent (
|
|
|
41
41
|
|
|
42
42
|
## Standard: Important Constraints
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- Use Conventional Commit format for every commit so the message passes commit validation.
|
|
45
45
|
- Read the reference BEFORE writing your commit message: {{package-root}}/skills/git-workflow/templates/commit-types.md
|
|
46
46
|
- Validate your commit message BEFORE committing:
|
|
47
47
|
```bash
|
|
48
48
|
{{package-root}}/skills/git-workflow/scripts/validate-commit.sh "<your-commit-message>"
|
|
49
|
-
|
|
49
|
+
```
|
|
50
50
|
|
|
51
51
|
If validation fails, revise the message and re-validate until it passes.
|
|
52
52
|
|
|
@@ -78,7 +78,7 @@ Return a summary including:
|
|
|
78
78
|
- Documentation created/updated (if any)
|
|
79
79
|
- Reasoning for documentation decisions
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
````
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
@@ -254,7 +254,7 @@ You are handling the git commit and documentation for: [SECURITY FEATURE]
|
|
|
254
254
|
|
|
255
255
|
This introduces [security measure] to [protect against what].
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
Apply this pattern consistently wherever the same protection is needed.
|
|
258
258
|
|
|
259
259
|
## Security Pattern: Documentation Templates
|
|
260
260
|
|
|
@@ -427,7 +427,7 @@ Use when:
|
|
|
427
427
|
- Multiple distinct features
|
|
428
428
|
- Independent scopes
|
|
429
429
|
|
|
430
|
-
|
|
430
|
+
Deploy all agents in one message with one subagent invocation per agent so they run in parallel.
|
|
431
431
|
|
|
432
432
|
**Example**:
|
|
433
433
|
|
|
@@ -515,4 +515,3 @@ Each agent prompt should have:
|
|
|
515
515
|
7. Specify expected output format
|
|
516
516
|
|
|
517
517
|
**Remember**: The goal is parallel, coordinated work where each agent handles complete commit (source + docs) for their scope.
|
|
518
|
-
```
|
|
@@ -176,12 +176,10 @@ All auth endpoints MUST use rate limiting middleware:
|
|
|
176
176
|
```typescript
|
|
177
177
|
router.post('/login', rateLimitMiddleware(5, '15m'), loginHandler);
|
|
178
178
|
```
|
|
179
|
-
````
|
|
180
179
|
|
|
181
180
|
Failure to do so creates brute force vulnerability.
|
|
182
181
|
|
|
183
182
|
See docs/security/rate-limiting.md for details.
|
|
184
|
-
|
|
185
183
|
````
|
|
186
184
|
|
|
187
185
|
**Example of what NOT to add:**
|
|
@@ -196,7 +194,7 @@ user login, registration, and session management. The auth
|
|
|
196
194
|
service connects to the database and validates credentials...
|
|
197
195
|
|
|
198
196
|
(This belongs in feature docs, not AGENTS.md)
|
|
199
|
-
|
|
197
|
+
```
|
|
200
198
|
|
|
201
199
|
### AGENTS.md Template Location
|
|
202
200
|
|
|
@@ -329,15 +329,13 @@ Related to #234, #567
|
|
|
329
329
|
```
|
|
330
330
|
````
|
|
331
331
|
|
|
332
|
-
````
|
|
333
|
-
|
|
334
332
|
**If no breaking changes**:
|
|
335
333
|
|
|
336
334
|
```markdown
|
|
337
335
|
## Breaking Changes
|
|
338
336
|
|
|
339
337
|
- No breaking changes in this PR
|
|
340
|
-
|
|
338
|
+
```
|
|
341
339
|
|
|
342
340
|
### 7. Checklist Section
|
|
343
341
|
|
|
@@ -310,27 +310,30 @@ goimports -w .
|
|
|
310
310
|
|
|
311
311
|
### Recommended Linter Configuration (.golangci.yml)
|
|
312
312
|
|
|
313
|
+
This uses the golangci-lint v2 format, which `golangci-lint-action` v7 and later require.
|
|
314
|
+
|
|
313
315
|
```yaml
|
|
316
|
+
version: '2'
|
|
317
|
+
|
|
314
318
|
linters:
|
|
315
319
|
enable:
|
|
316
320
|
- errcheck
|
|
317
|
-
- gosimple
|
|
318
321
|
- govet
|
|
319
322
|
- ineffassign
|
|
320
|
-
- staticcheck
|
|
323
|
+
- staticcheck # includes the former gosimple checks
|
|
321
324
|
- unused
|
|
322
|
-
- gofmt
|
|
323
|
-
- goimports
|
|
324
325
|
- misspell
|
|
325
326
|
- unconvert
|
|
326
327
|
- unparam
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
328
|
+
settings:
|
|
329
|
+
errcheck:
|
|
330
|
+
check-type-assertions: true
|
|
331
|
+
govet:
|
|
332
|
+
enable:
|
|
333
|
+
- shadow
|
|
334
|
+
|
|
335
|
+
formatters:
|
|
336
|
+
enable:
|
|
337
|
+
- gofmt
|
|
338
|
+
- goimports
|
|
336
339
|
```
|
|
@@ -332,8 +332,8 @@ func TestAPIHandler(t *testing.T) {
|
|
|
332
332
|
test:
|
|
333
333
|
runs-on: ubuntu-latest
|
|
334
334
|
steps:
|
|
335
|
-
- uses: actions/checkout@
|
|
336
|
-
- uses: actions/setup-go@
|
|
335
|
+
- uses: actions/checkout@v7
|
|
336
|
+
- uses: actions/setup-go@v7
|
|
337
337
|
with:
|
|
338
338
|
go-version: '1.22'
|
|
339
339
|
|
|
@@ -76,24 +76,23 @@ After completing the task, provide:
|
|
|
76
76
|
|
|
77
77
|
### Notes
|
|
78
78
|
[Any important observations or warnings]
|
|
79
|
-
````
|
|
80
|
-
|
|
81
79
|
```
|
|
80
|
+
````
|
|
82
81
|
|
|
83
82
|
---
|
|
84
83
|
|
|
85
84
|
## Variable Reference
|
|
86
85
|
|
|
87
|
-
| Variable
|
|
88
|
-
|
|
89
|
-
| `{{PLAN_PATH}}`
|
|
90
|
-
| `{{SHARED_PATH}}`
|
|
91
|
-
| `{{TASK_ID}}`
|
|
92
|
-
| `{{TASK_TITLE}}`
|
|
93
|
-
| `{{FILES_TO_READ}}`
|
|
94
|
-
| `{{FILES_TO_CREATE}}`
|
|
95
|
-
| `{{FILES_TO_MODIFY}}`
|
|
96
|
-
| `{{TASK_INSTRUCTIONS}}` | Implementation instructions
|
|
86
|
+
| Variable | Description | Example |
|
|
87
|
+
| ----------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
88
|
+
| `{{PLAN_PATH}}` | Canonical absolute plan path; linear cache is not moved into the feature worktree | `/repo/.ycc/artifacts/user-authentication/parallel-plan.md` |
|
|
89
|
+
| `{{SHARED_PATH}}` | Absolute companion context path; omit its reading item when absent | `/repo/.ycc/artifacts/user-authentication/shared.md` |
|
|
90
|
+
| `{{TASK_ID}}` | Task identifier | `1.1`, `2.3` or `T0`, `T1` |
|
|
91
|
+
| `{{TASK_TITLE}}` | Task title from plan | `Create user model` |
|
|
92
|
+
| `{{FILES_TO_READ}}` | Files from "READ THESE BEFORE TASK" | `- /src/models/base.ts` |
|
|
93
|
+
| `{{FILES_TO_CREATE}}` | Files from "Files to Create" | `- /src/models/user.ts` |
|
|
94
|
+
| `{{FILES_TO_MODIFY}}` | Files from "Files to Modify" | `- /src/index.ts` |
|
|
95
|
+
| `{{TASK_INSTRUCTIONS}}` | Implementation instructions | Detailed task steps |
|
|
97
96
|
|
|
98
97
|
---
|
|
99
98
|
|
|
@@ -113,7 +112,7 @@ When deploying an implementor agent:
|
|
|
113
112
|
|
|
114
113
|
## Example Populated Prompt
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
````
|
|
117
116
|
|
|
118
117
|
Implement Task 1.1: Create user model
|
|
119
118
|
|
|
@@ -196,17 +195,17 @@ After completing the task, provide:
|
|
|
196
195
|
Followed BaseModel pattern exactly. User model ready for validation task 1.2.
|
|
197
196
|
```
|
|
198
197
|
|
|
199
|
-
|
|
198
|
+
````
|
|
200
199
|
|
|
201
200
|
---
|
|
202
201
|
|
|
203
202
|
## Agent Configuration
|
|
204
203
|
|
|
205
|
-
| Setting
|
|
206
|
-
|
|
207
|
-
| Subagent Type | `implementor`
|
|
208
|
-
| Readonly
|
|
209
|
-
| Model
|
|
204
|
+
| Setting | Value |
|
|
205
|
+
| ------------- | ---------------------- |
|
|
206
|
+
| Subagent Type | `implementor` |
|
|
207
|
+
| Readonly | No (must modify files) |
|
|
208
|
+
| Model | Default |
|
|
210
209
|
|
|
211
210
|
## Best Practices
|
|
212
211
|
|
|
@@ -214,4 +213,3 @@ Followed BaseModel pattern exactly. User model ready for validation task 1.2.
|
|
|
214
213
|
2. **Include All Context**: Provide complete file paths and instructions
|
|
215
214
|
3. **Clear Boundaries**: Make it obvious what is in scope vs out of scope
|
|
216
215
|
4. **Validation Required**: Agents must check their work before returning
|
|
217
|
-
```
|
|
@@ -5,18 +5,12 @@
|
|
|
5
5
|
# Output format (one task per line):
|
|
6
6
|
# TASK_ID|TASK_TITLE|DEPENDENCIES
|
|
7
7
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
# pipe field (WORKTREE_PATH) has been removed.
|
|
11
|
-
#
|
|
12
|
-
# Additionally, two header lines are emitted BEFORE the task rows when a
|
|
13
|
-
# "## Worktree Setup" section is detected in the plan (only **Parent** is required
|
|
14
|
-
# for the single-worktree contract; a **Children** list is not required):
|
|
8
|
+
# Two header lines are emitted BEFORE the task rows when the plan has a
|
|
9
|
+
# "## Worktree Setup" section (its **Parent** line supplies the path):
|
|
15
10
|
# WT_PARENT_PATH=<path>
|
|
16
11
|
# WT_FEATURE_SLUG=<slug>
|
|
17
12
|
#
|
|
18
|
-
#
|
|
19
|
-
# (back-compat: the output is identical to the pre-worktree format).
|
|
13
|
+
# Without a "## Worktree Setup" section, neither header line is emitted.
|
|
20
14
|
#
|
|
21
15
|
# Supports two task ID formats:
|
|
22
16
|
# Format A (decimal): #### Task 1.1: Title Depends on [none]
|
|
@@ -121,7 +121,7 @@ Do not dispatch agents or run worktree scripts in dry-run mode.
|
|
|
121
121
|
|
|
122
122
|
- Write the plan to `docs/orchestration/[sanitized-task-name].md`, save the complete orchestration plan for later execution, display its location and a summary.
|
|
123
123
|
- Team creation is skipped entirely; no team cleanup needed.
|
|
124
|
-
- With `WORKTREE_MODE=true`, read dispatch-playbook.md section 3 now and include a `## Worktree Setup` section immediately after frontmatter and before Batch 1, listing only the parent path.
|
|
124
|
+
- With `WORKTREE_MODE=true`, read dispatch-playbook.md section 3 now and include a `## Worktree Setup` section immediately after frontmatter and before Batch 1, listing only the parent path.
|
|
125
125
|
- **Stop here.** Do not deploy agents.
|
|
126
126
|
|
|
127
127
|
## Linear Mode
|
|
@@ -104,7 +104,7 @@ Worktree: feature=<repo-root>/.opencode/worktrees/<repo>-<FEATURE_SLUG>/ (all
|
|
|
104
104
|
When `WORKTREE_MODE=true`, the plan file at `docs/orchestration/[sanitized-task-name].md`
|
|
105
105
|
gains a `## Worktree Setup` section immediately after frontmatter, before Batch 1.
|
|
106
106
|
Follow the annotation format in `{{package-root}}/shared/references/worktree-strategy.md`
|
|
107
|
-
section 2: list only the parent path.
|
|
107
|
+
section 2: list only the parent path.
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
@@ -5,9 +5,9 @@ description: Creates parallel-plan.md from existing shared.md through plan-workf
|
|
|
5
5
|
parallel implementation tasks.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Plan-only mode
|
|
9
9
|
|
|
10
|
-
This skill
|
|
10
|
+
This skill always runs canonical `plan-workflow` with
|
|
11
11
|
`--plan-only --no-checkpoint` (use existing `shared.md`, no interactive
|
|
12
12
|
checkpoint), regardless of `$ARGUMENTS`.
|
|
13
13
|
|
|
@@ -18,14 +18,10 @@ checkpoint), regardless of `$ARGUMENTS`.
|
|
|
18
18
|
- Redundant — silently ignored because already forced: `--plan-only`, `--no-checkpoint`.
|
|
19
19
|
- Every other flag (including `--research-only`, `--optimized`, and any unknown `-`/`--` token) → abort with the usage error below. Do not read the canonical skill or write anything.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Scope
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- DO NOT execute any implementation tasks
|
|
26
|
-
- DO NOT modify application code
|
|
27
|
-
- DO NOT run the implement-plan skill
|
|
28
|
-
- DO NOT proceed beyond creating planning artifacts
|
|
23
|
+
Create planning artifacts only. Leave implementation tasks, application code,
|
|
24
|
+
and the `implement-plan` skill for the user's separate implementation step.
|
|
29
25
|
|
|
30
26
|
**Outputs**:
|
|
31
27
|
|
|
@@ -36,7 +32,7 @@ checkpoint), regardless of `$ARGUMENTS`.
|
|
|
36
32
|
|
|
37
33
|
Canonical `plan-workflow` resolves these paths with the artifact-store `analysis-<name>` and `parallel-plan` kinds. Local mode keeps today's `docs/plans/<feature>/` paths; linear mode resolves under `.ycc/artifacts/<feature>/` and saves only the plan to Linear. Analysis remains local-only.
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
Stop after creating the planning artifacts and displaying the summary.
|
|
40
36
|
|
|
41
37
|
---
|
|
42
38
|
|
|
@@ -167,7 +167,7 @@ Substitute `{{FEATURE_NAME}}` (feature directory name), `{{FEATURE_DIR}}` (`${fe
|
|
|
167
167
|
|
|
168
168
|
### Step 10: Spawn Research Agents (standard mode)
|
|
169
169
|
|
|
170
|
-
Read `references/research-agents.md`.
|
|
170
|
+
Read `references/research-agents.md`. Deploy all 4 research agents in one message with 4 native `subagent` calls so they run in parallel. Every call sets `background=false`, uses the configured agent model, and follows the shared result policy below.
|
|
171
171
|
|
|
172
172
|
| Name | Subagent Type | Output File | Model | Focus |
|
|
173
173
|
| ------------------------- | --------------------------- | -------------------------- | ------ | ---------------------------------------- |
|
|
@@ -255,7 +255,7 @@ Read `{{package-root}}/skills/plan-workflow/references/planning-agents.md` — r
|
|
|
255
255
|
|
|
256
256
|
### Step 20: Spawn Analysis Agents
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
Deploy all 3 analysis agents in one message with 3 native `subagent` calls so they run in parallel. Every call sets `background=false`, uses the configured agent model, and follows the shared result policy below.
|
|
259
259
|
|
|
260
260
|
|
|
261
261
|
| Name | Subagent Type | Output File | Model | Focus |
|
|
@@ -345,7 +345,7 @@ Read `{{package-root}}/skills/plan-workflow/references/validation-agents.md` —
|
|
|
345
345
|
| `path-dep-validator` | `explore` | configured | Verify paths + dependency graph |
|
|
346
346
|
| `completeness-validator` | `codebase-research-analyst` | configured | Task quality + completeness |
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
Deploy all validation agents (3 in standard, 2 in optimized) in one message with one native `subagent` call per validator so they run in parallel. Every call sets `background=false`, uses the configured agent model, and follows the shared result policy below.
|
|
349
349
|
|
|
350
350
|
|
|
351
351
|
### Step 31: Review and Fix Issues
|
|
@@ -220,8 +220,7 @@ Format exactly as defined in
|
|
|
220
220
|
- **Parent**: <repo-root>/.opencode/worktrees/<repo>-<feature-slug>/ (branch: feat/<feature-slug>)
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
All tasks — parallel and sequential — share this single feature worktree.
|
|
224
|
-
add a `**Children**:` list. Do **not** add per-task `**Worktree**:` lines.
|
|
223
|
+
All tasks — parallel and sequential — share this single feature worktree.
|
|
225
224
|
|
|
226
225
|
> **Plan-file handoff**: in local mode, leave `parallel-plan.md` and `shared.md` at their resolved paths in the current checkout (default `docs/plans/<feature-slug>/`). The implementor (`implement-plan` / `prp-implement`) will **move** them into the feature worktree once created — never copied or synced. In linear mode (the default), never move the cache; print `/ycc:implement-plan --store=linear <feature-slug>` as the next step (the implementor loads the plan from the cache). See `worktree-strategy.md` §7 and artifact-store.md "Worktrees".
|
|
227
226
|
|
|
@@ -232,7 +231,6 @@ add a `**Children**:` list. Do **not** add per-task `**Worktree**:` lines.
|
|
|
232
231
|
> before the first batch, following
|
|
233
232
|
> `{{package-root}}/shared/references/worktree-strategy.md` §2.
|
|
234
233
|
> All tasks — parallel and sequential — share this one feature worktree path.
|
|
235
|
-
> Do NOT add a `**Children**:` list. Do NOT add per-task `**Worktree**:` lines.
|
|
236
234
|
|
|
237
235
|
shared-worktree team dispatch: all parallel sub-agents operate against the same
|
|
238
236
|
feature worktree path, not separate per-task paths.
|
|
@@ -8,12 +8,9 @@
|
|
|
8
8
|
# - Dependencies are properly formatted
|
|
9
9
|
# - Phase organization is present
|
|
10
10
|
#
|
|
11
|
-
# Optional
|
|
11
|
+
# Optional section (never flagged as errors):
|
|
12
12
|
# - ## Worktree Setup — emitted by default in plan-workflow / parallel-plan (opt out: --no-worktree)
|
|
13
13
|
#
|
|
14
|
-
# Optional per-task fields (never flagged as errors):
|
|
15
|
-
# - **Worktree**: ... — legacy field; new plans use a single **Parent** worktree only
|
|
16
|
-
#
|
|
17
14
|
# Supports monorepo configurations via .plans-config file.
|
|
18
15
|
# See resolve-plans-dir.sh for configuration options.
|
|
19
16
|
|
|
@@ -175,14 +172,11 @@ else
|
|
|
175
172
|
warning "Missing 'Advice' section"
|
|
176
173
|
fi
|
|
177
174
|
|
|
178
|
-
# Optional. Single
|
|
179
|
-
# per-task **Worktree** lines are legacy and not required in new plans.
|
|
175
|
+
# Optional. Single feature worktree: ## Worktree Setup contains only **Parent**.
|
|
180
176
|
echo ""
|
|
181
177
|
echo "Checking optional worktree annotations..."
|
|
182
178
|
if grep -q "^## Worktree Setup" <<<"$CONTENT"; then
|
|
183
179
|
success "Worktree Setup section present (single feature worktree — see worktree-strategy.md)"
|
|
184
|
-
WORKTREE_TASK_FIELDS=$(echo "$CONTENT" | grep -c '\*\*Worktree\*\*:' || true)
|
|
185
|
-
success " $WORKTREE_TASK_FIELDS legacy per-task **Worktree** field(s) (expected 0 in new plans)"
|
|
186
180
|
else
|
|
187
181
|
echo " (no ## Worktree Setup — plan was generated with --no-worktree)"
|
|
188
182
|
fi
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr-evidence
|
|
3
|
+
description: 'Attaches review evidence to every new pull request: before/after UI
|
|
4
|
+
screenshots across viewports, motion videos, and base-vs-branch benchmark graphs.
|
|
5
|
+
Use when about to open, create or publish a PR, before gh pr create or tea pull
|
|
6
|
+
create.'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# PR Evidence
|
|
10
|
+
|
|
11
|
+
Every pull request an agent opens carries evidence of what changed, so the reviewer
|
|
12
|
+
can see the result instead of inferring it from the diff. UI changes get
|
|
13
|
+
before/after screenshots at several viewports (plus video for motion). Performance
|
|
14
|
+
changes get real base-vs-branch benchmarks with variance and a graph of what
|
|
15
|
+
improved and what regressed. Everything else gets one line saying why no evidence
|
|
16
|
+
was needed.
|
|
17
|
+
|
|
18
|
+
This skill has no command. It applies whenever you are about to create a PR,
|
|
19
|
+
including from `prp-pr` and `git-workflow`. Run it after the branch is
|
|
20
|
+
pushed-ready and before the create call.
|
|
21
|
+
|
|
22
|
+
## Hard rules
|
|
23
|
+
|
|
24
|
+
- **Real or nothing.** Every image comes from running the base and the branch.
|
|
25
|
+
Never mock, edit, or reuse a screenshot, and never estimate a benchmark number.
|
|
26
|
+
When capture is impossible (app needs secrets, a device, or paid services),
|
|
27
|
+
say so in the PR under Evidence with the blocker. Do not skip silently.
|
|
28
|
+
- **Same conditions on both sides.** Same machine, data, viewport, flags, build
|
|
29
|
+
mode and port. Only the code differs.
|
|
30
|
+
- **Never commit evidence to the feature branch.** Keep it under the evidence
|
|
31
|
+
directory below and upload it as PR attachments.
|
|
32
|
+
- **No secrets or personal data in images.** Use seeded or test accounts. Mask
|
|
33
|
+
tokens, emails and live data. Look at every image before upload.
|
|
34
|
+
- **Delegate the capture.** It is long and noisy; keep it out of the main context
|
|
35
|
+
(Phase 2).
|
|
36
|
+
|
|
37
|
+
## Phase 0: Classify
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
"{{package-root}}/skills/pr-evidence/scripts/classify-change.sh" --base origin/<base>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
It prints `kind=ui|perf|ui+perf|none` with reasons. Treat it as a hint and confirm
|
|
44
|
+
against the diff:
|
|
45
|
+
|
|
46
|
+
- **UI** means a user could see the difference: markup, styles, components,
|
|
47
|
+
copy, layout, icons, themes, client-side state that changes what renders, or
|
|
48
|
+
terminal output a user reads. A refactor that should render identically still
|
|
49
|
+
counts when it touches UI files, and the evidence is "no visual change".
|
|
50
|
+
- **Perf** means the PR claims or risks a speed, memory, size or throughput
|
|
51
|
+
change: `perf:` commits, optimisation work, hot-path rewrites, caching,
|
|
52
|
+
dependency or build-flag changes on a hot path, or touched benchmarks.
|
|
53
|
+
- **Skip** (`none`) for docs, tests, CI, release, backport and dependency-bump
|
|
54
|
+
PRs with no runtime effect. Also skip when the user said to.
|
|
55
|
+
|
|
56
|
+
Record the skip reason for the PR body and go to Phase 3.
|
|
57
|
+
|
|
58
|
+
## Phase 1: Prepare
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
SLUG=$(git rev-parse --abbrev-ref HEAD | tr '/' '-')
|
|
62
|
+
EVIDENCE="$(git rev-parse --path-format=absolute --git-common-dir)/pr-evidence/$SLUG"
|
|
63
|
+
MERGE_BASE=$(git merge-base origin/<base> HEAD)
|
|
64
|
+
mkdir -p "$EVIDENCE"
|
|
65
|
+
git worktree add --detach "$EVIDENCE/base-src" "$MERGE_BASE"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The evidence directory lives inside the git directory, so it is never committed
|
|
69
|
+
and every worktree of the repo can reach it. Compare against the merge base, not
|
|
70
|
+
the moving tip of the base branch. Remove the base worktree in Phase 4.
|
|
71
|
+
|
|
72
|
+
## Phase 2: Capture (subagents)
|
|
73
|
+
|
|
74
|
+
Dispatch one `pr-evidence-collector` agent (`@pr-evidence-collector`) per evidence kind (UI and perf in
|
|
75
|
+
parallel, in one message), following
|
|
76
|
+
`{{package-root}}/shared/references/standalone-dispatch.md`. Inline
|
|
77
|
+
everything it needs in the prompt, because agent installs do not ship skill files:
|
|
78
|
+
|
|
79
|
+
- kind (`ui` or `perf`), repo path, base worktree path, merge-base and head SHAs
|
|
80
|
+
- evidence directory (`$EVIDENCE/ui` or `$EVIDENCE/perf`)
|
|
81
|
+
- what changed and where, in a few lines, with the files that matter
|
|
82
|
+
- how to install, build and run the app or benchmarks, if you know
|
|
83
|
+
- absolute paths of the helper scripts:
|
|
84
|
+
`{{package-root}}/skills/pr-evidence/scripts/capture-ui.mjs` and
|
|
85
|
+
`{{package-root}}/skills/pr-evidence/scripts/bench_report.py`
|
|
86
|
+
- the contents of the matching reference:
|
|
87
|
+
`{{package-root}}/skills/pr-evidence/references/ui-evidence.md` or
|
|
88
|
+
`{{package-root}}/skills/pr-evidence/references/perf-evidence.md`
|
|
89
|
+
|
|
90
|
+
**Separate threads.** When the runtime offers task threads instead of subagents
|
|
91
|
+
(for example T3 Code or Orca), start one thread per kind with the same brief.
|
|
92
|
+
Ask it to hand back only the manifest path and its summary, then read the
|
|
93
|
+
manifest from the shared evidence directory. Without subagents or threads, do
|
|
94
|
+
the capture inline, following the same reference.
|
|
95
|
+
|
|
96
|
+
**Hand-back contract.** The collector writes `$EVIDENCE/<kind>/manifest.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"kind": "ui",
|
|
101
|
+
"status": "captured|blocked",
|
|
102
|
+
"blocker": null,
|
|
103
|
+
"summary": "one or two sentences",
|
|
104
|
+
"files": [{ "path": "/abs/file.png", "caption": "Settings, mobile 375x667", "changed": true }],
|
|
105
|
+
"markdown": "/abs/evidence-section.md"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Check that each listed file exists and open two or three of the images yourself.
|
|
110
|
+
If a UI change shows `changed: false` everywhere, the capture probably missed the
|
|
111
|
+
changed screen: send the agent back once with the specific route or state.
|
|
112
|
+
|
|
113
|
+
## Phase 3: Write the Evidence section
|
|
114
|
+
|
|
115
|
+
Build the PR body's `## Evidence` section from
|
|
116
|
+
`{{package-root}}/skills/pr-evidence/references/pr-body-and-hosting.md`.
|
|
117
|
+
It goes right after the summary, so the reviewer sees it first. Keep unchanged
|
|
118
|
+
viewports and raw numbers in `<details>` blocks.
|
|
119
|
+
|
|
120
|
+
## Phase 4: Attach and clean up
|
|
121
|
+
|
|
122
|
+
Upload the files as PR attachments, following the hosting order in
|
|
123
|
+
`pr-body-and-hosting.md`. With gh 2.99 or later, reference each local file in the
|
|
124
|
+
body and pass it to `gh pr create --attach`; gh swaps the paths for uploaded URLs.
|
|
125
|
+
When the PR is created another way (GitHub MCP, `tea`), run
|
|
126
|
+
`gh pr edit <n> --body-file <body> --attach ...` right after. Then:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
git worktree remove --force "$EVIDENCE/base-src"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Keep the rest of `$EVIDENCE` until the PR merges, for re-runs after review.
|
|
133
|
+
|
|
134
|
+
## Updating an open PR
|
|
135
|
+
|
|
136
|
+
When later pushes change the UI or the measured code, re-run the affected kind
|
|
137
|
+
and post the new evidence with `gh pr comment <n> --attach ...`, noting the
|
|
138
|
+
commit it was captured at.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Performance Evidence
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Goal
|
|
6
|
+
- Choose what to measure
|
|
7
|
+
- Conditions
|
|
8
|
+
- Run the benchmarks
|
|
9
|
+
- Framework benchmarks
|
|
10
|
+
- Report and graph
|
|
11
|
+
- Manifest
|
|
12
|
+
|
|
13
|
+
## Goal
|
|
14
|
+
|
|
15
|
+
Show, with real runs of base and branch on the same machine, what got faster or
|
|
16
|
+
slower, by how much, and how sure we are. One graph, one table, honest verdicts.
|
|
17
|
+
|
|
18
|
+
## Choose what to measure
|
|
19
|
+
|
|
20
|
+
Measure the thing the PR claims to improve, plus one or two neighbours it could
|
|
21
|
+
hurt (the same code path with other inputs, memory, startup, bundle size). Use
|
|
22
|
+
the project's existing benchmarks first. When none cover the change, write a
|
|
23
|
+
small, repeatable benchmark in the evidence directory (not in the branch), run
|
|
24
|
+
it against both checkouts, and say so in the PR.
|
|
25
|
+
|
|
26
|
+
Typical measures: wall time of a command, request latency or throughput,
|
|
27
|
+
function time from the language's bench harness, peak memory, binary or bundle
|
|
28
|
+
size, build time.
|
|
29
|
+
|
|
30
|
+
## Conditions
|
|
31
|
+
|
|
32
|
+
- Same machine, same session, nothing heavy running. Note CPU, OS and runtime
|
|
33
|
+
versions in the report.
|
|
34
|
+
- Release or production builds on both sides, built the same way. Build first;
|
|
35
|
+
never time the build unless build time is the subject.
|
|
36
|
+
- Warm up before measuring (`--warmup 3` or the harness's warmup) and take at
|
|
37
|
+
least 10 samples per side; 30 or more when the effect is under 5%.
|
|
38
|
+
- Interleave or alternate base and head runs so drift (thermal throttling,
|
|
39
|
+
background load) hits both. hyperfine runs commands in sequence; repeat the
|
|
40
|
+
whole comparison twice and check the verdicts agree.
|
|
41
|
+
- Same inputs and data sets on both sides. Reset state between runs with
|
|
42
|
+
`--prepare` (caches, temp files, databases).
|
|
43
|
+
- Wall-clock CI runners are noisy. Prefer a local or dedicated machine; when only
|
|
44
|
+
CI is available, raise the sample count and say so.
|
|
45
|
+
|
|
46
|
+
## Run the benchmarks
|
|
47
|
+
|
|
48
|
+
Command-level, with hyperfine (`-n` names must be `base:<bench>` / `head:<bench>`):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
hyperfine -N --warmup 3 --runs 20 --export-json "$EVIDENCE/perf/hyperfine.json" \
|
|
52
|
+
-n base:parse-large "$BASE_SRC/target/release/tool parse fixtures/large.json" \
|
|
53
|
+
-n head:parse-large "./target/release/tool parse fixtures/large.json"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`-N` skips the intermediate shell for commands without pipes. hyperfine 2.x also
|
|
57
|
+
records peak memory, which the report shows as its own row. Use
|
|
58
|
+
`--prepare 'cmd'` to reset state before each run.
|
|
59
|
+
|
|
60
|
+
HTTP services: start base, load it with a fixed request mix (`oha`, `k6`, `wrk`,
|
|
61
|
+
`autocannon`) for a fixed duration after a warm-up period, save per-run
|
|
62
|
+
latency percentiles and throughput, stop it, repeat for head. Run at least 5
|
|
63
|
+
rounds per side and use the per-round numbers as samples.
|
|
64
|
+
|
|
65
|
+
## Framework benchmarks
|
|
66
|
+
|
|
67
|
+
Run the harness in each checkout and convert per-sample numbers into the samples
|
|
68
|
+
JSON that `bench_report.py --samples` reads:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"benchmarks": [
|
|
73
|
+
{ "name": "parse/large", "unit": "s", "lower_is_better": true, "base": [0.0121, 0.0119], "head": [0.0098, 0.0101] }
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- **Rust (criterion):** `cargo bench -- --save-baseline base` in the base worktree,
|
|
79
|
+
then `cargo bench -- --baseline base` on the branch. Read per-sample times from
|
|
80
|
+
`target/criterion/<bench>/{base,new}/sample.json` (`times[i] / iters[i]`, in ns;
|
|
81
|
+
divide by 1e9 for seconds).
|
|
82
|
+
- **Go:** `go test -run='^$' -bench=. -count=10 -benchmem ./... > base.txt` on each
|
|
83
|
+
side; `benchstat base.txt head.txt` for the text table; parse `ns/op` lines into
|
|
84
|
+
samples for the graph.
|
|
85
|
+
- **Python:** `pytest --benchmark-only --benchmark-json=base.json` per side; use
|
|
86
|
+
each benchmark's `stats.data` list.
|
|
87
|
+
- **JavaScript:** `vitest bench --outputJson` or tinybench; use the per-sample
|
|
88
|
+
arrays when exposed, else run the bench 10+ times and use each run's mean.
|
|
89
|
+
- **Bundle or binary size:** one sample per side is exact, so report the bytes
|
|
90
|
+
directly in the table and skip the CI columns.
|
|
91
|
+
|
|
92
|
+
## Report and graph
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
python3 bench_report.py --hyperfine "$EVIDENCE/perf/hyperfine.json" \
|
|
96
|
+
[--samples "$EVIDENCE/perf/samples.json"] \
|
|
97
|
+
--md "$EVIDENCE/perf/table.md" --json "$EVIDENCE/perf/report.json" \
|
|
98
|
+
--svg "$EVIDENCE/perf/chart.svg" --title "<what was measured>"
|
|
99
|
+
node capture-ui.mjs render --input "$EVIDENCE/perf/chart.svg" --out "$EVIDENCE/perf/chart.png" --width 1100
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The table shows median ± standard deviation per side, the change (positive is
|
|
103
|
+
better), a 95% bootstrap confidence interval, run counts and a verdict:
|
|
104
|
+
improved, regressed, no change, or noisy (coefficient of variation over 10%).
|
|
105
|
+
A change counts only when its interval excludes zero and it beats the noise
|
|
106
|
+
floor (`--noise-floor`, default 2%). Report regressions as prominently as
|
|
107
|
+
improvements; a hidden regression costs more than a missing graph.
|
|
108
|
+
|
|
109
|
+
When `node` with Playwright is unavailable, attach `chart.svg` (GitHub renders
|
|
110
|
+
SVG attachments). When a result is noisy, rerun with more samples before
|
|
111
|
+
reporting; if it stays noisy, say so.
|
|
112
|
+
|
|
113
|
+
## Manifest
|
|
114
|
+
|
|
115
|
+
Write `$EVIDENCE/perf/manifest.json` (contract in the skill) and
|
|
116
|
+
`$EVIDENCE/perf/evidence-section.md` with the chart reference (absolute local
|
|
117
|
+
path), the table, the exact commands, sample counts and the machine line. Return
|
|
118
|
+
only the manifest path and a two-sentence summary naming the biggest improvement
|
|
119
|
+
and any regression.
|