@ai-content-space/loopx 0.1.9 → 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.
- package/AGENTS.md +50 -0
- package/README.md +59 -446
- package/README.zh-CN.md +59 -457
- package/docs/loopx/design/loopx-skill-suite-v1-design.md +73 -0
- package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +77 -0
- package/package.json +5 -2
- package/plugins/loopx/.codex-plugin/plugin.json +4 -4
- package/plugins/loopx/scripts/plugin-install.test.mjs +20 -20
- package/plugins/loopx/skills/clarify/SKILL.md +38 -311
- package/plugins/loopx/skills/debug/SKILL.md +1 -1
- package/plugins/loopx/skills/exec/SKILL.md +71 -0
- package/plugins/loopx/skills/finish/SKILL.md +254 -0
- package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
- package/plugins/loopx/skills/go-style/SKILL.md +1 -1
- package/plugins/loopx/skills/kratos/SKILL.md +1 -1
- package/plugins/loopx/skills/plan/SKILL.md +136 -258
- package/plugins/loopx/skills/refactor-plan/SKILL.md +71 -0
- package/plugins/loopx/skills/review/SKILL.md +72 -105
- package/plugins/loopx/skills/review/code-reviewer.md +168 -0
- package/plugins/loopx/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
- package/plugins/loopx/skills/spec/SKILL.md +76 -0
- package/plugins/loopx/skills/subagent-exec/SKILL.md +282 -0
- package/plugins/loopx/skills/subagent-exec/agents/openai.yaml +3 -0
- package/plugins/loopx/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
- package/plugins/loopx/skills/subagent-exec/codex-subagents.md +37 -0
- package/plugins/loopx/skills/subagent-exec/implementer-prompt.md +113 -0
- package/plugins/loopx/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
- package/plugins/loopx/skills/tdd/SKILL.md +1 -1
- package/plugins/loopx/skills/verify/SKILL.md +1 -1
- package/scripts/claude-workflow-hook.mjs +109 -0
- package/scripts/codex-workflow-hook.mjs +2 -5
- package/scripts/install-skills.mjs +3 -3
- package/scripts/verify-skills.mjs +32 -1
- package/skills/RESOLVER.md +26 -17
- package/skills/clarify/SKILL.md +38 -311
- package/skills/debug/SKILL.md +1 -1
- package/skills/exec/SKILL.md +71 -0
- package/skills/finish/SKILL.md +254 -0
- package/skills/fix-review/SKILL.md +216 -0
- package/skills/go-style/SKILL.md +1 -1
- package/skills/kratos/SKILL.md +1 -1
- package/skills/plan/SKILL.md +136 -258
- package/skills/refactor-plan/SKILL.md +71 -0
- package/skills/review/SKILL.md +72 -105
- package/skills/review/code-reviewer.md +168 -0
- package/skills/spec/DESIGN_SPEC_TEMPLATE.md +323 -0
- package/skills/spec/SKILL.md +76 -0
- package/skills/subagent-exec/SKILL.md +282 -0
- package/skills/subagent-exec/agents/openai.yaml +3 -0
- package/skills/subagent-exec/code-quality-reviewer-prompt.md +25 -0
- package/skills/subagent-exec/codex-subagents.md +37 -0
- package/skills/subagent-exec/implementer-prompt.md +113 -0
- package/skills/subagent-exec/spec-reviewer-prompt.md +61 -0
- package/skills/tdd/SKILL.md +1 -1
- package/skills/verify/SKILL.md +1 -1
- package/src/autopilot-runtime.mjs +1 -1
- package/src/cli.mjs +79 -5
- package/src/context-manifest.mjs +2 -2
- package/src/html-views.mjs +457 -95
- package/src/install-discovery.mjs +210 -6
- package/src/next-skill.mjs +2 -4
- package/src/plan-runtime.mjs +572 -93
- package/src/runtime-maintenance.mjs +60 -16
- package/src/workflow.mjs +989 -65
- package/templates/architecture.md +58 -16
- package/templates/development-plan.md +42 -12
- package/plugins/loopx/skills/archive/SKILL.md +0 -55
- package/plugins/loopx/skills/autopilot/SKILL.md +0 -93
- package/plugins/loopx/skills/build/SKILL.md +0 -228
- package/skills/archive/SKILL.md +0 -55
- package/skills/autopilot/SKILL.md +0 -93
- package/skills/build/SKILL.md +0 -228
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# loopx Skill Suite v1 Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** execute task-by-task. Preserve existing user edits and keep legacy CLI runtime compatibility unless a task explicitly changes skill installation behavior.
|
|
4
|
+
|
|
5
|
+
**Source Design:** `docs/loopx/design/loopx-skill-suite-v1-design.md`
|
|
6
|
+
|
|
7
|
+
**Goal:** Convert loopx into a Codex and Claude ready skill suite with renamed superpowers-style workflow skills, dual-target installation, and non-blocking Claude hook support.
|
|
8
|
+
|
|
9
|
+
**Architecture:** `skills/` remains canonical. `plugins/loopx/skills/` mirrors canonical skills for Codex plugin packaging. `src/install-discovery.mjs` owns multi-target installation and lock metadata.
|
|
10
|
+
|
|
11
|
+
**Tech Stack:** Node.js ESM, `node:test`, filesystem APIs from `node:fs/promises`.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
### Task 1: Skill Set And Names
|
|
16
|
+
|
|
17
|
+
**Files:**
|
|
18
|
+
- Modify: `src/install-discovery.mjs`
|
|
19
|
+
- Modify: `skills/`
|
|
20
|
+
- Modify: `plugins/loopx/skills/`
|
|
21
|
+
- Modify: `skills/RESOLVER.md`
|
|
22
|
+
|
|
23
|
+
- [ ] Rename canonical superpowers-derived skills to v1 names.
|
|
24
|
+
- [ ] Remove old runtime workflow skills from the bundled install list.
|
|
25
|
+
- [ ] Keep `plan` as the canonical implementation-planning skill.
|
|
26
|
+
- [ ] Mirror all canonical skill files into `plugins/loopx/skills/`.
|
|
27
|
+
- [ ] Update internal references from old names to new `loopx:` names.
|
|
28
|
+
|
|
29
|
+
### Task 2: Installer Targets
|
|
30
|
+
|
|
31
|
+
**Files:**
|
|
32
|
+
- Modify: `src/install-discovery.mjs`
|
|
33
|
+
- Modify: `scripts/install-skills.mjs`
|
|
34
|
+
- Modify: `src/cli.mjs`
|
|
35
|
+
|
|
36
|
+
- [ ] Add Codex and Claude user skill targets.
|
|
37
|
+
- [ ] Add interactive `loopx install-skills` command.
|
|
38
|
+
- [ ] Keep non-interactive flags for target, mode, project, custom directory, and yes.
|
|
39
|
+
- [ ] Make postinstall install Codex user skills and Claude user skills by default.
|
|
40
|
+
- [ ] Preserve lock/ownership checks so non-loopx skills are not overwritten.
|
|
41
|
+
|
|
42
|
+
### Task 3: Claude Hook
|
|
43
|
+
|
|
44
|
+
**Files:**
|
|
45
|
+
- Add: `scripts/claude-workflow-hook.mjs`
|
|
46
|
+
- Modify: `src/install-discovery.mjs`
|
|
47
|
+
- Modify: `scripts/install-skills.mjs`
|
|
48
|
+
|
|
49
|
+
- [ ] Install Claude user hook script under `~/.claude/hooks/`.
|
|
50
|
+
- [ ] Merge a non-blocking hook entry into `~/.claude/settings.json`.
|
|
51
|
+
- [ ] Keep the hook advisory-only.
|
|
52
|
+
- [ ] Do not overwrite unrelated Claude settings.
|
|
53
|
+
|
|
54
|
+
### Task 4: Docs And Governance
|
|
55
|
+
|
|
56
|
+
**Files:**
|
|
57
|
+
- Modify: `README.md`
|
|
58
|
+
- Modify: `README.zh-CN.md`
|
|
59
|
+
- Modify: `package.json`
|
|
60
|
+
- Modify: `scripts/verify-skills.mjs`
|
|
61
|
+
- Modify: `test/skill-governance.test.mjs`
|
|
62
|
+
- Modify: `test/workflow.test.mjs`
|
|
63
|
+
|
|
64
|
+
- [ ] Reframe loopx as a skill suite for agentic coding assistants.
|
|
65
|
+
- [ ] Document the new workflow and artifact paths.
|
|
66
|
+
- [ ] Document Codex and Claude installation.
|
|
67
|
+
- [ ] Update governance checks for the v1 bundled skill list and mirrors.
|
|
68
|
+
- [ ] Update install tests for dual user targets and hooks.
|
|
69
|
+
|
|
70
|
+
### Task 5: Verification
|
|
71
|
+
|
|
72
|
+
**Files:**
|
|
73
|
+
- Test suite only unless failures require fixes.
|
|
74
|
+
|
|
75
|
+
- [ ] Run `node scripts/verify-skills.mjs`.
|
|
76
|
+
- [ ] Run `npm test`.
|
|
77
|
+
- [ ] Fix failures without broad unrelated refactors.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-content-space/loopx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"description": "Skill-first
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Skill-first workflow suite for agentic coding assistants",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/hugh-zhan9/loopx.git"
|
|
@@ -18,11 +18,14 @@
|
|
|
18
18
|
"loopx": "src/cli.mjs"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
+
"AGENTS.md",
|
|
21
22
|
"README.md",
|
|
22
23
|
"README.zh-CN.md",
|
|
24
|
+
"docs/loopx/",
|
|
23
25
|
"package.json",
|
|
24
26
|
"scripts/install-skills.mjs",
|
|
25
27
|
"scripts/verify-skills.mjs",
|
|
28
|
+
"scripts/claude-workflow-hook.mjs",
|
|
26
29
|
"scripts/codex-stop-hook.mjs",
|
|
27
30
|
"scripts/codex-workflow-hook.mjs",
|
|
28
31
|
"assets/logo.svg",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loopx",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Skill-first
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Skill-first workflow suite for agentic coding assistants",
|
|
5
5
|
"skills": "./skills/",
|
|
6
6
|
"interface": {
|
|
7
7
|
"displayName": "loopx",
|
|
8
|
-
"shortDescription": "
|
|
9
|
-
"longDescription": "This plugin mirrors the canonical loopx skills and routes plugin installs through the shared loopx install/discovery core. It stays plugin-root-relative at the manifest boundary and does not define a second loopx implementation.",
|
|
8
|
+
"shortDescription": "Codex plugin shell for the loopx skill bundle.",
|
|
9
|
+
"longDescription": "This plugin mirrors the canonical loopx skills and routes Codex plugin installs through the shared loopx install/discovery core. It stays plugin-root-relative at the manifest boundary and does not define a second loopx implementation.",
|
|
10
10
|
"developerName": "loopx",
|
|
11
11
|
"category": "Developer Tools"
|
|
12
12
|
}
|
|
@@ -7,7 +7,7 @@ import { tmpdir } from 'node:os';
|
|
|
7
7
|
import { dirname, join, resolve } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
|
|
10
|
-
import { verifyInstallState } from '../../../src/install-discovery.mjs';
|
|
10
|
+
import { LOOPX_BUNDLED_SKILLS, verifyInstallState } from '../../../src/install-discovery.mjs';
|
|
11
11
|
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
13
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
@@ -17,15 +17,7 @@ const MANIFEST_PATH = join(PLUGIN_ROOT, '.codex-plugin', 'plugin.json');
|
|
|
17
17
|
const INSTALL_SCRIPT = join(MODULE_DIR, 'plugin-install.mjs');
|
|
18
18
|
const ROOT_SKILLS_DIR = join(REPO_ROOT, 'skills');
|
|
19
19
|
const PLUGIN_SKILLS_DIR = join(PLUGIN_ROOT, 'skills');
|
|
20
|
-
const
|
|
21
|
-
const LOOPX_SKILLS = [
|
|
22
|
-
'clarify',
|
|
23
|
-
'plan',
|
|
24
|
-
'build',
|
|
25
|
-
'review',
|
|
26
|
-
'archive',
|
|
27
|
-
'autopilot',
|
|
28
|
-
];
|
|
20
|
+
const LOOPX_SKILLS = LOOPX_BUNDLED_SKILLS;
|
|
29
21
|
|
|
30
22
|
function loopxEnv(home) {
|
|
31
23
|
return {
|
|
@@ -69,26 +61,30 @@ describe('loopx plugin shell', () => {
|
|
|
69
61
|
}
|
|
70
62
|
});
|
|
71
63
|
|
|
72
|
-
it('locks plan as the canonical
|
|
64
|
+
it('locks plan as the canonical implementation-planning contract', async () => {
|
|
73
65
|
const planSkill = await readFile(join(ROOT_SKILLS_DIR, 'plan', 'SKILL.md'), 'utf8');
|
|
74
66
|
const pluginPlanSkill = await readFile(join(PLUGIN_SKILLS_DIR, 'plan', 'SKILL.md'), 'utf8');
|
|
75
|
-
const ralplanSkill = await readFile(RALPLAN_SKILL_PATH, 'utf8');
|
|
76
67
|
|
|
77
|
-
assert.match(planSkill, /
|
|
78
|
-
assert.match(planSkill, /
|
|
79
|
-
assert.match(planSkill, /
|
|
80
|
-
assert.match(planSkill, /
|
|
68
|
+
assert.match(planSkill, /Bite-Sized Task Granularity/);
|
|
69
|
+
assert.match(planSkill, /No Placeholders/);
|
|
70
|
+
assert.match(planSkill, /docs\/loopx\/plans\/YYYY-MM-DD-<feature-name>\.md/);
|
|
71
|
+
assert.match(planSkill, /loopx:subagent-exec/);
|
|
72
|
+
assert.doesNotMatch(planSkill, /Planner -> Architect -> Critic/);
|
|
73
|
+
assert.doesNotMatch(planSkill, /consensus-first/i);
|
|
81
74
|
assert.equal(pluginPlanSkill, planSkill);
|
|
82
|
-
assert.equal(ralplanSkill.includes('compatibility alias for `$plan`'), true);
|
|
83
|
-
assert.equal(ralplanSkill.includes('$plan --consensus'), false);
|
|
84
75
|
});
|
|
85
76
|
|
|
86
|
-
it('locks clarify
|
|
77
|
+
it('locks clarify to use the conditional spec or plan handoff gate', async () => {
|
|
87
78
|
const clarifySkill = await readFile(join(ROOT_SKILLS_DIR, 'clarify', 'SKILL.md'), 'utf8');
|
|
88
79
|
const pluginClarifySkill = await readFile(join(PLUGIN_SKILLS_DIR, 'clarify', 'SKILL.md'), 'utf8');
|
|
89
80
|
|
|
90
81
|
assert.equal(pluginClarifySkill, clarifySkill);
|
|
91
|
-
assert.match(clarifySkill, /
|
|
82
|
+
assert.match(clarifySkill, /needs_spec/);
|
|
83
|
+
assert.match(clarifySkill, /direct_to_plan/);
|
|
84
|
+
assert.match(clarifySkill, /docs\/loopx\/design\/<需求名>需求设计文档\.md/);
|
|
85
|
+
assert.match(clarifySkill, /docs\/loopx\/plans\/YYYY-MM-DD-<feature-name>\.md/);
|
|
86
|
+
assert.doesNotMatch(clarifySkill, /Recommended invocation: `\$spec/);
|
|
87
|
+
assert.doesNotMatch(clarifySkill, /Default handoff after normal loopx clarify: `\$plan <slug>`/);
|
|
92
88
|
assert.doesNotMatch(clarifySkill, /hand off to `build` only/i);
|
|
93
89
|
assert.doesNotMatch(clarifySkill, /direct execution/i);
|
|
94
90
|
assert.doesNotMatch(clarifySkill, /direct implementation/i);
|
|
@@ -121,5 +117,9 @@ describe('loopx plugin shell', () => {
|
|
|
121
117
|
true,
|
|
122
118
|
);
|
|
123
119
|
}
|
|
120
|
+
|
|
121
|
+
const installedSpecTemplate = await readFile(join(home, '.agents', 'skills', 'spec', 'DESIGN_SPEC_TEMPLATE.md'), 'utf8');
|
|
122
|
+
const pluginSpecTemplate = await readFile(join(PLUGIN_SKILLS_DIR, 'spec', 'DESIGN_SPEC_TEMPLATE.md'), 'utf8');
|
|
123
|
+
assert.equal(installedSpecTemplate, pluginSpecTemplate);
|
|
124
124
|
});
|
|
125
125
|
});
|
|
@@ -1,346 +1,73 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clarify
|
|
3
|
-
description: "
|
|
3
|
+
description: "Grills ambiguous loopx work until material questions are answered, then routes to spec or plan using a design gate. Not for clear implementation tasks, approved specs, or code changes."
|
|
4
4
|
when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.2.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# loopx Clarify
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
`clarify` is loopx's full pre-implementation clarification skill. It combines:
|
|
11
|
+
Do not accept vague answers. Do not optimize for speed. The goal is shared understanding: every material question that could change scope, design, verification, rollout, safety, or ownership must be answered before handoff.
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
- the design-shaping discipline of `brainstorming`
|
|
13
|
+
## Core Loop
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
- explicit about non-goals and decision boundaries
|
|
21
|
-
- concrete enough to hand to `plan`
|
|
22
|
-
- structured enough that downstream execution does not re-discover the task from scratch
|
|
23
|
-
</Purpose>
|
|
17
|
+
Ask the questions one at a time.
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
- The request is broad, ambiguous, or mixes problem, solution, and implementation detail.
|
|
27
|
-
- The user needs help defining scope, non-goals, acceptance criteria, or tradeoffs before planning.
|
|
28
|
-
- A design direction exists only implicitly and would otherwise be invented during implementation.
|
|
29
|
-
- The task will later be handed to `plan`, and you want a high-signal spec first.
|
|
30
|
-
</Use_When>
|
|
19
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
31
20
|
|
|
32
|
-
<Do_Not_Use_When>
|
|
33
|
-
- The task already has concrete file/symbol targets and clear acceptance criteria.
|
|
34
|
-
- A complete and approved spec/plan already exists for the same task.
|
|
35
|
-
- The user explicitly asks to skip clarification and execute immediately.
|
|
36
|
-
</Do_Not_Use_When>
|
|
37
21
|
|
|
38
|
-
<Why_This_Exists>
|
|
39
|
-
Most implementation drift happens before coding begins. Teams often think they need “more planning,” when the real problem is weaker intent clarity, hidden assumptions, fuzzy boundaries, or a design shape that was never made explicit. `clarify` exists to solve those upstream failures before `plan` turns the clarified intent into an execution contract.
|
|
40
|
-
</Why_This_Exists>
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
- Ask one question at a time.
|
|
44
|
-
- Prefer bounded multiple-choice questions when the option space is known; use open-ended questions only when the option space is genuinely unknown.
|
|
45
|
-
- Prefer the highest-leverage unresolved question, not broad coverage.
|
|
46
|
-
- Keep digging on the same thread until one assumption, one boundary, or one tradeoff becomes clearer.
|
|
47
|
-
- Treat every answer as a claim to pressure-test, not a final truth to copy down.
|
|
48
|
-
- Make `Non-goals` and `Decision Boundaries` mandatory gates.
|
|
49
|
-
- Default to YAGNI: shrink speculative scope unless the user gives a concrete reason it belongs in the first pass.
|
|
50
|
-
- Do not stop at “requirements”; shape the solution enough that the next stage has a coherent starting design.
|
|
51
|
-
</Core_Principles>
|
|
23
|
+
## Output
|
|
52
24
|
|
|
53
|
-
|
|
54
|
-
- **Standard (`--standard`, default)**:
|
|
55
|
-
- default loopx clarify mode
|
|
56
|
-
- target threshold: `<= 0.20`
|
|
57
|
-
- max rounds: `15`
|
|
58
|
-
- **Deep (`--deep`)**:
|
|
59
|
-
- higher-rigor clarify mode with heavier pressure-testing and design shaping
|
|
60
|
-
- target threshold: `<= 0.10`
|
|
61
|
-
- max rounds: `25`
|
|
62
|
-
|
|
63
|
-
If no flag is provided, use **Standard**.
|
|
64
|
-
</Profiles>
|
|
65
|
-
|
|
66
|
-
<Runtime_State_Machine>
|
|
67
|
-
`clarify` must maintain these runtime fields in `.loopx/workflows/<slug>/state.json` and mirror them in the clarify spec frontmatter:
|
|
68
|
-
|
|
69
|
-
- `clarify_current_round` / `current_round`: starts at `0`; increments after each user-answer round.
|
|
70
|
-
- `clarify_ambiguity_score` / `ambiguity_score`: starts at `1`; must be `<= clarify_target_ambiguity_threshold` before handoff.
|
|
71
|
-
- `clarify_non_goals_resolved` / `non_goals_resolved`: `true` only after non-goals are explicit.
|
|
72
|
-
- `clarify_decision_boundaries_resolved` / `decision_boundaries_resolved`: `true` only after human-vs-agent decision boundaries are explicit.
|
|
73
|
-
- `clarify_pressure_pass_complete` / `pressure_pass_complete`: `true` only after at least one prior answer has been revisited with explicit pressure.
|
|
74
|
-
|
|
75
|
-
The `clarify -> plan` gate is blocked until all of the following are true:
|
|
76
|
-
|
|
77
|
-
- `unresolved_ambiguity_count` is `0`
|
|
78
|
-
- `clarify_current_round` is between `1` and `clarify_max_rounds`
|
|
79
|
-
- `clarify_ambiguity_score` is at or below the selected profile threshold
|
|
80
|
-
- non-goals are resolved
|
|
81
|
-
- decision boundaries are resolved
|
|
82
|
-
- pressure pass is complete
|
|
83
|
-
|
|
84
|
-
Do not mark a clarify spec handoff-ready by prose alone. Update the frontmatter fields so the runtime can enforce the same readiness decision.
|
|
85
|
-
</Runtime_State_Machine>
|
|
86
|
-
|
|
87
|
-
<Execution_Policy>
|
|
88
|
-
- Always run a preflight context intake before the first interview question.
|
|
89
|
-
- If supplied context is too large for safe prompt use, first request or create a concise prompt-safe summary that preserves goals, constraints, success criteria, non-goals, decision boundaries, and source references.
|
|
90
|
-
- Explore repo context before asking the user about internals.
|
|
91
|
-
- Prefer evidence-backed clarification in brownfield work:
|
|
92
|
-
- “I found X in Y. Should this clarify spec preserve that pattern?”
|
|
93
|
-
- Route facts before judgment:
|
|
94
|
-
- discoverable codebase facts should be inspected directly
|
|
95
|
-
- evidence-backed inferences should be confirmed with the user
|
|
96
|
-
- product intent, tradeoffs, scope, non-goals, and decision boundaries must be treated as human decisions
|
|
97
|
-
- Ask about intent and boundaries before implementation detail.
|
|
98
|
-
- Respect stage priority:
|
|
99
|
-
1. intent, outcome, scope, non-goals, decision boundaries
|
|
100
|
-
2. constraints and success criteria
|
|
101
|
-
3. brownfield grounding and integration details
|
|
102
|
-
- Stay on the same thread when the answer is still weak instead of rotating dimensions just for coverage.
|
|
103
|
-
- Revisit at least one earlier answer with an explicit assumption, evidence, or tradeoff follow-up before crystallizing.
|
|
104
|
-
- If the task is too large for one coherent spec, decompose it before pretending it is ready.
|
|
105
|
-
- Keep user effort low: do not ask for facts that can be discovered directly.
|
|
106
|
-
</Execution_Policy>
|
|
107
|
-
|
|
108
|
-
<Dimensions>
|
|
109
|
-
- **Intent**: why the user wants this
|
|
110
|
-
- **Outcome**: what end state they actually want
|
|
111
|
-
- **Scope**: how far the change should go
|
|
112
|
-
- **Constraints**: what must remain true
|
|
113
|
-
- **Success Criteria**: how completion will be judged
|
|
114
|
-
- **Context**: how this fits the existing codebase (brownfield only)
|
|
115
|
-
</Dimensions>
|
|
116
|
-
|
|
117
|
-
<Pressure_Patterns>
|
|
118
|
-
When an answer is still weak, prefer one of these next:
|
|
119
|
-
|
|
120
|
-
1. Ask for a concrete example or counterexample.
|
|
121
|
-
2. Expose the hidden assumption that makes the answer true.
|
|
122
|
-
3. Force a boundary:
|
|
123
|
-
- what should not happen
|
|
124
|
-
- what should be deferred
|
|
125
|
-
- what should be rejected
|
|
126
|
-
4. If the answer is still describing symptoms, reframe toward root cause.
|
|
127
|
-
</Pressure_Patterns>
|
|
128
|
-
|
|
129
|
-
<Socratic_Questioning>
|
|
130
|
-
`clarify` should be Socratic without being vague.
|
|
131
|
-
|
|
132
|
-
- Ask one focused round at a time.
|
|
133
|
-
- Prefer bounded choices when they reduce user effort:
|
|
134
|
-
- use single-choice when one answer should drive the next branch
|
|
135
|
-
- use multi-choice when several constraints, non-goals, or success checks may all apply
|
|
136
|
-
- include `Other` only when the known options are likely incomplete
|
|
137
|
-
- Lead with the recommended option when repo evidence or prior answers support it, but make the tradeoff visible.
|
|
138
|
-
- Do not hide a branching interview tree inside one overloaded question. If an option would require a follow-up, ask that follow-up next.
|
|
139
|
-
- After each answer, decide whether the next highest-value move is:
|
|
140
|
-
- deeper pressure on the same thread
|
|
141
|
-
- zooming out to another unresolved breadth track
|
|
142
|
-
- crystallizing the spec
|
|
143
|
-
</Socratic_Questioning>
|
|
144
|
-
|
|
145
|
-
<Breadth_Ledger>
|
|
146
|
-
Maintain a lightweight breadth ledger across independent ambiguity tracks:
|
|
147
|
-
|
|
148
|
-
- scope
|
|
149
|
-
- constraints
|
|
150
|
-
- outputs / deliverables
|
|
151
|
-
- verification and success criteria
|
|
152
|
-
- brownfield integration
|
|
153
|
-
- user-mentioned workstreams or stakeholder requirements
|
|
154
|
-
|
|
155
|
-
The ledger is a guard, not a rotation rule. Stay deep on the current thread until it has been pressure-tested, then zoom out only when another material track remains unresolved and would change downstream execution.
|
|
156
|
-
</Breadth_Ledger>
|
|
157
|
-
|
|
158
|
-
<Challenge_Modes>
|
|
159
|
-
Use these assumption stress tests when applicable:
|
|
160
|
-
|
|
161
|
-
- **Contrarian**: challenge a core assumption when an answer rests on an untested belief.
|
|
162
|
-
- **Simplifier**: probe the smallest viable first pass when scope expands faster than outcome clarity.
|
|
163
|
-
- **Ontologist**: reframe toward essence/root cause when the user keeps describing symptoms or when ambiguity stalls.
|
|
164
|
-
|
|
165
|
-
Track which challenge modes have been used in the ambiguity register. Do not repeat a mode mechanically.
|
|
166
|
-
</Challenge_Modes>
|
|
167
|
-
|
|
168
|
-
<Design_Shaping>
|
|
169
|
-
`clarify` should not stop at “what do you want?” Once the intent is understandable, it should also shape the task enough that the downstream plan is not starting from zero.
|
|
170
|
-
|
|
171
|
-
When there is a real design choice:
|
|
172
|
-
|
|
173
|
-
- propose 2-3 viable approaches
|
|
174
|
-
- lead with the recommended one
|
|
175
|
-
- explain tradeoffs briefly
|
|
176
|
-
- right-size the design to the task
|
|
177
|
-
- identify likely component boundaries, data flow, or user-facing flow when that would materially affect planning
|
|
178
|
-
- reject speculative features unless they are necessary for the stated outcome
|
|
179
|
-
|
|
180
|
-
The goal is not to produce a full architecture doc here. The goal is to make the clarify spec design-ready.
|
|
181
|
-
</Design_Shaping>
|
|
182
|
-
|
|
183
|
-
<Incremental_Validation>
|
|
184
|
-
For non-trivial designs, validate the design in small sections before writing the final clarify spec.
|
|
185
|
-
|
|
186
|
-
Present a compact design summary and ask whether it matches the user's intent. When relevant, validate these sections separately:
|
|
187
|
-
|
|
188
|
-
- user-facing behavior or workflow
|
|
189
|
-
- component boundaries / ownership
|
|
190
|
-
- data flow or API contract
|
|
191
|
-
- error handling and edge cases
|
|
192
|
-
- test and verification shape
|
|
193
|
-
- explicitly deferred work
|
|
194
|
-
|
|
195
|
-
If the user rejects a section, continue the interview loop instead of writing a handoff-ready spec.
|
|
196
|
-
</Incremental_Validation>
|
|
197
|
-
|
|
198
|
-
<Practical_Closure_Audit>
|
|
199
|
-
Treat a low ambiguity score as permission to audit closure, not as automatic permission to stop.
|
|
200
|
-
|
|
201
|
-
Before crystallizing, ask:
|
|
202
|
-
|
|
203
|
-
- Would one more question materially change implementation, test strategy, or scope?
|
|
204
|
-
- Are non-goals and decision boundaries explicit enough for downstream agents?
|
|
205
|
-
- Has at least one assumption or tradeoff been pressure-tested?
|
|
206
|
-
- Is remaining uncertainty residual risk rather than actionable ambiguity?
|
|
207
|
-
|
|
208
|
-
If remaining uncertainty would not change execution, crystallize the spec and preserve it as residual risk instead of opening a low-value branch.
|
|
209
|
-
</Practical_Closure_Audit>
|
|
210
|
-
|
|
211
|
-
<Spec_Self_Review>
|
|
212
|
-
Before marking a clarify spec handoff-ready, perform a self-review pass:
|
|
213
|
-
|
|
214
|
-
- remove placeholders such as `TBD`, `TODO`, `REPLACE_ME`, or vague “etc.”
|
|
215
|
-
- check for internal contradictions
|
|
216
|
-
- check whether the scope is still too broad for one coherent execution package
|
|
217
|
-
- check whether any requirement can be interpreted two materially different ways
|
|
218
|
-
- verify that non-goals, decision boundaries, acceptance criteria, and residual risks are explicit
|
|
219
|
-
- verify that brownfield evidence is labeled separately from inference
|
|
220
|
-
</Spec_Self_Review>
|
|
221
|
-
|
|
222
|
-
<Process>
|
|
223
|
-
|
|
224
|
-
## 1. Explore Context
|
|
225
|
-
|
|
226
|
-
- Read relevant files, docs, and current patterns first.
|
|
227
|
-
- Classify the work as brownfield or greenfield.
|
|
228
|
-
- For brownfield work, collect concrete evidence before questioning.
|
|
229
|
-
- Create or update a compact context snapshot for the task when the conversation, source docs, or repo evidence would otherwise be too large to carry safely.
|
|
230
|
-
|
|
231
|
-
## 2. Interview
|
|
232
|
-
|
|
233
|
-
- Ask one question per round.
|
|
234
|
-
- Prefer bounded choices for known option spaces; use open-ended questions only when the valid answers cannot be enumerated.
|
|
235
|
-
- Before asking each question, show a compact status line with:
|
|
236
|
-
- `round`: current round and max rounds
|
|
237
|
-
- `ambiguity_score`: current score
|
|
238
|
-
- `target`: selected profile threshold
|
|
239
|
-
- `open_items`: unresolved ambiguity count
|
|
240
|
-
- Also state the current focus dimension and whether the round is fact confirmation or human judgment.
|
|
241
|
-
- After the user answers and the round is updated, show the revised `ambiguity_score`, whether it moved up/down/unchanged, and the main reason for that change before asking the next question.
|
|
242
|
-
- After each answered round, update `current_round`, the ambiguity register, and `ambiguity_score`.
|
|
243
|
-
- Target the weakest unresolved dimension within the stage-priority order.
|
|
244
|
-
- Maintain the breadth ledger; do not rotate dimensions just for coverage.
|
|
245
|
-
- Keep `Non-goals` and `Decision Boundaries` explicit from early in the process.
|
|
246
|
-
- Respect the selected profile:
|
|
247
|
-
- `standard`: stop only when the clarify spec is handoff-ready or `15` rounds are exhausted
|
|
248
|
-
- `deep`: stop only when the clarify spec is handoff-ready or `25` rounds are exhausted
|
|
249
|
-
|
|
250
|
-
## 3. Pressure-Test
|
|
251
|
-
|
|
252
|
-
- Apply explicit follow-up pressure to at least one earlier answer.
|
|
253
|
-
- Set `pressure_pass_complete: true` only after the pressure follow-up is answered and reflected in the spec.
|
|
254
|
-
- Do not crystallize while assumptions are still hidden or boundaries are still fuzzy.
|
|
255
|
-
- In `deep`, expect more persistence on the same thread before moving on.
|
|
256
|
-
|
|
257
|
-
## 4. Shape the Design
|
|
258
|
-
|
|
259
|
-
- Where needed, propose a small set of options.
|
|
260
|
-
- Recommend one approach.
|
|
261
|
-
- Clarify what that approach implies for scope and downstream execution.
|
|
262
|
-
- Apply incremental validation for non-trivial designs before finalizing the spec.
|
|
263
|
-
|
|
264
|
-
## 4.5. Closure and Self-Review
|
|
265
|
-
|
|
266
|
-
- Run the practical closure audit.
|
|
267
|
-
- Run the spec self-review checklist before marking handoff-ready.
|
|
268
|
-
- If the round cap is reached or the user chooses to proceed despite ambiguity, preserve an explicit residual-risk warning in the spec and handoff recommendation.
|
|
269
|
-
|
|
270
|
-
## 5. Write the Clarify Spec
|
|
271
|
-
|
|
272
|
-
Write the output to the loopx runtime namespace:
|
|
25
|
+
Write the clarification context bundle to:
|
|
273
26
|
|
|
274
27
|
- `.loopx/intake/clarify-<slug>-<timestamp>.md`
|
|
275
28
|
|
|
276
|
-
The
|
|
29
|
+
The bundle must preserve the information `spec` or `plan` needs:
|
|
277
30
|
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
- `ambiguity_score`
|
|
282
|
-
- `non_goals_resolved`
|
|
283
|
-
- `decision_boundaries_resolved`
|
|
284
|
-
- `pressure_pass_complete`
|
|
285
|
-
- `unresolved_ambiguity_count`
|
|
286
|
-
- intent
|
|
287
|
-
- desired outcome
|
|
288
|
-
- in-scope
|
|
289
|
-
- out-of-scope / non-goals
|
|
31
|
+
- intent and desired outcome
|
|
32
|
+
- in-scope work
|
|
33
|
+
- non-goals
|
|
290
34
|
- decision boundaries
|
|
291
35
|
- constraints
|
|
292
36
|
- success criteria
|
|
293
|
-
- assumptions
|
|
294
|
-
-
|
|
37
|
+
- assumptions challenged
|
|
38
|
+
- key decisions and rejected alternatives
|
|
295
39
|
- brownfield evidence vs inference
|
|
296
|
-
- breadth ledger / unresolved tracks, if any
|
|
297
|
-
- design direction / preferred approach
|
|
298
40
|
- residual risks
|
|
299
|
-
-
|
|
41
|
+
- conversation summary and important user wording
|
|
42
|
+
- source requirements or external document references
|
|
43
|
+
- next handoff recommendation
|
|
44
|
+
|
|
45
|
+
## Handoff Decision
|
|
46
|
+
|
|
47
|
+
After every material question is answered, choose one handoff:
|
|
48
|
+
|
|
49
|
+
- `needs_spec`
|
|
50
|
+
- `direct_to_plan`
|
|
51
|
+
- `blocked`
|
|
300
52
|
|
|
301
|
-
|
|
53
|
+
Use `needs_spec` when any product behavior, API, data model, state machine, permission, security, migration, compatibility, rollout, or cross-module architecture decision still needs to be fixed before implementation planning.
|
|
302
54
|
|
|
303
|
-
|
|
55
|
+
Use `direct_to_plan` when goals, non-goals, constraints, affected scope, and verification are clear, and all remaining choices are local implementation details.
|
|
304
56
|
|
|
305
|
-
|
|
306
|
-
- if the user asks to execute immediately, explain that loopx requires the `plan` gate first and provide the plan invocation
|
|
307
|
-
- if a task is too small to justify planning, do not use `clarify`; handle that request outside the clarify workflow from the start
|
|
57
|
+
Use `blocked` when any material requirement or decision boundary is still unclear.
|
|
308
58
|
|
|
309
|
-
|
|
59
|
+
For `needs_spec`, immediately use the `spec` skill with the clarification context bundle, current conversation context, repo evidence, and source documents. `spec` writes:
|
|
310
60
|
|
|
311
|
-
-
|
|
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.
|
|
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
|
|
61
|
+
- `docs/loopx/design/<需求名>需求设计文档.md`
|
|
317
62
|
|
|
318
|
-
|
|
63
|
+
Then stop before implementation planning and report:
|
|
319
64
|
|
|
320
|
-
|
|
65
|
+
```text
|
|
66
|
+
$plan --direct docs/loopx/design/<需求名>需求设计文档.md
|
|
67
|
+
```
|
|
321
68
|
|
|
322
|
-
|
|
323
|
-
- `Non-goals` are explicit
|
|
324
|
-
- `Decision Boundaries` are explicit
|
|
325
|
-
- At least one pressure-pass follow-up has revisited an earlier answer
|
|
326
|
-
- The practical closure audit has passed
|
|
327
|
-
- The spec self-review pass has removed placeholders, contradictions, and material ambiguity
|
|
328
|
-
- A written clarify spec exists
|
|
329
|
-
- The task is small enough and clear enough for real downstream handoff
|
|
330
|
-
- The selected profile threshold is met:
|
|
331
|
-
- `standard`: weighted ambiguity `<= 0.20`
|
|
332
|
-
- `deep`: weighted ambiguity `<= 0.10`
|
|
333
|
-
</Readiness_Gates>
|
|
69
|
+
For `direct_to_plan`, immediately use the `plan` skill with the clarification context bundle as the source. `plan` writes:
|
|
334
70
|
|
|
335
|
-
|
|
336
|
-
- approval to move from clarify into plan
|
|
337
|
-
- skipping `plan` after producing a clarify spec
|
|
338
|
-
- implementation details that were never clarified or grounded
|
|
339
|
-
- widening the task because a broader redesign sounds cleaner
|
|
340
|
-
</Must_Not_Decide_Automatically>
|
|
71
|
+
- `docs/loopx/plans/YYYY-MM-DD-<feature-name>.md`
|
|
341
72
|
|
|
342
|
-
|
|
343
|
-
- primary artifact: a loopx clarify spec
|
|
344
|
-
- secondary artifact: an explicit ambiguity register and next-step recommendation
|
|
345
|
-
- preferred handoff: `plan`
|
|
346
|
-
</Output_Contract>
|
|
73
|
+
Do not start code changes or implementation planning from `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.
|
|
6
|
+
version: "0.2.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Systematic Debugging
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: exec
|
|
3
|
+
description: "Executes a written loopx implementation plan sequentially with review checkpoints. Not for unclear plans, missing requirements, or subagent-first execution."
|
|
4
|
+
when_to_use: "written implementation plan, inline execution, sequential plan execution, review checkpoints, no subagent lane"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.2.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Exec
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Load plan, review critically, execute all tasks, report when complete.
|
|
14
|
+
|
|
15
|
+
**Announce at start:** "I'm using the exec skill to implement this plan."
|
|
16
|
+
|
|
17
|
+
**Note:** If subagents are available and the tasks are independent, prefer loopx:subagent-exec instead of this skill.
|
|
18
|
+
|
|
19
|
+
## The Process
|
|
20
|
+
|
|
21
|
+
### Step 1: Load and Review Plan
|
|
22
|
+
1. Read plan file
|
|
23
|
+
2. Review critically - identify any questions or concerns about the plan
|
|
24
|
+
3. If concerns: Raise them with your human partner before starting
|
|
25
|
+
4. If no concerns: create update_plan and proceed
|
|
26
|
+
|
|
27
|
+
### Step 2: Execute Tasks
|
|
28
|
+
|
|
29
|
+
For each task:
|
|
30
|
+
1. Mark as in_progress
|
|
31
|
+
2. Follow each step exactly (plan has bite-sized steps)
|
|
32
|
+
3. Run verifications as specified
|
|
33
|
+
4. Mark as completed
|
|
34
|
+
|
|
35
|
+
### Step 3: Complete Development
|
|
36
|
+
|
|
37
|
+
After all tasks complete and verified:
|
|
38
|
+
- Announce: "I'm using the finish skill to complete this work."
|
|
39
|
+
- **REQUIRED SUB-SKILL:** Use loopx:finish
|
|
40
|
+
- Follow that skill to verify tests, present options, execute choice
|
|
41
|
+
|
|
42
|
+
## When to Stop and Ask for Help
|
|
43
|
+
|
|
44
|
+
**STOP executing immediately when:**
|
|
45
|
+
- Hit a blocker (missing dependency, test fails, instruction unclear)
|
|
46
|
+
- Plan has critical gaps preventing starting
|
|
47
|
+
- You don't understand an instruction
|
|
48
|
+
- Verification fails repeatedly
|
|
49
|
+
|
|
50
|
+
**Ask for clarification rather than guessing.**
|
|
51
|
+
|
|
52
|
+
## When to Revisit Earlier Steps
|
|
53
|
+
|
|
54
|
+
**Return to Review (Step 1) when:**
|
|
55
|
+
- Partner updates the plan based on your feedback
|
|
56
|
+
- Fundamental approach needs rethinking
|
|
57
|
+
|
|
58
|
+
**Don't force through blockers** - stop and ask.
|
|
59
|
+
|
|
60
|
+
## Remember
|
|
61
|
+
- Review plan critically first
|
|
62
|
+
- Follow plan steps exactly
|
|
63
|
+
- Don't skip verifications
|
|
64
|
+
- Reference skills when plan says to
|
|
65
|
+
- Stop when blocked, don't guess
|
|
66
|
+
|
|
67
|
+
## Integration
|
|
68
|
+
|
|
69
|
+
**Required workflow skills:**
|
|
70
|
+
- **loopx:plan** - Creates the plan this skill executes
|
|
71
|
+
- **loopx:finish** - Complete development after all tasks
|