| name | desktopdrift-pr |
| description | Use this skill whenever making, verifying, committing or PR-ing a change to this Desktop Drift repo. Triggers — "make a change", "fix this", "push it", "open a PR", "verify the change", "ship this", or any code/asset edit to the game. Encodes the safe loop: branch from main → npm test + node --check → run + browser-verify WITH the service worker cleared (key gotcha) → bump the SW cache version → push → open PR. NEVER push to main (main = live GitHub Pages deploy). |
Desktop Drift — make & verify a change (branch → PR)
The repeatable contribution loop for this repo. Read AGENTS.md + ROADMAP.md +
rules.md first — they are the source of truth (note: DESIGN.md here is a UI
aesthetics skill, not a game design doc).
main → production (GitHub Pages). Pushing to main = live deploy — never do it.
Work on a branch, open a PR.
Steps
- Fresh main + branch.
git fetch origin → git switch main →
git merge --ff-only origin/main → git switch -c <type>/<short>
(feat/, fix/, refactor/, perf/, chore/). New branch per logical change.
- Edit — minimal, per
rules.md (KISS/DRY/YAGNI/SoC). All code is English —
comments, identifiers, strings (rules.md: "use only english throughout"). No
Russian. New pure logic ships with a unit test in the same change.
- Tests + syntax (run before every commit):
npm test — node --test tests/*.test.js, must be green.
node --check on every touched js/*.js.
- Canvas/DOM/game-loop code can't run in Node → it rides the browser smoke test.
- If assets/JS changed → bump the SW cache
desktop-drift-vN in sw.js
(and add any new js module to the ASSETS array). Keep versions monotonic across
parallel branches; on merge, a CACHE-line conflict → take the newest.
The SW is stale-while-revalidate: a forgotten bump self-heals on the next load,
but bumping guarantees a first-load-fresh deploy — so still bump. (Forgetting it was
the v30→v31 prod-staleness bug.)
- Browser smoke test (required for runtime changes). Serve via
.claude/launch.json → config desktopdrift (python3 -m http.server 8777).
- Commit (Conventional Commits:
feat:/fix:/refactor:/perf:/chore:/docs:).
Before pushing, update AGENTS.md/ROADMAP.md to reflect new files/gotchas
(the project's "before every push" rule). Add/extend tests for new pure logic.
- Push + PR.
git push -u origin <branch> → open a PR into main
(https://github.com/letulip/DesktopDrift/pull/new/<branch>).
- Return the working tree to
main.
Merge conflicts
Branches cut before a sibling merged will conflict — usually just the CACHE line in
sw.js/AGENTS.md, occasionally the import block of js/game-engine.js. Fix on the
branch: git merge origin/main, resolve (take the newest cache version; keep both
sides' AGENTS entries), re-check game-engine.js, run tests, push.