@looop-games/cli 0.1.2 → 0.1.3
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/bin/looop.mjs +16 -0
- package/lib/bundle-primitives.mjs +77 -0
- package/lib/bundle-primitives.test.mjs +95 -0
- package/lib/create.mjs +110 -81
- package/lib/create.test.mjs +349 -12
- package/lib/dev.mjs +27 -2
- package/lib/dev.test.mjs +52 -0
- package/lib/engine.mjs +2 -2
- package/lib/feedback.mjs +87 -0
- package/lib/feedback.test.mjs +144 -0
- package/lib/npm.mjs +38 -0
- package/lib/npm.test.mjs +61 -0
- package/lib/publish.mjs +18 -3
- package/lib/publish.test.mjs +44 -0
- package/lib/test-cmd.mjs +135 -0
- package/lib/test-cmd.test.mjs +118 -0
- package/lib/update.mjs +51 -0
- package/lib/update.test.mjs +98 -0
- package/package.json +5 -2
- package/template/.claude/skills/build/SKILL.md +240 -0
- package/template/.claude/skills/engine/SKILL.md +59 -0
- package/template/.claude/skills/feedback/SKILL.md +71 -0
- package/template/.claude/skills/qa/SKILL.md +53 -0
- package/template/.claude/skills/todo/SKILL.md +54 -0
- package/template/.claude/skills/update-handbook/SKILL.md +69 -0
- package/template/AGENTS.md +80 -0
- package/template/CLAUDE.md +4 -0
- package/template/GEMINI.md +4 -0
- package/template/boot.smoke.mjs +21 -0
- package/template/game.js +53 -0
- package/template/gitignore +2 -0
- package/template/handbook/design.md +7 -0
- package/template/handbook/feel.md +8 -0
- package/template/handbook/qa.md +9 -0
- package/template/index.html +26 -0
- package/lib/agent-files.mjs +0 -151
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// `looop update` — the CLI verb the demoted /update skill became (cuqfzo Q6):
|
|
2
|
+
// move the game to the latest engine release and re-pin. Pins the contract:
|
|
3
|
+
// - newer release available → pin rewritten to latest, ensureEngine installs
|
|
4
|
+
// - already on latest (pin + install match) → no reinstall, says so
|
|
5
|
+
// - the latest lookup is login-gated like every creator endpoint
|
|
6
|
+
import { test, beforeEach, after } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import { tmpdir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { update } from './update.mjs';
|
|
12
|
+
import { readEnginePin, writeEnginePin } from './engine.mjs';
|
|
13
|
+
import { setToken } from './config.mjs';
|
|
14
|
+
|
|
15
|
+
const base = mkdtempSync(join(tmpdir(), 'looop-update-test-'));
|
|
16
|
+
after(() => rmSync(base, { recursive: true, force: true }));
|
|
17
|
+
|
|
18
|
+
let n = 0;
|
|
19
|
+
let projectDir;
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
projectDir = join(base, `game-${n++}`);
|
|
22
|
+
mkdirSync(projectDir, { recursive: true });
|
|
23
|
+
writeFileSync(join(projectDir, 'index.html'), '<!doctype html>');
|
|
24
|
+
writeFileSync(join(projectDir, 'package.json'), JSON.stringify({ name: 'game', private: true }, null, 2) + '\n');
|
|
25
|
+
process.env.LOOOP_HOME = join(base, `home-${n}`);
|
|
26
|
+
setToken('looop_' + 'a'.repeat(64), { apiBase: 'http://registry.test' });
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function installFakeEngine(dir, version) {
|
|
30
|
+
const engineDir = join(dir, 'node_modules', '@looop-games', 'engine');
|
|
31
|
+
mkdirSync(join(engineDir, 'shared'), { recursive: true });
|
|
32
|
+
mkdirSync(join(engineDir, 'room-server'), { recursive: true });
|
|
33
|
+
writeFileSync(join(engineDir, 'package.json'), JSON.stringify({ name: '@looop-games/engine', version }));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const listResponse = (latest) => ({ ok: true, status: 200, json: async () => ({ latest, versions: [latest] }) });
|
|
37
|
+
|
|
38
|
+
test('moves the pin to latest and installs through ensureEngine', async () => {
|
|
39
|
+
writeEnginePin(projectDir, '0.1.0');
|
|
40
|
+
installFakeEngine(projectDir, '0.1.0');
|
|
41
|
+
const ensureCalls = [];
|
|
42
|
+
const result = await update({
|
|
43
|
+
cwd: projectDir,
|
|
44
|
+
apiBase: 'http://registry.test',
|
|
45
|
+
log: () => {},
|
|
46
|
+
fetchImpl: async (url, opts) => {
|
|
47
|
+
assert.equal(url, 'http://registry.test/api/creator/engine');
|
|
48
|
+
assert.match(opts.headers.Authorization, /^Bearer looop_/);
|
|
49
|
+
return listResponse('0.2.0');
|
|
50
|
+
},
|
|
51
|
+
ensure: async (dir, opts) => {
|
|
52
|
+
ensureCalls.push(dir);
|
|
53
|
+
installFakeEngine(dir, '0.2.0'); // what the real ensureEngine would do
|
|
54
|
+
return { version: '0.2.0' };
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
assert.deepEqual(ensureCalls, [projectDir]);
|
|
58
|
+
assert.equal(readEnginePin(projectDir), '0.2.0', 'pin rewritten before ensure so it installs the new version');
|
|
59
|
+
assert.deepEqual({ from: result.from, to: result.to }, { from: '0.1.0', to: '0.2.0' });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('already on latest: no reinstall, reports up to date', async () => {
|
|
63
|
+
writeEnginePin(projectDir, '0.2.0');
|
|
64
|
+
installFakeEngine(projectDir, '0.2.0');
|
|
65
|
+
let ensured = 0;
|
|
66
|
+
const lines = [];
|
|
67
|
+
const result = await update({
|
|
68
|
+
cwd: projectDir,
|
|
69
|
+
apiBase: 'http://registry.test',
|
|
70
|
+
log: (s) => lines.push(s),
|
|
71
|
+
fetchImpl: async () => listResponse('0.2.0'),
|
|
72
|
+
ensure: async () => {
|
|
73
|
+
ensured += 1;
|
|
74
|
+
return { version: '0.2.0' };
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
assert.equal(ensured, 0, 'nothing reinstalled');
|
|
78
|
+
assert.equal(result.to, '0.2.0');
|
|
79
|
+
assert.match(lines.join('\n'), /up to date/i);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('rejected token: clear login hint, pin untouched', async () => {
|
|
83
|
+
writeEnginePin(projectDir, '0.1.0');
|
|
84
|
+
await assert.rejects(
|
|
85
|
+
() =>
|
|
86
|
+
update({
|
|
87
|
+
cwd: projectDir,
|
|
88
|
+
apiBase: 'http://registry.test',
|
|
89
|
+
log: () => {},
|
|
90
|
+
fetchImpl: async () => ({ ok: false, status: 401 }),
|
|
91
|
+
ensure: async () => {
|
|
92
|
+
throw new Error('must not reach ensure');
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
/looop login/,
|
|
96
|
+
);
|
|
97
|
+
assert.equal(readEnginePin(projectDir), '0.1.0');
|
|
98
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looop-games/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Looop game development CLI — dev server, login, and publishing for standalone Looop games.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
12
|
-
"lib"
|
|
12
|
+
"lib",
|
|
13
|
+
"template"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=20.11"
|
|
@@ -18,6 +19,8 @@
|
|
|
18
19
|
"test": "node --test 'lib/*.test.mjs'"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
22
|
+
"cross-spawn": "^7.0.6",
|
|
23
|
+
"esbuild": "^0.28.0",
|
|
21
24
|
"partykit": "^0.0.115"
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: The Looop build loop — the one way game work happens in this repo. Use when the creator wants to make their game, add or change a feature, start something new, or continue where a previous session left off ("let's build", "keep going", "add X", "make it so Y"). Runs from a plan in notes/plans/ — continues the plan if one exists, creates one if not.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /build — the loop that builds this game
|
|
7
|
+
|
|
8
|
+
You are building for a creator who is probably not a developer. They bring the
|
|
9
|
+
vision and the judgment calls; you bring everything else. This skill is the
|
|
10
|
+
process — one repo, one game, one loop:
|
|
11
|
+
|
|
12
|
+
> **plan → discuss → build in milestones of auto-verified steps → the creator
|
|
13
|
+
> playtests → offer publish**
|
|
14
|
+
|
|
15
|
+
Two words carry this loop, sized by the words themselves:
|
|
16
|
+
|
|
17
|
+
- A **milestone** is a big, vertical increment the creator can actually play —
|
|
18
|
+
the loop's unit of *their* attention. **The creator playtests at every
|
|
19
|
+
milestone.**
|
|
20
|
+
- A **step** is a small build increment inside a milestone. **Every step is
|
|
21
|
+
auto-verified by you** — the creator is never asked to approve steps.
|
|
22
|
+
|
|
23
|
+
## When to collapse the ceremony
|
|
24
|
+
|
|
25
|
+
A trivial direct request ("make the ball a bit faster") doesn't need the full
|
|
26
|
+
loop: make the change, verify it, one line in the plan's log if a plan exists.
|
|
27
|
+
The loop is for real increments — new mechanics, features, session-scale work.
|
|
28
|
+
The tell: if the creator will want to *play* the result to judge it, it's a
|
|
29
|
+
milestone and it runs through the loop.
|
|
30
|
+
|
|
31
|
+
**Collapse never applies when there is no plan yet.** Starting something new
|
|
32
|
+
runs through the §2 discussion — the plan records the creator's answers, so
|
|
33
|
+
it cannot exist before they've answered.
|
|
34
|
+
|
|
35
|
+
## 1. Anchor on the plan
|
|
36
|
+
|
|
37
|
+
Every build runs from a **plan** — a file in `notes/plans/`. A build without a
|
|
38
|
+
plan doesn't exist; the plan is the loop's spine and the next session's recap.
|
|
39
|
+
|
|
40
|
+
- **A plan exists** (look in `notes/plans/`) → CONTINUE it. Read it fully —
|
|
41
|
+
vision, decisions, the milestone checklist, the log — and pick up exactly
|
|
42
|
+
where it left off. Don't make the creator repeat themselves.
|
|
43
|
+
- **No plan** → START one (create `notes/plans/<YYYY-MM-DD-HHMM>-<short-name>.md`
|
|
44
|
+
— creation datetime first, always, so plans list in order and the newest is
|
|
45
|
+
findable at a glance), through the discussion below. A `/todo` being
|
|
46
|
+
promoted becomes a plan the same way.
|
|
47
|
+
|
|
48
|
+
Plan shape (keep it lean — decisions and why, never pasted code):
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
---
|
|
52
|
+
status: in_progress # in_progress | done | paused | abandoned
|
|
53
|
+
created: YYYY-MM-DD
|
|
54
|
+
updated: YYYY-MM-DD
|
|
55
|
+
---
|
|
56
|
+
# <What we're building>
|
|
57
|
+
|
|
58
|
+
## Vision
|
|
59
|
+
What this wants to be at its best, in the creator's words.
|
|
60
|
+
|
|
61
|
+
## Decisions
|
|
62
|
+
- **<choice>** — what was decided and why (one entry per real decision).
|
|
63
|
+
|
|
64
|
+
## Out of scope
|
|
65
|
+
- **<cut>** — why it's out (one line per cut). As load-bearing as Decisions:
|
|
66
|
+
every "we could also…" that got trimmed lands here, so it stays trimmed.
|
|
67
|
+
|
|
68
|
+
## Milestones
|
|
69
|
+
### Milestone 1 — <name> _(playtest: what the creator checks)_
|
|
70
|
+
- [x] step
|
|
71
|
+
- [ ] step
|
|
72
|
+
|
|
73
|
+
## Log
|
|
74
|
+
- YYYY-MM-DD — what happened, in a few lines. Newest first.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 2. Discuss before building
|
|
78
|
+
|
|
79
|
+
Before code, get the shape right with the creator — and record it in the plan.
|
|
80
|
+
|
|
81
|
+
**Building (§3) runs only from a plan whose decisions are settled — and a
|
|
82
|
+
decision is settled by the creator answering, never by you choosing for
|
|
83
|
+
them.** A new build request therefore starts as a conversation, one decision
|
|
84
|
+
at a time:
|
|
85
|
+
|
|
86
|
+
- **One decision per turn.** Pose it, resolve it fully, record it in the
|
|
87
|
+
plan, then move to the next. Never a batch of questions — and never a
|
|
88
|
+
finished plan (or code, or tests) as your opening move.
|
|
89
|
+
- **Explain the problem before the options.** The creator can't choose
|
|
90
|
+
between options they don't have the picture for. If they ask "what is X?",
|
|
91
|
+
stop and explain X cleanly; the decision waits. If they say "I don't
|
|
92
|
+
understand", don't restate the options louder — back up and re-explain the
|
|
93
|
+
underlying problem from scratch, with concrete examples.
|
|
94
|
+
- **2–3 options with honest pros/cons, and your lean stated** — make it easy
|
|
95
|
+
to say "do that" or override you. Don't stack the deck, and don't fake
|
|
96
|
+
confidence on a genuine 50/50: phrase the case for the other option clearly
|
|
97
|
+
enough that the creator can pick it up if they disagree.
|
|
98
|
+
- **Lock it in visibly** — say "Locking in: <choice>" and write it into the
|
|
99
|
+
plan's Decisions as it lands, so the record never lags the conversation.
|
|
100
|
+
|
|
101
|
+
**Every decision that shapes the game reaches the creator, framed by its
|
|
102
|
+
consequences** — the way an engineer briefs a product manager. Not "authority
|
|
103
|
+
vs. client prediction?" but "if X, joining mid-game is instant but scores can
|
|
104
|
+
briefly disagree; with Y it's the reverse — which matters more here?" Give 2–3
|
|
105
|
+
options with honest trade-offs and your lean. The technical detail stays
|
|
106
|
+
available underneath for whoever pulls the thread.
|
|
107
|
+
|
|
108
|
+
**Silently decide only what is consequence-free for the creator** — naming,
|
|
109
|
+
file layout, code structure. The test is *"is the creator the right person to
|
|
110
|
+
answer this?"*, not "is this technical?" A technical fork with a consequence
|
|
111
|
+
they'd care about (feel, fairness, what can break) goes to them; one with no
|
|
112
|
+
creator-visible consequence does not. Never hide a real fork to keep things
|
|
113
|
+
simple — there is always a non-confusing way to ask it.
|
|
114
|
+
|
|
115
|
+
**Default to the smallest build that meets the creator's ask — never inflate
|
|
116
|
+
scope.** Every "we could also…" and every richer-than-asked option is scope
|
|
117
|
+
YOU are injecting; the creator can't push back on over-building they didn't
|
|
118
|
+
ask for. Surface extras as explicitly optional, record what was ruled out in
|
|
119
|
+
the plan (an "Out of scope" line per cut), and when a discussion has stacked
|
|
120
|
+
several decisions, recap the accumulated size so the creator can trim.
|
|
121
|
+
|
|
122
|
+
Then cut the work into **milestones**: each one vertical, end-to-end, playable
|
|
123
|
+
on its own. The FIRST milestone is the thinnest playable thing that proves the
|
|
124
|
+
riskiest idea — if the core bet is wrong, the creator learns it after one
|
|
125
|
+
milestone, not after the whole build. Write the milestones into the plan, each
|
|
126
|
+
with its `_(playtest: …)_` note.
|
|
127
|
+
|
|
128
|
+
## 3. Build a milestone
|
|
129
|
+
|
|
130
|
+
Run the steps **autonomously — no approval gates between steps**, just brief
|
|
131
|
+
progress notes:
|
|
132
|
+
|
|
133
|
+
1. Consult what's already known before writing new systems: `handbook/`
|
|
134
|
+
(this game's locked truths), the engine practices
|
|
135
|
+
(`node_modules/@looop-games/engine/shared/practices/`), and `/engine` for
|
|
136
|
+
components that already exist — don't reinvent a library.
|
|
137
|
+
2. Where a behaviour has a real contract, write the failing test/smoke first,
|
|
138
|
+
then the code.
|
|
139
|
+
3. **After every step, verify it yourself — run `/qa` on what the step
|
|
140
|
+
changed.** The steps themselves live in the engine's master QA doc
|
|
141
|
+
(`node_modules/@looop-games/engine/shared/practices/qa.md`); `/qa` reads
|
|
142
|
+
and runs them — **including the review rows: fresh sub-agent reviewers
|
|
143
|
+
(code-quality + test-thoroughness) on the step's diff, findings resolved
|
|
144
|
+
red→green before the step counts as done.** Every automated step runs at
|
|
145
|
+
step cadence; only the playtest is per-milestone. You are the only tester
|
|
146
|
+
inside a milestone — act like it.
|
|
147
|
+
4. **If a fix doesn't land on the first re-test, diagnose — don't
|
|
148
|
+
second-guess.** Revert it, add instrumentation, find the actual cause;
|
|
149
|
+
never ship a second guess stacked on the first.
|
|
150
|
+
5. **A real fork discovered mid-step goes to the creator**, framed by its
|
|
151
|
+
consequences like every other game-shaping decision — never silently
|
|
152
|
+
resolved just because the build is rolling.
|
|
153
|
+
6. **Never narrow scope silently.** Build the full milestone that was agreed;
|
|
154
|
+
if a constraint forces something smaller, surface it at the gate — don't
|
|
155
|
+
quietly ship the lesser version.
|
|
156
|
+
7. Tick the step off in the plan as it lands.
|
|
157
|
+
|
|
158
|
+
## 3½. Close the milestone — before the creator ever sees it
|
|
159
|
+
|
|
160
|
+
Every step already passed its own `/qa` — including the per-step review
|
|
161
|
+
sub-agents. The milestone close is the whole-greater-than-parts check before
|
|
162
|
+
the ONE manual gate: run the full **`npx looop test`** suite (everything, not
|
|
163
|
+
just what the last step touched), re-drive the milestone's headline behaviour
|
|
164
|
+
end-to-end yourself, and for anything LLM-authored/generative run the
|
|
165
|
+
**verdict-mix** row (judged scenarios, never a green check). Anything found
|
|
166
|
+
here is fixed **red→green** — the failing test first, then the fix. Only then
|
|
167
|
+
hand back.
|
|
168
|
+
|
|
169
|
+
## 4. The playtest gate
|
|
170
|
+
|
|
171
|
+
When the milestone's steps are done and verified, hand it to the creator —
|
|
172
|
+
this is the one place the loop stops for a human:
|
|
173
|
+
|
|
174
|
+
- **The game is already RUNNING when you hand back — you run the server,
|
|
175
|
+
never the creator.** If the dev stack isn't up, start it yourself
|
|
176
|
+
(`npx looop dev`, backgrounded) and confirm the game URL answers before
|
|
177
|
+
handing over; if one is already running, reuse it. The creator gets a
|
|
178
|
+
**link to click** — `http://localhost:8000/games/<name>/index.html` (plus
|
|
179
|
+
the phone/LAN URL when touch is part of the playtest) — never a command
|
|
180
|
+
to paste. Asking them to run a server is asking them to learn infra.
|
|
181
|
+
- **A minimal checklist of genuinely human-judgment items** — feel, look,
|
|
182
|
+
"does this play the way you imagined". Never hand them a check you could
|
|
183
|
+
have run yourself; you already ran those, report the results instead.
|
|
184
|
+
|
|
185
|
+
Outcomes:
|
|
186
|
+
|
|
187
|
+
- **It lands** → save it (a commit — `milestone: <name>`), check it off in
|
|
188
|
+
the plan, update the log, move on. The saves at accepted milestones are the
|
|
189
|
+
game's restore points.
|
|
190
|
+
- **Close, needs iteration** → adjust within the milestone and hand back.
|
|
191
|
+
- **Wrong direction** → offer the revert plainly, no sunk-cost defence:
|
|
192
|
+
back to the last save (`git reset --hard` — nothing was saved mid-milestone,
|
|
193
|
+
so that's the last accepted state).
|
|
194
|
+
- **The playtest caught a defect you missed** → that's a hole in the
|
|
195
|
+
verification, not just a bug. Fix it, then run `/update-handbook` so this
|
|
196
|
+
class of defect gets an automated check and never reaches a playtest again.
|
|
197
|
+
|
|
198
|
+
## 5. Offer publish — never publish on your own
|
|
199
|
+
|
|
200
|
+
After a milestone lands, offer it: `npx looop publish` puts the game live at
|
|
201
|
+
`play.looop.games/g/<name>`. Publishing is **always the creator's explicit
|
|
202
|
+
call** — `/build` never runs it unprompted. For a variant the creator wants to
|
|
203
|
+
compare against the live game, `npx looop publish --slug <alt>` publishes an
|
|
204
|
+
isolated A/B copy (own URL, own room) without touching the real one.
|
|
205
|
+
|
|
206
|
+
## Parallel lanes (advanced)
|
|
207
|
+
|
|
208
|
+
A creator can run several `/build` experiments on one game at once. A lane is
|
|
209
|
+
just this loop in a git worktree:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# in the main checkout. git worktree needs the repo to have at least one
|
|
213
|
+
# commit (on a never-saved repo it silently creates an EMPTY orphan lane) —
|
|
214
|
+
# this saves ONLY in that case, and is a no-op otherwise:
|
|
215
|
+
git rev-parse HEAD >/dev/null 2>&1 || { git add -A && git commit -m "save: initial"; }
|
|
216
|
+
|
|
217
|
+
git worktree add ../<name>-<lane> # one folder per experiment
|
|
218
|
+
cd ../<name>-<lane> && npm install # node_modules is gitignored — without
|
|
219
|
+
# this, npx falls through to a WRONG
|
|
220
|
+
# public 'looop' package and crashes
|
|
221
|
+
# with a misleading error
|
|
222
|
+
npx looop dev --port 8010 # DISTINCT --port per lane (8010, 8020, …)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
- **The lane serves `/games/<worktree-folder-name>/…`** — the folder name, not
|
|
226
|
+
the original game slug. Use the URL the dev banner prints. The folder name
|
|
227
|
+
also keys the lane's multiplayer room.
|
|
228
|
+
- Every lane needs its own `--port`: the port shifts the whole stack together
|
|
229
|
+
— game, multiplayer, services — so lanes are fully isolated (distinct
|
|
230
|
+
server processes per lane; `looop test` inside one lane picks its own free
|
|
231
|
+
ports and doesn't disturb the others).
|
|
232
|
+
- Each lane keeps its own plan progress; save/playtest semantics are
|
|
233
|
+
unchanged inside a lane.
|
|
234
|
+
- Compare lanes live with `publish --slug <lane>` variants.
|
|
235
|
+
- Land the winner: save it in the lane (`git add -A && git commit`), then from
|
|
236
|
+
the main checkout `git merge <lane-branch>`, then
|
|
237
|
+
`git worktree remove ../<name>-<lane>` and delete the lane branch.
|
|
238
|
+
- **If the merge conflicts, stop — never auto-resolve.** Show the creator
|
|
239
|
+
what collided (in game terms: "both lanes changed how jumping feels") and
|
|
240
|
+
resolve it with them.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: engine
|
|
3
|
+
description: Discover what the Looop engine already provides before building something from scratch — components (rooms, physics, audio, joysticks, leaderboards, LLM NPCs…), craft docs, and how to customize engine behaviour. Use when the creator asks "can it do X?", when you're about to write a system a game engine would normally provide, or when tuning game feel.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /engine — what Looop already gives you
|
|
7
|
+
|
|
8
|
+
The engine is installed at `node_modules/@looop-games/engine` (downloaded by
|
|
9
|
+
`looop dev`, pinned in `package.json`'s `looop.engine`). Before writing any
|
|
10
|
+
system from scratch — movement, audio, UI, chat, NPCs, scoring — check whether
|
|
11
|
+
the engine already has it. Reinventing a library is the most common way a game
|
|
12
|
+
gets worse.
|
|
13
|
+
|
|
14
|
+
## Discover
|
|
15
|
+
|
|
16
|
+
1. **Start at the index:**
|
|
17
|
+
`node_modules/@looop-games/engine/shared/ui/INDEX.md` — the component
|
|
18
|
+
library at a glance, one line per component.
|
|
19
|
+
2. **Read the component's README before using it** —
|
|
20
|
+
`node_modules/@looop-games/engine/shared/ui/<component>/README.md`. Each
|
|
21
|
+
documents its import, API, and the practices around it.
|
|
22
|
+
3. **Import by absolute path**, e.g.
|
|
23
|
+
`import { createRoom } from '/shared/ui/room/client.js'`. In dev and in
|
|
24
|
+
production those resolve to the installed engine version — never to files
|
|
25
|
+
you can edit.
|
|
26
|
+
|
|
27
|
+
## The craft docs
|
|
28
|
+
|
|
29
|
+
`node_modules/@looop-games/engine/shared/practices/` is the engine's
|
|
30
|
+
accumulated craft knowledge and applies to every game:
|
|
31
|
+
|
|
32
|
+
- `feel.md` — what makes a game feel good; read before tuning anything.
|
|
33
|
+
- `architecture.md` — how Looop games are structured.
|
|
34
|
+
- `multiplayer.md` — authority, prediction, and the rules of shared state.
|
|
35
|
+
- `qa.md` — the master verification list (`/qa` runs it).
|
|
36
|
+
|
|
37
|
+
**Game feel specifically:** the `tweaks` library
|
|
38
|
+
(`shared/ui/tweaks/` — see its README) is the engine's tuning surface; use it
|
|
39
|
+
with `feel.md` rather than scattering magic numbers.
|
|
40
|
+
|
|
41
|
+
## Customize — overrides, never edits
|
|
42
|
+
|
|
43
|
+
The engine is read-only; never edit `node_modules`. To change how an engine
|
|
44
|
+
file behaves for THIS game:
|
|
45
|
+
|
|
46
|
+
1. Copy it to `overrides/shared/<same path as under shared/>`.
|
|
47
|
+
2. Edit the copy. Dev and publish both serve your override instead of the
|
|
48
|
+
official module — game imports stay `/shared/...`, never rewritten.
|
|
49
|
+
|
|
50
|
+
An override is a fork: that file stops receiving engine updates until you
|
|
51
|
+
re-port it. Prefer game-local code when it can live in the game; override only
|
|
52
|
+
when the behaviour truly must change inside the engine module.
|
|
53
|
+
|
|
54
|
+
## When the engine falls short
|
|
55
|
+
|
|
56
|
+
- The engine has the component but it's **broken or missing something every
|
|
57
|
+
game would want** → that's platform feedback: `/feedback`.
|
|
58
|
+
- The need is **specific to this game** → build it game-local (or override),
|
|
59
|
+
and note in `handbook/design.md` if it's a pillar.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feedback
|
|
3
|
+
description: File feedback to the Looop team when something in Looop ITSELF seems broken or missing — the engine, a shared component, the looop CLI, login, publishing, the platform. Use the moment you or the creator notice "this looks like a Looop bug, not our game" — offer to file it right away, don't wait to be asked.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /feedback — tell Looop when Looop is the problem
|
|
7
|
+
|
|
8
|
+
You are often the only witness when the platform misbehaves. The reflex this
|
|
9
|
+
skill exists for: the moment something smells like a **Looop** defect — an
|
|
10
|
+
engine component behaving wrong, a `looop` command failing strangely, docs
|
|
11
|
+
that lied, a missing capability every game would want — **offer to file it**:
|
|
12
|
+
"that looks like a Looop bug, want me to send it to the Looop team?"
|
|
13
|
+
|
|
14
|
+
This game's own bugs are NOT feedback — they're `/todo`s or just fixes.
|
|
15
|
+
|
|
16
|
+
## What to file
|
|
17
|
+
|
|
18
|
+
Write the report to `notes/feedback/<YYYY-MM-DD-HHMM>-<short-slug>.md`
|
|
19
|
+
(creation datetime first, like everything under `notes/`). **You are the author,
|
|
20
|
+
not the creator — so be maximal.** The Looop team gets nothing but this file;
|
|
21
|
+
they can't ask you follow-ups, re-run your session, or see your screen. Every
|
|
22
|
+
detail you leave out is a detail they'll have to guess. Include:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
---
|
|
26
|
+
created: YYYY-MM-DD
|
|
27
|
+
engine: <the looop.engine pin from package.json>
|
|
28
|
+
cli: <@looop-games/cli version from package.json devDependencies>
|
|
29
|
+
---
|
|
30
|
+
# <One line: what's wrong>
|
|
31
|
+
|
|
32
|
+
**What happened:** …
|
|
33
|
+
**What was expected:** …
|
|
34
|
+
|
|
35
|
+
## Environment
|
|
36
|
+
OS, node version, and anything unusual about the setup (worktree lane,
|
|
37
|
+
custom port, offline, …).
|
|
38
|
+
|
|
39
|
+
## Reproduction
|
|
40
|
+
The smallest steps/snippet that shows it. Exact commands **with their full
|
|
41
|
+
output pasted verbatim** — never summarize an error message.
|
|
42
|
+
|
|
43
|
+
## Transcript
|
|
44
|
+
The conversation that surfaced this, quoted verbatim — from the creator's
|
|
45
|
+
request that first hit the problem through your diagnosis: what they asked,
|
|
46
|
+
what you ran, what came back, what you ruled out. This is usually the most
|
|
47
|
+
valuable section; a reader should be able to replay your session from it.
|
|
48
|
+
|
|
49
|
+
## Workaround used (if any)
|
|
50
|
+
e.g. an overrides/shared/ copy, so the team knows what to un-fork once fixed.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Trim game-specific noise, never evidence: cut what's irrelevant to the
|
|
54
|
+
defect, keep everything that shows it. (The intake caps a report at 256 KiB —
|
|
55
|
+
if the transcript pushes past that, cut it down to the relevant exchange.)
|
|
56
|
+
|
|
57
|
+
## Send it
|
|
58
|
+
|
|
59
|
+
1. Run **`npx looop feedback`** — it delivers every unsent report under
|
|
60
|
+
`notes/feedback/` to the Looop team (login required; it's the same account
|
|
61
|
+
as publishing) and stamps each delivered file with `sent:` + `id:` in its
|
|
62
|
+
frontmatter so it never ships twice.
|
|
63
|
+
2. If the send fails (offline, not logged in), the file stays unstamped —
|
|
64
|
+
just run `npx looop feedback` again later; it retries everything unsent.
|
|
65
|
+
|
|
66
|
+
## Why bother
|
|
67
|
+
|
|
68
|
+
An override that patches an engine bug is a fork that stops receiving updates;
|
|
69
|
+
feedback is how the fix lands upstream so the fork can be deleted. And a
|
|
70
|
+
missing capability filed from a real game is exactly how the engine decides
|
|
71
|
+
what to build next.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa
|
|
3
|
+
description: Verify the current change — run every automated check that applies and hand the creator only the shortest possible list of things that genuinely need human eyes. Use when the creator asks "does it work?", before any playtest handback, or whenever work is about to be called done.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /qa — run the game's checks, hand back only what needs a human
|
|
7
|
+
|
|
8
|
+
The QA framework lives in ONE place: the engine's master doc at
|
|
9
|
+
`node_modules/@looop-games/engine/shared/practices/qa.md` — what counts as an
|
|
10
|
+
**automated** step (you run it, you report it) vs a **manual** one (only the
|
|
11
|
+
creator can judge it), the ratchet, and the master steps list. **Read it
|
|
12
|
+
first, every time. This skill is the procedure; the steps live there.**
|
|
13
|
+
|
|
14
|
+
The governing rule (from that doc): **maximize automated, drive manual toward
|
|
15
|
+
zero.** Anything you *can* run, you run and report — it never goes on the
|
|
16
|
+
creator's list.
|
|
17
|
+
|
|
18
|
+
## The three sources of checks (merge all three)
|
|
19
|
+
|
|
20
|
+
1. **Executable checks — `npx looop test`.** Discovers and runs every
|
|
21
|
+
`*.test.mjs` and `*.smoke.mjs` in this folder against a real dev stack.
|
|
22
|
+
The files ARE the list; always the whole gate, not just new tests.
|
|
23
|
+
2. **This game's earned checks — `handbook/qa.md`.** Procedural steps this
|
|
24
|
+
specific game accumulated (past playtest catches, fragile spots).
|
|
25
|
+
3. **The engine master list** — the doc above. Generic steps every Looop game
|
|
26
|
+
is checked against.
|
|
27
|
+
|
|
28
|
+
## Procedure
|
|
29
|
+
|
|
30
|
+
1. **Scope the change** — which surfaces did it touch? That selects which
|
|
31
|
+
master-list rows and handbook steps apply.
|
|
32
|
+
2. **Run every automated step that applies**, from all three sources. Where
|
|
33
|
+
the master doc calls for fresh reviewer or adjudicator sub-agents, spawn
|
|
34
|
+
them yourself with the briefs it describes.
|
|
35
|
+
3. **Report results concretely** — how you verified, not "tested": suite
|
|
36
|
+
counts, which URL you drove, what the screenshot showed, findings resolved.
|
|
37
|
+
4. **Emit the minimal human list.** Only feel/look/judgment items and things
|
|
38
|
+
you genuinely couldn't verify — each against a game that is **already
|
|
39
|
+
running** (start or reuse the dev stack yourself; the creator gets the
|
|
40
|
+
URL to open, never a command to run). If everything was automatable, say
|
|
41
|
+
so plainly; "couldn't test it" must never read as "tested and fine".
|
|
42
|
+
5. **Close the ratchet.** If the creator's pass catches something your run
|
|
43
|
+
missed, that's a hole in the checks — run `/update-handbook` to convert
|
|
44
|
+
that defect class into an automated check.
|
|
45
|
+
|
|
46
|
+
## Notes
|
|
47
|
+
|
|
48
|
+
- `/qa` verifies; it never commits or publishes.
|
|
49
|
+
- Smokes drive a real browser with Playwright — **already in this repo's
|
|
50
|
+
devDependencies** (`looop create` ships it and pre-fetches Chromium, and
|
|
51
|
+
`looop test` re-fetches the browser if the cache was pruned). Only a repo
|
|
52
|
+
scaffolded before playwright shipped needs the one-time
|
|
53
|
+
`npm i -D playwright && npx playwright install chromium`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: todo
|
|
3
|
+
description: Capture a bug, idea, or improvement for later without acting on it now. Use when the creator (or you, mid-build) spots something worth remembering — "we should fix that jump later", "idea — a boss level", "note that down" — and when they want to see what's captured or start work on one.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /todo — capture now, decide later
|
|
7
|
+
|
|
8
|
+
A **todo** is the one lightweight capture type in this repo: bug, idea,
|
|
9
|
+
improvement — all the same thing until someone decides to act. Capturing must
|
|
10
|
+
be nearly free; never derail the current work to file one.
|
|
11
|
+
|
|
12
|
+
## Capture
|
|
13
|
+
|
|
14
|
+
Write one small file per todo at `notes/todos/<YYYY-MM-DD-HHMM>-<short-slug>.md`
|
|
15
|
+
(creation datetime first, always — the whole `notes/` tree names files this way
|
|
16
|
+
so they list in order):
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
---
|
|
20
|
+
status: open # open | done | promoted | abandoned
|
|
21
|
+
created: YYYY-MM-DD
|
|
22
|
+
---
|
|
23
|
+
# <One-line summary>
|
|
24
|
+
|
|
25
|
+
What was seen / imagined, in a couple of sentences. Enough that a future
|
|
26
|
+
session understands it cold. Reference files by path if relevant.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then get back to what you were doing. If the creator says something mid-build
|
|
30
|
+
that is clearly a "later" item, offer to capture it in one line — don't stop
|
|
31
|
+
the milestone.
|
|
32
|
+
|
|
33
|
+
## Browse
|
|
34
|
+
|
|
35
|
+
"What's on the list?" → read `notes/todos/`, summarize the open ones in a few
|
|
36
|
+
lines each. Group bugs vs ideas by content, not by folder — there is
|
|
37
|
+
deliberately only one folder.
|
|
38
|
+
|
|
39
|
+
## Promote
|
|
40
|
+
|
|
41
|
+
When the creator decides to actually DO a todo, it becomes a **plan**: start
|
|
42
|
+
`/build`, which creates the plan in `notes/plans/` through its discussion
|
|
43
|
+
phase, seeded from the todo's content. Mark the todo `status: promoted` with a
|
|
44
|
+
line pointing at the plan file. Small fixes don't need promotion — just do
|
|
45
|
+
them and mark the todo `done`.
|
|
46
|
+
|
|
47
|
+
## Rules
|
|
48
|
+
|
|
49
|
+
- Never delete a todo — mark it `done` (with a line saying what happened),
|
|
50
|
+
`promoted`, or — when the creator decides NOT to do it — `abandoned` **with
|
|
51
|
+
a one-line why**. The why is the value: it saves re-deciding the same thing
|
|
52
|
+
next month. "Won't do" and "did it" must never collapse into one status.
|
|
53
|
+
- A todo about **Looop itself** (the engine, the CLI, the platform — not this
|
|
54
|
+
game) is `/feedback`'s job, not a todo.
|