@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.
@@ -0,0 +1,166 @@
1
+ #!/usr/bin/env node
2
+
3
+ import assert from 'node:assert/strict';
4
+ import { existsSync } from 'node:fs';
5
+ import { readdir, readFile } from 'node:fs/promises';
6
+ import { dirname, join, resolve } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ import { LOOPX_BUNDLED_SKILLS } from '../src/install-discovery.mjs';
10
+
11
+ const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
12
+ const packageJson = JSON.parse(await readFile(join(repoRoot, 'package.json'), 'utf8'));
13
+ const pluginManifest = JSON.parse(await readFile(join(repoRoot, 'plugins', 'loopx', '.codex-plugin', 'plugin.json'), 'utf8'));
14
+ const resolverPath = join(repoRoot, 'skills', 'RESOLVER.md');
15
+ const markdownPaths = [
16
+ 'README.md',
17
+ 'README.zh-CN.md',
18
+ 'AGENTS.md',
19
+ 'skills/RESOLVER.md',
20
+ ];
21
+ const personalPathPattern = /\/(?:Users|home)\/[A-Za-z0-9._-]+\//;
22
+ const localRefPattern = /(?<![/.])\b(?:references|agents|scripts)\/[\w/.-]+\b/g;
23
+
24
+ function parseFrontmatter(path, text) {
25
+ assert.equal(text.startsWith('---\n'), true, `${path} must start with YAML frontmatter`);
26
+ const end = text.indexOf('\n---\n', 4);
27
+ assert.notEqual(end, -1, `${path} frontmatter must close with ---`);
28
+
29
+ const fields = {};
30
+ let inMetadata = false;
31
+ for (const line of text.slice(4, end).split('\n')) {
32
+ if (line === 'metadata:') {
33
+ inMetadata = true;
34
+ continue;
35
+ }
36
+ if (inMetadata && line.startsWith(' version:')) {
37
+ fields.version = line.split(':', 2)[1].trim().replace(/^"|"$/g, '');
38
+ continue;
39
+ }
40
+ if (!line || line.startsWith(' ')) {
41
+ continue;
42
+ }
43
+ inMetadata = false;
44
+ const separator = line.indexOf(':');
45
+ assert.notEqual(separator, -1, `${path} has invalid frontmatter line: ${line}`);
46
+ const key = line.slice(0, separator).trim();
47
+ const raw = line.slice(separator + 1).trim();
48
+ fields[key] = raw.replace(/^"|"$/g, '');
49
+ }
50
+ return fields;
51
+ }
52
+
53
+ function assertSkillDescription(skillName, description) {
54
+ assert.ok(description, `${skillName} missing description`);
55
+ assert.ok(description.length >= 40, `${skillName} description is too short`);
56
+ assert.ok(description.length <= 500, `${skillName} description is too long`);
57
+ assert.match(description, /not for/i, `${skillName} description must include a Not for exclusion`);
58
+ }
59
+
60
+ async function assertMarkdownStructure(relativePath) {
61
+ const path = join(repoRoot, relativePath);
62
+ assert.equal(existsSync(path), true, `${relativePath} missing`);
63
+ const text = await readFile(path, 'utf8');
64
+ assert.equal(text.endsWith('\n'), true, `${relativePath} missing final newline`);
65
+
66
+ const fenceStack = [];
67
+ text.split('\n').forEach((line, index) => {
68
+ assert.equal(/^(<<<<<<<|=======|>>>>>>>)($| )/.test(line), false, `${relativePath}:${index + 1}: merge conflict marker`);
69
+ const match = line.match(/^(`{3,}|~{3,})/);
70
+ if (!match) {
71
+ return;
72
+ }
73
+ const marker = match[1];
74
+ if (fenceStack.length > 0 && marker[0] === fenceStack.at(-1).char && marker.length >= fenceStack.at(-1).length) {
75
+ fenceStack.pop();
76
+ return;
77
+ }
78
+ fenceStack.push({ char: marker[0], length: marker.length, line: index + 1 });
79
+ });
80
+
81
+ assert.deepEqual(fenceStack, [], `${relativePath} has unclosed fenced block`);
82
+ }
83
+
84
+ function assertContains(text, value, label) {
85
+ assert.match(text, new RegExp(value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')), `${label} missing ${value}`);
86
+ }
87
+
88
+ async function assertPublicDocsAligned() {
89
+ const readme = await readFile(join(repoRoot, 'README.md'), 'utf8');
90
+ const readmeZh = await readFile(join(repoRoot, 'README.zh-CN.md'), 'utf8');
91
+ const commands = [
92
+ 'loopx init',
93
+ 'loopx clarify',
94
+ 'loopx approve',
95
+ 'loopx plan',
96
+ 'loopx build',
97
+ 'loopx review',
98
+ 'loopx archive',
99
+ 'loopx autopilot',
100
+ 'loopx render',
101
+ 'loopx status',
102
+ 'loopx setup-context',
103
+ 'loopx doctor',
104
+ 'loopx migrate',
105
+ 'loopx repair-install',
106
+ 'node scripts/verify-skills.mjs',
107
+ ];
108
+ for (const command of commands) {
109
+ assertContains(readme, command, 'README.md');
110
+ assertContains(readmeZh, command, 'README.zh-CN.md');
111
+ }
112
+
113
+ const releaseNotesRoot = join(repoRoot, 'docs', 'release-notes');
114
+ const releaseNotes = existsSync(releaseNotesRoot)
115
+ ? (await readdir(releaseNotesRoot)).filter((name) => name.endsWith('.md'))
116
+ : [];
117
+ assert.ok(releaseNotes.includes(`${packageJson.version}.md`), `docs/release-notes/${packageJson.version}.md missing`);
118
+ for (const name of releaseNotes) {
119
+ await assertMarkdownStructure(`docs/release-notes/${name}`);
120
+ }
121
+ }
122
+
123
+ async function assertSkill(skillName, resolverText) {
124
+ const rootPath = join(repoRoot, 'skills', skillName, 'SKILL.md');
125
+ const pluginPath = join(repoRoot, 'plugins', 'loopx', 'skills', skillName, 'SKILL.md');
126
+ assert.equal(existsSync(rootPath), true, `${skillName} root SKILL.md missing`);
127
+ assert.equal(existsSync(pluginPath), true, `${skillName} plugin SKILL.md missing`);
128
+
129
+ const rootText = await readFile(rootPath, 'utf8');
130
+ const pluginText = await readFile(pluginPath, 'utf8');
131
+ assert.equal(pluginText, rootText, `${skillName} plugin mirror drifted`);
132
+ assert.equal(personalPathPattern.test(rootText), false, `${skillName} contains a personal absolute path`);
133
+
134
+ const fields = parseFrontmatter(rootPath, rootText);
135
+ assert.equal(fields.name, skillName, `${skillName} frontmatter name mismatch`);
136
+ assert.equal(fields.version, packageJson.version, `${skillName} metadata.version must match package.json`);
137
+ assert.ok(fields.when_to_use && fields.when_to_use.length >= 20, `${skillName} missing useful when_to_use metadata`);
138
+ assertSkillDescription(skillName, fields.description);
139
+ assert.match(resolverText, new RegExp(`skills/${skillName}/SKILL\\.md`), `${skillName} missing from skills/RESOLVER.md`);
140
+
141
+ const refs = [...rootText.matchAll(localRefPattern)].map((match) => match[0]);
142
+ for (const ref of refs) {
143
+ const target = join(repoRoot, 'skills', skillName, ref);
144
+ assert.equal(existsSync(target), true, `${skillName} references missing local file: ${ref}`);
145
+ }
146
+ }
147
+
148
+ assert.equal(pluginManifest.version, packageJson.version, 'plugin manifest version must match package.json');
149
+ assert.equal(existsSync(resolverPath), true, 'skills/RESOLVER.md missing');
150
+
151
+ for (const relativePath of markdownPaths) {
152
+ await assertMarkdownStructure(relativePath);
153
+ }
154
+ await assertPublicDocsAligned();
155
+
156
+ const resolverText = await readFile(resolverPath, 'utf8');
157
+ for (const skillName of LOOPX_BUNDLED_SKILLS) {
158
+ await assertSkill(skillName, resolverText);
159
+ }
160
+
161
+ const staleRefs = [...resolverText.matchAll(/skills\/([a-z][a-z0-9-]*)\/SKILL\.md/g)]
162
+ .map((match) => match[1])
163
+ .filter((skillName) => !LOOPX_BUNDLED_SKILLS.includes(skillName));
164
+ assert.deepEqual([...new Set(staleRefs)], [], 'skills/RESOLVER.md contains stale bundled-skill refs');
165
+
166
+ console.log(`ok: verified ${LOOPX_BUNDLED_SKILLS.length} loopx bundled skills`);
@@ -0,0 +1,45 @@
1
+ # loopx Skill Resolver
2
+
3
+ Central routing map for loopx bundled skills. Keep this file in sync with every bundled `skills/<name>/SKILL.md` and `plugins/loopx/skills/<name>/SKILL.md`.
4
+
5
+ Read the selected skill file before acting. If multiple skills match, read every likely candidate and use the disambiguation rules below.
6
+
7
+ ## Public Workflow Skills
8
+
9
+ | Trigger | Skill |
10
+ |---|---|
11
+ | Ambiguous request, unclear scope, non-goals, decision boundaries, requirements interview | `skills/clarify/SKILL.md` |
12
+ | Approved clarify spec, direct requirements artifact, PRD/test/architecture planning, consensus planning | `skills/plan/SKILL.md` |
13
+ | Approved plan execution, implementation persistence, review-requested implementation fixes | `skills/build/SKILL.md` |
14
+ | Independent acceptance, code review, architecture-smell review, go/no-go after build | `skills/review/SKILL.md` |
15
+ | Completed workflow needs long-lived spec sync and ADR candidate | `skills/archive/SKILL.md` |
16
+ | User wants one bounded end-to-end loopx run over clarify/plan/build/review | `skills/autopilot/SKILL.md` |
17
+
18
+ ## Support Skills
19
+
20
+ | Trigger | Skill |
21
+ |---|---|
22
+ | Bug, test failure, build failure, regression, unexpected behavior, root-cause investigation | `skills/debug/SKILL.md` |
23
+ | Feature or bugfix implementation where behavior should be covered by a failing test first | `skills/tdd/SKILL.md` |
24
+ | Completion, fixed, passing, review-ready, commit, or handoff claims need fresh evidence | `skills/verify/SKILL.md` |
25
+ | Editing `.go` files or reviewing Go style inside build/review | `skills/go-style/SKILL.md` |
26
+ | Go-Kratos proto, service, biz, data, middleware, auth, config, or Kratos troubleshooting | `skills/kratos/SKILL.md` |
27
+
28
+ ## Disambiguation
29
+
30
+ 1. If intent, scope, non-goals, or decision boundaries are unresolved, use `clarify` before `plan`.
31
+ 2. If requirements are approved but execution has not started, use `plan` before `build`.
32
+ 3. If implementation is broken or tests fail during build, use `debug` as the diagnostic lens before patching.
33
+ 4. If code is already implemented and needs acceptance, use `review`; do not run new build work from review.
34
+ 5. If review requests implementation-only fixes, route to `build --from-review`; route to `plan` only when the plan itself is wrong.
35
+ 6. If the user asks for autonomous execution, use `autopilot` only when requirements are bounded enough to run without new human decisions.
36
+ 7. Treat `tdd`, `verify`, `go-style`, and `kratos` as support lenses unless the user explicitly invokes them directly.
37
+ 8. `archive` is only valid after `review -> done`.
38
+
39
+ ## Deterministic Guard
40
+
41
+ Run this before release or when changing bundled skills:
42
+
43
+ ```bash
44
+ node scripts/verify-skills.mjs
45
+ ```
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: archive
3
- description: Sync an approved loopx change delta into long-lived specs after review is done.
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`. It syncs the accepted change delta into long-lived `.loopx/specs/` files, archives the change staging directory, and writes an advisory ADR candidate.
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 `review -> done` has been approved.
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: Richer internal-phase loopx autonomous orchestration over the public clarify/plan/build/review flow.
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: Ralph-style loopx execution runtime under the public build stage.
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: Comprehensive loopx clarify skill for requirements, boundaries, and design-ready specs.
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
- - Recommended invocation: `$plan <slug>`
309
- - Artifact-pinned invocation when needed: `$plan --direct .loopx/intake/clarify-<slug>-<timestamp>.md`
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: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
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 language style support for loopx. Use before creating or editing Go (.go) files, especially inside build execution lanes.
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 framework support for loopx. Use for Kratos microservices, proto/buf API work, service/biz/data layering, Kratos middleware, auth, configuration, and troubleshooting.
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: Consensus-first loopx planning skill with Planner, Architect, and Critic review.
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: Repo-local acceptance surface for loopx.
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: Use when implementing any feature or bugfix, before writing implementation code
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: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
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
@@ -138,6 +138,7 @@ export async function generateBuildContextManifest({ cwd, root, state, slug }) {
138
138
  row(cwd, { stage: 'build', kind: 'review-rework', path: reviewReworkPath, reason: 'review_requested_implementation_fixes', priority: 33, required: requiresReviewRework }),
139
139
  row(cwd, { stage: 'build', kind: 'domain-context', path: contextPaths.domainGlossary, reason: 'domain_vocabulary', priority: 34, required: contextSetup.status !== 'missing' }),
140
140
  row(cwd, { stage: 'build', kind: 'agent-domain', path: contextPaths.agentDomain, reason: 'agent_context_rules', priority: 35, required: false }),
141
+ row(cwd, { stage: 'build', kind: 'workspace-config', path: join(cwd, '.loopx', 'config.json'), reason: 'project_rules_spec_sources_and_verification_commands', priority: 36, required: false }),
141
142
  ];
142
143
  const manifestPath = buildContextManifestPath(root);
143
144
  await writeContextManifest(manifestPath, rows);
@@ -157,6 +158,7 @@ export async function generateReviewContextManifest({ cwd, root, state, slug })
157
158
  row(cwd, { stage: 'review', kind: 'residual-risks', path: join(root, 'execution-record.md'), reason: 'residual_risk_reference', priority: 26, required: false }),
158
159
  row(cwd, { stage: 'review', kind: 'build-support', path: join(root, 'build-support'), reason: 'build_gate_evidence', priority: 30, required: false }),
159
160
  row(cwd, { stage: 'review', kind: 'agent-domain', path: contextPaths.agentDomain, reason: 'agent_context_rules', priority: 31, required: false }),
161
+ row(cwd, { stage: 'review', kind: 'workspace-config', path: join(cwd, '.loopx', 'config.json'), reason: 'project_rules_spec_sources_and_verification_commands', priority: 32, required: false }),
160
162
  row(cwd, { stage: 'review', kind: 'state', path: join(root, 'state.json'), reason: 'workflow_state', priority: 40 }),
161
163
  ];
162
164
  const manifestPath = reviewContextManifestPath(root);