@ai-content-space/loopx 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +26 -26
  2. package/package.json +6 -2
  3. package/plugins/loopx/.codex-plugin/plugin.json +6 -6
  4. package/plugins/loopx/scripts/plugin-install.test.mjs +25 -8
  5. package/plugins/loopx/skills/autopilot/SKILL.md +90 -0
  6. package/plugins/loopx/skills/build/SKILL.md +118 -0
  7. package/plugins/loopx/skills/clarify/SKILL.md +219 -0
  8. package/plugins/loopx/skills/plan/SKILL.md +238 -0
  9. package/plugins/loopx/skills/{loopx-review → review}/SKILL.md +9 -4
  10. package/skills/ai-slop-cleaner/SKILL.md +114 -0
  11. package/skills/autopilot/SKILL.md +90 -0
  12. package/skills/autoresearch/SKILL.md +68 -0
  13. package/skills/build/SKILL.md +118 -0
  14. package/skills/clarify/SKILL.md +219 -0
  15. package/skills/deep-interview/SKILL.md +461 -0
  16. package/skills/deepsearch/SKILL.md +38 -0
  17. package/skills/plan/SKILL.md +242 -0
  18. package/skills/ralph/SKILL.md +271 -0
  19. package/skills/ralplan/SKILL.md +49 -0
  20. package/skills/{loopx-review → review}/SKILL.md +9 -4
  21. package/src/autopilot-runtime.mjs +152 -0
  22. package/src/build-runtime.mjs +146 -0
  23. package/src/cli.mjs +49 -12
  24. package/src/codex-exec-runtime.mjs +97 -0
  25. package/src/install-discovery.mjs +7 -7
  26. package/src/next-skill.mjs +33 -0
  27. package/src/plan-runtime.mjs +477 -0
  28. package/src/runtime-maintenance.mjs +36 -8
  29. package/src/workflow.mjs +831 -124
  30. package/templates/architecture.md +3 -3
  31. package/templates/development-plan.md +1 -1
  32. package/templates/execution-record.md +1 -1
  33. package/templates/plan.md +10 -4
  34. package/templates/review-report.md +1 -1
  35. package/templates/spec.md +38 -2
  36. package/templates/test-plan.md +1 -1
  37. package/plugins/loopx/skills/loopx-autopilot/SKILL.md +0 -30
  38. package/plugins/loopx/skills/loopx-build/SKILL.md +0 -25
  39. package/plugins/loopx/skills/loopx-clarify/SKILL.md +0 -25
  40. package/plugins/loopx/skills/loopx-plan/SKILL.md +0 -25
  41. package/skills/loopx-autopilot/SKILL.md +0 -30
  42. package/skills/loopx-build/SKILL.md +0 -25
  43. package/skills/loopx-clarify/SKILL.md +0 -25
  44. package/skills/loopx-plan/SKILL.md +0 -25
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: plan
3
+ description: Consensus-first loopx planning skill with Planner, Architect, and Critic review.
4
+ argument-hint: "[--interactive] [--deliberate] [--direct <spec-path>] <clarified task or spec path>"
5
+ ---
6
+
7
+ # loopx Plan
8
+
9
+ <Purpose>
10
+ `plan` is loopx's canonical planning gate. It turns an approved clarify result or execution-ready spec into a reviewed plan package before build or autopilot starts.
11
+
12
+ By default, `plan` includes the full consensus review loop formerly documented under `ralplan`: Planner -> Architect -> Critic. Planner creates the plan, Architect reviews it, Critic gates it, and the plan iterates until approved or the iteration cap is reached.
13
+ </Purpose>
14
+
15
+ <Use_When>
16
+ - A clarify spec exists and needs a concrete execution package.
17
+ - The user asks for `plan`, `ralplan`, consensus planning, PRD, test spec, implementation plan, or architecture review.
18
+ - The request is clear enough to plan, but execution should not start before architecture and verification shape are reviewed.
19
+ - The downstream path may be `build`, `autopilot`, or another execution lane, but still needs a stable plan artifact first.
20
+ </Use_When>
21
+
22
+ <Do_Not_Use_When>
23
+ - Requirements are still vague enough that intent, non-goals, or decision boundaries are unresolved. Use `clarify` first.
24
+ - The user explicitly asks to implement a concrete small change immediately and no planning gate is needed.
25
+ - A current approved plan package already exists and the next action is execution.
26
+ </Do_Not_Use_When>
27
+
28
+ <Core_Principles>
29
+ - Default planning is consensus-first, not lightweight-by-default.
30
+ - Treat the clarify spec as source of truth; do not re-interview unless the spec is incomplete or contradictory.
31
+ - Keep planning artifact-bound: produce PRD, architecture, development plan, and test plan outputs.
32
+ - Separate planning approval from execution approval.
33
+ - Do not start implementation from `plan`.
34
+ - Prefer a smaller executable plan over a broad plan that cannot be verified.
35
+ - Preserve non-goals, decision boundaries, and residual-risk warnings from clarify.
36
+ </Core_Principles>
37
+
38
+ <Inputs>
39
+ Accepted inputs:
40
+
41
+ - an approved loopx clarify workflow slug
42
+ - `.loopx/specs/clarify-*.md`
43
+ - `.omx/specs/deep-interview-*.md`
44
+ - a direct task description when enough context is already present
45
+ - `--direct <spec-path>` to force a specific requirements artifact
46
+
47
+ If no requirements artifact is provided, derive a task slug and run pre-context intake before planning.
48
+ </Inputs>
49
+
50
+ <Flags>
51
+ - `--interactive`: ask the user at draft review and final approval boundaries.
52
+ - `--deliberate`: force high-rigor planning. Add pre-mortem and expanded test planning.
53
+ - `--direct <spec-path>`: use the given artifact as the planning source of truth.
54
+
55
+ `ralplan` is a compatibility alias for this default consensus behavior. It should not maintain a separate planning contract.
56
+ </Flags>
57
+
58
+ <Pre_Context_Intake>
59
+ Before planning:
60
+
61
+ 1. Derive a task slug.
62
+ 2. Reuse the latest relevant `.omx/context/{slug}-*.md` snapshot when available.
63
+ 3. If none exists, create `.omx/context/{slug}-{timestamp}.md` with:
64
+ - task statement
65
+ - desired outcome
66
+ - source requirements artifact
67
+ - known facts / evidence
68
+ - constraints
69
+ - non-goals
70
+ - decision boundaries
71
+ - unknowns / open questions
72
+ - likely codebase touchpoints
73
+ 4. For brownfield tasks, inspect relevant repo files before finalizing the plan.
74
+ 5. If ambiguity is still high, route back to `clarify` instead of inventing missing requirements.
75
+ 6. If planning depends on unfamiliar SDKs, external APIs, or version-sensitive framework behavior, use official documentation or a researcher lane before final approval.
76
+ </Pre_Context_Intake>
77
+
78
+ <Consensus_Workflow>
79
+ ## Step 1. Planner Draft
80
+
81
+ Planner creates the initial plan package and a compact RALPLAN-DR summary:
82
+
83
+ - Principles: 3-5 guiding constraints
84
+ - Decision Drivers: top 3 forces shaping the plan
85
+ - Viable Options: at least 2 options with bounded pros / cons
86
+ - Rejected Options: explicit invalidation when only one option remains viable
87
+ - Plan Package:
88
+ - PRD / requirements translation
89
+ - architecture approach
90
+ - development plan
91
+ - test plan
92
+ - acceptance criteria
93
+ - risk register
94
+
95
+ In `--deliberate` mode, also include:
96
+
97
+ - pre-mortem with 3 plausible failure scenarios
98
+ - expanded test plan covering unit, integration, e2e, and observability where applicable
99
+
100
+ ## Step 2. Draft User Review (`--interactive` only)
101
+
102
+ If interactive mode is enabled, present the draft plus the DR summary and ask whether to:
103
+
104
+ - proceed to Architect review
105
+ - request changes
106
+ - reject / stop
107
+
108
+ Without `--interactive`, proceed automatically to Architect review.
109
+
110
+ ## Step 3. Architect Review
111
+
112
+ Architect reviews the plan for soundness. This step must finish before Critic starts.
113
+
114
+ Architect must provide:
115
+
116
+ - strongest steelman objection to the plan
117
+ - at least one real tradeoff tension
118
+ - architecture risks and mitigations
119
+ - synthesis or recommended revision when the objection is valid
120
+ - deliberate-mode principle-violation checks when applicable
121
+
122
+ ## Step 4. Critic Gate
123
+
124
+ Critic runs only after Architect review completes.
125
+
126
+ Critic evaluates:
127
+
128
+ - principle-option consistency
129
+ - fairness of alternatives
130
+ - clarity of risk mitigation
131
+ - testable acceptance criteria
132
+ - concrete verification steps
133
+ - execution-input completeness for each new or changed ingress / workflow entrypoint
134
+ - explicit non-goals and decision boundaries
135
+ - in deliberate mode: pre-mortem and expanded test plan quality
136
+
137
+ Critic verdicts:
138
+
139
+ - `APPROVE`
140
+ - `ITERATE`
141
+ - `REJECT`
142
+
143
+ ## Step 5. Closed Re-Review Loop
144
+
145
+ If Critic returns `ITERATE` or `REJECT`, run a full closed loop:
146
+
147
+ 1. collect Architect + Critic feedback
148
+ 2. revise the plan with Planner
149
+ 3. return to Architect review
150
+ 4. return to Critic gate
151
+ 5. repeat until `APPROVE` or 5 iterations
152
+
153
+ Do not patch only the Critic complaint in isolation if the Architect objection implies a deeper plan change.
154
+
155
+ ## Step 6. Final Plan Package
156
+
157
+ On approval, write canonical planning artifacts:
158
+
159
+ - `.loopx/workflows/<slug>/plan.md`
160
+ - `.loopx/workflows/<slug>/architecture.md`
161
+ - `.loopx/workflows/<slug>/development-plan.md`
162
+ - `.loopx/workflows/<slug>/test-plan.md`
163
+ - `.loopx/plans/prd-<slug>.md`
164
+ - `.loopx/plans/test-spec-<slug>.md`
165
+
166
+ The final plan must include:
167
+
168
+ - ADR: Decision, Drivers, Alternatives considered, Why chosen, Consequences, Follow-ups
169
+ - concrete implementation steps sized to the actual task
170
+ - execution inputs mapped to concrete sources before build starts
171
+ - available execution lanes and recommended lane
172
+ - test and verification commands
173
+ - residual risks and assumptions
174
+ - explicit build/autopilot handoff guidance
175
+
176
+ ## Step 7. Execution Bridge
177
+
178
+ `plan` stops at an approved plan package.
179
+
180
+ In `--interactive` mode, ask for the next lane:
181
+
182
+ - approve for `build`
183
+ - approve for `autopilot`
184
+ - request plan changes
185
+ - stop
186
+
187
+ Without `--interactive`, report the approved plan and recommended next command, but do not launch execution.
188
+ </Consensus_Workflow>
189
+
190
+ <Runtime_State_Machine>
191
+ `plan` must keep the planning gate machine-checkable. Runtime state should track:
192
+
193
+ - `plan_current_iteration`: starts at `1`
194
+ - `plan_max_iterations`: default `5`
195
+ - `plan_consensus_mode`: `true` by default
196
+ - `plan_deliberate_mode`: `true|false`
197
+ - `plan_principles_resolved`: `true` after principles are explicit
198
+ - `plan_options_reviewed`: `true` after alternatives are fairly compared
199
+ - `plan_architect_review_status`: `not-started|complete|changes-requested`
200
+ - `plan_critic_verdict`: `none|approve|iterate|reject`
201
+ - `plan_package_status`: `missing|partial|complete`
202
+ - `plan_acceptance_criteria_testable`: `true|false`
203
+ - `plan_verification_steps_resolved`: `true|false`
204
+ - `plan_execution_inputs_resolved`: `true|false`
205
+ - `requested_transition`: remains explicit before build/autopilot
206
+
207
+ The plan gate is blocked until:
208
+
209
+ - plan package artifacts exist
210
+ - Architect review is complete
211
+ - Critic verdict is `approve`
212
+ - acceptance criteria are testable
213
+ - verification steps are concrete
214
+ - execution inputs are fully mapped to concrete sources
215
+ - user approval exists for any execution transition
216
+ </Runtime_State_Machine>
217
+
218
+ <Must_Not_Decide_Automatically>
219
+ - Do not skip Architect review.
220
+ - Do not run Architect and Critic in parallel; Critic depends on Architect.
221
+ - Do not launch build/autopilot without explicit approval.
222
+ - Do not widen scope beyond clarify non-goals because a broader redesign seems cleaner.
223
+ - Do not erase residual-risk warnings inherited from clarify.
224
+ - Do not treat a plan as approved when Critic returns `ITERATE` or `REJECT`.
225
+ </Must_Not_Decide_Automatically>
226
+
227
+ <Output_Contract>
228
+ Primary outputs:
229
+
230
+ - approved plan package under `.loopx/workflows/<slug>/`
231
+ - canonical PRD and test spec under `.loopx/plans/`
232
+ - consensus review summary with Planner / Architect / Critic evidence
233
+ - next-step recommendation
234
+
235
+ Status output must clearly state:
236
+
237
+ - current iteration
238
+ - Architect review status
239
+ - Critic verdict
240
+ - missing plan gates, if any
241
+ - whether execution is approved
242
+ </Output_Contract>
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: ralph
3
+ description: Self-referential loop until task completion with architect verification
4
+ ---
5
+
6
+ [RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
7
+
8
+ Your previous attempt did not output the completion promise. Continue working on the task.
9
+
10
+ <Purpose>
11
+ Ralph is a persistence loop that keeps working on a task until it is fully complete and architect-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, and mandatory verification before completion.
12
+ </Purpose>
13
+
14
+ <Use_When>
15
+ - Task requires guaranteed completion with verification (not just "do your best")
16
+ - User says "ralph", "don't stop", "must complete", "finish this", or "keep going until done"
17
+ - Work may span multiple iterations and needs persistence across retries
18
+ - Task benefits from parallel execution with architect sign-off at the end
19
+ </Use_When>
20
+
21
+ <Do_Not_Use_When>
22
+ - User wants a full autonomous pipeline from idea to code -- use `autopilot` instead
23
+ - User wants to explore or plan before committing -- use `plan` skill instead
24
+ - User wants a quick one-shot fix -- delegate directly to an executor agent
25
+ - User wants manual control over completion -- use `ultrawork` directly
26
+ </Do_Not_Use_When>
27
+
28
+ <Why_This_Exists>
29
+ Complex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. Ralph prevents this by looping until work is genuinely complete, requiring fresh verification evidence before allowing completion, and using tiered architect review to confirm quality.
30
+ </Why_This_Exists>
31
+
32
+ <Execution_Policy>
33
+ - Fire independent agent calls simultaneously -- never wait sequentially for independent work
34
+ - Use `run_in_background: true` for long operations (installs, builds, test suites)
35
+ - Always pass the `model` parameter explicitly when delegating to agents
36
+ - Read `docs/shared/agent-tiers.md` before first delegation to select correct agent tiers
37
+ - Deliver the full implementation: no scope reduction, no partial completion, no deleting tests to make them pass
38
+ - Default to concise, evidence-dense progress and completion reporting unless the user or risk level requires more detail
39
+ - Treat newer user task updates as local overrides for the active workflow branch while preserving earlier non-conflicting constraints
40
+ - If correctness depends on additional inspection, retrieval, execution, or verification, keep using the relevant tools until the execution loop is grounded
41
+ - Continue through clear, low-risk, reversible next steps automatically; ask only when the next step is materially branching, destructive, or preference-dependent
42
+ </Execution_Policy>
43
+
44
+ <Steps>
45
+ 0. **Pre-context intake (required before planning/execution loop starts)**:
46
+ - Assemble or load a context snapshot at `.omx/context/{task-slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`).
47
+ - Minimum snapshot fields:
48
+ - task statement
49
+ - desired outcome
50
+ - known facts/evidence
51
+ - constraints
52
+ - unknowns/open questions
53
+ - likely codebase touchpoints
54
+ - If an existing relevant snapshot is available, reuse it and record the path in Ralph state.
55
+ - If request ambiguity is high, gather brownfield facts first. When session guidance enables `USE_OMX_EXPLORE_CMD`, prefer `omx explore` for simple read-only repository lookups with narrow, concrete prompts; otherwise use the richer normal explore path. Then run `$deep-interview --quick <task>` to close critical gaps.
56
+ - Do not begin Ralph execution work (delegation, implementation, or verification loops) until snapshot grounding exists. If forced to proceed quickly, note explicit risk tradeoffs.
57
+ 1. **Review progress**: Check TODO list and any prior iteration state
58
+ 2. **Continue from where you left off**: Pick up incomplete tasks
59
+ 3. **Delegate in parallel**: Route tasks to specialist agents at appropriate tiers
60
+ - Simple lookups: LOW tier -- "What does this function return?"
61
+ - Standard work: STANDARD tier -- "Add error handling to this module"
62
+ - Complex analysis: THOROUGH tier -- "Debug this race condition"
63
+ - When Ralph is entered as a ralplan follow-up, start from the approved **available-agent-types roster** and make the delegation plan explicit: implementation lane, evidence/regression lane, and final sign-off lane using only known agent types
64
+ 4. **Run long operations in background**: Builds, installs, test suites use `run_in_background: true`
65
+ 5. **Visual task gate (when screenshot/reference images are present)**:
66
+ - Run `$visual-verdict` **before every next edit**.
67
+ - Require structured JSON output: `score`, `verdict`, `category_match`, `differences[]`, `suggestions[]`, `reasoning`.
68
+ - Persist verdict to `.omx/state/{scope}/ralph-progress.json` including numeric + qualitative feedback.
69
+ - Default pass threshold: `score >= 90`.
70
+ - **URL-based visual cloning tasks**: When the task description contains a target URL (e.g., "clone https://example.com"), route the work through `$visual-ralph`. `$web-clone` is hard-deprecated; Visual Ralph owns the migrated live-URL visual implementation use case and uses `$visual-verdict` for measured visual scoring.
71
+ 6. **Verify completion with fresh evidence**:
72
+ a. Identify what command proves the task is complete
73
+ b. Run verification (test, build, lint)
74
+ c. Read the output -- confirm it actually passed
75
+ d. Check: zero pending/in_progress TODO items
76
+ 7. **Architect verification** (tiered):
77
+ - <5 files, <100 lines with full tests: STANDARD tier minimum (architect role)
78
+ - Standard changes: STANDARD tier (architect role)
79
+ - >20 files or security/architectural changes: THOROUGH tier (architect role)
80
+ - Ralph floor: always at least STANDARD, even for small changes
81
+ 7.5 **Mandatory Deslop Pass**:
82
+ - After Step 7 passes, run `oh-my-codex:ai-slop-cleaner` on **all files changed during the Ralph session**.
83
+ - Scope the cleaner to **changed files only**; do not widen the pass beyond Ralph-owned edits.
84
+ - Run the cleaner in **standard mode** (not `--review`).
85
+ - If the prompt contains `--no-deslop`, skip Step 7.5 entirely and proceed with the most recent successful verification evidence.
86
+ 7.6 **Regression Re-verification**:
87
+ - After the deslop pass, re-run all tests/build/lint and read the output to confirm they still pass.
88
+ - If post-deslop regression fails, roll back cleaner changes or fix and retry. Then rerun Step 7.5 and Step 7.6 until the regression is green.
89
+ - Do not proceed to completion until post-deslop regression is green (unless `--no-deslop` explicitly skipped the deslop pass).
90
+ 8. **On approval**: Run `/cancel` to cleanly exit and clean up all state files
91
+ 9. **On rejection**: Fix the issues raised, then re-verify at the same tier
92
+ </Steps>
93
+
94
+ <Tool_Usage>
95
+ - Before first MCP tool use, call `ToolSearch("mcp")` to discover deferred MCP tools
96
+ - Use `ask_codex` with `agent_role: "architect"` for verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integration
97
+ - Skip Codex consultation for simple feature additions, well-tested changes, or time-critical verification
98
+ - If ToolSearch finds no MCP tools or Codex is unavailable, proceed with architect agent verification alone -- never block on external tools
99
+ - Use `state_write` / `state_read` for ralph mode state persistence between iterations
100
+ - Persist context snapshot path in Ralph mode state so later phases and agents share the same grounding context
101
+ </Tool_Usage>
102
+
103
+ ## State Management
104
+
105
+ Use the `omx_state` MCP server tools (`state_write`, `state_read`, `state_clear`) for Ralph lifecycle state.
106
+
107
+ - **On start**:
108
+ `state_write({mode: "ralph", active: true, iteration: 1, max_iterations: 10, current_phase: "executing", started_at: "<now>", state: {context_snapshot_path: "<snapshot-path>"}})`
109
+ - **On each iteration**:
110
+ `state_write({mode: "ralph", iteration: <current>, current_phase: "executing"})`
111
+ - **On verification/fix transition**:
112
+ `state_write({mode: "ralph", current_phase: "verifying"})` or `state_write({mode: "ralph", current_phase: "fixing"})`
113
+ - **On completion**:
114
+ `state_write({mode: "ralph", active: false, current_phase: "complete", completed_at: "<now>"})`
115
+ - **On cancellation/cleanup**:
116
+ run `$cancel` (which should call `state_clear(mode="ralph")`)
117
+
118
+
119
+ ## Scenario Examples
120
+
121
+ **Good:** The user says `continue` after the workflow already has a clear next step. Continue the current branch of work instead of restarting or re-asking the same question.
122
+
123
+ **Good:** The user changes only the output shape or downstream delivery step (for example `make a PR`). Preserve earlier non-conflicting workflow constraints and apply the update locally.
124
+
125
+ **Bad:** The user says `continue`, and the workflow restarts discovery or stops before the missing verification/evidence is gathered.
126
+
127
+ <Examples>
128
+ <Good>
129
+ Correct parallel delegation:
130
+ ```
131
+ delegate(role="executor", tier="LOW", task="Add type export for UserConfig")
132
+ delegate(role="executor", tier="STANDARD", task="Implement the caching layer for API responses")
133
+ delegate(role="executor", tier="THOROUGH", task="Refactor auth module to support OAuth2 flow")
134
+ ```
135
+ Why good: Three independent tasks fired simultaneously at appropriate tiers.
136
+ </Good>
137
+
138
+ <Good>
139
+ Correct verification before completion:
140
+ ```
141
+ 1. Run: npm test → Output: "42 passed, 0 failed"
142
+ 2. Run: npm run build → Output: "Build succeeded"
143
+ 3. Run: lsp_diagnostics → Output: 0 errors
144
+ 4. Delegate to architect at STANDARD tier → Verdict: "APPROVED"
145
+ 5. Run /cancel
146
+ ```
147
+ Why good: Fresh evidence at each step, architect verification, then clean exit.
148
+ </Good>
149
+
150
+ <Bad>
151
+ Claiming completion without verification:
152
+ "All the changes look good, the implementation should work correctly. Task complete."
153
+ Why bad: Uses "should" and "look good" -- no fresh test/build output, no architect verification.
154
+ </Bad>
155
+
156
+ <Bad>
157
+ Sequential execution of independent tasks:
158
+ ```
159
+ delegate(executor, LOW, "Add type export") → wait →
160
+ delegate(executor, STANDARD, "Implement caching") → wait →
161
+ delegate(executor, THOROUGH, "Refactor auth")
162
+ ```
163
+ Why bad: These are independent tasks that should run in parallel, not sequentially.
164
+ </Bad>
165
+ </Examples>
166
+
167
+ <Escalation_And_Stop_Conditions>
168
+ - Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)
169
+ - Stop when the user says "stop", "cancel", or "abort" -- run `/cancel`
170
+ - Continue working when the hook system sends "The boulder never stops" -- this means the iteration continues
171
+ - If architect rejects verification, fix the issues and re-verify (do not stop)
172
+ - If the same issue recurs across 3+ iterations, report it as a potential fundamental problem
173
+ </Escalation_And_Stop_Conditions>
174
+
175
+ <Final_Checklist>
176
+ - [ ] All requirements from the original task are met (no scope reduction)
177
+ - [ ] Zero pending or in_progress TODO items
178
+ - [ ] Fresh test run output shows all tests pass
179
+ - [ ] Fresh build output shows success
180
+ - [ ] lsp_diagnostics shows 0 errors on affected files
181
+ - [ ] Architect verification passed (STANDARD tier minimum)
182
+ - [ ] ai-slop-cleaner pass completed on changed files (or --no-deslop specified)
183
+ - [ ] Post-deslop regression tests pass
184
+ - [ ] `/cancel` run for clean state cleanup
185
+ </Final_Checklist>
186
+
187
+ <Advanced>
188
+ ## PRD Mode (Optional)
189
+
190
+ When the user provides the `--prd` flag, initialize a Product Requirements Document before starting the ralph loop.
191
+
192
+ ### Detecting PRD Mode
193
+ Check if `{{PROMPT}}` contains `--prd` or `--PRD`.
194
+
195
+ Prompt-side `$ralph` workflow activation is lighter-weight than `omx ralph --prd ...`.
196
+ It seeds Ralph workflow state and guidance, but it does not implicitly launch the
197
+ CLI entrypoint or apply the PRD startup gate. Treat `omx ralph --prd ...` as the
198
+ explicit PRD-gated path.
199
+
200
+ ### Detecting `--no-deslop`
201
+ Check if `{{PROMPT}}` contains `--no-deslop`.
202
+ If `--no-deslop` is present, skip the deslop pass entirely after Step 7 and continue using the latest successful pre-deslop verification evidence.
203
+
204
+ ### Visual Reference Flags (Optional)
205
+ Ralph execution supports visual reference flags for screenshot tasks:
206
+ - Repeatable image inputs: `-i <image-path>` (can be used multiple times)
207
+ - Image directory input: `--images-dir <directory>`
208
+
209
+ Example:
210
+ `ralph -i refs/hn.png -i refs/hn-item.png --images-dir ./screenshots "match HackerNews layout"`
211
+
212
+ ### PRD Workflow
213
+ 1. Run deep-interview in quick mode before creating PRD artifacts:
214
+ - Execute: `$deep-interview --quick <task>`
215
+ - Complete a compact requirements pass (context, goals, scope, constraints, validation)
216
+ - Persist interview output to `.omx/interviews/{slug}-{timestamp}.md`
217
+ 2. Create canonical PRD/progress artifacts:
218
+ - PRD: `.omx/plans/prd-{slug}.md`
219
+ - Progress ledger: `.omx/state/{scope}/ralph-progress.json` (session scope when available, else root scope)
220
+ 3. Parse the task (everything after `--prd` flag)
221
+ 4. Break down into user stories:
222
+
223
+ ```json
224
+ {
225
+ "project": "[Project Name]",
226
+ "branchName": "ralph/[feature-name]",
227
+ "description": "[Feature description]",
228
+ "userStories": [
229
+ {
230
+ "id": "US-001",
231
+ "title": "[Short title]",
232
+ "description": "As a [user], I want to [action] so that [benefit].",
233
+ "acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
234
+ "priority": 1,
235
+ "passes": false
236
+ }
237
+ ]
238
+ }
239
+ ```
240
+
241
+ 5. Initialize canonical progress ledger at `.omx/state/{scope}/ralph-progress.json`
242
+ 6. Guidelines: right-sized stories (one session each), verifiable criteria, independent stories, priority order (foundational work first)
243
+ 7. Proceed to normal ralph loop using user stories as the task list
244
+
245
+ ### Example
246
+ User input: `--prd build a todo app with React and TypeScript`
247
+ Workflow: Detect flag, extract task, create `.omx/plans/prd-{slug}.md`, create `.omx/state/{scope}/ralph-progress.json`, begin ralph loop.
248
+
249
+ ### Legacy compatibility
250
+ - During the compatibility window, Ralph `--prd` startup still validates machine-readable story state from `.omx/prd.json`.
251
+ - `.omx/plans/prd-{slug}.md` remains the canonical storage/documentation artifact, but it is not yet the startup validation source.
252
+ - If `.omx/prd.json` exists and canonical PRD is absent, migrate one-way into `.omx/plans/prd-{slug}.md`.
253
+ - If `.omx/progress.txt` exists and canonical progress ledger is absent, import one-way into `.omx/state/{scope}/ralph-progress.json`.
254
+ - Keep legacy files unchanged for one release cycle.
255
+
256
+ ## Background Execution Rules
257
+
258
+ **Run in background** (`run_in_background: true`):
259
+ - Package installation (npm install, pip install, cargo build)
260
+ - Build processes (make, project build commands)
261
+ - Test suites
262
+ - Docker operations (docker build, docker pull)
263
+
264
+ **Run blocking** (foreground):
265
+ - Quick status checks (git status, ls, pwd)
266
+ - File reads and edits
267
+ - Simple commands
268
+ </Advanced>
269
+
270
+ Original task:
271
+ {{PROMPT}}
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: ralplan
3
+ description: Compatibility alias for the default consensus-first loopx plan skill
4
+ ---
5
+
6
+ # Ralplan
7
+
8
+ `ralplan` is a compatibility alias for `$plan`.
9
+
10
+ loopx `plan` is consensus-first by default, so `ralplan` must not define or maintain a separate planning workflow.
11
+
12
+ ## Canonical Invocation
13
+
14
+ Use:
15
+
16
+ ```text
17
+ $plan <arguments>
18
+ $plan --interactive <arguments>
19
+ $plan --deliberate <arguments>
20
+ ```
21
+
22
+ Legacy invocations remain accepted as user intent:
23
+
24
+ ```text
25
+ $ralplan <arguments>
26
+ $ralplan --interactive <arguments>
27
+ $ralplan --deliberate <arguments>
28
+ ```
29
+
30
+ ## Delegation Rule
31
+
32
+ When invoked, immediately follow `skills/plan/SKILL.md` as the canonical contract.
33
+
34
+ Do not duplicate or reinterpret:
35
+
36
+ - pre-context intake
37
+ - RALPLAN-DR summary
38
+ - Planner -> Architect -> Critic sequencing
39
+ - closed re-review loop
40
+ - deliberate mode
41
+ - interactive approval boundaries
42
+ - execution bridge
43
+ - runtime state machine
44
+
45
+ ## Must Not
46
+
47
+ - Do not pass a consensus flag to `plan`; consensus is already the default plan behavior.
48
+ - Do not maintain a separate ralplan artifact schema.
49
+ - Do not launch execution directly from this alias.
@@ -1,8 +1,13 @@
1
- # LoopX Review
1
+ ---
2
+ name: review
3
+ description: Repo-local acceptance surface for loopx.
4
+ ---
5
+
6
+ # loopx Review
2
7
 
3
8
  ## Purpose
4
9
 
5
- Repo-local acceptance surface for LoopX. Use it to evaluate the execution package from `loopx-build` and return an explicit go / no-go result.
10
+ Repo-local acceptance surface for loopx. Use it to evaluate the execution package from `build` and return an explicit go / no-go result.
6
11
 
7
12
  ## Expected Outputs
8
13
 
@@ -13,7 +18,7 @@ Repo-local acceptance surface for LoopX. Use it to evaluate the execution packag
13
18
  ## Decision Boundary
14
19
 
15
20
  - Use this only after build has produced execution and verification evidence for a specific run.
16
- - Stop here if review evidence is incomplete. `loopx-review` remains an independent gate and does not auto-complete the workflow.
21
+ - Stop here if review evidence is incomplete. `review` remains an independent gate and does not auto-complete the workflow.
17
22
 
18
23
  ## Must Not Decide Automatically
19
24
 
@@ -22,4 +27,4 @@ Repo-local acceptance surface for LoopX. Use it to evaluate the execution packag
22
27
 
23
28
  ## Notes
24
29
 
25
- - Review consumes structured outputs from the active LoopX run. It should reject thin or placeholder-only evidence.
30
+ - Review consumes structured outputs from the active loopx run. It should reject thin or placeholder-only evidence.