@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
@@ -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
@@ -31,7 +31,6 @@ function nextSkill(state) {
31
31
  if (!state || !state.slug) {
32
32
  return null;
33
33
  }
34
- const reviewBuildCommand = `$build --from-review .loopx/workflows/${state.slug}/review-report.md`;
35
34
  if (isClarifyReadyForPlan(state)) {
36
35
  return `$plan ${state.slug}`;
37
36
  }
@@ -51,7 +50,7 @@ function nextSkill(state) {
51
50
  && state.current_stage === 'plan'
52
51
  && Array.isArray(state.plan_blockers)
53
52
  && state.plan_blockers.length === 0) {
54
- return `$build .loopx/plans/requirements-snapshot-${state.slug}.md`;
53
+ return `$subagent-exec .loopx/plans/requirements-snapshot-${state.slug}.md`;
55
54
  }
56
55
  if (state.current_stage === 'build'
57
56
  && state.stage_status === 'awaiting-approval'
@@ -71,13 +70,13 @@ function nextSkill(state) {
71
70
  || state.approval?.build === 'requested'
72
71
  || state.approval?.build === 'approved'
73
72
  )) {
74
- return reviewBuildCommand;
73
+ return null;
75
74
  }
76
75
  if (state.current_stage === 'review'
77
76
  && state.review_verdict === 'request-changes'
78
77
  && state.requested_transition === 'review->build'
79
78
  && state.approval?.build === 'approved') {
80
- return reviewBuildCommand;
79
+ return null;
81
80
  }
82
81
  if (state.current_stage === 'review'
83
82
  && state.review_verdict === 'request-changes'
@@ -94,6 +93,36 @@ function nextSkill(state) {
94
93
  return null;
95
94
  }
96
95
 
96
+ function nextCli(state) {
97
+ if (!state || !state.slug) {
98
+ return null;
99
+ }
100
+ if (state.stage_status === 'awaiting-approval'
101
+ && state.current_stage === 'plan'
102
+ && Array.isArray(state.plan_blockers)
103
+ && state.plan_blockers.length === 0) {
104
+ return `loopx build .loopx/plans/requirements-snapshot-${state.slug}.md`;
105
+ }
106
+ if (state.current_stage === 'review'
107
+ && state.review_verdict === 'request-changes'
108
+ && state.rollback_target === 'build'
109
+ && (
110
+ state.pending_user_decision === 'review->build'
111
+ || state.requested_transition === 'review->build'
112
+ || state.approval?.build === 'requested'
113
+ || state.approval?.build === 'approved'
114
+ )) {
115
+ return `loopx build --from-review .loopx/workflows/${state.slug}/review-report.md`;
116
+ }
117
+ if (state.current_stage === 'review'
118
+ && state.review_verdict === 'request-changes'
119
+ && state.requested_transition === 'review->build'
120
+ && state.approval?.build === 'approved') {
121
+ return `loopx build --from-review .loopx/workflows/${state.slug}/review-report.md`;
122
+ }
123
+ return null;
124
+ }
125
+
97
126
  function blockers(state) {
98
127
  const values = [
99
128
  ...(Array.isArray(state.plan_blockers) ? state.plan_blockers : []),
@@ -134,7 +163,7 @@ function nextActionLine(state, workflow) {
134
163
  if (isClarifyReadyForPlan(state) && state.approval?.plan !== 'approved') {
135
164
  return `approve clarify -> plan, then $plan ${state.slug || workflow}`;
136
165
  }
137
- return nextSkill(state) || state.recommended_next_action || 'none';
166
+ return nextSkill(state) || nextCli(state) || state.recommended_next_action || 'none';
138
167
  }
139
168
 
140
169
  function implementationGateLines(state) {
@@ -228,6 +257,8 @@ try {
228
257
  `loopx workflow: ${state.slug || workflow}`,
229
258
  `stage: ${stageText(state)}`,
230
259
  `next: ${nextActionLine(state, workflow)}`,
260
+ `next skill: ${nextSkill(state) || '(none)'}`,
261
+ `next cli: ${nextCli(state) || '(none)'}`,
231
262
  `blockers: ${blockers(state)}`,
232
263
  ...implementationGateLines(state),
233
264
  `approval: ${JSON.stringify(state.approval || {})}`,
@@ -26,6 +26,7 @@ Read the selected skill file before acting. If multiple skills match, read every
26
26
  | Feature or bugfix implementation should be covered by a failing test first | `skills/tdd/SKILL.md` |
27
27
  | Bug, test failure, build failure, regression, unexpected behavior, root-cause investigation | `skills/debug/SKILL.md` |
28
28
  | Completion, fixed, passing, review-ready, commit, or handoff claims need fresh evidence | `skills/verify/SKILL.md` |
29
+ | Document readability, PRD assessment, requirements gaps, unclear viewpoint, AI-like prose, or document rewriting | `skills/doc-readability/SKILL.md` |
29
30
  | Editing `.go` files or reviewing Go style | `skills/go-style/SKILL.md` |
30
31
  | Go-Kratos proto, service, biz, data, middleware, auth, config, or troubleshooting | `skills/kratos/SKILL.md` |
31
32
 
@@ -42,7 +43,8 @@ Read the selected skill file before acting. If multiple skills match, read every
42
43
  9. Use `fix-review` only after feedback exists.
43
44
  10. Use `finish` only after implementation, final review, and verification are complete.
44
45
  11. Use `refactor-plan` for behavior-preserving refactor planning. If the refactor changes external behavior or contracts, route to `clarify` or `spec`.
45
- 12. Treat `tdd`, `debug`, `verify`, `go-style`, and `kratos` as support lenses unless the user explicitly invokes them directly.
46
+ 12. Use `doc-readability` for document assessment or rewriting, especially PRDs, requirements docs, specs, meeting notes, and AI-like prose. If the document is a source artifact for implementation, assess or rewrite it first, then route clarified implementation work back through `clarify`, `spec`, or `plan`.
47
+ 13. Treat `tdd`, `debug`, `verify`, `doc-readability`, `go-style`, and `kratos` as support lenses unless the user explicitly invokes them directly.
46
48
 
47
49
  ## Deterministic Guard
48
50
 
@@ -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.