abelworkflow 0.9.2 → 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.
Files changed (134) hide show
  1. package/README.md +54 -182
  2. package/bin/abelworkflow.mjs +5 -3
  3. package/extensions/pi-gpt-responses-compat/index.ts +1 -1
  4. package/lib/cli/args.mjs +76 -0
  5. package/lib/cli/main.mjs +385 -0
  6. package/lib/cli/prompts.mjs +106 -0
  7. package/lib/config/dotenv.mjs +102 -0
  8. package/lib/config/jsonc.mjs +80 -0
  9. package/lib/config/store.mjs +310 -0
  10. package/lib/config/toml.mjs +638 -0
  11. package/lib/installer/assets.mjs +324 -0
  12. package/lib/installer/install.mjs +153 -0
  13. package/lib/installer/links.mjs +427 -0
  14. package/lib/installer/state.mjs +163 -0
  15. package/lib/paths.mjs +99 -0
  16. package/lib/providers/claude.mjs +197 -0
  17. package/lib/providers/codex.mjs +433 -0
  18. package/lib/providers/pi.mjs +577 -0
  19. package/lib/providers/skills.mjs +105 -0
  20. package/lib/templates/codex/agents/default.toml +7 -0
  21. package/lib/templates/codex/agents/explorer.toml +7 -0
  22. package/lib/templates/codex/agents/planner.toml +7 -0
  23. package/lib/templates/codex/agents/reviewer.toml +7 -0
  24. package/lib/templates/codex/agents/worker.toml +7 -0
  25. package/lib/templates/codex/config-base.toml +11 -3
  26. package/lib/templates/workflow/AGENTS.md +50 -0
  27. package/lib/templates/workflow/commands/abel-design.md +175 -0
  28. package/{commands → lib/templates/workflow/commands}/abel-diagnose.md +5 -5
  29. package/lib/templates/workflow/commands/abel-implement.md +170 -0
  30. package/{commands → lib/templates/workflow/commands}/abel-init.md +3 -5
  31. package/{.gitignore → lib/templates/workflow/gitignore.template} +0 -2
  32. package/lib/tools/cli-installer.mjs +277 -0
  33. package/package.json +37 -10
  34. package/skills/context7-auto-research/SKILL.md +5 -5
  35. package/skills/context7-auto-research/{context7-api.js → context7-api.cjs} +5 -8
  36. package/skills/dev-browser/SKILL.md +53 -33
  37. package/skills/dev-browser/dist/scripts/start.d.ts +2 -0
  38. package/skills/dev-browser/dist/scripts/start.d.ts.map +1 -0
  39. package/skills/dev-browser/dist/scripts/start.js +118 -0
  40. package/skills/dev-browser/dist/scripts/start.js.map +1 -0
  41. package/skills/dev-browser/dist/src/client.d.ts +93 -0
  42. package/skills/dev-browser/dist/src/client.d.ts.map +1 -0
  43. package/skills/dev-browser/dist/src/client.js +310 -0
  44. package/skills/dev-browser/dist/src/client.js.map +1 -0
  45. package/skills/dev-browser/dist/src/entrypoint.d.ts +29 -0
  46. package/skills/dev-browser/dist/src/entrypoint.d.ts.map +1 -0
  47. package/skills/dev-browser/dist/src/entrypoint.js +106 -0
  48. package/skills/dev-browser/dist/src/entrypoint.js.map +1 -0
  49. package/skills/dev-browser/dist/src/index.d.ts +4 -0
  50. package/skills/dev-browser/dist/src/index.d.ts.map +1 -0
  51. package/skills/dev-browser/dist/src/index.js +2 -0
  52. package/skills/dev-browser/dist/src/index.js.map +1 -0
  53. package/skills/dev-browser/dist/src/page-api.d.ts +25 -0
  54. package/skills/dev-browser/dist/src/page-api.d.ts.map +1 -0
  55. package/skills/dev-browser/dist/src/page-api.js +104 -0
  56. package/skills/dev-browser/dist/src/page-api.js.map +1 -0
  57. package/skills/dev-browser/dist/src/relay.d.ts +27 -0
  58. package/skills/dev-browser/dist/src/relay.d.ts.map +1 -0
  59. package/skills/dev-browser/dist/src/relay.js +521 -0
  60. package/skills/dev-browser/dist/src/relay.js.map +1 -0
  61. package/skills/dev-browser/dist/src/runtime.d.ts +45 -0
  62. package/skills/dev-browser/dist/src/runtime.d.ts.map +1 -0
  63. package/skills/dev-browser/dist/src/runtime.js +54 -0
  64. package/skills/dev-browser/dist/src/runtime.js.map +1 -0
  65. package/skills/dev-browser/dist/src/snapshot/browser-script.d.ts +23 -0
  66. package/skills/dev-browser/dist/src/snapshot/browser-script.d.ts.map +1 -0
  67. package/skills/dev-browser/{src/snapshot/browser-script.ts → dist/src/snapshot/browser-script.js} +21 -30
  68. package/skills/dev-browser/dist/src/snapshot/browser-script.js.map +1 -0
  69. package/skills/dev-browser/dist/src/snapshot/index.d.ts +14 -0
  70. package/skills/dev-browser/dist/src/snapshot/index.d.ts.map +1 -0
  71. package/skills/dev-browser/{src/snapshot/index.ts → dist/src/snapshot/index.js} +2 -2
  72. package/skills/dev-browser/dist/src/snapshot/index.js.map +1 -0
  73. package/skills/dev-browser/dist/src/snapshot/inject.d.ts +13 -0
  74. package/skills/dev-browser/dist/src/snapshot/inject.d.ts.map +1 -0
  75. package/skills/dev-browser/{src/snapshot/inject.ts → dist/src/snapshot/inject.js} +2 -2
  76. package/skills/dev-browser/dist/src/snapshot/inject.js.map +1 -0
  77. package/skills/dev-browser/dist/src/standalone.d.ts +32 -0
  78. package/skills/dev-browser/dist/src/standalone.d.ts.map +1 -0
  79. package/skills/dev-browser/dist/src/standalone.js +174 -0
  80. package/skills/dev-browser/dist/src/standalone.js.map +1 -0
  81. package/skills/dev-browser/dist/src/startup.d.ts +55 -0
  82. package/skills/dev-browser/dist/src/startup.d.ts.map +1 -0
  83. package/skills/dev-browser/dist/src/startup.js +81 -0
  84. package/skills/dev-browser/dist/src/startup.js.map +1 -0
  85. package/skills/dev-browser/dist/src/target-registry.d.ts +29 -0
  86. package/skills/dev-browser/dist/src/target-registry.d.ts.map +1 -0
  87. package/skills/dev-browser/dist/src/target-registry.js +135 -0
  88. package/skills/dev-browser/dist/src/target-registry.js.map +1 -0
  89. package/skills/dev-browser/dist/src/types.d.ts +27 -0
  90. package/skills/dev-browser/dist/src/types.d.ts.map +1 -0
  91. package/skills/dev-browser/dist/src/types.js +2 -0
  92. package/skills/dev-browser/dist/src/types.js.map +1 -0
  93. package/skills/dev-browser/package-lock.json +67 -1510
  94. package/skills/dev-browser/package.json +18 -14
  95. package/skills/dev-browser/references/scraping.md +94 -105
  96. package/skills/grok-search/.env.example +3 -3
  97. package/skills/grok-search/SKILL.md +1 -1
  98. package/skills/grok-search/defaults.json +3 -0
  99. package/skills/grok-search/gitignore.template +4 -0
  100. package/skills/grok-search/scripts/_dotenv.py +5 -1
  101. package/skills/grok-search/scripts/groksearch_cli.py +15 -33
  102. package/skills/prompt-enhancer/SKILL.md +2 -27
  103. package/skills/prompt-enhancer/TEMPLATE.md +0 -4
  104. package/.skill-lock.json +0 -29
  105. package/AGENTS.md +0 -45
  106. package/commands/abel-implement.md +0 -157
  107. package/commands/abel-plan.md +0 -88
  108. package/commands/abel-research.md +0 -126
  109. package/lib/cli/logic.mjs +0 -213
  110. package/lib/cli.mjs +0 -3016
  111. package/skills/confidence-check/SKILL.md +0 -34
  112. package/skills/confidence-check/confidence.ts +0 -276
  113. package/skills/dev-browser/bun.lock +0 -460
  114. package/skills/dev-browser/scripts/start.ts +0 -280
  115. package/skills/dev-browser/src/client.ts +0 -474
  116. package/skills/dev-browser/src/entrypoint.ts +0 -157
  117. package/skills/dev-browser/src/index.ts +0 -289
  118. package/skills/dev-browser/src/relay.ts +0 -731
  119. package/skills/dev-browser/src/runtime.test.ts +0 -60
  120. package/skills/dev-browser/src/runtime.ts +0 -171
  121. package/skills/dev-browser/src/startup.test.ts +0 -95
  122. package/skills/dev-browser/src/startup.ts +0 -153
  123. package/skills/dev-browser/src/types.ts +0 -35
  124. package/skills/dev-browser/tsconfig.json +0 -36
  125. package/skills/dev-browser/vitest.config.ts +0 -12
  126. package/skills/prompt-enhancer/.env.example +0 -12
  127. package/skills/prompt-enhancer/ADVANCED.md +0 -103
  128. package/skills/prompt-enhancer/requirements.txt +0 -2
  129. package/skills/prompt-enhancer/scripts/_dotenv.py +0 -28
  130. package/skills/prompt-enhancer/scripts/enhance.py +0 -191
  131. package/skills/prompt-enhancer/scripts/prompt_enhancer_entry.py +0 -253
  132. package/skills/sequential-think/SKILL.md +0 -198
  133. package/skills/sequential-think/scripts/.env.example +0 -5
  134. package/skills/sequential-think/scripts/sequential_think_cli.py +0 -253
@@ -20,6 +20,13 @@ developer_instructions = """
20
20
  Your only job is to map. You produce a structured evidence report that the
21
21
  orchestrator or a worker agent uses to plan safe changes.
22
22
 
23
+ ## Development Context
24
+
25
+ Development context: work is currently in the development phase, and this is a development repository.
26
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
27
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
28
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
29
+
23
30
  ## Rules
24
31
 
25
32
  - Do not edit any file, ever.
@@ -25,6 +25,13 @@ safely, not like someone writing a design essay.
25
25
  Your job is to turn an implementation request into an execution-ready plan
26
26
  that minimizes ambiguity, unnecessary searching, and accidental scope growth.
27
27
 
28
+ ## Development Context
29
+
30
+ Development context: work is currently in the development phase, and this is a development repository.
31
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
32
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
33
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
34
+
28
35
  ## Priorities (in order)
29
36
 
30
37
  1. Scope clarity — what is actually being changed and what is not
@@ -20,6 +20,13 @@ developer_instructions = """
20
20
  Review code like an owner who will be on-call for what ships.
21
21
  Your job is to find real problems, not to demonstrate thoroughness.
22
22
 
23
+ ## Development Context
24
+
25
+ Development context: work is currently in the development phase, and this is a development repository.
26
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
27
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
28
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
29
+
23
30
 
24
31
  ## Priorities (in order)
25
32
 
@@ -18,6 +18,13 @@ developer_instructions = """
18
18
  You are a local implementation sub-agent. Execute bounded tasks with
19
19
  precision and minimal footprint. You are not alone in the codebase.
20
20
 
21
+ ## Development Context
22
+
23
+ Development context: work is currently in the development phase, and this is a development repository.
24
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
25
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
26
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
27
+
21
28
  ## Boundaries
22
29
 
23
30
  - Work only within the file set and module boundary authorized by the
@@ -12,10 +12,17 @@ developer_instructions = """
12
12
  Act as the default orchestrator for specialized subagents.
13
13
 
14
14
  This is a fallback orchestration policy, not the primary workflow definition.
15
- If an active custom command or workflow prompt is present (for example `/oc:*`),
15
+ If an active custom command or workflow prompt is present (for example `/abel-*`),
16
16
  its phase rules, guardrails, write scope, tool requirements, and stop/go gates
17
17
  take precedence over the default routing below.
18
18
 
19
+ ## Development Context
20
+
21
+ Development context: work is currently in the development phase, and this is a development repository.
22
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
23
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
24
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
25
+
19
26
  ## Global Precedence
20
27
 
21
28
  - Active workflow or command instructions override default orchestration
@@ -42,8 +49,8 @@ take precedence over the default routing below.
42
49
  - During research or discovery phases, do not dispatch implementation workers.
43
50
  - During planning phases, do not generate or apply code changes.
44
51
  - During implementation or diagnose phases, respect command-specific
45
- requirements such as TDD, confidence gates, verification order, and patch or
46
- report format.
52
+ requirements such as TDD, root-cause verification, verification order, and
53
+ patch or report format.
47
54
  - Respect command-specific write boundaries and required tools.
48
55
  - If the active workflow requires explicit user confirmation before advancing
49
56
  to the next phase, do not advance automatically.
@@ -55,6 +62,7 @@ take precedence over the default routing below.
55
62
  - Prefer parallel subagents only when they do not violate workflow ordering or
56
63
  gates.
57
64
  - Assign concrete ownership with explicit scope and disjoint write sets.
65
+ - Copy this development context into every subagent task.
58
66
  - Do not duplicate work across agents. Avoid overlapping exploration,
59
67
  planning, implementation, or review tasks.
60
68
  - Do not hand off blocked or underspecified work without enough context for
@@ -0,0 +1,50 @@
1
+ # Configuration
2
+
3
+ ## Language
4
+
5
+ - Tool/model interactions: **English**
6
+ - User-facing output: **Chinese**
7
+
8
+ ## Code Style
9
+
10
+ - Concise, efficient, no redundancy
11
+ - Minimal comments/docs (only when necessary)
12
+ - Targeted changes only; never touch unrelated functionality
13
+
14
+ ## Development Context
15
+
16
+ Development context: work is currently in the development phase, and this is a development repository.
17
+ Do not retain runtime user state in the repository or shipped artifacts, and do not preserve compatibility layers for unreleased behavior.
18
+ Prefer deleting obsolete code paths; keep code and prompts concise and avoid over-engineering.
19
+ This context does not by itself authorize destructive changes to user files or credentials outside the repository.
20
+
21
+ ## Context Rules
22
+
23
+ - Use local codebase retrieval with `rg`, `rg --files`, `git grep`, and direct file reads.
24
+ - Rely only on project code plus `grok/context7` results
25
+ - If information is insufficient or uncertain, state it explicitly
26
+
27
+ ## Workflow
28
+
29
+ ```
30
+ /abel-init → /abel-design → /abel-implement(TDD)
31
+ ↘ /abel-diagnose (bug fix)
32
+ ```
33
+
34
+ ## Universal Constraints
35
+
36
+ 1. Use `unified diff patch` format for proposed/applied changes
37
+ 2. Before applying changes, state assumptions and unknowns explicitly; stop and ask the user on any critical unknown
38
+
39
+ ## Stage Skill Matrix
40
+
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
+
48
+ Legend: ✅ Primary, ○ Optional, ❌ Forbidden
49
+
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,7 +12,7 @@ argument-hint: <problem-description>
12
12
  **Guardrails**
13
13
  - Root cause first; never fix symptoms only
14
14
  - Verify root cause hypothesis with evidence before fix
15
- - Confidence gate: ≥90% before applying fixes
15
+ - Only fixes with evidence-verified root cause may be applied
16
16
  - Every fix must include a regression test
17
17
  - Keep changes minimal and scoped
18
18
  - If verification fails, rollback and iterate
@@ -32,9 +32,9 @@ argument-hint: <problem-description>
32
32
  **Steps**
33
33
  1. Parse input, infer scope, and split into issue list (single or multiple).
34
34
  2. For each issue in parallel: collect logs/traces and locate code via the configured codebase retrieval policy.
35
- 3. For each issue in parallel: perform root cause analysis; use `/sequential-think` for multi-component chains.
35
+ 3. For each issue in parallel: perform root cause analysis; for multi-component chains, decompose the failure chain step by step with evidence.
36
36
  4. Build dependency/conflict graph across issues and compute safe fix order.
37
- 5. Run `/confidence-check` per issue; only issues with score ≥90% can move to fix generation.
37
+ 5. Verify each issue's root cause against collected evidence; only issues with a verified root cause can move to fix generation.
38
38
  6. Spawn one subagent per READY issue to generate `unified diff patch` and regression test with minimal scoped context.
39
39
  7. Main agent reviews/merges subagent outputs by dependency order and outputs one batch report with all issue statuses and patches.
40
40
  8. Apply merged patches strictly sequentially by dependency order.
@@ -42,13 +42,13 @@ argument-hint: <problem-description>
42
42
 
43
43
  **Batch Output**
44
44
  ```text
45
- ## /oc:diagnose Batch Report
45
+ ## /abel-diagnose Batch Report
46
46
 
47
47
  ### Batch Summary
48
48
  Total: {n} | ReadyToFix: {n_ready} | Blocked: {n_blocked}
49
49
 
50
50
  ### Issue Results
51
- - [{id}] Classification: {category}/{severity} | Root Cause: {summary} | Confidence: {score} | Subagent: {agent_id|none} | Status: {READY|BLOCKED}
51
+ - [{id}] Classification: {category}/{severity} | Root Cause: {summary} | Verified: {yes|no} | Subagent: {agent_id|none} | Status: {READY|BLOCKED}
52
52
 
53
53
  ### Patch Queue (dependency order)
54
54
  1. [{id}] [subagent:{agent_id}] {file_list}
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: abel-implement
3
+ description: Implement approved changes with mandatory TDD.
4
+ category: abel
5
+ tags: [abel, implementation, TDD]
6
+ argument-hint: [change_name]
7
+ ---
8
+
9
+ <!-- ABEL:START -->
10
+ **Arguments**
11
+ - Requested: `<change_name>`
12
+
13
+ **Guardrails**
14
+
15
+ - Keep changes tightly scoped to the requested outcome; enforce side-effect review before applying any modification.
16
+ - Minimize documentation—avoid unnecessary comments; prefer self-explanatory code.
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.
18
+
19
+ **TDD Guardrails (mandatory)**
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.
25
+
26
+ **Skill Integration**: See `Stage Skill Matrix` (Implement column)
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
+
40
+ **Tool Routing**:
41
+ - **TDD Cycle**: Autonomous refactoring
42
+ - **Final Review** (after all tasks):
43
+ - Backend refactor (subagents)
44
+ - Frontend refactor (subagents)
45
+ - **E2E tasks** → `/dev-browser`
46
+
47
+ After preflight, detect the project's verification tooling and work through the tracked tasks sequentially.
48
+
49
+ **TDD Cycle (per task)**
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
+
63
+ ```
64
+ ┌─────────────────────────────────────────────────────────┐
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}│
69
+ │ │ Context: {code_context} │
70
+ │ │ Output: unified diff patch │
71
+ │ │ FORBIDDEN: implementation code" │
72
+ │ ├─ Apply verification code (after review) │
73
+ │ ├─ Run Red command → MUST FAIL for expected reason │
74
+ │ └─ If it passes or fails differently → STOP │
75
+ ├─────────────────────────────────────────────────────────┤
76
+ │ Step 2: 🟢 Green Phase - Minimal Implementation │
77
+ │ ├─ Generate minimal implementation │
78
+ │ │ PROMPT: "Generate minimal code for verification: │
79
+ │ │ Verification: {verification_context} │
80
+ │ │ Context: {code_context} │
81
+ │ │ Output: unified diff patch │
82
+ │ │ FORBIDDEN: over-engineering" │
83
+ │ ├─ Apply implementation (after review & rewrite) │
84
+ │ ├─ Run Red command → MUST PASS │
85
+ │ └─ If fails → analyze error, fix, retry │
86
+ ├─────────────────────────────────────────────────────────┤
87
+ │ Step 3: 🔵 Refactor Phase │
88
+ │ ├─ Analyzes code quality │
89
+ │ ├─ Apply standard refactoring techniques: │
90
+ │ │ ├─ Eliminate code duplication │
91
+ │ │ ├─ Improve naming and structure │
92
+ │ │ ├─ Enhance readability │
93
+ │ │ └─ Simplify logic where possible │
94
+ │ ├─ Apply refactoring changes │
95
+ │ ├─ Run affected-suite command → MUST STILL PASS │
96
+ │ └─ If fails → rollback refactoring │
97
+ └─────────────────────────────────────────────────────────┘
98
+ ```
99
+
100
+ Before applying any change, perform mandatory side-effect review.
101
+
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.
103
+
104
+ **Final Review & Refactor** (after all tasks complete)
105
+
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.
108
+
109
+ 3. Execute global code review via subagents:
110
+
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`.
118
+
119
+ **TDD Output Format**
120
+
121
+ ```
122
+ ## /abel-implement (TDD Mode)
123
+
124
+ ### Task 1/N: {task_description}
125
+
126
+ 🔴 Red Phase
127
+ ├─ Type: {verification_type}
128
+ ├─ Generated: {verification_files_or_none}
129
+ ├─ Run: {red_command}
130
+ └─ Result: failed for {expected_failure_reason} ✓
131
+
132
+ 🟢 Green Phase
133
+ ├─ Generated: {implementation_files}
134
+ ├─ Run: {red_command}
135
+ └─ Result: {green_expected_behavior} ✓
136
+
137
+ 🔵 Refactor Phase (Agent autonomous)
138
+ ├─ Optimized: {description}
139
+ ├─ Run: {affected_suite_command}
140
+ └─ Result: target verification green ✓
141
+
142
+ ✓ Task complete → Next task
143
+
144
+ ---
145
+
146
+ ### All Tasks Complete
147
+
148
+ 🔍 Final Review & Refactor
149
+
150
+ Backend Review
151
+ ├─ Files: {backend_files}
152
+ ├─ Status: Running in background...
153
+ └─ Task ID: {task_id}
154
+
155
+ Frontend Review
156
+ ├─ Files: {frontend_files}
157
+ ├─ Status: Running in background...
158
+ └─ Task ID: {task_id}
159
+
160
+ [Waiting for completion...]
161
+
162
+ ✓ Reviews complete
163
+ ├─ Applied: {refactoring_summary}
164
+ ├─ Target tests: green ✓
165
+ ├─ Full suite: no failures beyond baseline ✓
166
+ └─ Ready for user-authorized archive
167
+
168
+ ✓ Implementation complete
169
+ ```
170
+ <!-- ABEL:END -->
@@ -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:
21
- - Skills: `/dev-browser` `/sequential-think` `/context7-auto-research` `/grok-search` `/confidence-check`
22
- 7. Output summary with ✓/✗:
19
+ 5. Verify required skills:
20
+ - Skills: `/dev-browser` `/context7-auto-research` `/grok-search`
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 -->
@@ -14,5 +14,3 @@ skills/dev-browser/.cache/
14
14
  .claude/
15
15
  .codex/
16
16
  *pycache*/
17
- openspec/
18
- package-lock.json