Skip to content

Commit ddb73e6

Browse files
alphabtCopilot
andauthored
Improve Copilot guidance for previews and stacked PRs (#65)
* docs: improve Copilot repository guidance Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs: clarify preview command flow Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4a6bd68 commit ddb73e6

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

.github/copilot-instructions.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Mortality is a zero-dependency browser extension (Chrome / Firefox / Edge, MV3)
44
replaces the new tab page with a live counter of your age. There is **no build step**: the
55
files in [`src/`](../src) _are_ the extension (vanilla ES modules, plain CSS, HTML).
66

7+
## Development and validation
8+
9+
- Full test suite: `npm test`.
10+
- Focused test file: `npx vitest run test/<file>.test.js`.
11+
- Formatting gate: `npm run format:check`; use `npm run format` to apply fixes.
12+
- Package gate: `npm run zip`.
13+
- There is no build or lint script. Do not probe generic build/lint commands or pass
14+
Jest-only flags such as `--runInBand` to Vitest.
15+
716
## Design Context
817

918
This project uses the **impeccable** design skill. Before changing any UI, read the two
@@ -31,8 +40,38 @@ To iterate visually, run `/impeccable live` (pre-configured for `src/tab.html`).
3140

3241
## Workflow
3342

34-
- **UI changes:** always open the integrated browser (preview `src/tab.html`, or the dev
35-
server) so the change can be tried out live before it's finalized.
43+
### Preview and browser verification
44+
45+
- For the normal preview, use `npm run dev`, which starts
46+
[`scripts/preview.mjs`](../scripts/preview.mjs). The app's **Run** button is configured by
47+
[`.github/copilot-desktop.yml`](copilot-desktop.yml) to invoke that npm command and open
48+
its URL. Do not create an ad hoc server or mutate Copilot app settings/database state.
49+
- When starting the preview through a tool, keep it running as a detached process, wait for
50+
the printed `Mortality preview ready at ...` URL, verify it responds, then open that URL
51+
in the integrated browser. If the panel is blank or stale, restart the preview or use a
52+
cache-busting URL before diagnosing the extension code.
53+
- Always let the user try UI changes in the integrated browser before finalizing them. The
54+
shipping engines are Chrome/Edge (Chromium) and Firefox (Gecko), however, so reproduce
55+
rendering, caching, or keyboard behavior in a target browser before adding a workaround.
56+
Do not complicate the extension for behavior caused only by the app preview or by a
57+
shortcut captured by its host UI.
58+
59+
### Stacked pull requests
60+
61+
- Before acting on or pushing a layer, run `git fetch origin --prune` and inspect the live
62+
base PR, branch head, and merge state. A SHA supplied at kickoff is a snapshot, not a
63+
durable source of truth; live remote state wins over stale cross-session messages.
64+
- Keep each PR limited to its layer's delta. Do not duplicate, revert, or silently modify
65+
lower-layer behavior.
66+
- If a lower PR is squash-merged and its branch is deleted, replay only the current layer's
67+
commits onto the merged `origin/main`, verify the resulting layer-only diff, and retarget
68+
as needed. Do not recreate the deleted branch or retain an empty/no-content bridge commit.
69+
- Do not restack for every transient review commit. Unless the upper layer is blocked, wait
70+
for the dependency's checks and review to settle, then send dependent sessions one
71+
consolidated update containing only material base or API changes.
72+
73+
### Pull requests
74+
3675
- **Pull requests:** describe UI changes in words in the PR description — do **not** commit
3776
image files or park them on a throwaway asset branch just to embed screenshots from the
3877
CLI; never do that. If a reviewer wants visual proof, attach screenshots by hand via

0 commit comments

Comments
 (0)