@ai-content-space/loopx 0.1.10 → 0.2.1
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 +49 -0
- package/README.md +69 -448
- package/README.zh-CN.md +69 -459
- package/docs/loopx/design/loopx-skill-suite-v1-design.md +80 -0
- package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +81 -0
- package/package.json +7 -3
- package/plugins/loopx/.codex-plugin/plugin.json +4 -4
- 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 +349 -0
- package/plugins/loopx/skills/fix-review/SKILL.md +216 -0
- package/plugins/loopx/skills/go-style/SKILL.md +2 -2
- package/plugins/loopx/skills/kratos/SKILL.md +1 -1
- package/plugins/loopx/skills/plan/SKILL.md +138 -271
- 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 +34 -2
- package/skills/RESOLVER.md +22 -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 +349 -0
- package/skills/fix-review/SKILL.md +216 -0
- package/skills/go-style/SKILL.md +2 -2
- package/skills/kratos/SKILL.md +1 -1
- package/skills/plan/SKILL.md +138 -271
- 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 +78 -7
- package/src/context-manifest.mjs +2 -2
- package/src/html-views.mjs +129 -195
- package/src/install-discovery.mjs +210 -6
- package/src/next-skill.mjs +2 -4
- package/src/plan-runtime.mjs +219 -93
- package/src/runtime-maintenance.mjs +5 -2
- package/src/workflow.mjs +749 -71
- package/templates/architecture.md +58 -16
- package/templates/development-plan.md +42 -12
- package/plugins/loopx/scripts/plugin-install.test.mjs +0 -125
- 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/ai-slop-cleaner/SKILL.md +0 -114
- package/skills/archive/SKILL.md +0 -55
- package/skills/autopilot/SKILL.md +0 -93
- package/skills/autoresearch/SKILL.md +0 -68
- package/skills/build/SKILL.md +0 -228
- package/skills/deep-interview/SKILL.md +0 -461
- package/skills/ralph/SKILL.md +0 -271
- package/skills/ralplan/SKILL.md +0 -49
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# loopx Skill Suite v1 Design
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
loopx is moving from a CLI-runtime-first workflow into a skill-first suite for agentic coding assistants. Codex and Claude are supported targets. The CLI remains as installer, governance, diagnostics, rendering, and runtime maintenance.
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
The v1 product surface is the installed and governed bundled skill suite:
|
|
10
|
+
|
|
11
|
+
- `clarify`
|
|
12
|
+
- `spec`
|
|
13
|
+
- `plan`
|
|
14
|
+
- `subagent-exec`
|
|
15
|
+
- `exec`
|
|
16
|
+
- `review`
|
|
17
|
+
- `fix-review`
|
|
18
|
+
- `finish`
|
|
19
|
+
- `refactor-plan`
|
|
20
|
+
- `tdd`
|
|
21
|
+
- `debug`
|
|
22
|
+
- `verify`
|
|
23
|
+
- `go-style`
|
|
24
|
+
- `kratos`
|
|
25
|
+
|
|
26
|
+
Runtime-only skills are not installed as Codex or Claude skills in v1.
|
|
27
|
+
|
|
28
|
+
The repository may retain auxiliary or compatibility skill source directories for development history or adjacent workflows. They are not part of the v1 product surface unless they are listed in the bundled install set and mirrored into the plugin skill set.
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
Recommended flow:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
clarify -> spec? -> plan -> subagent-exec | exec -> review -> fix-review? -> finish
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`spec` is a conditional design gate. `clarify` may route directly to `plan` when the remaining questions are local implementation choices. It routes to `spec` when product behavior, APIs, state, data, permissions, migration, compatibility, or architecture decisions need to be fixed before implementation planning.
|
|
39
|
+
|
|
40
|
+
`plan` is the superpowers `writing-plans` workflow under the loopx name. It writes executable plans and offers two execution options: `subagent-exec` recommended, or `exec` inline.
|
|
41
|
+
|
|
42
|
+
`review` is the superpowers `requesting-code-review` workflow under the loopx name. `fix-review` is the superpowers `receiving-code-review` workflow under the loopx name.
|
|
43
|
+
|
|
44
|
+
`finish` verifies completion, extracts local memory, proposes repo-tracked spec candidates when stable team rules emerged, then presents merge, PR, keep, or discard options.
|
|
45
|
+
|
|
46
|
+
## Artifacts
|
|
47
|
+
|
|
48
|
+
Human-maintained v1 skill-suite artifacts use `docs/loopx/`:
|
|
49
|
+
|
|
50
|
+
- `docs/loopx/design/`
|
|
51
|
+
- `docs/loopx/plans/`
|
|
52
|
+
- `docs/loopx/reviews/`
|
|
53
|
+
- `docs/loopx/refactors/`
|
|
54
|
+
- `docs/loopx/specs/`
|
|
55
|
+
|
|
56
|
+
Runtime state, hook diagnostics, installer metadata, manifests, generated HTML views, and runtime JSON use `.loopx/`.
|
|
57
|
+
|
|
58
|
+
Local agent memory uses `.loopx/memory/`. `.loopx/memory/MEMORY.md` is bounded curated project memory. `.loopx/memory/index.jsonl` is a curated active index for agent file-search. Stable shared rules belong in `docs/loopx/specs/<domain>.md`, with `docs/loopx/specs/inbox.md` as the fallback domain.
|
|
59
|
+
|
|
60
|
+
## Installer
|
|
61
|
+
|
|
62
|
+
Default installation writes user-level skills and hooks for both supported targets:
|
|
63
|
+
|
|
64
|
+
- Codex skills: `~/.agents/skills/`
|
|
65
|
+
- Claude skills: `~/.claude/skills/`
|
|
66
|
+
- Codex hook: existing loopx workflow hook
|
|
67
|
+
- Claude hook: non-blocking prompt hook
|
|
68
|
+
|
|
69
|
+
Project-level Claude installation and custom directories are explicit installer choices.
|
|
70
|
+
|
|
71
|
+
## Claude Hook
|
|
72
|
+
|
|
73
|
+
The Claude hook is advisory only. It must not block tools, mutate workflow state, or enforce git safety. It emits next-action context when loopx support context exists.
|
|
74
|
+
|
|
75
|
+
## Non-Goals
|
|
76
|
+
|
|
77
|
+
- No alias skills in the v1 bundled install surface for renamed superpowers skills.
|
|
78
|
+
- No automatic project-level `.claude/skills` writes in postinstall.
|
|
79
|
+
- No new mandatory CLI state machine for the v1 skill suite.
|
|
80
|
+
- No blocking Claude hook in v1.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# loopx Skill Suite v1 Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** execute task-by-task. Preserve existing user edits and keep runtime maintenance behavior 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 the canonical source root. `plugins/loopx/skills/` mirrors the bundled v1 skill set for Codex plugin packaging, not every auxiliary source directory that may exist under `skills/`. `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 bundled v1 canonical skill files into `plugins/loopx/skills/`.
|
|
27
|
+
- [ ] Update internal references from old names to new `loopx:` names.
|
|
28
|
+
- [ ] Keep auxiliary or compatibility skill sources outside the bundled install list unless explicitly promoted into the v1 product surface.
|
|
29
|
+
|
|
30
|
+
### Task 2: Installer Targets
|
|
31
|
+
|
|
32
|
+
**Files:**
|
|
33
|
+
- Modify: `src/install-discovery.mjs`
|
|
34
|
+
- Modify: `scripts/install-skills.mjs`
|
|
35
|
+
- Modify: `src/cli.mjs`
|
|
36
|
+
|
|
37
|
+
- [ ] Add Codex and Claude user skill targets.
|
|
38
|
+
- [ ] Add interactive `loopx install-skills` command.
|
|
39
|
+
- [ ] Keep non-interactive flags for target, mode, project, custom directory, and yes.
|
|
40
|
+
- [ ] Make postinstall install Codex user skills and Claude user skills by default.
|
|
41
|
+
- [ ] Preserve lock/ownership checks so non-loopx skills are not overwritten.
|
|
42
|
+
|
|
43
|
+
### Task 3: Claude Hook
|
|
44
|
+
|
|
45
|
+
**Files:**
|
|
46
|
+
- Add: `scripts/claude-workflow-hook.mjs`
|
|
47
|
+
- Modify: `src/install-discovery.mjs`
|
|
48
|
+
- Modify: `scripts/install-skills.mjs`
|
|
49
|
+
|
|
50
|
+
- [ ] Install Claude user hook script under `~/.claude/hooks/`.
|
|
51
|
+
- [ ] Merge a non-blocking hook entry into `~/.claude/settings.json`.
|
|
52
|
+
- [ ] Keep the hook advisory-only.
|
|
53
|
+
- [ ] Do not overwrite unrelated Claude settings.
|
|
54
|
+
|
|
55
|
+
### Task 4: Docs And Governance
|
|
56
|
+
|
|
57
|
+
**Files:**
|
|
58
|
+
- Modify: `README.md`
|
|
59
|
+
- Modify: `README.zh-CN.md`
|
|
60
|
+
- Modify: `package.json`
|
|
61
|
+
- Modify: `scripts/verify-skills.mjs`
|
|
62
|
+
- Modify: `test/skill-governance.test.mjs`
|
|
63
|
+
- Modify: `test/workflow.test.mjs`
|
|
64
|
+
|
|
65
|
+
- [ ] Reframe loopx as a skill suite for agentic coding assistants.
|
|
66
|
+
- [ ] Document the new workflow and artifact paths.
|
|
67
|
+
- [ ] Clarify v1 `docs/loopx/` artifacts versus generated runtime support state.
|
|
68
|
+
- [ ] Document finish memory extraction and `docs/loopx/specs/` candidate promotion.
|
|
69
|
+
- [ ] Clarify installed bundled skills versus auxiliary skill source directories.
|
|
70
|
+
- [ ] Document Codex and Claude installation.
|
|
71
|
+
- [ ] Update governance checks for the v1 bundled skill list and mirrors.
|
|
72
|
+
- [ ] Update install tests for dual user targets and hooks.
|
|
73
|
+
|
|
74
|
+
### Task 5: Verification
|
|
75
|
+
|
|
76
|
+
**Files:**
|
|
77
|
+
- Test suite only unless failures require fixes.
|
|
78
|
+
|
|
79
|
+
- [ ] Run `node scripts/verify-skills.mjs`.
|
|
80
|
+
- [ ] Run `npm test`.
|
|
81
|
+
- [ ] 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.1
|
|
5
|
-
"description": "Skill-first
|
|
4
|
+
"version": "0.2.1",
|
|
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,18 +18,22 @@
|
|
|
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",
|
|
29
32
|
"src/",
|
|
30
33
|
"skills/",
|
|
31
34
|
"templates/",
|
|
32
|
-
"plugins/loopx/"
|
|
35
|
+
"plugins/loopx/",
|
|
36
|
+
"!plugins/loopx/scripts/plugin-install.test.mjs"
|
|
33
37
|
],
|
|
34
38
|
"publishConfig": {
|
|
35
39
|
"access": "public"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loopx",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "Skill-first
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
}
|
|
@@ -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.1
|
|
6
|
+
version: "0.2.1"
|
|
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 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`, hand off to 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 write implementation plans or start code changes inside `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
|
|
6
|
+
version: "0.2.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Systematic Debugging
|