abelworkflow 1.0.0-rc.1 → 1.0.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.
@@ -20,15 +20,15 @@ This context does not by itself authorize destructive changes to user files or c
20
20
 
21
21
  ## Context Rules
22
22
 
23
- - {{CODEBASE_RETRIEVAL_POLICY}}
23
+ - Use local codebase retrieval with `rg`, `rg --files`, `git grep`, and direct file reads.
24
24
  - Rely only on project code plus `grok/context7` results
25
25
  - If information is insufficient or uncertain, state it explicitly
26
26
 
27
27
  ## Workflow
28
28
 
29
29
  ```
30
- /abel-init → /abel-research → /abel-plan → /abel-implement(TDD)
31
- ↘ /abel-diagnose (bug fix)
30
+ /abel-init → /abel-design → /abel-implement(TDD)
31
+ ↘ /abel-diagnose (bug fix)
32
32
  ```
33
33
 
34
34
  ## Universal Constraints
@@ -38,13 +38,13 @@ This context does not by itself authorize destructive changes to user files or c
38
38
 
39
39
  ## Stage Skill Matrix
40
40
 
41
- | Skill | Research | Plan | Implement | Diagnose | Capability & Triggers |
42
- | --- | :---: | :---: | :---: | :---: | --- |
43
- | /grok-search | ✅ | ○ | ❌ | ✅ | Deep research, concept understanding. Trigger: architectural patterns, best practices |
44
- | /context7-auto-research | ✅ | ✅ | ✅ | ✅ | Official docs retrieval. Trigger: framework/library usage, APIs |
45
- | /dev-browser | ○ | ○ | ✅ | ✅ | Browser automation. Trigger: E2E testing, UI verification |
46
- | /time | ○ | ✅ | ✅ | ○ | Time/timezone operations. Trigger: scheduling logic |
41
+ | Skill | Design | Implement | Diagnose | Capability & Triggers |
42
+ | --- | :---: | :---: | :---: | --- |
43
+ | /grok-search | ✅ | ❌ | ✅ | Deep research, concept understanding. Trigger: architectural patterns, best practices |
44
+ | /context7-auto-research | ✅ | ✅ | ✅ | Official docs retrieval. Trigger: framework/library usage, APIs |
45
+ | /dev-browser | ○ | ✅ | ✅ | Browser automation. Trigger: E2E testing, UI verification |
46
+ | /time | ○ | ✅ | ○ | Time/timezone operations. Trigger: scheduling logic |
47
47
 
48
48
  Legend: ✅ Primary, ○ Optional, ❌ Forbidden
49
49
 
50
- OpenSpec commands: `/opsx:new` `/opsx:ff` `/opsx:archive` `openspec view` `openspec status`
50
+ OpenSpec commands: `/opsx:propose` `/opsx:explore` `/opsx:apply` `/opsx:update` `/opsx:sync` `/opsx:archive` `openspec view` `openspec status`
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: abel-design
3
+ description: Transform requirements into implementation-ready, traceable specs via gated clarification.
4
+ category: abel
5
+ tags: [abel, design, constraints, PBT, subagents]
6
+ argument-hint: [requirement | --change <change_name>]
7
+ ---
8
+
9
+ <!-- ABEL:START -->
10
+
11
+ # abel-design — Gated Design Mode (Specs Only, No Implementation)
12
+
13
+ ## Non-Negotiable Rules (Highest Priority)
14
+ 1. DESIGN MODE ONLY — you MUST NOT generate implementation code.
15
+ 2. WRITE SCOPE:
16
+ - Before Gate A: strictly read-only; persist nothing.
17
+ - After Gate A: write ONLY inside the resolved `changeRoot`. Create only ready artifacts; edit a done artifact only when an approved loop-back/consistency repair explicitly targets it.
18
+ 3. NEVER assume or guess — every blocking decision goes to the user (see Decision Model).
19
+ 4. Final output: a schema-valid, fully traceable OpenSpec change with BLOCKING_DECISIONS = 0, READY_TO_IMPLEMENT.
20
+
21
+ **Skill Integration**: See `Stage Skill Matrix` (Design column)
22
+
23
+ ---
24
+
25
+ ## Decision Model
26
+ - Maintain an in-session Decision Ledger with: `id`, `class`, `question`, `evidence`, `options`, `recommendation`, `resolution`, `status`, `affected_artifacts`.
27
+ - `BLOCKING_DECISIONS` is the count of unresolved, non-mechanical decisions in that ledger.
28
+ - Behavior decisions answer WHAT: observable outcomes, scope/non-goals, scenarios, failure behavior, data/security/privacy/compatibility policies and success criteria.
29
+ - Technical decisions answer HOW: interfaces, data flow, dependencies, storage/algorithms, implementation error mechanisms and key technical parameters.
30
+ - MUST be approved by the user: goal, scope, non-goals and observable success behavior; data, security, privacy, compatibility and migration rules; new dependencies, cross-module architecture, irreversible changes; any technical choice with substantive trade-offs, including key parameters.
31
+ - MAY be decided mechanically by the agent: naming, file locations and local structure uniquely determined by existing repo conventions; easily reversible details with no external behavior change; test placement and execution order derived directly from the approved design.
32
+ - Record mechanical decisions and never re-ask them. Two or more viable options with substantive differences → escalate to a blocking decision.
33
+ - Do NOT create a runtime ledger or approval-state file. Materialize approved decisions only in schema artifacts.
34
+
35
+ ## Phase 0 — Entry, Mode & Readiness (read-only)
36
+ - Verify an initialized OpenSpec root and the required CLI capabilities: `new change`, `list --json`, `schemas --json`, `schema which --json`, `schema validate --json`, `templates --json`, `status --json`, `instructions --json`, and `validate --strict`. If unavailable, STOP with actionable `/abel-init` remediation; do not initialize or update from this command.
37
+ - Resolve mode:
38
+ - Explicit `--change <name>` → Resume. If that change does not exist, STOP and ask the user to correct the name or choose New mode.
39
+ - Otherwise, an exact existing-change match → Resume.
40
+ - Otherwise → New mode; do not silently interpret an explicit/resume-like typo as a requirement.
41
+ - Resolve the effective schema by precedence: explicit schema choice, existing change metadata, project config, then `spec-driven`; verify it appears in `openspec schemas --json`.
42
+ - Before creating a change, run `openspec schema which <schema> --json` and `openspec schema validate <schema> --json`, inspect its definition and `openspec templates --schema <schema> --json`, and perform a preliminary behavior/technical/mixed dependency check. Implementation compatibility also requires a non-empty concrete `apply.tracks` that matches exactly one artifact's `generates`. An incompatible schema must fail closed before creation.
43
+ - New mode minimum intake before ANY exploration:
44
+ - Problem/goal statement, AND
45
+ - Scope anchor (which module/directory is involved).
46
+ - If either intake item is missing, ask the user concisely before proceeding.
47
+ - Generate a provisional kebab-case change name and check `openspec list --changes --json`. Recompute and confirm it from the final Gate A scope before creation. Persist nothing yet.
48
+
49
+ ## Phase 1 — Evidence Exploration (read-only)
50
+ - Use local codebase retrieval with `rg`, `rg --files`, `git grep`, and direct file reads.
51
+ - Single context boundary → main agent explores directly.
52
+ - Multiple independent context boundaries, when the platform permits → dispatch parallel Explore subagents:
53
+ - Divide by context boundary (NOT functional role); each boundary self-contained.
54
+ - Each subagent receives: mandatory use of the codebase retrieval policy, a clear scope, and the mandatory JSON output schema:
55
+ {
56
+ "module_name": "所探索的上下文边界",
57
+ "existing_structures": ["关键结构/模式"],
58
+ "existing_conventions": ["约定/标准"],
59
+ "constraints_discovered": ["硬约束"],
60
+ "open_questions": ["需用户输入的歧义"],
61
+ "dependencies": ["跨模块依赖"],
62
+ "risks": ["风险/阻碍"],
63
+ "success_criteria_hints": ["可观察的成功行为"]
64
+ }
65
+ - Validate every subagent JSON before aggregation; aggregate constraints, dependencies, risks, conflicts and questions into the Decision Ledger.
66
+ - Audit existing codebase patterns:
67
+ Use `rg`, `rg --files`, `git grep`, and direct file reads to validate against existing codebase patterns.
68
+ - On-demand /context7-auto-research: verify candidate libraries/APIs against official contracts.
69
+ - On-demand /grok-search: architectural patterns and best practices for candidate directions.
70
+ - PBT boundary screening: probe empty input, idempotency, ordering, size/value bounds, state-transition legality → feed the question list for Phase 2.
71
+ - Reference: Inspect codebase structure with `rg --files`, `git grep`, and direct file reads.
72
+
73
+ ## Phase 2 — Behavior Clarification Loop (multiple rounds allowed)
74
+ - Cover WHAT only: goal, scope, non-goals, observable scenarios/success criteria, failure behavior, and data/security/privacy/compatibility policies.
75
+ - Do not choose libraries, protocols, algorithms, storage, topology or implementation parameters in this phase; route them to Phase 4.
76
+ - Each round asks ONLY the current highest-impact blocking questions, grouped concisely, each with evidence, impact and a recommended default.
77
+ - Anti-patterns (flag and reject):
78
+ - Observable behavior deferred to implementation ("error behavior decided while coding")
79
+ - Technical mechanisms smuggled in as product requirements
80
+ - Target behavior patterns:
81
+ - "Lock the account for 30 minutes after 5 consecutive failed logins."
82
+ - "Retain audit records for 30 days and never expose secrets in responses."
83
+ - "For an empty query, return an empty result within the approved latency bound."
84
+ - An answer that widens modules, scenarios or data boundaries → return to Phase 1 for INCREMENTAL exploration only.
85
+ - Loop until unresolved behavior decisions = 0.
86
+
87
+ ## ⛔ Gate A — Approve Behavior Contract
88
+ - Present the behavior contract and affected Decision Ledger entries; the user explicitly approves goal, scope/non-goals, scenarios/success criteria and policies.
89
+ - Recompute the change name from the approved scope and recheck duplicates.
90
+ - New mode: ONLY NOW create the change with `openspec new change <change-name>` (add `--schema <schema>` only for an explicit non-default choice).
91
+ - Build the Artifact Plan, then materialize only behavior-class artifacts that are safe and ready.
92
+
93
+ ## Artifact Plan & Write Protocol
94
+ - Before New-mode creation, build a preliminary compatibility map from the resolved schema definition/templates. After creation or in Resume mode, build the final Artifact Plan from `status --json` and available `instructions --json`. Record the schema's `apply.tracks`; for every artifact record capture id/output paths, dependencies/status, substantive decision class (`behavior|technical|mixed`), write Gate, and affected decisions. Mechanical impact information alone does not make an artifact mixed.
95
+ - Classify by the decisions the artifact carries, never by a hardcoded artifact name:
96
+ - behavior → Gate A
97
+ - technical or mixed → Gate B
98
+ - behavior depending on a Gate B artifact → defer until after Gate B and then follow the DAG
99
+ - If the schema requires a write before Gate A, a write outside `changeRoot`, or an unapproved technical decision to unlock behavior, STOP before New-mode creation and ask the user to select a compatible schema/mapping. Schema order never overrides decision approval.
100
+ - Mandatory loop for EVERY artifact write:
101
+ 1. Run `openspec status --change <change-name> --json`; verify `schemaName`, `changeRoot`, `artifactPaths`, status/dependencies and `applyRequires`. `existingOutputPaths` may be empty and is not a new-file target.
102
+ 2. Run `openspec instructions <artifact-id> --change <change-name> --json`; follow its template/rules/dependencies.
103
+ 3. Read dependencies and existing outputs; check consistency in both directions.
104
+ 4. Prepare content in memory and show the decision summary or unified diff before the corresponding Gate. If materialization reveals a new substantive decision, return to the relevant loop and re-approve it.
105
+ 5. After Gate approval, create exactly one ready artifact, or edit one done artifact explicitly targeted by an approved loop-back/consistency repair. Rerun status after every write and process newly unlocked artifacts topologically.
106
+
107
+ ## Phase 3 — Technical Derivation
108
+ - Derive the technical design from the Gate A contract, existing codebase patterns and official API contracts.
109
+ - Mechanical decisions → record directly in the design. Substantive trade-offs → Phase 4.
110
+
111
+ ## Phase 4 — Technical Decision & Verification Loop
112
+ - Cover HOW: interfaces, data flow, implementation error mechanisms, dependencies/algorithms and key parameters. Examples include JWT vs session design and an approved bcrypt cost factor.
113
+ - Apply the same evidence/options/recommendation format to every substantive technical decision; update the Decision Ledger.
114
+ - PBT applicability rule (screen with the six categories: commutativity/associativity, idempotency, round-trip, invariant preservation, monotonicity, bounds):
115
+ - Behavior with invariants, round-trips, idempotency, ordering, bounds or state transitions → MUST extract a property + falsification strategy.
116
+ - Behavior unsuited to PBT → use example/E2E/static verification and record why PBT does not apply. Do NOT force every requirement through every category.
117
+ - Give every scenario a stable reference: `<spec-path>#<requirement-heading>/<scenario-heading>` and require those headings to be unique within the spec; maintain Requirement → Scenario → Verification → Task.
118
+ - Every task has exactly one schema checkbox and a verification contract using ordinary indented bullets, NEVER nested `- [ ]`/`- [x]` lines:
119
+ - Task ID / dependencies
120
+ - Requirement + stable Scenario reference
121
+ - Verification type: property | example | E2E | static
122
+ - Red command + expected failure reason
123
+ - Green expected behavior
124
+ - Affected-suite verification command
125
+ - Target scope/files
126
+ - For a non-behavior-change task, the Red command is a pre-change executable static verification. Manual-only verification is not implementation-ready and MUST NOT pass Gate B or Exit; reshape the task until it has executable property/example/E2E/static verification.
127
+ - Loop until unresolved technical decisions = 0; prepare proposed remaining artifact contents/unified diffs in memory.
128
+
129
+ ## ⛔ Gate B — Approve Implementation Contract
130
+ - Verify Phase 3/4 faithfully expand the Gate A contract; no unapproved new decisions introduced.
131
+ - Present substantive technical decisions, task/verification mapping and artifact materialization preview.
132
+ - The user explicitly approves that implementation contract.
133
+ - Write the remaining ready artifacts one at a time per the Artifact Plan & Write Protocol.
134
+
135
+ ## Loop-Back Rules
136
+ - A user answer widens modules, scenarios or data boundaries → return to Phase 1.
137
+ - Technical analysis overturns the behavior contract → return to Phase 2; re-approve ONLY the affected decisions and synchronize all affected artifacts.
138
+ - Gate B finds the materialization unfaithful → return to Phase 3/4; unaffected Gate A decisions remain approved.
139
+ - Strict validation, verification-contract or traceability failure → return to the earliest phase that introduced the inconsistency.
140
+ - Never hide a late-discovered blocking question.
141
+
142
+ ## Resume Rules
143
+ - Never infer user approval from artifact existence: `status` reporting `done` proves file completion only, not Gate approval.
144
+ - Never resume by fixed file names or file existence alone; the active schema decides.
145
+ - Algorithm:
146
+ 1. Run `openspec status --change <change-name> --json`.
147
+ 2. Use its `schemaName`, `changeRoot`, `artifactPaths` and statuses; read all `existingOutputPaths` and dependencies.
148
+ 3. Check `openspec validate <change-name> --strict --type change`, template completeness, cross-artifact consistency, traceability and verification contracts.
149
+ 4. Rebuild Gate A/B summaries and the Artifact Plan. Re-confirm every Gate approval that cannot be proven in the current conversation.
150
+ 5. Choose the next step:
151
+ - Explicit Resume change not found (`change_error`) → STOP for spelling/New-mode confirmation; never create silently.
152
+ - Artifacts incomplete → repair/confirm the nearest safe Gate, then handle the artifacts the schema reports ready.
153
+ - Artifacts complete but validation/traceability fails → earliest inconsistent phase.
154
+ - Every artifact id listed in `applyRequires` is `done` → re-confirm any unproven Gate, then run the Exit audit.
155
+ - Only in-session, un-persisted analysis exists → no mid-loop resume; re-run the read-only analysis.
156
+ - Do NOT create runtime approval-state files; re-confirming the Gate summary IS the resume mechanism.
157
+
158
+ ## Exit Criteria
159
+ - [ ] `openspec validate <change-name> --strict --type change` returns zero issues
160
+ - [ ] Every artifact id in `applyRequires` has status `done`
161
+ - [ ] Schema `apply.tracks` resolves to the generated task artifact inside `changeRoot`
162
+ - [ ] Artifacts are consistent and traceable; every task has a valid verification contract
163
+ - [ ] Every task has executable property/example/E2E/static verification; no task is manual-only
164
+ - [ ] BLOCKING_DECISIONS = 0
165
+ - [ ] User has explicitly approved the reconstructed/current Gate A and Gate B summaries in this conversation
166
+ - [ ] Status: READY_TO_IMPLEMENT
167
+
168
+ ## Reference
169
+ - `openspec context --json` / `openspec schemas --json`
170
+ - `openspec view` / `openspec list --changes --json` / `openspec list --specs` (conflicts with existing specs)
171
+ - `openspec status --change <change-name> --json` / `openspec instructions <artifact-id> --change <change-name> --json`
172
+ - `openspec new change <change-name>` (Gate A only)
173
+ - `openspec show <change-name> --json --deltas-only` when validation fails
174
+ - `rg -n "Constraint:|MUST|MUST NOT|INVARIANT:|PROPERTY:" openspec/` before defining new ones
175
+ <!-- ABEL:END -->
@@ -12,21 +12,31 @@ argument-hint: [change_name]
12
12
 
13
13
  **Guardrails**
14
14
 
15
- **Guardrails**
16
-
17
15
  - Keep changes tightly scoped to the requested outcome; enforce side-effect review before applying any modification.
18
16
  - Minimize documentation—avoid unnecessary comments; prefer self-explanatory code.
19
17
  - Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) for additional OpenSpec conventions or clarifications.
20
18
 
21
19
  **TDD Guardrails (mandatory)**
22
- - **Red Phase**: Generate failing tests ONLY; implementation code is FORBIDDEN.
23
- - **Green Phase**: Write MINIMAL code to pass tests; over-engineering is FORBIDDEN.
24
- - **Refactor Phase**: Optimize code quality while keeping ALL tests passing.
25
- - **Mandatory**: Run tests after EVERY code change; never skip verification.
26
- - **Test-First**: Each task MUST have a failing test before implementation begins.
20
+ - **Red Phase**: Create or execute the task's failing executable verification ONLY; implementation code is FORBIDDEN.
21
+ - **Green Phase**: Write MINIMAL code to satisfy the verification; over-engineering is FORBIDDEN.
22
+ - **Refactor Phase**: Optimize code quality while keeping target and affected verification green and introducing no new full-suite failures.
23
+ - **Mandatory**: Run the task's executable verification after EVERY code change; never skip verification.
24
+ - **Test-First**: Each task MUST have a failing executable verification before implementation begins.
27
25
 
28
26
  **Skill Integration**: See `Stage Skill Matrix` (Implement column)
29
27
 
28
+ **Readiness Preflight (before any code or test write)**
29
+
30
+ 1. Explicit argument takes precedence. Resolve it directly; ask only when the argument is missing or cannot be resolved uniquely. Never require unconditional `openspec view` confirmation.
31
+ 2. Run `openspec status --change <change-name> --json`; read `schemaName`, `changeRoot`, `artifactPaths`, `applyRequires`, and `artifacts`.
32
+ 3. Run `openspec schema which <schemaName> --json`, read the resolved `schema.yaml`, and extract `apply.tracks`. Resolve `apply.tracks` relative to `changeRoot`; it must name one concrete existing regular file inside `changeRoot`. Missing, null, non-concrete, or escaping paths fail closed; do not infer the tracking path from apply-instruction `contextFiles` or `tasks`.
33
+ 4. Every artifact id in `applyRequires` must have status `done`; array presence or a general completion flag is insufficient.
34
+ 5. Run `openspec validate <change-name> --strict --type change`; require zero issues.
35
+ 6. Read every planning artifact reported by `artifactPaths`, then run `openspec instructions apply --change <change-name> --json` and follow the returned apply contract.
36
+ 7. Verify stable Requirement and Scenario references, the Requirement → Scenario → Verification → Task chain, and every task verification contract. Rebuild the Gate A and Gate B summaries; if approval cannot be proven in the current conversation, show the summaries and require explicit user confirmation.
37
+ 8. Run and record affected baseline tests and the full test suite before any write. Record each command, exit status, and normalized failure identities/reasons. Keep existing failures from the full suite separate from the target Red; an existing failure never counts as Red.
38
+ 9. If any preflight item fails, STOP and return `/abel-design --change <change-name>`. Do not invent or repair product, behavior, or architecture decisions here.
39
+
30
40
  **Tool Routing**:
31
41
  - **TDD Cycle**: Autonomous refactoring
32
42
  - **Final Review** (after all tasks):
@@ -34,39 +44,44 @@ argument-hint: [change_name]
34
44
  - Frontend refactor (subagents)
35
45
  - **E2E tasks** → `/dev-browser`
36
46
 
37
- 1. Run `openspec view` to inspect current project status and review `Active Changes`; ask the user to confirm which change folder (`<change_name>`) they want to implement.
38
- 2. Check artifact status: `openspec status --change <change_name>`
39
- 3. Get apply instructions: `openspec instructions apply --change <change_name>`
40
- 4. Detect test framework: identify project's testing setup (pytest/jest/vitest/etc.)
41
- 5. Work through tasks sequentially; for each task, execute the **TDD Cycle** below.
47
+ After preflight, detect the project's verification tooling and work through the tracked tasks sequentially.
42
48
 
43
49
  **TDD Cycle (per task)**
44
50
 
51
+ Consume these ordinary indented bullets from the task verification contract, never Markdown checkboxes:
52
+ - verification type: property | example | E2E | static
53
+ - Red command and expected failure reason
54
+ - Green expected behavior
55
+ - affected-suite command
56
+ - target scope/files
57
+
58
+ - Red must fail because of the target defect described by the contract.
59
+ - If the failure reason differs or the command is invalid, STOP and return `/abel-design --change <change-name>`; do not improvise a replacement contract.
60
+ - A non-behavior-change task starts with its specified failing executable static verification.
61
+ - A manual-only task is not implementation-ready; STOP and return `/abel-design --change <change-name>`.
62
+
45
63
  ```
46
64
  ┌─────────────────────────────────────────────────────────┐
47
- │ Step 1: 🔴 Red Phase - Generate Failing Test
48
- │ ├─ Analyze task determine test type
49
- ├─ Backend pytest/jest
50
- │ │ ├─ Frontend vitest/jest
51
- │ │ └─ E2E → dev-browser │
52
- │ ├─ Generate test via │
53
- │ │ PROMPT: "Generate failing test for: {task} │
65
+ │ Step 1: 🔴 Red Phase - Execute Contract Verification
66
+ │ ├─ Use the contract's verification type and scope
67
+ │ ├─ Generate the required failing verification via
68
+ │ │ PROMPT: "Generate failing verification for: {task}
54
69
  │ │ Context: {code_context} │
55
70
  │ │ Output: unified diff patch │
56
71
  │ │ FORBIDDEN: implementation code" │
57
- │ ├─ Apply test code (after review)
58
- │ ├─ Run test → MUST FAIL
59
- │ └─ If passes test invalid, regenerate
72
+ │ ├─ Apply verification code (after review)
73
+ │ ├─ Run Red command → MUST FAIL for expected reason
74
+ │ └─ If it passes or fails differently → STOP
60
75
  ├─────────────────────────────────────────────────────────┤
61
76
  │ Step 2: 🟢 Green Phase - Minimal Implementation │
62
77
  │ ├─ Generate minimal implementation │
63
- │ │ PROMPT: "Generate minimal code to pass test:
64
- │ │ Test: {test_code}
78
+ │ │ PROMPT: "Generate minimal code for verification:
79
+ │ │ Verification: {verification_context}
65
80
  │ │ Context: {code_context} │
66
81
  │ │ Output: unified diff patch │
67
82
  │ │ FORBIDDEN: over-engineering" │
68
83
  │ ├─ Apply implementation (after review & rewrite) │
69
- │ ├─ Run test → MUST PASS
84
+ │ ├─ Run Red command → MUST PASS
70
85
  │ └─ If fails → analyze error, fix, retry │
71
86
  ├─────────────────────────────────────────────────────────┤
72
87
  │ Step 3: 🔵 Refactor Phase │
@@ -77,28 +92,29 @@ argument-hint: [change_name]
77
92
  │ │ ├─ Enhance readability │
78
93
  │ │ └─ Simplify logic where possible │
79
94
  │ ├─ Apply refactoring changes │
80
- │ ├─ Run test → MUST STILL PASS
95
+ │ ├─ Run affected-suite command → MUST STILL PASS
81
96
  │ └─ If fails → rollback refactoring │
82
97
  └─────────────────────────────────────────────────────────┘
83
98
  ```
84
99
 
85
- 6. Before applying any change, perform mandatory side-effect review.
100
+ Before applying any change, perform mandatory side-effect review.
86
101
 
87
- 7. After TDD cycle completes for a task, mark as `- [x]` in `tasks.md`.
102
+ After a task's TDD cycle completes, locate the task ID's checkbox in the concrete tracking file resolved from schema `apply.tracks`; require exactly one match and update only it. Zero or multiple matches must STOP and return `/abel-design --change <change-name>`. Never hardcode an artifact filename or infer the tracking path from apply instructions.
88
103
 
89
104
  **Final Review & Refactor** (after all tasks complete)
90
105
 
91
- 8. Run all tests to ensure everything passes.
106
+ 1. Require all target tests to be green, then run the affected suites.
107
+ 2. Re-run the same full-suite command (the full test suite), compare normalized failure identities with the recorded full-suite baseline, and require no new failures.
92
108
 
93
- 9. Execute global code review via subagents:
109
+ 3. Execute global code review via subagents:
94
110
 
95
- 10. Wait for background tasks to complete; review diff patches.
96
- 11. Rewrite patches into production-grade code (per rewriting principle).
97
- 12. Apply refactoring changes.
98
- 13. Run all tests MUST ALL PASS.
99
- 14. If any test fails analyze root cause, fix or rollback.
100
- 15. Perform final side-effect review.
101
- 16. Report that the change is ready for archive; do not archive until the user explicitly authorizes `/opsx:archive`.
111
+ 4. Wait for background tasks to complete; review diff patches.
112
+ 5. Rewrite patches into production-grade code (per rewriting principle).
113
+ 6. Apply refactoring changes.
114
+ 7. Re-run target, affected, and full-suite verification against the baseline.
115
+ 8. If a target test fails or the full suite has a new failure, analyze the root cause and fix or roll back.
116
+ 9. Perform final side-effect review.
117
+ 10. Report that the change is ready for archive; do not archive until the user explicitly authorizes `/opsx:archive`.
102
118
 
103
119
  **TDD Output Format**
104
120
 
@@ -108,19 +124,20 @@ argument-hint: [change_name]
108
124
  ### Task 1/N: {task_description}
109
125
 
110
126
  🔴 Red Phase
111
- ├─ Generated: tests/{test_file}
112
- ├─ Run: {test_command}
113
- └─ Result: {count} failed ✓ (expected)
127
+ ├─ Type: {verification_type}
128
+ ├─ Generated: {verification_files_or_none}
129
+ ├─ Run: {red_command}
130
+ └─ Result: failed for {expected_failure_reason} ✓
114
131
 
115
132
  🟢 Green Phase
116
- ├─ Generated: src/{impl_file}
117
- ├─ Run: {test_command}
118
- └─ Result: {count} passed
133
+ ├─ Generated: {implementation_files}
134
+ ├─ Run: {red_command}
135
+ └─ Result: {green_expected_behavior} ✓
119
136
 
120
137
  🔵 Refactor Phase (Agent autonomous)
121
138
  ├─ Optimized: {description}
122
- ├─ Run: {test_command}
123
- └─ Result: {count} passed
139
+ ├─ Run: {affected_suite_command}
140
+ └─ Result: target verification green
124
141
 
125
142
  ✓ Task complete → Next task
126
143
 
@@ -144,7 +161,8 @@ Frontend Review
144
161
 
145
162
  ✓ Reviews complete
146
163
  ├─ Applied: {refactoring_summary}
147
- ├─ Tests: {count} passed
164
+ ├─ Target tests: green
165
+ ├─ Full suite: no failures beyond baseline ✓
148
166
  └─ Ready for user-authorized archive
149
167
 
150
168
  ✓ Implementation complete
@@ -16,12 +16,10 @@ tags: [openspec, init, setup]
16
16
  2. Verify `openspec` availability via `openspec --version`.
17
17
  3. If missing, `npm install -g @fission-ai/openspec@latest`, then re-check version.
18
18
  4. Run `openspec init` (or `openspec update` for existing projects).
19
- 5. {{AUGMENT_CONTEXT_ENGINE_VALIDATION}}
20
- 6. Verify required skills:
19
+ 5. Verify required skills:
21
20
  - Skills: `/dev-browser` `/context7-auto-research` `/grok-search`
22
- 7. Output summary with ✓/✗:
21
+ 6. Output summary with ✓/✗:
23
22
  - OpenSpec installation
24
23
  - Project initialization
25
- - MCP availability if enabled
26
24
  - Required skills availability
27
25
  <!-- ABEL:END -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abelworkflow",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0",
4
4
  "description": "Install AbelWorkflow into ~/.agents and create Claude/Codex symlinks.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -41,14 +41,8 @@
41
41
  "skills/grok-search/scripts/_dotenv.py",
42
42
  "skills/grok-search/scripts/groksearch_cli.py",
43
43
  "skills/grok-search/scripts/groksearch_entry.py",
44
- "skills/prompt-enhancer/.env.example",
45
- "skills/prompt-enhancer/ADVANCED.md",
46
44
  "skills/prompt-enhancer/SKILL.md",
47
45
  "skills/prompt-enhancer/TEMPLATE.md",
48
- "skills/prompt-enhancer/requirements.txt",
49
- "skills/prompt-enhancer/scripts/_dotenv.py",
50
- "skills/prompt-enhancer/scripts/enhance.py",
51
- "skills/prompt-enhancer/scripts/prompt_enhancer_entry.py",
52
46
  "skills/time/SKILL.md",
53
47
  "skills/time/scripts/time_cli.py"
54
48
  ],
@@ -6,9 +6,9 @@ GROK_API_URL=
6
6
  # 必填项:你的 API 密钥
7
7
  GROK_API_KEY=
8
8
 
9
- # 可选项:使用的 Grok 模型(默认:grok-4.20-auto
10
- # 常用选项:grok-4.20-auto, grok-4-fast
11
- GROK_MODEL=grok-4.20-auto
9
+ # 可选项:使用的 Grok 模型(默认:grok-4.20-non-reasoning
10
+ # 常用选项:grok-4.20-non-reasoning, grok-4.20-auto, grok-4-fast
11
+ GROK_MODEL=grok-4.20-non-reasoning
12
12
 
13
13
  # 可选项:启用调试模式(true/false)
14
14
  GROK_DEBUG=false
@@ -24,7 +24,7 @@ Use this skill for web search, webpage retrieval, and current-information lookup
24
24
  ```bash
25
25
  cp "<SKILL_DIR>/.env.example" "<SKILL_DIR>/.env"
26
26
 
27
- python "<SKILL_DIR>/scripts/groksearch_entry.py" web_search --query "search terms" [--platform "GitHub"] [--min-results 3] [--max-results 10] [--model "grok-4.20-auto"] [--extra-sources 3]
27
+ python "<SKILL_DIR>/scripts/groksearch_entry.py" web_search --query "search terms" [--platform "GitHub"] [--min-results 3] [--max-results 10] [--model "grok-4.20-non-reasoning"] [--extra-sources 3]
28
28
 
29
29
  python "<SKILL_DIR>/scripts/groksearch_entry.py" web_fetch --url "https://..." [--out file.md] [--fallback-grok]
30
30
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "model": "grok-4.20-auto"
2
+ "model": "grok-4.20-non-reasoning"
3
3
  }
@@ -2,7 +2,6 @@
2
2
  name: prompt-enhancer
3
3
  description: |
4
4
  Rewrite a raw prompt into a clearer prompt for a coding agent. Use only when the user explicitly asks to improve, optimize, rewrite, or structure a prompt for Codex, Claude Code, Gemini CLI, or another AI agent. Triggers: "improve this prompt", "rewrite this prompt", "optimize this prompt for Codex", "make this prompt better for an AI agent".
5
- allowed-tools: Bash(python:*), Bash(python3:*), Bash(uv:*), Read, Grep
6
5
  ---
7
6
 
8
7
  # Prompt Enhancer
@@ -19,31 +18,7 @@ Do not use this for general writing edits like email, docs, or PR copy.
19
18
 
20
19
  ## Do
21
20
 
22
- - Default path: rewrite the prompt directly with the current agent using the structure from [TEMPLATE.md](TEMPLATE.md).
23
- - Third-party path: use the Python entrypoint only when the user explicitly provides `url`, `apiKey`, and `model`, or when all three are already configured in `<SKILL_DIR>/.env`.
24
-
25
- ```bash
26
- python "<SKILL_DIR>/scripts/prompt_enhancer_entry.py" "user's raw prompt here"
27
- ```
28
-
29
- - Do not call `scripts/enhance.py` directly.
30
- - Use the installed skill directory for `<SKILL_DIR>`.
31
- - If any of `url`, `apiKey`, or `model` is missing, do not invoke the script. Use the current agent directly instead.
32
- - Optional setup: `cp "<SKILL_DIR>/.env.example" "<SKILL_DIR>/.env"`
33
-
34
- ## Output
35
-
36
- - Read the enhanced prompt from `stdout`.
37
- - Keep `stderr` for usage or optional debug output only.
21
+ - Rewrite the prompt directly with the current agent, following the structure from [TEMPLATE.md](TEMPLATE.md).
38
22
  - Preserve the user's intent and explicit constraints.
39
23
  - Add structure and missing execution context only when it helps the agent act.
40
- - When running directly in the current agent, use placeholders for unknown context instead of inventing new requirements.
41
-
42
- ## Notes
43
-
44
- - Local config file: `<SKILL_DIR>/.env`
45
- - The entrypoint auto-loads `<SKILL_DIR>/.env` before bootstrap and dependency install.
46
- - Optional debug flag: `PE_DEBUG=1`
47
- - Bootstrap controls: `PROMPT_ENHANCER_VENV_DIR`, `PROMPT_ENHANCER_PYTHON`, `AGENTS_SKILLS_PYTHON`
48
- - Setup and troubleshooting: [ADVANCED.md](ADVANCED.md)
49
- - Prompt template reference: [TEMPLATE.md](TEMPLATE.md)
24
+ - Use placeholders for unknown context instead of inventing new requirements.
@@ -1,46 +0,0 @@
1
- const augmentContextEngineRetrievalTool = "mcp__augment-context-engine__codebase-retrieval";
2
- const localCodebaseRetrievalPolicy = "Use local codebase retrieval with `rg`, `rg --files`, `git grep`, and direct file reads. Do not require augment-context-engine MCP.";
3
- const augmentCodebaseRetrievalPolicy = `Use \`${augmentContextEngineRetrievalTool}\` as the primary codebase search tool.`;
4
-
5
- function resolveAugmentContextEngineFeature(options = {}, previousMetadata = {}) {
6
- if (typeof options.augmentContextEngine === "boolean") return options.augmentContextEngine;
7
- if (typeof previousMetadata?.features?.augmentContextEngine === "boolean") {
8
- return previousMetadata.features.augmentContextEngine;
9
- }
10
- return false;
11
- }
12
-
13
- function getWorkflowRenderValues(augmentContextEngine) {
14
- return {
15
- CODEBASE_RETRIEVAL_POLICY: augmentContextEngine ? augmentCodebaseRetrievalPolicy : localCodebaseRetrievalPolicy,
16
- AUGMENT_CONTEXT_ENGINE_VALIDATION: augmentContextEngine
17
- ? `Verify MCP availability:\n - \`${augmentContextEngineRetrievalTool}\``
18
- : "Skip augment-context-engine MCP validation; use local retrieval tools.",
19
- CODEBASE_RETRIEVAL_MANDATORY_RULE: augmentContextEngine
20
- ? `Mandatory use of \`${augmentContextEngineRetrievalTool}\``
21
- : "Mandatory use of configured codebase retrieval policy.",
22
- CODEBASE_RETRIEVAL_STRUCTURE_REFERENCE: augmentContextEngine
23
- ? `Inspect codebase structure: \`${augmentContextEngineRetrievalTool}\` with \`file list --recursive\`.`
24
- : "Inspect codebase structure with `rg --files`, `git grep`, and direct file reads.",
25
- CODEBASE_RETRIEVAL_PATTERN_AUDIT: augmentContextEngine
26
- ? `Use augment-context-engine to validate against existing codebase patterns.\n ${augmentContextEngineRetrievalTool}: "Search for existing implementations similar to change <change_name>. Keywords: [key concepts from proposal]"`
27
- : "Use `rg`, `rg --files`, `git grep`, and direct file reads to validate against existing codebase patterns."
28
- };
29
- }
30
-
31
- function renderWorkflowTemplate(content, { augmentContextEngine = false } = {}) {
32
- let nextContent = content;
33
- for (const [key, value] of Object.entries(getWorkflowRenderValues(augmentContextEngine))) {
34
- nextContent = nextContent.replaceAll(`{{${key}}}`, value);
35
- }
36
- if (nextContent.includes("{{") || nextContent.includes("}}")) {
37
- throw new Error("工作流模板包含未解析占位符");
38
- }
39
- return nextContent;
40
- }
41
-
42
- export {
43
- getWorkflowRenderValues,
44
- renderWorkflowTemplate,
45
- resolveAugmentContextEngineFeature
46
- };