@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
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  Recommended v1 flow:
16
16
 
17
17
  ```text
18
- clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
18
+ clarify -> spec? -> plan -> (subagent-exec | exec) -> final-review -> fix-review? -> finish
19
19
  ```
20
20
 
21
21
  `spec` is conditional. Use it when API, data, state, permission, migration, compatibility, product behavior, or architecture decisions must be fixed before planning. Skip it when the remaining work is local implementation choice.
@@ -32,10 +32,13 @@ Core workflow skills:
32
32
  - `subagent-exec`: execute an approved plan with fresh subagents and staged review.
33
33
  - `exec`: execute an approved plan inline when subagents are unavailable or not desired.
34
34
  - `review`: request independent code review against a git range and plan or requirements.
35
+ - `final-review`: review the completed feature for runtime, integration, and test-gap risk before finishing.
35
36
  - `fix-review`: evaluate and implement code review feedback rigorously.
36
37
  - `finish`: verify and choose merge, PR, keep, or discard.
37
38
  - `refactor-plan`: interview and write a behavior-preserving refactor plan with tiny commits.
38
39
 
40
+ `review` and its matching `fix-review` run inside `subagent-exec` or `exec` as task/checkpoint review loops. `final-review` is the top-level whole-feature review before `finish`, and its feedback also goes through `fix-review`.
41
+
39
42
  Support skills:
40
43
 
41
44
  - `tdd`
@@ -56,6 +59,8 @@ For the v1 skill-suite workflow, human-maintained artifacts live under `docs/loo
56
59
 
57
60
  `finish` may generate spec candidates in `docs/loopx/specs/` when completed work produces stable team rules. These candidates are repo-tracked and must remain visible in the git diff.
58
61
 
62
+ `finish` is the terminal completion step for one implementation decision. Rerun it only after keep-as-is, PR iteration, interruption before executing a choice, or new changes after review feedback. Do not rerun it after merge or discard.
63
+
59
64
  Generated support state, hook diagnostics, installer metadata, HTML views, manifests, and runtime JSON remain under `.loopx/`.
60
65
 
61
66
  Local agent memory lives under `.loopx/memory/`:
package/README.zh-CN.md CHANGED
@@ -15,7 +15,7 @@
15
15
  推荐 v1 流程:
16
16
 
17
17
  ```text
18
- clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
18
+ clarify -> spec? -> plan -> (subagent-exec | exec) -> final-review -> fix-review? -> finish
19
19
  ```
20
20
 
21
21
  `spec` 是条件设计门。涉及 API、数据、状态、权限、迁移、兼容、产品行为或架构决策时使用;只剩局部实现选择时可以跳过,直接进入 `plan`。
@@ -32,10 +32,13 @@ clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> fin
32
32
  - `subagent-exec`:用 fresh subagents 和 staged review 执行已批准计划。
33
33
  - `exec`:没有 subagent 或用户选择 inline 时顺序执行计划。
34
34
  - `review`:基于 git range 和计划/需求发起独立代码评审。
35
+ - `final-review`:在收尾前对完整 feature 做运行时、集成和测试缺口风险评审。
35
36
  - `fix-review`:严谨评估并处理 code review feedback。
36
37
  - `finish`:验证完成后选择 merge、PR、保留或丢弃。
37
38
  - `refactor-plan`:访谈并写行为保持的 tiny-commit 重构计划。
38
39
 
40
+ `review` 和对应的 `fix-review` 在 `subagent-exec` 或 `exec` 内部作为 task/checkpoint review loop 运行。`final-review` 是 `finish` 前的顶层 whole-feature review,它的反馈也通过 `fix-review` 处理。
41
+
39
42
  辅助 skills:
40
43
 
41
44
  - `tdd`
@@ -56,6 +59,8 @@ v1 skill-suite 工作流的人工维护长期产物放在 `docs/loopx/`:
56
59
 
57
60
  当完成的工作产生稳定团队规则时,`finish` 可以在 `docs/loopx/specs/` 生成 spec candidates。这些候选是 repo-tracked,必须保留在 git diff 中供审阅。
58
61
 
62
+ `finish` 是一次 implementation decision 的终端完成步骤。只有在上次选择保留、PR 迭代、执行选择前中断,或 review feedback 后出现新变更时才重新执行;merge 或 discard 后不要重复执行。
63
+
59
64
  生成的支撑状态、hook 诊断、安装元数据、HTML views、manifests 和 runtime JSON 仍放在 `.loopx/` 下。
60
65
 
61
66
  本地 agent memory 放在 `.loopx/memory/`:
@@ -14,6 +14,7 @@ The v1 product surface is the installed and governed bundled skill suite:
14
14
  - `subagent-exec`
15
15
  - `exec`
16
16
  - `review`
17
+ - `final-review`
17
18
  - `fix-review`
18
19
  - `finish`
19
20
  - `refactor-plan`
@@ -32,16 +33,16 @@ The repository may retain auxiliary or compatibility skill source directories fo
32
33
  Recommended flow:
33
34
 
34
35
  ```text
35
- clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
36
+ clarify -> spec? -> plan -> (subagent-exec | exec) -> final-review -> fix-review? -> finish
36
37
  ```
37
38
 
38
39
  `spec` is a conditional design gate. `clarify` may route directly to `plan` when the remaining questions are local implementation choices. It routes to `spec` when product behavior, APIs, state, data, permissions, migration, compatibility, or architecture decisions need to be fixed before implementation planning.
39
40
 
40
41
  `plan` is the superpowers `writing-plans` workflow under the loopx name. It writes executable plans and offers two execution options: `subagent-exec` recommended, or `exec` inline.
41
42
 
42
- `review` is the superpowers `requesting-code-review` workflow under the loopx name. `fix-review` is the superpowers `receiving-code-review` workflow under the loopx name.
43
+ `review` is the task or checkpoint code review workflow inside `subagent-exec` or `exec`. `final-review` is the top-level whole-feature runtime, integration, and test-gap review before completion. `fix-review` handles feedback from either review layer.
43
44
 
44
- `finish` verifies completion, extracts local memory, proposes repo-tracked spec candidates when stable team rules emerged, then presents merge, PR, keep, or discard options.
45
+ `finish` verifies completion, extracts local memory, proposes repo-tracked spec candidates when stable team rules emerged, then presents merge, PR, keep, or discard options. It is the terminal completion step for one implementation decision; rerun it only after keep-as-is, PR iteration, interruption before choice execution, or new changes after review feedback. Do not rerun it after merge or discard.
45
46
 
46
47
  ## Artifacts
47
48
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-content-space/loopx",
3
3
  "type": "module",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "description": "Skill-first workflow suite for agentic coding assistants",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopx",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Skill-first workflow suite for agentic coding assistants",
5
5
  "skills": "./skills/",
6
6
  "interface": {
@@ -3,7 +3,7 @@ name: clarify
3
3
  description: "Grills ambiguous loopx work until material questions are answered, then routes to spec or plan using a design gate. Not for clear implementation tasks, approved specs, or code changes."
4
4
  when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # loopx Clarify
@@ -3,7 +3,7 @@ name: debug
3
3
  description: "Finds root cause for bugs, failing tests, build failures, regressions, and unexpected behavior before fixes. Not for new feature planning or routine code review."
4
4
  when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
5
5
  metadata:
6
- version: "0.2.2"
6
+ version: "0.2.4"
7
7
  ---
8
8
 
9
9
  # Systematic Debugging
@@ -0,0 +1,222 @@
1
+ ---
2
+ name: doc-readability
3
+ description: "Use when evaluating, rewriting, or editing documents for human readability, unclear viewpoints, AI-like prose, bloated specs, PRDs, requirements docs, meeting notes, strategy docs, or internal knowledge-base articles. Not for code review, implementation planning, or file-format conversion."
4
+ when_to_use: "document readability, PRD assessment, requirements gaps, AI-like prose, unclear viewpoint, rewrite docs, editing docs, 文档可读性, 去AI味, 需求文档评估"
5
+ metadata:
6
+ version: "0.2.4"
7
+ ---
8
+
9
+ # Doc Readability
10
+
11
+ ## Principle
12
+
13
+ Readable documents help a specific reader make a decision, execute work, or verify a claim with minimal reconstruction. Do not confuse readability with shortness or smooth prose. Preserve factual meaning, domain vocabulary, and useful specificity while removing noise.
14
+
15
+ ## First Move
16
+
17
+ Read the actual document before judging it. If the document is a URL, cloud doc, wiki page, local file, PDF, or exported artifact, fetch or read the content with the appropriate available tool. If only an excerpt is provided, state that the assessment is based on the excerpt.
18
+
19
+ Start by inferring:
20
+
21
+ | Question | Why it matters |
22
+ |---|---|
23
+ | Who is the reader? | Reviewers, engineers, operators, executives, and future maintainers need different structures. |
24
+ | What job must the document do? | PRDs, engineering specs, SOPs, decision memos, and general notes have different standards. |
25
+ | What is the main claim? | If the claim is hard to state in one sentence, the document likely has a structure problem. |
26
+ | What action should follow? | Readability is poor when the reader cannot tell what to do next. |
27
+
28
+ If these are clear from the request and document, use them to make a recommendation. The document type still needs user confirmation unless the user explicitly asks for a quick assessment or says to use judgment.
29
+
30
+ ## Setup Flow
31
+
32
+ User choices override inference. Support explicit inputs such as:
33
+
34
+ ```text
35
+ Document type: engineering spec
36
+ Reader: engineering reviewers
37
+ Mode: assessment only
38
+ Strictness: review-ready
39
+ ```
40
+
41
+ Do not turn setup into a form. Use this order:
42
+
43
+ 1. Confirm document type first. If the user has not explicitly specified document type, ask Step 1 before evaluating. Do not proceed based only on inference.
44
+ 2. If the document appears to mix multiple types, ask which lens should be primary. Do not silently choose the primary type.
45
+ 3. After document type is chosen, read enough of the document to judge its actual condition: title, headings, first screen, conclusion, and key sections. For long documents, sample the main path and high-risk sections.
46
+ 4. Only after reading the document may the agent recommend an action mode. Do not recommend assessment-only, targeted suggestions, or rewrite before reading the document.
47
+ 5. Recommendations must be dynamic, based on the user request, chosen document type, document content, headings, visible structure, and previous user choices.
48
+ 6. Do not hard-code a default recommendation in the skill.
49
+ 7. If the user says "quick assessment", "use your judgment", "don't ask", or equivalent, proceed with inference and state assumptions.
50
+
51
+ Ask setup questions sequentially:
52
+
53
+ ```text
54
+ I want to confirm the document type. Based on the title and headings, I would treat this as "...", because ...
55
+
56
+ Which document type should I use?
57
+ 1. Engineering spec / interface contract / rules document
58
+ 2. Requirements document / PRD
59
+ 3. Engineering design document
60
+ 4. SOP / operating procedure
61
+ 5. Decision memo
62
+ 6. Research / analysis document
63
+ 7. Meeting notes / discussion record
64
+ 8. Postmortem / RCA
65
+ 9. Project plan / roadmap
66
+ 10. General note / knowledge-base article
67
+ ```
68
+
69
+ After the user chooses the type, read the document. Then decide whether action mode needs confirmation:
70
+
71
+ ```text
72
+ I have read the document's main path. Given the chosen type and the document's actual condition, I recommend "...", because ...
73
+
74
+ How should I handle it?
75
+ 1. Assessment only
76
+ 2. Assessment plus targeted improvement suggestions
77
+ 3. Assessment, then rewrite only if there are blocking issues
78
+ 4. Rewrite directly
79
+ ```
80
+
81
+ Ask strictness only when it would change the result:
82
+
83
+ ```text
84
+ Strictness will affect this assessment. I recommend "...", because ...
85
+
86
+ Which strictness should I use?
87
+ 1. Usable for internal handoff
88
+ 2. Review-ready
89
+ 3. Publication-ready
90
+ ```
91
+
92
+ If strictness is not worth asking, choose a sensible default and state it briefly.
93
+
94
+ When the confirmed document type is `Requirements document / PRD`, read `references/prd.md` before assessment or rewrite. Use it to check requirement completeness and testability, not just prose clarity.
95
+
96
+ ## Document Types
97
+
98
+ Use the document type to set the evaluation bar.
99
+
100
+ | Type | Readability standard |
101
+ |---|---|
102
+ | Requirements / PRD | Reader can identify problem, users, goals, non-goals, scope, workflows, requirements, acceptance criteria, priorities, and open questions. Also read `references/prd.md` for PRD-specific completeness checks. |
103
+ | Engineering design | Reader can identify context, proposed design, key decisions, rejected alternatives, contracts, data flow, failure modes, rollout, and boundaries. |
104
+ | Engineering spec / interface contract / rules document | Reader can identify the first-screen conclusion, main decision path, canonical rules, field/status definitions, and where details live. Long tables, enum lists, field contracts, state tables, and long sections are acceptable when they are locatable and support implementation. Judge clarity of path and lookup, not shortness. |
105
+ | SOP / operating procedure | Reader can identify trigger, owner, prerequisites, step order, checks, exceptions, and escalation path. |
106
+ | Decision memo | Reader can identify recommendation, rationale, tradeoffs, risks, decision owner, and next action. |
107
+ | Research / analysis | Reader can identify question, method, evidence, conclusion, confidence, limitations, and implications. |
108
+ | Meeting notes / discussion record | Reader can identify decisions, unresolved questions, owners, due dates, and context needed later. |
109
+ | Postmortem / RCA | Reader can identify impact, timeline, root cause, contributing factors, fixes, owners, and prevention checks. |
110
+ | Project plan / roadmap | Reader can identify objective, milestones, dependencies, owners, risks, dates, and decision points. |
111
+ | General note / knowledge-base article | Reader can identify topic, takeaway, section map, and why each section exists. |
112
+
113
+ If a document mixes types, name the primary and secondary type. Judge the primary reading path first; suggest moving secondary material to an appendix or companion doc only when it interferes with the main job.
114
+
115
+ ## Diagnostic Rubric
116
+
117
+ Evaluate across these dimensions:
118
+
119
+ | Dimension | Good | Poor |
120
+ |---|---|---|
121
+ | Viewpoint | The document makes defensible claims and repeats them consistently. | It lists related facts without choosing what matters. |
122
+ | Reader path | The reader can predict where conclusions, rules, examples, and details live. | Background, rules, fields, cases, and tasks are mixed together. |
123
+ | Information hierarchy | Important decisions appear first; details support them. | Long tables and sections force the reader to synthesize conclusions manually. |
124
+ | Actionability | Owners, timing, inputs, outputs, states, and exceptions are concrete. | Sentences say "support", "process", "handle", or "optimize" without operational meaning. |
125
+ | Density | Each paragraph changes what the reader knows or can do. | Repeated sentence frames and generic transitions create drag. |
126
+ | Boundary clarity | Scope, non-goals, risks, blockers, and "not automatic" rules are explicit. | Boundaries are scattered, softened, or buried after implementation detail. |
127
+ | Human voice | The prose shows judgment, tradeoffs, and emphasis. | The prose is neutral, padded, symmetric, and unwilling to choose. |
128
+
129
+ Lead with a practical verdict in the user's language: `Readable`, `Partly readable`, or `Hard to read`.
130
+
131
+ Separate findings by severity:
132
+
133
+ | Severity | Meaning |
134
+ |---|---|
135
+ | Blocking | The target reader cannot understand the conclusion, decision path, required action, or authoritative rule. This usually requires restructuring or rewriting. |
136
+ | Important | The document is usable, but readers will waste time or may implement inconsistently. Recommend focused changes. |
137
+ | Optional | The document can be improved, but the issue does not block review or execution. Do not present optional polish as readability failure. |
138
+
139
+ For an already rewritten or structured document, use this severity split instead of listing every possible flaw as a main obstacle.
140
+
141
+ ## AI-Like Smells
142
+
143
+ Treat these as signals to tighten or restructure:
144
+
145
+ - Broad openings like "This document is used to..." without a decision.
146
+ - Repeated section patterns that say the same thing for every case.
147
+ - Tables whose cells are long paragraphs.
148
+ - Grammatically parallel bullets that are not intellectually prioritized.
149
+ - Generic terms like `support`, `process`, `optimize`, `capability`, `workflow`, `closed loop`, `improve`, `ensure`.
150
+ - Every section ending with "notes" that restate prior content.
151
+ - Long chains of "need to / can / generate / receive / process" without owner, timing, or output.
152
+ - Balanced summaries that avoid saying "do this", "do not do this", or "this is the rule".
153
+
154
+ Do not remove domain terms merely because they are technical. Remove vagueness, not expertise.
155
+
156
+ ## Rewrite Strategy
157
+
158
+ Choose structure by document job:
159
+
160
+ | Job | Preferred shape |
161
+ |---|---|
162
+ | Requirements / PRD | Problem -> users -> goals/non-goals -> scope -> workflows -> requirements -> acceptance criteria -> open questions |
163
+ | Engineering design | Context -> decision -> architecture -> alternatives -> contracts -> data flow -> failure modes -> rollout |
164
+ | Engineering spec / contract / rules | Conclusion -> hard rules -> decision path -> canonical definitions -> field/status contracts -> examples -> appendix |
165
+ | SOP | Trigger -> owner -> prerequisites -> steps -> checks -> exceptions -> escalation |
166
+ | Decision memo | Verdict -> decisions -> tradeoffs -> risks -> next action -> appendix |
167
+ | Research / analysis | Question -> method -> evidence -> findings -> confidence -> limitations -> implications |
168
+ | Meeting notes | Context -> decisions -> action items -> open questions -> reference notes |
169
+ | Postmortem / RCA | Impact -> timeline -> root cause -> contributing factors -> fixes -> prevention |
170
+ | General note / KB | Orientation -> key takeaway -> section map -> details |
171
+
172
+ For long documents, do not polish in place first. Extract the spine:
173
+
174
+ 1. One-sentence main claim.
175
+ 2. Three to seven decisions or rules.
176
+ 3. Who owns each action.
177
+ 4. Which details belong in appendix/reference.
178
+ 5. Which repeated sections can share one template.
179
+
180
+ Then rewrite only within the user-approved action mode.
181
+
182
+ ## Output Rules
183
+
184
+ Match the user's requested mode. Use natural headings in the user's language. Do not expose rigid labels like `Main claim I extracted`, `Main reading obstacles`, or `Rewritten version` unless the user asks for a machine-readable template.
185
+
186
+ For assessment, cover:
187
+
188
+ - Chosen or inferred setup.
189
+ - Readability verdict.
190
+ - Core viewpoint extracted from the document.
191
+ - Blocking issues, important improvements, and optional polish.
192
+ - Whether rewrite is recommended.
193
+
194
+ Rewrite control:
195
+
196
+ - If mode is `assessment only`, do not output a rewritten version. State whether rewrite is recommended.
197
+ - If mode is `assessment plus targeted suggestions`, provide focused changes, not a full rewrite.
198
+ - If mode is `rewrite only if blocking`, provide a rewritten version only when blocking issues exist.
199
+ - If mode is `rewrite directly`, rewrite directly with a short diagnosis first.
200
+ - For long documents, rewrite the most important section first unless the user explicitly asks for the full document.
201
+
202
+ ## Editing Rules
203
+
204
+ - Lead with conclusions and rules before explanation.
205
+ - Prefer prose over a table when table cells become paragraphs.
206
+ - Split source-of-truth rules from implementation details.
207
+ - Make negative rules explicit: "do not auto-post cash", "do not rewrite historical trades", "do not send Plan before confirmation".
208
+ - Replace repeated prose with one shared rule plus event-specific exceptions.
209
+ - Keep strong domain nouns, exact dates, fields, statuses, and enumerations.
210
+ - Preserve real uncertainty, but name what is unknown and who resolves it.
211
+ - Remove performative transitions unless they add structure.
212
+ - Do not make formal documents chatty. Human writing means judgment and economy, not casual tone.
213
+
214
+ ## Final Check
215
+
216
+ Before claiming the document is improved, verify:
217
+
218
+ - The main claim is visible in the first screen or first section.
219
+ - A new reader can state the next action after reading the conclusion.
220
+ - Repeated content has been collapsed or justified.
221
+ - Boundaries and non-goals are not buried.
222
+ - Any removed text was redundant, not a lost requirement.
@@ -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