@ai-content-space/loopx 0.1.8 → 0.1.9

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 CHANGED
@@ -522,4 +522,4 @@ node src/cli.mjs status --json
522
522
 
523
523
  ## Version
524
524
 
525
- Current npm package version: `0.1.8`.
525
+ Current npm package version: `0.1.9`.
package/README.zh-CN.md CHANGED
@@ -533,4 +533,4 @@ node src/cli.mjs status --json
533
533
 
534
534
  ## 版本
535
535
 
536
- 当前 npm 包版本:`0.1.8`。
536
+ 当前 npm 包版本:`0.1.9`。
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.8",
4
+ "version": "0.1.9",
5
5
  "description": "Skill-first loopx workflow product for Codex",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopx",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Skill-first loopx workflow product for Codex",
5
5
  "skills": "./skills/",
6
6
  "interface": {
@@ -3,7 +3,7 @@ name: archive
3
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
4
  when_to_use: "archive, done workflow, spec delta, long-lived specs, ADR candidate, review approved, 归档, 同步规格"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<workflow slug>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: autopilot
3
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
4
  when_to_use: "autopilot, autonomous loopx run, end-to-end workflow, run all stages, bounded orchestration, 自动执行, 全流程"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<workflow slug>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: build
3
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
4
  when_to_use: "build, implement approved plan, execute PRD, --from-review, review rework, implementation fixes, 执行, 实现, 修改"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "[--no-deslop] <approved PRD path or workflow slug> | --from-review <review artifact path>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: clarify
3
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
4
  when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # loopx Clarify
@@ -3,7 +3,7 @@ name: debug
3
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
4
  when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Systematic Debugging
@@ -3,7 +3,7 @@ name: go-style
3
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
4
  when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Go Style
@@ -3,7 +3,7 @@ name: kratos
3
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
4
  when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Kratos
@@ -3,7 +3,7 @@ name: plan
3
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
4
  when_to_use: "plan, planning, consensus planning, PRD, architecture plan, test plan, approved clarify spec, 规划, 方案, 架构评审"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "[--interactive] [--deliberate] [--direct <spec-path>] <clarified task or spec path>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: review
3
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
4
  when_to_use: "review, code review, acceptance, go no-go, execution-record, architecture smell, build complete, 审查, 验收"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<execution-record path or workflow slug>"
8
8
  ---
9
9
 
@@ -101,13 +101,16 @@ For approval:
101
101
 
102
102
  ```text
103
103
  Next:
104
- loopx approve <slug> --from review --to done
104
+ $archive <slug>
105
105
  ```
106
106
 
107
- After the workflow reaches `done`, run:
107
+ `$archive` consumes the pending `review -> done` completion transition before syncing specs. Do not ask the user to run a separate `loopx approve <slug> --from review --to done` command in the normal Codex-facing flow.
108
108
 
109
- ```text
110
- $archive <slug>
109
+ For CLI/runtime debugging only, the equivalent explicit sequence is:
110
+
111
+ ```bash
112
+ loopx approve <slug> --from review --to done
113
+ loopx archive <slug>
111
114
  ```
112
115
 
113
116
  This syncs the approved `.loopx/changes/active/<change-id>/spec-delta.md` into long-lived `.loopx/specs/` files and moves the change folder under `.loopx/changes/archive/<change-id>/`.
@@ -3,7 +3,7 @@ name: tdd
3
3
  description: "Guides feature and bugfix implementation through a failing test before production code and red-green-refactor discipline. Not for generated files or throwaway prototypes."
4
4
  when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Test-Driven Development (TDD)
@@ -3,7 +3,7 @@ name: verify
3
3
  description: "Requires fresh verification evidence before claiming work is complete, fixed, passing, review-ready, or ready to commit. Not for speculative confidence or stale results."
4
4
  when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Verification Before Completion
@@ -40,6 +40,13 @@ function nextSkill(state) {
40
40
  && state.archive_status !== 'archived') {
41
41
  return `$archive ${state.slug}`;
42
42
  }
43
+ if (state.current_stage === 'review'
44
+ && state.review_verdict === 'approve'
45
+ && state.pending_user_decision === 'review->done'
46
+ && ['requested', 'approved'].includes(state.approval?.complete)
47
+ && state.archive_status !== 'archived') {
48
+ return `$archive ${state.slug}`;
49
+ }
43
50
  if (state.stage_status === 'awaiting-approval'
44
51
  && state.current_stage === 'plan'
45
52
  && Array.isArray(state.plan_blockers)
@@ -84,9 +91,6 @@ function nextSkill(state) {
84
91
  && state.approval?.rollback === 'approved') {
85
92
  return `$clarify ${state.slug}`;
86
93
  }
87
- if (state.current_stage === 'review' && state.review_verdict === 'approve' && state.pending_user_decision === 'review->done') {
88
- return `loopx approve ${state.slug} --from review --to done`;
89
- }
90
94
  return null;
91
95
  }
92
96
 
@@ -3,7 +3,7 @@ name: archive
3
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
4
  when_to_use: "archive, done workflow, spec delta, long-lived specs, ADR candidate, review approved, 归档, 同步规格"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<workflow slug>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: autopilot
3
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
4
  when_to_use: "autopilot, autonomous loopx run, end-to-end workflow, run all stages, bounded orchestration, 自动执行, 全流程"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<workflow slug>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: build
3
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
4
  when_to_use: "build, implement approved plan, execute PRD, --from-review, review rework, implementation fixes, 执行, 实现, 修改"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "[--no-deslop] <approved PRD path or workflow slug> | --from-review <review artifact path>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: clarify
3
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
4
  when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # loopx Clarify
@@ -3,7 +3,7 @@ name: debug
3
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
4
  when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Systematic Debugging
@@ -3,7 +3,7 @@ name: go-style
3
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
4
  when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Go Style
@@ -3,7 +3,7 @@ name: kratos
3
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
4
  when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Kratos
@@ -3,7 +3,7 @@ name: plan
3
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
4
  when_to_use: "plan, planning, consensus planning, PRD, architecture plan, test plan, approved clarify spec, 规划, 方案, 架构评审"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "[--interactive] [--deliberate] [--direct <spec-path>] <clarified task or spec path>"
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@ name: review
3
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
4
  when_to_use: "review, code review, acceptance, go no-go, execution-record, architecture smell, build complete, 审查, 验收"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  argument-hint: "<execution-record path or workflow slug>"
8
8
  ---
9
9
 
@@ -101,13 +101,16 @@ For approval:
101
101
 
102
102
  ```text
103
103
  Next:
104
- loopx approve <slug> --from review --to done
104
+ $archive <slug>
105
105
  ```
106
106
 
107
- After the workflow reaches `done`, run:
107
+ `$archive` consumes the pending `review -> done` completion transition before syncing specs. Do not ask the user to run a separate `loopx approve <slug> --from review --to done` command in the normal Codex-facing flow.
108
108
 
109
- ```text
110
- $archive <slug>
109
+ For CLI/runtime debugging only, the equivalent explicit sequence is:
110
+
111
+ ```bash
112
+ loopx approve <slug> --from review --to done
113
+ loopx archive <slug>
111
114
  ```
112
115
 
113
116
  This syncs the approved `.loopx/changes/active/<change-id>/spec-delta.md` into long-lived `.loopx/specs/` files and moves the change folder under `.loopx/changes/archive/<change-id>/`.
@@ -3,7 +3,7 @@ name: tdd
3
3
  description: "Guides feature and bugfix implementation through a failing test before production code and red-green-refactor discipline. Not for generated files or throwaway prototypes."
4
4
  when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Test-Driven Development (TDD)
@@ -3,7 +3,7 @@ name: verify
3
3
  description: "Requires fresh verification evidence before claiming work is complete, fixed, passing, review-ready, or ready to commit. Not for speculative confidence or stale results."
4
4
  when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
5
5
  metadata:
6
- version: "0.1.8"
6
+ version: "0.1.9"
7
7
  ---
8
8
 
9
9
  # Verification Before Completion
@@ -19,6 +19,13 @@ export function nextSkillCommand(state) {
19
19
  && state.archive_status !== 'archived') {
20
20
  return `$archive ${state.slug}`;
21
21
  }
22
+ if (state.current_stage === 'review'
23
+ && state.review_verdict === 'approve'
24
+ && state.pending_user_decision === 'review->done'
25
+ && ['requested', 'approved'].includes(state.approval?.complete)
26
+ && state.archive_status !== 'archived') {
27
+ return `$archive ${state.slug}`;
28
+ }
22
29
  if (state.stage_status !== 'awaiting-approval') {
23
30
  return null;
24
31
  }
package/src/workflow.mjs CHANGED
@@ -2248,7 +2248,7 @@ function buildCurrentEvidenceChain(state, readiness = buildReadiness(state), aut
2248
2248
  evidence.push(evidenceEntry(
2249
2249
  'review_approved',
2250
2250
  'Review verdict is approve.',
2251
- authorization.done.authorized ? 'The approved review -> done transition can be consumed.' : 'Completion still requires explicit review -> done authorization.',
2251
+ authorization.done.authorized ? 'Archive can consume the approved review -> done transition before syncing specs.' : 'Completion still requires explicit review -> done authorization.',
2252
2252
  ));
2253
2253
  }
2254
2254
  if (state.archive_status === 'archived' && state.spec_sync_status === 'synced') {
@@ -2371,9 +2371,7 @@ function recommendedAction(state, legacy = false) {
2371
2371
  : 'Approve build -> review when execution-record.md is complete.';
2372
2372
  case STAGES.REVIEW:
2373
2373
  if (state.review_verdict === 'approve') {
2374
- return state.approval.complete === APPROVAL_STATES.APPROVED
2375
- ? 'Run loopx review again to consume the approved review -> done transition.'
2376
- : 'Approve review -> done to complete the workflow.';
2374
+ return 'Run loopx archive; archive consumes the pending review -> done completion transition before syncing specs.';
2377
2375
  }
2378
2376
  if (state.review_verdict === 'request-changes') {
2379
2377
  if (state.requested_transition === TRANSITIONS.REVIEW_TO_BUILD && state.approval.build === APPROVAL_STATES.APPROVED) {
@@ -2574,7 +2572,11 @@ function nextCommandForRollbackTarget(slug, target) {
2574
2572
  if (target === 'none') {
2575
2573
  return [
2576
2574
  'Next:',
2575
+ `$archive ${slug}`,
2576
+ '',
2577
+ 'CLI-only equivalent:',
2577
2578
  `loopx approve ${slug} --from review --to done`,
2579
+ `loopx archive ${slug}`,
2578
2580
  ].join('\n');
2579
2581
  }
2580
2582
  return [
@@ -2587,7 +2589,7 @@ function nextCommandForRollbackTarget(slug, target) {
2587
2589
  function reviewUserMessageZh({ slug, verdict, rollbackTarget, findings }) {
2588
2590
  const label = reviewVerdictLabel(verdict);
2589
2591
  const next = verdict === 'APPROVE'
2590
- ? `下一步:批准 review -> done 后完成工作流。\n${nextCommandForRollbackTarget(slug, 'none')}`
2592
+ ? `下一步:直接归档;archive 会先消费 pending 的 review -> done 完成态。\n${nextCommandForRollbackTarget(slug, 'none')}`
2591
2593
  : `下一步:按审查发现处理,并${rollbackTargetLabel(rollbackTarget)}。\n${nextCommandForRollbackTarget(slug, rollbackTarget)}`;
2592
2594
  const findingText = Array.isArray(findings) && findings.length > 0 ? findings.join(';') : '无额外发现。';
2593
2595
  return `Review 结果:${slug} ${label}。审查发现:${findingText} ${next}`;
@@ -3929,7 +3931,7 @@ export async function reviewStage(cwd, slug, { reviewer = 'independent-reviewer'
3929
3931
  verdict: reviewInput.verdict,
3930
3932
  reviewMessageZh: reviewMessage,
3931
3933
  evidenceManifest: reviewInput.evidenceManifest,
3932
- followUps: ['等待 review -> done 审批。'],
3934
+ followUps: ['执行 $archive;archive 会消费 pending 的 review -> done 完成态。'],
3933
3935
  });
3934
3936
  } catch (error) {
3935
3937
  journalWarning = error instanceof Error ? error.message : String(error);