Skip to content

Commit 3c1beb9

Browse files
committed
chore(ai): pin sync report range to precise commit SHAs
Record start and end SHAs from the --summary output so follow-up syncs can start exactly where the previous run ended, regardless of whether the range was tag-based, commit-based, or a past-to-past date window.
1 parent 6c52170 commit 3c1beb9

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.agents/skills/storybook-sync/SKILL.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ Fetch the commit list with diff line counts:
8383
bash <skill-dir>/scripts/fetch_upstream.sh --summary --days <N>
8484
```
8585

86-
Output: `HASH|DATE|AUTHOR|SUBJECT|LINES_ADDED+LINES_DELETED` (one per line, oldest first).
86+
Output: `HASH|DATE|AUTHOR|SUBJECT|LINES_ADDED+LINES_DELETED` (one per line, oldest first — the script uses `--reverse`).
87+
88+
**Capture the range bounds from the summary output** — the first line's hash is `START_SHA` (oldest commit in range), the last line's hash is `END_SHA` (newest). These are the actual commits the report covers, regardless of whether the user asked for a date range, tag range, or commit range.
89+
90+
This is critical for reproducibility: `END_SHA` is exactly where the next sync run should start from, and `START_SHA` anchors the beginning to a precise ref even when the user specified a fuzzy bound like `--days 30` or `--since 2026-03-12`.
8791

8892
Based on the commit count:
8993
- **≤ 8 commits** → step 3a (direct analysis)
@@ -168,7 +172,7 @@ Save to `$REPORT_NAME` in the project root.
168172
```markdown
169173
# Storybook Upstream Sync Report
170174

171-
- **Range**: <range description>
175+
- **Range**: <range-label> ([`<START_SHA_SHORT>`](https://github.com/storybookjs/storybook/commit/<START_SHA>)[`<END_SHA_SHORT>`](https://github.com/storybookjs/storybook/commit/<END_SHA>))
172176
- **Generated**: YYYY-MM-DD
173177
- **Upstream branch**: next
174178
- **Commits scanned**: N (after filtering out version bumps and merges)
@@ -203,6 +207,14 @@ Save to `$REPORT_NAME` in the project root.
203207

204208
Commits within each priority section should be in chronological order (oldest first).
205209

210+
**Range line**: always pin both ends to precise linked SHAs — never leave "HEAD" or a bare date. Use `START_SHA` and `END_SHA` from step 2 (the first and last hashes of the `--summary` output). The `<range-label>` is a human-readable description of how the user specified the range:
211+
- `--from v10.0.0 --to v10.1.0``v10.0.0..v10.1.0 ([\`abc1234\`](...)[\`def5678\`](...))`
212+
- `--from v10.0.0` (open end) → `v10.0.0..next ([\`abc1234\`](...)[\`def5678\`](...))`
213+
- `--since 2026-03-12 --until 2026-04-11``2026-03-12..2026-04-11 ([\`abc1234\`](...)[\`def5678\`](...))`
214+
- `--days 30``last 30 days (2026-03-12..2026-04-11) ([\`abc1234\`](...)[\`def5678\`](...))`
215+
216+
This precision is critical for follow-up syncs — `END_SHA` becomes the exact starting ref (`--from <END_SHA>`) for the next run, regardless of whether the range ended at HEAD, a tag, or a past date.
217+
206218
### 5. Offer to create an issue
207219

208220
After writing the report, ask the user if they want to publish it as a GitHub issue in this repository. If yes, create the issue using `gh`:

0 commit comments

Comments
 (0)