mapples 0.2.0-beta.8 → 0.2.0-beta.9

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.
@@ -111,8 +111,14 @@ or editing the file and syncing pushes the tokens to Creator (missing file + emp
111
111
 
112
112
  ## The agent lease
113
113
 
114
- While `__DESIGN_COMMAND__` runs, `npx -y mapples@__CLI_VERSION__ agent start` holds a lease on the project so Creator shows
115
- "__AGENT_LABEL__ is working" and locks its own chat. `npx -y mapples@__CLI_VERSION__ agent step` reports progress;
114
+ Creator shows "__AGENT_LABEL__ is working" and locks its own chat while you hold the project's
115
+ lease. You do not manage it for ordinary requests: this app's hooks take the lease as soon as
116
+ the user sends a prompt and release it when you finish responding, even when you change
117
+ nothing. Do not call `agent start` or `agent stop` yourself for a normal request.
118
+
119
+ The first thing `__DESIGN_COMMAND__` does — before syncing or asking the user anything — is
120
+ `npx -y mapples@__CLI_VERSION__ agent start`, which holds a lease on the project so Creator shows
121
+ "__AGENT_LABEL__ is working" and locks its own chat for the whole run, questions included. `npx -y mapples@__CLI_VERSION__ agent step` reports progress;
116
122
  `npx -y mapples@__CLI_VERSION__ agent stop` releases. `.mapples/agent.json` exists while the lease is held and labels
117
123
  every sync commit "__AGENT_LABEL__: <step>". Exit codes: `3` = the lease is gone (Creator
118
124
  disconnected you or it expired — stop and tell the user), `4` = another agent holds the project.
@@ -10,8 +10,41 @@ You are the product designer and builder for this app. Your bar is a finished sc
10
10
  designer would ship — not a wireframe. Everything you make is a file in this repo; every phase
11
11
  ends with `npx -y mapples@__CLI_VERSION__ sync --yes --json`, which pushes it to Creator where the user watches it land.
12
12
 
13
- Read `__CONVENTIONS_PATH__` and the `mapples-conventions` and `mapples-sync` skills before the
14
- first file. Reference material for this skill lives next to it:
13
+ ## First: take the project's lease
14
+
15
+ Do this **before anything else** — before reading references, syncing, or asking the user a
16
+ single question. While you hold the lease Creator locks its own AI chat and refuses Save, so
17
+ nobody changes the project from the browser while you are still asking about the brief.
18
+
19
+ 1. `.mapples/config.json` must exist (the app is linked). If not: stop and ask the user to run
20
+ `npx -y mapples@__CLI_VERSION__ init --secret <key> --agent __AGENT_FLAG__` — never run it yourself.
21
+ 2. Take the lease, pre-declaring the fixed step titles:
22
+
23
+ ```bash
24
+ npx -y mapples@__CLI_VERSION__ agent start --agent __AGENT_ID__ --label "__AGENT_LABEL__" --steps "Brief,Style guides,Design tokens,Plan,Scaffold navigation & screens" --json
25
+ ```
26
+
27
+ Exit 4 = busy: another agent session holds the project. That is the only question you may
28
+ ask before holding the lease — whether to take over (re-run with `--takeover`, which
29
+ disconnects the other session). Never take over silently; if the user says no, stop.
30
+ 3. Mark the brief running at once — the brief questions happen inside this step:
31
+
32
+ ```bash
33
+ npx -y mapples@__CLI_VERSION__ agent step --index 0 --title "Brief" --status running --json
34
+ ```
35
+
36
+ Only then:
37
+
38
+ 4. Read `__CONVENTIONS_PATH__` and the `mapples-conventions` and `mapples-sync` skills.
39
+ 5. `npx -y mapples@__CLI_VERSION__ sync --yes --json` — be current before designing. Exit 2 here means the repo
40
+ already had conflicts: resolve them (see `mapples-sync`) before going on.
41
+ 6. Read `mapples/design.md` if it exists: a previous run's brief, chosen style and plan. Resume
42
+ from the first phase whose output is missing rather than redoing everything.
43
+
44
+ If the user stops the run at any point — including while you are still asking questions —
45
+ release the lease before you reply (`agent stop --status failed --error "stopped by the user"`).
46
+
47
+ Reference material for this skill lives next to it:
15
48
 
16
49
  - `reference/style-guides.md` — art directions and style guides (phase 1)
17
50
  - `reference/design-tokens.md` — the `mapples/theme.ts` contract and template (phase 2)
@@ -21,37 +54,19 @@ first file. Reference material for this skill lives next to it:
21
54
  - `reference/lint-checklist.md` — the review pass (phase N)
22
55
  - `reference/playbooks/<name>.md` — screen-kind playbooks, loaded per screen
23
56
 
24
- ## Preconditions
25
-
26
- 1. `.mapples/config.json` must exist (the app is linked). If not: stop and ask the user to run
27
- `npx -y mapples@__CLI_VERSION__ init --secret <key> --agent __AGENT_FLAG__` — never run it yourself.
28
- 2. `npx -y mapples@__CLI_VERSION__ agent status --json`. If `session` is non-null with `status: "active"` and
29
- `holdsLease` is false, another agent is working on this project: stop and ask whether to take
30
- over (`--takeover` disconnects it). Never take over silently.
31
- 3. `npx -y mapples@__CLI_VERSION__ sync --yes --json` — be current before designing. Exit 2 here means the repo already
32
- had conflicts: resolve them (see `mapples-sync`) before going on.
33
- 4. Read `mapples/design.md` if it exists: a previous run's brief, chosen style and plan. Resume
34
- from the first phase whose output is missing rather than redoing everything.
35
-
36
57
  ## Steps and the lease
37
58
 
38
- The run is one agent session. Steps have a **fixed index convention** shared with Creator's
39
- progress log:
59
+ The lease taken above covers the whole run. Steps have a **fixed index convention** shared
60
+ with Creator's progress log:
40
61
 
41
62
  ```
42
63
  0 Brief · 1 Style guides · 2 Design tokens · 3 Plan · 4 Scaffold navigation & screens ·
43
64
  5…N-2 one per plan step ("Build the Home screen", …) · N-1 Wiring · N Review
44
65
  ```
45
66
 
46
- Start the session as soon as the brief and scope are known, pre-declaring every step title:
47
-
48
- ```bash
49
- npx -y mapples@__CLI_VERSION__ agent start --agent __AGENT_ID__ --label "__AGENT_LABEL__" --steps "Brief,Style guides,Design tokens,Plan,Scaffold navigation & screens" --json
50
- ```
51
-
52
- Exit 4 = busy (see precondition 2). After the plan exists (phase 3), the remaining titles are
53
- declared as they run: `npx -y mapples@__CLI_VERSION__ agent step --index 5 --title "Build the Home screen" --status running`
54
- creates the step. Wrap **every** phase:
67
+ After the plan exists (phase 3), the remaining titles are declared as they run:
68
+ `npx -y mapples@__CLI_VERSION__ agent step --index 5 --title "Build the Home screen" --status running` creates the step.
69
+ Wrap **every** phase:
55
70
 
56
71
  ```bash
57
72
  npx -y mapples@__CLI_VERSION__ agent step --index <i> --title "<title>" --status running --json
@@ -73,6 +88,8 @@ A phase's syncs are labelled with the running step in Creator's history automati
73
88
 
74
89
  ## Phase 0 — Brief and scope
75
90
 
91
+ Step 0 is already running (you marked it right after taking the lease).
92
+
76
93
  Input: `$ARGUMENTS` (the brief, optionally `--scope single|minimal|basic|advanced`). If the
77
94
  brief is missing or too thin to name the audience, the core value and the mood, ask **one**
78
95
  round of questions (with your multiple-choice question tool, when you have one) — audience, the one thing the app must do well, the