@ai-content-space/loopx 0.1.9 → 0.2.0
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 +50 -0
- package/README.md +59 -446
- package/README.zh-CN.md +59 -457
- package/docs/loopx/design/loopx-skill-suite-v1-design.md +73 -0
- package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +77 -0
- package/package.json +5 -2
- package/plugins/loopx/.codex-plugin/plugin.json +4 -4
- package/plugins/loopx/scripts/plugin-install.test.mjs +20 -20
- 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 +254 -0
- package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
- package/plugins/loopx/skills/go-style/SKILL.md +1 -1
- package/plugins/loopx/skills/kratos/SKILL.md +1 -1
- package/plugins/loopx/skills/plan/SKILL.md +136 -258
- 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 +32 -1
- package/skills/RESOLVER.md +26 -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 +254 -0
- package/skills/fix-review/SKILL.md +216 -0
- package/skills/go-style/SKILL.md +1 -1
- package/skills/kratos/SKILL.md +1 -1
- package/skills/plan/SKILL.md +136 -258
- 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 +79 -5
- package/src/context-manifest.mjs +2 -2
- package/src/html-views.mjs +457 -95
- package/src/install-discovery.mjs +210 -6
- package/src/next-skill.mjs +2 -4
- package/src/plan-runtime.mjs +572 -93
- package/src/runtime-maintenance.mjs +60 -16
- package/src/workflow.mjs +989 -65
- package/templates/architecture.md +58 -16
- package/templates/development-plan.md +42 -12
- 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/archive/SKILL.md +0 -55
- package/skills/autopilot/SKILL.md +0 -93
- package/skills/build/SKILL.md +0 -228
package/README.zh-CN.md
CHANGED
|
@@ -1,167 +1,108 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./assets/logo.svg" alt="loopx
|
|
2
|
+
<img src="./assets/logo.svg" alt="loopx logo" width="128" height="128">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">loopx</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
面向
|
|
8
|
+
面向 agentic coding assistants 的 skill-first 工作流套件。
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
[English](./README.md)
|
|
12
12
|
|
|
13
|
-
`loopx`
|
|
13
|
+
`loopx` 为 Codex 和 Claude 风格的 coding agent 打包一组实用 skills。它把 grill-me 式需求澄清和 superpowers 式计划、执行、评审、收尾流程组合成一套可安装、可治理的技能套件。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
推荐 v1 流程:
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
|
-
clarify -> plan ->
|
|
18
|
+
clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
`
|
|
21
|
+
`spec` 是条件设计门。涉及 API、数据、状态、权限、迁移、兼容、产品行为或架构决策时使用;只剩局部实现选择时可以跳过,直接进入 `plan`。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
## Skills
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
核心工作流 skills:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
- `clarify`:持续追问直到范围、非目标、约束和决策边界清楚。
|
|
28
|
+
- `spec`:在需要设计决策时写设计文档或轻量 design note。
|
|
29
|
+
- `plan`:按 superpowers `writing-plans` 风格写小步实施计划。
|
|
30
|
+
- `subagent-exec`:用 fresh subagents 和 staged review 执行已批准计划。
|
|
31
|
+
- `exec`:没有 subagent 或用户选择 inline 时顺序执行计划。
|
|
32
|
+
- `review`:基于 git range 和计划/需求发起独立代码评审。
|
|
33
|
+
- `fix-review`:严谨评估并处理 code review feedback。
|
|
34
|
+
- `finish`:验证完成后选择 merge、PR、保留或丢弃。
|
|
35
|
+
- `refactor-plan`:访谈并写行为保持的 tiny-commit 重构计划。
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
- 通过 `skills/RESOLVER.md` 明确 bundled skill 路由,并用确定性治理脚本检查 frontmatter、plugin 镜像、resolver 覆盖、本地引用、发布包包含项和版本一致性。
|
|
31
|
-
- 支持 npm 全局安装和 Codex plugin 安装,两种安装方式共享同一套 install/discovery 逻辑。
|
|
32
|
-
- 自动安装 loopx 管理的 Codex workflow hook,在 Codex 中提示当前 workflow 状态和安全下一步。
|
|
33
|
-
- 所有运行时状态和阶段产物都写入项目本地 `.loopx/`,便于审计、恢复和迁移。
|
|
34
|
-
- clarify 需求快照写入 `.loopx/intake/`,让 `.loopx/specs/` 只承载长期领域规格。
|
|
35
|
-
- init 时会把已有项目 AI 规则、既有 spec 来源和自动发现的验证命令记录到 `.loopx/config.json`,让 loopx 保留项目原有事实源,同时继续执行完整闭环。
|
|
36
|
-
- `plan` 默认采用 Planner -> Architect -> Critic 的共识规划循环。
|
|
37
|
-
- `plan` 会写入借鉴 OpenSpec 的 change artifacts:proposal、spec delta、design、tasks 和 artifact dependency graph。
|
|
38
|
-
- 提供项目级 agent context:`.loopx/agents/` 和 `.loopx/context/domain.md`,供 build/review 的 context manifest 消费。
|
|
39
|
-
- `build` 默认包含执行记录、验证证据、架构验收、deslop 清理和回归再验证。
|
|
40
|
-
- `review` 作为独立验收面,包含代码审查和内部 architecture-smell lane,并输出中文评审结论和 go/no-go 判断。
|
|
41
|
-
- 支持 `archive`,把已批准的 change delta 同步进长期 `.loopx/specs/` source of truth,并生成 ADR candidate。
|
|
37
|
+
辅助 skills:
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
- `tdd`
|
|
40
|
+
- `debug`
|
|
41
|
+
- `verify`
|
|
42
|
+
- `go-style`
|
|
43
|
+
- `kratos`
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
## 产物
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
npm install -g @ai-content-space/loopx
|
|
49
|
-
```
|
|
47
|
+
人工维护的长期产物放在 `docs/loopx/`:
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
49
|
+
- `docs/loopx/design/`
|
|
50
|
+
- `docs/loopx/plans/`
|
|
51
|
+
- `docs/loopx/reviews/`
|
|
52
|
+
- `docs/loopx/refactors/`
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
`.loopx/` 用于本地支撑状态、hook 诊断、安装元数据和 legacy runtime workflows。
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
~/.agents/skills/
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
同时也会把 loopx 管理的 Codex workflow hook 安装到:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
~/.codex/hooks/codex-workflow-hook.mjs
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
并更新:
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
~/.agents/.skill-lock.json
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Codex plugin 安装
|
|
76
|
-
|
|
77
|
-
插件入口位于:
|
|
78
|
-
|
|
79
|
-
```text
|
|
80
|
-
plugins/loopx/
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
插件安装脚本:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
node plugins/loopx/scripts/plugin-install.mjs
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
npm 安装和 plugin 安装会收敛到同一个 `installationIdentity=loopx`,避免 Codex 里出现重复的 loopx skill 集合。
|
|
90
|
-
|
|
91
|
-
## 快速开始
|
|
92
|
-
|
|
93
|
-
初始化一个工作流:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
loopx init --slug my-task
|
|
97
|
-
```
|
|
56
|
+
## 安装
|
|
98
57
|
|
|
99
|
-
|
|
58
|
+
全局安装:
|
|
100
59
|
|
|
101
60
|
```bash
|
|
102
|
-
|
|
61
|
+
npm install -g @ai-content-space/loopx
|
|
103
62
|
```
|
|
104
63
|
|
|
105
|
-
|
|
64
|
+
postinstall 默认安装 Codex 和 Claude 用户级 skills 与 hooks:
|
|
106
65
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
66
|
+
- Codex skills:`~/.agents/skills/`
|
|
67
|
+
- Claude skills:`~/.claude/skills/`
|
|
68
|
+
- Codex hook:`~/.codex/hooks/codex-workflow-hook.mjs`
|
|
69
|
+
- Claude hook:`~/.claude/hooks/loopx-workflow-hook.mjs`
|
|
111
70
|
|
|
112
|
-
|
|
71
|
+
也可以手动运行安装器或交互式选择目标:
|
|
113
72
|
|
|
114
73
|
```bash
|
|
115
|
-
loopx
|
|
116
|
-
loopx
|
|
74
|
+
loopx install-skills
|
|
75
|
+
loopx install-skills --target codex
|
|
76
|
+
loopx install-skills --target claude
|
|
77
|
+
loopx install-skills --target claude --project
|
|
78
|
+
loopx install-skills --target all --yes
|
|
117
79
|
```
|
|
118
80
|
|
|
119
|
-
|
|
81
|
+
Claude project install 会写入当前仓库的 `.claude/skills/` 和 `.claude/settings.json`。
|
|
120
82
|
|
|
121
|
-
|
|
122
|
-
loopx approve my-task --from build --to review
|
|
123
|
-
loopx review my-task
|
|
124
|
-
```
|
|
83
|
+
## Codex Plugin
|
|
125
84
|
|
|
126
|
-
|
|
85
|
+
Codex plugin shell 位于:
|
|
127
86
|
|
|
128
87
|
```text
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
当 review 已批准并路由到 `done` 时,`$archive` 会先消费 pending 的 `review -> done` 完成态,再同步 specs。纯 CLI 操作者仍然可以显式执行 `loopx approve my-task --from review --to done`,再执行 `loopx archive my-task`。
|
|
133
|
-
|
|
134
|
-
查看状态:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
loopx status my-task
|
|
138
|
-
loopx status my-task --json
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
plan 完成后会自动写入派生 HTML 阅读视图,方便直接审阅计划:
|
|
142
|
-
|
|
143
|
-
```text
|
|
144
|
-
.loopx/workflows/my-task/view/index.html
|
|
145
|
-
.loopx/workflows/my-task/view/plan.html
|
|
146
|
-
.loopx/views/index.html
|
|
88
|
+
plugins/loopx/
|
|
147
89
|
```
|
|
148
90
|
|
|
149
|
-
|
|
91
|
+
插件安装脚本:
|
|
150
92
|
|
|
151
93
|
```bash
|
|
152
|
-
loopx
|
|
94
|
+
node plugins/loopx/scripts/plugin-install.mjs
|
|
153
95
|
```
|
|
154
96
|
|
|
155
|
-
|
|
97
|
+
插件镜像 canonical `skills/` 目录,并复用同一套 install/discovery core。
|
|
156
98
|
|
|
157
|
-
|
|
158
|
-
loopx plan --direct ./path/to/spec.md
|
|
159
|
-
```
|
|
99
|
+
## CLI
|
|
160
100
|
|
|
161
|
-
|
|
101
|
+
CLI 用于安装、诊断、渲染和 legacy runtime 兼容:
|
|
162
102
|
|
|
163
103
|
```bash
|
|
164
|
-
loopx
|
|
104
|
+
loopx install-skills [--target <codex|claude|all>] [--project] [--mode <copy|symlink>] [--dir <path>] [--yes]
|
|
105
|
+
loopx init [--slug <slug>] [--enable-agent-delegation] [--auto-agent-delegation] [--agent-delegation-threshold <local|critic-only|parallel-review>]
|
|
165
106
|
loopx clarify <slug> [--standard|--deep]
|
|
166
107
|
loopx approve <slug> --from <stage> --to <stage>
|
|
167
108
|
loopx plan [slug] [--direct <spec-path>] [--interactive] [--deliberate]
|
|
@@ -178,11 +119,9 @@ loopx migrate
|
|
|
178
119
|
loopx repair-install
|
|
179
120
|
```
|
|
180
121
|
|
|
181
|
-
|
|
122
|
+
Legacy `.loopx/workflows/` 命令仍保留兼容,但不是 v1 skill-suite workflow。
|
|
182
123
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
## Skill 路由与治理
|
|
124
|
+
## 治理
|
|
186
125
|
|
|
187
126
|
bundled skill resolver 位于:
|
|
188
127
|
|
|
@@ -190,347 +129,10 @@ bundled skill resolver 位于:
|
|
|
190
129
|
skills/RESOLVER.md
|
|
191
130
|
```
|
|
192
131
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
skill 治理由下面的确定性脚本执行:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
node scripts/verify-skills.mjs
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
该脚本会检查 bundled skill frontmatter 是否可触发且有排除边界、`metadata.version` 是否匹配 `package.json`、plugin skill 镜像是否与 canonical skills 一致、`skills/RESOLVER.md` 是否覆盖所有 bundled skills 且没有陈旧 bundled-skill 引用、本地 skill 引用是否存在、plugin manifest 版本是否匹配 package 版本,以及 verifier 本身是否进入 npm 发布包。
|
|
202
|
-
|
|
203
|
-
## Skill 说明
|
|
204
|
-
|
|
205
|
-
### clarify
|
|
206
|
-
|
|
207
|
-
`clarify` 用于把模糊请求转成可执行 spec。它会维护歧义分数、非目标、决策边界和压力测试结果。只有满足门禁后,才建议进入 `plan`。
|
|
208
|
-
|
|
209
|
-
默认 profile:
|
|
210
|
-
|
|
211
|
-
- `--standard`:目标歧义分数 `<= 0.20`,最多 `15` 轮。
|
|
212
|
-
- `--deep`:目标歧义分数 `<= 0.10`,最多 `25` 轮。
|
|
213
|
-
|
|
214
|
-
### plan
|
|
215
|
-
|
|
216
|
-
`plan` 把已批准的 clarify spec 或直接输入的 spec 转成计划包。默认包含 Planner、Architect、Critic 三段式评审循环,最多迭代到通过或达到上限。
|
|
217
|
-
|
|
218
|
-
主要产物:
|
|
219
|
-
|
|
220
|
-
- `.loopx/plans/prd-<slug>.md`
|
|
221
|
-
- `.loopx/plans/test-spec-<slug>.md`
|
|
222
|
-
- `.loopx/changes/active/<change-id>/proposal.md`
|
|
223
|
-
- `.loopx/changes/active/<change-id>/spec-delta.md`
|
|
224
|
-
- `.loopx/changes/active/<change-id>/design.md`
|
|
225
|
-
- `.loopx/changes/active/<change-id>/tasks.md`
|
|
226
|
-
- `.loopx/changes/active/<change-id>/slices.json`
|
|
227
|
-
- `.loopx/changes/active/<change-id>/artifact-graph.json`
|
|
228
|
-
- `.loopx/workflows/<slug>/plan.md`
|
|
229
|
-
- `.loopx/workflows/<slug>/architecture.md`
|
|
230
|
-
- `.loopx/workflows/<slug>/development-plan.md`
|
|
231
|
-
- `.loopx/workflows/<slug>/test-plan.md`
|
|
232
|
-
- `.loopx/workflows/<slug>/requirement-traceability.md`
|
|
233
|
-
|
|
234
|
-
plan 成功后,loopx 还会写入派生阅读视图:`.loopx/workflows/<slug>/view/index.html`、`.loopx/workflows/<slug>/view/plan.html` 和 `.loopx/views/index.html`。这些视图用于人工审阅;Markdown 和 JSON 仍然是可编辑事实源。
|
|
235
|
-
|
|
236
|
-
`requirement-traceability.md` 会把原始需求或 PRD 映射到生成的 plan package、change delta、vertical slices 和测试。若显式需求覆盖项或需求表格项没有被计划包覆盖,`plan` 会在 build approval 前保持 blocked。
|
|
237
|
-
|
|
238
|
-
`spec-delta.md` 使用 requirement delta:`## ADDED Requirements`、`## MODIFIED Requirements`、`## REMOVED Requirements` 和 `## RENAMED Requirements`。ADDED / MODIFIED 必须是完整的 `### Requirement:` 块,包含 SHALL/MUST 约束和 `#### Scenario:` 场景,archive 才能把它们合并进长期 spec 当前状态。
|
|
239
|
-
|
|
240
|
-
### build
|
|
241
|
-
|
|
242
|
-
`build` 执行已批准的计划,并把执行过程、验证证据和限制记录到 canonical artifact:
|
|
243
|
-
|
|
244
|
-
```text
|
|
245
|
-
.loopx/workflows/<slug>/execution-record.md
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
`build` 内部保留结构化 runtime lanes,同时增加 Ralph-like owner loop:单一 owner 持续推进,可并行 delegation,但进入 review handoff 前必须满足 blocking delegation 已 drain,并通过 completion audit。相关运行态证据写入:
|
|
249
|
-
|
|
250
|
-
```text
|
|
251
|
-
.loopx/workflows/<slug>/build-support/delegation-ledger.json
|
|
252
|
-
.loopx/workflows/<slug>/build-support/completion-audit.json
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
这些仍然是 build 支撑证据,不替代 `execution-record.md`。
|
|
256
|
-
|
|
257
|
-
默认流程包含 deslop 清理;如果确实要跳过,可以使用:
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
loopx build <slug> --no-deslop
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
当 review 要求修实现问题时,Codex 侧的正常回路把 review artifact 作为本轮返工合同:
|
|
264
|
-
|
|
265
|
-
```text
|
|
266
|
-
$build --from-review .loopx/workflows/<slug>/review-report.md
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
已批准 PRD、test spec、上次 `execution-record.md` 和 workflow-local plan package 仍会作为支撑上下文加载,但不再让用户把 PRD 当成本轮返工的主参数。
|
|
270
|
-
|
|
271
|
-
### review
|
|
272
|
-
|
|
273
|
-
`review` 消费 build 输出的 `execution-record.md`,执行独立验收、代码评审和轻量 architecture-smell lane,并生成:
|
|
274
|
-
|
|
275
|
-
```text
|
|
276
|
-
.loopx/workflows/<slug>/review-report.md
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
最终用户可见评审结果要求使用中文。
|
|
280
|
-
|
|
281
|
-
如果评审通过并路由到 `done`,Codex 侧的正常下一步是 `$archive <slug>`;archive 会消费 pending 的完成态,然后同步 specs。纯 CLI 操作者仍然可以先显式执行 `loopx approve <slug> --from review --to done`,再执行 `loopx archive <slug>`。如果评审要求修实现问题,则运行 `$build --from-review .loopx/workflows/<slug>/review-report.md`。只有当 review 明确指出计划或需求本身错误时,才回到 `$plan <slug>` 或 `$clarify <slug>`。
|
|
282
|
-
|
|
283
|
-
architecture-smell lane 是 review 的一部分,不会增加新阶段。它会把发现记录到 `review-support/architecture-smell.json`,只有当模块边界、可测试性、领域词汇或计划架构假设存在实质性错误时才阻断。
|
|
284
|
-
|
|
285
|
-
### archive
|
|
286
|
-
|
|
287
|
-
`archive` 消费已完成工作流,或 review 已批准且唯一 pending route 是 `done` 的工作流,并把 `.loopx/changes/active/<change-id>/spec-delta.md` 合并进 `.loopx/specs/` 下的长期领域规格。归档后的 change 目录会移动到:
|
|
288
|
-
|
|
289
|
-
```text
|
|
290
|
-
.loopx/changes/archive/<change-id>/
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Archive 还会在 `.loopx/decisions/adr-candidates/<change-id>.md` 写入建议性 ADR candidate,不会自动提升到 `docs/adr/`。
|
|
294
|
-
|
|
295
|
-
Archive 现在按语义应用 requirement delta,而不是追加每次 change 的历史块。ADDED 新增 requirement,MODIFIED 替换完整 requirement 块,REMOVED 删除 requirement,RENAMED 只修改 requirement 标题并保留正文。
|
|
296
|
-
|
|
297
|
-
### autopilot
|
|
298
|
-
|
|
299
|
-
`autopilot` 是端到端编排入口,会在内部组织 expansion、planning、execution、qa、validation 等阶段,但 canonical artifact 仍然来自公开的 `clarify -> plan -> build -> review` 流程。
|
|
300
|
-
|
|
301
|
-
自动编排 ledger 写入:
|
|
302
|
-
|
|
303
|
-
```text
|
|
304
|
-
.loopx/autopilot/<slug>/run.json
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### debug
|
|
308
|
-
|
|
309
|
-
`debug` 是用于 bug、测试失败、回归和异常行为的质量辅助 skill。它要求先完成根因调查,再进入模式对比、假设验证和修复实现,避免直接猜测式打补丁。
|
|
310
|
-
|
|
311
|
-
### tdd
|
|
312
|
-
|
|
313
|
-
`tdd` 是用于功能开发和 bug 修复的质量辅助 skill。它要求先写失败测试,确认失败原因正确,再实现最小可通过改动。
|
|
314
|
-
|
|
315
|
-
### verify
|
|
316
|
-
|
|
317
|
-
`verify` 是用于最终完成声明前的质量辅助 skill。它要求在声称完成、修好、测试通过、可提交或可评审之前,先运行 fresh verification 并读取真实输出。
|
|
318
|
-
|
|
319
|
-
### go-style
|
|
320
|
-
|
|
321
|
-
`go-style` 是 Go 语言支持 skill。它用于指导 `.go` 文件编辑,强调 idiomatic Go、保留项目本地风格、清晰错误处理、小接口、表驱动测试,以及 `gofmt` 和 Go 验证。
|
|
322
|
-
|
|
323
|
-
### kratos
|
|
324
|
-
|
|
325
|
-
`kratos` 是 Go-Kratos 框架支持 skill。当项目出现 `buf.yaml`、proto API、`internal/service`、`internal/biz`、`internal/data` 或 `github.com/go-kratos/kratos/v2` 等信号时使用,并提供 proto 设计、分层架构、配置、中间件、认证、HTTP 定制和排错参考。
|
|
326
|
-
|
|
327
|
-
## 运行时目录
|
|
328
|
-
|
|
329
|
-
loopx 在当前项目下写入 `.loopx/`:
|
|
330
|
-
|
|
331
|
-
```text
|
|
332
|
-
.loopx/
|
|
333
|
-
README.md
|
|
334
|
-
config.json
|
|
335
|
-
intake/
|
|
336
|
-
clarify-<slug>-<timestamp>.md
|
|
337
|
-
views/
|
|
338
|
-
index.html
|
|
339
|
-
specs/
|
|
340
|
-
<domain>/
|
|
341
|
-
spec.md
|
|
342
|
-
changes/
|
|
343
|
-
active/
|
|
344
|
-
<change-id>/
|
|
345
|
-
proposal.md
|
|
346
|
-
spec-delta.md
|
|
347
|
-
design.md
|
|
348
|
-
tasks.md
|
|
349
|
-
slices.json
|
|
350
|
-
artifact-graph.json
|
|
351
|
-
archive/
|
|
352
|
-
<change-id>/
|
|
353
|
-
decisions/
|
|
354
|
-
adr-candidates/
|
|
355
|
-
plans/
|
|
356
|
-
agents/
|
|
357
|
-
issue-tracker.md
|
|
358
|
-
domain.md
|
|
359
|
-
triage-labels.md
|
|
360
|
-
context/
|
|
361
|
-
domain.md
|
|
362
|
-
workflows/
|
|
363
|
-
<slug>/
|
|
364
|
-
state.json
|
|
365
|
-
spec.md
|
|
366
|
-
plan.md
|
|
367
|
-
architecture.md
|
|
368
|
-
development-plan.md
|
|
369
|
-
test-plan.md
|
|
370
|
-
execution-record.md
|
|
371
|
-
review-report.md
|
|
372
|
-
view/
|
|
373
|
-
index.html
|
|
374
|
-
intake.html
|
|
375
|
-
plan.html
|
|
376
|
-
build.html
|
|
377
|
-
review.html
|
|
378
|
-
plan-reviews/
|
|
379
|
-
build-support/
|
|
380
|
-
review-support/
|
|
381
|
-
autopilot/
|
|
382
|
-
<slug>/
|
|
383
|
-
run.json
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
`config.json` 记录 loopx 产品契约和 init 时的项目发现结果:已有 AI 规则文件,例如 `AGENTS.md`、`CLAUDE.md`、Cursor / Copilot 规则;已有 spec 来源,例如 `docs/changes`、ADR/RFC 目录;以及自动发现的 install/test/lint/typecheck/build/E2E 命令。这不会引入轻量版 loopx;它只是让 `plan`、`build`、`review` 能看到项目事实,同时保持完整闭环。
|
|
387
|
-
|
|
388
|
-
`intake` 保存一次需求的 clarify 快照;`workflows` 保存当前任务的运行时工作副本;`changes` 保存本次需求对长期行为的 change delta;`specs` 只保存 archive 后的长期领域行为契约。
|
|
389
|
-
|
|
390
|
-
`views/` 和 `workflows/<slug>/view/` 是 plan 后写入、也可由 `loopx render` 重新生成的派生 HTML 阅读视图,只服务于人的浏览和评审;agent 和工具仍应读取、修改 Markdown 与 JSON 产物。
|
|
391
|
-
|
|
392
|
-
### 文档关注边界
|
|
393
|
-
|
|
394
|
-
用户日常需要关注的文档:
|
|
395
|
-
|
|
396
|
-
- `README.md` / `README.zh-CN.md`:产品用法、命令和目录约定。
|
|
397
|
-
- `.loopx/workflows/<slug>/spec.md`:当前需求工作副本。
|
|
398
|
-
- `.loopx/workflows/<slug>/plan.md`、`architecture.md`、`development-plan.md`、`test-plan.md`:当前任务的计划、架构和验证约定。
|
|
399
|
-
- `.loopx/workflows/<slug>/requirement-traceability.md`:plan、build、review 都会消费的原始需求覆盖门禁。
|
|
400
|
-
- `.loopx/workflows/<slug>/execution-record.md`、`review-report.md`:执行证据和评审结论。
|
|
401
|
-
- `.loopx/views/index.html` 与 `.loopx/workflows/<slug>/view/index.html`:plan 后写入、也可由 `loopx render` 重新生成的阅读入口。
|
|
402
|
-
|
|
403
|
-
用户可以阅读和按流程修改的事实源文档:
|
|
404
|
-
|
|
405
|
-
- `.loopx/workflows/<slug>/*.md`:当前 workflow 的可编辑工作副本;修改后仍需通过对应阶段门禁。
|
|
406
|
-
- `.loopx/config.json`:workspace 配置、项目规则/spec 来源发现结果和默认验证命令;当仓库的 canonical 命令或规则文件变化时可以更新。
|
|
407
|
-
- `.loopx/context/domain.md` 和 `.loopx/agents/*.md`:项目级背景、术语和 agent 协作约定。
|
|
408
|
-
- `.loopx/changes/active/<change-id>/*.md`:plan 生成的 change proposal、design、tasks 和 spec delta;修改后应重新过 plan/build/review。
|
|
409
|
-
- `.loopx/specs/<domain>/spec.md`:archive 后的长期行为规格;通常由 `archive` 同步,人工改动需要保持和后续 change delta 一致。
|
|
410
|
-
|
|
411
|
-
工具运行依赖或派生的文档/数据:
|
|
412
|
-
|
|
413
|
-
- `.loopx/workflows/<slug>/state.json`、`build-context.jsonl`、`review-context.jsonl`:运行时状态和 context manifest,工具依赖,不建议手改。
|
|
414
|
-
- `.loopx/workflows/<slug>/plan-reviews/`、`build-support/`、`review-support/`:阶段证据和内部审查结果,供诊断和 review 使用。
|
|
415
|
-
- `.loopx/intake/clarify-*.md`:clarify 快照,用于审计和追溯;不要当作长期 specs 修改。
|
|
416
|
-
- `.loopx/changes/active/<change-id>/slices.json`、`artifact-graph.json`:计划结构化数据,build/review/archive 会消费。
|
|
417
|
-
- `.loopx/autopilot/<slug>/run.json`、`.loopx/build-active.json`:编排和 stop-hook 运行态。
|
|
418
|
-
- `.loopx/views/` 和 `.loopx/workflows/<slug>/view/`:HTML 派生视图,plan 后自动写入,可删除后用 `loopx render` 重新生成,不应作为事实源编辑。
|
|
419
|
-
|
|
420
|
-
## 安装诊断与修复
|
|
421
|
-
|
|
422
|
-
检查运行时和 skill 安装状态:
|
|
423
|
-
|
|
424
|
-
```bash
|
|
425
|
-
loopx doctor
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
修复 loopx 管理的 skill 安装:
|
|
429
|
-
|
|
430
|
-
```bash
|
|
431
|
-
loopx repair-install
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
只检查当前 skill discovery 状态:
|
|
435
|
-
|
|
436
|
-
```bash
|
|
437
|
-
node scripts/install-skills.mjs --check
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
检查 bundled skill 治理状态:
|
|
441
|
-
|
|
442
|
-
```bash
|
|
443
|
-
node scripts/verify-skills.mjs
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
## Codex Workflow Hook
|
|
447
|
-
|
|
448
|
-
`install-skills.mjs` 和 Codex plugin 安装脚本会自动把 `scripts/codex-workflow-hook.mjs` 安装到:
|
|
449
|
-
|
|
450
|
-
```text
|
|
451
|
-
~/.codex/hooks/codex-workflow-hook.mjs
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
该 hook 会读取最近的 `.loopx/workflows/<slug>/state.json`,为当前 workflow 输出建议性上下文:当前阶段、blockers、readiness、authorization、evidence 和安全下一步。它只提供提示;真正的运行时门禁仍以 loopx runtime 为准。
|
|
455
|
-
|
|
456
|
-
设置 `LOOPX_HOOKS=0` 可以关闭 workflow hook 输出。
|
|
457
|
-
|
|
458
|
-
## Codex Stop Hook
|
|
459
|
-
|
|
460
|
-
loopx 内置一个 Codex stop-hook 辅助脚本,用于防止活跃 build 在达到 review handoff 之前提前停止:
|
|
461
|
-
|
|
462
|
-
```bash
|
|
463
|
-
node scripts/codex-stop-hook.mjs
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
`loopx build` 运行期间会写入持久状态:
|
|
467
|
-
|
|
468
|
-
```text
|
|
469
|
-
.loopx/build-active.json
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
如果状态显示 build 仍处于 `starting`、`executing`、`verifying` 或 `fixing`,hook 会返回 `allow: false` 和继续执行提示。只有 build 已经 `review-ready`、被真实 blocker 阻塞、失败、取消或不活跃时,hook 才允许停止。
|
|
473
|
-
|
|
474
|
-
## 环境变量
|
|
475
|
-
|
|
476
|
-
安装和 discovery 逻辑支持以下环境变量:
|
|
477
|
-
|
|
478
|
-
- `LOOPX_HOME`:覆盖默认 home 目录。
|
|
479
|
-
- `LOOPX_AGENTS_ROOT`:覆盖 `.agents` 根目录。
|
|
480
|
-
- `LOOPX_SKILLS_ROOT`:覆盖已安装 skills 目录。
|
|
481
|
-
- `LOOPX_SKILL_LOCK_PATH`:覆盖 skill lock 文件路径。
|
|
482
|
-
- `LOOPX_PROJECT_ROOT`:覆盖 loopx 项目根目录。
|
|
483
|
-
- `LOOPX_SKILL_SOURCE_ROOT`:覆盖 skill 源目录。
|
|
484
|
-
- `LOOPX_DISTRIBUTION_CHANNEL`:设置安装渠道,默认 `npm`。
|
|
485
|
-
- `LOOPX_INSTALLATION_IDENTITY`:设置安装身份,默认 `loopx`。
|
|
486
|
-
- `LOOPX_SOURCE_URL`:设置安装来源。
|
|
487
|
-
- `LOOPX_HOOKS`:设置为 `0` 时关闭 workflow hook 输出。
|
|
488
|
-
|
|
489
|
-
## 开发
|
|
490
|
-
|
|
491
|
-
安装依赖后运行测试:
|
|
492
|
-
|
|
493
|
-
```bash
|
|
494
|
-
npm test
|
|
495
|
-
```
|
|
496
|
-
|
|
497
|
-
`npm test` 会先运行 bundled skill 治理检查,再运行 Node 测试套件:
|
|
498
|
-
|
|
499
|
-
```bash
|
|
500
|
-
node scripts/verify-skills.mjs
|
|
501
|
-
node --test test/*.test.mjs
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
也可以直接执行项目内的验证命令:
|
|
132
|
+
发布前或修改 bundled skills 后运行确定性治理检查:
|
|
505
133
|
|
|
506
134
|
```bash
|
|
507
135
|
node scripts/verify-skills.mjs
|
|
508
|
-
node --test test/*.test.mjs
|
|
509
|
-
node scripts/install-skills.mjs --check
|
|
510
|
-
node --test plugins/loopx/scripts/plugin-install.test.mjs
|
|
511
|
-
node src/cli.mjs --help
|
|
512
|
-
node src/cli.mjs --version
|
|
513
|
-
node src/cli.mjs doctor
|
|
514
|
-
node src/cli.mjs status --json
|
|
515
136
|
```
|
|
516
137
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
`package.json` 的 `files` 字段会发布以下内容:
|
|
520
|
-
|
|
521
|
-
- `README.md`
|
|
522
|
-
- `README.zh-CN.md`
|
|
523
|
-
- `package.json`
|
|
524
|
-
- `scripts/install-skills.mjs`
|
|
525
|
-
- `scripts/verify-skills.mjs`
|
|
526
|
-
- `scripts/codex-stop-hook.mjs`
|
|
527
|
-
- `scripts/codex-workflow-hook.mjs`
|
|
528
|
-
- `assets/logo.svg`
|
|
529
|
-
- `src/`
|
|
530
|
-
- `skills/`,包含公开 loopx skills 以及随包发布的兼容/内部 skill 源文件
|
|
531
|
-
- `templates/`
|
|
532
|
-
- `plugins/loopx/`
|
|
533
|
-
|
|
534
|
-
## 版本
|
|
535
|
-
|
|
536
|
-
当前 npm 包版本:`0.1.9`。
|
|
138
|
+
治理脚本检查 bundled skill frontmatter、plugin mirrors、resolver coverage、本地引用、发布包包含项、版本一致性和公开文档。
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# loopx Skill Suite v1 Design
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
loopx is moving from a CLI-runtime-first workflow into a skill-first suite for agentic coding assistants. Codex and Claude are supported targets. The CLI remains as installer, governance, diagnostics, rendering, and legacy `.loopx/workflows/` support.
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
The v1 product surface is a bundled skill suite:
|
|
10
|
+
|
|
11
|
+
- `clarify`
|
|
12
|
+
- `spec`
|
|
13
|
+
- `plan`
|
|
14
|
+
- `subagent-exec`
|
|
15
|
+
- `exec`
|
|
16
|
+
- `review`
|
|
17
|
+
- `fix-review`
|
|
18
|
+
- `finish`
|
|
19
|
+
- `refactor-plan`
|
|
20
|
+
- `tdd`
|
|
21
|
+
- `debug`
|
|
22
|
+
- `verify`
|
|
23
|
+
- `go-style`
|
|
24
|
+
- `kratos`
|
|
25
|
+
|
|
26
|
+
Legacy runtime skills are not bundled as Codex or Claude skills in v1. Legacy CLI commands may remain for compatibility.
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
Recommended flow:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`spec` is a conditional design gate. `clarify` may route directly to `plan` when the remaining questions are local implementation choices. It routes to `spec` when product behavior, APIs, state, data, permissions, migration, compatibility, or architecture decisions need to be fixed before implementation planning.
|
|
37
|
+
|
|
38
|
+
`plan` is the superpowers `writing-plans` workflow under the loopx name. It writes executable plans and offers two execution options: `subagent-exec` recommended, or `exec` inline.
|
|
39
|
+
|
|
40
|
+
`review` is the superpowers `requesting-code-review` workflow under the loopx name. `fix-review` is the superpowers `receiving-code-review` workflow under the loopx name.
|
|
41
|
+
|
|
42
|
+
## Artifacts
|
|
43
|
+
|
|
44
|
+
Human-maintained artifacts use `docs/loopx/`:
|
|
45
|
+
|
|
46
|
+
- `docs/loopx/design/`
|
|
47
|
+
- `docs/loopx/plans/`
|
|
48
|
+
- `docs/loopx/reviews/`
|
|
49
|
+
- `docs/loopx/refactors/`
|
|
50
|
+
|
|
51
|
+
Runtime state, hook diagnostics, installer metadata, and legacy workflows use `.loopx/`.
|
|
52
|
+
|
|
53
|
+
## Installer
|
|
54
|
+
|
|
55
|
+
Default installation writes user-level skills and hooks for both supported targets:
|
|
56
|
+
|
|
57
|
+
- Codex skills: `~/.agents/skills/`
|
|
58
|
+
- Claude skills: `~/.claude/skills/`
|
|
59
|
+
- Codex hook: existing loopx workflow hook
|
|
60
|
+
- Claude hook: non-blocking prompt hook
|
|
61
|
+
|
|
62
|
+
Project-level Claude installation and custom directories are explicit installer choices.
|
|
63
|
+
|
|
64
|
+
## Claude Hook
|
|
65
|
+
|
|
66
|
+
The Claude hook is advisory only. It must not block tools, mutate workflow state, or enforce git safety. It emits next-action context when loopx support or legacy runtime context exists.
|
|
67
|
+
|
|
68
|
+
## Non-Goals
|
|
69
|
+
|
|
70
|
+
- No alias skills for renamed superpowers skills.
|
|
71
|
+
- No automatic project-level `.claude/skills` writes in postinstall.
|
|
72
|
+
- No new mandatory CLI state machine for the v1 skill suite.
|
|
73
|
+
- No blocking Claude hook in v1.
|