theslopmachine 1.0.22 → 1.0.25

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/MANUAL.md CHANGED
@@ -15,30 +15,36 @@ The installer copies OpenCode agents to `~/.config/opencode/agents`, Claude asse
15
15
  ## Initialize A Task
16
16
 
17
17
  ```sh
18
- slopmachine init /path/to/task-root
18
+ slopmachine init <github-url>
19
19
  ```
20
20
 
21
- The initialized root is intentionally sparse and packaging-friendly. Product code belongs in `repo/`; product-facing docs belong in `docs/`; final kept reports belong in `.tmp/`; project facts belong in `metadata.json`.
21
+ Run init from an empty workflow root. The GitHub repository name becomes the task root directory name. For example, `slopmachine init https://github.com/example/t178.git` clones into `./t178/`.
22
22
 
23
- Use `--claude` for `slopmachine-claude` runs:
23
+ The cloned task root must already contain the task-facing structure: product code in `repo/`, product-facing docs in `docs/`, final kept reports in `.tmp/`, and project facts in `metadata.json`. SlopMachine creates workflow-private state in sibling `./.ai` and `./.beads` directories.
24
+
25
+ Init relies on normal git authentication. If the repository is private and local git cannot access it, clone fails.
26
+
27
+ SlopMachine no longer seeds developer-facing docs, API spec placeholders, product README content, `AGENTS.md`, or `.claude/settings.json`. It only writes the allowed task-root `CLAUDE.md` rulebook.
28
+
29
+ Use `-o` to open OpenCode after bootstrap:
24
30
 
25
31
  ```sh
26
- slopmachine init --claude /path/to/task-root
32
+ slopmachine init https://github.com/example/t178.git -o
27
33
  ```
28
34
 
29
- The active developer rulebook is recorded in `../.ai/metadata.json` as `developer_rulebook_file`. The unused rulebook is removed from the task folder.
35
+ The active developer rulebook is recorded in `../.ai/metadata.json` as `developer_rulebook_file`.
30
36
 
31
37
  ## Continue From A Phase Alias
32
38
 
33
39
  ```sh
34
- slopmachine init --continue-from P5 /path/to/task-root
40
+ slopmachine init <github-url> --continue-from P5
35
41
  ```
36
42
 
37
43
  Legacy aliases remain accepted for CLI compatibility, but owner-facing language uses Phase 1 through Phase 8.
38
44
 
39
45
  ## Developer Rulebooks
40
46
 
41
- OpenCode developer agents read `AGENTS.md`. Claude developer agents read `CLAUDE.md`. Only the selected rulebook is seeded into a task root. These files are product engineering rulebooks, not owner workflow instructions.
47
+ Claude developer lanes read `CLAUDE.md`. SlopMachine seeds only this product engineering rulebook into the task root; it is not an owner workflow instruction file.
42
48
 
43
49
  ## Verification
44
50
 
package/README.md CHANGED
@@ -27,12 +27,11 @@ slopmachine install
27
27
  ```sh
28
28
  slopmachine --help
29
29
  slopmachine install
30
- slopmachine init <target-dir>
31
- slopmachine init --claude <target-dir>
30
+ slopmachine init <github-url>
32
31
  slopmachine set-token
33
32
  ```
34
33
 
35
- Use `slopmachine init` to create or adopt a task root. By default it seeds `AGENTS.md` for OpenCode developer lanes. Use `slopmachine init --claude` to seed `CLAUDE.md` and `.claude/` for script-managed Claude Code lanes. The unused rulebook is not left in the task folder, and `../.ai/metadata.json` records the active `developer_rulebook_file`.
34
+ Use `slopmachine init <github-url>` from an empty workflow root. The CLI clones the GitHub repository into `./<repo-name>/`, uses that cloned folder as the task root, creates workflow-private state under `./.ai` and `./.beads`, and records the repo name as `task_root` and `run_id`. The cloned task root is expected to contain the task-facing `docs/`, `.tmp/`, `metadata.json`, and `repo/` structure. SlopMachine no longer seeds developer-facing docs or product README content; it only writes the allowed task-root `CLAUDE.md` rulebook.
36
35
 
37
36
  ## Phase Map
38
37
 
@@ -69,4 +68,4 @@ npm run check
69
68
 
70
69
  ## Developer-Facing Boundaries
71
70
 
72
- Developer-facing prompts and rulebooks avoid owner workflow mechanics. They focus on good engineering practice: read the code, follow `AGENTS.md` or `CLAUDE.md`, implement real behavior, keep README claims honest, test meaningful behavior, avoid secrets, do not run Docker or `run_tests.sh` unless asked, and provide proof for completed work.
71
+ Developer-facing prompts and the task-root `CLAUDE.md` rulebook avoid owner workflow mechanics. They focus on good engineering practice: read the code, implement real behavior, keep README claims honest, test meaningful behavior, avoid secrets, do not run Docker or `run_tests.sh` unless asked, and provide proof for completed work.
package/RELEASE.md CHANGED
@@ -5,6 +5,6 @@
5
5
  - Preserves the reference CLI/package behavior.
6
6
  - Rebuilds owner agents around Phase 1 through Phase 8 terminology.
7
7
  - Adds generic developer prompts for OpenCode and Claude.
8
- - Adds task-root `AGENTS.md` and `CLAUDE.md` templates focused on product engineering practice.
8
+ - Seeds only the task-root `CLAUDE.md` rulebook; developer-facing docs and product README content come from the cloned task repository and implementation lane work.
9
9
  - Includes Claude-specific worker skills and all required slopmachine utility scripts.
10
10
  - Keeps legacy `P*` phase aliases for CLI compatibility.
@@ -108,6 +108,8 @@ Good Claude-message style:
108
108
 
109
109
  ## Owner Direct Fixes And Developer Awareness
110
110
 
111
+ The owner may directly make small safe edits to existing docs, config, wrappers, cleanup, and light glue when the change does not require product-design judgment, broad debugging, new product behavior, or new tests. Inside `./repo`, owner-side edits are limited to existing configuration, Docker files, test wrappers, run scripts, verification scripts, cleanup scripts, and similarly narrow glue. The owner must never create a new file anywhere under `./repo`. New product files, meaningful implementation work, new tests, behavioral changes, and larger fixes must go to the active Claude lane.
112
+
111
113
  When the owner makes direct edits to the task directory (README, config, scripts, docs, glue code, cleanup), the active Claude lane (develop-1, bugfix-1, or test-coverage-1) must always be informed of what changed. Batching is required: make a group of fixes, batch them together, then inform the lane once. Do not notify the lane turn by turn for every small edit.
112
114
 
113
115
  This rule applies strictly to the persistent implementation lanes — develop-1, bugfix-1, and test-coverage-1. It does not apply to evaluator sessions, clarification workers, faithfulness reviewers, planning subagents, or other temporary owner-side sessions.
@@ -148,7 +150,7 @@ Example: `I made a few edits to the README for the startup docs and fixed a conf
148
150
  - Never use `task` with `developer`, `implement`, `helper`, maintenance, or ad hoc coding subagents for product implementation, product bugfixes, product test authoring, product docs authored by the implementation lane, or implementation verification guidance. Those must go through live Claude lanes using the packaged Claude utilities.
149
151
  - Do not use OpenCode subagents, local edits, raw `claude` commands, manual tmux typing, or untracked helper scripts as a substitute for Claude live-lane implementation. The only normal interaction path with Claude lanes is `claude_live_launch.mjs`, `claude_live_turn.mjs`, `claude_live_status.mjs`, and `claude_live_stop.mjs`.
150
152
  - Use `question` only for material user decisions that cannot be resolved by a prompt-faithful default.
151
- - Use `edit`/`write` only for owner-side workflow files, reports, and tiny safe owner fixes that do not substitute for Claude implementation work. The owner may directly make small safe edits to docs, config, wrappers, cleanup, and light glue when the change does not require product-design judgment, broad debugging, new product behavior, or new tests. The owner must not create new files under `./repo`; new product files, meaningful implementation work, and larger fixes must go to the active Claude lane. Do not edit installed packaged prompt assets; those must always be read fresh and pasted verbatim under the non-negotiable verbatim prompt paste rule at the top of this file. If a tiny owner fix touches product code/docs, notify the active Claude lane and ask it to inspect/acknowledge before continuing.
153
+ - Use `edit`/`write` only for owner-side workflow files, reports, and tiny safe owner fixes that do not substitute for Claude implementation work. Inside `./repo`, owner-side edits are limited to existing configuration, Docker files, test wrappers, run scripts, verification scripts, cleanup scripts, and similarly narrow glue. The owner must never create a new file anywhere under `./repo`; new product files, meaningful implementation work, new tests, behavioral changes, and larger fixes must go to the active Claude lane. Do not edit installed packaged prompt assets; those must always be read fresh and pasted verbatim under the non-negotiable verbatim prompt paste rule at the top of this file. If a tiny owner fix touches product code/docs, notify the active Claude lane and ask it to inspect/acknowledge before continuing.
152
154
  - Use `todowrite` for substantial multi-step owner work when tracking improves reliability.
153
155
  - Use Context7/Exa only when current documentation or external facts are needed.
154
156
 
@@ -228,7 +230,7 @@ Use these sequential names as the canonical workflow model. Legacy `P*` names ar
228
230
 
229
231
  - Required skills: `beads-operations`, `developer-session-lifecycle`, `claude-worker-management`, `planning-guidance`, `planning-gate`, `owner-evidence-discipline`, and `report-output-discipline` when reports are long or reusable.
230
232
  - Establish or resume the primary Claude lane and start design/planning.
231
- - Follow the deterministic planning sequence in `planning-guidance` exactly: (1) send original prompt with only "don't write code yet" appended, (2) after acknowledgement send clarifications, (3) after acknowledgement send the design prompt verbatim.
233
+ - Follow the deterministic planning sequence in `planning-guidance` exactly: (1) send original prompt with only the required planning/placeholder sentences appended, (2) after acknowledgement send clarifications, (3) after acknowledgement send the design prompt verbatim.
232
234
  - Delegate owner-private `../.ai/plan.md` creation to a general owner-side subagent. Read the installed `~/slopmachine/phase-2-execution-planning-prompt.md` and `~/slopmachine/phase-2-plan-template.md` fresh. Paste both bodies verbatim into the subagent message.
233
235
  - Record lane/session and artifact decisions in metadata and Beads.
234
236
  - Exit only when `planning-gate` is satisfied.
@@ -108,7 +108,7 @@ Good worker-message style:
108
108
 
109
109
  ## Owner Direct Fixes And Developer Awareness
110
110
 
111
- The owner may directly make small safe edits to docs, config, wrappers, cleanup, and light glue when the change does not require product-design judgment, broad debugging, new product behavior, or new tests. The owner must not create new files under `./repo`; new product files, meaningful implementation work, and larger fixes must go to the active developer/bugfix/test-coverage lane.
111
+ The owner may directly make small safe edits to existing docs, config, wrappers, cleanup, and light glue when the change does not require product-design judgment, broad debugging, new product behavior, or new tests. Inside `./repo`, owner-side edits are limited to existing configuration, Docker files, test wrappers, run scripts, verification scripts, cleanup scripts, and similarly narrow glue. The owner must never create a new file anywhere under `./repo`. New product files, meaningful implementation work, new tests, behavioral changes, and larger fixes must go to the active developer/bugfix/test-coverage lane.
112
112
 
113
113
  When the owner makes direct edits to the task directory (README, config, scripts, docs, glue code, cleanup), the active developer/bugfix/test-coverage lane must always be informed of what changed. Batching is required: make a group of fixes, batch them together, then inform the lane once. Do not notify the lane turn by turn for every small edit.
114
114
 
@@ -149,7 +149,7 @@ Example: `I made a few edits to the README for the startup docs and fixed a conf
149
149
  - Do not use `implement`, `helper`, maintenance, or extra ad hoc subagents for product implementation unless the user explicitly asks. Keep implementation in the tracked active developer session except for evaluator-isolated work or a recorded recovery/context reason.
150
150
  - Use `question` only for material user decisions that cannot be resolved by a prompt-faithful default.
151
151
  - Use `bash` for git, package managers, tests, Docker, CLIs, runtime checks, and artifact commands.
152
- - Use `edit`/`write` for owner-side workflow files, tiny safe fixes, and reports. Do not edit installed packaged prompt assets; those must always be read fresh and pasted verbatim under the non-negotiable verbatim prompt paste rule at the top of this file.
152
+ - Use `edit`/`write` for owner-side workflow files, reports, and tiny safe edits to existing docs/config/wrappers/scripts/glue. Inside `./repo`, never use owner-side editing to create new files; new repo files must be created by the active developer/bugfix/test-coverage lane. Do not edit installed packaged prompt assets; those must always be read fresh and pasted verbatim under the non-negotiable verbatim prompt paste rule at the top of this file.
153
153
  - Use `todowrite` for substantial multi-step owner work when tracking improves reliability.
154
154
  - Use Context7/Exa only when current documentation or external facts are needed.
155
155
 
@@ -197,7 +197,7 @@ Use these sequential names as the canonical workflow model. Legacy `P*` names ar
197
197
 
198
198
  - Required skills: `beads-operations`, `developer-session-lifecycle`, `planning-guidance`, `planning-gate`, `owner-evidence-discipline`, and `report-output-discipline` when reports are long or reusable.
199
199
  - Establish or resume the primary developer session and start design/planning.
200
- - Follow the deterministic planning sequence in `planning-guidance` exactly: (1) send original prompt with only "don't write code yet" appended, (2) after acknowledgement send clarifications, (3) after acknowledgement send the design prompt verbatim.
200
+ - Follow the deterministic planning sequence in `planning-guidance` exactly: (1) send original prompt with only the required planning/placeholder sentences appended, (2) after acknowledgement send clarifications, (3) after acknowledgement send the design prompt verbatim.
201
201
  - Delegate owner-private `../.ai/plan.md` creation to a general owner-side subagent. Read the installed `~/slopmachine/phase-2-execution-planning-prompt.md` and `~/slopmachine/phase-2-plan-template.md` fresh. Paste both bodies verbatim into the subagent message.
202
202
  - Record session and artifact decisions in metadata and Beads.
203
203
  - Exit only when `planning-gate` is satisfied.
@@ -272,7 +272,19 @@ def main():
272
272
  beads = read_beads(project_path)
273
273
  ai_data = read_ai_metadata(project_path)
274
274
  task_dir = project_path if os.path.isdir(os.path.join(project_path, "docs")) \
275
- else os.path.join(project_path, "task")
275
+ else None
276
+ if not task_dir:
277
+ ai_meta = os.path.join(project_path, ".ai", "metadata.json")
278
+ if os.path.isfile(ai_meta):
279
+ with open(ai_meta) as f:
280
+ ai_data = json.load(f)
281
+ task_root_name = ai_data.get("task_root") if isinstance(ai_data, dict) else None
282
+ candidate = os.path.join(project_path, task_root_name)
283
+ if os.path.isdir(os.path.join(candidate, "docs")):
284
+ task_dir = candidate
285
+ if not task_dir:
286
+ print(f" Warning: could not find task root at {project_path} (no docs/ and no .ai/metadata.json with task_root)")
287
+ task_dir = project_path
276
288
  task_docs = read_task_docs(task_dir)
277
289
  audit_reports = read_audit_reports(task_dir)
278
290
  print(f" Beads: {len(beads)}, Audit reports: {len(audit_reports)}")
@@ -238,3 +238,4 @@ Implementation must:
238
238
  10. **Module isolation:** Modules built in isolation with no cross-module integration tests proving data/behavior flow between them
239
239
  11. **Skipped evaluator passes:** Fewer than 5 internal evaluator passes run in Phase 4
240
240
  12. **No browser verification before P6:** Web/fullstack projects reach P6 without any browser verification, finding crashes that should have been caught in P3 or P4
241
+ 13. **Owner-created repo files:** Owner creates new files under repo/ instead of routing file creation through the active developer lane
@@ -12,7 +12,7 @@ Use this skill for startup preflight, session policy, metadata consistency, lane
12
12
  Sessions are the primary deliverable. An incomplete or corrupted session dataset invalidates the submission regardless of code quality. Every session must be preserved, continuous, and authentic.
13
13
 
14
14
  - Do not edit, rename, restructure, rewrite, clean, delete, or fabricate session files or trajectory records. They are immutable evidence.
15
- - Do not perform untracked implementation work. Developer/Claude implementation, debugging, and substantive product fixes must happen inside a tracked implementation session. Owner orchestration, verification commands, package checks, and tiny safe owner-side docs/config/wrapper/glue fixes are allowed when recorded in metadata/Beads and the active implementation lane is notified afterward.
15
+ - Do not perform untracked implementation work. Developer/Claude implementation, debugging, and substantive product fixes must happen inside a tracked implementation session. Owner orchestration, verification commands, package checks, and tiny safe owner-side edits to existing docs/config/wrappers/scripts/glue are allowed when recorded in metadata/Beads and the active implementation lane is notified afterward. The owner must never create a new file anywhere under `./repo`; new repo files must be created by the active developer/Claude lane.
16
16
  - Sessions must progress strictly forward. Never return to a closed session. The lifecycle is:
17
17
  1. Development session → complete → stop/close
18
18
  2. Bugfix session → complete both audit cycles → close
@@ -23,7 +23,7 @@ Sessions are the primary deliverable. An incomplete or corrupted session dataset
23
23
  ## Preflight
24
24
 
25
25
  - Confirm cwd is task root `./`.
26
- - Confirm the current working directory is the task root (the directory containing `repo/`, `docs/`, and `metadata.json`). If the root is not `task/` or its equivalent, stop and reject: sessions must be started from the task root, not from inside `repo/` or any subdirectory.
26
+ - Confirm the current working directory is the task root (the directory containing `repo/`, `docs/`, and `metadata.json`). If the root does not contain these expected paths, stop and reject: sessions must be started from the task root, not from inside `repo/` or any subdirectory.
27
27
  - Confirm product repo exists at `./repo`.
28
28
  - Confirm workflow-private root exists at `../.ai`, workflow state exists at `../.ai/metadata.json`, and Beads root exists at `../.beads` when initialized.
29
29
  - Confirm task docs are limited to `./docs/questions.md`, `./docs/design.md`, and `./docs/api-spec.md` when applicable.
@@ -48,7 +48,7 @@ Sessions are the primary deliverable. An incomplete or corrupted session dataset
48
48
  - Phase 5 uses fresh evaluator sessions for full audits. Evaluator-session reuse occurs in three cases: (1) fail-regeneration — same session receives only the regeneration prompt after fixes; (2) Partial Pass fix-check — same session verifies all scoped issues are fixed; (3) Pass-with-items fix-check — same session verifies all scoped recommendations are closed.
49
49
  - Audit Cycle 1 and Audit Cycle 2 fixes go through the dedicated bugfix lane. After both audit cycles complete, the bugfix lane is closed and a new test-coverage/final-reconciliation lane takes over for coverage/README remediation.
50
50
  - Phase 6 reconciliation uses the currently active developer/Claude lane for Docker, runtime, browser, account, `run_tests.sh`, coverage, README, and final readiness fixes unless a new lane is explicitly justified by context limits or isolation risk.
51
- - If the owner directly changes docs, wrappers, config, cleanup, or light glue, send the active lane a minimal acknowledgement request that names the changed surface and asks it to inspect/confirm before readiness continues.
51
+ - If the owner directly changes existing docs, wrappers, config, cleanup, scripts, or light glue, send the active lane a minimal acknowledgement request that names the changed surface and asks it to inspect/confirm before readiness continues.
52
52
 
53
53
  ## Metadata Discipline
54
54
 
@@ -58,7 +58,7 @@ No other full-audit or fail-regeneration prompt is allowed. In particular, the o
58
58
 
59
59
  If any deviation is found from either allowed prompt send, the current audit cycle is invalid. Archive every report or candidate report generated during that invalid cycle unchanged under `../.ai/archive/`, record the restart reason in metadata and Beads, then restart that audit cycle from a fresh evaluator session using the installed asset and exact saved send packet. Do not patch, rename, or reuse invalid-cycle reports as kept reports.
60
60
 
61
- Record the installed prompt asset path, prepared prompt path, exact send packet path, evaluator session id, and report path in metadata and Beads. Treat evaluator reports as immutable once written.
61
+ Record the installed prompt asset path, prepared prompt path, exact send packet path, evaluator session id, and report path in metadata and Beads. Treat evaluator reports as immutable once written except for the narrow minor wording cleanup allowed by cycle validation below.
62
62
 
63
63
  ## Report Paths And Names
64
64
 
@@ -152,6 +152,8 @@ Run this procedure twice: once for Audit Cycle 1 and once for Audit Cycle 2.
152
152
 
153
153
  Before a cycle can close, validate the whole cycle as a hard gate. If any item fails, archive every candidate/kept/fix-check report produced in that cycle unchanged under `../.ai/archive/`, record the reason, and restart that audit cycle from a fresh evaluator session using the non-negotiable full-audit prompt block.
154
154
 
155
+ Exception: if the only issue is minor wording that does not change findings, verdict, severity, evidence, scoped issue identity, fix status, or report meaning, the owner may patch that wording directly in the kept report or fix-check report instead of restarting the cycle. Record the exact wording cleanup, file path, and reason in metadata and Beads. Do not use this exception to alter verdicts, remove real findings, add missing fix evidence, repair a mismatched issue list, or hide a materially invalid regeneration/fix-check.
156
+
155
157
  Required for each cycle:
156
158
  - the installed evaluation prompt asset path is recorded and matches the project type;
157
159
  - the exact saved send packet path is recorded;
@@ -160,8 +162,10 @@ Required for each cycle:
160
162
  - the kept audit report exists at `./.tmp/audit_report-<N>.md`;
161
163
  - the kept audit report is rich and complete: at least 150 lines and not materially shallower than the installed prompt's required output structure;
162
164
  - the kept audit report includes the required verdict, scope/boundary, prompt/repository mapping, section review or blocker/high panel as applicable, issues/suggestions or explicit no-issue statement, security/data-risk review where applicable, and test/logging/coverage sections required by the installed prompt;
165
+ - the kept audit report has no language that reveals or implies it is a regeneration, rerun, continuation, post-fix report, or comparison against an earlier audit. Forbidden examples include: `regenerated`, `regeneration`, `rerun`, `previous audit`, `previous report`, `prior audit`, `after fixes`, `after the fixes`, `fixed since`, `remaining`, `still`, `now fixed`, `resolved`, `no longer`, `left`, `updated verdict`, or equivalent wording that exposes audit history. If this language is only incidental wording and does not affect findings or meaning, patch it and record the cleanup. If the report is continuation-shaped, fix-oriented, or materially depends on prior audit history, archive and restart the cycle;
163
166
  - the cycle fix-check report exists at `./.tmp/audit_report-<N>-fix_check.md`;
164
167
  - the cycle fix-check report confirms every issue/recommendation/caveat/suggestion/action item/requested change from the kept audit report is fixed, or explicitly confirms the kept audit report had zero scoped items to close;
168
+ - the scoped issue list in the fix-check exactly matches the scoped issue list from the corresponding kept audit report. Every kept-audit issue/recommendation/caveat/suggestion/action item/requested change must appear in the fix-check with a fixed status and evidence, and the fix-check must not silently drop, merge beyond recognition, rename into a different issue, or add unrelated new audit issues. If the lists do not match, the cycle is invalid and must restart unless the mismatch is only a harmless wording/label discrepancy that can be patched without changing issue identity, fix status, evidence, or meaning;
165
169
  - the fix-check report does not perform a broader new audit and does not use history-exposing comparison language.
166
170
 
167
171
  No audit cycle is complete without both `./.tmp/audit_report-<N>.md` and `./.tmp/audit_report-<N>-fix_check.md` passing this validation gate.
@@ -74,7 +74,7 @@ If any final runtime, test, browser, account, or platform check cannot run, read
74
74
 
75
75
  ## Owner Direct Fixes
76
76
 
77
- - The owner may directly fix only minor, safe docs, wrapper, config, cleanup, or light glue issues when the change does not require product-design judgment, new tests, behavioral changes, or non-trivial debugging.
77
+ - The owner may directly fix only minor, safe existing docs, wrapper, config, cleanup, run-script, verification-script, or light glue issues when the change does not require product-design judgment, new tests, behavioral changes, or non-trivial debugging. The owner must never create a new file anywhere under `./repo`; any new repo file must be created by the active developer/Claude lane.
78
78
  - If the reconciliation issue is large enough to need real implementation work, meaningful test updates, runtime debugging, README/runtime restructuring, or product judgment, do not fix it owner-side. Send it to the currently active developer/Claude lane.
79
79
  - Batch multiple direct fixes into a group, then inform the lane once. Do not notify turn by turn for every small edit. After all fixes in the batch are complete, send a single note describing all changed surfaces and ask the lane to inspect and acknowledge.
80
80
  - The note should be concise and developer-facing, not a workflow report.
@@ -22,7 +22,7 @@ Phase 2 establishes the primary developer session and produces the accepted plan
22
22
  - Accepted `./docs/questions.md`.
23
23
  - Accepted `../.ai/requirements-breakdown.md`.
24
24
  - Accepted `../.ai/clarification-faithfulness-review.md`.
25
- - Packaged design prompt and design template.
25
+ - Packaged design prompt.
26
26
  - Packaged execution planning prompt and plan template.
27
27
 
28
28
  ## Deterministic Planning Sequence (Must Follow Exactly)
@@ -31,10 +31,11 @@ This sequence is strict. Do not combine, reorder, skip, or batch these steps. Ea
31
31
 
32
32
  ### Step 1: Send Original Prompt
33
33
 
34
- Send the original product prompt from `./metadata.json` exactly as-is. No prefix, no introduction, no context, no clarifications. Append only this exact sentence at the end:
34
+ Send the original product prompt from `./metadata.json` exactly as-is. No prefix, no introduction, no context, no clarifications. Append only these exact sentences at the end:
35
35
 
36
36
  ```
37
37
  Don't write code yet — we'll plan this first.
38
+ This folder may contain placeholder docs or repo content from the starting skeleton; please inspect it and remove or replace unrelated placeholder material as we go.
38
39
  ```
39
40
 
40
41
  That is the entire message. Wait for the developer to acknowledge before proceeding.
@@ -53,7 +54,7 @@ Wait for the developer to acknowledge before proceeding.
53
54
 
54
55
  ### Step 3: Send Design Prompt
55
56
 
56
- After the developer acknowledges the clarifications, read the installed `~/slopmachine/phase-1-design-prompt.md` fresh from its asset path and paste its full body verbatim under the non-negotiable verbatim prompt paste rule. The design prompt references the context already provided in Steps 1 and 2 and the template already seeded at `./docs/design.md`. Do not paste the template file body — it is already in the workspace.
57
+ After the developer acknowledges the clarifications, read the installed `~/slopmachine/phase-1-design-prompt.md` fresh from its asset path and paste its full body verbatim under the non-negotiable verbatim prompt paste rule. The design prompt references the context already provided in Steps 1 and 2 and tells the lane what design surfaces to cover because `./docs/design.md` may be missing or placeholder-only.
57
58
 
58
59
  The design must:
59
60
  - be a true product/system design, not an execution plan
@@ -72,7 +73,9 @@ Patch small wording/traceability issues directly when meaning is unchanged. Send
72
73
 
73
74
  ### Step 5: Create `./docs/api-spec.md` When Applicable
74
75
 
75
- Use the accepted design as input. Require exact endpoint/interface contracts where APIs exist. If no meaningful API exists, mark `./docs/api-spec.md` as not applicable with a short reason. Record the API spec artifact path and applicability decision in metadata and Beads.
76
+ Use the accepted design as input. Require exact endpoint/interface contracts where APIs exist. If `./docs/api-spec.md` is missing or placeholder-only, the implementation lane must create or replace it. If no meaningful API exists, mark `./docs/api-spec.md` as not applicable with a short reason. Record the API spec artifact path and applicability decision in metadata and Beads.
77
+
78
+ The API spec prompt must ask for, where applicable: endpoint/interface name, purpose, actor/consumer, method/path or call signature, auth and permission model, request fields, response fields, validation rules, success status/result, important error cases, persistence/side effects, frontend or job consumers, and required API/integration tests. Do not provide endpoint conclusions that the design has not established; ask the lane to derive exact contracts from the accepted design and codebase context.
76
79
 
77
80
  ### Step 6: Owner Reviews Design and API Spec Together
78
81
 
@@ -39,7 +39,13 @@ Use casual, direct language. Example:
39
39
  ```text
40
40
  Let's start with the scaffold. Set up the base project in ./repo for the stack described in docs/design.md. Keep this to the framework, runtime, tests, and README foundation with a minimal proof page or endpoint. Do not add product-specific business logic yet.
41
41
 
42
+ The cloned folder may contain placeholder docs, README text, scripts, or config. Remove or replace unrelated placeholder content instead of preserving it.
43
+
42
44
  The scaffold needs a working docker-compose.yml with a profile-gated test service, a run_tests.sh that runs the full test suite through Docker, a separate stack-native local test harness for fast implementation-time checks, a unit_tests directory for unit tests, an API_tests directory for API and integration HTTP tests, and a README baseline with startup, access, verification, and test commands. Make sure the local harness is separate from the Docker test path. The local harness is for fast iteration. run_tests.sh is the broad dockerized verification wrapper for later.
45
+
46
+ The README needs to be enough for a reviewer to run and verify the project later: project type near the top, what the repo delivers, stack, repo layout, primary startup/access command, legacy docker-compose compatibility string when Docker Compose is used, verification method, auth/demo credentials or "No authentication required", seeded data or empty-state note, mock/local/debug disclosures, known limitations, and the Dockerized ./run_tests.sh contract. Do not leave template placeholders in README.
47
+
48
+ The run_tests.sh and Docker config must be real, not placeholders: run_tests.sh should execute the broad Docker-contained test path, docker-compose.yml should include the app services needed for runtime and a profile-gated test service, and the local test harness should remain separate for fast implementation-time checks.
43
49
  ```
44
50
 
45
51
  Adjust the exact wording to the project. Do not over-format the message.
@@ -11,8 +11,8 @@ Packaging is a final-delivery contract, not a reporting exercise. Do not close P
11
11
 
12
12
  ## Package Boundary
13
13
 
14
- - Package root is `task/`.
15
- - Product repo is `task/repo`.
14
+ - Package root is the task root directory (named by the task-id from `../.ai/metadata.json`'s `task_root` field).
15
+ - Product repo is `<task-root>/repo`.
16
16
  - Workflow-private state remains outside package under `../.ai`, `../.beads`, and `../claude-sessions.zip`.
17
17
  - Do not package workflow-private state as product files.
18
18
  - The final task-root package allowlist is `docs/`, `repo/`, `.tmp/`, `metadata.json`, plus explicit VCS/validation exceptions.
@@ -81,7 +81,7 @@ Do not run broad Docker prune commands that can affect unrelated projects.
81
81
  ## Session Export
82
82
 
83
83
  - Export tracked developer sessions before closing packaging.
84
- - Claude-backed lanes produce `../claude-sessions.zip` as a sibling handoff artifact, not as a product file under `task/`.
84
+ - Claude-backed lanes produce `../claude-sessions.zip` as a sibling handoff artifact, not as a product file under the task root.
85
85
  - Use packaged session export utilities when available and preserve prompt-anchored session provenance.
86
86
  - Verify exported session content is anchored to the original prompt from `./metadata.json` strongly enough to support package lineage.
87
87
  - Do not manually edit, rewrite, fabricate, rename, clean, delete, or restructure raw session/trajectory files to make the package look cleaner. Only use packaged export/normalization utilities that preserve provenance.
@@ -1,6 +1,6 @@
1
1
  You are helping create the product/system design for a software project.
2
2
 
3
- The original prompt, stack and context, accepted clarifications, and accepted requirements have already been provided in the previous steps. The design template is already seeded at ./docs/design.md.
3
+ The original prompt, stack and context, accepted clarifications, and accepted requirements have already been provided in the previous steps. The task root may contain placeholder docs from the cloned starting repository; inspect them, keep only relevant true information, and replace unrelated placeholder content.
4
4
 
5
5
  Your task is to write `./docs/design.md`.
6
6
 
@@ -10,6 +10,22 @@ This is planning/design work only. Do not write implementation code.
10
10
 
11
11
  Produce a design document that is faithful to the original prompt and accepted clarifications. The design should be specific enough to guide implementation, but it must not become a step-by-step execution checklist.
12
12
 
13
+ ## Expected Shape
14
+
15
+ Use clear sections that cover these surfaces where applicable:
16
+ - project overview: project type, delivery shape, business objective, success outcome, and stack summary
17
+ - prompt and clarification alignment: accepted requirements, accepted clarifications, safe assumptions, and explicit non-goals that do not narrow the prompt
18
+ - actors, roles, permissions, and the main user/system flows
19
+ - module design: purpose, owned behavior, UI/API/job surfaces, data ownership, failure/security cases, and required test surfaces
20
+ - data design: entities/objects, lifecycle rules, visibility, and access rules
21
+ - UI or interaction design, or a brief not-applicable reason
22
+ - API or interface design, including whether `./docs/api-spec.md` is required
23
+ - security and privacy design: auth, authorization, object isolation, sensitive data, logging/redaction, debug/admin protection, file/path safety, and abuse prevention where relevant
24
+ - runtime and configuration design: runtime model, configuration model, persistence, seed/demo data, external integrations, and README startup/access/auth expectations
25
+ - verification strategy: unit, API/integration, E2E/platform, frontend component, frontend-to-backend, README/runtime, Docker, and known proof boundaries
26
+ - API spec handoff: whether a separate API spec is required and which API/interface families it must cover
27
+ - remaining design risks that still need a decision
28
+
13
29
  ## Required Design Qualities
14
30
 
15
31
  The design must:
@@ -39,6 +55,6 @@ The design should define what the system must be and how its major parts fit tog
39
55
 
40
56
  ## Output
41
57
 
42
- Write the completed design to `./docs/design.md` using the template already seeded at that path. If a section is not applicable, keep it brief and explain why.
58
+ Write the completed design to `./docs/design.md`. If a placeholder file already exists there, replace unrelated placeholder content rather than preserving it. If a section is not applicable, keep it brief and explain why.
43
59
 
44
60
  If the project has meaningful APIs or interface contracts, say that `./docs/api-spec.md` should be completed next and summarize the API families that need specification.
@@ -13,7 +13,7 @@ The current type-check gate covers the Claude/session tooling family because the
13
13
 
14
14
  ## Path Model
15
15
 
16
- - `--task-root` means the workflow task root, usually `<workflow-root>/task`.
16
+ - `--task-root` means the workflow task root directory (named by the task-id from `../.ai/metadata.json`'s `task_root` field).
17
17
  - Product code lives under `<task-root>/repo`.
18
18
  - Workflow-private state lives outside task root under `<workflow-root>/.ai` and `<workflow-root>/.beads`.
19
19
  - Claude project lookup uses the task root because Claude transcripts are keyed by the working directory used to launch Claude.
@@ -115,10 +115,10 @@ Required:
115
115
  - `--task-root <task-root>`
116
116
 
117
117
  Important options:
118
- - `--output <zip-path>` writes the zip to a custom path; default is `<task-root>/claude-sessions.zip`
118
+ - `--output <zip-path>` writes the zip to a custom path; default is `<workflow-root>/claude-sessions.zip`
119
119
  - `--label <text>` adds reporting context
120
120
 
121
- The helper copies the Claude project/session directory as-is, removes `.DS_Store` files and top-level `.jsonl` transcripts under 25KB from the staged copy, zips the folder contents directly, and writes a single zip. It does not normalize or rewrite transcript files.
121
+ The helper copies the Claude project/session directory as-is into a temp directory, removes `.DS_Store` files and top-level `.jsonl` transcripts under 25KB from the staged copy, zips the whole copied folder, and writes a single zip. It does not normalize or rewrite transcript files.
122
122
 
123
123
  ### `analyze_claude_project_dir.mjs`
124
124
 
@@ -546,13 +546,13 @@ export async function waitForHookEvent(paths, startIndex, labels, timeoutMs, mat
546
546
  return waitFor(async () => {
547
547
  const events = await readJsonl(paths.hookEventsFile)
548
548
  const pending = events.slice(startIndex)
549
- const match = pending.find((event) => labels.has(event.label) && (!matcher || matcher(event)))
550
- if (!match) {
549
+ const matchIndex = pending.findIndex((event) => labels.has(event.label) && (!matcher || matcher(event)))
550
+ if (matchIndex === -1) {
551
551
  return null
552
552
  }
553
553
  return {
554
- event: match,
555
- eventsLength: events.length,
554
+ event: pending[matchIndex],
555
+ eventsLength: startIndex + matchIndex + 1,
556
556
  }
557
557
  }, {
558
558
  timeoutMs,
@@ -23,6 +23,7 @@ import {
23
23
  readState,
24
24
  tmuxHasSession,
25
25
  tmuxPasteFileAndEnter,
26
+ tmuxSendEnter,
26
27
  waitForRateLimitReset,
27
28
  waitForHookEvent,
28
29
  writeState,
@@ -50,6 +51,8 @@ const runtimeDir = argv['runtime-dir']
50
51
  const promptFile = typeof argv['prompt-file'] === 'string' ? argv['prompt-file'].trim() : ''
51
52
  const turnTimeoutMs = Number.parseInt(argv['timeout-ms'] || String(DEFAULT_TURN_TIMEOUT_MS), 10)
52
53
  const retryOnLimit = argv['retry-on-limit'] !== '0'
54
+ const SUBMIT_CONFIRM_TIMEOUT_MS = 5000
55
+ const SUBMIT_ENTER_RETRIES = 3
53
56
 
54
57
  if (!runtimeDir || !promptFile) {
55
58
  emitFailure('claude_live_turn_invalid_args', 'Missing required turn arguments', {
@@ -70,6 +73,38 @@ function emitTurnFailure(resultPayload) {
70
73
  })
71
74
  }
72
75
 
76
+ async function confirmPromptSubmitted({ paths, hookStartIndex, turnId, tmuxSession, runtimeDir, turnDir }) {
77
+ let currentHookStartIndex = hookStartIndex
78
+ for (let attempt = 0; attempt <= SUBMIT_ENTER_RETRIES; attempt += 1) {
79
+ try {
80
+ const { eventsLength } = await waitForHookEvent(
81
+ paths,
82
+ currentHookStartIndex,
83
+ new Set(['UserPromptSubmit']),
84
+ SUBMIT_CONFIRM_TIMEOUT_MS,
85
+ (hookEvent) => hookEvent?.turn_id === turnId,
86
+ )
87
+ await writeState(runtimeDir, {
88
+ current_turn_prompt_submitted_at: new Date().toISOString(),
89
+ current_turn_submit_enter_retries: attempt,
90
+ })
91
+ return { ok: true, eventsLength }
92
+ } catch {
93
+ if (attempt === SUBMIT_ENTER_RETRIES) {
94
+ break
95
+ }
96
+ await tmuxSendEnter(tmuxSession)
97
+ await writeState(runtimeDir, {
98
+ current_turn_submit_enter_retries: attempt + 1,
99
+ })
100
+ }
101
+ }
102
+
103
+ const blockerFile = path.join(turnDir, `prompt-submit-unconfirmed-pane-${Date.now()}.txt`)
104
+ await captureTmuxPaneArtifact(tmuxSession, blockerFile)
105
+ return { ok: false, blockerFile }
106
+ }
107
+
73
108
  try {
74
109
  const promptSource = path.resolve(promptFile)
75
110
 
@@ -237,6 +272,34 @@ try {
237
272
  current_turn_prompt_injected_at: new Date().toISOString(),
238
273
  })
239
274
 
275
+ const submitConfirmation = await confirmPromptSubmitted({
276
+ paths,
277
+ hookStartIndex,
278
+ turnId,
279
+ tmuxSession: liveState.tmux_session || state.tmux_session,
280
+ runtimeDir,
281
+ turnDir,
282
+ })
283
+ if (!submitConfirmation.ok) {
284
+ const resultPayload = buildFailureResult('claude_prompt_submit_unconfirmed', 'Claude prompt was pasted, but UserPromptSubmit did not fire after repeated Enter sends', liveState.sid || state.sid)
285
+ await writeTurnArtifacts(paths, turnId, prompt, resultPayload, argv['result-file'] || null)
286
+ await writeState(runtimeDir, {
287
+ status: 'failed',
288
+ current_turn_id: null,
289
+ current_turn_prompt_file: null,
290
+ current_turn_prompt_source: null,
291
+ current_turn_started_at: null,
292
+ current_turn_transport: 'tmux-paste-buffer',
293
+ last_completed_turn_id: turnId,
294
+ last_turn_number: turnNumber + 1,
295
+ last_error: resultPayload.msg,
296
+ prompt_submit_unconfirmed_pane_file: submitConfirmation.blockerFile,
297
+ })
298
+ emitTurnFailure(resultPayload)
299
+ process.exit(1)
300
+ }
301
+ hookStartIndex = submitConfirmation.eventsLength
302
+
240
303
  const { event, eventsLength } = await waitForHookEvent(
241
304
  paths,
242
305
  hookStartIndex,
@@ -18,7 +18,7 @@ Required:
18
18
  --task-root <task-root>
19
19
 
20
20
  Options:
21
- --output <zip-path> Zip output path (default: <task-root>/claude-sessions.zip)
21
+ --output <zip-path> Zip output path (default: <workflow-root>/claude-sessions.zip)
22
22
  --label <text> Optional package label for reporting
23
23
  `)
24
24
  }
@@ -168,7 +168,7 @@ try {
168
168
  }
169
169
 
170
170
  const sourceProjectDir = await resolveClaudeProjectDir(taskRoot)
171
- const outputPath = argv.output ? path.resolve(argv.output) : path.join(taskRoot, 'claude-sessions.zip')
171
+ const outputPath = argv.output ? path.resolve(argv.output) : path.join(path.dirname(taskRoot), 'claude-sessions.zip')
172
172
  const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'slopmachine-claude-project-'))
173
173
  const packageRoot = path.join(tempRoot, path.basename(sourceProjectDir))
174
174
 
@@ -177,7 +177,7 @@ try {
177
177
  await removeDsStoreFiles(packageRoot)
178
178
  const tinyRootTranscriptsRemoved = await removeTinyRootTranscripts(packageRoot)
179
179
  const included = (await listFilesRecursive(packageRoot)).sort((left, right) => left.localeCompare(right))
180
- await createZipArchive(packageRoot, outputPath)
180
+ await createZipArchive(tempRoot, outputPath)
181
181
 
182
182
  emitSuccess(path.basename(sourceProjectDir), {
183
183
  output: outputPath,
@@ -185,7 +185,7 @@ try {
185
185
  label: argv.label || null,
186
186
  included,
187
187
  tiny_root_transcripts_removed: tinyRootTranscriptsRemoved,
188
- packaging_mode: 'raw_claude_project_dir',
188
+ packaging_mode: 'raw_claude_project_dir_folder',
189
189
  })
190
190
  } finally {
191
191
  await fs.rm(tempRoot, { recursive: true, force: true }).catch(() => {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theslopmachine",
3
- "version": "1.0.22",
3
+ "version": "1.0.25",
4
4
  "description": "SlopMachine installer and project bootstrap CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/cli.js CHANGED
@@ -10,7 +10,7 @@ function printHelp() {
10
10
  Commands:
11
11
  setup Configure slopmachine in the local user environment
12
12
  upgrade Install slopmachine@latest globally and rerun setup
13
- init Bootstrap a workspace (--claude seeds CLAUDE.md, --opencode seeds AGENTS.md, --adopt wraps existing project, -o opens OpenCode)
13
+ init <github-url> Clone a task repository into the current workflow root and bootstrap workflow state (-o opens OpenCode)
14
14
  cleanup Remove/archive obsolete installed agents, skills, and assets (--dry-run previews)
15
15
  set-token Store the upload token in machine config
16
16
  send-data Upload workflow artifacts to Supabase
package/src/constants.js CHANGED
@@ -44,12 +44,10 @@ export const REQUIRED_SLOPMACHINE_FILES = [
44
44
  "clarifier-agent-prompt.md",
45
45
  "clarification-faithfulness-review-prompt.md",
46
46
  "phase-1-design-prompt.md",
47
- "phase-1-design-template.md",
48
47
  "phase-2-execution-planning-prompt.md",
49
48
  "phase-2-plan-template.md",
50
49
  "test-coverage-prompt.md",
51
50
  "owner-verification-checklist.md",
52
- "exact-readme-template.md",
53
51
  "workflow-init.js",
54
52
  "templates/AGENTS.md",
55
53
  "templates/CLAUDE.md",