@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.
- package/AGENTS.md +49 -0
- package/README.md +69 -448
- package/README.zh-CN.md +69 -459
- package/docs/loopx/design/loopx-skill-suite-v1-design.md +80 -0
- package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +81 -0
- package/package.json +7 -3
- package/plugins/loopx/.codex-plugin/plugin.json +4 -4
- package/plugins/loopx/skills/clarify/SKILL.md +38 -311
- package/plugins/loopx/skills/debug/SKILL.md +1 -1
- package/plugins/loopx/skills/exec/SKILL.md +71 -0
- package/plugins/loopx/skills/finish/SKILL.md +349 -0
- package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
- package/plugins/loopx/skills/go-style/SKILL.md +2 -2
- package/plugins/loopx/skills/kratos/SKILL.md +1 -1
- package/plugins/loopx/skills/plan/SKILL.md +138 -271
- package/plugins/loopx/skills/refactor-plan/SKILL.md +71 -0
- package/plugins/loopx/skills/review/SKILL.md +72 -105
- package/plugins/loopx/skills/review/code-reviewer.md +168 -0
- package/plugins/loopx/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
- package/plugins/loopx/skills/spec/SKILL.md +76 -0
- package/plugins/loopx/skills/subagent-exec/SKILL.md +282 -0
- package/plugins/loopx/skills/subagent-exec/agents/openai.yaml +3 -0
- package/plugins/loopx/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
- package/plugins/loopx/skills/subagent-exec/codex-subagents.md +37 -0
- package/plugins/loopx/skills/subagent-exec/implementer-prompt.md +113 -0
- package/plugins/loopx/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
- package/plugins/loopx/skills/tdd/SKILL.md +1 -1
- package/plugins/loopx/skills/verify/SKILL.md +1 -1
- package/scripts/claude-workflow-hook.mjs +109 -0
- package/scripts/codex-workflow-hook.mjs +2 -5
- package/scripts/install-skills.mjs +3 -3
- package/scripts/verify-skills.mjs +34 -2
- package/skills/RESOLVER.md +22 -17
- package/skills/clarify/SKILL.md +38 -311
- package/skills/debug/SKILL.md +1 -1
- package/skills/exec/SKILL.md +71 -0
- package/skills/finish/SKILL.md +349 -0
- package/skills/fix-review/SKILL.md +216 -0
- package/skills/go-style/SKILL.md +2 -2
- package/skills/kratos/SKILL.md +1 -1
- package/skills/plan/SKILL.md +138 -271
- package/skills/refactor-plan/SKILL.md +71 -0
- package/skills/review/SKILL.md +72 -105
- package/skills/review/code-reviewer.md +168 -0
- package/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
- package/skills/spec/SKILL.md +76 -0
- package/skills/subagent-exec/SKILL.md +282 -0
- package/skills/subagent-exec/agents/openai.yaml +3 -0
- package/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
- package/skills/subagent-exec/codex-subagents.md +37 -0
- package/skills/subagent-exec/implementer-prompt.md +113 -0
- package/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
- package/skills/tdd/SKILL.md +1 -1
- package/skills/verify/SKILL.md +1 -1
- package/src/autopilot-runtime.mjs +1 -1
- package/src/cli.mjs +78 -7
- package/src/context-manifest.mjs +2 -2
- package/src/html-views.mjs +129 -195
- package/src/install-discovery.mjs +210 -6
- package/src/next-skill.mjs +2 -4
- package/src/plan-runtime.mjs +219 -93
- package/src/runtime-maintenance.mjs +5 -2
- package/src/workflow.mjs +749 -71
- package/templates/architecture.md +58 -16
- package/templates/development-plan.md +42 -12
- package/plugins/loopx/scripts/plugin-install.test.mjs +0 -125
- package/plugins/loopx/skills/archive/SKILL.md +0 -55
- package/plugins/loopx/skills/autopilot/SKILL.md +0 -93
- package/plugins/loopx/skills/build/SKILL.md +0 -228
- package/skills/ai-slop-cleaner/SKILL.md +0 -114
- package/skills/archive/SKILL.md +0 -55
- package/skills/autopilot/SKILL.md +0 -93
- package/skills/autoresearch/SKILL.md +0 -68
- package/skills/build/SKILL.md +0 -228
- package/skills/deep-interview/SKILL.md +0 -461
- package/skills/ralph/SKILL.md +0 -271
- package/skills/ralplan/SKILL.md +0 -49
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec
|
|
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
|
+
when_to_use: "spec, design spec, technical design, design proposal, detailed design, architecture design, 设计方案, 概要设计, 详细设计, 技术方案"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.2.1"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# loopx Spec
|
|
10
|
+
|
|
11
|
+
Turn clarified requirements into design documents. Do not invent missing requirements. Do not write an implementation plan. Do not change code.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
Use the user's PRD, external requirements document, or approved `clarify` output as the source of truth.
|
|
16
|
+
|
|
17
|
+
Before writing, inspect relevant code and docs when the task touches an existing system. If a design question can be answered from the repo, answer it from evidence. If a material requirement, constraint, owner decision, or product behavior is still unclear, stop and route back to `clarify`.
|
|
18
|
+
|
|
19
|
+
## Core Loop
|
|
20
|
+
|
|
21
|
+
Write the design as a decision document, not a task list.
|
|
22
|
+
|
|
23
|
+
Use [DESIGN_SPEC_TEMPLATE.md](DESIGN_SPEC_TEMPLATE.md) as the required output structure. Keep the section order. If a section does not apply, write `无` or `不涉及` with a short reason instead of deleting it.
|
|
24
|
+
|
|
25
|
+
Cover:
|
|
26
|
+
|
|
27
|
+
- problem framing and design goals
|
|
28
|
+
- explicit non-goals and decision boundaries
|
|
29
|
+
- system context and affected modules
|
|
30
|
+
- proposed solution
|
|
31
|
+
- alternatives considered and why rejected
|
|
32
|
+
- data model, state model, and contracts
|
|
33
|
+
- key flows and edge cases
|
|
34
|
+
- failure modes, rollback, migration, and compatibility
|
|
35
|
+
- security, privacy, performance, and operational concerns when relevant
|
|
36
|
+
- testing and verification strategy
|
|
37
|
+
- open risks that do not block planning
|
|
38
|
+
|
|
39
|
+
For brownfield work, distinguish repo evidence from inference.
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
Write Markdown by default. Derive `<需求名>` from the clarified requirement title or the user's own wording, not from an opaque slug:
|
|
44
|
+
|
|
45
|
+
- `docs/loopx/design/<需求名>需求设计文档.md`
|
|
46
|
+
|
|
47
|
+
If the user asks for a presentable document or visual review artifact, also write:
|
|
48
|
+
|
|
49
|
+
- `docs/loopx/design/<需求名>需求设计文档.html`
|
|
50
|
+
|
|
51
|
+
The Markdown spec must include these sections:
|
|
52
|
+
|
|
53
|
+
- `# <项目/功能>设计文档`
|
|
54
|
+
- `一、修订历史`
|
|
55
|
+
- `二、需求信息`
|
|
56
|
+
- `三、概要设计`
|
|
57
|
+
- `四、详细设计`
|
|
58
|
+
- `五、存储类设计`
|
|
59
|
+
- `六、其他组件设计`
|
|
60
|
+
- `七、接口设计`
|
|
61
|
+
- `八、系统发布`
|
|
62
|
+
- `九、系统监控与维护`
|
|
63
|
+
- `十、排期与规划`
|
|
64
|
+
- `十一、QA`
|
|
65
|
+
|
|
66
|
+
The `十、排期与规划` section must include a `Planning Handoff` subsection stating what `plan` may decide without re-opening design and what must return to `clarify` or `spec`.
|
|
67
|
+
|
|
68
|
+
## Handoff
|
|
69
|
+
|
|
70
|
+
After the spec is complete, recommend:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
$plan docs/loopx/design/<需求名>需求设计文档.md
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use `plan` only after the design document is internally consistent and all material requirements questions are resolved.
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagent-exec
|
|
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
|
+
when_to_use: "approved implementation plan, independent tasks, subagent execution, staged spec review, code quality review, parallel-capable execution"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.2.1"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Subagent Exec
|
|
10
|
+
|
|
11
|
+
Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
|
|
12
|
+
|
|
13
|
+
**Why subagents:** You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
|
|
14
|
+
|
|
15
|
+
**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
|
|
16
|
+
|
|
17
|
+
**Continuous execution:** Do not pause to check in with your human partner between tasks. Execute all tasks from the plan without stopping. The only reasons to stop are: BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
```dot
|
|
22
|
+
digraph when_to_use {
|
|
23
|
+
"Have implementation plan?" [shape=diamond];
|
|
24
|
+
"Tasks mostly independent?" [shape=diamond];
|
|
25
|
+
"Stay in this session?" [shape=diamond];
|
|
26
|
+
"subagent-exec" [shape=box];
|
|
27
|
+
"exec" [shape=box];
|
|
28
|
+
"Manual execution or brainstorm first" [shape=box];
|
|
29
|
+
|
|
30
|
+
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
|
|
31
|
+
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
|
|
32
|
+
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
|
|
33
|
+
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
|
|
34
|
+
"Stay in this session?" -> "subagent-exec" [label="yes"];
|
|
35
|
+
"Stay in this session?" -> "exec" [label="no - parallel session"];
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**vs. Exec (parallel session):**
|
|
40
|
+
- Same session (no context switch)
|
|
41
|
+
- Fresh subagent per task (no context pollution)
|
|
42
|
+
- Two-stage review after each task: spec compliance first, then code quality
|
|
43
|
+
- Faster iteration (no human-in-loop between tasks)
|
|
44
|
+
|
|
45
|
+
## The Process
|
|
46
|
+
|
|
47
|
+
```dot
|
|
48
|
+
digraph process {
|
|
49
|
+
rankdir=TB;
|
|
50
|
+
|
|
51
|
+
subgraph cluster_per_task {
|
|
52
|
+
label="Per Task";
|
|
53
|
+
"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
|
|
54
|
+
"Implementer subagent asks questions?" [shape=diamond];
|
|
55
|
+
"Answer questions, provide context" [shape=box];
|
|
56
|
+
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
|
|
57
|
+
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
|
|
58
|
+
"Spec reviewer subagent confirms code matches spec?" [shape=diamond];
|
|
59
|
+
"Implementer subagent fixes spec gaps" [shape=box];
|
|
60
|
+
"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
|
|
61
|
+
"Code quality reviewer subagent approves?" [shape=diamond];
|
|
62
|
+
"Implementer subagent fixes quality issues" [shape=box];
|
|
63
|
+
"Mark task complete in update_plan" [shape=box];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
"Read plan, extract all tasks with full text, note context, create update_plan" [shape=box];
|
|
67
|
+
"More tasks remain?" [shape=diamond];
|
|
68
|
+
"Dispatch final code reviewer subagent for entire implementation" [shape=box];
|
|
69
|
+
"Use loopx:finish" [shape=box style=filled fillcolor=lightgreen];
|
|
70
|
+
|
|
71
|
+
"Read plan, extract all tasks with full text, note context, create update_plan" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
72
|
+
"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
|
|
73
|
+
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
|
|
74
|
+
"Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
75
|
+
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
|
|
76
|
+
"Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
|
|
77
|
+
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
|
|
78
|
+
"Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
|
|
79
|
+
"Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
|
|
80
|
+
"Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
|
|
81
|
+
"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
|
|
82
|
+
"Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
|
|
83
|
+
"Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
|
|
84
|
+
"Code quality reviewer subagent approves?" -> "Mark task complete in update_plan" [label="yes"];
|
|
85
|
+
"Mark task complete in update_plan" -> "More tasks remain?";
|
|
86
|
+
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
|
|
87
|
+
"More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
|
|
88
|
+
"Dispatch final code reviewer subagent for entire implementation" -> "Use loopx:finish";
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Model Selection
|
|
93
|
+
|
|
94
|
+
Use the least powerful model that can handle each role to conserve cost and increase speed.
|
|
95
|
+
|
|
96
|
+
**Mechanical implementation tasks** (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.
|
|
97
|
+
|
|
98
|
+
**Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
|
|
99
|
+
|
|
100
|
+
**Architecture, design, and review tasks**: use the most capable available model.
|
|
101
|
+
|
|
102
|
+
**Task complexity signals:**
|
|
103
|
+
- Touches 1-2 files with a complete spec → cheap model
|
|
104
|
+
- Touches multiple files with integration concerns → standard model
|
|
105
|
+
- Requires design judgment or broad codebase understanding → most capable model
|
|
106
|
+
|
|
107
|
+
## Handling Implementer Status
|
|
108
|
+
|
|
109
|
+
Implementer subagents report one of four statuses. Handle each appropriately:
|
|
110
|
+
|
|
111
|
+
**DONE:** Proceed to spec compliance review.
|
|
112
|
+
|
|
113
|
+
**DONE_WITH_CONCERNS:** The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.
|
|
114
|
+
|
|
115
|
+
**NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
|
|
116
|
+
|
|
117
|
+
**BLOCKED:** The implementer cannot complete the task. Assess the blocker:
|
|
118
|
+
1. If it's a context problem, provide more context and re-dispatch with the same model
|
|
119
|
+
2. If the task requires more reasoning, re-dispatch with a more capable model
|
|
120
|
+
3. If the task is too large, break it into smaller pieces
|
|
121
|
+
4. If the plan itself is wrong, escalate to the human
|
|
122
|
+
|
|
123
|
+
**Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
|
|
124
|
+
|
|
125
|
+
## Prompt Templates
|
|
126
|
+
|
|
127
|
+
- `./codex-subagents.md` - Codex subagent tool mapping and required runtime support
|
|
128
|
+
- `./implementer-prompt.md` - Dispatch implementer subagent
|
|
129
|
+
- `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
|
|
130
|
+
- `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
|
|
131
|
+
|
|
132
|
+
## Example Workflow
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
You: I'm using Subagent Exec to execute this plan.
|
|
136
|
+
|
|
137
|
+
[Read plan file once: docs/loopx/plans/feature-plan.md]
|
|
138
|
+
[Extract all 5 tasks with full text and context]
|
|
139
|
+
[create update_plan with all tasks]
|
|
140
|
+
|
|
141
|
+
Task 1: Hook installation script
|
|
142
|
+
|
|
143
|
+
[Get Task 1 text and context (already extracted)]
|
|
144
|
+
[Dispatch implementation subagent with full task text + context]
|
|
145
|
+
|
|
146
|
+
Implementer: "Before I begin - should the hook be installed at user or system level?"
|
|
147
|
+
|
|
148
|
+
You: "User level (~/.config/loopx/hooks/)"
|
|
149
|
+
|
|
150
|
+
Implementer: "Got it. Implementing now..."
|
|
151
|
+
[Later] Implementer:
|
|
152
|
+
- Implemented install-hook command
|
|
153
|
+
- Added tests, 5/5 passing
|
|
154
|
+
- Self-review: Found I missed --force flag, added it
|
|
155
|
+
- Committed
|
|
156
|
+
|
|
157
|
+
[Dispatch spec compliance reviewer]
|
|
158
|
+
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
|
|
159
|
+
|
|
160
|
+
[Get git SHAs, dispatch code quality reviewer]
|
|
161
|
+
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
|
|
162
|
+
|
|
163
|
+
[Mark Task 1 complete]
|
|
164
|
+
|
|
165
|
+
Task 2: Recovery modes
|
|
166
|
+
|
|
167
|
+
[Get Task 2 text and context (already extracted)]
|
|
168
|
+
[Dispatch implementation subagent with full task text + context]
|
|
169
|
+
|
|
170
|
+
Implementer: [No questions, proceeds]
|
|
171
|
+
Implementer:
|
|
172
|
+
- Added verify/repair modes
|
|
173
|
+
- 8/8 tests passing
|
|
174
|
+
- Self-review: All good
|
|
175
|
+
- Committed
|
|
176
|
+
|
|
177
|
+
[Dispatch spec compliance reviewer]
|
|
178
|
+
Spec reviewer: ❌ Issues:
|
|
179
|
+
- Missing: Progress reporting (spec says "report every 100 items")
|
|
180
|
+
- Extra: Added --json flag (not requested)
|
|
181
|
+
|
|
182
|
+
[Implementer fixes issues]
|
|
183
|
+
Implementer: Removed --json flag, added progress reporting
|
|
184
|
+
|
|
185
|
+
[Spec reviewer reviews again]
|
|
186
|
+
Spec reviewer: ✅ Spec compliant now
|
|
187
|
+
|
|
188
|
+
[Dispatch code quality reviewer]
|
|
189
|
+
Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
|
|
190
|
+
|
|
191
|
+
[Implementer fixes]
|
|
192
|
+
Implementer: Extracted PROGRESS_INTERVAL constant
|
|
193
|
+
|
|
194
|
+
[Code reviewer reviews again]
|
|
195
|
+
Code reviewer: ✅ Approved
|
|
196
|
+
|
|
197
|
+
[Mark Task 2 complete]
|
|
198
|
+
|
|
199
|
+
...
|
|
200
|
+
|
|
201
|
+
[After all tasks]
|
|
202
|
+
[Dispatch final code-reviewer]
|
|
203
|
+
Final reviewer: All requirements met, ready to merge
|
|
204
|
+
|
|
205
|
+
Done!
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Advantages
|
|
209
|
+
|
|
210
|
+
**vs. Manual execution:**
|
|
211
|
+
- Subagents follow TDD naturally
|
|
212
|
+
- Fresh context per task (no confusion)
|
|
213
|
+
- Parallel-safe (subagents don't interfere)
|
|
214
|
+
- Subagent can ask questions (before AND during work)
|
|
215
|
+
|
|
216
|
+
**vs. Exec:**
|
|
217
|
+
- Same session (no handoff)
|
|
218
|
+
- Continuous progress (no waiting)
|
|
219
|
+
- Review checkpoints automatic
|
|
220
|
+
|
|
221
|
+
**Efficiency gains:**
|
|
222
|
+
- No file reading overhead (controller provides full text)
|
|
223
|
+
- Controller curates exactly what context is needed
|
|
224
|
+
- Subagent gets complete information upfront
|
|
225
|
+
- Questions surfaced before work begins (not after)
|
|
226
|
+
|
|
227
|
+
**Quality gates:**
|
|
228
|
+
- Self-review catches issues before handoff
|
|
229
|
+
- Two-stage review: spec compliance, then code quality
|
|
230
|
+
- Review loops ensure fixes actually work
|
|
231
|
+
- Spec compliance prevents over/under-building
|
|
232
|
+
- Code quality ensures implementation is well-built
|
|
233
|
+
|
|
234
|
+
**Cost:**
|
|
235
|
+
- More subagent invocations (implementer + 2 reviewers per task)
|
|
236
|
+
- Controller does more prep work (extracting all tasks upfront)
|
|
237
|
+
- Review loops add iterations
|
|
238
|
+
- But catches issues early (cheaper than debugging later)
|
|
239
|
+
|
|
240
|
+
## Red Flags
|
|
241
|
+
|
|
242
|
+
**Never:**
|
|
243
|
+
- Skip reviews (spec compliance OR code quality)
|
|
244
|
+
- Proceed with unfixed issues
|
|
245
|
+
- Dispatch multiple implementation subagents in parallel (conflicts)
|
|
246
|
+
- Make subagent read plan file (provide full text instead)
|
|
247
|
+
- Skip scene-setting context (subagent needs to understand where task fits)
|
|
248
|
+
- Ignore subagent questions (answer before letting them proceed)
|
|
249
|
+
- Accept "close enough" on spec compliance (spec reviewer found issues = not done)
|
|
250
|
+
- Skip review loops (reviewer found issues = implementer fixes = review again)
|
|
251
|
+
- Let implementer self-review replace actual review (both are needed)
|
|
252
|
+
- **Start code quality review before spec compliance is ✅** (wrong order)
|
|
253
|
+
- Move to next task while either review has open issues
|
|
254
|
+
|
|
255
|
+
**If subagent asks questions:**
|
|
256
|
+
- Answer clearly and completely
|
|
257
|
+
- Provide additional context if needed
|
|
258
|
+
- Don't rush them into implementation
|
|
259
|
+
|
|
260
|
+
**If reviewer finds issues:**
|
|
261
|
+
- Implementer (same subagent) fixes them
|
|
262
|
+
- Reviewer reviews again
|
|
263
|
+
- Repeat until approved
|
|
264
|
+
- Don't skip the re-review
|
|
265
|
+
|
|
266
|
+
**If subagent fails task:**
|
|
267
|
+
- Dispatch fix subagent with specific instructions
|
|
268
|
+
- Don't try to fix manually (context pollution)
|
|
269
|
+
|
|
270
|
+
## Integration
|
|
271
|
+
|
|
272
|
+
**Required workflow skills:**
|
|
273
|
+
|
|
274
|
+
- **loopx:plan** - Creates the plan this skill executes
|
|
275
|
+
- **loopx:review** - Code review template for reviewer subagents
|
|
276
|
+
- **loopx:finish** - Complete development after all tasks
|
|
277
|
+
|
|
278
|
+
**Subagents should use:**
|
|
279
|
+
- **loopx:tdd** - Subagents follow TDD for each task
|
|
280
|
+
|
|
281
|
+
**Alternative workflow:**
|
|
282
|
+
- **loopx:exec** - Use for parallel session instead of same-session execution
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code Quality Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a code quality reviewer subagent.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Verify implementation is well-built (clean, tested, maintainable)
|
|
6
|
+
|
|
7
|
+
**Only dispatch after spec compliance review passes.**
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Native Codex subagent:
|
|
11
|
+
Use template at review/code-reviewer.md
|
|
12
|
+
|
|
13
|
+
DESCRIPTION: [task summary, from implementer's report]
|
|
14
|
+
PLAN_OR_REQUIREMENTS: Task N from [plan-file]
|
|
15
|
+
BASE_SHA: [commit before task]
|
|
16
|
+
HEAD_SHA: [current commit]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**In addition to standard code quality concerns, the reviewer should check:**
|
|
20
|
+
- Does each file have one clear responsibility with a well-defined interface?
|
|
21
|
+
- Are units decomposed so they can be understood and tested independently?
|
|
22
|
+
- Is the implementation following the file structure from the plan?
|
|
23
|
+
- Did this implementation create new files that are already large, or significantly grow existing files? (Don't flag pre-existing file sizes — focus on what this change contributed.)
|
|
24
|
+
|
|
25
|
+
**Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Codex Subagent Tool Mapping
|
|
2
|
+
|
|
3
|
+
Use this reference before executing this skill in Codex.
|
|
4
|
+
|
|
5
|
+
## Tool Mapping
|
|
6
|
+
|
|
7
|
+
| Skill action | Codex equivalent |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Dispatch one implementer or reviewer subagent | `spawn_agent` |
|
|
10
|
+
| Dispatch independent subagents in parallel | multiple `spawn_agent` calls |
|
|
11
|
+
| Wait for a subagent result | `wait_agent` |
|
|
12
|
+
| Free a completed subagent slot | `close_agent` |
|
|
13
|
+
| Track task state | `update_plan` |
|
|
14
|
+
| Read, edit, or run commands | native Codex file and shell tools |
|
|
15
|
+
|
|
16
|
+
## Required Runtime Support
|
|
17
|
+
|
|
18
|
+
Subagent dispatch requires Codex multi-agent support. If `spawn_agent`,
|
|
19
|
+
`wait_agent`, or `close_agent` are unavailable, do not pretend this skill ran
|
|
20
|
+
as subagent-driven development. Use `loopx:exec` instead.
|
|
21
|
+
|
|
22
|
+
Codex environments that require explicit feature flags should enable:
|
|
23
|
+
|
|
24
|
+
```toml
|
|
25
|
+
[features]
|
|
26
|
+
multi_agent = true
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Execution Rules
|
|
30
|
+
|
|
31
|
+
- Spawn fresh subagents with complete task text and only the context they need.
|
|
32
|
+
- Use implementer, spec reviewer, and code quality reviewer prompts from this directory.
|
|
33
|
+
- Do not make subagents read the whole plan file; paste the relevant task text.
|
|
34
|
+
- Keep implementation tasks sequential unless write scopes are clearly disjoint.
|
|
35
|
+
- Use `wait_agent` only when the next controller step needs that result.
|
|
36
|
+
- Close completed agents after their result is integrated.
|
|
37
|
+
- Keep the controller responsible for integration, review loops, and final status.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Implementer Subagent Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching an implementer subagent.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Native Codex subagent:
|
|
7
|
+
description: "Implement Task N: [task name]"
|
|
8
|
+
prompt: |
|
|
9
|
+
You are implementing Task N: [task name]
|
|
10
|
+
|
|
11
|
+
## Task Description
|
|
12
|
+
|
|
13
|
+
[FULL TEXT of task from plan - paste it here, don't make subagent read file]
|
|
14
|
+
|
|
15
|
+
## Context
|
|
16
|
+
|
|
17
|
+
[Scene-setting: where this fits, dependencies, architectural context]
|
|
18
|
+
|
|
19
|
+
## Before You Begin
|
|
20
|
+
|
|
21
|
+
If you have questions about:
|
|
22
|
+
- The requirements or acceptance criteria
|
|
23
|
+
- The approach or implementation strategy
|
|
24
|
+
- Dependencies or assumptions
|
|
25
|
+
- Anything unclear in the task description
|
|
26
|
+
|
|
27
|
+
**Ask them now.** Raise any concerns before starting work.
|
|
28
|
+
|
|
29
|
+
## Your Job
|
|
30
|
+
|
|
31
|
+
Once you're clear on requirements:
|
|
32
|
+
1. Implement exactly what the task specifies
|
|
33
|
+
2. Write tests (following TDD if task says to)
|
|
34
|
+
3. Verify implementation works
|
|
35
|
+
4. Commit your work
|
|
36
|
+
5. Self-review (see below)
|
|
37
|
+
6. Report back
|
|
38
|
+
|
|
39
|
+
Work from: [directory]
|
|
40
|
+
|
|
41
|
+
**While you work:** If you encounter something unexpected or unclear, **ask questions**.
|
|
42
|
+
It's always OK to pause and clarify. Don't guess or make assumptions.
|
|
43
|
+
|
|
44
|
+
## Code Organization
|
|
45
|
+
|
|
46
|
+
You reason best about code you can hold in context at once, and your edits are more
|
|
47
|
+
reliable when files are focused. Keep this in mind:
|
|
48
|
+
- Follow the file structure defined in the plan
|
|
49
|
+
- Each file should have one clear responsibility with a well-defined interface
|
|
50
|
+
- If a file you're creating is growing beyond the plan's intent, stop and report
|
|
51
|
+
it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
|
|
52
|
+
- If an existing file you're modifying is already large or tangled, work carefully
|
|
53
|
+
and note it as a concern in your report
|
|
54
|
+
- In existing codebases, follow established patterns. Improve code you're touching
|
|
55
|
+
the way a good developer would, but don't restructure things outside your task.
|
|
56
|
+
|
|
57
|
+
## When You're in Over Your Head
|
|
58
|
+
|
|
59
|
+
It is always OK to stop and say "this is too hard for me." Bad work is worse than
|
|
60
|
+
no work. You will not be penalized for escalating.
|
|
61
|
+
|
|
62
|
+
**STOP and escalate when:**
|
|
63
|
+
- The task requires architectural decisions with multiple valid approaches
|
|
64
|
+
- You need to understand code beyond what was provided and can't find clarity
|
|
65
|
+
- You feel uncertain about whether your approach is correct
|
|
66
|
+
- The task involves restructuring existing code in ways the plan didn't anticipate
|
|
67
|
+
- You've been reading file after file trying to understand the system without progress
|
|
68
|
+
|
|
69
|
+
**How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
|
|
70
|
+
specifically what you're stuck on, what you've tried, and what kind of help you need.
|
|
71
|
+
The controller can provide more context, re-dispatch with a more capable model,
|
|
72
|
+
or break the task into smaller pieces.
|
|
73
|
+
|
|
74
|
+
## Before Reporting Back: Self-Review
|
|
75
|
+
|
|
76
|
+
Review your work with fresh eyes. Ask yourself:
|
|
77
|
+
|
|
78
|
+
**Completeness:**
|
|
79
|
+
- Did I fully implement everything in the spec?
|
|
80
|
+
- Did I miss any requirements?
|
|
81
|
+
- Are there edge cases I didn't handle?
|
|
82
|
+
|
|
83
|
+
**Quality:**
|
|
84
|
+
- Is this my best work?
|
|
85
|
+
- Are names clear and accurate (match what things do, not how they work)?
|
|
86
|
+
- Is the code clean and maintainable?
|
|
87
|
+
|
|
88
|
+
**Discipline:**
|
|
89
|
+
- Did I avoid overbuilding (YAGNI)?
|
|
90
|
+
- Did I only build what was requested?
|
|
91
|
+
- Did I follow existing patterns in the codebase?
|
|
92
|
+
|
|
93
|
+
**Testing:**
|
|
94
|
+
- Do tests actually verify behavior (not just mock behavior)?
|
|
95
|
+
- Did I follow TDD if required?
|
|
96
|
+
- Are tests comprehensive?
|
|
97
|
+
|
|
98
|
+
If you find issues during self-review, fix them now before reporting.
|
|
99
|
+
|
|
100
|
+
## Report Format
|
|
101
|
+
|
|
102
|
+
When done, report:
|
|
103
|
+
- **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
104
|
+
- What you implemented (or what you attempted, if blocked)
|
|
105
|
+
- What you tested and test results
|
|
106
|
+
- Files changed
|
|
107
|
+
- Self-review findings (if any)
|
|
108
|
+
- Any issues or concerns
|
|
109
|
+
|
|
110
|
+
Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
|
|
111
|
+
Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
|
|
112
|
+
information that wasn't provided. Never silently produce work you're unsure about.
|
|
113
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Spec Compliance Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a spec compliance reviewer subagent.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Verify implementer built what was requested (nothing more, nothing less)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Native Codex subagent:
|
|
9
|
+
description: "Review spec compliance for Task N"
|
|
10
|
+
prompt: |
|
|
11
|
+
You are reviewing whether an implementation matches its specification.
|
|
12
|
+
|
|
13
|
+
## What Was Requested
|
|
14
|
+
|
|
15
|
+
[FULL TEXT of task requirements]
|
|
16
|
+
|
|
17
|
+
## What Implementer Claims They Built
|
|
18
|
+
|
|
19
|
+
[From implementer's report]
|
|
20
|
+
|
|
21
|
+
## CRITICAL: Do Not Trust the Report
|
|
22
|
+
|
|
23
|
+
The implementer finished suspiciously quickly. Their report may be incomplete,
|
|
24
|
+
inaccurate, or optimistic. You MUST verify everything independently.
|
|
25
|
+
|
|
26
|
+
**DO NOT:**
|
|
27
|
+
- Take their word for what they implemented
|
|
28
|
+
- Trust their claims about completeness
|
|
29
|
+
- Accept their interpretation of requirements
|
|
30
|
+
|
|
31
|
+
**DO:**
|
|
32
|
+
- Read the actual code they wrote
|
|
33
|
+
- Compare actual implementation to requirements line by line
|
|
34
|
+
- Check for missing pieces they claimed to implement
|
|
35
|
+
- Look for extra features they didn't mention
|
|
36
|
+
|
|
37
|
+
## Your Job
|
|
38
|
+
|
|
39
|
+
Read the implementation code and verify:
|
|
40
|
+
|
|
41
|
+
**Missing requirements:**
|
|
42
|
+
- Did they implement everything that was requested?
|
|
43
|
+
- Are there requirements they skipped or missed?
|
|
44
|
+
- Did they claim something works but didn't actually implement it?
|
|
45
|
+
|
|
46
|
+
**Extra/unneeded work:**
|
|
47
|
+
- Did they build things that weren't requested?
|
|
48
|
+
- Did they over-engineer or add unnecessary features?
|
|
49
|
+
- Did they add "nice to haves" that weren't in spec?
|
|
50
|
+
|
|
51
|
+
**Misunderstandings:**
|
|
52
|
+
- Did they interpret requirements differently than intended?
|
|
53
|
+
- Did they solve the wrong problem?
|
|
54
|
+
- Did they implement the right feature but wrong way?
|
|
55
|
+
|
|
56
|
+
**Verify by reading code, not by trusting report.**
|
|
57
|
+
|
|
58
|
+
Report:
|
|
59
|
+
- ✅ Spec compliant (if everything matches after code inspection)
|
|
60
|
+
- ❌ Issues found: [list specifically what's missing or extra, with file:line references]
|
|
61
|
+
```
|
package/skills/tdd/SKILL.md
CHANGED
|
@@ -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.1
|
|
6
|
+
version: "0.2.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Test-Driven Development (TDD)
|
package/skills/verify/SKILL.md
CHANGED
|
@@ -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.1
|
|
6
|
+
version: "0.2.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Verification Before Completion
|
|
@@ -55,7 +55,7 @@ export function createRealAutopilotAdapter({ model } = {}) {
|
|
|
55
55
|
'Required spec frontmatter updates:',
|
|
56
56
|
'- unresolved_ambiguity_count: 0',
|
|
57
57
|
'- current_round: at least 1',
|
|
58
|
-
'- ambiguity_score:
|
|
58
|
+
'- ambiguity_score: 0',
|
|
59
59
|
'- non_goals_resolved: true',
|
|
60
60
|
'- decision_boundaries_resolved: true',
|
|
61
61
|
'- pressure_pass_complete: true',
|