Skip to content

Commit b039a10

Browse files
authored
Merge pull request #14 from rhyek/docs/start-stack-example-and-hotfix-skill
Make the startStack example start the service it calls
2 parents dc1892e + 5f5596d commit b039a10

2 files changed

Lines changed: 148 additions & 1 deletion

File tree

‎.claude/skills/hotfix/SKILL.md‎

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
name: hotfix
3+
description: >-
4+
Ship a small, finished fix in the stackctl repo end to end without stopping: branch, commit,
5+
push, pull request, CI, merge, deployment, and a check that the docs site or the npm package
6+
now serves the change. Only when the user invokes /hotfix.
7+
disable-model-invocation: true
8+
allowed-tools:
9+
- Bash(git *)
10+
- Bash(STACKCTL_RECORDINGS_CHECKED=1 git commit *)
11+
- Bash(gh *)
12+
- Bash(pnpm *)
13+
- Bash(node *)
14+
- Bash(npm view *)
15+
- Bash(curl *)
16+
- Bash(./maintenance/scripts/demo/record.sh *)
17+
- Read
18+
- Edit
19+
- Write
20+
---
21+
22+
# Hotfix: ship a small change end to end
23+
24+
`/hotfix` is the user's word to commit, push, open the pull request **and merge it**. It covers
25+
this one change, from start to finish. Don't ask for confirmation at any step, and don't stop
26+
at "PR opened" or "merged": the job ends when the live site or npm serves the change, or when
27+
something fails that you can't fix.
28+
29+
The repo's rules still apply in full: no AI attribution in the commit or PR body, the
30+
recordings check before committing, no personal content, and docs and changelog style.
31+
32+
## 1. Settle what ships
33+
34+
```sh
35+
git fetch -q origin
36+
git status --short
37+
git diff HEAD
38+
```
39+
40+
- **The change is the working tree's uncommitted work.** If nothing is uncommitted, stop and
41+
say so.
42+
- **Leave out anything plainly unrelated** to the fix. Don't stage it, and name it in the
43+
report.
44+
- **Classify the change**, since it decides what step 7 verifies:
45+
- **docs:** it touches `docs/`, `logo/`, the root `package.json` or `pnpm-lock.yaml`, which
46+
trigger `docs.yaml`.
47+
- **package:** a stackctl user would notice it (`packages/stackctl/src`, `assets/`,
48+
`skills/`, its `package.json`). It needs a release: add a patch heading at the top of
49+
`CHANGELOG.md`, one above the latest `v*` tag (`git tag --sort=-v:refname | head -1`), with
50+
the entry in house style (the `clean-changelog-entry` skill's rules). A fix is
51+
`### Fixes`. If the top heading is still unreleased, add to it instead.
52+
- **neither:** tests, CI, maintenance scripts. There's nothing to deploy, and the merge still
53+
has to leave `release` green.
54+
- A change can be both docs and package.
55+
56+
## 2. Branch
57+
58+
Branch from `origin/main`. The uncommitted work comes with you:
59+
60+
```sh
61+
git switch -c <type>/<kebab-summary> origin/main
62+
```
63+
64+
`<type>` is `fix`, `docs`, `test`, `ci`, `chore` or `refactor`. The summary names the change in
65+
two to five words: `docs/consistent-start-stack-example`, `fix/env-reload-on-symlink`.
66+
67+
## 3. Check locally
68+
69+
Run what CI would fail on for this kind of change, so CI doesn't fail first:
70+
71+
- **docs:** `pnpm docs:build` (dead links) and `pnpm lint`.
72+
- **package:** `pnpm build`, `pnpm lint`, `pnpm test`, plus `pnpm test:types` if types changed
73+
and `pnpm test:e2e` if the TUI or CLI did.
74+
- **changelog:** if you touched it, `node maintenance/scripts/changelog.ts check`.
75+
76+
Fix what fails and run it again.
77+
78+
## 4. Commit
79+
80+
Follow the `commit` skill's steps 2 to 4 (`node maintenance/scripts/demo/affected.ts`, judge
81+
each scene, re-record or skip). Prefix the commit with `STACKCTL_RECORDINGS_CHECKED=1` only for
82+
scenes you judged and skipped.
83+
84+
- **Subject:** an imperative sentence in plain words, no prefix, matching `git log`: `Make the
85+
startStack example start the service it calls`.
86+
- **Body:** what changed and why, formal and wrapped at 72 columns.
87+
- **No trailers.**
88+
89+
If the pre-commit hook rewrites files, stage them and commit again. Never `--no-verify`.
90+
91+
## 5. Pull request
92+
93+
```sh
94+
git push -u origin HEAD
95+
gh pr create --base main --title "<commit subject>" --body "<body>"
96+
```
97+
98+
The body is a short summary, then a **Verification** list of what step 3 ran. No attribution
99+
footer.
100+
101+
## 6. CI, then merge
102+
103+
```sh
104+
gh pr checks <n> --watch --fail-fast
105+
```
106+
107+
- **Green:** `gh pr merge <n> --merge --delete-branch`, the merge style `main` already uses.
108+
- **Red from the change:** read the log (`gh run view <id> --log-failed`), fix it, commit and
109+
push, and watch again. After three failed rounds, stop and report, with the PR left open.
110+
- **Red and not from the change** (a flaky test, a runner error): rerun it once
111+
(`gh run rerun <id> --failed`). If it fails again, stop and report.
112+
- **Never** bypass the ruleset: no `--admin`, no disabling checks.
113+
114+
## 7. Deployments, then the live check
115+
116+
Take the merge commit (`gh pr view <n> --json mergeCommit -q .mergeCommit.oid`) and find its
117+
runs. They can take a few seconds to show up:
118+
119+
```sh
120+
gh run list --commit <sha> --json databaseId,workflowName,status,conclusion
121+
gh run watch <id> --exit-status
122+
```
123+
124+
Watch `release`, which runs on every merge, and `docs` when it ran. A run longer than the
125+
command timeout goes in the background. A failed deploy run gets one rerun, then you stop and
126+
report.
127+
128+
Then confirm what users get. A green run is not enough:
129+
130+
- **docs:** fetch each changed page with a cache-busting query and find a phrase only the new
131+
version has: `curl -s "https://stackctl.dev/<page path without .md>?v=<sha>" | grep -F
132+
'<phrase>'`. The page's Markdown copy is at the same path plus `.md`. GitHub Pages can take
133+
a minute or two to serve a deploy, so retry for up to five minutes before calling it failed.
134+
- **package:** `npm view stackctl version` prints the new version,
135+
`gh release view v<version>` exists, and `npm view stackctl@<version> dist.attestations`
136+
shows provenance.
137+
- **neither:** `release` finished green and published nothing.
138+
139+
## 8. Clean up and report
140+
141+
```sh
142+
git switch main && git pull --ff-only -q && git branch -d <branch>
143+
```
144+
145+
Report in a few lines: the PR link, the merge commit, each run and how it ended, and the live
146+
check's result (the URL and phrase, or the npm version). Say what you left out in step 1, any
147+
CI round you had to fix, and any step that failed.

‎docs/reference/sdk.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Starts a headless session as a child of the calling process and resolves once th
5252
every service asked for are healthy. See [Tests and CI](../guide/testing.md).
5353

5454
```ts
55-
const stack = await startStack({ mode: 'test', services: ['web'] });
55+
const stack = await startStack({ mode: 'test', services: ['api'] });
5656
try {
5757
await fetch(`${stack.origins.api}/health`);
5858
} finally {

0 commit comments

Comments
 (0)