@ai-content-space/loopx 0.1.10 → 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.
Files changed (72) hide show
  1. package/AGENTS.md +50 -0
  2. package/README.md +59 -450
  3. package/README.zh-CN.md +59 -461
  4. package/docs/loopx/design/loopx-skill-suite-v1-design.md +73 -0
  5. package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +77 -0
  6. package/package.json +5 -2
  7. package/plugins/loopx/.codex-plugin/plugin.json +4 -4
  8. package/plugins/loopx/scripts/plugin-install.test.mjs +20 -20
  9. package/plugins/loopx/skills/clarify/SKILL.md +38 -311
  10. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  11. package/plugins/loopx/skills/exec/SKILL.md +71 -0
  12. package/plugins/loopx/skills/finish/SKILL.md +254 -0
  13. package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
  14. package/plugins/loopx/skills/go-style/SKILL.md +1 -1
  15. package/plugins/loopx/skills/kratos/SKILL.md +1 -1
  16. package/plugins/loopx/skills/plan/SKILL.md +138 -271
  17. package/plugins/loopx/skills/refactor-plan/SKILL.md +71 -0
  18. package/plugins/loopx/skills/review/SKILL.md +72 -105
  19. package/plugins/loopx/skills/review/code-reviewer.md +168 -0
  20. package/plugins/loopx/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
  21. package/plugins/loopx/skills/spec/SKILL.md +76 -0
  22. package/plugins/loopx/skills/subagent-exec/SKILL.md +282 -0
  23. package/plugins/loopx/skills/subagent-exec/agents/openai.yaml +3 -0
  24. package/plugins/loopx/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
  25. package/plugins/loopx/skills/subagent-exec/codex-subagents.md +37 -0
  26. package/plugins/loopx/skills/subagent-exec/implementer-prompt.md +113 -0
  27. package/plugins/loopx/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
  28. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  29. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  30. package/scripts/claude-workflow-hook.mjs +109 -0
  31. package/scripts/codex-workflow-hook.mjs +2 -5
  32. package/scripts/install-skills.mjs +3 -3
  33. package/scripts/verify-skills.mjs +32 -1
  34. package/skills/RESOLVER.md +26 -17
  35. package/skills/clarify/SKILL.md +38 -311
  36. package/skills/debug/SKILL.md +1 -1
  37. package/skills/exec/SKILL.md +71 -0
  38. package/skills/finish/SKILL.md +254 -0
  39. package/skills/fix-review/SKILL.md +216 -0
  40. package/skills/go-style/SKILL.md +1 -1
  41. package/skills/kratos/SKILL.md +1 -1
  42. package/skills/plan/SKILL.md +138 -271
  43. package/skills/refactor-plan/SKILL.md +71 -0
  44. package/skills/review/SKILL.md +72 -105
  45. package/skills/review/code-reviewer.md +168 -0
  46. package/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
  47. package/skills/spec/SKILL.md +76 -0
  48. package/skills/subagent-exec/SKILL.md +282 -0
  49. package/skills/subagent-exec/agents/openai.yaml +3 -0
  50. package/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
  51. package/skills/subagent-exec/codex-subagents.md +37 -0
  52. package/skills/subagent-exec/implementer-prompt.md +113 -0
  53. package/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
  54. package/skills/tdd/SKILL.md +1 -1
  55. package/skills/verify/SKILL.md +1 -1
  56. package/src/autopilot-runtime.mjs +1 -1
  57. package/src/cli.mjs +77 -5
  58. package/src/context-manifest.mjs +2 -2
  59. package/src/html-views.mjs +129 -195
  60. package/src/install-discovery.mjs +210 -6
  61. package/src/next-skill.mjs +2 -4
  62. package/src/plan-runtime.mjs +571 -93
  63. package/src/runtime-maintenance.mjs +5 -2
  64. package/src/workflow.mjs +865 -68
  65. package/templates/architecture.md +58 -16
  66. package/templates/development-plan.md +42 -12
  67. package/plugins/loopx/skills/archive/SKILL.md +0 -55
  68. package/plugins/loopx/skills/autopilot/SKILL.md +0 -93
  69. package/plugins/loopx/skills/build/SKILL.md +0 -228
  70. package/skills/archive/SKILL.md +0 -55
  71. package/skills/autopilot/SKILL.md +0 -93
  72. package/skills/build/SKILL.md +0 -228
@@ -2,30 +2,72 @@
2
2
  schema_version: 1
3
3
  workflow_id: <workflow id>
4
4
  stage: plan
5
- decision_id: loopx-v1
6
- chosen_option: skill-first-runtime-substrate
5
+ decision_id: <decision id>
6
+ chosen_option: <chosen option>
7
7
  ---
8
8
 
9
9
  # loopx Architecture: <task name>
10
10
 
11
- ## Intent
11
+ ## 文档定位
12
12
 
13
- - keep loopx skill-first while reusing the deterministic runtime/debug substrate
13
+ 架构文档回答“系统如何分层、如何集成、边界在哪里、哪些风险必须被设计约束”。它不是开发排期,也不是字段级详细设计。
14
14
 
15
- ## Boundaries
15
+ | 文档 | 负责回答 | 不负责回答 |
16
+ | --- | --- | --- |
17
+ | `architecture.md` | 系统边界、模块职责、数据/状态模型、接口集成、架构决策和质量属性 | 逐文件编码步骤、字段默认值、函数签名细节 |
18
+ | `development-plan.md` | 切片顺序、依赖、验证、人工确认和完成定义 | 重新选择架构方向 |
19
+ | `design.md` | 字段、接口、函数、组件、状态机和边界条件 | 跨系统架构取舍或排期 |
16
20
 
17
- - skills are the primary user surface
18
- - CLI remains runtime/debug support
19
- - approvals remain explicit
20
- - review stays independent from build
21
+ ## 架构目标与非目标
21
22
 
22
- ## Chosen Design
23
+ - 目标:<architecture goals>
24
+ - 非目标:<architecture non-goals>
25
+ - 不可越过边界:<hard boundaries>
23
26
 
24
- - canonical loopx artifacts under `.loopx/`
25
- - single build lane, no public `team`
26
- - bounded `autopilot` composition over clarify/plan/build/review
27
+ ## 上下文与系统边界
27
28
 
28
- ## Alternatives Considered
29
+ | 入口/参与方 | 上游来源 | 本系统职责 | 下游/外部依赖 | 本次边界 |
30
+ | --- | --- | --- | --- | --- |
31
+ | <actor or entrypoint> | <source> | <responsibility> | <dependency> | <in/out of scope> |
29
32
 
30
- - thin skill wrappers over a CLI-first product
31
- - plugin-first rebuild
33
+ ## 组件与职责
34
+
35
+ | 组件/模块 | 职责 | 不负责 | 调用方向 | 所有者/约束 |
36
+ | --- | --- | --- | --- | --- |
37
+ | <component> | <responsibility> | <non-responsibility> | <caller -> callee> | <constraint> |
38
+
39
+ ## 数据与状态模型
40
+
41
+ | 实体/状态 | 关键字段/状态值 | 来源 | 一致性/幂等约束 | 审计/追踪 |
42
+ | --- | --- | --- | --- | --- |
43
+ | <entity or state> | <fields> | <source> | <consistency rule> | <audit trail> |
44
+
45
+ ## 接口与集成契约
46
+
47
+ | 接口/事件/provider | 输入 | 输出 | 错误/权限 | 副作用边界 |
48
+ | --- | --- | --- | --- | --- |
49
+ | <contract> | <input> | <output> | <error/auth> | <side effect boundary> |
50
+
51
+ ## 关键流程
52
+
53
+ 1. <happy path step>
54
+ 2. <state/data update>
55
+ 3. <response or downstream handling>
56
+
57
+ 异常流程:
58
+
59
+ - <failure path and handling>
60
+
61
+ ## 质量属性与风险
62
+
63
+ | 质量属性 | 设计约束 | 验证方式 | 残余风险 |
64
+ | --- | --- | --- | --- |
65
+ | 可测试性 | <constraint> | <verification> | <risk> |
66
+ | 可观测性 | <constraint> | <verification> | <risk> |
67
+ | 安全/副作用 | <constraint> | <verification> | <risk> |
68
+
69
+ ## 架构决策记录
70
+
71
+ | 决策 | 备选方案 | 选择理由 | 后续影响 |
72
+ | --- | --- | --- | --- |
73
+ | <decision> | <alternatives> | <why chosen> | <consequence> |
@@ -8,20 +8,50 @@ stage_owner: plan
8
8
 
9
9
  # loopx Development Plan: <task name>
10
10
 
11
- ## Execution Breakdown
11
+ ## 文档定位
12
12
 
13
- 1. prepare clarify spec
14
- 2. generate plan package
15
- 3. run build with verification
16
- 4. run review
13
+ 开发计划回答“按什么顺序交付、每个切片做到什么程度、依赖什么、如何验证、何时算完成”。它不重新做架构取舍,也不写字段级详细设计。
17
14
 
18
- ## Staffing Guidance
15
+ ## 交付切片
19
16
 
20
- - owner: build
21
- - verifier: review
22
- - runtime helpers: CLI support only
17
+ | 切片 | 模式 AFK/HITL | 用户可见/系统行为 | 主要文件/模块 | 验收标准 | 验证信号 |
18
+ | --- | --- | --- | --- | --- | --- |
19
+ | Slice 1 | <AFK or HITL> | <behavior> | <files/modules> | <acceptance> | <command/evidence> |
23
20
 
24
- ## Sequencing
21
+ ## 实施顺序与依赖
25
22
 
26
- - do not skip approvals
27
- - do not bypass review
23
+ | 顺序 | 工作 | 依赖 | 退出条件 |
24
+ | --- | --- | --- | --- |
25
+ | 1 | <work item> | <dependency> | <done signal> |
26
+
27
+ ## 需求到开发切片
28
+
29
+ | 原始需求 | 切片 | 实现范围 | 完成判定 |
30
+ | --- | --- | --- | --- |
31
+ | <source requirement> | <slice> | <implementation scope> | <done definition> |
32
+
33
+ ## 文件级变更清单
34
+
35
+ | 文件/目录 | 变更类型 | 所属切片 | 说明 |
36
+ | --- | --- | --- | --- |
37
+ | <path> | <add/modify/generate/test> | <slice> | <note> |
38
+
39
+ ## 验证计划
40
+
41
+ | 验证层级 | 命令/证据 | 覆盖切片 | 失败处理 |
42
+ | --- | --- | --- | --- |
43
+ | 单元/集成/构建/人工 | <command or evidence> | <slice> | <fallback> |
44
+
45
+ ## 人工确认点
46
+
47
+ - <HITL approval or manual validation point>
48
+
49
+ ## 回滚/降级策略
50
+
51
+ - <rollback or remaining_scope rule>
52
+
53
+ ## 完成定义
54
+
55
+ - 所有切片的验收标准都有实现和验证证据。
56
+ - `execution-record.md` 的 `completion_claim` 与实际范围一致。
57
+ - deslop 后重新运行回归验证。
@@ -1,55 +0,0 @@
1
- ---
2
- name: archive
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.10"
7
- argument-hint: "<workflow slug>"
8
- ---
9
-
10
- # loopx Archive
11
-
12
- ## Purpose
13
-
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.
15
-
16
- The accepted delta is requirement-based, not a changelog block. Archive applies:
17
-
18
- - `## ADDED Requirements`
19
- - `## MODIFIED Requirements`
20
- - `## REMOVED Requirements`
21
- - `## RENAMED Requirements`
22
-
23
- into the current long-lived `## Requirements` state for each target domain.
24
-
25
- ## Inputs
26
-
27
- - `<workflow slug>` for a completed loopx workflow, or for a review-approved workflow whose next route is `done`
28
-
29
- ## Behavior
30
-
31
- Run:
32
-
33
- ```bash
34
- loopx archive <slug>
35
- ```
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
-
39
- Then report in Chinese:
40
-
41
- - whether the change was archived
42
- - whether `review -> done` was consumed by archive
43
- - which long-lived spec files were updated
44
- - the archived change path
45
- - the ADR candidate path, if written
46
- - any blocker if the workflow is not done, the spec delta is incomplete, or the execution record still declares partial scope
47
-
48
- ## Boundaries
49
-
50
- - Do not run archive before review has approved the workflow and routed it to `done`.
51
- - Do not archive malformed requirement deltas. ADDED and MODIFIED entries must use `### Requirement:`, SHALL/MUST language, and at least one `#### Scenario:`.
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.
53
- - Do not edit implementation code.
54
- - Do not promote ADR candidates into `docs/adr/` automatically; report the candidate path for human follow-up.
55
- - Do not treat `loopx status` as a user-facing skill. Use status only as a runtime diagnostic when needed.
@@ -1,93 +0,0 @@
1
- ---
2
- name: autopilot
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.10"
7
- argument-hint: "<workflow slug>"
8
- ---
9
-
10
- # loopx Autopilot
11
-
12
- <Purpose>
13
- `autopilot` is loopx's autonomous orchestration surface. It upgrades the current bounded composition model by adding richer internal phases while keeping loopx's public stage model authoritative.
14
-
15
- Externally, the user still reasons about:
16
-
17
- - `clarify`
18
- - `plan`
19
- - `build`
20
- - `review`
21
-
22
- Internally, `autopilot` may orchestrate richer phases such as expansion, planning, execution, QA, and validation.
23
- </Purpose>
24
-
25
- <Use_When>
26
- - One owner wants loopx to run end-to-end with internal autonomous orchestration.
27
- - A clarified or workflow-local spec already exists, or the workflow is ready to begin from loopx stages.
28
- - The task benefits from richer internal planning/execution/QA/validation behavior without exposing a more complex public stage surface.
29
- </Use_When>
30
-
31
- <Do_Not_Use_When>
32
- - The user wants manual control over each stage gate.
33
- - The task should stop after planning or execution rather than run end-to-end.
34
- - Requirements are too ambiguous for bounded autonomous orchestration.
35
- </Do_Not_Use_When>
36
-
37
- <Core_Principles>
38
- - loopx public stage truth remains authoritative.
39
- - Richer internal phases are allowed, but they stay internal.
40
- - Internal stage approvals may be auto-consumed and must be recorded as control events.
41
- - Canonical loopx artifacts remain the source of truth; `run.json` is an orchestration ledger.
42
- - Reuse strengthened loopx stage runtimes rather than re-implementing contradictory truths.
43
- </Core_Principles>
44
-
45
- <Internal_Phases>
46
- Suggested internal phase model:
47
-
48
- - `expansion`
49
- - `planning`
50
- - `execution`
51
- - `qa`
52
- - `validation`
53
-
54
- Phase-to-stage alignment:
55
-
56
- - `expansion` -> clarified-spec reuse or clarify preparation
57
- - `planning` -> loopx `plan`
58
- - `execution` + `qa` -> loopx `build`
59
- - `validation` -> pre-review validation plus loopx `review`
60
- </Internal_Phases>
61
-
62
- <Control_Plane>
63
- - one autopilot invocation authorizes one bounded autopilot run
64
- - autopilot may internally consume stage approvals for:
65
- - `clarify -> plan`
66
- - `plan -> build`
67
- - `build -> review`
68
- - `review -> done`
69
- - these decisions must be recorded as internal control events
70
- </Control_Plane>
71
-
72
- <Artifact_Contract>
73
- Canonical stage artifacts remain authoritative:
74
-
75
- - clarify spec artifacts
76
- - `.loopx/plans/prd-<slug>.md`
77
- - `.loopx/plans/test-spec-<slug>.md`
78
- - canonical build `execution-record.md`
79
- - canonical review `review-report.md`
80
-
81
- Autopilot also writes an orchestration ledger:
82
-
83
- - `.loopx/autopilot/<slug>/run.json`
84
-
85
- `run.json` may include internal phase progression, blockers, and control events, but it must not replace canonical stage artifacts as the source of truth.
86
- </Artifact_Contract>
87
-
88
- <Must_Not_Decide_Automatically>
89
- - do not create a new public stage family
90
- - do not bypass loopx canonical artifacts
91
- - do not fork a second workflow truth that contradicts loopx stages
92
- - do not literally port the parent autopilot where it conflicts with loopx runtime contracts
93
- </Must_Not_Decide_Automatically>
@@ -1,228 +0,0 @@
1
- ---
2
- name: build
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.10"
7
- argument-hint: "[--no-deslop] <approved PRD path or workflow slug> | --from-review <review artifact path>"
8
- ---
9
-
10
- # loopx Build
11
-
12
- <Purpose>
13
- `build` is loopx's canonical execution lane. It executes an approved plan with Ralph-style rigor while keeping the public loopx stage surface unchanged.
14
-
15
- By default, `build` is not a one-shot draft writer. It is a persistence loop with internal parallel lanes, fresh verification, architect gating, deslop, and regression re-verification before `review` can start.
16
- </Purpose>
17
-
18
- <Use_When>
19
- - `plan -> build` has already been explicitly approved.
20
- - `review -> build` was requested for implementation fixes and a review artifact is supplied with `--from-review`.
21
- - Canonical plan artifacts already exist and execution should now proceed.
22
- - The task needs execution persistence, verification evidence, and explicit pre-review quality gates.
23
- </Use_When>
24
-
25
- <Do_Not_Use_When>
26
- - Requirements or planning are still incomplete.
27
- - The user wants to skip execution and only review or inspect the plan.
28
- - A valid build run is already review-ready and the next action is `review`.
29
- </Do_Not_Use_When>
30
-
31
- <Core_Principles>
32
- - Public surface stays `build`; internal strength can still match Ralph-style execution.
33
- - Execution may parallelize internally without exposing a public `team` stage.
34
- - `build` does not replace `review`.
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.
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.
38
- - Bug, test-failure, build-failure, and unexpected-behavior work should use `debug` before proposing fixes.
39
- - Completion and review-ready claims should use `verify` before they are stated.
40
- - Go edits should use `go-style` and preserve local repository conventions.
41
- - Go-Kratos work should use `kratos` when Kratos project signals or Kratos-specific tasks are present.
42
- - Fresh evidence is required before review handoff.
43
- - Deslop and regression re-verification are part of the default build path.
44
- - `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.
45
- </Core_Principles>
46
-
47
- <Preconditions>
48
- For initial execution, `build` starts only when all of the following are true:
49
-
50
- - approved `plan -> build` transition exists
51
- - `.loopx/plans/prd-<slug>.md` exists
52
- - `.loopx/plans/test-spec-<slug>.md` exists
53
- - workflow-local planning artifacts required by the execution lane exist
54
-
55
- For review-requested implementation fixes, `build` may instead start from:
56
-
57
- - `$build --from-review .loopx/workflows/<slug>/review-report.md`
58
- - or `$build --from-review .loopx/workflows/<slug>/review.md`
59
-
60
- 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.
61
- </Preconditions>
62
-
63
- <Inputs>
64
- Preferred skill input:
65
-
66
- - `.loopx/plans/prd-<slug>.md`
67
-
68
- Preferred review rework input:
69
-
70
- - `--from-review .loopx/workflows/<slug>/review-report.md`
71
-
72
- Compatible skill / CLI input:
73
-
74
- - `<slug>`
75
-
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.
77
-
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.
81
- </Inputs>
82
-
83
- <Execution_Model>
84
- `build` should behave like a Ralph-style execution runtime:
85
-
86
- 1. Initialize or resume build iteration state.
87
- 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.
88
- 3. Run internal execution / evidence / verification lanes in parallel.
89
- 4. For implementation work, apply `tdd` unless the approved plan explicitly classifies the change as non-behavioral or test-inapplicable.
90
- 5. For failures discovered during execution or verification, apply `debug` before attempting fixes.
91
- 6. For `.go` edits, apply `go-style`; for Kratos API/service/biz/data work, apply `kratos` before changing framework structure.
92
- 7. Aggregate lane results into canonical `execution-record.md`.
93
- 8. Run fresh verification and read actual output using `verify` discipline.
94
- 9. Run architect verification as a hard pre-review gate.
95
- 10. Run deslop on build-owned changes.
96
- 11. Re-run regression verification after deslop.
97
- 12. Write/update the build delegation ledger and ensure blocking delegated work is drained.
98
- 13. Write/update the completion audit mapping approved plan, slices, and review rework inputs to evidence.
99
- 14. Stop only when review handoff gates are satisfied or a real blocker remains.
100
-
101
- `build` may persist support artifacts for runtime inspection, but they must not replace `execution-record.md`.
102
- </Execution_Model>
103
-
104
- <Continuation_Discipline>
105
- `build` is a persistence loop, not a "one phase per invocation" runner.
106
-
107
- 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.
108
-
109
- The following are **not** real blockers by themselves:
110
-
111
- - a planned phase is unfinished
112
- - a runtime adapter is not fully migrated yet
113
- - store-layer branches still need to be moved to the new service/client path
114
- - more files remain in the approved implementation scope
115
- - verification has not been rerun after the latest edits
116
-
117
- Those are remaining execution work. Keep working them down.
118
-
119
- A real blocker must identify why execution cannot safely continue now, such as:
120
-
121
- - missing human product/architecture decision that is not specified by the approved plan
122
- - unavailable credential, service, fixture, dependency, or environment that cannot be mocked or bypassed responsibly
123
- - verification failure caused by a pre-existing repository condition that blocks evaluating this change and cannot be isolated
124
- - repeated implementation failure after the build iteration budget is exhausted
125
- - a conflict between the approved plan and current repository facts that requires re-planning
126
-
127
- 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`.
128
- </Continuation_Discipline>
129
-
130
- <Runtime_State_Machine>
131
- `build` should track at minimum:
132
-
133
- - `build_run_id`
134
- - `build_current_iteration`
135
- - `build_max_iterations` (default `10`)
136
- - `build_parallel_mode`
137
- - `build_lane_statuses`
138
- - `build_verification_status`
139
- - `build_architect_verification_status`
140
- - `build_deslop_status`
141
- - `build_regression_status`
142
- - `build_blockers`
143
- - `build_progress_artifact_paths`
144
- - `build_support_evidence_paths`
145
- - `build_owner_id`
146
- - `build_owner_session_id`
147
- - `build_owner_status`
148
- - `build_delegation_status`
149
- - `build_delegation_ledger_path`
150
- - `build_active_delegation_count`
151
- - `build_completion_audit_status`
152
- - `build_completion_audit_path`
153
- - `execution_record_status`
154
-
155
- `build -> review` is blocked until:
156
-
157
- - all internal lanes are complete
158
- - fresh verification passes
159
- - architect verification is approved
160
- - deslop is complete, unless explicitly skipped
161
- - post-deslop regression passes
162
- - blocking delegated build work is drained
163
- - completion audit passes
164
- - `execution-record.md` is complete
165
- </Runtime_State_Machine>
166
-
167
- <Artifact_Contract>
168
- Canonical artifact:
169
-
170
- - `execution-record.md`
171
-
172
- `execution-record.md` must make the completion scope explicit when a plan is larger than the current implementation slice:
173
-
174
- - `planned_scope`: the approved PRD/workflow scope being measured.
175
- - `implemented_scope`: the scope actually completed in this build run.
176
- - `remaining_scope`: empty only when the approved workflow scope is fully implemented.
177
- - `completion_claim`: use `full` only when the whole approved workflow is complete; use `slice` or another non-full value for partial implementation.
178
-
179
- 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.
180
-
181
- Support artifacts may exist for:
182
-
183
- - iteration progress
184
- - lane evidence summaries
185
- - architect gate summaries
186
- - deslop summaries
187
- - regression summaries
188
- - `build-support/delegation-ledger.json`
189
- - `build-support/completion-audit.json`
190
-
191
- These support artifacts are runtime aids only. They must not become new canonical review inputs.
192
- </Artifact_Contract>
193
-
194
- <Review_Boundary>
195
- - build-internal architect verification is an execution-quality gate
196
- - review remains the final independent stage
197
- - review continues to own provenance checks, evidence completeness checks, completion/rollback decisions, and code-review
198
- </Review_Boundary>
199
-
200
- <Final_Response_Contract>
201
- When `build` reaches review handoff readiness, the final response must include an explicit next skill command using the execution record path:
202
-
203
- Default review handoff after build readiness:
204
-
205
- ```text
206
- Next:
207
- $review .loopx/workflows/<slug>/execution-record.md
208
- ```
209
-
210
- If the user needs the CLI/runtime-debug form, use:
211
-
212
- ```bash
213
- loopx review <slug>
214
- ```
215
-
216
- 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.
217
- </Final_Response_Contract>
218
-
219
- <Flags>
220
- - `--no-deslop`: skip the deslop pass and the post-deslop regression loop, while still requiring the latest successful pre-deslop verification evidence
221
- </Flags>
222
-
223
- <Must_Not_Decide_Automatically>
224
- - do not self-approve review
225
- - do not mark the workflow complete
226
- - do not replace `execution-record.md` with support artifacts
227
- - do not widen execution into public `team`, `ultrawork`, or `ralph` command surfaces
228
- </Must_Not_Decide_Automatically>
@@ -1,55 +0,0 @@
1
- ---
2
- name: archive
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.10"
7
- argument-hint: "<workflow slug>"
8
- ---
9
-
10
- # loopx Archive
11
-
12
- ## Purpose
13
-
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.
15
-
16
- The accepted delta is requirement-based, not a changelog block. Archive applies:
17
-
18
- - `## ADDED Requirements`
19
- - `## MODIFIED Requirements`
20
- - `## REMOVED Requirements`
21
- - `## RENAMED Requirements`
22
-
23
- into the current long-lived `## Requirements` state for each target domain.
24
-
25
- ## Inputs
26
-
27
- - `<workflow slug>` for a completed loopx workflow, or for a review-approved workflow whose next route is `done`
28
-
29
- ## Behavior
30
-
31
- Run:
32
-
33
- ```bash
34
- loopx archive <slug>
35
- ```
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
-
39
- Then report in Chinese:
40
-
41
- - whether the change was archived
42
- - whether `review -> done` was consumed by archive
43
- - which long-lived spec files were updated
44
- - the archived change path
45
- - the ADR candidate path, if written
46
- - any blocker if the workflow is not done, the spec delta is incomplete, or the execution record still declares partial scope
47
-
48
- ## Boundaries
49
-
50
- - Do not run archive before review has approved the workflow and routed it to `done`.
51
- - Do not archive malformed requirement deltas. ADDED and MODIFIED entries must use `### Requirement:`, SHALL/MUST language, and at least one `#### Scenario:`.
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.
53
- - Do not edit implementation code.
54
- - Do not promote ADR candidates into `docs/adr/` automatically; report the candidate path for human follow-up.
55
- - Do not treat `loopx status` as a user-facing skill. Use status only as a runtime diagnostic when needed.
@@ -1,93 +0,0 @@
1
- ---
2
- name: autopilot
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.10"
7
- argument-hint: "<workflow slug>"
8
- ---
9
-
10
- # loopx Autopilot
11
-
12
- <Purpose>
13
- `autopilot` is loopx's autonomous orchestration surface. It upgrades the current bounded composition model by adding richer internal phases while keeping loopx's public stage model authoritative.
14
-
15
- Externally, the user still reasons about:
16
-
17
- - `clarify`
18
- - `plan`
19
- - `build`
20
- - `review`
21
-
22
- Internally, `autopilot` may orchestrate richer phases such as expansion, planning, execution, QA, and validation.
23
- </Purpose>
24
-
25
- <Use_When>
26
- - One owner wants loopx to run end-to-end with internal autonomous orchestration.
27
- - A clarified or workflow-local spec already exists, or the workflow is ready to begin from loopx stages.
28
- - The task benefits from richer internal planning/execution/QA/validation behavior without exposing a more complex public stage surface.
29
- </Use_When>
30
-
31
- <Do_Not_Use_When>
32
- - The user wants manual control over each stage gate.
33
- - The task should stop after planning or execution rather than run end-to-end.
34
- - Requirements are too ambiguous for bounded autonomous orchestration.
35
- </Do_Not_Use_When>
36
-
37
- <Core_Principles>
38
- - loopx public stage truth remains authoritative.
39
- - Richer internal phases are allowed, but they stay internal.
40
- - Internal stage approvals may be auto-consumed and must be recorded as control events.
41
- - Canonical loopx artifacts remain the source of truth; `run.json` is an orchestration ledger.
42
- - Reuse strengthened loopx stage runtimes rather than re-implementing contradictory truths.
43
- </Core_Principles>
44
-
45
- <Internal_Phases>
46
- Suggested internal phase model:
47
-
48
- - `expansion`
49
- - `planning`
50
- - `execution`
51
- - `qa`
52
- - `validation`
53
-
54
- Phase-to-stage alignment:
55
-
56
- - `expansion` -> clarified-spec reuse or clarify preparation
57
- - `planning` -> loopx `plan`
58
- - `execution` + `qa` -> loopx `build`
59
- - `validation` -> pre-review validation plus loopx `review`
60
- </Internal_Phases>
61
-
62
- <Control_Plane>
63
- - one autopilot invocation authorizes one bounded autopilot run
64
- - autopilot may internally consume stage approvals for:
65
- - `clarify -> plan`
66
- - `plan -> build`
67
- - `build -> review`
68
- - `review -> done`
69
- - these decisions must be recorded as internal control events
70
- </Control_Plane>
71
-
72
- <Artifact_Contract>
73
- Canonical stage artifacts remain authoritative:
74
-
75
- - clarify spec artifacts
76
- - `.loopx/plans/prd-<slug>.md`
77
- - `.loopx/plans/test-spec-<slug>.md`
78
- - canonical build `execution-record.md`
79
- - canonical review `review-report.md`
80
-
81
- Autopilot also writes an orchestration ledger:
82
-
83
- - `.loopx/autopilot/<slug>/run.json`
84
-
85
- `run.json` may include internal phase progression, blockers, and control events, but it must not replace canonical stage artifacts as the source of truth.
86
- </Artifact_Contract>
87
-
88
- <Must_Not_Decide_Automatically>
89
- - do not create a new public stage family
90
- - do not bypass loopx canonical artifacts
91
- - do not fork a second workflow truth that contradicts loopx stages
92
- - do not literally port the parent autopilot where it conflicts with loopx runtime contracts
93
- </Must_Not_Decide_Automatically>