@ai-content-space/loopx 0.1.2 → 0.1.3
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/README.md +343 -56
- package/README.zh-CN.md +392 -0
- package/package.json +4 -1
- package/plugins/loopx/.codex-plugin/plugin.json +1 -1
- package/plugins/loopx/scripts/plugin-install.test.mjs +1 -0
- package/plugins/loopx/skills/archive/SKILL.md +39 -0
- package/plugins/loopx/skills/build/SKILL.md +111 -9
- package/plugins/loopx/skills/clarify/SKILL.md +121 -1
- package/plugins/loopx/skills/debug/SKILL.md +296 -0
- package/plugins/loopx/skills/debug/condition-based-waiting.md +115 -0
- package/plugins/loopx/skills/debug/defense-in-depth.md +122 -0
- package/plugins/loopx/skills/debug/find-polluter.sh +63 -0
- package/plugins/loopx/skills/debug/root-cause-tracing.md +169 -0
- package/plugins/loopx/skills/go-style/SKILL.md +71 -0
- package/plugins/loopx/skills/kratos/SKILL.md +74 -0
- package/plugins/loopx/skills/kratos/references/advanced-features.md +314 -0
- package/plugins/loopx/skills/kratos/references/architecture.md +488 -0
- package/plugins/loopx/skills/kratos/references/configuration.md +399 -0
- package/plugins/loopx/skills/kratos/references/http-customization.md +512 -0
- package/plugins/loopx/skills/kratos/references/middleware-logging.md +400 -0
- package/plugins/loopx/skills/kratos/references/proto-api-design.md +432 -0
- package/plugins/loopx/skills/kratos/references/security-auth.md +411 -0
- package/plugins/loopx/skills/kratos/references/troubleshooting.md +385 -0
- package/plugins/loopx/skills/plan/SKILL.md +22 -2
- package/plugins/loopx/skills/review/SKILL.md +98 -1
- package/plugins/loopx/skills/tdd/SKILL.md +371 -0
- package/plugins/loopx/skills/tdd/testing-anti-patterns.md +299 -0
- package/plugins/loopx/skills/verify/SKILL.md +139 -0
- package/scripts/codex-stop-hook.mjs +71 -0
- package/scripts/codex-workflow-hook.mjs +153 -0
- package/skills/archive/SKILL.md +39 -0
- package/skills/build/SKILL.md +111 -9
- package/skills/clarify/SKILL.md +121 -1
- package/skills/debug/SKILL.md +296 -0
- package/skills/debug/condition-based-waiting.md +115 -0
- package/skills/debug/defense-in-depth.md +122 -0
- package/skills/debug/find-polluter.sh +63 -0
- package/skills/debug/root-cause-tracing.md +169 -0
- package/skills/go-style/SKILL.md +71 -0
- package/skills/kratos/SKILL.md +74 -0
- package/skills/kratos/references/advanced-features.md +314 -0
- package/skills/kratos/references/architecture.md +488 -0
- package/skills/kratos/references/configuration.md +399 -0
- package/skills/kratos/references/http-customization.md +512 -0
- package/skills/kratos/references/middleware-logging.md +400 -0
- package/skills/kratos/references/proto-api-design.md +432 -0
- package/skills/kratos/references/security-auth.md +411 -0
- package/skills/kratos/references/troubleshooting.md +385 -0
- package/skills/plan/SKILL.md +18 -2
- package/skills/review/SKILL.md +98 -1
- package/skills/tdd/SKILL.md +371 -0
- package/skills/tdd/testing-anti-patterns.md +299 -0
- package/skills/verify/SKILL.md +139 -0
- package/src/build-runtime.mjs +303 -26
- package/src/build-stop-gate.mjs +94 -0
- package/src/cli.mjs +47 -5
- package/src/codex-exec-runtime.mjs +105 -5
- package/src/context-manifest.mjs +172 -0
- package/src/install-discovery.mjs +352 -5
- package/src/next-skill.mjs +57 -5
- package/src/plan-runtime.mjs +79 -122
- package/src/review-runtime.mjs +378 -0
- package/src/runtime-maintenance.mjs +428 -14
- package/src/template-governance.mjs +223 -0
- package/src/workflow.mjs +1941 -117
- package/src/workspace-context.mjs +166 -0
- package/src/workspace-memory.mjs +69 -0
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# loopx
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
`loopx` 是一个面向 Codex 的 skill-first 工作流工具包。它把需求澄清、共识规划、持久执行、独立评审组织成一条可追踪的本地工作流,并通过 CLI 与 Codex Skill 两种方式暴露同一套运行时。
|
|
6
|
+
|
|
7
|
+
当前公开流程:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
clarify -> plan -> build -> review
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
评审通过并进入 `done` 后,可以执行 archive,把本次被接受的 change delta 合并到长期 specs。
|
|
14
|
+
|
|
15
|
+
其中 `autopilot` 是端到端编排入口,会在内部复用这套公开阶段,而不是引入另一套流程真相。
|
|
16
|
+
|
|
17
|
+
## 特性
|
|
18
|
+
|
|
19
|
+
- 安装并公开 11 个 loopx Codex skills:工作流 skills `clarify`、`plan`、`build`、`review`、`archive`、`autopilot`,质量辅助 skills `debug`、`tdd`、`verify`,以及 Go 支持 skills `go-style`、`kratos`。
|
|
20
|
+
- 支持 npm 全局安装和 Codex plugin 安装,两种安装方式共享同一套 install/discovery 逻辑。
|
|
21
|
+
- 所有运行时状态和阶段产物都写入项目本地 `.loopx/`,便于审计、恢复和迁移。
|
|
22
|
+
- `plan` 默认采用 Planner -> Architect -> Critic 的共识规划循环。
|
|
23
|
+
- `plan` 会写入借鉴 OpenSpec 的 change artifacts:proposal、spec delta、design、tasks 和 artifact dependency graph。
|
|
24
|
+
- `build` 默认包含执行记录、验证证据、架构验收、deslop 清理和回归再验证。
|
|
25
|
+
- `review` 作为独立验收面,输出中文评审结论和 go/no-go 判断。
|
|
26
|
+
- 支持 `archive`,把已批准的 change delta 同步进长期 `.loopx/specs/` source of truth。
|
|
27
|
+
- 支持从旧 `.codex-helper/` 运行时迁移到 `.loopx/`。
|
|
28
|
+
|
|
29
|
+
## 安装
|
|
30
|
+
|
|
31
|
+
### npm 全局安装
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @ai-content-space/loopx
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
安装后会自动运行:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
node scripts/install-skills.mjs
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
该脚本会把 loopx 管理的 skills 安装到:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
~/.agents/skills/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
并更新:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
~/.agents/.skill-lock.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Codex plugin 安装
|
|
56
|
+
|
|
57
|
+
插件入口位于:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
plugins/loopx/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
插件安装脚本:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
node plugins/loopx/scripts/plugin-install.mjs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
npm 安装和 plugin 安装会收敛到同一个 `installationIdentity=loopx`,避免 Codex 里出现重复的 loopx skill 集合。
|
|
70
|
+
|
|
71
|
+
## 快速开始
|
|
72
|
+
|
|
73
|
+
初始化一个工作流:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
loopx init --slug my-task
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
进入澄清阶段:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
loopx clarify my-task
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
澄清完成后批准进入计划阶段:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
loopx approve my-task --from clarify --to plan
|
|
89
|
+
loopx plan my-task
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
计划完成后批准执行:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
loopx approve my-task --from plan --to build
|
|
96
|
+
loopx build my-task
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
执行完成后进入评审:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
loopx approve my-task --from build --to review
|
|
103
|
+
loopx review my-task
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
评审通过后完成工作流:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
loopx approve my-task --from review --to done
|
|
110
|
+
loopx review my-task
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
把已接受行为归档到长期 specs:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
$archive my-task
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
查看状态:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
loopx status my-task
|
|
123
|
+
loopx status my-task --json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
也可以让 loopx 根据一个现成 spec 直接创建规划工作流:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
loopx plan --direct ./path/to/spec.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## CLI 命令
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
loopx init [--slug <slug>]
|
|
136
|
+
loopx clarify <slug> [--standard|--deep]
|
|
137
|
+
loopx approve <slug> --from <stage> --to <stage>
|
|
138
|
+
loopx plan [slug] [--direct <spec-path>] [--interactive] [--deliberate]
|
|
139
|
+
loopx build <slug> [--no-deslop]
|
|
140
|
+
loopx build --from-review <review-report-path> [--no-deslop]
|
|
141
|
+
loopx review <slug> [--reviewer <name>]
|
|
142
|
+
loopx archive <slug>
|
|
143
|
+
loopx autopilot <slug> [--reviewer <name>]
|
|
144
|
+
loopx status [slug] [--json]
|
|
145
|
+
loopx setup-context
|
|
146
|
+
loopx doctor
|
|
147
|
+
loopx migrate
|
|
148
|
+
loopx repair-install
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
CLI 主要用于运行时、调试、状态观察和维护。日常面向 Codex 的主入口是同名 skills,例如 `$clarify`、`$plan`、`$build`、`$review`、`$archive`、`$autopilot`、`$debug`、`$tdd`、`$verify`、`$go-style`、`$kratos`。
|
|
152
|
+
|
|
153
|
+
`loopx status` 仍然是 CLI/runtime 诊断命令,不作为单独 Codex skill 暴露。
|
|
154
|
+
|
|
155
|
+
## Skill 说明
|
|
156
|
+
|
|
157
|
+
### clarify
|
|
158
|
+
|
|
159
|
+
`clarify` 用于把模糊请求转成可执行 spec。它会维护歧义分数、非目标、决策边界和压力测试结果。只有满足门禁后,才建议进入 `plan`。
|
|
160
|
+
|
|
161
|
+
默认 profile:
|
|
162
|
+
|
|
163
|
+
- `--standard`:目标歧义分数 `<= 0.20`,最多 `15` 轮。
|
|
164
|
+
- `--deep`:目标歧义分数 `<= 0.10`,最多 `25` 轮。
|
|
165
|
+
|
|
166
|
+
### plan
|
|
167
|
+
|
|
168
|
+
`plan` 把已批准的 clarify spec 或直接输入的 spec 转成计划包。默认包含 Planner、Architect、Critic 三段式评审循环,最多迭代到通过或达到上限。
|
|
169
|
+
|
|
170
|
+
主要产物:
|
|
171
|
+
|
|
172
|
+
- `.loopx/plans/prd-<slug>.md`
|
|
173
|
+
- `.loopx/plans/test-spec-<slug>.md`
|
|
174
|
+
- `.loopx/changes/active/<change-id>/proposal.md`
|
|
175
|
+
- `.loopx/changes/active/<change-id>/spec-delta.md`
|
|
176
|
+
- `.loopx/changes/active/<change-id>/design.md`
|
|
177
|
+
- `.loopx/changes/active/<change-id>/tasks.md`
|
|
178
|
+
- `.loopx/changes/active/<change-id>/artifact-graph.json`
|
|
179
|
+
- `.loopx/workflows/<slug>/plan.md`
|
|
180
|
+
- `.loopx/workflows/<slug>/architecture.md`
|
|
181
|
+
- `.loopx/workflows/<slug>/development-plan.md`
|
|
182
|
+
- `.loopx/workflows/<slug>/test-plan.md`
|
|
183
|
+
|
|
184
|
+
### build
|
|
185
|
+
|
|
186
|
+
`build` 执行已批准的计划,并把执行过程、验证证据和限制记录到 canonical artifact:
|
|
187
|
+
|
|
188
|
+
```text
|
|
189
|
+
.loopx/workflows/<slug>/execution-record.md
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`build` 内部保留结构化 runtime lanes,同时增加 Ralph-like owner loop:单一 owner 持续推进,可并行 delegation,但进入 review handoff 前必须满足 blocking delegation 已 drain,并通过 completion audit。相关运行态证据写入:
|
|
193
|
+
|
|
194
|
+
```text
|
|
195
|
+
.loopx/workflows/<slug>/build-support/delegation-ledger.json
|
|
196
|
+
.loopx/workflows/<slug>/build-support/completion-audit.json
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
这些仍然是 build 支撑证据,不替代 `execution-record.md`。
|
|
200
|
+
|
|
201
|
+
默认流程包含 deslop 清理;如果确实要跳过,可以使用:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
loopx build <slug> --no-deslop
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
当 review 要求修实现问题时,Codex 侧的正常回路把 review artifact 作为本轮返工合同:
|
|
208
|
+
|
|
209
|
+
```text
|
|
210
|
+
$build --from-review .loopx/workflows/<slug>/review-report.md
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
已批准 PRD、test spec、上次 `execution-record.md` 和 workflow-local plan package 仍会作为支撑上下文加载,但不再让用户把 PRD 当成本轮返工的主参数。
|
|
214
|
+
|
|
215
|
+
### review
|
|
216
|
+
|
|
217
|
+
`review` 消费 build 输出的 `execution-record.md`,执行独立验收和代码评审,并生成:
|
|
218
|
+
|
|
219
|
+
```text
|
|
220
|
+
.loopx/workflows/<slug>/review-report.md
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
最终用户可见评审结果要求使用中文。
|
|
224
|
+
|
|
225
|
+
如果评审通过,仍然需要显式批准 `review -> done`。如果评审要求修实现问题,则运行 `$build --from-review .loopx/workflows/<slug>/review-report.md`。只有当 review 明确指出计划或需求本身错误时,才回到 `$plan <slug>` 或 `$clarify <slug>`。
|
|
226
|
+
|
|
227
|
+
### archive
|
|
228
|
+
|
|
229
|
+
`archive` 消费已完成工作流,并把 `.loopx/changes/active/<change-id>/spec-delta.md` 合并进 `.loopx/specs/` 下的长期领域规格。归档后的 change 目录会移动到:
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
.loopx/changes/archive/<change-id>/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### autopilot
|
|
236
|
+
|
|
237
|
+
`autopilot` 是端到端编排入口,会在内部组织 expansion、planning、execution、qa、validation 等阶段,但 canonical artifact 仍然来自公开的 `clarify -> plan -> build -> review` 流程。
|
|
238
|
+
|
|
239
|
+
自动编排 ledger 写入:
|
|
240
|
+
|
|
241
|
+
```text
|
|
242
|
+
.loopx/autopilot/<slug>/run.json
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### debug
|
|
246
|
+
|
|
247
|
+
`debug` 是用于 bug、测试失败、回归和异常行为的质量辅助 skill。它要求先完成根因调查,再进入模式对比、假设验证和修复实现,避免直接猜测式打补丁。
|
|
248
|
+
|
|
249
|
+
### tdd
|
|
250
|
+
|
|
251
|
+
`tdd` 是用于功能开发和 bug 修复的质量辅助 skill。它要求先写失败测试,确认失败原因正确,再实现最小可通过改动。
|
|
252
|
+
|
|
253
|
+
### verify
|
|
254
|
+
|
|
255
|
+
`verify` 是用于最终完成声明前的质量辅助 skill。它要求在声称完成、修好、测试通过、可提交或可评审之前,先运行 fresh verification 并读取真实输出。
|
|
256
|
+
|
|
257
|
+
### go-style
|
|
258
|
+
|
|
259
|
+
`go-style` 是 Go 语言支持 skill。它用于指导 `.go` 文件编辑,强调 idiomatic Go、保留项目本地风格、清晰错误处理、小接口、表驱动测试,以及 `gofmt` 和 Go 验证。
|
|
260
|
+
|
|
261
|
+
### kratos
|
|
262
|
+
|
|
263
|
+
`kratos` 是 Go-Kratos 框架支持 skill。当项目出现 `buf.yaml`、proto API、`internal/service`、`internal/biz`、`internal/data` 或 `github.com/go-kratos/kratos/v2` 等信号时使用,并提供 proto 设计、分层架构、配置、中间件、认证、HTTP 定制和排错参考。
|
|
264
|
+
|
|
265
|
+
## 运行时目录
|
|
266
|
+
|
|
267
|
+
loopx 在当前项目下写入 `.loopx/`:
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
.loopx/
|
|
271
|
+
README.md
|
|
272
|
+
config.json
|
|
273
|
+
specs/
|
|
274
|
+
<domain>/
|
|
275
|
+
spec.md
|
|
276
|
+
changes/
|
|
277
|
+
active/
|
|
278
|
+
<change-id>/
|
|
279
|
+
proposal.md
|
|
280
|
+
spec-delta.md
|
|
281
|
+
design.md
|
|
282
|
+
tasks.md
|
|
283
|
+
artifact-graph.json
|
|
284
|
+
archive/
|
|
285
|
+
<change-id>/
|
|
286
|
+
plans/
|
|
287
|
+
context/
|
|
288
|
+
workflows/
|
|
289
|
+
<slug>/
|
|
290
|
+
state.json
|
|
291
|
+
spec.md
|
|
292
|
+
plan.md
|
|
293
|
+
architecture.md
|
|
294
|
+
development-plan.md
|
|
295
|
+
test-plan.md
|
|
296
|
+
execution-record.md
|
|
297
|
+
review-report.md
|
|
298
|
+
plan-reviews/
|
|
299
|
+
build-support/
|
|
300
|
+
autopilot/
|
|
301
|
+
<slug>/
|
|
302
|
+
run.json
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
旧的 `.codex-helper/` 可通过 `loopx migrate` 迁移。`.omx/` 仍保留为外部编排/规划元数据,不属于 loopx 运行时命名空间。
|
|
306
|
+
|
|
307
|
+
## 安装诊断与修复
|
|
308
|
+
|
|
309
|
+
检查运行时和 skill 安装状态:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
loopx doctor
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
修复 loopx 管理的 skill 安装:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
loopx repair-install
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
只检查当前 skill discovery 状态:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
node scripts/install-skills.mjs --check
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Codex Stop Hook
|
|
328
|
+
|
|
329
|
+
loopx 内置一个 Codex stop-hook 辅助脚本,用于防止活跃 build 在达到 review handoff 之前提前停止:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
node scripts/codex-stop-hook.mjs
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
`loopx build` 运行期间会写入持久状态:
|
|
336
|
+
|
|
337
|
+
```text
|
|
338
|
+
.loopx/build-active.json
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
如果状态显示 build 仍处于 `starting`、`executing`、`verifying` 或 `fixing`,hook 会返回 `allow: false` 和继续执行提示。只有 build 已经 `review-ready`、被真实 blocker 阻塞、失败、取消或不活跃时,hook 才允许停止。
|
|
342
|
+
|
|
343
|
+
## 环境变量
|
|
344
|
+
|
|
345
|
+
安装和 discovery 逻辑支持以下环境变量:
|
|
346
|
+
|
|
347
|
+
- `LOOPX_HOME`:覆盖默认 home 目录。
|
|
348
|
+
- `LOOPX_AGENTS_ROOT`:覆盖 `.agents` 根目录。
|
|
349
|
+
- `LOOPX_SKILLS_ROOT`:覆盖已安装 skills 目录。
|
|
350
|
+
- `LOOPX_SKILL_LOCK_PATH`:覆盖 skill lock 文件路径。
|
|
351
|
+
- `LOOPX_PROJECT_ROOT`:覆盖 loopx 项目根目录。
|
|
352
|
+
- `LOOPX_SKILL_SOURCE_ROOT`:覆盖 skill 源目录。
|
|
353
|
+
- `LOOPX_DISTRIBUTION_CHANNEL`:设置安装渠道,默认 `npm`。
|
|
354
|
+
- `LOOPX_INSTALLATION_IDENTITY`:设置安装身份,默认 `loopx`。
|
|
355
|
+
- `LOOPX_SOURCE_URL`:设置安装来源。
|
|
356
|
+
|
|
357
|
+
## 开发
|
|
358
|
+
|
|
359
|
+
安装依赖后运行测试:
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
npm test
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
也可以直接执行项目内的验证命令:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
node --test test/*.test.mjs
|
|
369
|
+
node scripts/install-skills.mjs --check
|
|
370
|
+
node --test plugins/loopx/scripts/plugin-install.test.mjs
|
|
371
|
+
node src/cli.mjs --help
|
|
372
|
+
node src/cli.mjs doctor
|
|
373
|
+
node src/cli.mjs status --json
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## 发布内容
|
|
377
|
+
|
|
378
|
+
`package.json` 的 `files` 字段会发布以下内容:
|
|
379
|
+
|
|
380
|
+
- `README.md`
|
|
381
|
+
- `README.zh-CN.md`
|
|
382
|
+
- `package.json`
|
|
383
|
+
- `scripts/install-skills.mjs`
|
|
384
|
+
- `scripts/codex-stop-hook.mjs`
|
|
385
|
+
- `src/`
|
|
386
|
+
- `skills/`,包含公开 loopx skills 以及随包发布的兼容/内部 skill 源文件
|
|
387
|
+
- `templates/`
|
|
388
|
+
- `plugins/loopx/`
|
|
389
|
+
|
|
390
|
+
## 版本
|
|
391
|
+
|
|
392
|
+
当前 npm 包版本:`0.1.2`。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-content-space/loopx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"description": "Skill-first loopx workflow product for Codex",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -19,8 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"README.md",
|
|
22
|
+
"README.zh-CN.md",
|
|
22
23
|
"package.json",
|
|
23
24
|
"scripts/install-skills.mjs",
|
|
25
|
+
"scripts/codex-stop-hook.mjs",
|
|
26
|
+
"scripts/codex-workflow-hook.mjs",
|
|
24
27
|
"src/",
|
|
25
28
|
"skills/",
|
|
26
29
|
"templates/",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: archive
|
|
3
|
+
description: Sync an approved loopx change delta into long-lived specs after review is done.
|
|
4
|
+
argument-hint: "<workflow slug>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# loopx Archive
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Use `archive` after a loopx workflow has reached `done`. It syncs the accepted change delta into long-lived `.loopx/specs/` files, archives the change staging directory, and writes an advisory ADR candidate.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
- `<workflow slug>` for a completed loopx workflow
|
|
16
|
+
|
|
17
|
+
## Behavior
|
|
18
|
+
|
|
19
|
+
Run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
loopx archive <slug>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then report in Chinese:
|
|
26
|
+
|
|
27
|
+
- whether the change was archived
|
|
28
|
+
- which long-lived spec files were updated
|
|
29
|
+
- the archived change path
|
|
30
|
+
- the ADR candidate path, if written
|
|
31
|
+
- any blocker if the workflow is not done, the spec delta is incomplete, or the execution record still declares partial scope
|
|
32
|
+
|
|
33
|
+
## Boundaries
|
|
34
|
+
|
|
35
|
+
- Do not run archive before `review -> done` has been approved.
|
|
36
|
+
- Do not archive when `execution-record.md` declares non-empty `remaining_scope`, `completion_claim` other than `full`, or a mismatch between `planned_scope` and `implemented_scope`; route back to build/plan instead.
|
|
37
|
+
- Do not edit implementation code.
|
|
38
|
+
- Do not promote ADR candidates into `docs/adr/` automatically; report the candidate path for human follow-up.
|
|
39
|
+
- Do not treat `loopx status` as a user-facing skill. Use status only as a runtime diagnostic when needed.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build
|
|
3
3
|
description: Ralph-style loopx execution runtime under the public build stage.
|
|
4
|
-
argument-hint: "[--no-deslop] <approved workflow slug>"
|
|
4
|
+
argument-hint: "[--no-deslop] <approved PRD path or workflow slug> | --from-review <review artifact path>"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# loopx Build
|
|
@@ -14,6 +14,7 @@ By default, `build` is not a one-shot draft writer. It is a persistence loop wit
|
|
|
14
14
|
|
|
15
15
|
<Use_When>
|
|
16
16
|
- `plan -> build` has already been explicitly approved.
|
|
17
|
+
- `review -> build` was requested for implementation fixes and a review artifact is supplied with `--from-review`.
|
|
17
18
|
- Canonical plan artifacts already exist and execution should now proceed.
|
|
18
19
|
- The task needs execution persistence, verification evidence, and explicit pre-review quality gates.
|
|
19
20
|
</Use_When>
|
|
@@ -29,34 +30,97 @@ By default, `build` is not a one-shot draft writer. It is a persistence loop wit
|
|
|
29
30
|
- Execution may parallelize internally without exposing a public `team` stage.
|
|
30
31
|
- `build` does not replace `review`.
|
|
31
32
|
- `execution-record.md` remains the sole canonical execution and verification artifact.
|
|
33
|
+
- Feature work and bug fixes should use `tdd`: write a failing test, confirm it fails for the intended reason, then implement the smallest passing change.
|
|
34
|
+
- Bug, test-failure, build-failure, and unexpected-behavior work should use `debug` before proposing fixes.
|
|
35
|
+
- Completion and review-ready claims should use `verify` before they are stated.
|
|
36
|
+
- Go edits should use `go-style` and preserve local repository conventions.
|
|
37
|
+
- Go-Kratos work should use `kratos` when Kratos project signals or Kratos-specific tasks are present.
|
|
32
38
|
- Fresh evidence is required before review handoff.
|
|
33
39
|
- Deslop and regression re-verification are part of the default build path.
|
|
40
|
+
- `build` has one owner for persistence. Delegation may run in parallel, but the owner remains accountable for draining delegated work and proving completion before review handoff.
|
|
34
41
|
</Core_Principles>
|
|
35
42
|
|
|
36
43
|
<Preconditions>
|
|
37
|
-
`build` starts only when all of the following are true:
|
|
44
|
+
For initial execution, `build` starts only when all of the following are true:
|
|
38
45
|
|
|
39
46
|
- approved `plan -> build` transition exists
|
|
40
47
|
- `.loopx/plans/prd-<slug>.md` exists
|
|
41
48
|
- `.loopx/plans/test-spec-<slug>.md` exists
|
|
42
49
|
- workflow-local planning artifacts required by the execution lane exist
|
|
50
|
+
|
|
51
|
+
For review-requested implementation fixes, `build` may instead start from:
|
|
52
|
+
|
|
53
|
+
- `$build --from-review .loopx/workflows/<slug>/review-report.md`
|
|
54
|
+
- or `$build --from-review .loopx/workflows/<slug>/review.md`
|
|
55
|
+
|
|
56
|
+
In that mode, the review artifact is the direct rework contract. The approved PRD, test spec, previous execution record, and workflow-local plan package remain required context, but they are not the primary user-facing argument.
|
|
43
57
|
</Preconditions>
|
|
44
58
|
|
|
59
|
+
<Inputs>
|
|
60
|
+
Preferred skill input:
|
|
61
|
+
|
|
62
|
+
- `.loopx/plans/prd-<slug>.md`
|
|
63
|
+
|
|
64
|
+
Preferred review rework input:
|
|
65
|
+
|
|
66
|
+
- `--from-review .loopx/workflows/<slug>/review-report.md`
|
|
67
|
+
|
|
68
|
+
Compatible skill / CLI input:
|
|
69
|
+
|
|
70
|
+
- `<slug>`
|
|
71
|
+
|
|
72
|
+
When invoked with a PRD path, derive `<slug>` from `prd-<slug>.md` and still use the matching workflow-local plan package and test spec.
|
|
73
|
+
|
|
74
|
+
When invoked with `--from-review`, derive `<slug>` from the workflow directory, treat the review artifact as the implementation-fix contract, and load the matching PRD, test spec, previous `execution-record.md`, and workflow-local plan package as supporting context. This Codex skill invocation consumes the `review -> build` rework intent; users should not need a separate bash `loopx approve ... --from review --to build` step for the normal Codex-facing flow.
|
|
75
|
+
</Inputs>
|
|
76
|
+
|
|
45
77
|
<Execution_Model>
|
|
46
78
|
`build` should behave like a Ralph-style execution runtime:
|
|
47
79
|
|
|
48
80
|
1. Initialize or resume build iteration state.
|
|
49
|
-
2.
|
|
50
|
-
3.
|
|
51
|
-
4.
|
|
52
|
-
5.
|
|
53
|
-
6.
|
|
54
|
-
7.
|
|
55
|
-
8.
|
|
81
|
+
2. If running from `--from-review`, load the review artifact first and constrain implementation work to the requested implementation fixes unless the review artifact exposes a real plan or clarify blocker.
|
|
82
|
+
3. Run internal execution / evidence / verification lanes in parallel.
|
|
83
|
+
4. For implementation work, apply `tdd` unless the approved plan explicitly classifies the change as non-behavioral or test-inapplicable.
|
|
84
|
+
5. For failures discovered during execution or verification, apply `debug` before attempting fixes.
|
|
85
|
+
6. For `.go` edits, apply `go-style`; for Kratos API/service/biz/data work, apply `kratos` before changing framework structure.
|
|
86
|
+
7. Aggregate lane results into canonical `execution-record.md`.
|
|
87
|
+
8. Run fresh verification and read actual output using `verify` discipline.
|
|
88
|
+
9. Run architect verification as a hard pre-review gate.
|
|
89
|
+
10. Run deslop on build-owned changes.
|
|
90
|
+
11. Re-run regression verification after deslop.
|
|
91
|
+
12. Write/update the build delegation ledger and ensure blocking delegated work is drained.
|
|
92
|
+
13. Write/update the completion audit mapping approved plan, slices, and review rework inputs to evidence.
|
|
93
|
+
14. Stop only when review handoff gates are satisfied or a real blocker remains.
|
|
56
94
|
|
|
57
95
|
`build` may persist support artifacts for runtime inspection, but they must not replace `execution-record.md`.
|
|
58
96
|
</Execution_Model>
|
|
59
97
|
|
|
98
|
+
<Continuation_Discipline>
|
|
99
|
+
`build` is a persistence loop, not a "one phase per invocation" runner.
|
|
100
|
+
|
|
101
|
+
If approved plan work remains, continue executing within the same `$build` invocation until either review handoff gates are satisfied or a real blocker prevents further progress.
|
|
102
|
+
|
|
103
|
+
The following are **not** real blockers by themselves:
|
|
104
|
+
|
|
105
|
+
- a planned phase is unfinished
|
|
106
|
+
- a runtime adapter is not fully migrated yet
|
|
107
|
+
- store-layer branches still need to be moved to the new service/client path
|
|
108
|
+
- more files remain in the approved implementation scope
|
|
109
|
+
- verification has not been rerun after the latest edits
|
|
110
|
+
|
|
111
|
+
Those are remaining execution work. Keep working them down.
|
|
112
|
+
|
|
113
|
+
A real blocker must identify why execution cannot safely continue now, such as:
|
|
114
|
+
|
|
115
|
+
- missing human product/architecture decision that is not specified by the approved plan
|
|
116
|
+
- unavailable credential, service, fixture, dependency, or environment that cannot be mocked or bypassed responsibly
|
|
117
|
+
- verification failure caused by a pre-existing repository condition that blocks evaluating this change and cannot be isolated
|
|
118
|
+
- repeated implementation failure after the build iteration budget is exhausted
|
|
119
|
+
- a conflict between the approved plan and current repository facts that requires re-planning
|
|
120
|
+
|
|
121
|
+
Do not end a build response with "continue in the next build" for unfinished approved work. If work remains and no real blocker exists, keep executing. If a real blocker exists, name the concrete blocker and record it in `execution-record.md`.
|
|
122
|
+
</Continuation_Discipline>
|
|
123
|
+
|
|
60
124
|
<Runtime_State_Machine>
|
|
61
125
|
`build` should track at minimum:
|
|
62
126
|
|
|
@@ -72,6 +136,14 @@ By default, `build` is not a one-shot draft writer. It is a persistence loop wit
|
|
|
72
136
|
- `build_blockers`
|
|
73
137
|
- `build_progress_artifact_paths`
|
|
74
138
|
- `build_support_evidence_paths`
|
|
139
|
+
- `build_owner_id`
|
|
140
|
+
- `build_owner_session_id`
|
|
141
|
+
- `build_owner_status`
|
|
142
|
+
- `build_delegation_status`
|
|
143
|
+
- `build_delegation_ledger_path`
|
|
144
|
+
- `build_active_delegation_count`
|
|
145
|
+
- `build_completion_audit_status`
|
|
146
|
+
- `build_completion_audit_path`
|
|
75
147
|
- `execution_record_status`
|
|
76
148
|
|
|
77
149
|
`build -> review` is blocked until:
|
|
@@ -81,6 +153,8 @@ By default, `build` is not a one-shot draft writer. It is a persistence loop wit
|
|
|
81
153
|
- architect verification is approved
|
|
82
154
|
- deslop is complete, unless explicitly skipped
|
|
83
155
|
- post-deslop regression passes
|
|
156
|
+
- blocking delegated build work is drained
|
|
157
|
+
- completion audit passes
|
|
84
158
|
- `execution-record.md` is complete
|
|
85
159
|
</Runtime_State_Machine>
|
|
86
160
|
|
|
@@ -89,6 +163,15 @@ Canonical artifact:
|
|
|
89
163
|
|
|
90
164
|
- `execution-record.md`
|
|
91
165
|
|
|
166
|
+
`execution-record.md` must make the completion scope explicit when a plan is larger than the current implementation slice:
|
|
167
|
+
|
|
168
|
+
- `planned_scope`: the approved PRD/workflow scope being measured.
|
|
169
|
+
- `implemented_scope`: the scope actually completed in this build run.
|
|
170
|
+
- `remaining_scope`: empty only when the approved workflow scope is fully implemented.
|
|
171
|
+
- `completion_claim`: use `full` only when the whole approved workflow is complete; use `slice` or another non-full value for partial implementation.
|
|
172
|
+
|
|
173
|
+
If `remaining_scope` is non-empty or `completion_claim` is not `full`, build may still hand off for slice review, but review/archive must not treat that as full workflow completion.
|
|
174
|
+
|
|
92
175
|
Support artifacts may exist for:
|
|
93
176
|
|
|
94
177
|
- iteration progress
|
|
@@ -96,6 +179,8 @@ Support artifacts may exist for:
|
|
|
96
179
|
- architect gate summaries
|
|
97
180
|
- deslop summaries
|
|
98
181
|
- regression summaries
|
|
182
|
+
- `build-support/delegation-ledger.json`
|
|
183
|
+
- `build-support/completion-audit.json`
|
|
99
184
|
|
|
100
185
|
These support artifacts are runtime aids only. They must not become new canonical review inputs.
|
|
101
186
|
</Artifact_Contract>
|
|
@@ -106,6 +191,23 @@ These support artifacts are runtime aids only. They must not become new canonica
|
|
|
106
191
|
- review continues to own provenance checks, evidence completeness checks, completion/rollback decisions, and code-review
|
|
107
192
|
</Review_Boundary>
|
|
108
193
|
|
|
194
|
+
<Final_Response_Contract>
|
|
195
|
+
When `build` reaches review handoff readiness, the final response must include an explicit next skill command using the execution record path:
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
Next:
|
|
199
|
+
$review .loopx/workflows/<slug>/execution-record.md
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
If the user needs the CLI/runtime-debug form, use:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
loopx review <slug>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Do not end with prose-only guidance such as "next step should enter review" when the workflow is ready for review. Do not emit `$review <slug>` as the primary skill handoff when the execution record path is known. If review handoff is blocked, state the blocker instead of emitting a `$review` command.
|
|
209
|
+
</Final_Response_Contract>
|
|
210
|
+
|
|
109
211
|
<Flags>
|
|
110
212
|
- `--no-deslop`: skip the deslop pass and the post-deslop regression loop, while still requiring the latest successful pre-deslop verification evidence
|
|
111
213
|
</Flags>
|