theslopmachine 0.4.8 → 0.5.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.
- package/README.md +174 -144
- package/RELEASE.md +8 -0
- package/assets/agents/developer.md +26 -0
- package/assets/agents/slopmachine.md +7 -0
- package/assets/skills/clarification-gate/SKILL.md +7 -4
- package/assets/slopmachine/templates/AGENTS.md +8 -78
- package/package.json +1 -1
- package/src/cli.js +21 -1
- package/src/config.js +103 -0
- package/src/constants.js +2 -9
- package/src/install.js +86 -34
- package/src/send-data.js +536 -0
- package/src/set-token.js +12 -0
package/README.md
CHANGED
|
@@ -1,226 +1,256 @@
|
|
|
1
1
|
# theslopmachine
|
|
2
2
|
|
|
3
|
-
`theslopmachine`
|
|
3
|
+
`theslopmachine` installs and bootstraps the SlopMachine workflow for OpenCode.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It configures:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
7
|
+
- the `slopmachine` owner agent
|
|
8
|
+
- the `developer` implementation agent
|
|
9
|
+
- required skills under `~/.agents/skills/`
|
|
10
|
+
- workflow support files under `~/slopmachine/`
|
|
11
|
+
- OpenCode MCP entries for `context7` and `exa`
|
|
14
12
|
|
|
15
|
-
Requirements
|
|
13
|
+
## Requirements
|
|
16
14
|
|
|
17
15
|
- Node.js 18+
|
|
18
16
|
- `git`
|
|
19
|
-
- Docker
|
|
20
|
-
- `
|
|
17
|
+
- Docker
|
|
18
|
+
- `python3`
|
|
19
|
+
- `opencode`
|
|
20
|
+
- `br` (`beads_rust`)
|
|
21
|
+
|
|
22
|
+
`slopmachine setup` verifies or installs what it can.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
From this package directory:
|
|
23
27
|
|
|
24
28
|
```bash
|
|
25
29
|
npm install
|
|
26
30
|
npm run check
|
|
27
31
|
npm pack
|
|
28
|
-
npm install -g ./theslopmachine
|
|
32
|
+
npm install -g ./theslopmachine-0.5.0.tgz
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
For local package development instead of global install:
|
|
35
|
+
For local development instead:
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
38
|
npm link
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
## Commands
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
### `slopmachine setup`
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
Use this once per machine, then rerun any time you want to refresh packaged assets.
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
48
|
slopmachine setup
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
What it does:
|
|
50
52
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- installs
|
|
54
|
-
- installs
|
|
55
|
-
- installs
|
|
53
|
+
- verifies or installs `opencode`
|
|
54
|
+
- verifies `br`, `git`, `python3`, and Docker
|
|
55
|
+
- installs packaged agents into `~/.config/opencode/agents/`
|
|
56
|
+
- installs packaged skills into `~/.agents/skills/`
|
|
57
|
+
- installs workflow files into `~/slopmachine/`
|
|
56
58
|
- updates `~/.config/opencode/opencode.json`
|
|
57
|
-
-
|
|
59
|
+
- ensures packaged MCP entries for `context7` and `exa`
|
|
60
|
+
- optionally asks for an upload token if one is not already stored
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
Notes:
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
- existing upload token is preserved and setup skips that prompt when one already exists
|
|
65
|
+
- existing `context7` and `exa` entries are preserved if already configured
|
|
66
|
+
- package-managed assets are refreshed on rerun
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
- Exa: `https://exa.ai`
|
|
68
|
+
### `slopmachine init`
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
Use this in a new or empty project directory to create a SlopMachine workspace.
|
|
67
71
|
|
|
68
72
|
```bash
|
|
69
|
-
|
|
73
|
+
mkdir my-project
|
|
74
|
+
cd my-project
|
|
75
|
+
slopmachine init
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
|
|
78
|
+
Or open OpenCode immediately after bootstrap:
|
|
73
79
|
|
|
74
80
|
```bash
|
|
75
|
-
|
|
81
|
+
slopmachine init -o
|
|
76
82
|
```
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
What it creates:
|
|
85
|
+
|
|
86
|
+
- `repo/`
|
|
87
|
+
- `docs/`
|
|
88
|
+
- `sessions/`
|
|
89
|
+
- `metadata.json`
|
|
90
|
+
- `.ai/metadata.json`
|
|
91
|
+
- root `.beads/`
|
|
92
|
+
- `repo/AGENTS.md`
|
|
93
|
+
|
|
94
|
+
Important details:
|
|
95
|
+
|
|
96
|
+
- `run_id` is created in `.ai/metadata.json`
|
|
97
|
+
- the workspace root is the parent directory containing `repo/`
|
|
98
|
+
- Beads lives in the workspace root, not inside `repo/`
|
|
79
99
|
|
|
80
|
-
|
|
100
|
+
### `slopmachine set-token`
|
|
101
|
+
|
|
102
|
+
Stores the upload token used by `send-data`.
|
|
81
103
|
|
|
82
104
|
```bash
|
|
83
|
-
|
|
84
|
-
cd my-project
|
|
85
|
-
slopmachine init
|
|
105
|
+
slopmachine set-token
|
|
86
106
|
```
|
|
87
107
|
|
|
88
|
-
|
|
108
|
+
Behavior:
|
|
109
|
+
|
|
110
|
+
- prompts for the plaintext upload token
|
|
111
|
+
- stores it in `~/.config/slopmachine/config.json`
|
|
112
|
+
- replaces an existing token if one is already stored
|
|
113
|
+
- does not validate the token over the network during entry
|
|
114
|
+
|
|
115
|
+
### `slopmachine send-data <owner-session-id>`
|
|
116
|
+
|
|
117
|
+
Exports workflow artifacts and uploads them to the configured Supabase endpoint.
|
|
89
118
|
|
|
90
119
|
```bash
|
|
91
|
-
|
|
92
|
-
cd my-project
|
|
93
|
-
slopmachine init -o
|
|
120
|
+
slopmachine send-data <owner-session-id>
|
|
94
121
|
```
|
|
95
122
|
|
|
96
|
-
|
|
123
|
+
Supported options:
|
|
124
|
+
|
|
125
|
+
- `--dry-run`
|
|
126
|
+
- `--yes`
|
|
127
|
+
- `--label <text>`
|
|
128
|
+
- `--project-id <id>`
|
|
129
|
+
- `--output <path>`
|
|
130
|
+
- `--endpoint <url>`
|
|
131
|
+
|
|
132
|
+
Examples:
|
|
97
133
|
|
|
98
134
|
```bash
|
|
99
|
-
|
|
100
|
-
|
|
135
|
+
slopmachine send-data ses_abc123
|
|
136
|
+
slopmachine send-data ses_abc123 --dry-run
|
|
137
|
+
slopmachine send-data ses_abc123 --yes --label sprint-12
|
|
138
|
+
slopmachine send-data ses_abc123 --endpoint "https://<project-ref>.supabase.co/functions/v1/slopmachine-upload"
|
|
101
139
|
```
|
|
102
140
|
|
|
103
|
-
|
|
141
|
+
Where to run it:
|
|
104
142
|
|
|
105
|
-
|
|
143
|
+
- preferred: workspace root
|
|
144
|
+
- also supported: `repo/`
|
|
106
145
|
|
|
107
|
-
|
|
108
|
-
- `docs/` for workflow documentation and evidence
|
|
109
|
-
- `sessions/` for exported session artifacts
|
|
110
|
-
- `metadata.json` for project workflow metadata
|
|
111
|
-
- `repo/AGENTS.md` for the repo-local agent instructions
|
|
146
|
+
If run from `repo/`, the command resolves the parent workspace root automatically.
|
|
112
147
|
|
|
113
|
-
|
|
148
|
+
What it exports live:
|
|
114
149
|
|
|
115
|
-
|
|
150
|
+
- owner session from the positional `owner-session-id`
|
|
151
|
+
- developer sessions from `.ai/metadata.json`
|
|
152
|
+
- `beads-export.json` from root `.beads/`
|
|
116
153
|
|
|
117
|
-
|
|
154
|
+
What it includes when present:
|
|
118
155
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
156
|
+
- `self-test-run.md`
|
|
157
|
+
- `self-test-fixes.md`
|
|
158
|
+
- `retrospective-<run_id>.md`
|
|
159
|
+
- `improvement-actions-<run_id>.md`
|
|
160
|
+
- `metadata.json`
|
|
161
|
+
- `ai-metadata.json`
|
|
162
|
+
- `manifest.json`
|
|
125
163
|
|
|
126
|
-
-
|
|
127
|
-
- every bootstrapped project must expose one primary broad test command: `./run_tests.sh`
|
|
128
|
-
- for Dockerized web backend or fullstack projects, the expected broad runtime command is `docker compose up --build`
|
|
129
|
-
- for non-Docker runtime cases, the expected broad runtime command is usually `./run_app.sh`
|
|
164
|
+
Fail-fast conditions:
|
|
130
165
|
|
|
131
|
-
|
|
166
|
+
- missing owner session id argument
|
|
167
|
+
- missing `.ai/metadata.json`
|
|
168
|
+
- missing `run_id`
|
|
169
|
+
- missing tracked developer session ids
|
|
170
|
+
- owner session export failure
|
|
171
|
+
- developer session export failure
|
|
132
172
|
|
|
133
|
-
-
|
|
134
|
-
- treat `./run_tests.sh` as a broad gate, not an ordinary every-step verification command
|
|
135
|
-
- for Dockerized web backend and fullstack projects, scaffold acceptance should establish both `docker compose up --build` and `./run_tests.sh`
|
|
173
|
+
Warn-only conditions:
|
|
136
174
|
|
|
137
|
-
|
|
175
|
+
- missing `self-test-run.md`
|
|
176
|
+
- missing `self-test-fixes.md`
|
|
177
|
+
- missing retrospective files
|
|
138
178
|
|
|
139
|
-
|
|
179
|
+
Output behavior:
|
|
140
180
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
181
|
+
- creates a flat zip archive
|
|
182
|
+
- keeps the local zip by default
|
|
183
|
+
- default zip path:
|
|
184
|
+
- `~/slopmachine/retrospectives/send-data-<run_id>.zip`
|
|
185
|
+
- shows a preview before upload unless `--yes` is passed
|
|
144
186
|
|
|
145
|
-
|
|
187
|
+
## Config Files
|
|
146
188
|
|
|
147
|
-
|
|
148
|
-
2. `P1 Clarification`
|
|
149
|
-
3. `P2 Planning`
|
|
150
|
-
4. `P3 Scaffold`
|
|
151
|
-
5. `P4 Development`
|
|
152
|
-
6. `P5 Integrated Verification`
|
|
153
|
-
7. `P6 Hardening`
|
|
154
|
-
8. `P7 Evaluation and Fix Verification`
|
|
155
|
-
9. `P8 Final Human Decision`
|
|
156
|
-
10. `P9 Submission Packaging`
|
|
157
|
-
11. `P10 Retrospective`
|
|
189
|
+
Machine-level config:
|
|
158
190
|
|
|
159
|
-
|
|
191
|
+
- `~/.config/slopmachine/config.json`
|
|
160
192
|
|
|
161
|
-
|
|
162
|
-
- prefer targeted reads and focused local verification during implementation
|
|
163
|
-
- keep environment-specific state out of the package
|
|
164
|
-
- do not package local runtime artifacts, caches, editor folders, or generated dependency environments
|
|
193
|
+
Current schema:
|
|
165
194
|
|
|
166
|
-
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"upload": {
|
|
198
|
+
"endpoint": "https://<project-ref>.supabase.co/functions/v1/slopmachine-upload",
|
|
199
|
+
"token": "sm_u_...",
|
|
200
|
+
"timeoutMs": 30000
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
167
204
|
|
|
168
|
-
|
|
169
|
-
- do not hardcode database-specific environment state into packaged assets
|
|
170
|
-
- do not ship database files such as `.db`, `.sqlite`, dumps, or seeded local database artifacts in the package
|
|
205
|
+
OpenCode config managed by setup:
|
|
171
206
|
|
|
172
|
-
|
|
207
|
+
- `~/.config/opencode/opencode.json`
|
|
173
208
|
|
|
174
|
-
|
|
209
|
+
Packaged MCPs managed by setup:
|
|
175
210
|
|
|
176
|
-
|
|
211
|
+
- `context7`
|
|
212
|
+
- `exa`
|
|
177
213
|
|
|
178
|
-
|
|
179
|
-
- skills: `~/.agents/skills/`
|
|
180
|
-
- OpenCode config: `~/.config/opencode/opencode.json`
|
|
181
|
-
- packaged workflow files: `~/slopmachine/`
|
|
214
|
+
## Installed Assets
|
|
182
215
|
|
|
183
|
-
|
|
216
|
+
Agents:
|
|
184
217
|
|
|
185
218
|
- `~/.config/opencode/agents/slopmachine.md`
|
|
186
219
|
- `~/.config/opencode/agents/developer.md`
|
|
187
220
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- `~/.agents/skills
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
- MCP server: `shadcn` disabled by default
|
|
225
|
-
|
|
226
|
-
These are the user-editable locations if you want to customize agents, skills, plugins, or MCP configuration after setup.
|
|
221
|
+
Skills:
|
|
222
|
+
|
|
223
|
+
- installed under `~/.agents/skills/`
|
|
224
|
+
|
|
225
|
+
Workflow files:
|
|
226
|
+
|
|
227
|
+
- installed under `~/slopmachine/`
|
|
228
|
+
|
|
229
|
+
## Verification
|
|
230
|
+
|
|
231
|
+
Package-level check:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
npm run check
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Basic machine verification:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
slopmachine --help
|
|
241
|
+
slopmachine set-token
|
|
242
|
+
slopmachine setup
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`send-data` verification:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
slopmachine send-data <owner-session-id> --dry-run --endpoint "https://<project-ref>.supabase.co/functions/v1/slopmachine-upload"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Notes
|
|
252
|
+
|
|
253
|
+
- the upload token is machine-level state and is not stored in the repo
|
|
254
|
+
- the owner session id is currently supplied manually to `send-data`
|
|
255
|
+
- developer session ids come from `.ai/metadata.json`
|
|
256
|
+
- broad workflow files and session exports live at workspace root, not inside `repo/`
|
package/RELEASE.md
CHANGED
|
@@ -14,6 +14,14 @@ node ./bin/slopmachine.js --help
|
|
|
14
14
|
SLOPMACHINE_HOME="$(pwd)/.tmp-home" SLOPMACHINE_NONINTERACTIVE=1 SLOPMACHINE_PLUGIN_BOOTSTRAP=0 node ./bin/slopmachine.js setup
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
That setup path should install `opencode-ai@latest` when OpenCode is missing and refresh it to `@latest` when it already exists.
|
|
18
|
+
|
|
19
|
+
Users can later refresh to the newest published package with:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
slopmachine upgrade
|
|
23
|
+
```
|
|
24
|
+
|
|
17
25
|
3. Test init into an isolated temp project:
|
|
18
26
|
|
|
19
27
|
```bash
|
|
@@ -32,6 +32,7 @@ Read and follow `AGENTS.md` before implementing.
|
|
|
32
32
|
- do real verification, not confidence theater
|
|
33
33
|
- keep moving until the assigned work is materially complete or concretely blocked
|
|
34
34
|
- do not stop for unnecessary intermediate check-ins
|
|
35
|
+
- use independent engineering judgment; do not behave like a passive worker waiting to be corrected later
|
|
35
36
|
|
|
36
37
|
## Requirements And Planning
|
|
37
38
|
|
|
@@ -41,6 +42,7 @@ Before coding:
|
|
|
41
42
|
- surface meaningful ambiguity instead of silently guessing
|
|
42
43
|
- make the plan concrete enough to drive real implementation
|
|
43
44
|
- keep frontend/backend surfaces aligned when both sides matter
|
|
45
|
+
- check prompt-fit before reporting completion; if the requested result still has visible gaps, keep working or call them out explicitly
|
|
44
46
|
|
|
45
47
|
Do not narrow scope for convenience.
|
|
46
48
|
|
|
@@ -53,6 +55,7 @@ Do not narrow scope for convenience.
|
|
|
53
55
|
- keep repo-local docs and code structure statically reviewable; do not rely on runtime success alone to make the project understandable
|
|
54
56
|
- keep the repo self-sufficient; do not make it depend on parent-directory docs or sibling artifacts for startup, build/preview, configuration, verification, or basic understanding
|
|
55
57
|
- do not touch workflow or rulebook files such as `AGENTS.md` unless explicitly asked
|
|
58
|
+
- if the work changes acceptance-critical docs or contracts, review those docs yourself before replying instead of assuming the owner will catch inconsistencies later
|
|
56
59
|
|
|
57
60
|
## Verification Cadence
|
|
58
61
|
|
|
@@ -97,6 +100,19 @@ Selected-stack defaults:
|
|
|
97
100
|
- use a shared validation/error-handling path when validation materially affects the flow
|
|
98
101
|
- do not hide missing failure handling behind fake-success paths
|
|
99
102
|
|
|
103
|
+
## Completion Preflight
|
|
104
|
+
|
|
105
|
+
Before reporting a planning package, scaffold, implementation slice, or fix round as ready, run this preflight yourself:
|
|
106
|
+
|
|
107
|
+
- prompt-fit: does the result still satisfy the original request without silent narrowing?
|
|
108
|
+
- consistency: do code, docs, route contracts, security notes, and runtime/test commands agree?
|
|
109
|
+
- flow completeness: are the user-facing and operator-facing flows touched by this work actually covered end to end?
|
|
110
|
+
- security and permissions: are auth, RBAC, object-level checks, sensitive actions, and audit implications handled where relevant?
|
|
111
|
+
- verification: did you run the strongest targeted checks that are appropriate without using owner-only broad gates?
|
|
112
|
+
- reviewability: can the owner review this work by reading the changed files and a small number of directly related files?
|
|
113
|
+
|
|
114
|
+
If any answer is no, fix it before replying or call out the blocker explicitly.
|
|
115
|
+
|
|
100
116
|
## Skills
|
|
101
117
|
|
|
102
118
|
- use relevant framework or language skills when they materially help the current task
|
|
@@ -109,3 +125,13 @@ Selected-stack defaults:
|
|
|
109
125
|
- always name the exact verification commands you ran and the concrete results they produced
|
|
110
126
|
- if you ran no verification command for part of the work, say that explicitly instead of implying broader proof than you have
|
|
111
127
|
- if a problem needs a real fix, fix it instead of explaining around it
|
|
128
|
+
|
|
129
|
+
Use this reply shape for substantive work:
|
|
130
|
+
|
|
131
|
+
1. `Changed files` — exact files changed
|
|
132
|
+
2. `What changed` — the concrete behavior/contract updates in those files
|
|
133
|
+
3. `Why this should pass review` — prompt-fit and consistency check in 2-5 bullets
|
|
134
|
+
4. `Verification` — exact commands run and exact results
|
|
135
|
+
5. `Remaining risks` — only the real unresolved weaknesses, if any
|
|
136
|
+
|
|
137
|
+
Keep the reply compact. Point to the exact changed files and the narrow supporting files the owner should read next.
|
|
@@ -244,6 +244,8 @@ When talking to the developer:
|
|
|
244
244
|
- keep prompts natural, sharp, and compact unless the moment really needs more context
|
|
245
245
|
- translate workflow intent into normal software-project language
|
|
246
246
|
- for each development slice or follow-up fix request, require the reply to state the exact verification commands that were run and the concrete results they produced
|
|
247
|
+
- require the developer to point to the exact changed files and the narrow supporting files worth review
|
|
248
|
+
- require the developer to self-check prompt-fit, consistency, and likely review defects before claiming readiness
|
|
247
249
|
|
|
248
250
|
Do not leak workflow internals such as:
|
|
249
251
|
|
|
@@ -265,6 +267,11 @@ Do not speak as a relay for a third party.
|
|
|
265
267
|
- read only what is needed to answer the current decision
|
|
266
268
|
- keep comments and metadata auditable and specific
|
|
267
269
|
- keep external docs owner-maintained as reference copies and repo-local docs developer-maintained for the repo's self-sufficient source of truth
|
|
270
|
+
- default review scope to the changed files and the specific supporting files named by the developer
|
|
271
|
+
- expand review scope only when a concrete inconsistency or missing dependency forces it
|
|
272
|
+
- avoid `grep` by default; prefer `glob` to identify exact files and `read` with targeted offsets
|
|
273
|
+
- use `grep` only for an exact low-cardinality string after the relevant file set is already known
|
|
274
|
+
- do not run broad parent-root searches during ordinary review when exact project files are already known
|
|
268
275
|
|
|
269
276
|
## Review Posture
|
|
270
277
|
|
|
@@ -100,14 +100,17 @@ If nothing material was unclear, still create `questions.md` and keep it minimal
|
|
|
100
100
|
|
|
101
101
|
- compare the original prompt and the prepared clarification prompt using one dedicated `General` validation session, never the developer session
|
|
102
102
|
- do not create a new validation session for every retry unless the session became unusable or a fundamental misunderstanding requires a clean restart
|
|
103
|
-
- on the first validation pass,
|
|
104
|
-
-
|
|
105
|
-
-
|
|
103
|
+
- on the first validation pass, prefer a file-based validation request that points the validator to `../metadata.json`, `../docs/questions.md`, and `../.ai/clarification-prompt.md` and asks it to read those files directly
|
|
104
|
+
- in that first pass, use `../metadata.json` as the source of truth for the original prompt instead of re-inlining the full prompt body when file access is available
|
|
105
|
+
- if file access is unavailable or blocked, fall back to one self-contained validation prompt block that includes the full original prompt text, the full current questions record, and the full current `../.ai/clarification-prompt.md`
|
|
106
|
+
- do not use placeholders such as `same as previous`, `from context`, `see above`, or `latest artifact` when you are in the inline fallback mode
|
|
106
107
|
- ask that `General` session whether the clarification prompt deviates from, weakens, narrows, or violates the original prompt in any way
|
|
107
108
|
- require it to judge whether the clarification prompt is a genuine improvement in execution quality while remaining faithful to the original intent
|
|
108
109
|
- if the validator suggests real fixes, patch the existing questions record and clarification prompt directly; do not restart the clarification phase from scratch unless the validator found a fundamental scope misunderstanding
|
|
109
110
|
- treat validator output as a correction list, not as a reason to regenerate giant clarification blocks repeatedly
|
|
110
|
-
- when rerunning validation in the same validator session, send only the
|
|
111
|
+
- when rerunning validation in the same validator session, send only the updated file path(s), the concrete fixes you made, and a request to confirm that those fixes resolve the previously reported issues
|
|
112
|
+
- on reruns, do not resend the original prompt block if the validator session already has that context
|
|
113
|
+
- on reruns, do not resend unchanged file bodies; point to the updated clarification file and, when useful, the narrow changed section in `questions.md`
|
|
111
114
|
- rerun validation only after applying the concrete fixes that matter
|
|
112
115
|
- keep the validation loop bounded and intentional; prefer one strong pass plus a small number of revision cycles over repeated loose churn
|
|
113
116
|
- once prompt-faithfulness is satisfied and the remaining notes are minor or cosmetic, stop iterating and proceed
|
|
@@ -17,63 +17,15 @@ This file is the repo-local engineering rulebook for `slopmachine` projects.
|
|
|
17
17
|
- Do not call work complete while it is still shaky.
|
|
18
18
|
- Reuse and extend shared cross-cutting patterns instead of inventing incompatible local ones.
|
|
19
19
|
|
|
20
|
-
## Verification
|
|
20
|
+
## Runtime And Verification
|
|
21
21
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- one primary documented runtime command
|
|
31
|
-
- one primary documented broad test command: `./run_tests.sh`
|
|
32
|
-
- follow the original prompt and existing repository first for the runtime stack; `./run_tests.sh` should exist regardless of project type
|
|
33
|
-
- the primary full-test command should install or prepare what it needs first when that setup is required for a clean environment
|
|
34
|
-
|
|
35
|
-
For web projects, those are usually:
|
|
36
|
-
|
|
37
|
-
- `docker compose up --build`
|
|
38
|
-
- `./run_tests.sh`
|
|
39
|
-
|
|
40
|
-
For web projects using the default Docker-first runtime model:
|
|
41
|
-
|
|
42
|
-
- `./run_tests.sh` must run the broad full-test path through Docker
|
|
43
|
-
- local non-Docker tests should still exist for normal development work
|
|
44
|
-
- final broad verification should use the Dockerized `./run_tests.sh` path, not only local test commands
|
|
45
|
-
- keep Compose isolation safe for shared machines: no unnecessary `container_name`, unique `COMPOSE_PROJECT_NAME`, and Compose-scoped image/network/volume naming
|
|
46
|
-
- expose only the primary app-facing port to host by default, bind it to `127.0.0.1`, and keep databases/cache/internal services off host ports unless truly required
|
|
47
|
-
- prefer random host-port assignment by default so parallel local projects do not collide; if a fixed host port is truly required, support override plus free-port fallback in the runtime or test wrapper
|
|
48
|
-
- add healthchecks and wait for service readiness before tests or dependent startup steps proceed
|
|
49
|
-
|
|
50
|
-
For web projects, default the runtime contract to `docker compose up --build` unless the prompt or existing repository clearly dictates another model.
|
|
51
|
-
|
|
52
|
-
When `docker compose up --build` is not the runtime contract, provide `./run_app.sh` as the single primary runtime wrapper.
|
|
53
|
-
|
|
54
|
-
For mobile, desktop, CLI, library, or other non-web projects, `./run_app.sh` should own the selected stack's runtime flow, while `./run_tests.sh` remains the single broad test wrapper calling the platform-equivalent full test path.
|
|
55
|
-
|
|
56
|
-
## Testing Rules
|
|
57
|
-
|
|
58
|
-
- Tests must be real and tied to actual behavior.
|
|
59
|
-
- Do not mock APIs for integration testing.
|
|
60
|
-
- Use real HTTP requests against the actual running service surface for integration evidence.
|
|
61
|
-
- For UI-bearing work, use the selected stack's local UI/E2E tool on affected flows and inspect screenshots or equivalent artifacts when practical.
|
|
62
|
-
- Prefer TDD when the behavior is well defined and practical to drive test-first.
|
|
63
|
-
- Where TDD is not practical, define the expected tests before implementation so coverage is intentional rather than retrofitted.
|
|
64
|
-
- Keep repo-local `./docs/test-coverage.md` aligned with the real test surface. It should map major requirement or risk points to concrete tests, key assertions, coverage status, and remaining gaps.
|
|
65
|
-
- For backend or fullstack projects, cover 401, 403, 404, conflict or duplicate submission when relevant, object-level authorization, tenant or user isolation, and sensitive-log exposure when those risks exist.
|
|
66
|
-
- For frontend-bearing projects, build and use a layered frontend test story where relevant: unit, component, page/route integration, and E2E.
|
|
67
|
-
- For non-trivial frontend projects, do not rely only on runtime or E2E proof; add component, page, route, or state-focused tests when UI state complexity is meaningful.
|
|
68
|
-
- For frontend-bearing flows, keep required UI states statically visible and tested where relevant: loading, empty, submitting, disabled, success, error, and duplicate-action protection.
|
|
69
|
-
- The project should normally reach roughly 90 percent meaningful coverage of the relevant behavior surface.
|
|
70
|
-
|
|
71
|
-
Selected-stack defaults:
|
|
72
|
-
|
|
73
|
-
- follow the original prompt and existing repository first; use the defaults below only when they do not already specify the platform or stack
|
|
74
|
-
- web frontend/fullstack: Playwright for browser E2E/UI verification when applicable
|
|
75
|
-
- mobile: Expo + React Native + TypeScript by default, with Jest plus React Native Testing Library for local tests and a platform-appropriate mobile UI/E2E tool when the flow needs it
|
|
76
|
-
- desktop: Electron + Vite + TypeScript by default, with a project-standard local test runner plus Playwright's Electron support or another platform-appropriate desktop UI/E2E tool when the flow needs it
|
|
22
|
+
- Keep one primary documented runtime command and one primary broad test command: `./run_tests.sh`.
|
|
23
|
+
- Follow the original prompt and existing repository first for the runtime stack.
|
|
24
|
+
- Prefer the fastest meaningful local verification for the changed area during ordinary iteration.
|
|
25
|
+
- Do not rerun broad runtime/test commands on every small change.
|
|
26
|
+
- For web projects, default the runtime contract to `docker compose up --build` unless the prompt or existing repository clearly dictates another model.
|
|
27
|
+
- When `docker compose up --build` is not the runtime contract, provide `./run_app.sh` as the single primary runtime wrapper.
|
|
28
|
+
- If the project has database dependencies, keep `./init_db.sh` as the only project-standard database initialization path.
|
|
77
29
|
|
|
78
30
|
## Documentation Rules
|
|
79
31
|
|
|
@@ -82,11 +34,7 @@ Selected-stack defaults:
|
|
|
82
34
|
- The README must clearly document whether the primary runtime command is `docker compose up --build` or `./run_app.sh`.
|
|
83
35
|
- The README must clearly document `./run_tests.sh` as the broad test command.
|
|
84
36
|
- The README must stand on its own for basic codebase use.
|
|
85
|
-
- The README should summarize important API or service surfaces when useful, but the full API catalog belongs in repo-local `./docs/api-spec.md` when that doc applies.
|
|
86
37
|
- Keep repo-local docs under `./docs/` when relevant, especially `./docs/reviewer-guide.md`, `./docs/test-coverage.md`, `./docs/security-boundaries.md`, `./docs/frontend-flow-matrix.md`, and `./docs/api-spec.md`.
|
|
87
|
-
- `./docs/reviewer-guide.md` should make build/preview/config, app entry points, routes, major module boundaries, feature flags, debug/demo surfaces, mock/interception defaults, and logging/validation overview traceable from inside the repo.
|
|
88
|
-
- `./docs/security-boundaries.md` should exist when auth, authorization, admin/debug, or isolation boundaries matter.
|
|
89
|
-
- `./docs/frontend-flow-matrix.md` should exist when frontend pages, interactions, and state transitions are material.
|
|
90
38
|
- The repo should be statically reviewable by a fresh reviewer: entry points, routes, config, test commands, and major module boundaries should be traceable from repository artifacts.
|
|
91
39
|
- If the project uses mock, stub, fake, interception, or local-data behavior, the README must disclose that scope accurately.
|
|
92
40
|
- If mock or interception behavior is enabled by default, the README must say so clearly.
|
|
@@ -94,31 +42,13 @@ Selected-stack defaults:
|
|
|
94
42
|
- Do not let a mock-only or local-data-only project look like undisclosed real backend or production integration.
|
|
95
43
|
- Do not hide missing failure handling behind fake-success paths.
|
|
96
44
|
|
|
97
|
-
## Logging And Validation Rules
|
|
98
|
-
|
|
99
|
-
- Establish and use a shared logging path rather than random print-style debugging.
|
|
100
|
-
- Logging should have meaningful categories or levels, support troubleshooting, and avoid sensitive-data leakage.
|
|
101
|
-
- Establish and use a shared validation path when validation matters instead of inventing ad hoc rules in scattered files.
|
|
102
|
-
- Keep validation and normalized user-facing error behavior traceable in repo-local code or docs.
|
|
103
|
-
|
|
104
45
|
## Secret And Runtime Rules
|
|
105
46
|
|
|
106
47
|
- Do not create or keep `.env` files anywhere in the repo.
|
|
107
48
|
- Do not rely on `.env`, `.env.local`, `.env.example`, or similar files for project startup.
|
|
108
49
|
- Do not hardcode secrets.
|
|
109
50
|
- If runtime env-file format is required, generate it ephemerally and do not commit or package it.
|
|
110
|
-
- If the project has database dependencies, create and maintain `./init_db.sh` as the only project-standard database initialization path.
|
|
111
|
-
- If the project has database dependencies, create `./init_db.sh` during scaffold and keep expanding it as the real schema, migrations, bootstrap data, and other database dependencies become known.
|
|
112
|
-
- If the project has database dependencies, use `./init_db.sh` from runtime and test entrypoints whenever database preparation is required.
|
|
113
51
|
- Do not hardcode database connection values or database bootstrap values anywhere in the repo.
|
|
114
|
-
- When auth or access control matters, keep the real security boundaries statically traceable in code and docs: auth entry points, route authorization, object authorization, function-level authorization, admin/debug protection, and tenant or user isolation where applicable.
|
|
115
|
-
|
|
116
|
-
Selected-stack secret/config defaults:
|
|
117
|
-
|
|
118
|
-
- follow the original prompt and existing repository first; use the defaults below only when they do not already specify the platform or stack
|
|
119
|
-
- web Dockerized services: use Docker/runtime-provided variables, never committed env files
|
|
120
|
-
- mobile apps: do not bundle real secrets into the client; use app config only for non-secret public configuration and keep real secrets server-side or in platform-appropriate secure storage when user/device secrets must be stored at runtime
|
|
121
|
-
- desktop apps: keep sensitive values in main-process/runtime configuration or platform-appropriate secure storage, and do not expose them to the renderer by default
|
|
122
52
|
|
|
123
53
|
## Product Integrity Rules
|
|
124
54
|
|