theslopmachine 0.6.2 → 0.7.0

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 (76) hide show
  1. package/MANUAL.md +21 -6
  2. package/README.md +55 -7
  3. package/RELEASE.md +15 -0
  4. package/assets/agents/developer.md +41 -1
  5. package/assets/agents/slopmachine-claude.md +100 -60
  6. package/assets/agents/slopmachine.md +40 -17
  7. package/assets/claude/agents/developer.md +42 -5
  8. package/assets/skills/clarification-gate/SKILL.md +25 -5
  9. package/assets/skills/claude-worker-management/SKILL.md +280 -57
  10. package/assets/skills/developer-session-lifecycle/SKILL.md +81 -37
  11. package/assets/skills/development-guidance/SKILL.md +21 -1
  12. package/assets/skills/evaluation-triage/SKILL.md +32 -23
  13. package/assets/skills/final-evaluation-orchestration/SKILL.md +86 -50
  14. package/assets/skills/hardening-gate/SKILL.md +17 -3
  15. package/assets/skills/integrated-verification/SKILL.md +3 -3
  16. package/assets/skills/planning-gate/SKILL.md +32 -3
  17. package/assets/skills/planning-guidance/SKILL.md +72 -13
  18. package/assets/skills/retrospective-analysis/SKILL.md +2 -2
  19. package/assets/skills/scaffold-guidance/SKILL.md +129 -124
  20. package/assets/skills/submission-packaging/SKILL.md +33 -27
  21. package/assets/skills/verification-gates/SKILL.md +44 -14
  22. package/assets/slopmachine/backend-evaluation-prompt.md +1 -1
  23. package/assets/slopmachine/frontend-evaluation-prompt.md +5 -5
  24. package/assets/slopmachine/scaffold-playbooks/android-kotlin-compose.md +81 -0
  25. package/assets/slopmachine/scaffold-playbooks/android-kotlin-views.md +191 -0
  26. package/assets/slopmachine/scaffold-playbooks/android-native-java.md +203 -0
  27. package/assets/slopmachine/scaffold-playbooks/angular-default.md +181 -0
  28. package/assets/slopmachine/scaffold-playbooks/backend-baseline.md +142 -0
  29. package/assets/slopmachine/scaffold-playbooks/backend-family-matrix.md +80 -0
  30. package/assets/slopmachine/scaffold-playbooks/database-module-matrix.md +80 -0
  31. package/assets/slopmachine/scaffold-playbooks/django-default.md +166 -0
  32. package/assets/slopmachine/scaffold-playbooks/docker-baseline.md +189 -0
  33. package/assets/slopmachine/scaffold-playbooks/docker-shared-contract.md +334 -0
  34. package/assets/slopmachine/scaffold-playbooks/electron-vite-default.md +124 -0
  35. package/assets/slopmachine/scaffold-playbooks/expo-react-native-default.md +73 -0
  36. package/assets/slopmachine/scaffold-playbooks/fastapi-default.md +134 -0
  37. package/assets/slopmachine/scaffold-playbooks/frontend-baseline.md +160 -0
  38. package/assets/slopmachine/scaffold-playbooks/frontend-family-matrix.md +134 -0
  39. package/assets/slopmachine/scaffold-playbooks/generic-unknown-tech-guide.md +136 -0
  40. package/assets/slopmachine/scaffold-playbooks/go-chi-default.md +160 -0
  41. package/assets/slopmachine/scaffold-playbooks/ios-linux-portable.md +93 -0
  42. package/assets/slopmachine/scaffold-playbooks/ios-native-objective-c.md +151 -0
  43. package/assets/slopmachine/scaffold-playbooks/ios-native-swift.md +188 -0
  44. package/assets/slopmachine/scaffold-playbooks/laravel-default.md +216 -0
  45. package/assets/slopmachine/scaffold-playbooks/livewire-default.md +265 -0
  46. package/assets/slopmachine/scaffold-playbooks/overlay-module-matrix.md +130 -0
  47. package/assets/slopmachine/scaffold-playbooks/platform-family-matrix.md +79 -0
  48. package/assets/slopmachine/scaffold-playbooks/selection-matrix.md +72 -0
  49. package/assets/slopmachine/scaffold-playbooks/spring-boot-default.md +182 -0
  50. package/assets/slopmachine/scaffold-playbooks/tauri-default.md +80 -0
  51. package/assets/slopmachine/scaffold-playbooks/vue-vite-default.md +162 -0
  52. package/assets/slopmachine/scaffold-playbooks/web-default.md +96 -0
  53. package/assets/slopmachine/templates/AGENTS.md +41 -3
  54. package/assets/slopmachine/templates/CLAUDE.md +111 -0
  55. package/assets/slopmachine/utils/claude_create_session.mjs +1 -0
  56. package/assets/slopmachine/utils/claude_live_channel.mjs +188 -0
  57. package/assets/slopmachine/utils/claude_live_common.mjs +406 -0
  58. package/assets/slopmachine/utils/claude_live_hook.py +47 -0
  59. package/assets/slopmachine/utils/claude_live_launch.mjs +181 -0
  60. package/assets/slopmachine/utils/claude_live_status.mjs +25 -0
  61. package/assets/slopmachine/utils/claude_live_stop.mjs +45 -0
  62. package/assets/slopmachine/utils/claude_live_turn.mjs +250 -0
  63. package/assets/slopmachine/utils/claude_resume_session.mjs +1 -0
  64. package/assets/slopmachine/utils/claude_wait_for_rate_limit_reset.mjs +23 -0
  65. package/assets/slopmachine/utils/claude_wait_for_rate_limit_reset.sh +5 -0
  66. package/assets/slopmachine/utils/claude_worker_common.mjs +224 -4
  67. package/assets/slopmachine/utils/cleanup_delivery_artifacts.py +4 -0
  68. package/assets/slopmachine/utils/export_ai_session.mjs +1 -1
  69. package/assets/slopmachine/utils/normalize_claude_session.py +153 -0
  70. package/assets/slopmachine/utils/package_claude_session.mjs +96 -0
  71. package/assets/slopmachine/utils/prepare_strict_audit_workspace.mjs +65 -0
  72. package/package.json +1 -1
  73. package/src/constants.js +42 -3
  74. package/src/init.js +173 -28
  75. package/src/install.js +75 -0
  76. package/src/send-data.js +56 -57
@@ -0,0 +1,216 @@
1
+ # Laravel Default Scaffold Playbook
2
+
3
+ Use this playbook when the prompt explicitly asks for a Laravel/PHP baseline and does not need product-specific feature work.
4
+
5
+ ## Goal
6
+
7
+ Ship a concrete Laravel baseline that is:
8
+
9
+ - bootstrapped from the official Laravel path
10
+ - Docker-first
11
+ - safe by default
12
+ - wired to a real database path without `.env`
13
+ - verified with real Laravel tests
14
+ - limited to baseline infrastructure only
15
+
16
+ Verified lab:
17
+
18
+ - `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/laravel-baseline`
19
+
20
+ ## Official bootstrap path
21
+
22
+ Use the official Composer create-project flow:
23
+
24
+ ```bash
25
+ docker run --rm -u "$(id -u):$(id -g)" -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab:/workspace" -w /workspace composer:2.8 create-project --prefer-dist laravel/laravel="^12.0" laravel-baseline
26
+ ```
27
+
28
+ Observed bootstrap result for the verified lab:
29
+
30
+ - `laravel/laravel v12.12.2`
31
+ - `laravel/framework v12.56.0`
32
+ - `phpunit/phpunit v11.5.55`
33
+
34
+ ## Safe pinned defaults
35
+
36
+ - Docker base image: `php:8.4-cli-bookworm`
37
+ - Composer image: `composer:2.8`
38
+ - Laravel skeleton: `laravel/laravel v12.12.2`
39
+ - Lockfile-pinned framework: `laravel/framework v12.56.0`
40
+ - Lockfile-pinned test runner: `phpunit/phpunit v11.5.55`
41
+ - database default: SQLite file in a Docker-managed volume
42
+
43
+ The lockfile is the real dependency pin. Keep it committed.
44
+
45
+ ## No-`.env` rule
46
+
47
+ - do not commit `.env`
48
+ - do not require users to create `.env` before startup
49
+ - point Laravel at a committed empty environment stub instead of `.env`
50
+ - load runtime app/database values from a generated runtime config file in a Docker-managed volume
51
+
52
+ Verified lab pattern:
53
+
54
+ - `bootstrap/runtime-environment.stub` is the environment file Laravel loads
55
+ - `bootstrap/runtime-config.php` loads JSON from `APP_CONFIG_PATH`
56
+ - `scripts/bootstrap_runtime.sh` generates the JSON config and SQLite path
57
+
58
+ ## Database pattern
59
+
60
+ - default to SQLite for the baseline
61
+ - place the SQLite file in `/runtime/database/app.sqlite`
62
+ - keep `/runtime` on a named Docker volume
63
+ - run migrations from a single entrypoint script before app start and inside test execution
64
+ - expose one real persistence-backed endpoint so DB wiring is proven, not implied
65
+
66
+ Verified lab surface:
67
+
68
+ - `GET /health`
69
+ - `POST /api/items`
70
+ - `GET /api/items`
71
+
72
+ ## Runtime contract
73
+
74
+ Required commands:
75
+
76
+ - `docker compose up --build`
77
+ - `./run_tests.sh`
78
+
79
+ Helpful extra command:
80
+
81
+ - `./init_db.sh`
82
+
83
+ All three commands are real in the verified lab.
84
+
85
+ ## Docker / Compose pattern
86
+
87
+ - use `compose.yaml`
88
+ - one app service published to loopback only with a random host port
89
+ - one tester service behind a `test` profile
90
+ - named volume for runtime state
91
+ - healthcheck against `/health`
92
+ - same image for runtime and tests
93
+
94
+ Verified lab details:
95
+
96
+ - host bind example during detached verification: `127.0.0.1:32786->8000`
97
+ - host bind example during interactive verification: `127.0.0.1:32788->8000`
98
+
99
+ ## Testing baseline
100
+
101
+ Minimum real Laravel/PHP test floor:
102
+
103
+ - one unit test that proves runtime config defaults select SQLite without `.env`
104
+ - one feature test for health/database readiness
105
+ - one feature test for persistence-backed create/list behavior
106
+ - containerized `./run_tests.sh` that performs both HTTP smoke checks and `php artisan test`
107
+
108
+ Verified lab test files:
109
+
110
+ - `tests/Unit/RuntimeConfigTest.php`
111
+ - `tests/Feature/BaselineApiTest.php`
112
+
113
+ Verified lab test result:
114
+
115
+ - `3 passed (10 assertions)`
116
+
117
+ ## README requirements
118
+
119
+ The README must honestly state:
120
+
121
+ - this is a baseline, not a feature app
122
+ - exact stack and pins used
123
+ - exact runtime command: `docker compose up --build`
124
+ - exact broad test command: `./run_tests.sh`
125
+ - no `.env` requirement
126
+ - safe database/config pattern
127
+ - what is intentionally excluded
128
+ - exact verification commands and observed results
129
+
130
+ ## Commands actually run for the verified lab
131
+
132
+ All commands below were executed in `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/laravel-baseline`.
133
+
134
+ ```bash
135
+ docker compose config
136
+
137
+ docker compose up --build -d
138
+
139
+ docker compose ps
140
+
141
+ docker compose port app 8000
142
+
143
+ curl -fsS "http://127.0.0.1:32786/health"
144
+
145
+ curl -fsS -X POST "http://127.0.0.1:32786/api/items" -H "content-type: application/json" -d '{"name":"manual-smoke-item"}'
146
+
147
+ curl -fsS "http://127.0.0.1:32786/api/items"
148
+
149
+ docker compose down --volumes --remove-orphans
150
+
151
+ ./run_tests.sh
152
+
153
+ ./init_db.sh
154
+
155
+ python3 - <<'PY'
156
+ import signal
157
+ import subprocess
158
+ import time
159
+ from urllib.request import urlopen
160
+
161
+ cwd = "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/laravel-baseline"
162
+ proc = subprocess.Popen(["docker", "compose", "up", "--build"], cwd=cwd)
163
+ error = None
164
+ try:
165
+ deadline = time.time() + 180
166
+ while time.time() < deadline:
167
+ try:
168
+ port = subprocess.check_output(["docker", "compose", "port", "app", "8000"], cwd=cwd, text=True).strip().rsplit(":", 1)[-1]
169
+ with urlopen(f"http://127.0.0.1:{port}/health", timeout=2) as response:
170
+ if response.status == 200:
171
+ print(f"health reached while docker compose up --build was active on port {port}")
172
+ break
173
+ except Exception as exc:
174
+ error = exc
175
+ time.sleep(2)
176
+ else:
177
+ raise RuntimeError(f"health never became ready: {error}")
178
+ finally:
179
+ proc.send_signal(signal.SIGINT)
180
+ try:
181
+ proc.wait(timeout=30)
182
+ except subprocess.TimeoutExpired:
183
+ proc.kill()
184
+ proc.wait(timeout=30)
185
+ subprocess.run(["docker", "compose", "down", "--volumes", "--remove-orphans"], cwd=cwd, check=True)
186
+ PY
187
+ ```
188
+
189
+ ## Observed results
190
+
191
+ - `docker compose config` resolved cleanly
192
+ - `docker compose up --build -d` started the app and `docker compose port app 8000` returned `127.0.0.1:32786`
193
+ - `curl -fsS "http://127.0.0.1:32786/health"` returned `{"status":"ok","database":"ready"}`
194
+ - `curl -fsS -X POST "http://127.0.0.1:32786/api/items" ...` returned `{"data":{"name":"manual-smoke-item",...,"id":1}}`
195
+ - `curl -fsS "http://127.0.0.1:32786/api/items"` returned `{"data":[{"id":1,"name":"manual-smoke-item",...}]}`
196
+ - `./run_tests.sh` passed and ended with `3 passed (10 assertions)`
197
+ - `./init_db.sh` passed and ran the `2026_04_15_000000_create_items_table` migration in Docker
198
+ - the interactive `docker compose up --build` path reached `/health` successfully and printed `health reached while docker compose up --build was active on port 32788`
199
+
200
+ ## Acceptance checklist
201
+
202
+ Baseline is acceptable when:
203
+
204
+ - official Laravel bootstrap path is used
205
+ - dependencies are pinned by lockfile and explicit Docker image tags
206
+ - runtime does not rely on `.env`
207
+ - database defaults are safe and real
208
+ - `docker compose up --build` works
209
+ - `./run_tests.sh` works
210
+ - minimal real Laravel tests are present and passing
211
+ - README is honest about included versus excluded scope
212
+ - the lab stops at baseline infrastructure
213
+
214
+ ## Experimental verification status
215
+
216
+ Yes. This playbook is based on an experimentally verified lab, not a hypothetical template.
@@ -0,0 +1,265 @@
1
+ # Laravel Livewire Default Scaffold Playbook
2
+
3
+ Use this playbook when the prompt explicitly asks for a Laravel Livewire baseline and does not need product-specific feature work.
4
+
5
+ This playbook follows the shared Docker contract in:
6
+
7
+ - `/Users/yohannesakd/code/eaglepoint/demonstration/slopmachine-0.3/assets/slopmachine/scaffold-playbooks/docker-shared-contract.md`
8
+
9
+ ## Goal
10
+
11
+ Ship a concrete Laravel Livewire baseline that is:
12
+
13
+ - bootstrapped from the official Laravel path
14
+ - upgraded with a real Livewire package install
15
+ - Docker-first
16
+ - Tailwind-preferred without pretending a richer design system exists
17
+ - safe by default
18
+ - wired to a real database path without `.env`
19
+ - verified with real Livewire page/component tests inside containers
20
+ - limited to baseline infrastructure only
21
+
22
+ Verified lab:
23
+
24
+ - `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline`
25
+
26
+ ## Official bootstrap path
27
+
28
+ Use the official Composer create-project flow, then install Livewire in the created app:
29
+
30
+ ```bash
31
+ docker run --rm -u "$(id -u):$(id -g)" -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab:/workspace" -w /workspace composer:2.8 create-project --prefer-dist laravel/laravel="^12.0" livewire-baseline
32
+
33
+ docker run --rm -u "$(id -u):$(id -g)" -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline:/app" -w /app composer:2.8 require livewire/livewire
34
+ ```
35
+
36
+ Observed bootstrap result for the verified lab:
37
+
38
+ - `laravel/laravel v12.12.2`
39
+ - `laravel/framework v12.56.0`
40
+ - `livewire/livewire v4.2.4`
41
+ - `phpunit/phpunit v11.5.55`
42
+
43
+ ## Safe pinned defaults
44
+
45
+ - Docker runtime image: `php:8.4-cli-bookworm`
46
+ - Node asset build image: `node:22-bookworm-slim`
47
+ - Composer image: `composer:2.8`
48
+ - Laravel skeleton: `laravel/laravel v12.12.2`
49
+ - lockfile-pinned Livewire package: `livewire/livewire v4.2.4`
50
+ - lockfile-pinned test runner: `phpunit/phpunit v11.5.55`
51
+ - database default: SQLite file in a Docker-managed volume
52
+ - frontend styling default: Tailwind via Vite build during image creation
53
+
54
+ The lockfiles are the real dependency pins. Keep them committed.
55
+
56
+ ## No-`.env` rule
57
+
58
+ - do not commit `.env`
59
+ - do not require users to create `.env` before startup
60
+ - point Laravel at a committed empty environment stub instead of `.env`
61
+ - load runtime app/database values from a generated runtime config file in a Docker-managed volume
62
+
63
+ Verified lab pattern:
64
+
65
+ - `bootstrap/runtime-environment.stub` is the environment file Laravel loads
66
+ - `bootstrap/runtime-config.php` loads JSON from `APP_CONFIG_PATH`
67
+ - `scripts/bootstrap_runtime.sh` generates the JSON config and SQLite path
68
+
69
+ ## Livewire baseline pattern
70
+
71
+ - use a full-page Livewire component as the baseline surface
72
+ - use `Route::livewire('/', App\Livewire\ShoppingListPage::class)` for the root page
73
+ - provide a real layout with `@vite`, `@livewireStyles`, and `@livewireScripts`
74
+ - keep the UI honest: Tailwind-styled baseline only, not a product-grade feature set
75
+ - back the component with one real persistence path so Livewire behavior and DB wiring are both proven
76
+
77
+ Verified lab surface:
78
+
79
+ - `GET /health`
80
+ - `GET /`
81
+
82
+ Verified lab component flow:
83
+
84
+ - add an item from the full-page Livewire form
85
+ - persist it into SQLite
86
+ - rerender the saved list
87
+
88
+ ## Runtime contract
89
+
90
+ Required commands:
91
+
92
+ - `docker compose up --build`
93
+ - `./run_tests.sh`
94
+
95
+ Both commands are real in the verified lab.
96
+
97
+ ## Docker / Compose pattern
98
+
99
+ - use `compose.yaml`
100
+ - one app service published to loopback only with a random host port
101
+ - one tester service behind a `test` profile
102
+ - named volume for runtime state
103
+ - healthcheck against `/health`
104
+ - same application image for runtime and tests
105
+ - multi-stage Dockerfile: Composer dependency stage, Node/Tailwind asset stage, PHP runtime stage
106
+
107
+ Verified lab details:
108
+
109
+ - detached verification host bind: `127.0.0.1:32800->8000`
110
+ - interactive verification host bind: `127.0.0.1:32801->8000`
111
+
112
+ ## Tailwind stance
113
+
114
+ - Tailwind is preferred and used here
115
+ - build Tailwind assets ahead of runtime with Vite
116
+ - do not pretend there is a live Vite dev-server contract when the Docker baseline serves built assets from `public/build`
117
+
118
+ Verified lab files:
119
+
120
+ - `resources/css/app.css`
121
+ - `resources/views/layouts/app.blade.php`
122
+ - `resources/views/livewire/shopping-list-page.blade.php`
123
+
124
+ ## Testing baseline
125
+
126
+ Minimum real Livewire/Laravel test floor:
127
+
128
+ - one unit test that proves runtime config defaults select SQLite without `.env`
129
+ - one feature test for health/database readiness
130
+ - one page-render test that proves the root Livewire page responds and includes Livewire markup
131
+ - one Livewire component test that mutates state, saves data, and proves persistence
132
+ - containerized `./run_tests.sh` that performs HTTP smoke checks plus `php artisan test`
133
+
134
+ Verified lab test files:
135
+
136
+ - `tests/Unit/RuntimeConfigTest.php`
137
+ - `tests/Feature/LivewireBaselineTest.php`
138
+ - `tests/Feature/ShoppingListPageTest.php`
139
+
140
+ Verified lab test result:
141
+
142
+ - `4 passed (13 assertions)`
143
+
144
+ ## README requirements
145
+
146
+ The README must honestly state:
147
+
148
+ - this is a baseline, not a feature app
149
+ - exact stack and pins used
150
+ - exact runtime command: `docker compose up --build`
151
+ - exact broad test command: `./run_tests.sh`
152
+ - no `.env` requirement
153
+ - safe database/config pattern
154
+ - Tailwind/Vite build boundary
155
+ - what is intentionally excluded
156
+ - exact verification commands and observed results
157
+
158
+ ## Commands actually run for the verified lab
159
+
160
+ All commands below were executed in `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline` unless otherwise noted.
161
+
162
+ Bootstrap and dependency commands:
163
+
164
+ ```bash
165
+ docker run --rm -u "$(id -u):$(id -g)" -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab:/workspace" -w /workspace composer:2.8 create-project --prefer-dist laravel/laravel="^12.0" livewire-baseline
166
+
167
+ docker run --rm -u "$(id -u):$(id -g)" -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline:/app" -w /app composer:2.8 require livewire/livewire
168
+
169
+ docker run --rm -u "$(id -u):$(id -g)" -e npm_config_cache=/app/.npm-cache -v "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline:/app" -w /app node:22-bookworm-slim npm install
170
+ ```
171
+
172
+ Verification commands:
173
+
174
+ ```bash
175
+ docker compose config
176
+
177
+ docker compose up --build -d
178
+
179
+ docker compose ps
180
+
181
+ docker compose port app 8000
182
+
183
+ curl -fsS "http://127.0.0.1:32800/health"
184
+
185
+ python3 - <<'PY'
186
+ from urllib.request import urlopen
187
+ html = urlopen('http://127.0.0.1:32800/', timeout=10).read().decode()
188
+ print('title=', 'Livewire baseline' in html)
189
+ print('snapshot=', 'wire:snapshot' in html)
190
+ print('saved_items=', 'Saved items' in html)
191
+ PY
192
+
193
+ docker compose down --volumes --remove-orphans
194
+
195
+ ./run_tests.sh
196
+
197
+ python3 - <<'PY'
198
+ import signal
199
+ import subprocess
200
+ import time
201
+ from urllib.request import urlopen
202
+
203
+ cwd = "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/livewire-baseline"
204
+ proc = subprocess.Popen(["docker", "compose", "up", "--build"], cwd=cwd)
205
+ last_error = None
206
+ try:
207
+ deadline = time.time() + 240
208
+ while time.time() < deadline:
209
+ try:
210
+ port_line = subprocess.check_output(["docker", "compose", "port", "app", "8000"], cwd=cwd, text=True).strip()
211
+ if not port_line:
212
+ raise RuntimeError("port not published yet")
213
+ port = port_line.rsplit(":", 1)[-1]
214
+ with urlopen(f"http://127.0.0.1:{port}/health", timeout=3) as response:
215
+ health_body = response.read().decode()
216
+ root_html = urlopen(f"http://127.0.0.1:{port}/", timeout=3).read().decode()
217
+ if 'Livewire baseline' in root_html and 'wire:snapshot' in root_html:
218
+ print(f"interactive docker compose up --build reached /health and / on port {port}")
219
+ print(health_body)
220
+ break
221
+ raise RuntimeError("root page missing Livewire markers")
222
+ except Exception as exc:
223
+ last_error = exc
224
+ time.sleep(2)
225
+ else:
226
+ raise RuntimeError(f"interactive compose never became ready: {last_error}")
227
+ finally:
228
+ proc.send_signal(signal.SIGINT)
229
+ try:
230
+ proc.wait(timeout=30)
231
+ except subprocess.TimeoutExpired:
232
+ proc.kill()
233
+ proc.wait(timeout=30)
234
+ subprocess.run(["docker", "compose", "down", "--volumes", "--remove-orphans"], cwd=cwd, check=True)
235
+ PY
236
+ ```
237
+
238
+ ## Observed results
239
+
240
+ - `docker compose config` resolved cleanly
241
+ - `docker compose up --build -d` started the app and `docker compose port app 8000` returned `127.0.0.1:32800`
242
+ - `docker compose ps` reported `Up ... (healthy)`
243
+ - `curl -fsS "http://127.0.0.1:32800/health"` returned `{"status":"ok","database":"ready"}`
244
+ - the root page marker script printed `title= True`, `snapshot= True`, and `saved_items= True`
245
+ - `./run_tests.sh` passed and ended with `4 passed (13 assertions)`
246
+ - the interactive `docker compose up --build` path reached both `/health` and `/` successfully and printed `interactive docker compose up --build reached /health and / on port 32801`
247
+
248
+ ## Acceptance checklist
249
+
250
+ Baseline is acceptable when:
251
+
252
+ - official Laravel bootstrap path is used
253
+ - Livewire is installed for real and pinned by lockfile
254
+ - Tailwind is used honestly as the default styling layer
255
+ - runtime does not rely on `.env`
256
+ - database defaults are safe and real
257
+ - `docker compose up --build` works
258
+ - `./run_tests.sh` works
259
+ - minimal real Livewire page/component tests are present and passing
260
+ - README is honest about included versus excluded scope
261
+ - the lab stops at baseline infrastructure
262
+
263
+ ## Experimental verification status
264
+
265
+ Yes. This playbook is based on an experimentally verified lab, not a hypothetical template.
@@ -0,0 +1,130 @@
1
+ # Overlay / Module Matrix for Scaffold Composition
2
+
3
+ Use this after selecting the scaffold root playbook. The root establishes the primary runtime and honest baseline contract; overlays add predictable non-root capabilities that recur across many prompts.
4
+
5
+ ## Core rule
6
+
7
+ - **scaffold root:** the minimum stack needed to boot, run, test, and explain the chosen platform honestly
8
+ - **overlay module:** a repeatable capability that is common enough to standardize but not universal enough to force into every root
9
+ - **later prompt-specific development:** product/domain behavior, provider-specific integrations, and feature depth that depends on the actual app brief
10
+
11
+ ## Root vs overlay vs later work
12
+
13
+ | Concern | Put in scaffold root when | Put in overlay when | Defer to later prompt-specific work when |
14
+ | --- | --- | --- | --- |
15
+ | Runtime/framework | it defines how the app starts and is built | almost never | never |
16
+ | Minimal testing | one real test path is required for honesty | extra test layers are requested or predictably valuable | the test only exists for a future feature |
17
+ | Config/secrets | the app cannot start safely without it | advanced secret/auth/policy layers are needed | provider-specific secret rotation or cloud policy details are unknown |
18
+ | Logging/validation | tiny baseline wiring is obviously required by the stack | structured, reusable cross-cutting policy is needed | domain-specific rules and business validations are not known yet |
19
+ | UI system | only a tiny shell/layout needed to prove the frontend runs | reusable design system, theme, component primitives, or form layer are wanted | product-specific screens and workflows are not yet defined |
20
+ | Database | a minimal persistence path is required to prove the backend honestly | network DB, ORM, migrations, cache, or multi-service persistence is needed | schema-heavy product models are not yet known |
21
+ | Jobs/search/export/reporting | rarely | when the prompt already implies platform support for them | when reports, indexes, or jobs depend on product logic not yet defined |
22
+
23
+ ## Overlay matrix
24
+
25
+ | Overlay family | Typical module contents | Apply to | Keep out of root by default because |
26
+ | --- | --- | --- | --- |
27
+ | Testing overlays | browser E2E harness, API integration test container, contract-test wiring, visual regression setup | frontend, backend, fullstack, mobile, desktop | roots only need one honest baseline test path; deeper test stacks are optional cost |
28
+ | Auth / security / config overlays | session/JWT wiring, user model stub, RBAC shell, CORS/CSRF/rate-limit policy, secret-file/config loader, secure cookie defaults | backend, fullstack, frontend shells with protected routes | many scaffolds do not need auth yet, and provider choice is often prompt-specific |
29
+ | Logging / validation overlays | structured logger, request IDs, error envelope, schema validation, input parsing, shared DTO/schema package | backend, fullstack, API-heavy frontend | baseline roots can survive with light defaults; standardized policy is reusable but not universal |
30
+ | UI system overlays | design tokens, theme switch, component primitives, layout shell, form helpers, icon setup, toast/notification shell | frontend, fullstack, desktop, some mobile | not every scaffold needs a reusable design system on day one |
31
+ | Database overlays | Postgres/MySQL service, ORM module, migrations tool, seed path, DB admin helper, cache/Redis sidecar when persistence model requires it | backend, fullstack | some roots only need a very small default persistence story; network DB choice should stay modular |
32
+ | Queue / job / scheduler overlays | worker service, queue broker, retry policy, cron/scheduler entrypoint, job health metrics | backend, fullstack | background processing is expensive to add and often unused in simple scaffolds |
33
+ | Search / export / reporting overlays | search engine service stub, export pipeline shell, report generation worker, storage/export directory contract | backend, fullstack, admin-heavy frontend/fullstack | these usually depend on real domain models, so only scaffold them when the prompt already signals the need |
34
+
35
+ ## Reusable overlay guidance by category
36
+
37
+ ### Testing overlays
38
+
39
+ - keep **one real baseline test path in the root**
40
+ - add overlays for:
41
+ - browser E2E
42
+ - API integration/container tests
43
+ - contract testing
44
+ - visual regression or snapshot systems
45
+ - do **not** pre-add heavyweight E2E browsers to every root
46
+
47
+ ### Auth / security / config overlays
48
+
49
+ - keep **safe config loading and no-secret defaults in the root**
50
+ - use overlays for:
51
+ - local auth stub or session/JWT baseline
52
+ - RBAC/permission shell
53
+ - hardened API security middleware
54
+ - provider-ready secret/config abstraction
55
+ - defer:
56
+ - OAuth provider specifics
57
+ - enterprise SSO details
58
+ - tenant-specific policy logic
59
+
60
+ ### Logging / validation overlays
61
+
62
+ - root may include very light logging/validation when the framework already exposes it naturally
63
+ - overlay should standardize:
64
+ - structured logs
65
+ - correlation/request IDs
66
+ - shared validation schemas
67
+ - normalized error responses
68
+ - defer domain validation rules that depend on real business entities
69
+
70
+ ### UI system overlays
71
+
72
+ - root should only prove the frontend can render and be tested
73
+ - overlay is the right place for:
74
+ - theme tokens
75
+ - reusable components
76
+ - navigation shell
77
+ - form system
78
+ - notification primitives
79
+ - defer product screens, dashboards, and specialized flows
80
+
81
+ ### Database overlays
82
+
83
+ - **yes, database modules belong in this matrix** when they are a reusable composition choice beyond the minimal root persistence story
84
+ - keep in root:
85
+ - only the smallest honest persistence needed for the selected backend/fullstack scaffold
86
+ - use overlay for:
87
+ - network DB service selection
88
+ - ORM/migrations package
89
+ - seed/reset helpers
90
+ - caching sidecars closely tied to persistence shape
91
+ - defer schema-rich domain modeling and app-specific query logic
92
+
93
+ ### Queue / job / scheduler overlays
94
+
95
+ - add only when the prompt already implies async work, scheduled work, ingestion, notifications, or heavy exports
96
+ - overlay should own:
97
+ - separate worker runtime
98
+ - queue/broker service
99
+ - retry/dead-letter defaults
100
+ - scheduler entrypoint
101
+ - defer actual business jobs until features are defined
102
+
103
+ ### Search / export / reporting overlays
104
+
105
+ - include at scaffold time only when these are clearly part of the platform ask, such as admin/reporting systems, catalog/search products, or export-heavy back offices
106
+ - overlay may establish:
107
+ - search service wiring
108
+ - export job shell
109
+ - report generation/storage contracts
110
+ - defer report definitions, search ranking rules, and domain-specific exports
111
+
112
+ ## Composition examples
113
+
114
+ | Composition | When it fits | Notes |
115
+ | --- | --- | --- |
116
+ | frontend root + UI system overlay + testing overlay | product asks for a polished web UI but feature scope is still open | keep domain pages out; ship reusable shell and stronger frontend verification |
117
+ | backend root + database overlay + logging/validation overlay | API scaffold needs production-shaped persistence and cross-cutting API quality | root proves API baseline; overlays add Postgres/ORM/migrations plus structured request handling |
118
+ | frontend root + backend root + database overlay + auth overlay | fullstack app with real accounts and persistent data | roots define separate runtime surfaces; overlays add shared auth and stronger persistence |
119
+ | frontend root + backend root + database overlay + queue overlay + reporting overlay | admin/back-office or workflow app with async exports/reports | only do this when the prompt already signals jobs/reports early |
120
+ | mobile/desktop root + backend root + auth overlay + logging/validation overlay | client app depends on API-backed identity and reusable service policy | keep platform runtime separate; centralize auth/API policy in overlays |
121
+
122
+ ## Decision shortcuts
123
+
124
+ - if the item is required for **every** app of that root family to start honestly, keep it in the root
125
+ - if the item is **common but optional** across many apps, make it an overlay
126
+ - if the item depends on domain nouns, product workflows, or provider selection not yet in evidence, defer it to later development
127
+
128
+ ## Practical stop rule
129
+
130
+ After root selection, layer only the overlays already justified by the prompt or clearly implied platform category. Stop before product-specific implementation begins.