@ai-content-space/loopx 0.2.9 → 0.2.10

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 (99) hide show
  1. package/README.md +10 -6
  2. package/README.zh-CN.md +10 -6
  3. package/docs/loopx/design/loopx-skill-suite-v1-design.md +12 -0
  4. package/docs/loopx/plans/2026-06-15-support-lens-skills-migration.md +1153 -0
  5. package/package.json +6 -1
  6. package/plugins/loopx/.codex-plugin/plugin.json +1 -1
  7. package/plugins/loopx/skills/api-designer/SKILL.md +232 -0
  8. package/plugins/loopx/skills/api-designer/references/error-handling.md +541 -0
  9. package/plugins/loopx/skills/api-designer/references/openapi.md +824 -0
  10. package/plugins/loopx/skills/api-designer/references/pagination.md +494 -0
  11. package/plugins/loopx/skills/api-designer/references/rest-patterns.md +335 -0
  12. package/plugins/loopx/skills/api-designer/references/versioning.md +391 -0
  13. package/plugins/loopx/skills/architecture-designer/SKILL.md +117 -0
  14. package/plugins/loopx/skills/architecture-designer/references/adr-template.md +116 -0
  15. package/plugins/loopx/skills/architecture-designer/references/architecture-patterns.md +346 -0
  16. package/plugins/loopx/skills/architecture-designer/references/database-selection.md +102 -0
  17. package/plugins/loopx/skills/architecture-designer/references/nfr-checklist.md +212 -0
  18. package/plugins/loopx/skills/architecture-designer/references/system-design.md +313 -0
  19. package/plugins/loopx/skills/clarify/SKILL.md +1 -1
  20. package/plugins/loopx/skills/cli-developer/SKILL.md +124 -0
  21. package/plugins/loopx/skills/cli-developer/references/design-patterns.md +221 -0
  22. package/plugins/loopx/skills/cli-developer/references/go-cli.md +540 -0
  23. package/plugins/loopx/skills/cli-developer/references/node-cli.md +383 -0
  24. package/plugins/loopx/skills/cli-developer/references/python-cli.md +422 -0
  25. package/plugins/loopx/skills/cli-developer/references/ux-patterns.md +448 -0
  26. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  27. package/plugins/loopx/skills/doc-readability/SKILL.md +1 -1
  28. package/plugins/loopx/skills/exec/SKILL.md +1 -1
  29. package/plugins/loopx/skills/final-review/SKILL.md +1 -1
  30. package/plugins/loopx/skills/finish/SKILL.md +1 -1
  31. package/plugins/loopx/skills/fix-review/SKILL.md +1 -1
  32. package/plugins/loopx/skills/go-style/SKILL.md +1 -1
  33. package/plugins/loopx/skills/kratos/SKILL.md +2 -1
  34. package/plugins/loopx/skills/plan-to-exec/SKILL.md +1 -1
  35. package/plugins/loopx/skills/refactor-plan/SKILL.md +1 -1
  36. package/plugins/loopx/skills/requirement-analyzer/SKILL.md +161 -0
  37. package/plugins/loopx/skills/requirement-analyzer/references/example-reports.md +170 -0
  38. package/plugins/loopx/skills/requirement-analyzer/references/prd-gap-checklist.md +167 -0
  39. package/plugins/loopx/skills/requirement-analyzer/references/readiness-rubric.md +70 -0
  40. package/plugins/loopx/skills/requirement-analyzer/references/report-template.md +83 -0
  41. package/plugins/loopx/skills/review/SKILL.md +1 -1
  42. package/plugins/loopx/skills/spec/SKILL.md +1 -1
  43. package/plugins/loopx/skills/sql-style/SKILL.md +108 -0
  44. package/plugins/loopx/skills/sql-style/references/database-design.md +402 -0
  45. package/plugins/loopx/skills/sql-style/references/dialect-differences.md +419 -0
  46. package/plugins/loopx/skills/sql-style/references/optimization.md +384 -0
  47. package/plugins/loopx/skills/sql-style/references/query-patterns.md +285 -0
  48. package/plugins/loopx/skills/sql-style/references/window-functions.md +328 -0
  49. package/plugins/loopx/skills/subagent-exec/SKILL.md +1 -1
  50. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  51. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  52. package/scripts/verify-skills.mjs +0 -2
  53. package/skills/RESOLVER.md +8 -1
  54. package/skills/api-designer/SKILL.md +232 -0
  55. package/skills/api-designer/references/error-handling.md +541 -0
  56. package/skills/api-designer/references/openapi.md +824 -0
  57. package/skills/api-designer/references/pagination.md +494 -0
  58. package/skills/api-designer/references/rest-patterns.md +335 -0
  59. package/skills/api-designer/references/versioning.md +391 -0
  60. package/skills/architecture-designer/SKILL.md +117 -0
  61. package/skills/architecture-designer/references/adr-template.md +116 -0
  62. package/skills/architecture-designer/references/architecture-patterns.md +346 -0
  63. package/skills/architecture-designer/references/database-selection.md +102 -0
  64. package/skills/architecture-designer/references/nfr-checklist.md +212 -0
  65. package/skills/architecture-designer/references/system-design.md +313 -0
  66. package/skills/clarify/SKILL.md +1 -1
  67. package/skills/cli-developer/SKILL.md +124 -0
  68. package/skills/cli-developer/references/design-patterns.md +221 -0
  69. package/skills/cli-developer/references/go-cli.md +540 -0
  70. package/skills/cli-developer/references/node-cli.md +383 -0
  71. package/skills/cli-developer/references/python-cli.md +422 -0
  72. package/skills/cli-developer/references/ux-patterns.md +448 -0
  73. package/skills/debug/SKILL.md +1 -1
  74. package/skills/doc-readability/SKILL.md +1 -1
  75. package/skills/exec/SKILL.md +1 -1
  76. package/skills/final-review/SKILL.md +1 -1
  77. package/skills/finish/SKILL.md +1 -1
  78. package/skills/fix-review/SKILL.md +1 -1
  79. package/skills/go-style/SKILL.md +1 -1
  80. package/skills/kratos/SKILL.md +2 -1
  81. package/skills/plan-to-exec/SKILL.md +1 -1
  82. package/skills/refactor-plan/SKILL.md +1 -1
  83. package/skills/requirement-analyzer/SKILL.md +161 -0
  84. package/skills/requirement-analyzer/references/example-reports.md +170 -0
  85. package/skills/requirement-analyzer/references/prd-gap-checklist.md +167 -0
  86. package/skills/requirement-analyzer/references/readiness-rubric.md +70 -0
  87. package/skills/requirement-analyzer/references/report-template.md +83 -0
  88. package/skills/review/SKILL.md +1 -1
  89. package/skills/spec/SKILL.md +1 -1
  90. package/skills/sql-style/SKILL.md +108 -0
  91. package/skills/sql-style/references/database-design.md +402 -0
  92. package/skills/sql-style/references/dialect-differences.md +419 -0
  93. package/skills/sql-style/references/optimization.md +384 -0
  94. package/skills/sql-style/references/query-patterns.md +285 -0
  95. package/skills/sql-style/references/window-functions.md +328 -0
  96. package/skills/subagent-exec/SKILL.md +1 -1
  97. package/skills/tdd/SKILL.md +1 -1
  98. package/skills/verify/SKILL.md +1 -1
  99. package/src/install-discovery.mjs +5 -0
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: requirement-analyzer
3
+ description: "Reviews existing requirements, PRDs, specs, and feature briefs for ambiguity, missing business closure, impact, feasibility, and development readiness. Not for changing workflow state, inventing business decisions, writing implementation plans, or editing code."
4
+ when_to_use: "requirement-analyzer, PRD review, requirement gaps, feasibility review, ambiguity analysis, development readiness, 需求分析, 需求缺口"
5
+ metadata:
6
+ version: "0.2.10"
7
+ ---
8
+
9
+ # Requirement Analyzer
10
+
11
+ ## Purpose
12
+
13
+ `requirement-analyzer` reviews an existing written requirement and produces a gap report or readiness assessment. It is a support skill like `doc-readability`: users can invoke it directly, and loopx workflow skills may use its output as source material later, but this skill does not advance workflow state.
14
+
15
+ Do not turn this skill into `clarify`, `spec`, or `plan-to-exec`. If analysis shows the requirement is not ready, report the gaps. If the user later wants to proceed, route that separate request through the normal loopx flow.
16
+
17
+ ## Inputs
18
+
19
+ Accept one primary input:
20
+
21
+ - a document path
22
+ - pasted document content
23
+ - a URL or external document the agent can read with available tools
24
+
25
+ Optional inputs:
26
+
27
+ - repository root for narrow context lookup
28
+ - analysis depth: `quick`, `standard`, or `deep`
29
+ - output mode: `gap_checklist` or `analysis_report`
30
+ - output path
31
+
32
+ If no source document or content is available, stop and ask for it.
33
+
34
+ ## Analysis Rules
35
+
36
+ - Do not invent missing business facts. Mark them as unknowns.
37
+ - Separate facts, inferences, and assumptions.
38
+ - Every P0 or P1 issue must cite evidence from the requirement or nearby repo context.
39
+ - Keep repository scanning narrow. Read only directly related docs, interfaces, schemas, or code paths.
40
+ - Prefer concrete follow-up questions over broad requests for more detail.
41
+ - Do not treat every API, schema, or implementation detail as a PRD defect when it clearly belongs in technical design.
42
+
43
+ ## Core Workflow
44
+
45
+ 1. **Identify the source artifact** — Read the requirement, PRD, spec, ticket, or feature brief. If only an excerpt is available, state that limitation.
46
+ 2. **Classify the document** — State whether it is a product requirement, engineering requirement, design brief, migration brief, bug requirement, or mixed document.
47
+ 3. **Extract facts** — List actors, triggers, inputs, outputs, user-visible states, constraints, and explicit acceptance rules before judging quality.
48
+ 4. **Run gap checks** — Review business closure, ambiguity, impact, feasibility, and development readiness. Load references only when the corresponding check is needed.
49
+ 5. **Prioritize issues** — Assign P0/P1/P2 using the priority rules below. Do not inflate every missing implementation detail into a requirement blocker.
50
+ 6. **Recommend next step** — Recommend `clarify`, `spec`, `plan-to-exec`, or blocked pending owner decisions. This is only a recommendation; do not create workflow artifacts unless separately asked.
51
+
52
+ ## Reference Guide
53
+
54
+ Load detailed guidance based on context:
55
+
56
+ | Topic | Reference | Load When |
57
+ | --- | --- | --- |
58
+ | PRD gap checklist | `references/prd-gap-checklist.md` | Reviewing business closure, ambiguity, impact, or Chinese PRDs |
59
+ | Readiness rubric | `references/readiness-rubric.md` | Deciding whether work is ready for `clarify`, `spec`, or `plan-to-exec` |
60
+ | Report template | `references/report-template.md` | Writing a gap checklist or narrative analysis report |
61
+ | Example reports | `references/example-reports.md` | Understanding expected output quality and format |
62
+
63
+ ## Priority Levels
64
+
65
+ - `P0`: Blocks design or implementation. Key behavior, ownership, timing, failure handling, contract, permission, or acceptance rule is missing or contradictory.
66
+ - `P1`: Does not block kickoff, but creates major design uncertainty, integration risk, or likely rework.
67
+ - `P2`: Clarity, operability, UX, or maintenance issue that should be improved but does not block work.
68
+
69
+ Use the lowest priority that still protects the work. If a missing detail can be decided during technical design without changing product behavior, classify it as a design input or P2 note, not a P0 requirement blocker.
70
+
71
+ ## Review Dimensions
72
+
73
+ ### Business Closure
74
+
75
+ Check whether the requirement has a complete loop:
76
+
77
+ ```text
78
+ input -> process -> output -> feedback
79
+ ```
80
+
81
+ Look for missing actors, triggers, success events, failure handling, ownership, and user-visible completion states.
82
+
83
+ For each missing closure point, state who must decide it and what downstream work is blocked.
84
+
85
+ ### Ambiguity
86
+
87
+ Find terms, quantities, timing, permissions, integrations, and acceptance criteria that can be interpreted more than one way.
88
+
89
+ Convert each ambiguity into a concrete question with two or three plausible interpretations when possible.
90
+
91
+ ### Impact
92
+
93
+ Identify affected users, systems, APIs, data, permissions, migrations, operations, analytics, and rollback concerns.
94
+
95
+ Call out impact as unknown only when the requirement gives no evidence. Do not invent affected systems from generic architecture assumptions.
96
+
97
+ ### Feasibility
98
+
99
+ Call out technical, product, operational, legal, data-quality, schedule, or dependency risks that would change design or planning.
100
+
101
+ Separate feasibility blockers from implementation difficulty. Hard work is not a requirement gap unless the requirement assumes an impossible or unapproved constraint.
102
+
103
+ ### Development Readiness
104
+
105
+ State whether the requirement is ready for:
106
+
107
+ - `clarify`
108
+ - `spec`
109
+ - `plan-to-exec`
110
+ - blocked pending owner decisions
111
+
112
+ This is a recommendation only. Do not create workflow artifacts unless the user separately asks.
113
+
114
+ Use these readiness rules:
115
+
116
+ - Ready for `clarify` when the source is incomplete or contradictory and owner decisions are needed before design.
117
+ - Ready for `spec` when product behavior is mostly clear but API, data, permission, migration, compatibility, or architecture decisions must be fixed before planning.
118
+ - Ready for `plan-to-exec` when scope, non-goals, acceptance rules, affected surfaces, and constraints are clear enough to break into implementation tasks.
119
+ - Blocked pending owner decisions when a P0 question has no safe default and no local repo evidence can answer it.
120
+
121
+ ## Output
122
+
123
+ Default to a markdown report with this structure:
124
+
125
+ ```markdown
126
+ # Requirement Analysis
127
+
128
+ ## Summary
129
+
130
+ ## Readiness Recommendation
131
+
132
+ ## P0 Blockers
133
+
134
+ ## P1 Major Risks
135
+
136
+ ## P2 Improvements
137
+
138
+ ## Facts
139
+
140
+ ## Inferences
141
+
142
+ ## Assumptions
143
+
144
+ ## Follow-Up Questions
145
+
146
+ ## Suggested Next Step
147
+ ```
148
+
149
+ If writing to disk, use a sibling file next to the source document when practical:
150
+
151
+ - `需求缺口清单.md` for gap reports
152
+ - `需求分析报告.md` for narrative analysis
153
+
154
+ ## Review Checklist
155
+
156
+ - Did every P0/P1 cite requirement text or nearby repo evidence?
157
+ - Are facts, inferences, and assumptions separated?
158
+ - Are follow-up questions concrete enough for an owner to answer?
159
+ - Are technical design questions separated from true requirement gaps?
160
+ - Does the readiness recommendation match the highest-priority unresolved issue?
161
+ - Did the report avoid creating workflow artifacts or advancing loopx state?
@@ -0,0 +1,170 @@
1
+ # Example Reports
2
+
3
+ These examples illustrate the expected output quality and format for requirement analysis reports. They are synthetic but modeled on real-world patterns.
4
+
5
+ ## Example 1: Gap Checklist (Chinese PRD)
6
+
7
+ Source: "用户积分兑换功能 PRD v0.3"
8
+
9
+ ```markdown
10
+ # 需求缺口清单
11
+
12
+ ## 结论
13
+
14
+ - 推荐下一步:clarify
15
+ - 阻塞项数量:3 个 P0
16
+ - 主要风险:兑换失败的回滚机制未定义,积分过期规则与兑换时序存在矛盾
17
+
18
+ ## 必须确认
19
+
20
+ - [ ] 问题:并发兑换时积分不足如何处理?
21
+ 证据:PRD 第 3.2 节仅描述 "扣减积分",未定义并发锁策略或失败回滚
22
+ 影响:可能导致积分超扣或兑换成功但商品库存不足
23
+
24
+ - [ ] 问题:积分过期与兑换时序矛盾
25
+ 证据:第 2.1 节 "积分到期日自动清零",第 3.1 节 "提交兑换后 24 小时内发货"
26
+ 影响:如果用户提交兑换时积分有效,但发货确认时积分已过期,扣减行为未定义
27
+
28
+ - [ ] 问题:"相关人员审核" 的角色和超时未定义
29
+ 证据:第 4.2 节 "高价值兑换需相关人员审核"
30
+ 影响:不知道谁审核、超时多久、超时后是自动通过还是拒绝
31
+
32
+ ## 可以后续完善
33
+
34
+ - [ ] 问题:兑换记录的展示排序和分页规则
35
+ 证据:第 5.1 节仅说 "展示兑换记录"
36
+ 建议:spec 阶段明确排序字段、分页大小、筛选维度
37
+
38
+ - [ ] 问题:积分变动通知渠道
39
+ 证据:第 6 节 "及时通知用户"
40
+ 建议:明确是 APP 推送、短信、站内信、还是多渠道,以及延迟容忍度
41
+ ```
42
+
43
+ ## Example 2: Analysis Report (English Feature Brief)
44
+
45
+ Source: "Multi-tenant API Key Management — Feature Brief v1"
46
+
47
+ ```markdown
48
+ # Requirement Analysis
49
+
50
+ ## Summary
51
+
52
+ - Source: Multi-tenant API Key Management Feature Brief v1
53
+ - Document type: Product requirement (mixed with some technical design)
54
+ - Overall readiness: Not ready for plan-to-exec
55
+ - Highest priority issue: Tenant isolation model for key scopes is undefined
56
+
57
+ ## Readiness Recommendation
58
+
59
+ Recommended next step: `spec`
60
+
61
+ Reason: Product intent is clear (tenants manage their own API keys with scoped permissions), but the key-to-permission model, cross-tenant visibility rules, and key rotation impact on active sessions are design decisions that need architecture input before implementation planning.
62
+
63
+ ## P0 Blockers
64
+
65
+ | Issue | Evidence | Why It Blocks | Question / Decision Needed |
66
+ | --- | --- | --- | --- |
67
+ | Key scope model undefined | Brief says "keys can have limited permissions" but does not define the permission granularity | Cannot design the authorization layer without knowing if scopes are predefined roles, custom permission sets, or resource-level grants | What is the permission model? Predefined roles (admin/read/write) or custom scope sets? |
68
+ | Cross-tenant key visibility | Brief says "admins can view all keys" without defining tenant boundary | In multi-tenant, "all keys" could mean within-tenant or platform-wide — different security models | Does "admin" mean tenant admin (sees own tenant keys) or platform admin (sees all tenant keys)? |
69
+ | Key rotation impact on sessions | Brief says "keys can be rotated" but does not address active sessions | Rotating a key mid-session could break active API consumers or require grace periods | When a key is rotated, do active sessions using the old key get terminated immediately, get a grace period, or continue until natural expiry? |
70
+
71
+ ## P1 Major Risks
72
+
73
+ | Issue | Evidence | Risk | Suggested Resolution |
74
+ | --- | --- | --- | --- |
75
+ | Rate limiting per key vs per tenant | Brief mentions "rate limiting" without specifying the limit entity | If limits are per-key, a tenant can create many keys to bypass limits; if per-tenant, a single key's traffic can starve others | Decide rate limit entity in spec: per-key, per-tenant, or hierarchical |
76
+ | Audit log retention | Brief says "all key operations are audited" without retention or access rules | Compliance and storage cost implications are unknown | Define retention period, access control for audit logs, and whether they are tenant-visible |
77
+
78
+ ## P2 Improvements
79
+
80
+ | Issue | Evidence | Improvement |
81
+ | --- | --- | --- |
82
+ | Key naming constraints | Not mentioned | Define max length, allowed characters, uniqueness scope |
83
+ | Bulk key operations | Not mentioned | Consider if tenants need bulk create/revoke for migration scenarios |
84
+ | Key metadata | Brief mentions "description" field only | Consider labels/tags for organizational use |
85
+
86
+ ## Facts
87
+
88
+ - Tenants can create, list, rotate, and revoke API keys
89
+ - Keys have a name and description
90
+ - Keys can have limited permissions (scope undefined)
91
+ - All key operations are audited
92
+ - Rate limiting applies (entity undefined)
93
+ - Admins can view all keys (boundary undefined)
94
+
95
+ ## Inferences
96
+
97
+ - Inference: Keys are likely long-lived (not session tokens)
98
+ Evidence: "rotate" and "revoke" imply persistent credentials, not short-lived tokens
99
+
100
+ - Inference: Multi-tenant isolation is required
101
+ Evidence: Feature title says "multi-tenant" and brief mentions "tenant" 12 times
102
+
103
+ ## Assumptions
104
+
105
+ - Assumption: One key belongs to exactly one tenant
106
+ Why it matters: If keys can be shared across tenants, the permission and audit model changes significantly
107
+
108
+ - Assumption: Key creation does not require approval
109
+ Why it matters: If approval is needed, the workflow, roles, and notification paths must be designed
110
+
111
+ ## Follow-Up Questions
112
+
113
+ 1. What permission model should keys use? (predefined roles vs custom scopes vs resource-level)
114
+ 2. Does "admin can view all keys" mean tenant-admin or platform-admin?
115
+ 3. What happens to active sessions when a key is rotated?
116
+ 4. Is rate limiting applied per-key, per-tenant, or both?
117
+ 5. What is the audit log retention period and who can access it?
118
+
119
+ ## Suggested Next Step
120
+
121
+ Route to `spec` with `api-designer` and `architecture-designer` lenses. The key-to-permission model is an architecture decision that affects API surface, data model, and authorization middleware.
122
+ ```
123
+
124
+ ## Example 3: Quick Gap Checklist (Ticket-Level)
125
+
126
+ Source: JIRA ticket "Add export button to analytics dashboard"
127
+
128
+ ```markdown
129
+ # 需求缺口清单
130
+
131
+ ## 结论
132
+
133
+ - 推荐下一步:plan-to-exec
134
+ - 阻塞项数量:0
135
+ - 主要风险:大数据量导出的超时和内存问题(P1,不阻塞规划)
136
+
137
+ ## 必须确认
138
+
139
+ (无 P0 阻塞项)
140
+
141
+ ## 可以后续完善
142
+
143
+ - [ ] 问题:导出数据量上限
144
+ 证据:ticket 说 "导出当前筛选结果",但仪表盘数据可能达百万行
145
+ 建议:plan-to-exec 时设计分页导出或异步下载,设定单次导出上限
146
+
147
+ - [ ] 问题:导出格式
148
+ 证据:ticket 仅说 "导出为 CSV"
149
+ 建议:确认是否需要 Excel (.xlsx) 支持,以及 CSV 编码(UTF-8 BOM for 中文兼容)
150
+
151
+ ## 为什么可以进入 plan-to-exec
152
+
153
+ - 范围明确:在现有仪表盘页面增加导出按钮
154
+ - 接受标准可测试:点击导出 → 下载包含当前筛选数据的文件
155
+ - 无跨团队依赖:仪表盘前端和 API 由同一团队负责
156
+ - 剩余问题(数据量上限、格式)是实现选择,不影响产品行为决策
157
+ ```
158
+
159
+ ## Report Quality Checklist
160
+
161
+ Before submitting a requirement analysis report, verify:
162
+
163
+ - [ ] Every P0/P1 cites specific text or section from the source document
164
+ - [ ] Facts, inferences, and assumptions are clearly separated
165
+ - [ ] Follow-up questions are concrete and answerable (not "please clarify further")
166
+ - [ ] Technical design concerns are separated from true requirement gaps
167
+ - [ ] The readiness recommendation matches the highest unresolved priority level
168
+ - [ ] Chinese terms are checked against the ambiguity table when analyzing Chinese documents
169
+ - [ ] The report does not invent business decisions or advance loopx workflow state
170
+ - [ ] Impact is classified as unknown only when evidence is genuinely absent, not when it can be inferred from context
@@ -0,0 +1,167 @@
1
+ # PRD Gap Checklist
2
+
3
+ Use this checklist when a requirement, PRD, ticket, or feature brief needs a gap review. Do not require every item for every document; apply the sections that match the document's job.
4
+
5
+ ## Business Closure
6
+
7
+ Check the requirement loop:
8
+
9
+ ```text
10
+ actor -> trigger -> input -> process -> output -> feedback
11
+ ```
12
+
13
+ Look for:
14
+
15
+ - Primary actor and secondary actors
16
+ - Triggering event or entry point
17
+ - Required input and validation rules
18
+ - Success output and user-visible completion state
19
+ - Failure output and user-visible recovery path
20
+ - Owner of manual decisions, approvals, or exceptions
21
+ - Feedback or notification path after completion
22
+
23
+ Common blockers:
24
+
25
+ - The requirement says "support", "sync", "review", or "process" without a completion state.
26
+ - It defines the happy path but not failure handling.
27
+ - It names a system integration but not the source of truth or ownership.
28
+ - It requires approval but does not identify who approves or what happens on rejection.
29
+
30
+ ## Ambiguity
31
+
32
+ Turn vague terms into answerable questions.
33
+
34
+ | Vague wording | Ask |
35
+ | --- | --- |
36
+ | "real-time" | What maximum delay is acceptable? |
37
+ | "admin" | Which role, permission, or tenant scope qualifies? |
38
+ | "recent" | What exact time window and timezone? |
39
+ | "all users" | Which user segments, regions, plans, or exclusions? |
40
+ | "failure notification" | Who receives it, by which channel, and with what action? |
41
+ | "compatible" | Which versions, clients, payloads, or migrations must continue working? |
42
+ | "batch" | What size, frequency, retry, and timeout rules? |
43
+ | "configurable" | Who configures it, where, and what are the allowed values and defaults? |
44
+ | "secure" | Which threat model, authentication, authorization, and encryption rules? |
45
+ | "performant" | What specific latency, throughput, or resource target? |
46
+
47
+ ### Chinese Requirement Ambiguity
48
+
49
+ For Chinese requirements, watch for these terms and convert them to concrete questions:
50
+
51
+ | 模糊用词 | 需要确认 |
52
+ | --- | --- |
53
+ | "及时" | 具体时间上限是多少?(< 1秒 / < 1分钟 / < 1小时) |
54
+ | "尽快" | 有没有 SLA 或超时后的降级策略? |
55
+ | "相关人员" | 具体是哪些角色、部门、或权限组? |
56
+ | "默认" | 默认值是什么?谁可以修改?修改后影响范围? |
57
+ | "自动" | 触发条件是什么?失败时怎么处理?有没有人工兜底? |
58
+ | "必要时" | 判断条件是什么?谁来判断?判断错误的后果? |
59
+ | "支持" | 支持的完整范围是什么?有没有不支持的例外? |
60
+ | "可配置" | 配置的维度、粒度、权限、生效时机? |
61
+ | "保持一致" | 一致性的对象、时间窗口、冲突解决规则? |
62
+ | "合理" | 合理的标准是什么?由谁定义? |
63
+ | "视情况而定" | 列举所有情况和对应处理方式 |
64
+ | "参考xx系统" | 哪些行为对齐、哪些行为不同、差异的原因? |
65
+ | "等" / "等等" | 完整枚举是什么?还是真的是开放集合? |
66
+
67
+ ## Impact
68
+
69
+ Identify affected surfaces without inventing architecture:
70
+
71
+ - Users, roles, tenants, plans, regions, or organizations
72
+ - APIs, CLI commands, screens, jobs, events, or integrations
73
+ - Database records, schemas, migrations, backfills, retention, or analytics
74
+ - Permissions, audit logs, compliance, privacy, or legal review
75
+ - Operations, monitoring, alerts, rollout, rollback, and support playbooks
76
+ - Existing behavior that must remain compatible
77
+
78
+ Classify impact as unknown when the source gives no evidence. Unknown impact is a gap only when it changes design, rollout, or acceptance.
79
+
80
+ ### Impact Assessment Matrix
81
+
82
+ | Impact Area | Questions to Ask | P0 if... |
83
+ | --- | --- | --- |
84
+ | Data | Schema change? Migration needed? Backward compatible? | Existing data is corrupted or lost without migration |
85
+ | API | Breaking change? New version? Deprecation? | Existing clients break without warning |
86
+ | Permissions | New role? Changed access? Audit implications? | Users gain unintended access |
87
+ | Operations | New alerts? Changed runbooks? New on-call scope? | Failure is undetectable or unrecoverable |
88
+ | Compliance | Privacy review? Legal approval? Data classification? | Non-compliance risk with legal consequences |
89
+ | Rollback | Can this be undone? What is the rollback blast radius? | No rollback path exists for a destructive change |
90
+
91
+ ## Feasibility
92
+
93
+ Separate requirement risk from implementation difficulty.
94
+
95
+ Requirement feasibility risks include:
96
+
97
+ - A dependency or external system is assumed but not available.
98
+ - The requested behavior conflicts with existing product rules or legal constraints.
99
+ - Required data does not exist, is unreliable, or has unclear ownership.
100
+ - A migration, rollout, or rollback path is required but unspecified.
101
+ - A schedule or SLA is stated without scope, load, or operational ownership.
102
+ - A third-party integration is assumed but not contracted or available in the target environment.
103
+
104
+ Do not mark a requirement defective just because implementation is complex. Mark it as a risk when the requirement assumes an unapproved tradeoff or hides a decision the owner must make.
105
+
106
+ ### Feasibility Red Flags
107
+
108
+ | Red Flag | Why It Matters |
109
+ | --- | --- |
110
+ | "Same as system X" without specifying differences | System X may have different constraints, scale, or contracts |
111
+ | Timing assumption without load analysis | "Real-time sync of 10M records" may be infeasible |
112
+ | Cross-team dependency without confirmed ownership | The other team may not have capacity or agreement |
113
+ | Compliance claim without legal review | Legal requirements need legal confirmation, not assumption |
114
+ | "No downtime" for schema migration | May require online DDL, dual-write, or phased rollout |
115
+
116
+ ## Development Readiness
117
+
118
+ Quick checks to determine if the requirement is ready for the next loopx workflow step.
119
+
120
+ ### Ready for `clarify`
121
+
122
+ - [ ] Scope or non-goals are missing or contradictory
123
+ - [ ] Multiple product interpretations lead to different designs
124
+ - [ ] Key actor, permission, or ownership is undecidable
125
+ - [ ] Competing goals exist without stated priority
126
+
127
+ ### Ready for `spec`
128
+
129
+ - [ ] Product intent is clear but API/data/state decisions are open
130
+ - [ ] Existing systems or contracts are affected
131
+ - [ ] Rollout, rollback, or operational behavior needs design
132
+ - [ ] Clear enough to compare options but not to write tasks
133
+
134
+ ### Ready for `plan-to-exec`
135
+
136
+ - [ ] Scope and non-goals are explicit
137
+ - [ ] Acceptance rules are testable
138
+ - [ ] Affected surfaces are discoverable
139
+ - [ ] Remaining choices are local implementation choices
140
+ - [ ] No owner-level decisions are pending
141
+
142
+ ### Blocked
143
+
144
+ - [ ] A P0 question has no safe default
145
+ - [ ] No local repo evidence can answer the blocking question
146
+ - [ ] The decision requires a specific person (legal, product owner, security)
147
+
148
+ ## Cross-Reference Checks
149
+
150
+ When the requirement references other documents or systems:
151
+
152
+ - [ ] Referenced documents exist and are accessible
153
+ - [ ] Referenced behavior is still current (not deprecated or changed)
154
+ - [ ] Contradictions between referenced docs and this requirement are flagged
155
+ - [ ] Version or date of referenced material is noted
156
+
157
+ ## Completeness Signals
158
+
159
+ A requirement is likely incomplete when:
160
+
161
+ - It describes only the creation flow but not update, delete, or error flows
162
+ - It mentions a list or collection but not pagination, sorting, or filtering rules
163
+ - It defines a notification but not the channel, template, frequency, or opt-out
164
+ - It references permissions but not the grant, revoke, or audit mechanism
165
+ - It describes a scheduled job but not frequency, retry, timeout, or conflict rules
166
+ - It mentions "sync" but not conflict resolution, source of truth, or failure handling
167
+ - It defines an approval flow but not timeout, escalation, delegation, or rejection recovery
@@ -0,0 +1,70 @@
1
+ # Development Readiness Rubric
2
+
3
+ Use this rubric to decide the next loopx recommendation after analyzing a source requirement.
4
+
5
+ ## Ready For `clarify`
6
+
7
+ Recommend `clarify` when owner answers are needed before design can start.
8
+
9
+ Signals:
10
+
11
+ - Scope, non-goals, actor, or acceptance rules are missing or contradictory.
12
+ - Multiple product interpretations are plausible and lead to different designs.
13
+ - Permission, ownership, or failure handling is not decidable from the document.
14
+ - The source mixes competing goals without priority.
15
+
16
+ Output:
17
+
18
+ - List P0 questions first.
19
+ - Keep questions concrete and answerable.
20
+ - Do not draft a design or implementation plan.
21
+
22
+ ## Ready For `spec`
23
+
24
+ Recommend `spec` when product intent is mostly clear but design decisions must be fixed before planning.
25
+
26
+ Signals:
27
+
28
+ - API, data, state, permission, migration, compatibility, or architecture choices are open.
29
+ - Existing systems or contracts are affected.
30
+ - Rollout, rollback, or operational behavior needs a design decision.
31
+ - The requirement is clear enough to compare options but not enough to write tasks.
32
+
33
+ Output:
34
+
35
+ - State the design decisions that need to be resolved.
36
+ - Identify any support lens that should be used later, such as `api-designer`, `architecture-designer`, `sql-style`, `cli-developer`, `go-style`, or `kratos`.
37
+
38
+ ## Ready For `plan-to-exec`
39
+
40
+ Recommend `plan-to-exec` only when implementation can be decomposed safely.
41
+
42
+ Signals:
43
+
44
+ - Scope and non-goals are explicit.
45
+ - Acceptance rules and user-visible completion states are testable.
46
+ - Affected files, modules, APIs, schemas, commands, or docs are discoverable.
47
+ - Remaining choices are local implementation choices, not product or architecture decisions.
48
+ - Known risks can be handled as implementation tasks with verification.
49
+
50
+ Output:
51
+
52
+ - Summarize why no owner-level decisions block planning.
53
+ - Mention any P2 improvements that should be tracked but not block planning.
54
+
55
+ ## Blocked Pending Owner Decisions
56
+
57
+ Use this when a P0 issue cannot be answered by local repo evidence and has no safe default.
58
+
59
+ Examples:
60
+
61
+ - Who is allowed to perform a destructive action?
62
+ - What happens to existing data during migration?
63
+ - Which customer-visible behavior wins when two requirements conflict?
64
+ - What legal, compliance, or privacy rule governs the data?
65
+
66
+ Output:
67
+
68
+ - State the blocking decision.
69
+ - Explain what downstream design or implementation would be unsafe without it.
70
+ - Ask the smallest set of questions needed to unblock the next step.
@@ -0,0 +1,83 @@
1
+ # Requirement Analysis Report Template
2
+
3
+ Use this structure for the default markdown report. Keep it concise; expand only where the requirement has real risk.
4
+
5
+ ```markdown
6
+ # Requirement Analysis
7
+
8
+ ## Summary
9
+
10
+ - Source:
11
+ - Document type:
12
+ - Overall readiness:
13
+ - Highest priority issue:
14
+
15
+ ## Readiness Recommendation
16
+
17
+ Recommended next step: `clarify` | `spec` | `plan-to-exec` | blocked pending owner decisions
18
+
19
+ Reason:
20
+
21
+ ## P0 Blockers
22
+
23
+ | Issue | Evidence | Why It Blocks | Question / Decision Needed |
24
+ | --- | --- | --- | --- |
25
+
26
+ ## P1 Major Risks
27
+
28
+ | Issue | Evidence | Risk | Suggested Resolution |
29
+ | --- | --- | --- | --- |
30
+
31
+ ## P2 Improvements
32
+
33
+ | Issue | Evidence | Improvement |
34
+ | --- | --- | --- |
35
+
36
+ ## Facts
37
+
38
+ - ...
39
+
40
+ ## Inferences
41
+
42
+ - Inference:
43
+ Evidence:
44
+
45
+ ## Assumptions
46
+
47
+ - Assumption:
48
+ Why it matters:
49
+
50
+ ## Follow-Up Questions
51
+
52
+ 1. ...
53
+
54
+ ## Suggested Next Step
55
+
56
+ ...
57
+ ```
58
+
59
+ ## Gap Checklist Mode
60
+
61
+ For a compact gap checklist, use:
62
+
63
+ ```markdown
64
+ # 需求缺口清单
65
+
66
+ ## 结论
67
+
68
+ - 推荐下一步:
69
+ - 阻塞项数量:
70
+ - 主要风险:
71
+
72
+ ## 必须确认
73
+
74
+ - [ ] 问题:
75
+ 证据:
76
+ 影响:
77
+
78
+ ## 可以后续完善
79
+
80
+ - [ ] 问题:
81
+ 证据:
82
+ 建议:
83
+ ```
@@ -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.9"
6
+ version: "0.2.10"
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.9"
6
+ version: "0.2.10"
7
7
  ---
8
8
 
9
9
  # loopx Spec