@ai-content-space/loopx 0.1.4 → 0.1.6
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 +55 -6
- package/README.zh-CN.md +56 -6
- package/package.json +3 -2
- package/plugins/loopx/.codex-plugin/plugin.json +1 -1
- package/plugins/loopx/skills/archive/SKILL.md +10 -4
- package/plugins/loopx/skills/autopilot/SKILL.md +4 -1
- package/plugins/loopx/skills/build/SKILL.md +9 -1
- package/plugins/loopx/skills/clarify/SKILL.md +9 -3
- package/plugins/loopx/skills/debug/SKILL.md +4 -1
- package/plugins/loopx/skills/go-style/SKILL.md +4 -1
- package/plugins/loopx/skills/kratos/SKILL.md +4 -1
- package/plugins/loopx/skills/plan/SKILL.md +31 -1
- package/plugins/loopx/skills/review/SKILL.md +9 -1
- package/plugins/loopx/skills/tdd/SKILL.md +4 -1
- package/plugins/loopx/skills/verify/SKILL.md +4 -1
- package/scripts/verify-skills.mjs +166 -0
- package/skills/RESOLVER.md +45 -0
- package/skills/archive/SKILL.md +10 -4
- package/skills/autopilot/SKILL.md +4 -1
- package/skills/build/SKILL.md +9 -1
- package/skills/clarify/SKILL.md +9 -3
- package/skills/debug/SKILL.md +4 -1
- package/skills/go-style/SKILL.md +4 -1
- package/skills/kratos/SKILL.md +4 -1
- package/skills/plan/SKILL.md +31 -1
- package/skills/review/SKILL.md +9 -1
- package/skills/tdd/SKILL.md +4 -1
- package/skills/verify/SKILL.md +4 -1
- package/src/context-manifest.mjs +2 -0
- package/src/project-discovery.mjs +163 -0
- package/src/workflow.mjs +91 -3
package/README.md
CHANGED
|
@@ -25,10 +25,12 @@ clarify -> plan -> build -> review -> approve review->done -> archive
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
27
27
|
- Installs and exposes eleven bundled loopx Codex skills: workflow skills `clarify`, `plan`, `build`, `review`, `archive`, and `autopilot`; quality support skills `debug`, `tdd`, and `verify`; and Go support skills `go-style` and `kratos`.
|
|
28
|
+
- Keeps bundled skill routing explicit in `skills/RESOLVER.md`, with deterministic governance checks for frontmatter, plugin mirrors, resolver coverage, local references, package inclusion, and version alignment.
|
|
28
29
|
- Supports npm global install and Codex plugin install through the same install/discovery core.
|
|
29
30
|
- Installs a managed Codex workflow hook that surfaces loopx workflow state and safe next-action hints inside Codex.
|
|
30
31
|
- Stores runtime state and stage artifacts locally under `.loopx/` for auditability, recovery, and migration.
|
|
31
32
|
- Stores clarify intake snapshots under `.loopx/intake/` so `.loopx/specs/` stays reserved for long-lived domain specs.
|
|
33
|
+
- Records existing project AI rule files, existing spec sources, and detected verification commands in `.loopx/config.json` during init so loopx can preserve local sources of truth while still running the full workflow.
|
|
32
34
|
- Runs `plan` with a Planner -> Architect -> Critic consensus loop by default.
|
|
33
35
|
- Writes OpenSpec-inspired change artifacts during `plan`: proposal, spec delta, design, vertical slices, tasks, and an artifact dependency graph.
|
|
34
36
|
- Provides per-repo agent context under `.loopx/agents/` and `.loopx/context/domain.md`, consumed by build/review context manifests.
|
|
@@ -138,7 +140,15 @@ loopx status my-task
|
|
|
138
140
|
loopx status my-task --json
|
|
139
141
|
```
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
Planning also writes derived HTML reading views so the plan can be reviewed without another command:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
.loopx/workflows/my-task/view/index.html
|
|
147
|
+
.loopx/workflows/my-task/view/plan.html
|
|
148
|
+
.loopx/views/index.html
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Regenerate derived HTML reading views at any time:
|
|
142
152
|
|
|
143
153
|
```bash
|
|
144
154
|
loopx render my-task
|
|
@@ -172,7 +182,25 @@ loopx repair-install
|
|
|
172
182
|
|
|
173
183
|
The CLI is primarily for runtime, debugging, status inspection, and maintenance. The normal Codex-facing product surface is the bundled skill set, for example `$clarify`, `$plan`, `$build`, `$review`, `$archive`, `$autopilot`, `$debug`, `$tdd`, `$verify`, `$go-style`, and `$kratos`.
|
|
174
184
|
|
|
175
|
-
`loopx status` remains a CLI/runtime diagnostic command rather than a Codex skill. `loopx
|
|
185
|
+
`loopx status` remains a CLI/runtime diagnostic command rather than a Codex skill. `loopx plan` automatically writes human-readable HTML views for the planned workflow and workspace index. `loopx render` regenerates those views from existing runtime artifacts; without a slug it renders every non-legacy workflow plus the workspace index. Markdown and JSON remain the canonical machine-readable and editable sources.
|
|
186
|
+
|
|
187
|
+
## Skill Routing and Governance
|
|
188
|
+
|
|
189
|
+
The bundled skill resolver lives at:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
skills/RESOLVER.md
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
It is the human-readable routing map for the eleven bundled skills. Keep it aligned with each `skills/<name>/SKILL.md` and mirrored `plugins/loopx/skills/<name>/SKILL.md`.
|
|
196
|
+
|
|
197
|
+
Skill governance is enforced by:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
node scripts/verify-skills.mjs
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The verifier checks that bundled skill frontmatter is triggerable and bounded, `metadata.version` matches `package.json`, plugin skill mirrors match the canonical skills, `skills/RESOLVER.md` covers every bundled skill without stale bundled-skill references, local skill references exist, the plugin manifest version matches the package version, and the verifier itself is included in the npm package.
|
|
176
204
|
|
|
177
205
|
## Skills
|
|
178
206
|
|
|
@@ -204,6 +232,8 @@ Main artifacts:
|
|
|
204
232
|
- `.loopx/workflows/<slug>/development-plan.md`
|
|
205
233
|
- `.loopx/workflows/<slug>/test-plan.md`
|
|
206
234
|
|
|
235
|
+
After a successful plan run, loopx also writes derived reading views at `.loopx/workflows/<slug>/view/index.html`, `.loopx/workflows/<slug>/view/plan.html`, and `.loopx/views/index.html`. Use these for human review; keep Markdown and JSON as the editable sources of truth.
|
|
236
|
+
|
|
207
237
|
`spec-delta.md` uses requirement deltas: `## ADDED Requirements`, `## MODIFIED Requirements`, `## REMOVED Requirements`, and `## RENAMED Requirements`. ADDED and MODIFIED entries are full `### Requirement:` blocks with SHALL/MUST language and `#### Scenario:` examples, so archive can merge them into the current long-lived spec state.
|
|
208
238
|
|
|
209
239
|
### build
|
|
@@ -337,14 +367,17 @@ loopx writes runtime state under `.loopx/` in the current project:
|
|
|
337
367
|
review.html
|
|
338
368
|
plan-reviews/
|
|
339
369
|
build-support/
|
|
370
|
+
review-support/
|
|
340
371
|
autopilot/
|
|
341
372
|
<slug>/
|
|
342
373
|
run.json
|
|
343
374
|
```
|
|
344
375
|
|
|
376
|
+
`config.json` records the loopx product contract plus init-time project discovery: existing AI rules such as `AGENTS.md` / `CLAUDE.md` / Cursor / Copilot files, existing spec sources such as `docs/changes` or ADR/RFC folders, and detected install/test/lint/typecheck/build/E2E commands. This does not create a lighter loopx mode; it keeps project facts available to `plan`, `build`, and `review` while preserving loopx's full closed workflow.
|
|
377
|
+
|
|
345
378
|
`intake` contains immutable clarify snapshots for a specific request. `workflows` contains the active runtime working set. `changes` contains the proposed change delta for the current request. `specs` contains accepted long-lived behavior after archive.
|
|
346
379
|
|
|
347
|
-
`views/` and `workflows/<slug>/view/` are derived HTML reading views
|
|
380
|
+
`views/` and `workflows/<slug>/view/` are derived HTML reading views written after `plan` and regenerated by `loopx render`. They are for human review only and are safe to regenerate; agents and tooling should continue to read and update the Markdown and JSON artifacts.
|
|
348
381
|
|
|
349
382
|
### Document Boundaries
|
|
350
383
|
|
|
@@ -354,11 +387,12 @@ Documents users normally need to watch:
|
|
|
354
387
|
- `.loopx/workflows/<slug>/spec.md`: the current requirement working copy.
|
|
355
388
|
- `.loopx/workflows/<slug>/plan.md`, `architecture.md`, `development-plan.md`, and `test-plan.md`: the current task's plan, architecture, execution, and verification contract.
|
|
356
389
|
- `.loopx/workflows/<slug>/execution-record.md` and `review-report.md`: execution evidence and review result.
|
|
357
|
-
- `.loopx/views/index.html` and `.loopx/workflows/<slug>/view/index.html`: reading entrypoints
|
|
390
|
+
- `.loopx/views/index.html` and `.loopx/workflows/<slug>/view/index.html`: reading entrypoints written after `plan` and regenerated by `loopx render`.
|
|
358
391
|
|
|
359
392
|
Documents users may read and modify as workflow fact sources:
|
|
360
393
|
|
|
361
394
|
- `.loopx/workflows/<slug>/*.md`: editable working-copy artifacts for the active workflow; changes still need to pass the relevant stage gates.
|
|
395
|
+
- `.loopx/config.json`: workspace configuration, project-rule/spec-source discovery, and default verification commands; update it if the repository's canonical commands or project-rule files change.
|
|
362
396
|
- `.loopx/context/domain.md` and `.loopx/agents/*.md`: project context, domain vocabulary, and agent collaboration guidance.
|
|
363
397
|
- `.loopx/changes/active/<change-id>/*.md`: plan-generated change proposal, design, tasks, and spec delta; edits should be followed by plan/build/review validation.
|
|
364
398
|
- `.loopx/specs/<domain>/spec.md`: long-lived archived behavior specs; normally synced by `archive`, and manual edits should stay consistent with later change deltas.
|
|
@@ -370,7 +404,7 @@ Documents and data the tools depend on, or generate as derived evidence:
|
|
|
370
404
|
- `.loopx/intake/clarify-*.md`: immutable clarify snapshots for audit and traceability; do not treat them as long-lived specs.
|
|
371
405
|
- `.loopx/changes/active/<change-id>/slices.json` and `artifact-graph.json`: structured planning data consumed by build/review/archive.
|
|
372
406
|
- `.loopx/autopilot/<slug>/run.json` and `.loopx/build-active.json`: orchestration and stop-hook runtime state.
|
|
373
|
-
- `.loopx/views/` and `.loopx/workflows/<slug>/view/`: derived HTML views; they can be deleted and regenerated with `loopx render`, and should not be edited as fact sources.
|
|
407
|
+
- `.loopx/views/` and `.loopx/workflows/<slug>/view/`: derived HTML views; they are written after `plan`, can be deleted and regenerated with `loopx render`, and should not be edited as fact sources.
|
|
374
408
|
|
|
375
409
|
## Diagnostics and Repair
|
|
376
410
|
|
|
@@ -392,6 +426,12 @@ Check skill discovery state only:
|
|
|
392
426
|
node scripts/install-skills.mjs --check
|
|
393
427
|
```
|
|
394
428
|
|
|
429
|
+
Verify bundled skill governance:
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
node scripts/verify-skills.mjs
|
|
433
|
+
```
|
|
434
|
+
|
|
395
435
|
## Codex Workflow Hook
|
|
396
436
|
|
|
397
437
|
`install-skills.mjs` and the Codex plugin installer automatically install `scripts/codex-workflow-hook.mjs` to:
|
|
@@ -443,9 +483,17 @@ Run tests:
|
|
|
443
483
|
npm test
|
|
444
484
|
```
|
|
445
485
|
|
|
486
|
+
`npm test` runs bundled skill governance first, then the Node test suites:
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
node scripts/verify-skills.mjs
|
|
490
|
+
node --test test/*.test.mjs
|
|
491
|
+
```
|
|
492
|
+
|
|
446
493
|
Useful verification commands:
|
|
447
494
|
|
|
448
495
|
```bash
|
|
496
|
+
node scripts/verify-skills.mjs
|
|
449
497
|
node --test test/*.test.mjs
|
|
450
498
|
node scripts/install-skills.mjs --check
|
|
451
499
|
node --test plugins/loopx/scripts/plugin-install.test.mjs
|
|
@@ -462,6 +510,7 @@ node src/cli.mjs status --json
|
|
|
462
510
|
- `README.zh-CN.md`
|
|
463
511
|
- `package.json`
|
|
464
512
|
- `scripts/install-skills.mjs`
|
|
513
|
+
- `scripts/verify-skills.mjs`
|
|
465
514
|
- `scripts/codex-stop-hook.mjs`
|
|
466
515
|
- `scripts/codex-workflow-hook.mjs`
|
|
467
516
|
- `assets/logo.svg`
|
|
@@ -472,4 +521,4 @@ node src/cli.mjs status --json
|
|
|
472
521
|
|
|
473
522
|
## Version
|
|
474
523
|
|
|
475
|
-
Current npm package version: `0.1.
|
|
524
|
+
Current npm package version: `0.1.6`.
|
package/README.zh-CN.md
CHANGED
|
@@ -27,10 +27,12 @@ clarify -> plan -> build -> review -> approve review->done -> archive
|
|
|
27
27
|
## 特性
|
|
28
28
|
|
|
29
29
|
- 安装并公开 11 个 loopx Codex skills:工作流 skills `clarify`、`plan`、`build`、`review`、`archive`、`autopilot`,质量辅助 skills `debug`、`tdd`、`verify`,以及 Go 支持 skills `go-style`、`kratos`。
|
|
30
|
+
- 通过 `skills/RESOLVER.md` 明确 bundled skill 路由,并用确定性治理脚本检查 frontmatter、plugin 镜像、resolver 覆盖、本地引用、发布包包含项和版本一致性。
|
|
30
31
|
- 支持 npm 全局安装和 Codex plugin 安装,两种安装方式共享同一套 install/discovery 逻辑。
|
|
31
32
|
- 自动安装 loopx 管理的 Codex workflow hook,在 Codex 中提示当前 workflow 状态和安全下一步。
|
|
32
33
|
- 所有运行时状态和阶段产物都写入项目本地 `.loopx/`,便于审计、恢复和迁移。
|
|
33
34
|
- clarify 需求快照写入 `.loopx/intake/`,让 `.loopx/specs/` 只承载长期领域规格。
|
|
35
|
+
- init 时会把已有项目 AI 规则、既有 spec 来源和自动发现的验证命令记录到 `.loopx/config.json`,让 loopx 保留项目原有事实源,同时继续执行完整闭环。
|
|
34
36
|
- `plan` 默认采用 Planner -> Architect -> Critic 的共识规划循环。
|
|
35
37
|
- `plan` 会写入借鉴 OpenSpec 的 change artifacts:proposal、spec delta、design、tasks 和 artifact dependency graph。
|
|
36
38
|
- 提供项目级 agent context:`.loopx/agents/` 和 `.loopx/context/domain.md`,供 build/review 的 context manifest 消费。
|
|
@@ -140,7 +142,15 @@ loopx status my-task
|
|
|
140
142
|
loopx status my-task --json
|
|
141
143
|
```
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
plan 完成后会自动写入派生 HTML 阅读视图,方便直接审阅计划:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
.loopx/workflows/my-task/view/index.html
|
|
149
|
+
.loopx/workflows/my-task/view/plan.html
|
|
150
|
+
.loopx/views/index.html
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
需要时也可以重新生成派生 HTML 阅读视图:
|
|
144
154
|
|
|
145
155
|
```bash
|
|
146
156
|
loopx render my-task
|
|
@@ -174,7 +184,25 @@ loopx repair-install
|
|
|
174
184
|
|
|
175
185
|
CLI 主要用于运行时、调试、状态观察和维护。日常面向 Codex 的主入口是同名 skills,例如 `$clarify`、`$plan`、`$build`、`$review`、`$archive`、`$autopilot`、`$debug`、`$tdd`、`$verify`、`$go-style`、`$kratos`。
|
|
176
186
|
|
|
177
|
-
`loopx status` 仍然是 CLI/runtime 诊断命令,不作为单独 Codex skill 暴露。`loopx
|
|
187
|
+
`loopx status` 仍然是 CLI/runtime 诊断命令,不作为单独 Codex skill 暴露。`loopx plan` 会自动为当前计划 workflow 和工作区首页写入给人阅读的 HTML 视图。`loopx render` 会基于现有运行时产物重新生成这些视图;不传 slug 时会渲染所有非 legacy workflow 和工作区首页。Markdown 和 JSON 仍然是机器可读、可编辑的事实源。
|
|
188
|
+
|
|
189
|
+
## Skill 路由与治理
|
|
190
|
+
|
|
191
|
+
bundled skill resolver 位于:
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
skills/RESOLVER.md
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
它是 11 个 bundled skills 的可读路由表。修改任一 `skills/<name>/SKILL.md` 或镜像的 `plugins/loopx/skills/<name>/SKILL.md` 时,都要保持 resolver 同步。
|
|
198
|
+
|
|
199
|
+
skill 治理由下面的确定性脚本执行:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
node scripts/verify-skills.mjs
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
该脚本会检查 bundled skill frontmatter 是否可触发且有排除边界、`metadata.version` 是否匹配 `package.json`、plugin skill 镜像是否与 canonical skills 一致、`skills/RESOLVER.md` 是否覆盖所有 bundled skills 且没有陈旧 bundled-skill 引用、本地 skill 引用是否存在、plugin manifest 版本是否匹配 package 版本,以及 verifier 本身是否进入 npm 发布包。
|
|
178
206
|
|
|
179
207
|
## Skill 说明
|
|
180
208
|
|
|
@@ -199,12 +227,15 @@ CLI 主要用于运行时、调试、状态观察和维护。日常面向 Codex
|
|
|
199
227
|
- `.loopx/changes/active/<change-id>/spec-delta.md`
|
|
200
228
|
- `.loopx/changes/active/<change-id>/design.md`
|
|
201
229
|
- `.loopx/changes/active/<change-id>/tasks.md`
|
|
230
|
+
- `.loopx/changes/active/<change-id>/slices.json`
|
|
202
231
|
- `.loopx/changes/active/<change-id>/artifact-graph.json`
|
|
203
232
|
- `.loopx/workflows/<slug>/plan.md`
|
|
204
233
|
- `.loopx/workflows/<slug>/architecture.md`
|
|
205
234
|
- `.loopx/workflows/<slug>/development-plan.md`
|
|
206
235
|
- `.loopx/workflows/<slug>/test-plan.md`
|
|
207
236
|
|
|
237
|
+
plan 成功后,loopx 还会写入派生阅读视图:`.loopx/workflows/<slug>/view/index.html`、`.loopx/workflows/<slug>/view/plan.html` 和 `.loopx/views/index.html`。这些视图用于人工审阅;Markdown 和 JSON 仍然是可编辑事实源。
|
|
238
|
+
|
|
208
239
|
`spec-delta.md` 使用 requirement delta:`## ADDED Requirements`、`## MODIFIED Requirements`、`## REMOVED Requirements` 和 `## RENAMED Requirements`。ADDED / MODIFIED 必须是完整的 `### Requirement:` 块,包含 SHALL/MUST 约束和 `#### Scenario:` 场景,archive 才能把它们合并进长期 spec 当前状态。
|
|
209
240
|
|
|
210
241
|
### build
|
|
@@ -347,14 +378,17 @@ loopx 在当前项目下写入 `.loopx/`:
|
|
|
347
378
|
review.html
|
|
348
379
|
plan-reviews/
|
|
349
380
|
build-support/
|
|
381
|
+
review-support/
|
|
350
382
|
autopilot/
|
|
351
383
|
<slug>/
|
|
352
384
|
run.json
|
|
353
385
|
```
|
|
354
386
|
|
|
387
|
+
`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` 能看到项目事实,同时保持完整闭环。
|
|
388
|
+
|
|
355
389
|
`intake` 保存一次需求的 clarify 快照;`workflows` 保存当前任务的运行时工作副本;`changes` 保存本次需求对长期行为的 change delta;`specs` 只保存 archive 后的长期领域行为契约。
|
|
356
390
|
|
|
357
|
-
`views/` 和 `workflows/<slug>/view/` 是 `loopx render`
|
|
391
|
+
`views/` 和 `workflows/<slug>/view/` 是 plan 后写入、也可由 `loopx render` 重新生成的派生 HTML 阅读视图,只服务于人的浏览和评审;agent 和工具仍应读取、修改 Markdown 与 JSON 产物。
|
|
358
392
|
|
|
359
393
|
### 文档关注边界
|
|
360
394
|
|
|
@@ -364,11 +398,12 @@ loopx 在当前项目下写入 `.loopx/`:
|
|
|
364
398
|
- `.loopx/workflows/<slug>/spec.md`:当前需求工作副本。
|
|
365
399
|
- `.loopx/workflows/<slug>/plan.md`、`architecture.md`、`development-plan.md`、`test-plan.md`:当前任务的计划、架构和验证约定。
|
|
366
400
|
- `.loopx/workflows/<slug>/execution-record.md`、`review-report.md`:执行证据和评审结论。
|
|
367
|
-
- `.loopx/views/index.html` 与 `.loopx/workflows/<slug>/view/index.html
|
|
401
|
+
- `.loopx/views/index.html` 与 `.loopx/workflows/<slug>/view/index.html`:plan 后写入、也可由 `loopx render` 重新生成的阅读入口。
|
|
368
402
|
|
|
369
403
|
用户可以阅读和按流程修改的事实源文档:
|
|
370
404
|
|
|
371
405
|
- `.loopx/workflows/<slug>/*.md`:当前 workflow 的可编辑工作副本;修改后仍需通过对应阶段门禁。
|
|
406
|
+
- `.loopx/config.json`:workspace 配置、项目规则/spec 来源发现结果和默认验证命令;当仓库的 canonical 命令或规则文件变化时可以更新。
|
|
372
407
|
- `.loopx/context/domain.md` 和 `.loopx/agents/*.md`:项目级背景、术语和 agent 协作约定。
|
|
373
408
|
- `.loopx/changes/active/<change-id>/*.md`:plan 生成的 change proposal、design、tasks 和 spec delta;修改后应重新过 plan/build/review。
|
|
374
409
|
- `.loopx/specs/<domain>/spec.md`:archive 后的长期行为规格;通常由 `archive` 同步,人工改动需要保持和后续 change delta 一致。
|
|
@@ -380,7 +415,7 @@ loopx 在当前项目下写入 `.loopx/`:
|
|
|
380
415
|
- `.loopx/intake/clarify-*.md`:clarify 快照,用于审计和追溯;不要当作长期 specs 修改。
|
|
381
416
|
- `.loopx/changes/active/<change-id>/slices.json`、`artifact-graph.json`:计划结构化数据,build/review/archive 会消费。
|
|
382
417
|
- `.loopx/autopilot/<slug>/run.json`、`.loopx/build-active.json`:编排和 stop-hook 运行态。
|
|
383
|
-
- `.loopx/views/` 和 `.loopx/workflows/<slug>/view/`:HTML
|
|
418
|
+
- `.loopx/views/` 和 `.loopx/workflows/<slug>/view/`:HTML 派生视图,plan 后自动写入,可删除后用 `loopx render` 重新生成,不应作为事实源编辑。
|
|
384
419
|
|
|
385
420
|
## 安装诊断与修复
|
|
386
421
|
|
|
@@ -402,6 +437,12 @@ loopx repair-install
|
|
|
402
437
|
node scripts/install-skills.mjs --check
|
|
403
438
|
```
|
|
404
439
|
|
|
440
|
+
检查 bundled skill 治理状态:
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
node scripts/verify-skills.mjs
|
|
444
|
+
```
|
|
445
|
+
|
|
405
446
|
## Codex Workflow Hook
|
|
406
447
|
|
|
407
448
|
`install-skills.mjs` 和 Codex plugin 安装脚本会自动把 `scripts/codex-workflow-hook.mjs` 安装到:
|
|
@@ -453,9 +494,17 @@ node scripts/codex-stop-hook.mjs
|
|
|
453
494
|
npm test
|
|
454
495
|
```
|
|
455
496
|
|
|
497
|
+
`npm test` 会先运行 bundled skill 治理检查,再运行 Node 测试套件:
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
node scripts/verify-skills.mjs
|
|
501
|
+
node --test test/*.test.mjs
|
|
502
|
+
```
|
|
503
|
+
|
|
456
504
|
也可以直接执行项目内的验证命令:
|
|
457
505
|
|
|
458
506
|
```bash
|
|
507
|
+
node scripts/verify-skills.mjs
|
|
459
508
|
node --test test/*.test.mjs
|
|
460
509
|
node scripts/install-skills.mjs --check
|
|
461
510
|
node --test plugins/loopx/scripts/plugin-install.test.mjs
|
|
@@ -472,6 +521,7 @@ node src/cli.mjs status --json
|
|
|
472
521
|
- `README.zh-CN.md`
|
|
473
522
|
- `package.json`
|
|
474
523
|
- `scripts/install-skills.mjs`
|
|
524
|
+
- `scripts/verify-skills.mjs`
|
|
475
525
|
- `scripts/codex-stop-hook.mjs`
|
|
476
526
|
- `scripts/codex-workflow-hook.mjs`
|
|
477
527
|
- `assets/logo.svg`
|
|
@@ -482,4 +532,4 @@ node src/cli.mjs status --json
|
|
|
482
532
|
|
|
483
533
|
## 版本
|
|
484
534
|
|
|
485
|
-
当前 npm 包版本:`0.1.
|
|
535
|
+
当前 npm 包版本:`0.1.6`。
|
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.6",
|
|
5
5
|
"description": "Skill-first loopx workflow product for Codex",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"README.zh-CN.md",
|
|
23
23
|
"package.json",
|
|
24
24
|
"scripts/install-skills.mjs",
|
|
25
|
+
"scripts/verify-skills.mjs",
|
|
25
26
|
"scripts/codex-stop-hook.mjs",
|
|
26
27
|
"scripts/codex-workflow-hook.mjs",
|
|
27
28
|
"assets/logo.svg",
|
|
@@ -35,6 +36,6 @@
|
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"postinstall": "node scripts/install-skills.mjs",
|
|
38
|
-
"test": "node --test test/*.test.mjs"
|
|
39
|
+
"test": "node scripts/verify-skills.mjs && node --test test/*.test.mjs"
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archive
|
|
3
|
-
description:
|
|
3
|
+
description: "Archives an approved loopx change delta into long-lived specs and writes an ADR candidate after done approval. Not for active builds or unapproved reviews."
|
|
4
|
+
when_to_use: "archive, done workflow, spec delta, long-lived specs, ADR candidate, review approved, 归档, 同步规格"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
argument-hint: "<workflow slug>"
|
|
5
8
|
---
|
|
6
9
|
|
|
@@ -8,7 +11,7 @@ argument-hint: "<workflow slug>"
|
|
|
8
11
|
|
|
9
12
|
## Purpose
|
|
10
13
|
|
|
11
|
-
Use `archive` after a loopx workflow has reached `done
|
|
14
|
+
Use `archive` after a loopx workflow has reached `done`, or immediately after an approved review that is waiting for `review -> done` completion. It syncs the accepted change delta into long-lived `.loopx/specs/` files, archives the change staging directory, and writes an advisory ADR candidate.
|
|
12
15
|
|
|
13
16
|
The accepted delta is requirement-based, not a changelog block. Archive applies:
|
|
14
17
|
|
|
@@ -21,7 +24,7 @@ into the current long-lived `## Requirements` state for each target domain.
|
|
|
21
24
|
|
|
22
25
|
## Inputs
|
|
23
26
|
|
|
24
|
-
- `<workflow slug>` for a completed loopx workflow
|
|
27
|
+
- `<workflow slug>` for a completed loopx workflow, or for a review-approved workflow whose next route is `done`
|
|
25
28
|
|
|
26
29
|
## Behavior
|
|
27
30
|
|
|
@@ -31,9 +34,12 @@ Run:
|
|
|
31
34
|
loopx archive <slug>
|
|
32
35
|
```
|
|
33
36
|
|
|
37
|
+
If review already approved the workflow and the only pending transition is `review -> done`, this command consumes that completion transition before archiving. Do not ask the user to run a separate `loopx approve <slug> --from review --to done` command in that case.
|
|
38
|
+
|
|
34
39
|
Then report in Chinese:
|
|
35
40
|
|
|
36
41
|
- whether the change was archived
|
|
42
|
+
- whether `review -> done` was consumed by archive
|
|
37
43
|
- which long-lived spec files were updated
|
|
38
44
|
- the archived change path
|
|
39
45
|
- the ADR candidate path, if written
|
|
@@ -41,7 +47,7 @@ Then report in Chinese:
|
|
|
41
47
|
|
|
42
48
|
## Boundaries
|
|
43
49
|
|
|
44
|
-
- Do not run archive before
|
|
50
|
+
- Do not run archive before review has approved the workflow and routed it to `done`.
|
|
45
51
|
- Do not archive malformed requirement deltas. ADDED and MODIFIED entries must use `### Requirement:`, SHALL/MUST language, and at least one `#### Scenario:`.
|
|
46
52
|
- 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.
|
|
47
53
|
- Do not edit implementation code.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autopilot
|
|
3
|
-
description:
|
|
3
|
+
description: "Runs one bounded autonomous loopx orchestration over clarify, plan, build, and review while preserving canonical artifacts. Not for manual gate-by-gate control."
|
|
4
|
+
when_to_use: "autopilot, autonomous loopx run, end-to-end workflow, run all stages, bounded orchestration, 自动执行, 全流程"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
argument-hint: "<workflow slug>"
|
|
5
8
|
---
|
|
6
9
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build
|
|
3
|
-
description:
|
|
3
|
+
description: "Executes an approved loopx plan or review rework contract with evidence, verification, deslop, and regression gates. Not for unclear requirements or independent review."
|
|
4
|
+
when_to_use: "build, implement approved plan, execute PRD, --from-review, review rework, implementation fixes, 执行, 实现, 修改"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
argument-hint: "[--no-deslop] <approved PRD path or workflow slug> | --from-review <review artifact path>"
|
|
5
8
|
---
|
|
6
9
|
|
|
@@ -30,6 +33,7 @@ By default, `build` is not a one-shot draft writer. It is a persistence loop wit
|
|
|
30
33
|
- Execution may parallelize internally without exposing a public `team` stage.
|
|
31
34
|
- `build` does not replace `review`.
|
|
32
35
|
- `execution-record.md` remains the sole canonical execution and verification artifact.
|
|
36
|
+
- `.loopx/config.json` is supporting context for existing project AI rules, existing spec sources, and discovered verification commands; use it to preserve local sources of truth, not to skip loopx stages.
|
|
33
37
|
- 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
38
|
- Bug, test-failure, build-failure, and unexpected-behavior work should use `debug` before proposing fixes.
|
|
35
39
|
- Completion and review-ready claims should use `verify` before they are stated.
|
|
@@ -72,6 +76,8 @@ Compatible skill / CLI input:
|
|
|
72
76
|
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
77
|
|
|
74
78
|
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.
|
|
79
|
+
|
|
80
|
+
Also load `.loopx/config.json` when present. Its `project_conventions` entries identify existing project rule/spec files that should be preserved, and its `verification_commands` entries are the first project-native commands to consider for fresh evidence.
|
|
75
81
|
</Inputs>
|
|
76
82
|
|
|
77
83
|
<Execution_Model>
|
|
@@ -194,6 +200,8 @@ These support artifacts are runtime aids only. They must not become new canonica
|
|
|
194
200
|
<Final_Response_Contract>
|
|
195
201
|
When `build` reaches review handoff readiness, the final response must include an explicit next skill command using the execution record path:
|
|
196
202
|
|
|
203
|
+
Default review handoff after build readiness:
|
|
204
|
+
|
|
197
205
|
```text
|
|
198
206
|
Next:
|
|
199
207
|
$review .loopx/workflows/<slug>/execution-record.md
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clarify
|
|
3
|
-
description:
|
|
3
|
+
description: "Clarifies ambiguous loopx work into requirements, non-goals, decision boundaries, and design-ready specs before planning. Not for already-approved plans or concrete implementation tasks."
|
|
4
|
+
when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# loopx Clarify
|
|
@@ -305,8 +308,11 @@ After the clarify spec is ready:
|
|
|
305
308
|
|
|
306
309
|
Preferred explicit handoff contract:
|
|
307
310
|
|
|
308
|
-
-
|
|
309
|
-
-
|
|
311
|
+
- Default handoff after normal loopx clarify: `$plan <slug>`
|
|
312
|
+
- Conditional artifact-pinned handoff: `$plan --direct <spec-path>`
|
|
313
|
+
- Recommend `$plan --direct <spec-path>` when the user explicitly wants to plan from a specific requirements artifact, when the source is external/manual/legacy, or when multiple plausible spec files exist and the user has chosen one as the planning source of truth.
|
|
314
|
+
- Do not use `$plan --direct` to work around unclear workflow state, missing approvals, or an uncertain slug; inspect or repair the loopx runtime state instead.
|
|
315
|
+
- For the normal loopx clarify happy path, prefer `$plan <slug>` because the active workflow slug already anchors the clarify artifact and runtime state.
|
|
310
316
|
- Consumer behavior: treat the clarify spec as the source of truth for intent, non-goals, decision boundaries, constraints, and design direction; do not reopen clarification by default
|
|
311
317
|
|
|
312
318
|
`clarify` itself does not implement the feature. The handoff recommendation must name `plan` as the next workflow step.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: debug
|
|
3
|
-
description:
|
|
3
|
+
description: "Finds root cause for bugs, failing tests, build failures, regressions, and unexpected behavior before fixes. Not for new feature planning or routine code review."
|
|
4
|
+
when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Systematic Debugging
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: go-style
|
|
3
|
-
description: Go
|
|
3
|
+
description: "Applies loopx Go coding style for .go edits, tests, errors, context, naming, and interface boundaries. Not for non-Go code or Kratos-specific architecture by itself."
|
|
4
|
+
when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Go Style
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kratos
|
|
3
|
-
description: Go-Kratos
|
|
3
|
+
description: "Supports Go-Kratos microservices, proto/buf APIs, service/biz/data layers, middleware, auth, config, and troubleshooting. Not for generic Go style alone."
|
|
4
|
+
when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Kratos
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
|
-
description:
|
|
3
|
+
description: "Creates a consensus-first loopx plan package with Planner, Architect, and Critic review from an approved spec. Not for unresolved requirements or direct implementation."
|
|
4
|
+
when_to_use: "plan, planning, consensus planning, PRD, architecture plan, test plan, approved clarify spec, 规划, 方案, 架构评审"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
argument-hint: "[--interactive] [--deliberate] [--direct <spec-path>] <clarified task or spec path>"
|
|
5
8
|
---
|
|
6
9
|
|
|
@@ -170,6 +173,14 @@ On approval, write canonical planning artifacts:
|
|
|
170
173
|
- `.loopx/changes/active/<change-id>/slices.json`
|
|
171
174
|
- `.loopx/changes/active/<change-id>/artifact-graph.json`
|
|
172
175
|
|
|
176
|
+
Also generate derived HTML reading views:
|
|
177
|
+
|
|
178
|
+
- `.loopx/workflows/<slug>/view/index.html`
|
|
179
|
+
- `.loopx/workflows/<slug>/view/plan.html`
|
|
180
|
+
- `.loopx/views/index.html`
|
|
181
|
+
|
|
182
|
+
The HTML files are derived reading views for human plan review. They are not canonical fact sources; Markdown and JSON remain authoritative.
|
|
183
|
+
|
|
173
184
|
The final plan must include:
|
|
174
185
|
|
|
175
186
|
- ADR: Decision, Drivers, Alternatives considered, Why chosen, Consequences, Follow-ups
|
|
@@ -196,6 +207,24 @@ In `--interactive` mode, ask for the next lane:
|
|
|
196
207
|
Without `--interactive`, report the approved plan and recommended next command, but do not launch execution.
|
|
197
208
|
</Consensus_Workflow>
|
|
198
209
|
|
|
210
|
+
<Final_Response_Contract>
|
|
211
|
+
Default build handoff after an approved plan package:
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
Next:
|
|
215
|
+
$build .loopx/plans/prd-<slug>.md
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Use the artifact-first PRD path because it pins build to the approved plan package. Do not emit `$build <slug>` as the primary handoff when `.loopx/plans/prd-<slug>.md` is known. If execution is not approved or plan gates remain blocked, state the blocker instead of emitting a build handoff.
|
|
219
|
+
|
|
220
|
+
Also report the generated HTML reading entrypoint so the user can review the plan without running another command:
|
|
221
|
+
|
|
222
|
+
```text
|
|
223
|
+
HTML:
|
|
224
|
+
.loopx/workflows/<slug>/view/index.html
|
|
225
|
+
```
|
|
226
|
+
</Final_Response_Contract>
|
|
227
|
+
|
|
199
228
|
<Runtime_State_Machine>
|
|
200
229
|
`plan` must keep the planning gate machine-checkable. Runtime state should track:
|
|
201
230
|
|
|
@@ -246,6 +275,7 @@ Primary outputs:
|
|
|
246
275
|
- approved plan package under `.loopx/workflows/<slug>/`
|
|
247
276
|
- canonical PRD and test spec under `.loopx/plans/`
|
|
248
277
|
- change artifacts under `.loopx/changes/active/<change-id>/`
|
|
278
|
+
- derived HTML reading views under `.loopx/workflows/<slug>/view/` and `.loopx/views/`
|
|
249
279
|
- consensus review summary with Planner / Architect / Critic evidence
|
|
250
280
|
- next-step recommendation
|
|
251
281
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description:
|
|
3
|
+
description: "Reviews a loopx build execution record for acceptance, code risks, evidence quality, and architecture smells. Not for doing implementation work or replanning."
|
|
4
|
+
when_to_use: "review, code review, acceptance, go no-go, execution-record, architecture smell, build complete, 审查, 验收"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
argument-hint: "<execution-record path or workflow slug>"
|
|
5
8
|
---
|
|
6
9
|
|
|
@@ -22,6 +25,8 @@ Compatible skill / CLI input:
|
|
|
22
25
|
|
|
23
26
|
When invoked with an execution record path, derive `<slug>` from the workflow directory and evaluate the matching active run.
|
|
24
27
|
|
|
28
|
+
When present, use `.loopx/config.json` as supporting context for project-native verification commands, existing AI rule files, and existing spec sources. Do not treat those external or pre-existing sources as replacements for the loopx execution record and review artifact.
|
|
29
|
+
|
|
25
30
|
## Expected Outputs
|
|
26
31
|
|
|
27
32
|
- a review artifact tied to the run being evaluated
|
|
@@ -42,6 +47,7 @@ Use stable machine values only where they are commands, file paths, JSON/state f
|
|
|
42
47
|
- Use this only after build has produced execution and verification evidence for a specific run.
|
|
43
48
|
- Stop here if review evidence is incomplete. `review` remains an independent gate and does not auto-complete the workflow.
|
|
44
49
|
- Review must include code review of the build-owned implementation diff. Do not limit review to artifact/schema checks.
|
|
50
|
+
- Review should compare verification evidence against project-native commands recorded in `.loopx/config.json` when available, while still accepting stronger task-specific verification from the approved plan.
|
|
45
51
|
- Review must include the architecture-smell lane as part of review evidence. This is not a new workflow stage and must not create extra user steps.
|
|
46
52
|
- Review must compare the execution scope against the approved workflow scope. If `execution-record.md` declares non-empty `remaining_scope`, `completion_claim` other than `full`, or a mismatch between `planned_scope` and `implemented_scope`, review must return no-go and route to build or plan. A partial slice may be accepted as useful work, but it must not be approved as full workflow completion.
|
|
47
53
|
- Code review findings should focus on real bugs, regressions, missing tests, broken contracts, security/data-integrity risks, and user-visible behavior gaps.
|
|
@@ -59,6 +65,8 @@ Every no-go review result must end with a concrete next command block.
|
|
|
59
65
|
|
|
60
66
|
For implementation fixes:
|
|
61
67
|
|
|
68
|
+
Default implementation-fix handoff:
|
|
69
|
+
|
|
62
70
|
```text
|
|
63
71
|
Next:
|
|
64
72
|
$build --from-review .loopx/workflows/<slug>/review-report.md
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd
|
|
3
|
-
description:
|
|
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
|
+
when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Test-Driven Development (TDD)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify
|
|
3
|
-
description:
|
|
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
|
+
when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.1.6"
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Verification Before Completion
|