multi-agents-cli 1.0.52 → 1.0.53

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.
Files changed (44) hide show
  1. package/core/templates/.agents/backend/API.md +259 -0
  2. package/core/templates/.agents/backend/AUTH.md +246 -0
  3. package/core/templates/.agents/backend/DB.md +257 -0
  4. package/core/templates/.agents/backend/EVENTS.md +253 -0
  5. package/core/templates/.agents/backend/INIT.md +239 -0
  6. package/core/templates/.agents/backend/JOBS.md +256 -0
  7. package/core/templates/.agents/backend/LOGIC.md +291 -0
  8. package/core/templates/.agents/backend/TESTING.md +266 -0
  9. package/core/templates/.agents/client/ACCESSIBILITY.md +266 -0
  10. package/core/templates/.agents/client/FORMS.md +234 -0
  11. package/core/templates/.agents/client/LOGIC.md +277 -0
  12. package/core/templates/.agents/client/ROUTING.md +235 -0
  13. package/core/templates/.agents/client/TESTING.md +241 -0
  14. package/core/templates/.agents/client/UI.md +226 -0
  15. package/core/templates/.agents/shared/CLOUD.md +229 -0
  16. package/core/templates/.agents/shared/CLOUD_TEARDOWN.md +158 -0
  17. package/core/templates/.agents/shared/SECURITY.md +286 -0
  18. package/core/templates/.frameworks/backend/django.md +55 -0
  19. package/core/templates/.frameworks/backend/express.md +74 -0
  20. package/core/templates/.frameworks/backend/fastapi.md +107 -0
  21. package/core/templates/.frameworks/backend/fastify.md +74 -0
  22. package/core/templates/.frameworks/backend/nestjs.md +75 -0
  23. package/core/templates/.frameworks/client/angular.md +80 -0
  24. package/core/templates/.frameworks/client/nextjs.md +47 -0
  25. package/core/templates/.frameworks/client/nuxt.md +45 -0
  26. package/core/templates/.frameworks/client/remix.md +44 -0
  27. package/core/templates/.frameworks/client/sveltekit.md +44 -0
  28. package/core/templates/.frameworks/client/vite-react.md +45 -0
  29. package/core/templates/CLAUDE.md +531 -0
  30. package/core/templates/CLOUD_STATE.md +55 -0
  31. package/core/templates/CONTRACTS.md +16 -0
  32. package/core/templates/TASKS_HISTORY.md +6 -0
  33. package/core/templates/backend/CLAUDE.md +207 -0
  34. package/core/templates/client/CLAUDE.md +213 -0
  35. package/core/templates/shared/.gitkeep +0 -0
  36. package/core/templates/shared/wiring.config.json +14 -0
  37. package/core/workflow/agent.js +1404 -0
  38. package/core/workflow/complete.js +354 -0
  39. package/core/workflow/guards.js +643 -0
  40. package/core/workflow/reset.js +246 -0
  41. package/core/workflow/restart.js +243 -0
  42. package/core/workflow/tasks_history.js +120 -0
  43. package/init.js +3 -15
  44. package/package.json +2 -1
@@ -0,0 +1,531 @@
1
+ # {{PROJECT_NAME}} - Global Agent Instructions
2
+ # @config PROJECT_NAME: ← [required] name of this project
3
+
4
+ ---
5
+
6
+ ## Project Identity
7
+
8
+ <!-- @annotation: 2-3 sentences. What the app does, core stack, why it's a monorepo. -->
9
+
10
+ ---
11
+
12
+ ## Repo Structure
13
+
14
+ <!-- @annotation: Update tree to match your layout. Default assumes client + backend. -->
15
+
16
+ ```
17
+ {{PROJECT_ROOT}}/
18
+ ├── .git
19
+ ├── CLAUDE.md ← this file (global, always auto-loaded)
20
+ ├── CONTRACTS.md ← shared types and enums (single source of truth)
21
+
22
+ ├── shared/
23
+ │ ├── types/
24
+ │ ├── enums/
25
+ │ └── agents/
26
+ │ └── SECURITY.md # @agent - cross-cutting, invoke from any worktree
27
+
28
+ ├── backend/ # @project - remove or rename if not applicable
29
+ │ ├── CLAUDE.md ← auto-loaded when in backend/ worktree
30
+ │ └── agents/
31
+ │ ├── INIT.md # @agent
32
+ │ ├── API.md # @agent
33
+ │ ├── LOGIC.md # @agent
34
+ │ ├── AUTH.md # @agent
35
+ │ ├── DB.md # @agent
36
+ │ ├── EVENTS.md # @agent
37
+ │ ├── JOBS.md # @agent
38
+ │ └── TESTING.md # @agent
39
+
40
+ ├── client/ # @project - remove or rename if not applicable
41
+ │ ├── CLAUDE.md ← auto-loaded when in client/ worktree
42
+ │ └── agents/
43
+ │ ├── UI.md # @agent
44
+ │ ├── LOGIC.md # @agent
45
+ │ ├── FORMS.md # @agent
46
+ │ ├── ROUTING.md # @agent
47
+ │ ├── TESTING.md # @agent
48
+ │ └── ACCESSIBILITY.md # @agent
49
+
50
+ └── worktrees/ ← sibling worktree checkouts - never commit this folder
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Worktree & Agent Model
56
+
57
+ Each agent runs in its own Git Worktree on a dedicated branch.
58
+ Agents never share a working directory.
59
+
60
+ **Branch naming:**
61
+ ```
62
+ agent/<project>/<scope>
63
+ ```
64
+
65
+ **Creating a worktree:**
66
+ Run this from the repo root before starting any agent task:
67
+ ```
68
+ git worktree add worktrees/<project>-<scope> -b agent/<project>/<scope>
69
+ ```
70
+
71
+ Examples:
72
+ ```
73
+ git worktree add worktrees/client-ui -b agent/client/ui
74
+ git worktree add worktrees/backend-api -b agent/backend/api
75
+ git worktree add worktrees/backend-auth -b agent/backend/auth
76
+ ```
77
+
78
+ Then open Claude Code inside the created worktree folder.
79
+ The `worktrees/` folder is local only - listed in `.gitignore`, never committed.
80
+
81
+ **Context loads in this order:**
82
+ 1. Root `CLAUDE.md` - always auto-loaded
83
+ 2. `<project>/CLAUDE.md` - auto-loaded per worktree
84
+ 3. `agents/<NAME>.md` - manually referenced per prompt
85
+
86
+ > Prompts stay thin. Agent files carry all behavioral detail.
87
+ > Example: `Use agents/UI.md. Task: build the activity table component.`
88
+
89
+ ---
90
+
91
+ ## CONTRACTS.md Protocol
92
+
93
+ Single source of truth for all types and enums shared across projects.
94
+ Never duplicated inside any project folder.
95
+
96
+ - Any agent may **read** `CONTRACTS.md` and `shared/` freely
97
+ - No agent may **write** to either unilaterally
98
+ - To propose a change, the agent must stop and surface:
99
+
100
+ ```
101
+ ## CONTRACTS CHANGE PROPOSAL
102
+ Agent : <agent name>
103
+ File : CONTRACTS.md or shared/<path>
104
+ Change : <what is being added, modified, or removed>
105
+ Reason : <why this change is needed>
106
+ Impact : <which other agents or projects are affected>
107
+ ```
108
+
109
+ Awaits explicit human approval before proceeding.
110
+
111
+ <!-- @annotation: Default ratification is human-only. Update if your workflow differs. -->
112
+
113
+ ---
114
+
115
+ ## Coordination Rules
116
+
117
+ 1. **Domain isolation** - each agent writes only within its assigned project folder.
118
+ 2. **Shared is read-only** - no writes to `shared/` without a ratified proposal.
119
+ 3. **No cross-domain assumptions** - use `CONTRACTS.md` as the handshake between agents.
120
+ 4. **One branch per agent** - branch = agent + task scope. Never reuse.
121
+ 5. **worktrees/ is not committed** - add to `.gitignore`.
122
+
123
+ <!-- @annotation: Add project-specific coordination rules here if needed. -->
124
+
125
+ ---
126
+
127
+ ## Safety Rules
128
+
129
+ - **Never delete or overwrite** `CONTRACTS.md`, `shared/`, or another agent's files
130
+ - **Never commit directly** to `main` or any protected branch
131
+ - **Never add `Co-Authored-By` to commit messages** — commits are attributed to the project owner only
132
+ - **Never skip the proposal step** when a contract change is required
133
+ - **Stop and flag** any task that requires touching another agent's domain
134
+
135
+ ---
136
+
137
+ ## Session Start
138
+
139
+ This section fires at the start of every new Claude Code session.
140
+ Regardless of what the user types first - even a single word or greeting -
141
+ the agent must:
142
+
143
+ 1. Read `BUILD_STATE.md` at the repo root - understand what has been built
144
+ 2. Check if `TASK.md` exists in the current directory
145
+ 3. If yes - read it and verify dependencies are met against BUILD_STATE.md
146
+ 4. If dependencies not met - surface what is missing and propose options
147
+ 5. If dependencies met - begin executing the task defined in TASK.md
148
+ 6. If no TASK.md - inform the user to run `npm run agent`
149
+ 7. Re-read `TASK.md` at every turn before acting - it is the single source of truth for the current task
150
+
151
+ Do not wait for explicit instructions.
152
+ The presence of `TASK.md` in the worktree is the instruction.
153
+
154
+ ## Build State Protocol
155
+
156
+ Before any task begins, read `BUILD_STATE.md` and verify that all required
157
+ predecessor agents for your scope have `COMPLETED` status.
158
+
159
+ | Agent | Requires COMPLETED |
160
+ |-------|-------------------|
161
+ | `client / UI` | — (entry point, no prerequisites) |
162
+ | `client / LOGIC` | `client / UI` |
163
+ | `client / FORMS` | `client / UI` |
164
+ | `client / ROUTING` | `client / UI` |
165
+ | `client / TESTING` | `client / UI` + `client / LOGIC` |
166
+ | `client / ACCESSIBILITY` | `client / UI` |
167
+ | `backend / DB` | — (entry point, no prerequisites) |
168
+ | `backend / INIT` | — (entry point, no prerequisites) |
169
+ | `backend / API` | `backend / INIT` |
170
+ | `backend / LOGIC` | `backend / DB` |
171
+ | `backend / AUTH` | `backend / LOGIC` |
172
+ | `backend / EVENTS` | `backend / INIT` + `backend / API` |
173
+ | `backend / JOBS` | `backend / DB` |
174
+ | `backend / TESTING` | `backend / INIT` + `backend / API` + `backend / LOGIC` |
175
+ | `shared / SECURITY` | — (no hard prerequisites) |
176
+
177
+ If a required predecessor is missing or `IN PROGRESS`:
178
+
179
+ ```
180
+ ## PREREQUISITE NOT MET
181
+ Cannot proceed with <agent> task.
182
+ Required: <predecessor agent> — status: <current status>
183
+ Reason: <why this agent depends on the predecessor>
184
+ Options:
185
+ 1. Complete the prerequisite task first
186
+ 2. Confirm to proceed anyway with acknowledged risk
187
+ ```
188
+
189
+ Surface this before reading TASK.md or writing any code.
190
+ Proceed only after explicit human confirmation.
191
+
192
+ ## Autonomy Rules
193
+
194
+ When executing a task from `TASK.md`, operate in fully autonomous mode:
195
+
196
+ - **New files** — proceed without confirmation
197
+ - **Modifying existing USER SOURCE CODE** — confirm before proceeding
198
+ (components, pages, configs, APIs, schemas, stylesheets)
199
+ - **Deleting files** — always confirm before proceeding
200
+ - **Do not stop** to ask for plan confirmation unless a destructive action is detected
201
+ - **Do not interrupt** the agentic flow with clarifying questions unless the task
202
+ is genuinely ambiguous after reading all available context files
203
+
204
+ **These workflow files are ALWAYS updated without confirmation:**
205
+ - `TASK.md` — mark `[x] COMPLETED` when your task is done
206
+ - `CONTRACTS.md`
207
+ - `.scaffold/.tracking.json`
208
+
209
+ **NEVER update `BUILD_STATE.md` directly.**
210
+ `complete.js` owns all BUILD_STATE.md updates after merge.
211
+ Editing it in the worktree causes merge conflicts on every task.
212
+ Only update `TASK.md` status to `[x] COMPLETED` — that is sufficient.
213
+
214
+ ## User Input Handling
215
+
216
+ If the user types a message mid-session (after the task has started):
217
+
218
+ - Re-read `TASK.md` immediately
219
+ - If the input is within the current agent scope - treat it as a task description update:
220
+ 1. Update `TASK.md` with the new task under a `[USER OVERRIDE]` marker
221
+ 2. Append the override to `TASKS_HISTORY.md` with timestamp, input, and deviation note
222
+ 3. Proceed within the defined agent scope
223
+ - If the input is outside the current agent scope - surface a scope mismatch (see Scope Mismatch Protocol)
224
+ - If the input is completely unrelated to the project domain - flag it clearly and stay on task
225
+
226
+ **WARNING displayed to user on scope mismatch or domain deviation:**
227
+ ```
228
+ ⚠ Adding messages mid-session may cause the agent to deviate from the
229
+ structured build process. Each agent operates within a defined scope.
230
+ If you need to change direction - stop this session and run npm run agent
231
+ to start a new scoped task instead.
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Scope Mismatch Protocol
237
+
238
+ Before acting on any user input or task description, verify it falls within the current agent scope.
239
+
240
+ If a mismatch is detected:
241
+ 1. Do NOT proceed with the out-of-scope work
242
+ 2. Surface the mismatch clearly:
243
+
244
+ ```
245
+ ⚠ Scope mismatch detected
246
+
247
+ You are in the [AGENT] agent ([SCOPE] scope).
248
+ The requested task belongs to: [CORRECT AGENT] agent
249
+
250
+ Options:
251
+ 1. Stop this session and run npm run agent - select [CORRECT AGENT]
252
+ 2. Rephrase the task to stay within [AGENT] scope
253
+ 3. Continue anyway (not recommended - may break dependency chain)
254
+ ```
255
+
256
+ 3. Wait for user direction before proceeding
257
+ 4. Never silently cross scope boundaries
258
+
259
+ ---
260
+
261
+ ## Worktree Awareness
262
+
263
+ You are operating inside a git worktree — NOT the main repo root.
264
+ Before editing ANY file, verify you are in your own worktree:
265
+
266
+ ```bash
267
+ git rev-parse --show-toplevel # this is your root — stay within it
268
+ ```
269
+
270
+ Never edit files outside your worktree path. If BUILD_STATE.md or
271
+ any file needs updating, edit the copy inside YOUR worktree root,
272
+ not the main repo's copy.
273
+
274
+ ## Implicit Task Clarity Rule
275
+
276
+ This rule applies to ALL agents and overrides individual Pre-flight Check 1 strictness.
277
+
278
+ Before flagging a task as ambiguous, the agent must first attempt to derive intent from:
279
+
280
+ 1. **Agent domain** - what this agent is responsible for (UI = components/layout, LOGIC = state/API, etc.)
281
+ 2. **@config values** - the confirmed stack defines what to build and how
282
+ 3. **BUILD_STATE.md** - current project state defines what exists and what's next
283
+ 4. **Scope** - the worktree scope (.claude-scope) defines the boundary
284
+
285
+ If all four sources together make the intent clear - proceed autonomously.
286
+ Only flag for clarification if the task remains genuinely ambiguous AFTER reading all four.
287
+
288
+ **Examples of implicitly clear tasks:**
289
+ - UI agent + empty client/ + full @config + "build the ui" → scaffold the configured stack
290
+ - LOGIC agent + scaffold done + STATE: Zustand + "set up state" → implement Zustand stores
291
+ - TESTING agent + framework set + "set up tests" → configure test runner for the framework
292
+ - ROUTING agent + scaffold done + "set up routing" → configure App Router / routing conventions
293
+ - FORMS agent + LOGIC done + "build forms" → implement form architecture with configured libraries
294
+
295
+ **Examples that still require clarification:**
296
+ - "build the ui" with no @config set → framework unknown, cannot proceed
297
+ - "add a component" with no description → which component, what purpose
298
+ - Any task touching another agent's domain → flag and redirect
299
+ ## Tracking Protocol
300
+
301
+ Every agent reads `.scaffold/.tracking.json` at session start.
302
+ This file records the current state of every agent slot.
303
+
304
+ **Slot schema:**
305
+ ```json
306
+ {
307
+ "branch": "agent/{scope}/{agent}/{timestamp} | null",
308
+ "timestamp": "numeric timestamp | null",
309
+ "launchedAt": "ISO date string | null",
310
+ "status": "ACTIVE | MISSING | null",
311
+ "missingCount": "number (informational — not a blocking signal)",
312
+ "worktreePath": "absolute path | null"
313
+ }
314
+ ```
315
+
316
+ **Status meanings:**
317
+ - `null` — never launched
318
+ - `ACTIVE` — currently running
319
+ - `MISSING` — worktree was deleted without completing
320
+
321
+ **Agent rules:**
322
+ - If your slot shows `MISSING` — a decision gate fired before you started. Follow the Recovery Notes in TASK.md if present.
323
+ - If your slot shows `ACTIVE` — you are the active instance. Do not create parallel work.
324
+ - Never write directly to `.tracking.json` — managed by workflow scripts only.
325
+
326
+ ## Paths Protocol
327
+
328
+ `.scaffold/.paths.json` maps expected and actual framework paths for the project.
329
+ Written at init time with `status: pending`. Updated by agents after scaffolding.
330
+
331
+ **Schema:**
332
+ ```json
333
+ {
334
+ "client": {
335
+ "typesDir": {
336
+ "expected": "client/src/types",
337
+ "current": null,
338
+ "status": "pending"
339
+ }
340
+ },
341
+ "backend": {
342
+ "schemasDir": {
343
+ "expected": "backend/app/schemas",
344
+ "current": null,
345
+ "status": "pending"
346
+ }
347
+ }
348
+ }
349
+ ```
350
+
351
+ **Status values:**
352
+ - `pending` — path not yet created (agent hasn't scaffolded yet)
353
+ - `verified` — agent confirmed path exists on disk
354
+ - `diverged` — actual path differs from expected (update `current` with real path)
355
+
356
+ **Agent rules:**
357
+ - After scaffolding your framework, read `.scaffold/.paths.json`
358
+ - Verify each path in your scope exists on disk
359
+ - Update `current` with the actual path and set `status: verified` or `diverged`
360
+ - If `diverged` — use the `current` path going forward, not `expected`
361
+ - Other agents reading this file should use `current` if set, fall back to `expected`
362
+
363
+ ## Remote Setup Protocol
364
+
365
+ **Context:** `npm run init` commits the project locally but does NOT push
366
+ to a remote. The template origin is removed during init and moved to
367
+ `upstream`. The project has no remote until one is configured.
368
+
369
+ If `.scaffold/.remote-setup-needed` exists at session start, this MUST
370
+ be resolved before any task work begins. The deployment chain
371
+ (`npm run complete → git push origin main`) will fail without it.
372
+
373
+ **Step 1 — Check if already configured:**
374
+ ```bash
375
+ git remote get-url origin
376
+ ```
377
+ → Origin exists: delete flag, proceed with task ✓
378
+ → No origin: continue to Step 2
379
+
380
+ **Step 2 — Silent background authentication detection (OS-aware):**
381
+
382
+ Run all checks silently. Stop at the first that succeeds.
383
+
384
+ Mac:
385
+ ```bash
386
+ ssh -T git@github.com 2>&1 # exit 1 = authenticated
387
+ gh auth status 2>/dev/null # gh authenticated
388
+ git ls-remote https://github.com # HTTPS creds in Keychain
389
+ ```
390
+
391
+ Windows:
392
+ ```bash
393
+ ssh -T git@github.com # SSH
394
+ gh auth status # gh
395
+ git ls-remote https://github.com # Windows Credential Manager
396
+ ```
397
+
398
+ Linux:
399
+ ```bash
400
+ ssh -T git@github.com # SSH
401
+ gh auth status # gh
402
+ git ls-remote https://github.com # ~/.git-credentials
403
+ ```
404
+
405
+ **Step 3 — Act on first successful method:**
406
+
407
+ SSH authenticated:
408
+ ```bash
409
+ # Ask username, derive SSH remote
410
+ git remote add origin git@github.com:{username}/{projectName}.git
411
+ git ls-remote --heads origin # check for existing branches
412
+ # if branches exist → surface warning, offer Reuse (clear + reinit) or New repo
413
+ git push -u origin main ✓
414
+ ```
415
+
416
+ gh authenticated:
417
+ ```bash
418
+ gh repo view {username}/{projectName} 2>/dev/null
419
+ # if exists + has branches → surface warning, offer Reuse (clear + reinit) or New repo
420
+ # if exists + empty → use it
421
+ # if not exists → gh repo create {projectName} --public --source=. --remote=origin --push ✓
422
+ ```
423
+
424
+ HTTPS credentials found:
425
+ ```bash
426
+ # Ask username, derive HTTPS remote
427
+ git remote add origin https://github.com/{username}/{projectName}
428
+ git ls-remote --heads origin # check for existing branches
429
+ # if branches exist → surface warning, offer Reuse (clear + reinit) or New repo
430
+ git push -u origin main ✓
431
+ ```
432
+
433
+ **Step 4 — ALL silent methods failed → browser (last resort only):**
434
+
435
+ Ask for GitHub username only:
436
+ ```
437
+ "What's your GitHub username?"
438
+ ```
439
+
440
+ Derive URL: `https://github.com/new?name={projectName}`
441
+
442
+ Open browser (OS-aware — check .app exists before using):
443
+ ```bash
444
+ # Mac:
445
+ open "https://github.com/new?name={projectName}"
446
+ # Windows:
447
+ start "" "https://github.com/new?name={projectName}"
448
+ # Linux:
449
+ xdg-open "https://github.com/new?name={projectName}"
450
+ ```
451
+
452
+ Then output this waiting prompt EXACTLY — formatted prominently so it cannot be missed:
453
+
454
+ ---
455
+ ## ⚠️ Action Required — GitHub Repo Setup
456
+
457
+ The repo creation page is now open in your browser.
458
+
459
+ **Do this now:**
460
+ 1. Repo name: **`{projectName}`** (already pre-filled)
461
+ 2. Leave all other settings as default
462
+ 3. Click **"Create repository"**
463
+ 4. Come back here and **type `done`** to continue
464
+
465
+ ---
466
+
467
+ Wait for the user to type `done` before proceeding.
468
+
469
+ Validate on return:
470
+ ```bash
471
+ git ls-remote https://github.com/{username}/{projectName}
472
+ ```
473
+ → 200 success, no branches: set origin, push ✓
474
+ → 200 success, has branches:
475
+ Run full evaluation before surfacing anything to user:
476
+
477
+ ```bash
478
+ # 1. Check for orphaned agent branches (unmerged work)
479
+ git ls-remote --heads origin 'refs/heads/agent/*'
480
+
481
+ # 2. Check last commit message on remote main
482
+ git log origin/main -1 --format="%s"
483
+
484
+ # 3. Check last commit timestamp
485
+ git log origin/main -1 --format="%ct"
486
+ ```
487
+
488
+ Decision logic:
489
+
490
+ Orphaned agent/* branches exist:
491
+ → Surface to user — unfinished work may be recoverable:
492
+ "⚠ Unfinished work detected from a previous session.
493
+ Orphaned branches: {list}
494
+ 1. Recover — restore previous worktree and continue
495
+ 2. Clear — delete all remote history, start fresh"
496
+
497
+ No orphaned branches + last commit > 24 hours ago:
498
+ → Auto-clear silently, proceed
499
+ (old session, clearly abandoned, no decision needed)
500
+
501
+ No orphaned branches + last commit < 24 hours ago + last commit is merge/completed:
502
+ → Auto-clear silently, proceed
503
+ (previous session completed cleanly)
504
+
505
+ No orphaned branches + last commit < 24 hours ago + last commit is incomplete (build: X started):
506
+ → Surface to user:
507
+ "⚠ A recent incomplete session was detected ({timestamp}).
508
+ 1. Clear — delete remote history, start fresh
509
+ 2. Keep — use a different repo name"
510
+
511
+ Auto-clear procedure:
512
+ gh available:
513
+ gh repo delete {username}/{projectName} --yes
514
+ gh repo create {projectName} --public --source=. --remote=origin --push ✓
515
+ gh not available:
516
+ git push origin main --force
517
+ git ls-remote --heads origin → delete each remote branch except main ✓
518
+ → 404 not found: retry prompt
519
+ → 403 auth error: "Verify username or repo visibility" → re-ask
520
+ → timeout: "Check your connection" → retry option
521
+
522
+ **Step 5 — Cleanup on success:**
523
+ ```bash
524
+ git push -u origin main
525
+ rm .scaffold/.remote-setup-needed
526
+ ```
527
+ Log completion in TASK.md checklist.
528
+ Confirm: "Remote configured — proceeding with task."
529
+
530
+ **Never begin task implementation until this flag is cleared.
531
+ Never delete the flag on failure.**
@@ -0,0 +1,55 @@
1
+ # CLOUD_STATE.md
2
+ # Deployment state. Read by ALL agents at session start. Updated incrementally by all agents.
3
+ # Written by CLOUD agent during deployment. Never edit manually.
4
+
5
+ ## Target
6
+ Platform : none
7
+ Profile : none
8
+ Type : none
9
+ Decided on : not set
10
+
11
+ ## Provisioned Resources
12
+ # Written by CLOUD agent - these exist on the platform
13
+ - [ ] App registered : none
14
+ - [ ] Database created : none
15
+ - [ ] Storage created : none
16
+ - [ ] Domain configured : none
17
+
18
+ ## Environments
19
+
20
+ ### Local
21
+ env file : missing
22
+ last verified : never
23
+
24
+ ### Staging
25
+ platform : none
26
+ url : none
27
+ env vars : none
28
+ last deployed : never
29
+
30
+ ### Production
31
+ platform : none
32
+ url : none
33
+ env vars : none
34
+ last deployed : never
35
+
36
+ ## Wiring
37
+ Client -> Backend : not configured
38
+ CORS : not configured
39
+ API base URL : not set
40
+
41
+ ## Secrets Registry
42
+ # Keys only - never values. Add entries as they are configured.
43
+ # Format: KEY_NAME : environment (local / staging / production / all)
44
+
45
+ ## Teardown Registry
46
+ # Populated when npm run reset or cloud-teardown is triggered.
47
+ # Format: | Resource | Platform ID | Status | Requested on |
48
+ | Resource | Platform ID | Status | Requested on |
49
+ |----------|-------------|--------|--------------|
50
+
51
+ ## Deployment Log
52
+ # Written by CLOUD agent after each deployment action.
53
+ # Format: | Date | Agent | Environment | Action | Status | Notes |
54
+ | Date | Agent | Environment | Action | Status | Notes |
55
+ |------|-------|-------------|--------|--------|-------|
@@ -0,0 +1,16 @@
1
+ # CONTRACTS.md
2
+ # Single source of truth for all types and enums shared across client and backend.
3
+ # Never duplicated inside any project folder.
4
+ # Changes require an explicit proposal and human approval — see root CLAUDE.md.
5
+
6
+ ---
7
+
8
+ ## Types
9
+
10
+ <!-- Add shared TypeScript interfaces here -->
11
+
12
+ ---
13
+
14
+ ## Enums
15
+
16
+ <!-- Add shared enums here -->
@@ -0,0 +1,6 @@
1
+ # TASKS_HISTORY.md
2
+ # Audit trail of all agent sessions and user overrides.
3
+ # Written by agent.js (on launch) and complete.js (on completion).
4
+ # Read by all agents at session start for full project history.
5
+ # Never edit manually.
6
+