@ai-content-space/loopx 0.1.10 → 0.2.1

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 (77) hide show
  1. package/AGENTS.md +49 -0
  2. package/README.md +69 -448
  3. package/README.zh-CN.md +69 -459
  4. package/docs/loopx/design/loopx-skill-suite-v1-design.md +80 -0
  5. package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +81 -0
  6. package/package.json +7 -3
  7. package/plugins/loopx/.codex-plugin/plugin.json +4 -4
  8. package/plugins/loopx/skills/clarify/SKILL.md +38 -311
  9. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  10. package/plugins/loopx/skills/exec/SKILL.md +71 -0
  11. package/plugins/loopx/skills/finish/SKILL.md +349 -0
  12. package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
  13. package/plugins/loopx/skills/go-style/SKILL.md +2 -2
  14. package/plugins/loopx/skills/kratos/SKILL.md +1 -1
  15. package/plugins/loopx/skills/plan/SKILL.md +138 -271
  16. package/plugins/loopx/skills/refactor-plan/SKILL.md +71 -0
  17. package/plugins/loopx/skills/review/SKILL.md +72 -105
  18. package/plugins/loopx/skills/review/code-reviewer.md +168 -0
  19. package/plugins/loopx/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
  20. package/plugins/loopx/skills/spec/SKILL.md +76 -0
  21. package/plugins/loopx/skills/subagent-exec/SKILL.md +282 -0
  22. package/plugins/loopx/skills/subagent-exec/agents/openai.yaml +3 -0
  23. package/plugins/loopx/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
  24. package/plugins/loopx/skills/subagent-exec/codex-subagents.md +37 -0
  25. package/plugins/loopx/skills/subagent-exec/implementer-prompt.md +113 -0
  26. package/plugins/loopx/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
  27. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  28. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  29. package/scripts/claude-workflow-hook.mjs +109 -0
  30. package/scripts/codex-workflow-hook.mjs +2 -5
  31. package/scripts/install-skills.mjs +3 -3
  32. package/scripts/verify-skills.mjs +34 -2
  33. package/skills/RESOLVER.md +22 -17
  34. package/skills/clarify/SKILL.md +38 -311
  35. package/skills/debug/SKILL.md +1 -1
  36. package/skills/exec/SKILL.md +71 -0
  37. package/skills/finish/SKILL.md +349 -0
  38. package/skills/fix-review/SKILL.md +216 -0
  39. package/skills/go-style/SKILL.md +2 -2
  40. package/skills/kratos/SKILL.md +1 -1
  41. package/skills/plan/SKILL.md +138 -271
  42. package/skills/refactor-plan/SKILL.md +71 -0
  43. package/skills/review/SKILL.md +72 -105
  44. package/skills/review/code-reviewer.md +168 -0
  45. package/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
  46. package/skills/spec/SKILL.md +76 -0
  47. package/skills/subagent-exec/SKILL.md +282 -0
  48. package/skills/subagent-exec/agents/openai.yaml +3 -0
  49. package/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
  50. package/skills/subagent-exec/codex-subagents.md +37 -0
  51. package/skills/subagent-exec/implementer-prompt.md +113 -0
  52. package/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
  53. package/skills/tdd/SKILL.md +1 -1
  54. package/skills/verify/SKILL.md +1 -1
  55. package/src/autopilot-runtime.mjs +1 -1
  56. package/src/cli.mjs +78 -7
  57. package/src/context-manifest.mjs +2 -2
  58. package/src/html-views.mjs +129 -195
  59. package/src/install-discovery.mjs +210 -6
  60. package/src/next-skill.mjs +2 -4
  61. package/src/plan-runtime.mjs +219 -93
  62. package/src/runtime-maintenance.mjs +5 -2
  63. package/src/workflow.mjs +749 -71
  64. package/templates/architecture.md +58 -16
  65. package/templates/development-plan.md +42 -12
  66. package/plugins/loopx/scripts/plugin-install.test.mjs +0 -125
  67. package/plugins/loopx/skills/archive/SKILL.md +0 -55
  68. package/plugins/loopx/skills/autopilot/SKILL.md +0 -93
  69. package/plugins/loopx/skills/build/SKILL.md +0 -228
  70. package/skills/ai-slop-cleaner/SKILL.md +0 -114
  71. package/skills/archive/SKILL.md +0 -55
  72. package/skills/autopilot/SKILL.md +0 -93
  73. package/skills/autoresearch/SKILL.md +0 -68
  74. package/skills/build/SKILL.md +0 -228
  75. package/skills/deep-interview/SKILL.md +0 -461
  76. package/skills/ralph/SKILL.md +0 -271
  77. package/skills/ralplan/SKILL.md +0 -49
@@ -1,139 +1,106 @@
1
1
  ---
2
2
  name: review
3
- description: "Reviews a loopx build execution record for acceptance, code risks, evidence quality, and architecture smells. Not for doing implementation work or replanning."
4
- when_to_use: "review, code review, acceptance, go no-go, execution-record, architecture smell, build complete, 审查, 验收"
3
+ description: "Dispatches a loopx code reviewer subagent against a concrete git range and requirements. Not for implementation, planning, or unresolved review scope."
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.1.10"
7
- argument-hint: "<execution-record path or workflow slug>"
6
+ version: "0.2.1"
8
7
  ---
9
8
 
10
- # loopx Review
9
+ # Review
11
10
 
12
- ## Purpose
11
+ Dispatch a code reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
13
12
 
14
- Repo-local acceptance surface for loopx. Use it to evaluate the execution package from `build` and return an explicit go / no-go result.
13
+ **Core principle:** Review early, review often.
15
14
 
16
- ## Inputs
15
+ ## When to Request Review
17
16
 
18
- Preferred skill input:
17
+ **Mandatory:**
18
+ - After each task in subagent-exec
19
+ - After completing major feature
20
+ - Before merge to main
19
21
 
20
- - `.loopx/workflows/<slug>/execution-record.md`
22
+ **Optional but valuable:**
23
+ - When stuck (fresh perspective)
24
+ - Before refactoring (baseline check)
25
+ - After fixing complex bug
21
26
 
22
- Compatible skill / CLI input:
27
+ ## How to Request
23
28
 
24
- - `<slug>`
25
-
26
- When invoked with an execution record path, derive `<slug>` from the workflow directory and evaluate the matching active run.
27
-
28
- When present, use `.loopx/config.json` as supporting context for project-native verification commands, existing AI rule files, and existing spec sources. Do not treat those external or pre-existing sources as replacements for the loopx execution record and review artifact.
29
-
30
- ## Expected Outputs
31
-
32
- - a review artifact tied to the run being evaluated
33
- - verdict and rationale
34
- - code review findings for the implementation diff, including file / line references when issues are found
35
- - architecture-smell findings from the internal review lane, focused on module depth, test seams, domain vocabulary, duplicated rules, and plan architecture alignment
36
- - rollback/fix guidance when execution is incomplete, unstable, or needs another iteration
37
- - an explicit `Next:` block with the exact next skill command when more work remains
38
-
39
- ## User Notification Language
40
-
41
- The final user-facing review result must be written in Chinese.
42
-
43
- Use stable machine values only where they are commands, file paths, JSON/state fields, or exact verdict identifiers. The human-readable summary, rationale, findings, residual risks, rollback guidance, and next-step instruction must be Chinese.
44
-
45
- ## Decision Boundary
46
-
47
- - Use this only after build has produced execution and verification evidence for a specific run.
48
- - Stop here if review evidence is incomplete. `review` remains an independent gate and does not auto-complete the workflow.
49
- - Review must include code review of the build-owned implementation diff. Do not limit review to artifact/schema checks.
50
- - Review should compare verification evidence against project-native commands recorded in `.loopx/config.json` when available, while still accepting stronger task-specific verification from the approved plan.
51
- - Review must include the architecture-smell lane as part of review evidence. This is not a new workflow stage and must not create extra user steps.
52
- - Review must compare the execution scope against the approved workflow scope. If `execution-record.md` declares non-empty `remaining_scope`, `completion_claim` other than `full`, or a mismatch between `planned_scope` and `implemented_scope`, review must return no-go and route to build or plan. A partial slice may be accepted as useful work, but it must not be approved as full workflow completion.
53
- - Review must compare implementation evidence against the original source requirements and `.loopx/workflows/<slug>/requirement-traceability.md`, not only against the generated plan. If the traceability matrix is missing, partial, or contradicted by code/tests, route to `review -> plan` or `review -> clarify` depending on whether the plan or requirements are wrong.
54
- - Code review findings should focus on real bugs, regressions, missing tests, broken contracts, security/data-integrity risks, and user-visible behavior gaps.
55
- - If code review finds blocking high or medium severity issues, return a no-go verdict and rollback guidance instead of approving completion.
56
- - If architecture-smell findings are only advisory, record them as warnings without blocking. Block only when module seams, testability, domain boundaries, duplicated rules, or plan architecture assumptions are materially wrong.
57
- - Route request-changes by problem type:
58
- - implementation bugs, missing tests, small contract fixes: `review -> build`
59
- - wrong plan, wrong architecture, unresolved execution inputs: `review -> plan`
60
- - unclear product requirements or decision boundaries: `review -> clarify`
61
- - Do not route implementation-only fixes back to plan unless the plan itself is wrong.
62
-
63
- ## Next Step Format
64
-
65
- Every no-go review result must end with a concrete next command block.
66
-
67
- For implementation fixes:
68
-
69
- Default implementation-fix handoff:
70
-
71
- ```text
72
- Next:
73
- $build --from-review .loopx/workflows/<slug>/review-report.md
29
+ **1. Get git SHAs:**
30
+ ```bash
31
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
32
+ HEAD_SHA=$(git rev-parse HEAD)
74
33
  ```
75
34
 
76
- The review artifact is the direct rework contract for implementation fixes. `$build --from-review ...` must load the review findings first, while still using the approved PRD, test spec, previous `execution-record.md`, and workflow-local plan package as supporting context. Do not make the normal Codex-facing handoff require a separate bash `loopx approve ... --from review --to build` step.
35
+ **2. Dispatch code reviewer subagent:**
77
36
 
78
- For CLI/runtime debugging only, the equivalent state transition is:
37
+ Use the platform's native subagent mechanism when available and fill template at `code-reviewer.md`.
79
38
 
80
- ```bash
81
- loopx build --from-review .loopx/workflows/<slug>/review-report.md
82
- ```
39
+ **Placeholders:**
40
+ - `{DESCRIPTION}` - Brief summary of what you built
41
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
42
+ - `{BASE_SHA}` - Starting commit
43
+ - `{HEAD_SHA}` - Ending commit
83
44
 
84
- For plan fixes:
45
+ **3. Act on feedback:**
46
+ - Fix Critical issues immediately
47
+ - Fix Important issues before proceeding
48
+ - Note Minor issues for later
49
+ - Push back if reviewer is wrong (with reasoning)
85
50
 
86
- ```text
87
- Next:
88
- loopx approve <slug> --from review --to plan
89
- $plan <slug>
90
- ```
91
-
92
- For clarify fixes:
51
+ ## Example
93
52
 
94
- ```text
95
- Next:
96
- loopx approve <slug> --from review --to clarify
97
- $clarify <slug>
98
53
  ```
54
+ [Just completed Task 2: Add verification function]
99
55
 
100
- For approval:
56
+ You: Let me request code review before proceeding.
101
57
 
102
- ```text
103
- Next:
104
- $archive <slug>
105
- ```
58
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
59
+ HEAD_SHA=$(git rev-parse HEAD)
106
60
 
107
- `$archive` consumes the pending `review -> done` completion transition before syncing specs. Do not ask the user to run a separate `loopx approve <slug> --from review --to done` command in the normal Codex-facing flow.
61
+ [Dispatch code reviewer subagent]
62
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
63
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/loopx/plans/deployment-plan.md
64
+ BASE_SHA: a7981ec
65
+ HEAD_SHA: 3df7661
108
66
 
109
- For CLI/runtime debugging only, the equivalent explicit sequence is:
67
+ [Subagent returns]:
68
+ Strengths: Clean architecture, real tests
69
+ Issues:
70
+ Important: Missing progress indicators
71
+ Minor: Magic number (100) for reporting interval
72
+ Assessment: Ready to proceed
110
73
 
111
- ```bash
112
- loopx approve <slug> --from review --to done
113
- loopx archive <slug>
74
+ You: [Fix progress indicators]
75
+ [Continue to Task 3]
114
76
  ```
115
77
 
116
- This syncs the approved `.loopx/changes/active/<change-id>/spec-delta.md` into long-lived `.loopx/specs/` files and moves the change folder under `.loopx/changes/archive/<change-id>/`.
117
-
118
- ## Support Skill Review Lenses
78
+ ## Integration with Workflows
119
79
 
120
- Use loopx support skills as review lenses, not as implementation instructions:
80
+ **Subagent Exec:**
81
+ - Review after EACH task
82
+ - Catch issues before they compound
83
+ - Fix before moving to next task
121
84
 
122
- - `verify`: Evidence lens. Reject completion, passing, or review-ready claims that lack fresh command output and exit status.
123
- - `scope`: Completion lens. Reject full-completion claims when the execution record still declares remaining workflow scope or only a partial slice was implemented.
124
- - `tdd`: Behavior-change lens. Feature work and bug fixes should include failing-test or regression-test evidence unless the execution record explicitly explains why tests are not applicable.
125
- - `debug`: Failure-analysis lens. Fixes for bugs, test failures, build failures, and unexpected behavior should document root cause, not only symptoms or attempted patches.
126
- - `go-style`: Go diff lens. For `.go` changes, review happy-path structure, error handling, context usage, interface boundaries, naming, table tests, and `gofmt`/Go verification evidence.
127
- - `kratos`: Kratos diff lens. For Kratos/proto/service/biz/data/middleware/auth/config changes, review layer boundaries, generated-code flow, proto/package contracts, middleware/auth ordering, config compatibility, and project-native verification.
85
+ **Exec:**
86
+ - Review after each task or at natural checkpoints
87
+ - Get feedback, apply, continue
128
88
 
129
- These lenses can produce review findings when the execution package violates them. Do not run new build work from `review`; request rollback or changes instead.
89
+ **Ad-Hoc Development:**
90
+ - Review before merge
91
+ - Review when stuck
130
92
 
131
- ## Must Not Decide Automatically
93
+ ## Red Flags
132
94
 
133
- - final completion without an explicit approval step
134
- - re-running build work inside the review surface
135
- - editing code or rerunning build from inside review
95
+ **Never:**
96
+ - Skip review because "it's simple"
97
+ - Ignore Critical issues
98
+ - Proceed with unfixed Important issues
99
+ - Argue with valid technical feedback
136
100
 
137
- ## Notes
101
+ **If reviewer wrong:**
102
+ - Push back with technical reasoning
103
+ - Show code/tests that prove it works
104
+ - Request clarification
138
105
 
139
- - Review consumes structured outputs from the active loopx run. It should reject thin or placeholder-only evidence.
106
+ See template at: review/code-reviewer.md
@@ -0,0 +1,168 @@
1
+ # Code Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code reviewer subagent.
4
+
5
+ **Purpose:** Review completed work against requirements and code quality standards before it cascades into more work.
6
+
7
+ ```
8
+ Native subagent:
9
+ description: "Review code changes"
10
+ prompt: |
11
+ You are a Senior Code Reviewer with expertise in software architecture,
12
+ design patterns, and best practices. Your job is to review completed work
13
+ against its plan or requirements and identify issues before they cascade.
14
+
15
+ ## What Was Implemented
16
+
17
+ {DESCRIPTION}
18
+
19
+ ## Requirements / Plan
20
+
21
+ {PLAN_OR_REQUIREMENTS}
22
+
23
+ ## Git Range to Review
24
+
25
+ **Base:** {BASE_SHA}
26
+ **Head:** {HEAD_SHA}
27
+
28
+ ```bash
29
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
30
+ git diff {BASE_SHA}..{HEAD_SHA}
31
+ ```
32
+
33
+ ## What to Check
34
+
35
+ **Plan alignment:**
36
+ - Does the implementation match the plan / requirements?
37
+ - Are deviations justified improvements, or problematic departures?
38
+ - Is all planned functionality present?
39
+
40
+ **Code quality:**
41
+ - Clean separation of concerns?
42
+ - Proper error handling?
43
+ - Type safety where applicable?
44
+ - DRY without premature abstraction?
45
+ - Edge cases handled?
46
+
47
+ **Architecture:**
48
+ - Sound design decisions?
49
+ - Reasonable scalability and performance?
50
+ - Security concerns?
51
+ - Integrates cleanly with surrounding code?
52
+
53
+ **Testing:**
54
+ - Tests verify real behavior, not mocks?
55
+ - Edge cases covered?
56
+ - Integration tests where they matter?
57
+ - All tests passing?
58
+
59
+ **Production readiness:**
60
+ - Migration strategy if schema changed?
61
+ - Backward compatibility considered?
62
+ - Documentation complete?
63
+ - No obvious bugs?
64
+
65
+ ## Calibration
66
+
67
+ Categorize issues by actual severity. Not everything is Critical.
68
+ Acknowledge what was done well before listing issues — accurate praise
69
+ helps the implementer trust the rest of the feedback.
70
+
71
+ If you find significant deviations from the plan, flag them specifically
72
+ so the implementer can confirm whether the deviation was intentional.
73
+ If you find issues with the plan itself rather than the implementation,
74
+ say so.
75
+
76
+ ## Output Format
77
+
78
+ ### Strengths
79
+ [What's well done? Be specific.]
80
+
81
+ ### Issues
82
+
83
+ #### Critical (Must Fix)
84
+ [Bugs, security issues, data loss risks, broken functionality]
85
+
86
+ #### Important (Should Fix)
87
+ [Architecture problems, missing features, poor error handling, test gaps]
88
+
89
+ #### Minor (Nice to Have)
90
+ [Code style, optimization opportunities, documentation polish]
91
+
92
+ For each issue:
93
+ - File:line reference
94
+ - What's wrong
95
+ - Why it matters
96
+ - How to fix (if not obvious)
97
+
98
+ ### Recommendations
99
+ [Improvements for code quality, architecture, or process]
100
+
101
+ ### Assessment
102
+
103
+ **Ready to merge?** [Yes | No | With fixes]
104
+
105
+ **Reasoning:** [1-2 sentence technical assessment]
106
+
107
+ ## Critical Rules
108
+
109
+ **DO:**
110
+ - Categorize by actual severity
111
+ - Be specific (file:line, not vague)
112
+ - Explain WHY each issue matters
113
+ - Acknowledge strengths
114
+ - Give a clear verdict
115
+
116
+ **DON'T:**
117
+ - Say "looks good" without checking
118
+ - Mark nitpicks as Critical
119
+ - Give feedback on code you didn't actually read
120
+ - Be vague ("improve error handling")
121
+ - Avoid giving a clear verdict
122
+ ```
123
+
124
+ **Placeholders:**
125
+ - `{DESCRIPTION}` — brief summary of what was built
126
+ - `{PLAN_OR_REQUIREMENTS}` — what it should do (plan file path, task text, or requirements)
127
+ - `{BASE_SHA}` — starting commit
128
+ - `{HEAD_SHA}` — ending commit
129
+
130
+ **Reviewer returns:** Strengths, Issues (Critical / Important / Minor), Recommendations, Assessment
131
+
132
+ ## Example Output
133
+
134
+ ```
135
+ ### Strengths
136
+ - Clean database schema with proper migrations (db.ts:15-42)
137
+ - Comprehensive test coverage (18 tests, all edge cases)
138
+ - Good error handling with fallbacks (summarizer.ts:85-92)
139
+
140
+ ### Issues
141
+
142
+ #### Important
143
+ 1. **Missing help text in CLI wrapper**
144
+ - File: index-conversations:1-31
145
+ - Issue: No --help flag, users won't discover --concurrency
146
+ - Fix: Add --help case with usage examples
147
+
148
+ 2. **Date validation missing**
149
+ - File: search.ts:25-27
150
+ - Issue: Invalid dates silently return no results
151
+ - Fix: Validate ISO format, throw error with example
152
+
153
+ #### Minor
154
+ 1. **Progress indicators**
155
+ - File: indexer.ts:130
156
+ - Issue: No "X of Y" counter for long operations
157
+ - Impact: Users don't know how long to wait
158
+
159
+ ### Recommendations
160
+ - Add progress reporting for user experience
161
+ - Consider config file for excluded projects (portability)
162
+
163
+ ### Assessment
164
+
165
+ **Ready to merge: With fixes**
166
+
167
+ **Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
168
+ ```