@yandy-r/ycc-opencode 6.4.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/branching-model.md +2 -1
- package/shared/references/standalone-dispatch.md +4 -1
- package/shared/references/target-capability-matrix.md +170 -30
- package/shared/references/worktree-strategy.md +9 -31
- package/shared/scripts/lib/ci-classify.sh +2 -2
- package/shared/scripts/release-feature-sets.sh +18 -0
- package/shared/scripts/release_feature_sets.py +232 -0
- package/shared/scripts/setup-worktree.sh +2 -69
- package/skills/bundle-author/references/surface-map.md +1 -1
- package/skills/bundle-author/references/when-not-to-scaffold.md +1 -1
- package/skills/bundle-author/scripts/scaffold-skill.sh +9 -0
- package/skills/bundle-release/SKILL.md +22 -5
- package/skills/bundle-release/references/release-checklist.md +9 -1
- package/skills/bundle-release/references/version-policy.md +11 -4
- 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/SKILL.md +2 -1
- package/skills/formatters/references/flag-reference.md +8 -4
- package/skills/formatters/references/templates/lint-autofix.yml.tmpl +189 -23
- package/skills/formatters/references/templates/lint.yml.tmpl +11 -11
- package/skills/formatters/references/templates/readme-section.md.tmpl +1 -1
- 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/formatters/scripts/bundle/style.sh +2 -2
- package/skills/git-cleanup/SKILL.md +4 -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/references/conventional-commits.md +8 -1
- package/skills/init/references/template-library.md +1 -1
- package/skills/init/templates/git/gitignore.tmpl +2 -0
- package/skills/init/templates/git/gitmessage.tmpl +2 -1
- 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/release-model/templates/RELEASING.md.tmpl +2 -1
- package/skills/releaser/SKILL.md +5 -1
- 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/releaser/references/release-preparation.md +34 -15
- 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
- package/shared/scripts/merge-children.sh +0 -82
- package/skills/write-docs/templates/docs-readme.md +0 -34
|
@@ -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.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# PR Body Evidence Section and Hosting
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Evidence section template
|
|
6
|
+
- Skip lines
|
|
7
|
+
- Hosting order
|
|
8
|
+
- Privacy and size
|
|
9
|
+
|
|
10
|
+
## Evidence section template
|
|
11
|
+
|
|
12
|
+
Place `## Evidence` right after the PR summary (or in the template's closest
|
|
13
|
+
section, such as "Testing" or "Reviewer Notes", when the repo's template has no
|
|
14
|
+
room for a new heading). Reference images by their **local absolute path**; the
|
|
15
|
+
upload step rewrites them to hosted URLs.
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
## Evidence
|
|
19
|
+
|
|
20
|
+
**UI** — captured at `<short-sha>` vs merge-base `<short-sha>`, Chromium, light theme.
|
|
21
|
+
Changed: settings form spacing and error state. No other screens moved.
|
|
22
|
+
|
|
23
|
+
| Viewport | Before · After · Diff |
|
|
24
|
+
| --------------- | ----------------------------------------------------------- |
|
|
25
|
+
| Mobile 375×667 |  |
|
|
26
|
+
| Laptop 1366×768 |  |
|
|
27
|
+
| Wide 2560×1440 |  |
|
|
28
|
+
|
|
29
|
+
Menu opening, after:
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
<details><summary>Unchanged viewports (0.00% diff)</summary>
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
</details>
|
|
38
|
+
|
|
39
|
+
**Performance** — 20 runs per side after 3 warm-ups, Linux x86_64, 8 cores, release build.
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
| Benchmark | Base (median ± sd) | Head (median ± sd) | Change | 95% CI | Runs | Verdict |
|
|
44
|
+
| ----------- | ------------------ | ------------------ | ------ | --------------- | ----- | ----------- |
|
|
45
|
+
| parse-large | 12.1 ms ± 0.2 ms | 9.9 ms ± 0.3 ms | +18.2% | +16.9% … +19.4% | 20/20 | 🟢 improved |
|
|
46
|
+
|
|
47
|
+
<details><summary>How to reproduce</summary>
|
|
48
|
+
|
|
49
|
+
hyperfine -N --warmup 3 --runs 20 -n base:parse-large '…' -n head:parse-large '…'
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Lead with what the reviewer should notice, in one line per kind. Put changed
|
|
55
|
+
viewports first and fold the rest. A video reference must be alone in its
|
|
56
|
+
paragraph or GitHub renders it as a link.
|
|
57
|
+
|
|
58
|
+
## Skip lines
|
|
59
|
+
|
|
60
|
+
When a kind does not apply, write one line instead of the section:
|
|
61
|
+
|
|
62
|
+
- `Evidence: none needed (docs-only change).`
|
|
63
|
+
- `Evidence: UI not captured — the dashboard needs production credentials; reviewer should check /billing at mobile width.`
|
|
64
|
+
- `Evidence: no visual change expected (internal refactor); spot-check composites show 0.00% diff.`
|
|
65
|
+
|
|
66
|
+
## Hosting order
|
|
67
|
+
|
|
68
|
+
Never commit evidence to the feature branch: it bloats history and the diff.
|
|
69
|
+
|
|
70
|
+
1. **gh 2.99 or later on github.com / GHE Cloud** (`gh --version`). Pass every
|
|
71
|
+
referenced file once with `--attach`; gh uploads it and rewrites the matching
|
|
72
|
+
local path in the body. Alt text goes after `#`.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gh pr create --title "<title>" --base <base> --body-file body.md \
|
|
76
|
+
--attach '/abs/compare/settings--mobile.png#Settings, mobile' \
|
|
77
|
+
--attach /abs/after/menu-open--mobile--after.webm
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
For a PR that already exists, or one created through the GitHub MCP tool, use
|
|
81
|
+
`gh pr edit <n> --body-file body.md --attach …`. For evidence captured after
|
|
82
|
+
review, use `gh pr comment <n> --body-file note.md --attach …`. Uploads need
|
|
83
|
+
push access to the repository.
|
|
84
|
+
|
|
85
|
+
2. **Older gh:** upgrade gh when you can. Otherwise push the files to an orphan
|
|
86
|
+
branch named `pr-evidence` (one directory per PR) and reference them as
|
|
87
|
+
`https://github.com/<owner>/<repo>/blob/<sha>/<path>?raw=true`. Pin to the
|
|
88
|
+
commit SHA, not the branch, so later pushes cannot change what the PR shows.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git worktree add --orphan -b pr-evidence "$EVIDENCE/host" # first time only
|
|
92
|
+
# later runs: git worktree add "$EVIDENCE/host" pr-evidence
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
3. **Forgejo or Gitea:** upload each file with the issue-attachments API
|
|
96
|
+
(`POST /api/v1/repos/{owner}/{repo}/issues/{index}/assets`, form field
|
|
97
|
+
`attachment`) after the PR exists, then edit the body with the returned
|
|
98
|
+
`browser_download_url`. If that API is unavailable, use the orphan branch.
|
|
99
|
+
4. **No upload path at all:** keep the files in the evidence directory, list
|
|
100
|
+
their paths in the PR body under Evidence, and tell the user.
|
|
101
|
+
|
|
102
|
+
Do not use public image hosts, gists of a private repository's UI, or release
|
|
103
|
+
assets for PR evidence: they outlive the PR and can leak private work.
|
|
104
|
+
|
|
105
|
+
## Privacy and size
|
|
106
|
+
|
|
107
|
+
- Check every image for secrets, tokens, personal data and customer content
|
|
108
|
+
before upload. Mask (`maskSelectors`) or use seeded data instead.
|
|
109
|
+
- On a public repository, anything attached is public.
|
|
110
|
+
- Limits: images and GIFs 10 MB; video 10 MB on free plans, 100 MB on paid.
|
|
111
|
+
`capture-ui.mjs compose` falls back to JPEG above 9.5 MB. Shorten or scale
|
|
112
|
+
videos that exceed the limit.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# UI Evidence
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Goal
|
|
6
|
+
- Pick what to show
|
|
7
|
+
- Run base and branch
|
|
8
|
+
- Capture spec
|
|
9
|
+
- Shoot and compose
|
|
10
|
+
- Determinism checklist
|
|
11
|
+
- Motion and interaction
|
|
12
|
+
- Non-web interfaces
|
|
13
|
+
- Manifest
|
|
14
|
+
|
|
15
|
+
## Goal
|
|
16
|
+
|
|
17
|
+
The reviewer checks alignment, spacing, overflow and responsiveness at a glance.
|
|
18
|
+
Every changed screen appears at small, medium and large sizes, base next to branch,
|
|
19
|
+
with the pixels that changed highlighted.
|
|
20
|
+
|
|
21
|
+
## Pick what to show
|
|
22
|
+
|
|
23
|
+
Read the diff and list the screens and states the change affects: the page that
|
|
24
|
+
renders a changed component, plus the states that exercise it (empty, loading,
|
|
25
|
+
error, long text, hover, open menu, dark mode when themes changed). Prefer three
|
|
26
|
+
to six well-chosen states over every route in the app. Add one unaffected
|
|
27
|
+
neighbour screen when the change touches shared styles, to show nothing else moved.
|
|
28
|
+
|
|
29
|
+
## Run base and branch
|
|
30
|
+
|
|
31
|
+
Build and serve each checkout the same way, one after the other on the **same
|
|
32
|
+
port** so origin-dependent behaviour matches:
|
|
33
|
+
|
|
34
|
+
1. Install and start the base worktree (`npm ci && npm run build && npm run preview`,
|
|
35
|
+
`npm run dev`, Storybook, or the project's own command). Wait until it answers.
|
|
36
|
+
2. Shoot with `--label before`, then stop the server.
|
|
37
|
+
3. Start the branch the same way, shoot with `--label after`, stop it.
|
|
38
|
+
|
|
39
|
+
Use production builds when the project has them; dev overlays and hot-reload
|
|
40
|
+
banners add noise. Seed the same data on both sides. Use the project's test
|
|
41
|
+
login or `storageState` file, never a real user's session.
|
|
42
|
+
|
|
43
|
+
## Capture spec
|
|
44
|
+
|
|
45
|
+
`capture-ui.mjs` reads a JSON spec:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"routes": [
|
|
50
|
+
{ "name": "settings", "path": "/settings", "waitFor": "[data-testid=settings-form]" },
|
|
51
|
+
{
|
|
52
|
+
"name": "settings-error",
|
|
53
|
+
"path": "/settings",
|
|
54
|
+
"actions": [
|
|
55
|
+
{ "fill": "#email", "value": "not-an-email" },
|
|
56
|
+
{ "click": "button[type=submit]" },
|
|
57
|
+
{ "waitFor": ".field-error" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "menu-open",
|
|
62
|
+
"path": "/",
|
|
63
|
+
"record": true,
|
|
64
|
+
"viewports": ["mobile", "desktop"],
|
|
65
|
+
"actions": [{ "click": "[aria-label=Menu]" }, { "wait": 400 }]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"maskSelectors": ["[data-testid=avatar]", ".timestamp"],
|
|
69
|
+
"hideSelectors": ["#intercom-container"],
|
|
70
|
+
"colorScheme": "light",
|
|
71
|
+
"freezeTime": "2024-01-01T12:00:00Z"
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Actions: `click`, `hover`, `fill` + `value`, `press`, `waitFor`, `scroll`, `wait`
|
|
76
|
+
(milliseconds, last resort). Omit `viewports` to use the defaults:
|
|
77
|
+
|
|
78
|
+
| Name | Size | Why |
|
|
79
|
+
| ------- | ----------- | ----------------------------------- |
|
|
80
|
+
| mobile | 375 x 667 | small phone, touch, 2x density |
|
|
81
|
+
| tablet | 768 x 1024 | breakpoint edge, touch, 2x density |
|
|
82
|
+
| laptop | 1366 x 768 | common low-resolution laptop |
|
|
83
|
+
| desktop | 1920 x 1080 | standard monitor |
|
|
84
|
+
| wide | 2560 x 1440 | large screen, max-width and stretch |
|
|
85
|
+
|
|
86
|
+
Override `viewports` in the spec when the project defines its own breakpoints
|
|
87
|
+
(test one pixel each side of a breakpoint that the change touches). Add a dark
|
|
88
|
+
`colorScheme` run when theme tokens changed.
|
|
89
|
+
|
|
90
|
+
## Shoot and compose
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
node capture-ui.mjs shoot --url http://localhost:3000 --spec spec.json --label before --out "$EVIDENCE/ui/before"
|
|
94
|
+
node capture-ui.mjs shoot --url http://localhost:3000 --spec spec.json --label after --out "$EVIDENCE/ui/after"
|
|
95
|
+
node capture-ui.mjs compose --before "$EVIDENCE/ui/before" --after "$EVIDENCE/ui/after" --out "$EVIDENCE/ui/compare"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`compose` writes one image per route and viewport with three panels (Before,
|
|
99
|
+
After, Diff in red) and `summary.json` with the share of changed pixels. Attach
|
|
100
|
+
the composites, not the raw shots. Playwright resolves from the project first;
|
|
101
|
+
if missing, install it in a scratch directory, not the project's manifest.
|
|
102
|
+
|
|
103
|
+
Before handing back, open every composite and check:
|
|
104
|
+
|
|
105
|
+
- The change is visible where expected, and nothing unexpected moved.
|
|
106
|
+
- Nothing overflows, truncates, overlaps or wraps badly at mobile and tablet.
|
|
107
|
+
- Content does not stretch awkwardly or leave empty gutters at wide.
|
|
108
|
+
- Masks cover only dynamic content (they show as magenta).
|
|
109
|
+
|
|
110
|
+
Report any layout bug you see in the summary; that is the point of the evidence.
|
|
111
|
+
|
|
112
|
+
## Determinism checklist
|
|
113
|
+
|
|
114
|
+
The script already freezes the clock, pins locale and timezone, reduces motion,
|
|
115
|
+
disables CSS animations and transitions, hides the caret, waits for network idle
|
|
116
|
+
and fonts. Two runs of the same build should give a 0% diff. When they do not:
|
|
117
|
+
|
|
118
|
+
- Mask or hide what still changes: timestamps, avatars, ads, maps, charts with
|
|
119
|
+
live data, random IDs, carousels, third-party widgets.
|
|
120
|
+
- Wait for the real ready signal (`waitFor`) instead of adding `wait`.
|
|
121
|
+
- Stub or seed network data; never point both runs at a live API whose data moves.
|
|
122
|
+
- Use the same machine and browser build for both runs; fonts and antialiasing
|
|
123
|
+
differ across operating systems.
|
|
124
|
+
|
|
125
|
+
## Motion and interaction
|
|
126
|
+
|
|
127
|
+
Use a recording when the change is an animation, transition, drag, scroll effect,
|
|
128
|
+
loading sequence or multi-step flow. Set `"record": true` on the route; the script
|
|
129
|
+
saves `<route>--<viewport>--before.webm` and `--after.webm` with reduced motion
|
|
130
|
+
off. Keep each clip under 10 seconds. GitHub renders `.webm` and `.mp4` inline
|
|
131
|
+
(10 MB on free plans, 100 MB on paid). For a looping preview, convert to GIF and
|
|
132
|
+
keep it under 10 MB:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
ffmpeg -y -i in.webm -vf "fps=12,scale=800:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" out.gif
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Non-web interfaces
|
|
139
|
+
|
|
140
|
+
- **Terminal output (CLI, TUI):** record with `vhs` (a `.tape` file per state) or
|
|
141
|
+
capture the before/after output as text in a fenced block.
|
|
142
|
+
- **Native or mobile apps:** use the platform's simulator screenshot command
|
|
143
|
+
(`xcrun simctl io booted screenshot`, `adb exec-out screencap -p`) at the same
|
|
144
|
+
device profile for both builds, then `compose` the PNGs.
|
|
145
|
+
- **Email or PDF output:** render to PNG and compose the same way.
|
|
146
|
+
|
|
147
|
+
## Manifest
|
|
148
|
+
|
|
149
|
+
Write `$EVIDENCE/ui/manifest.json` (contract in the skill) and
|
|
150
|
+
`$EVIDENCE/ui/evidence-section.md`: the UI part of the Evidence section, with
|
|
151
|
+
image references as absolute local paths, changed viewports first and unchanged
|
|
152
|
+
ones inside `<details>`. Return only the manifest path and a two-sentence summary.
|