@ai-content-space/loopx 0.2.2 → 0.2.4

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 (50) hide show
  1. package/README.md +6 -1
  2. package/README.zh-CN.md +6 -1
  3. package/docs/loopx/design/loopx-skill-suite-v1-design.md +4 -3
  4. package/package.json +1 -1
  5. package/plugins/loopx/.codex-plugin/plugin.json +1 -1
  6. package/plugins/loopx/skills/clarify/SKILL.md +1 -1
  7. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  8. package/plugins/loopx/skills/doc-readability/SKILL.md +222 -0
  9. package/plugins/loopx/skills/doc-readability/references/prd.md +269 -0
  10. package/plugins/loopx/skills/exec/SKILL.md +7 -2
  11. package/plugins/loopx/skills/final-review/SKILL.md +1 -1
  12. package/plugins/loopx/skills/finish/SKILL.md +1 -1
  13. package/plugins/loopx/skills/fix-review/SKILL.md +1 -1
  14. package/plugins/loopx/skills/go-style/SKILL.md +8 -2
  15. package/plugins/loopx/skills/kratos/SKILL.md +1 -1
  16. package/plugins/loopx/skills/plan/SKILL.md +3 -3
  17. package/plugins/loopx/skills/refactor-plan/SKILL.md +1 -1
  18. package/plugins/loopx/skills/review/SKILL.md +1 -1
  19. package/plugins/loopx/skills/spec/SKILL.md +1 -1
  20. package/plugins/loopx/skills/subagent-exec/SKILL.md +1 -1
  21. package/plugins/loopx/skills/subagent-exec/agents/openai.yaml +2 -2
  22. package/plugins/loopx/skills/subagent-exec/codex-subagents.md +1 -1
  23. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  24. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  25. package/scripts/codex-workflow-hook.mjs +36 -5
  26. package/skills/RESOLVER.md +3 -1
  27. package/skills/clarify/SKILL.md +1 -1
  28. package/skills/debug/SKILL.md +1 -1
  29. package/skills/doc-readability/SKILL.md +222 -0
  30. package/skills/doc-readability/references/prd.md +269 -0
  31. package/skills/exec/SKILL.md +7 -2
  32. package/skills/final-review/SKILL.md +1 -1
  33. package/skills/finish/SKILL.md +1 -1
  34. package/skills/fix-review/SKILL.md +1 -1
  35. package/skills/go-style/SKILL.md +8 -2
  36. package/skills/kratos/SKILL.md +1 -1
  37. package/skills/plan/SKILL.md +3 -3
  38. package/skills/refactor-plan/SKILL.md +1 -1
  39. package/skills/review/SKILL.md +1 -1
  40. package/skills/spec/SKILL.md +1 -1
  41. package/skills/subagent-exec/SKILL.md +1 -1
  42. package/skills/subagent-exec/agents/openai.yaml +2 -2
  43. package/skills/subagent-exec/codex-subagents.md +1 -1
  44. package/skills/tdd/SKILL.md +1 -1
  45. package/skills/verify/SKILL.md +1 -1
  46. package/src/build-stop-gate.mjs +1 -1
  47. package/src/cli.mjs +5 -1
  48. package/src/install-discovery.mjs +1 -28
  49. package/src/next-skill.mjs +46 -5
  50. package/src/workflow.mjs +4 -4
@@ -0,0 +1,269 @@
1
+ # PRD Readability and Completeness
2
+
3
+ Use this reference only when the confirmed document type is `Requirements document / PRD`, or when the user explicitly asks to evaluate a document as a PRD.
4
+
5
+ ## Core Standard
6
+
7
+ A PRD is readable only if it lets reviewers decide whether the product should be built and lets designers, engineers, QA, operations, and stakeholders understand what must be delivered. For PRDs, readability includes requirement completeness, not just prose clarity.
8
+
9
+ ## Required Checks
10
+
11
+ Check the PRD across these areas:
12
+
13
+ | Area | What must be clear |
14
+ |---|---|
15
+ | Problem | What problem exists, who has it, why it matters now, and what current workaround or failure it replaces. |
16
+ | Goal | What outcome this release must achieve, and how success will be judged. |
17
+ | Non-goals | What is explicitly out of scope, deferred, or intentionally unsupported. |
18
+ | Users / roles | Which user roles exist, what each role can see or do, and which role owns each decision or operation. |
19
+ | Scope and priority | What is MVP / phase-one / required, what is optional, and what is future work. |
20
+ | Workflow | Trigger, preconditions, main path, branch paths, exception paths, and terminal states. |
21
+ | Functional requirements | Inputs, outputs, state changes, permissions, validation, dependencies, and failure handling. |
22
+ | Business rules | Who evaluates the rule, using which fields, at what time, and what happens when the rule fails. |
23
+ | Page / operation behavior | Entry point, displayed fields, action buttons, enable/disable conditions, submit validation, success/failure feedback, and audit logs. |
24
+ | Data / integration | Source systems, target systems, required fields, idempotency, versioning, retries, and consistency expectations. |
25
+ | Acceptance criteria | Testable Given/When/Then-style outcomes or equivalent concrete verification criteria. |
26
+ | Open questions | Unknowns, decision owners, deadlines, and whether they block delivery. |
27
+
28
+ ## Detail Gap Patterns
29
+
30
+ Flag these as PRD detail gaps, even if the prose is readable:
31
+
32
+ - A feature says `support`, `process`, `identify`, `generate`, `sync`, `notify`, `confirm`, or `handle`, but does not define input, output, owner, timing, or terminal state.
33
+ - A workflow lists stages but omits trigger, precondition, branch conditions, exception handling, or completion criteria.
34
+ - A status is named but its transitions, allowed actions, owner, or exit condition are missing.
35
+ - A page lists fields but omits action behavior, button availability, validation, empty states, errors, permissions, or logs.
36
+ - A rule describes intent but not the exact field, calculation, priority, source of truth, or conflict handling.
37
+ - A Plan / task / event is generated, but the recipient, payload, idempotency, retry, cancellation, and failure handling are unclear.
38
+ - A dependency is mentioned but its contract, SLA, missing-data behavior, or fallback is undefined.
39
+ - A requirement cannot be tested because it lacks concrete examples or acceptance criteria.
40
+
41
+ ## Ambiguity Probes
42
+
43
+ Use these probes to expose unclear requirements. Do not ask all of them to the user; use them to inspect the document and report the gaps that matter.
44
+
45
+ ### Feature Scope
46
+
47
+ - What exactly does `support X` include and exclude?
48
+ - What is the minimum acceptable behavior for phase one?
49
+ - Is this automatic, manual, or semi-automatic?
50
+ - Who can trigger it, and from where?
51
+ - What happens if the user starts but does not finish?
52
+ - What behavior is intentionally not supported?
53
+ - What is the smallest shippable version of the feature?
54
+ - Which users, accounts, markets, regions, products, channels, or data types are included?
55
+ - Which cases are explicitly excluded even if they look similar?
56
+ - Does "support" mean display only, calculate, persist, send, execute, reconcile, notify, or audit?
57
+ - Does the requirement apply to historical data, only new data, or both?
58
+ - Is there a migration, backfill, or cleanup requirement?
59
+
60
+ ### Actors and Ownership
61
+
62
+ - Which role owns each decision, confirmation, correction, and exception?
63
+ - Which actions are system actions, user actions, operator actions, or downstream-system actions?
64
+ - Who is allowed to override system output?
65
+ - Who reviews or approves high-risk actions?
66
+ - Who is notified when something is blocked, failed, revised, or completed?
67
+ - Who owns manual follow-up when automation cannot continue?
68
+
69
+ ### Workflow and State
70
+
71
+ - What triggers the workflow?
72
+ - What preconditions must be true?
73
+ - What is the happy path?
74
+ - What branches exist and what condition selects each branch?
75
+ - What are the terminal states?
76
+ - Which states allow edit, retry, cancel, ignore, approve, reject, archive, or rollback?
77
+ - Who owns each state transition?
78
+ - What happens when two events, tasks, or users act on the same object concurrently?
79
+ - What is the first state after creation?
80
+ - What is the difference between draft, pending, confirmed, sent, failed, completed, archived, ignored, or cancelled?
81
+ - Which transitions are automatic and which require user action?
82
+ - Are any transitions irreversible?
83
+ - What events reopen or revise a completed item?
84
+ - What stale states require timeout handling or escalation?
85
+ - What should the system do if a workflow is interrupted mid-step?
86
+
87
+ ### Timing and Snapshot
88
+
89
+ - Which date or time controls eligibility, calculation, display, execution, and notification?
90
+ - Is the date in user timezone, market timezone, system timezone, or source-system timezone?
91
+ - What snapshot is used for positions, balances, orders, customers, permissions, or source data?
92
+ - Can the snapshot be regenerated? If yes, does it replace or version prior results?
93
+ - What happens if source data arrives late, is revised, or is cancelled?
94
+ - What is the cutoff time for each action?
95
+ - What is allowed before cutoff, after cutoff, and after execution?
96
+
97
+ ### Data and Rules
98
+
99
+ - What is the source of truth for each important field?
100
+ - Which field is required, optional, calculated, derived, or manually entered?
101
+ - What is the rule priority when multiple rules match?
102
+ - What happens when source systems disagree?
103
+ - What happens when required data is missing, stale, duplicated, revised, or cancelled?
104
+ - Are historical values preserved when current effective values change?
105
+ - Is there versioning, and which version is current?
106
+ - What is the unique key for deduplication?
107
+ - Which fields are immutable after creation?
108
+ - Which fields can be manually corrected, and how are original/system/manual/effective values preserved?
109
+ - What validation prevents invalid combinations?
110
+ - What precision, rounding, currency, unit, or formatting rule applies?
111
+ - What happens when two rules produce different outputs?
112
+ - What is the conflict priority between source data, manual confirmation, downstream return, and recalculation?
113
+ - Is the rule evaluated per user, per account, per task, per event, per order, or per item?
114
+
115
+ ### Page and Operation Behavior
116
+
117
+ - Where is the entry point?
118
+ - What fields are visible by default, and what is hidden behind details?
119
+ - Which actions are available in each status?
120
+ - What disables an action button?
121
+ - What validation runs before submit?
122
+ - What confirmation, warning, or preview is shown before an irreversible operation?
123
+ - What success, failure, partial-success, retry, and timeout feedback does the user see?
124
+ - What audit log is written?
125
+ - What filters, sorting, grouping, search, export, or bulk actions are required?
126
+ - What empty, loading, error, no-permission, and no-data states are shown?
127
+ - What fields are editable, read-only, calculated, or drill-down only?
128
+ - What happens when a user edits data that has already changed in the background?
129
+ - What is the behavior for batch selection, partial selection, and disabled rows?
130
+ - What is the exact result of save, submit, approve, reject, retry, ignore, archive, cancel, rollback, or resend?
131
+ - Does the user need a preview of generated output before sending?
132
+
133
+ ### Integration and Execution
134
+
135
+ - Who receives generated tasks, events, Plans, notifications, or files?
136
+ - What payload is sent?
137
+ - What idempotency key or duplicate-prevention rule exists?
138
+ - What is retryable and what requires manual intervention?
139
+ - What happens on partial success?
140
+ - What happens if the downstream system accepts the request but later reports failure?
141
+ - What cancellation, correction, reversal, or compensation path exists?
142
+ - Is execution synchronous, asynchronous, scheduled, or manual?
143
+ - What acknowledgement does the upstream system need?
144
+ - What return payload is expected?
145
+ - What retry policy applies: count, interval, backoff, manual retry, or no retry?
146
+ - What makes a request idempotent?
147
+ - How are duplicate sends, duplicate callbacks, or out-of-order callbacks handled?
148
+ - What monitoring, alerting, or reconciliation is required?
149
+ - What should happen when integration is unavailable but users continue operating?
150
+
151
+ ### Permissions and Risk
152
+
153
+ - Who can view, create, edit, approve, send, retry, cancel, or archive?
154
+ - Which operations require dual review or elevated permission?
155
+ - What is the blast radius of a wrong operation?
156
+ - What guardrails prevent sending incomplete, stale, or unconfirmed data?
157
+ - What must be recoverable from logs?
158
+ - Which fields or actions are sensitive?
159
+ - Which roles can see customer-level, account-level, financial, or operational details?
160
+ - Is approval required before customer-facing or financially impactful actions?
161
+ - What is the rollback or compensation path for wrong execution?
162
+ - What operational dashboard or report proves the feature is healthy?
163
+ - What audit evidence must be retained for compliance or customer support?
164
+
165
+ ### Notifications and External Visibility
166
+
167
+ - Who receives notifications: internal operators, downstream teams, customers, support, or all?
168
+ - What triggers notification creation?
169
+ - What template, channel, language, and timing are required?
170
+ - What fields are shown to customers versus internal users?
171
+ - What happens if notification delivery fails?
172
+ - Can notifications be resent, corrected, suppressed, or cancelled?
173
+ - What customer support or audit view is needed after notification?
174
+
175
+ ## Acceptance Criteria Patterns
176
+
177
+ When a requirement is vague, propose a testable acceptance shape. Use domain language from the document.
178
+
179
+ ```text
180
+ Given [precondition / status / role / data]
181
+ When [user action / system trigger / external event]
182
+ Then [observable result / state change / generated output]
183
+ And [audit / notification / error / retry behavior]
184
+ ```
185
+
186
+ Include acceptance coverage for:
187
+
188
+ - Happy path.
189
+ - Missing or invalid input.
190
+ - Permission denied.
191
+ - Duplicate submission or duplicate event.
192
+ - External dependency failure.
193
+ - Partial success.
194
+ - Revised or cancelled source data.
195
+ - No impacted users / empty result.
196
+ - Manual override.
197
+ - Audit and traceability.
198
+
199
+ For page requirements, check:
200
+
201
+ ```text
202
+ Given [task status and user role]
203
+ When [page opens or action is clicked]
204
+ Then [fields/actions visible]
205
+ And [disabled/enabled conditions]
206
+ And [validation / feedback / log behavior]
207
+ ```
208
+
209
+ For rules, check:
210
+
211
+ ```text
212
+ Given [source data and priority conditions]
213
+ When [rule evaluation runs]
214
+ Then [selected result]
215
+ And [fallback or conflict result]
216
+ ```
217
+
218
+ ## PRD Severity
219
+
220
+ Use this severity model in addition to the main skill's severity model:
221
+
222
+ | Severity | Meaning |
223
+ |---|---|
224
+ | Blocking requirement gap | A builder or reviewer cannot know what to implement, test, approve, or operate. |
225
+ | Important requirement gap | The requirement is implementable only with assumptions; different readers may implement it differently. |
226
+ | Optional refinement | The requirement is understandable, but examples, wording, or organization could reduce review effort. |
227
+
228
+ Do not label every missing detail as blocking. A missing detail is blocking only if implementation, testing, or review would require guessing.
229
+
230
+ ## PRD Output Requirement
231
+
232
+ When assessing a PRD, include a section for requirement detail gaps. Use natural headings in the user's language. Cover:
233
+
234
+ - The gap.
235
+ - Why it affects delivery or review.
236
+ - What question must be answered or what detail must be added.
237
+ - A suggested acceptance or clarification shape when useful.
238
+
239
+ Example shape:
240
+
241
+ ```text
242
+ Requirement detail gaps:
243
+ - [Gap]: ...
244
+ Impact: ...
245
+ Need to clarify: ...
246
+ Suggested acceptance shape: ...
247
+ ```
248
+
249
+ ## Rewrite Guidance for PRDs
250
+
251
+ When rewriting a PRD, prefer this structure:
252
+
253
+ ```text
254
+ 1. Summary
255
+ 2. Background / problem
256
+ 3. Goals and non-goals
257
+ 4. Users and roles
258
+ 5. Scope and priorities
259
+ 6. Core workflows
260
+ 7. Functional requirements
261
+ 8. Rules and edge cases
262
+ 9. Page / operation requirements
263
+ 10. Data and integration requirements
264
+ 11. Acceptance criteria
265
+ 12. Open questions
266
+ 13. Appendix
267
+ ```
268
+
269
+ Keep implementation contracts in the PRD only when they are needed for product review. Move exhaustive field tables, enum lists, API payloads, and state-machine details to appendices or companion engineering specs when they interrupt the product decision path.
@@ -3,7 +3,7 @@ name: exec
3
3
  description: "Executes a written loopx implementation plan sequentially with review checkpoints. Not for unclear plans, missing requirements, or subagent-first execution."
4
4
  when_to_use: "written implementation plan, inline execution, sequential plan execution, review checkpoints, no subagent lane"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Exec
@@ -35,9 +35,12 @@ For each task:
35
35
  ### Step 3: Complete Development
36
36
 
37
37
  After all tasks complete and verified:
38
+ - Announce: "I'm using the final-review skill to review the completed feature."
39
+ - **REQUIRED SUB-SKILL:** Use loopx:final-review
40
+ - If final-review finds Critical or Important issues, use loopx:fix-review to handle feedback before proceeding
38
41
  - Announce: "I'm using the finish skill to complete this work."
39
42
  - **REQUIRED SUB-SKILL:** Use loopx:finish
40
- - Follow that skill to verify tests, present options, execute choice
43
+ - Follow finish to verify tests, present options, execute choice
41
44
 
42
45
  ## When to Stop and Ask for Help
43
46
 
@@ -68,4 +71,6 @@ After all tasks complete and verified:
68
71
 
69
72
  **Required workflow skills:**
70
73
  - **loopx:plan** - Creates the plan this skill executes
74
+ - **loopx:final-review** - Final whole-feature runtime and integration risk review
75
+ - **loopx:fix-review** - Handles final-review feedback before finish
71
76
  - **loopx:finish** - Complete development after all tasks
@@ -3,7 +3,7 @@ name: final-review
3
3
  description: "Performs whole-feature review after implementation and staged task review. Not for per-task review, unresolved scope, implementation, or pure documentation polish."
4
4
  when_to_use: "final-review, final code review, whole feature review, integration review, pre-finish review, after subagent-exec, runtime risk review, 最终评审"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Final Review
@@ -3,7 +3,7 @@ name: finish
3
3
  description: "Finishes completed loopx development work after tests pass by presenting merge, PR, keep, or discard options. Not for unfinished work or failing verification."
4
4
  when_to_use: "implementation complete, tests pass, finish branch, create pull request, merge locally, keep branch, discard work"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Finish
@@ -3,7 +3,7 @@ name: fix-review
3
3
  description: "Handles received code review feedback with verification, technical evaluation, pushback, and one-item-at-a-time fixes. Not for requesting a new review or implementing unrelated changes."
4
4
  when_to_use: "fix-review, received code review feedback, review comments, reviewer suggestions, requested changes, 处理评审意见"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Fix Review
@@ -3,7 +3,7 @@ name: go-style
3
3
  description: "Applies loopx Go coding style for .go edits, tests, errors, context, naming, and interface boundaries. Not for non-Go code or Kratos-specific architecture by itself."
4
4
  when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Go Style
@@ -59,7 +59,13 @@ Choose the one already used in the codebase.
59
59
 
60
60
  - Exported symbols should have Go doc comments that start with the symbol name.
61
61
  - Short local comments are acceptable when they explain why, not what.
62
- - Prefer complete sentences for package, exported type, exported function, and non-obvious behavior comments.
62
+ - Prefer complete sentences for package, exported type, exported function, exported method, and non-obvious behavior comments.
63
+ - Match new comments to the user's requested language. If the user asks in Chinese or explicitly requests Chinese comments, write new comments in Chinese while preserving Go doc naming conventions such as `// UserService ...` and `// CreateUser ...`.
64
+ - Do not translate existing comments unless the user explicitly asks for translation; preserve the surrounding file's established comment language when no user preference is stated.
65
+ - Remove comments that only restate syntax, names, or immediately obvious control flow.
66
+ - Add comments for non-obvious business rules, ordering constraints, compatibility behavior, concurrency assumptions, performance tradeoffs, and external API quirks.
67
+ - Check nearby existing comments when behavior changes; stale comments are worse than missing comments.
68
+ - Prefer clearer names, smaller functions, or stronger types over comments that explain avoidable confusion.
63
69
 
64
70
  ## Verification
65
71
 
@@ -3,7 +3,7 @@ name: kratos
3
3
  description: "Supports Go-Kratos microservices, proto/buf APIs, service/biz/data layers, middleware, auth, config, and troubleshooting. Not for generic Go style alone."
4
4
  when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Kratos
@@ -3,7 +3,7 @@ name: plan
3
3
  description: "Creates bite-sized implementation plans from approved requirements, clarify output, or design specs with exact files, tests, commands, expected output, and execution handoff. Not for unresolved requirements, design decisions, PRD generation, or code changes."
4
4
  when_to_use: "plan, implementation plan, execution plan, task breakdown, approved requirements, approved design spec, docs/loopx/design, 实施计划, 执行计划, 任务拆分"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  argument-hint: "<design spec path or feature name>"
8
8
  ---
9
9
 
@@ -156,13 +156,13 @@ Plan complete and saved to `docs/loopx/plans/<filename>.md`.
156
156
 
157
157
  Two execution options:
158
158
 
159
- 1. Subagent-Driven (recommended) - dispatch a fresh subagent per task, review between tasks, fast iteration
159
+ 1. Subagent Exec (recommended) - dispatch a fresh subagent per task, review between tasks, fast iteration
160
160
  2. Inline Execution - execute tasks in this session using exec, batch execution with checkpoints
161
161
 
162
162
  Which approach?
163
163
  ```
164
164
 
165
- If Subagent-Driven is chosen:
165
+ If Subagent Exec is chosen:
166
166
 
167
167
  - REQUIRED SUB-SKILL: Use `loopx:subagent-exec`
168
168
  - Fresh subagent per task plus two-stage review
@@ -3,7 +3,7 @@ name: refactor-plan
3
3
  description: "Creates a behavior-preserving refactor plan with user interview, repo evidence, tiny commits, scope boundaries, and testing decisions. Not for feature changes or immediate implementation."
4
4
  when_to_use: "refactor-plan, refactor request, refactoring RFC, tiny commits, behavior-preserving cleanup, architecture cleanup, 重构计划"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.
@@ -3,7 +3,7 @@ name: review
3
3
  description: "Dispatches a loopx code reviewer subagent against a concrete git range and requirements. Not for implementation, planning, or unresolved review scope."
4
4
  when_to_use: "request code review, completed task review, major feature review, pre-merge review, subagent code quality check"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Review
@@ -3,7 +3,7 @@ name: spec
3
3
  description: "Writes software design specs from already-clarified requirements, including solution approach, architecture outline, detailed design, tradeoffs, verification design, and handoff context. Not for unresolved requirements, PRD generation, implementation task planning, or code changes."
4
4
  when_to_use: "spec, design spec, technical design, design proposal, detailed design, architecture design, 设计方案, 概要设计, 详细设计, 技术方案"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # loopx Spec
@@ -3,7 +3,7 @@ name: subagent-exec
3
3
  description: "Executes approved loopx implementation plans with fresh subagents per independent task and staged review. Not for planning, unclear requirements, or tightly coupled edits."
4
4
  when_to_use: "approved implementation plan, independent tasks, subagent execution, staged spec review, code quality review, parallel-capable execution"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Subagent Exec
@@ -1,3 +1,3 @@
1
1
  interface:
2
- display_name: "Subagent-Driven Development"
3
- short_description: "Execute implementation plans with staged subagent reviews"
2
+ display_name: "Subagent Exec"
3
+ short_description: "Execute loopx plans with staged subagent reviews"
@@ -17,7 +17,7 @@ Use this reference before executing this skill in Codex.
17
17
 
18
18
  Subagent dispatch requires Codex multi-agent support. If `spawn_agent`,
19
19
  `wait_agent`, or `close_agent` are unavailable, do not pretend this skill ran
20
- as subagent-driven development. Use `loopx:exec` instead.
20
+ as subagent-exec. Use `loopx:exec` instead.
21
21
 
22
22
  Codex environments that require explicit feature flags should enable:
23
23
 
@@ -3,7 +3,7 @@ name: tdd
3
3
  description: "Guides feature and bugfix implementation through a failing test before production code and red-green-refactor discipline. Not for generated files or throwaway prototypes."
4
4
  when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Test-Driven Development (TDD)
@@ -3,7 +3,7 @@ name: verify
3
3
  description: "Requires fresh verification evidence before claiming work is complete, fixed, passing, review-ready, or ready to commit. Not for speculative confidence or stale results."
4
4
  when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Verification Before Completion
@@ -73,7 +73,7 @@ export function evaluateBuildStopGate(state) {
73
73
  const delegationCount = Number.isFinite(Number(state.active_delegation_count)) ? Number(state.active_delegation_count) : null;
74
74
  const delegationText = delegationCount !== null ? ` active delegations=${delegationCount}.` : '';
75
75
  const auditText = state.completion_audit_status ? ` completion audit: ${state.completion_audit_status}.` : '';
76
- const nextAction = state.next_action ? ` next action: ${state.next_action}` : ' next action: continue the contract-covered next step in $build.';
76
+ const nextAction = state.next_action ? ` next action: ${state.next_action}` : ' next action: continue the contract-covered loopx build step.';
77
77
  const completionSignal = state.completion_signal ? ` completion signal: ${state.completion_signal}` : ' completion signal: review handoff readiness, a real blocker, user stop, or a return to plan/clarify.';
78
78
  return {
79
79
  allow: false,
package/src/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import { createInterface } from 'node:readline/promises';
6
6
  import { archiveStage, autopilotStage, approveStage, buildStage, clarifyStage, initWorkspace, planStage, reviewStage, statusSummary } from './workflow.mjs';
7
7
  import { renderHtmlViews } from './html-views.mjs';
8
8
  import { installBundledSkills, installSkillsForTargets } from './install-discovery.mjs';
9
- import { nextSkillCommand, withNextSkill } from './next-skill.mjs';
9
+ import { nextCliCommand, nextSkillCommand, withNextSkill } from './next-skill.mjs';
10
10
  import { doctorRuntime, migrateLegacyRuntime } from './runtime-maintenance.mjs';
11
11
  import { setupWorkspaceContext } from './workspace-context.mjs';
12
12
 
@@ -178,6 +178,10 @@ function printHumanStatus(status) {
178
178
  if (nextSkill) {
179
179
  console.log(`next skill: ${nextSkill}`);
180
180
  }
181
+ const nextCli = nextCliCommand(status.state);
182
+ if (nextCli) {
183
+ console.log(`next cli: ${nextCli}`);
184
+ }
181
185
  console.log(`next: ${status.next_action}`);
182
186
  }
183
187
 
@@ -28,21 +28,10 @@ const LOOPX_SKILLS = [
28
28
  'debug',
29
29
  'tdd',
30
30
  'verify',
31
+ 'doc-readability',
31
32
  'go-style',
32
33
  'kratos',
33
34
  ];
34
- const LOOPX_LEGACY_SKILLS = [
35
- 'build',
36
- 'autopilot',
37
- 'archive',
38
- 'writing-plans',
39
- 'executing-plans',
40
- 'subagent-driven-development',
41
- 'requesting-code-review',
42
- 'receiving-code-review',
43
- 'finishing-a-development-branch',
44
- 'request-refactor-plan',
45
- ];
46
35
  const LOOPX_INSTALLATION_IDENTITY = 'loopx';
47
36
  const LOOPX_MANAGED_SCRIPT_ITEMS = [
48
37
  {
@@ -453,20 +442,6 @@ async function removeStaleOwnedInstall(currentRow) {
453
442
  await removeInstalledSkill(currentRow.installedPath);
454
443
  }
455
444
 
456
- async function pruneLegacyLoopxOwnedSkills(nextData, env = process.env) {
457
- const pruned = [];
458
- for (const skillName of LOOPX_LEGACY_SKILLS) {
459
- const row = nextData.skills?.[skillName];
460
- if (!isLoopxOwnedIdentity(skillName, row, env)) {
461
- continue;
462
- }
463
- await removeStaleOwnedInstall(row);
464
- delete nextData.skills[skillName];
465
- pruned.push({ skillName, installedPath: row.installedPath });
466
- }
467
- return pruned;
468
- }
469
-
470
445
  async function removeInstalledFile(path) {
471
446
  if (!existsSync(path)) {
472
447
  return;
@@ -668,7 +643,6 @@ export async function installBundledSkills(env = process.env, options = {}) {
668
643
  const nextData = jsonClone(data);
669
644
  nextData.version = nextData.version || 3;
670
645
  nextData.skills = nextData.skills || {};
671
- const pruned = await pruneLegacyLoopxOwnedSkills(nextData, env);
672
646
  const baselinePath = getTemplateBaselinePath(env);
673
647
  const existingBaseline = await readTemplateBaseline(baselinePath);
674
648
  const baselineItemsByPath = new Map((existingBaseline?.items || []).map((item) => [templateItemKey(item), item]));
@@ -767,7 +741,6 @@ export async function installBundledSkills(env = process.env, options = {}) {
767
741
  installed,
768
742
  conflicts,
769
743
  skipped,
770
- pruned,
771
744
  templateGovernance,
772
745
  inspection: await inspectInstallState(env),
773
746
  };
@@ -2,7 +2,6 @@ export function nextSkillCommand(state) {
2
2
  if (!state || !state.slug) {
3
3
  return null;
4
4
  }
5
- const reviewBuildCommand = `$build --from-review .loopx/workflows/${state.slug}/review-report.md`;
6
5
  if (state.current_stage === 'clarify'
7
6
  && state.clarify_current_round > 0
8
7
  && state.unresolved_ambiguity_count === 0
@@ -28,7 +27,7 @@ export function nextSkillCommand(state) {
28
27
  return null;
29
28
  }
30
29
  if (state.current_stage === 'plan' && Array.isArray(state.plan_blockers) && state.plan_blockers.length === 0) {
31
- return `$build .loopx/plans/requirements-snapshot-${state.slug}.md`;
30
+ return `$subagent-exec .loopx/plans/requirements-snapshot-${state.slug}.md`;
32
31
  }
33
32
  if (state.current_stage === 'build'
34
33
  && state.stage_status === 'awaiting-approval'
@@ -48,13 +47,13 @@ export function nextSkillCommand(state) {
48
47
  || state.approval?.build === 'requested'
49
48
  || state.approval?.build === 'approved'
50
49
  )) {
51
- return reviewBuildCommand;
50
+ return null;
52
51
  }
53
52
  if (state.current_stage === 'review'
54
53
  && state.review_verdict === 'request-changes'
55
54
  && state.requested_transition === 'review->build'
56
55
  && state.approval?.build === 'approved') {
57
- return reviewBuildCommand;
56
+ return null;
58
57
  }
59
58
  if (state.current_stage === 'review'
60
59
  && state.review_verdict === 'request-changes'
@@ -71,20 +70,62 @@ export function nextSkillCommand(state) {
71
70
  return null;
72
71
  }
73
72
 
73
+ export function nextCliCommand(state) {
74
+ if (!state || !state.slug) {
75
+ return null;
76
+ }
77
+ if (state.stage_status === 'awaiting-approval'
78
+ && state.current_stage === 'plan'
79
+ && Array.isArray(state.plan_blockers)
80
+ && state.plan_blockers.length === 0) {
81
+ return `loopx build .loopx/plans/requirements-snapshot-${state.slug}.md`;
82
+ }
83
+ if (state.current_stage === 'review'
84
+ && state.review_verdict === 'request-changes'
85
+ && state.rollback_target === 'build'
86
+ && (
87
+ state.pending_user_decision === 'review->build'
88
+ || state.requested_transition === 'review->build'
89
+ || state.approval?.build === 'requested'
90
+ || state.approval?.build === 'approved'
91
+ )) {
92
+ return `loopx build --from-review .loopx/workflows/${state.slug}/review-report.md`;
93
+ }
94
+ if (state.current_stage === 'review'
95
+ && state.review_verdict === 'request-changes'
96
+ && state.requested_transition === 'review->build'
97
+ && state.approval?.build === 'approved') {
98
+ return `loopx build --from-review .loopx/workflows/${state.slug}/review-report.md`;
99
+ }
100
+ return null;
101
+ }
102
+
74
103
  export function nextSkillHint(state) {
75
104
  const command = nextSkillCommand(state);
76
105
  if (!command) {
77
106
  return null;
78
107
  }
79
- return `Next: ${command}`;
108
+ return `Next skill: ${command}`;
109
+ }
110
+
111
+ export function nextCliHint(state) {
112
+ const command = nextCliCommand(state);
113
+ if (!command) {
114
+ return null;
115
+ }
116
+ return `Next CLI: ${command}`;
80
117
  }
81
118
 
82
119
  export function withNextSkill(payload, state) {
83
120
  const nextCommand = nextSkillCommand(state);
84
121
  const nextHint = nextSkillHint(state);
122
+ const cliCommand = nextCliCommand(state);
123
+ const cliHint = nextCliHint(state);
85
124
  return {
86
125
  ...payload,
87
126
  next_skill_command: nextCommand,
88
127
  next_skill_hint: nextHint,
128
+ next_cli_command: cliCommand,
129
+ next_cli_hint: cliHint,
89
130
  };
90
131
  }