thoth-agents 0.3.3 → 0.3.4

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 (32) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +24 -14
  3. package/dist/{chunk-YUCGIJPP.js → chunk-6GQYMWWT.js} +1 -1
  4. package/dist/{chunk-XO74DXBZ.js → chunk-F2K4CS5J.js} +32 -23
  5. package/dist/{chunk-UQOCEMU3.js → chunk-W5GCMYA3.js} +59 -20
  6. package/dist/cli/index.js +3 -3
  7. package/dist/cli/skills.d.ts +2 -0
  8. package/dist/cli/tui/index.js +2 -2
  9. package/dist/harness/core/agent-pack.d.ts +3 -3
  10. package/dist/harness/core/sdd.d.ts +30 -23
  11. package/dist/index.js +2 -2
  12. package/package.json +1 -1
  13. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +2 -2
  14. package/plugin/.claude-plugin/plugin.json +1 -1
  15. package/plugin/.codex-plugin/plugin.json +1 -1
  16. package/plugin/agents/oracle.md +6 -6
  17. package/plugin/agents/orchestrator.md +8 -7
  18. package/plugin/skills/plan-reviewer/SKILL.md +107 -0
  19. package/plugin/skills/plan-reviewer/templates/plan-review.md +65 -0
  20. package/plugin/skills/thoth-constitution/templates/constitution.md +2 -2
  21. package/plugin/skills/thoth-init/SKILL.md +1 -1
  22. package/plugin/skills/thoth-init/scripts/init.mjs +1 -0
  23. package/plugin/skills/thoth-sdd/SKILL.md +21 -15
  24. package/skills/README.md +4 -2
  25. package/skills/plan-reviewer/SKILL.md +107 -0
  26. package/skills/plan-reviewer/templates/plan-review.md +65 -0
  27. package/skills/thoth-constitution/templates/constitution.md +2 -2
  28. package/skills/thoth-init/SKILL.md +1 -1
  29. package/skills/thoth-init/scripts/init.mjs +1 -0
  30. package/skills/thoth-sdd/SKILL.md +21 -15
  31. package/plugin/skills/thoth-sdd/references/phases/analyze.md +0 -21
  32. package/skills/thoth-sdd/references/phases/analyze.md +0 -21
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "thoth-agents",
11
11
  "description": "Adaptive root orchestration, six specialist subagents, and a runtime-autonomous Spec Kit-compatible SDD bundle.",
12
- "version": "0.3.3",
12
+ "version": "0.3.4",
13
13
  "author": {
14
14
  "name": "thoth-agents maintainers"
15
15
  },
package/README.md CHANGED
@@ -23,7 +23,10 @@ parallelism creates a net gain.
23
23
  The plugin ships the seven-role contract and thoth-owned SDD
24
24
  contracts that combine Spec Kit-grade traceability with OpenSpec-style durable
25
25
  deltas. Accelerated planning fast-forwards without routine pauses; structural
26
- `ready`/`closeout` gates and independent oracle review retain rigor. During
26
+ `ready`/`closeout` gates and independent oracle review retain rigor. Root
27
+ recommends Direct, Accelerated, or Full and the user selects the route. After
28
+ `ready`, artifact-backed routes offer optional Oracle plan review or proceeding
29
+ without it; every final verification remains mandatory. During
27
30
  installation, the CLI obtains four mandatory external skills
28
31
  from their canonical repositories with `npx skills add` and invokes the official
29
32
  provider-owned thoth-mem setup for the selected harness. During an SDD, agents
@@ -58,10 +61,12 @@ Restart OpenCode and initialize the current repository:
58
61
  /thoth-init
59
62
  ```
60
63
 
61
- This copies the four thoth-owned workflow skills into `.agents/skills/` and
64
+ This copies the five thoth-owned workflow skills into `.agents/skills/` and
62
65
  creates missing `openspec/` governance files. The external skills are already in
63
- OpenCode's global skill root and thoth-mem has completed its own provider setup
64
- from the CLI step. Existing project-owned files are preserved.
66
+ one of the OpenCode global discovery roots managed here,
67
+ `~/.config/opencode/skills/` or `~/.agents/skills/`, and thoth-mem has completed
68
+ its own provider setup from the CLI step. Existing project-owned files are
69
+ preserved.
65
70
 
66
71
  ### Codex
67
72
 
@@ -113,7 +118,7 @@ Restart Claude Code or run `/reload-plugins`, then initialize the repository:
113
118
  /thoth-agents:thoth-init
114
119
  ```
115
120
 
116
- Claude discovers the packaged orchestrator, six namespaced subagents, and four
121
+ Claude discovers the packaged orchestrator, six namespaced subagents, and five
117
122
  thoth-owned skills from the plugin. The CLI installs the external skills into
118
123
  Claude's global skill root and requires thoth-mem's own setup result to be
119
124
  complete. Init creates only the missing project governance files; it never edits
@@ -141,8 +146,8 @@ correctness-critical work.
141
146
  <br>
142
147
  <i>Adaptive root and final synthesis.</i>
143
148
  <br><br>
144
- Keeps task ownership and synthesis, chooses the route, coordinates SDD
145
- artifacts, and implements bounded work directly.
149
+ Keeps task ownership and synthesis, recommends a route for the user's
150
+ selection, coordinates SDD artifacts, and implements bounded work directly.
146
151
  <br><br>
147
152
  <b>Mode:</b> <code>adaptive-root</code>
148
153
  </td>
@@ -195,7 +200,7 @@ correctness-critical work.
195
200
  <br>
196
201
  <i>Independent analysis and verification.</i>
197
202
  <br><br>
198
- Challenges plans, owns Full analysis, and independently verifies every
203
+ Reviews plans when the user requests it and independently verifies every
199
204
  implementation.
200
205
  <br><br>
201
206
  <b>Mode:</b> <code>read-only</code>
@@ -267,29 +272,33 @@ Accelerated work.
267
272
  ```text
268
273
  Direct: implement -> verify
269
274
  Accelerated: specify -> plan -> tasks -> implement -> verify -> archive
270
- Full: explore -> specify -> plan -> tasks -> analyze -> implement -> verify -> archive
275
+ Full: explore -> specify -> plan -> tasks -> implement -> verify -> archive
271
276
  ```
272
277
 
273
278
  | Route | Use when | Artifacts |
274
279
  | --- | --- | --- |
275
280
  | Direct | Clear, bounded, low-risk work, including multi-file documentation/mechanical edits | None; oracle returns its verdict in-session. |
276
281
  | Accelerated | Generic SDD request, partial clarity, moderate risk, multi-surface behavior, or architecture | Canonical artifacts with fast-forward specification/planning/tasks. |
277
- | Full | Material uncertainty, cross-cutting behavior/architecture, high contract risk, or high failure cost | Accelerated artifacts plus exploration and independent pre-implementation analysis. |
282
+ | Full | Material uncertainty, cross-cutting behavior/architecture, high contract risk, or high failure cost | Accelerated artifacts plus exploration and separate planning gates. |
278
283
 
279
284
  The root loads only the current phase contract from the bundled `thoth-sdd`
280
285
  skill. It owns specification, clarification, planning, requirements checklists,
281
286
  task decomposition, convergence, report persistence, and archive. `explorer`
282
- owns Full discovery; `oracle` always owns `analyze` and `verify`.
287
+ owns Full discovery; `oracle` owns user-selected plan review and every `verify`.
283
288
 
284
- An explicitly named route wins. A generic request to use SDD sets Accelerated as
285
- the minimum. Accelerated writes `spec.md -> plan.md -> tasks.md` in one
286
- uninterrupted root pass and does not pause for routine approval between phases.
289
+ An explicitly named route is the user's selection and wins. Otherwise root
290
+ recommends one of all three routes and waits for the user's choice. A generic
291
+ request to use SDD sets Accelerated as the minimum recommendation. Accelerated
292
+ writes `spec.md -> plan.md -> tasks.md` in one uninterrupted root pass and does
293
+ not pause for routine approval between those planning phases.
287
294
 
288
295
  Conditional phases remain deliberately narrow:
289
296
 
290
297
  - `clarify` runs only for a material ambiguity and updates canonical `spec.md`;
291
298
  - `checklist` audits high-risk requirement quality with `CHK###` taxonomy and a
292
299
  separate revalidation pass;
300
+ - `plan-review` is offered after `ready` on Accelerated and Full; the user chooses
301
+ `Review plan with Oracle (Recommended)` or `Proceed without review`;
293
302
  - `converge` appends tasks only after failed artifact-backed verification; and
294
303
  - `architectural-grilling` runs before specification only when explicitly
295
304
  requested or a material human-owned decision remains unresolved.
@@ -314,6 +323,7 @@ Every harness package includes the workflow contracts owned by thoth-agents:
314
323
  | `thoth-sdd` | Route rules, phase contracts, templates, and structural validator. |
315
324
  | `thoth-constitution` | Explicit governance SemVer lifecycle; routine plans only read principles. |
316
325
  | `thoth-archive` | Passing closeout, transactional durable-spec sync, audit report, and dated move. |
326
+ | `plan-reviewer` | Optional read-only Oracle plan review with exact `[OKAY]`/`[REJECT]` results and freshness evidence. |
317
327
 
318
328
  The installer obtains these mandatory external skills from their single source
319
329
  of truth:
@@ -14,7 +14,7 @@ import {
14
14
  getStepBudgetPromptSection,
15
15
  loadAgentPrompt,
16
16
  renderRolePrompt
17
- } from "./chunk-XO74DXBZ.js";
17
+ } from "./chunk-F2K4CS5J.js";
18
18
 
19
19
  // src/agents/deep.ts
20
20
  var DEEP_PROMPT = renderRolePrompt(
@@ -797,7 +797,7 @@ var AGENT_ROLES = [
797
797
  "keeps requirements, decisions, and final synthesis in the root thread"
798
798
  ],
799
799
  verification: [
800
- "delegates analyze and every verify phase to oracle, including Direct and Accelerated routes",
800
+ "delegates selected plan-review and every verify phase to oracle; plan review stays optional and final verification stays mandatory",
801
801
  "consolidates summarized evidence returned by child agents"
802
802
  ]
803
803
  },
@@ -832,8 +832,8 @@ var AGENT_ROLES = [
832
832
  mode: "read-only",
833
833
  dispatch: "synchronous-task-only",
834
834
  canMutateWorkspace: false,
835
- scope: "diagnosis, architecture, analysis, and independent verification",
836
- responsibility: "Independently analyze plans and perform every implementation verification, exposing correctness risks and judging whether results satisfy their contracts.",
835
+ scope: "diagnosis, architecture, optional plan review, and independent verification",
836
+ responsibility: "Independently review plans when the user requests it and perform every implementation verification, exposing correctness risks and judging whether results satisfy their contracts.",
837
837
  toolGovernance: [
838
838
  "performs read-only analysis and independent review and is never the implementer of the work it judges",
839
839
  "does not implement, persist artifacts, or delegate further"
@@ -1017,16 +1017,17 @@ var SDD_PHASES = [
1017
1017
  reason: "Produce dependency-ordered implementation slices with verification."
1018
1018
  },
1019
1019
  {
1020
- id: "analyze",
1020
+ id: "plan-review",
1021
1021
  order: 6,
1022
- availableFor: ["full"],
1023
- requiredFor: ["full"],
1024
- activation: "required",
1025
- prerequisites: ["specify", "plan", "tasks"],
1026
- producesArtifact: false,
1022
+ availableFor: ["accelerated", "full"],
1023
+ requiredFor: [],
1024
+ activation: "conditional",
1025
+ prerequisites: ["tasks"],
1026
+ producesArtifact: true,
1027
1027
  defaultAgentRole: "oracle",
1028
1028
  eligibleAgentRoles: ["oracle"],
1029
- reason: "Independently check cross-artifact consistency before high-risk implementation."
1029
+ reason: "Offer independent blocker-only plan review when the user selects it after planning passes ready.",
1030
+ condition: "Activate only after ready when the user chooses Review plan with Oracle (Recommended)."
1030
1031
  },
1031
1032
  {
1032
1033
  id: "implement",
@@ -1034,7 +1035,7 @@ var SDD_PHASES = [
1034
1035
  availableFor: ["direct", "accelerated", "full"],
1035
1036
  requiredFor: ["direct", "accelerated", "full"],
1036
1037
  activation: "required",
1037
- prerequisites: ["tasks", "analyze"],
1038
+ prerequisites: ["tasks"],
1038
1039
  producesArtifact: false,
1039
1040
  defaultAgentRole: "orchestrator",
1040
1041
  eligibleAgentRoles: ["orchestrator", "designer", "quick", "deep"],
@@ -1135,6 +1136,13 @@ var SDD_ARTIFACT_GRAPH = [
1135
1136
  consumes: ["spec", "plan"],
1136
1137
  requiredFor: []
1137
1138
  },
1139
+ {
1140
+ id: "plan-review",
1141
+ path: "plan-review.md",
1142
+ producedBy: "plan-review",
1143
+ consumes: ["spec", "plan", "tasks"],
1144
+ requiredFor: []
1145
+ },
1138
1146
  {
1139
1147
  id: "verify-report",
1140
1148
  path: "verify-report.md",
@@ -1164,7 +1172,7 @@ var SDD_ROUTE_EXECUTION_POLICIES = [
1164
1172
  planningMode: "fast-forward",
1165
1173
  validationGates: ["specify", "ready", "closeout"],
1166
1174
  optionalArtifactsByDefault: false,
1167
- routineUserPauses: false,
1175
+ routineUserPauses: true,
1168
1176
  artifactRevisionPolicy: "revalidate-affected-downstream"
1169
1177
  },
1170
1178
  {
@@ -1172,7 +1180,7 @@ var SDD_ROUTE_EXECUTION_POLICIES = [
1172
1180
  planningMode: "gated",
1173
1181
  validationGates: ["specify", "plan", "tasks", "ready", "closeout"],
1174
1182
  optionalArtifactsByDefault: false,
1175
- routineUserPauses: false,
1183
+ routineUserPauses: true,
1176
1184
  artifactRevisionPolicy: "revalidate-affected-downstream"
1177
1185
  }
1178
1186
  ];
@@ -1184,25 +1192,25 @@ var SDD_WORKFLOW_CONTRACT = {
1184
1192
  validationGates: [...policy.validationGates]
1185
1193
  })),
1186
1194
  routingRules: [
1187
- "An explicitly requested direct, accelerated, or full route wins; a generic SDD request sets accelerated as the minimum route.",
1195
+ "The root recommends direct, accelerated, or full from risk evidence, but the user selects the route; an explicitly requested route already counts as selection.",
1188
1196
  "Direct work is the default for clear, bounded, low-risk changes; documentation and mechanical work may remain direct across multiple files.",
1189
1197
  "Accelerated SDD is used for multi-surface behavior, architecture, partial clarity, moderate risk, or broad non-behavioral coordination.",
1190
- "Accelerated planning fast-forwards specify, plan, and tasks in one uninterrupted root pass without routine user pauses.",
1198
+ "Accelerated planning fast-forwards specify, plan, and tasks without pauses between those artifacts, then offers the user optional oracle plan review after ready.",
1191
1199
  "Full SDD is used for unresolved scope, cross-cutting behavior or architecture, high contract risk, or high failure cost.",
1192
1200
  "Use architectural-grilling before specification only when the user explicitly requests it or material product or architecture decisions remain human-owned and unresolved; never require it merely because the route is Full.",
1193
- "User input is requested only when a material unresolved decision would change the result."
1201
+ "Route selection and the post-ready plan-review choice are explicit user decisions; other input is requested only when a material unresolved decision changes the result."
1194
1202
  ],
1195
1203
  artifactRules: [
1196
1204
  "Spec Kit artifact semantics are preserved inside the governed openspec store.",
1197
1205
  "Accelerated and full routes require spec.md, plan.md, tasks.md, verify-report.md, and archive-report.md.",
1198
- "Research, data model, contracts, quickstart, and requirements checklist are created only when useful.",
1206
+ "Research, data model, contracts, quickstart, requirements checklist, and plan-review.md are optional and created only when useful or selected.",
1199
1207
  "The adaptive root writes coordination artifacts after loading the matching bundled phase contract; implementation ownership stays with the root or one writer role.",
1200
1208
  "After oracle PASS, archive transactionally synchronizes only explicitly declared durable ADDED, MODIFIED, REMOVED, and RENAMED requirement deltas into openspec/specs; INTERNAL requirements and undeclared prose never update permanent specifications.",
1201
1209
  "Archive stages and backs up writes so handled failures roll back within the active process; forced process or operating-system termination is not crash-atomic."
1202
1210
  ],
1203
1211
  verificationRules: [
1204
1212
  "Every route delegates focused verification to read-only oracle; the implementation writer never verifies its own work.",
1205
- "Full SDD delegates independent cross-artifact analysis to oracle before implementation.",
1213
+ "Accelerated and Full offer read-only oracle plan review after ready; it runs only when the user selects it and never replaces final verification.",
1206
1214
  "Accelerated and full verification persists verify-report.md with a pass or fail verdict and requirement compliance matrix.",
1207
1215
  "An artifact-backed fail verdict routes through append-only convergence, implementation, and verification again; direct work returns straight to implementation.",
1208
1216
  "A pass verdict is required before accelerated or full work can archive."
@@ -1383,7 +1391,7 @@ ${renderRoleDirectory()}
1383
1391
  </routing>
1384
1392
 
1385
1393
  <sdd-routing>
1386
- - An explicitly requested route wins; a generic SDD request sets Accelerated as the minimum unless Full risk applies.
1394
+ - An explicitly requested route wins: no duplicate route-selection prompt. Otherwise assess and recommend one route, ask with \`{{userQuestionTool}}\`, and wait for the user to select Direct, Accelerated, or Full. The recommendation is not the decision. The user's selected route wins; explain risk without overriding it. A generic SDD request sets Accelerated as the minimum unless Full risk applies.
1387
1395
  - Direct: clear, bounded, low-risk work. ${renderSddRoute("direct")}.
1388
1396
  - Documentation or mechanical work may remain Direct across multiple files when it is clear and low risk.
1389
1397
  - Accelerated SDD: multi-surface behavior, architecture, partial clarity, or moderate risk. ${renderSddRoute("accelerated")}.
@@ -1391,12 +1399,13 @@ ${renderRoleDirectory()}
1391
1399
  - Its thoth-sdd validator gates are ${accelerated.validationGates.join(" -> ")}; optional artifacts are off by default.
1392
1400
  - Full SDD: uncertain scope, cross-cutting behavior or architecture, high contract risk, or high failure cost. ${renderSddRoute("full")}.
1393
1401
  - Full gates are ${full.validationGates.join(" -> ")}; checklist remains conditional.
1402
+ - After \`ready\` on Accelerated/Full, ask with \`{{userQuestionTool}}\`: \`Review plan with Oracle (Recommended)\` or \`Proceed without review\`. Skipping plan review means no pre-implementation Oracle review. If selected, load \`plan-reviewer\`, delegate read-only review, and accept only \`[OKAY]\` or \`[REJECT]\` with at most 3 actionable blockers. After \`[OKAY]\`, summarize and ask whether to implement or stop. Plan review never replaces mandatory final Oracle verify.
1394
1403
  - Happy path: verify -> archive. Artifact-backed failure loop: verify fail -> converge -> implement -> verify. Direct failure loop: verify fail -> implement -> verify.
1395
- - Conditional phases: clarify only for material ambiguity; checklist only when requirement risk justifies it; converge only when verification finds actionable defects.
1404
+ - Conditional phases: clarify for material ambiguity; checklist for requirement risk; plan-review by user choice; converge for verification defects.
1396
1405
  - When implementation discoveries refine the same intent, update the canonical artifact and revalidate only affected downstream artifacts. Split a new change when the intent changes.
1397
1406
  - Load the bundled \`thoth-sdd\` skill only after selecting Accelerated or Full, then read only the reference for the current phase.
1398
1407
  - Root owns specify, clarify, plan, checklist, tasks, converge, and archive coordination; these phases are not delegated merely to change prompts.
1399
- - Delegate analyze and every verify phase to ${roleTemplate("oracle")}, including Direct and Accelerated work. The implementation writer must never review itself.
1408
+ - Delegate each user-selected plan review and every verify phase to ${roleTemplate("oracle")}. The implementation writer must never review itself.
1400
1409
  </sdd-routing>
1401
1410
 
1402
1411
  <external-skills>
@@ -1425,7 +1434,7 @@ ${renderRoleDirectory()}
1425
1434
 
1426
1435
  <execution>
1427
1436
  - Validate contracts and tests first; use test-first work for behavior. Root or one writer implements; do not delegate merely because an agent exists.
1428
- - ${roleTemplate("oracle")} always provides independent verification and also owns Full SDD analysis. Root and implementation writers never self-approve.
1437
+ - ${roleTemplate("oracle")} owns selected plan review and every verification; root and writers never self-approve.
1429
1438
  - Preserve unrelated working-tree changes. Never instruct an agent to discard them.
1430
1439
  - Report changed files, evidence, risks, and capability gaps truthfully.
1431
1440
  </execution>
@@ -1452,7 +1461,7 @@ var ROLE_SPECIFIC_RULES = {
1452
1461
  oracle: [
1453
1462
  "Separate observations, risks, and recommendations.",
1454
1463
  "Review against stated requirements and contracts; do not invent implementation scope.",
1455
- "For analyze or verify, load the matching bundled thoth-sdd reference and remain read-only.",
1464
+ "For plan-review, load the bundled plan-reviewer skill; for verify, load the matching bundled thoth-sdd reference and remain read-only.",
1456
1465
  "Reject self-review: the implementing root or writer cannot substitute for independent oracle judgment."
1457
1466
  ],
1458
1467
  designer: [
@@ -31,7 +31,7 @@ import {
31
31
  updateOpenCodeMainConfig,
32
32
  writeConfig,
33
33
  writeLiteConfig
34
- } from "./chunk-XO74DXBZ.js";
34
+ } from "./chunk-F2K4CS5J.js";
35
35
 
36
36
  // src/cli/codex-paths.ts
37
37
  import { homedir } from "os";
@@ -2496,10 +2496,13 @@ var SKILLS_CLI_AGENT = {
2496
2496
  codex: "codex",
2497
2497
  claude: "claude-code"
2498
2498
  };
2499
- var GLOBAL_SKILL_ROOT = {
2500
- opencode: [".config", "opencode", "skills"],
2501
- codex: [".codex", "skills"],
2502
- claude: [".claude", "skills"]
2499
+ var GLOBAL_SKILL_ROOTS = {
2500
+ opencode: [
2501
+ [".config", "opencode", "skills"],
2502
+ [".agents", "skills"]
2503
+ ],
2504
+ codex: [[".agents", "skills"]],
2505
+ claude: [[".claude", "skills"]]
2503
2506
  };
2504
2507
  var REQUIRED_SKILLS = [
2505
2508
  {
@@ -2527,16 +2530,22 @@ var REQUIRED_SKILLS = [
2527
2530
  description: "Conditional product and architecture decision interview"
2528
2531
  }
2529
2532
  ];
2530
- function getRequiredSkillPath(skill, harness, homeDir = homedir2()) {
2531
- return join3(
2532
- homeDir,
2533
- ...GLOBAL_SKILL_ROOT[harness],
2534
- skill.skillName,
2535
- "SKILL.md"
2533
+ function getRequiredSkillPaths(skill, harness, homeDir = homedir2()) {
2534
+ return GLOBAL_SKILL_ROOTS[harness].map(
2535
+ (root) => join3(homeDir, ...root, skill.skillName, "SKILL.md")
2536
2536
  );
2537
2537
  }
2538
- function isRequiredSkillInstalled(skill, harness, options = {}) {
2539
- return existsSync6(getRequiredSkillPath(skill, harness, options.homeDir));
2538
+ function getRequiredSkillPath(skill, harness, homeDir = homedir2()) {
2539
+ const [primaryPath] = getRequiredSkillPaths(skill, harness, homeDir);
2540
+ if (!primaryPath) {
2541
+ throw new Error(`No global skill root is configured for ${harness}.`);
2542
+ }
2543
+ return primaryPath;
2544
+ }
2545
+ function getInstalledRequiredSkillPath(skill, harness, homeDir = homedir2()) {
2546
+ return getRequiredSkillPaths(skill, harness, homeDir).find(
2547
+ (path) => existsSync6(path)
2548
+ );
2540
2549
  }
2541
2550
  function getRequiredSkillInstallCommand(skill, harness, options = {}) {
2542
2551
  return getNpxCommand(
@@ -2557,8 +2566,18 @@ function getRequiredSkillInstallCommand(skill, harness, options = {}) {
2557
2566
  }
2558
2567
  function installRequiredSkill(skill, harness, options = {}) {
2559
2568
  const skillPath = getRequiredSkillPath(skill, harness, options.homeDir);
2560
- if (isRequiredSkillInstalled(skill, harness, options)) {
2561
- return { skill, harness, status: "already-installed", skillPath };
2569
+ const installedPath = getInstalledRequiredSkillPath(
2570
+ skill,
2571
+ harness,
2572
+ options.homeDir
2573
+ );
2574
+ if (installedPath) {
2575
+ return {
2576
+ skill,
2577
+ harness,
2578
+ status: "already-installed",
2579
+ skillPath: installedPath
2580
+ };
2562
2581
  }
2563
2582
  const { command, args } = getRequiredSkillInstallCommand(
2564
2583
  skill,
@@ -2568,10 +2587,25 @@ function installRequiredSkill(skill, harness, options = {}) {
2568
2587
  try {
2569
2588
  const result = spawnSync2(command, args, { stdio: "inherit" });
2570
2589
  if (result.status === 0) {
2571
- return { skill, harness, status: "installed", skillPath };
2590
+ return {
2591
+ skill,
2592
+ harness,
2593
+ status: "installed",
2594
+ skillPath: getInstalledRequiredSkillPath(skill, harness, options.homeDir) ?? skillPath
2595
+ };
2572
2596
  }
2573
- if (isRequiredSkillInstalled(skill, harness, options)) {
2574
- return { skill, harness, status: "already-installed", skillPath };
2597
+ const recoveredPath = getInstalledRequiredSkillPath(
2598
+ skill,
2599
+ harness,
2600
+ options.homeDir
2601
+ );
2602
+ if (recoveredPath) {
2603
+ return {
2604
+ skill,
2605
+ harness,
2606
+ status: "already-installed",
2607
+ skillPath: recoveredPath
2608
+ };
2575
2609
  }
2576
2610
  return { skill, harness, status: "failed", skillPath, error: result.error };
2577
2611
  } catch (error) {
@@ -4015,8 +4049,13 @@ function homeDirFromContext(context2) {
4015
4049
  function openCodeSkillTargets(context2) {
4016
4050
  const homeDir = homeDirFromContext(context2);
4017
4051
  const requiredTargets = REQUIRED_SKILLS.map((skill) => {
4018
- const path = getRequiredSkillPath(skill, "opencode", homeDir);
4019
- const installed = existsSync9(path);
4052
+ const installedPath = getInstalledRequiredSkillPath(
4053
+ skill,
4054
+ "opencode",
4055
+ homeDir
4056
+ );
4057
+ const path = installedPath ?? getRequiredSkillPath(skill, "opencode", homeDir);
4058
+ const installed = installedPath !== void 0;
4020
4059
  return {
4021
4060
  kind: "skill",
4022
4061
  path,
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  getOpenCodeVersion,
5
5
  isOpenCodeInstalled,
6
6
  opencodeAdapter
7
- } from "../chunk-YUCGIJPP.js";
7
+ } from "../chunk-6GQYMWWT.js";
8
8
  import {
9
9
  CODEX_ROLE_NAMES,
10
10
  REQUIRED_SKILLS,
@@ -43,7 +43,7 @@ import {
43
43
  installRequiredSkill,
44
44
  listOperationHarnesses,
45
45
  normalizeEffortSelection
46
- } from "../chunk-UQOCEMU3.js";
46
+ } from "../chunk-W5GCMYA3.js";
47
47
  import {
48
48
  ALL_AGENT_NAMES,
49
49
  detectCurrentConfig,
@@ -53,7 +53,7 @@ import {
53
53
  getExistingLiteConfigPath,
54
54
  updateOpenCodeMainConfig,
55
55
  writeLiteConfig
56
- } from "../chunk-XO74DXBZ.js";
56
+ } from "../chunk-F2K4CS5J.js";
57
57
 
58
58
  // src/cli/index.ts
59
59
  import { pathToFileURL } from "url";
@@ -19,7 +19,9 @@ interface InstallRequiredSkillOptions extends NpxCommandOptions {
19
19
  homeDir?: string;
20
20
  }
21
21
  export declare const REQUIRED_SKILLS: readonly RequiredSkill[];
22
+ export declare function getRequiredSkillPaths(skill: RequiredSkill, harness: SkillInstallHarness, homeDir?: string): string[];
22
23
  export declare function getRequiredSkillPath(skill: RequiredSkill, harness: SkillInstallHarness, homeDir?: string): string;
24
+ export declare function getInstalledRequiredSkillPath(skill: RequiredSkill, harness: SkillInstallHarness, homeDir?: string): string | undefined;
23
25
  export declare function isRequiredSkillInstalled(skill: RequiredSkill, harness: SkillInstallHarness, options?: InstallRequiredSkillOptions): boolean;
24
26
  export declare function getRequiredSkillInstallCommand(skill: RequiredSkill, harness: SkillInstallHarness, options?: NpxCommandOptions): NpxCommand;
25
27
  /** Install one mandatory skill into the selected harness's global skill root. */
@@ -2,8 +2,8 @@ import {
2
2
  defaultTuiOperations,
3
3
  effortChoicesForModel,
4
4
  listOperationHarnesses
5
- } from "../../chunk-UQOCEMU3.js";
6
- import "../../chunk-XO74DXBZ.js";
5
+ } from "../../chunk-W5GCMYA3.js";
6
+ import "../../chunk-F2K4CS5J.js";
7
7
 
8
8
  // src/cli/tui/index.tsx
9
9
  import { render } from "ink";
@@ -32,7 +32,7 @@ export declare const AGENT_ROLES: readonly [{
32
32
  readonly scope: "requirements, SDD coordination, routing, bounded direct work, decisions, and synthesis";
33
33
  readonly responsibility: "Keep the task coherent, own sequential specification, planning, task, convergence, and archive coordination, act directly when work is clear and bounded, and delegate only for net gain.";
34
34
  readonly toolGovernance: ["may inspect and edit bounded direct work, but every verification is delegated to oracle", "loads the matching thoth-sdd phase contract on demand instead of carrying every phase protocol in its prompt", "owns governed coordination writes under openspec/ and uses append-only tasks.md updates during convergence", "delegates independent or specialist work only when it produces a net gain", "keeps requirements, decisions, and final synthesis in the root thread"];
35
- readonly verification: ["delegates analyze and every verify phase to oracle, including Direct and Accelerated routes", "consolidates summarized evidence returned by child agents"];
35
+ readonly verification: ["delegates selected plan-review and every verify phase to oracle; plan review stays optional and final verification stays mandatory", "consolidates summarized evidence returned by child agents"];
36
36
  }, {
37
37
  readonly name: "explorer";
38
38
  readonly mode: "read-only";
@@ -56,8 +56,8 @@ export declare const AGENT_ROLES: readonly [{
56
56
  readonly mode: "read-only";
57
57
  readonly dispatch: "synchronous-task-only";
58
58
  readonly canMutateWorkspace: false;
59
- readonly scope: "diagnosis, architecture, analysis, and independent verification";
60
- readonly responsibility: "Independently analyze plans and perform every implementation verification, exposing correctness risks and judging whether results satisfy their contracts.";
59
+ readonly scope: "diagnosis, architecture, optional plan review, and independent verification";
60
+ readonly responsibility: "Independently review plans when the user requests it and perform every implementation verification, exposing correctness risks and judging whether results satisfy their contracts.";
61
61
  readonly toolGovernance: ["performs read-only analysis and independent review and is never the implementer of the work it judges", "does not implement, persist artifacts, or delegate further"];
62
62
  readonly verification: ["separates observations, risks, and recommendations"];
63
63
  }, {
@@ -22,7 +22,7 @@ export interface SddRoutingDecision {
22
22
  requiresUserInput: boolean;
23
23
  reasons: string[];
24
24
  }
25
- export type SddPhaseId = 'explore' | 'specify' | 'clarify' | 'plan' | 'checklist' | 'tasks' | 'analyze' | 'implement' | 'verify' | 'converge' | 'archive';
25
+ export type SddPhaseId = 'explore' | 'specify' | 'clarify' | 'plan' | 'checklist' | 'tasks' | 'plan-review' | 'implement' | 'verify' | 'converge' | 'archive';
26
26
  export type SddPhaseActivation = 'required' | 'conditional';
27
27
  export interface SddPhaseContract {
28
28
  id: SddPhaseId;
@@ -58,7 +58,7 @@ export interface SddPhaseDispatchInput {
58
58
  verification?: string[];
59
59
  memory: MemoryDispatchContract;
60
60
  }
61
- export type SddArtifactId = 'spec' | 'plan' | 'tasks' | 'requirements-checklist' | 'research' | 'data-model' | 'contracts' | 'quickstart' | 'verify-report' | 'archive-report';
61
+ export type SddArtifactId = 'spec' | 'plan' | 'tasks' | 'requirements-checklist' | 'research' | 'data-model' | 'contracts' | 'quickstart' | 'plan-review' | 'verify-report' | 'archive-report';
62
62
  export interface SddArtifactContract {
63
63
  id: SddArtifactId;
64
64
  path: string;
@@ -151,23 +151,24 @@ export declare const SDD_PHASES: readonly [{
151
151
  readonly eligibleAgentRoles: ["orchestrator"];
152
152
  readonly reason: "Produce dependency-ordered implementation slices with verification.";
153
153
  }, {
154
- readonly id: "analyze";
154
+ readonly id: "plan-review";
155
155
  readonly order: 6;
156
- readonly availableFor: ["full"];
157
- readonly requiredFor: ["full"];
158
- readonly activation: "required";
159
- readonly prerequisites: ["specify", "plan", "tasks"];
160
- readonly producesArtifact: false;
156
+ readonly availableFor: ["accelerated", "full"];
157
+ readonly requiredFor: [];
158
+ readonly activation: "conditional";
159
+ readonly prerequisites: ["tasks"];
160
+ readonly producesArtifact: true;
161
161
  readonly defaultAgentRole: "oracle";
162
162
  readonly eligibleAgentRoles: ["oracle"];
163
- readonly reason: "Independently check cross-artifact consistency before high-risk implementation.";
163
+ readonly reason: "Offer independent blocker-only plan review when the user selects it after planning passes ready.";
164
+ readonly condition: "Activate only after ready when the user chooses Review plan with Oracle (Recommended).";
164
165
  }, {
165
166
  readonly id: "implement";
166
167
  readonly order: 7;
167
168
  readonly availableFor: ["direct", "accelerated", "full"];
168
169
  readonly requiredFor: ["direct", "accelerated", "full"];
169
170
  readonly activation: "required";
170
- readonly prerequisites: ["tasks", "analyze"];
171
+ readonly prerequisites: ["tasks"];
171
172
  readonly producesArtifact: false;
172
173
  readonly defaultAgentRole: "orchestrator";
173
174
  readonly eligibleAgentRoles: ["orchestrator", "designer", "quick", "deep"];
@@ -255,6 +256,12 @@ export declare const SDD_ARTIFACT_GRAPH: readonly [{
255
256
  readonly producedBy: "plan";
256
257
  readonly consumes: ["spec", "plan"];
257
258
  readonly requiredFor: [];
259
+ }, {
260
+ readonly id: "plan-review";
261
+ readonly path: "plan-review.md";
262
+ readonly producedBy: "plan-review";
263
+ readonly consumes: ["spec", "plan", "tasks"];
264
+ readonly requiredFor: [];
258
265
  }, {
259
266
  readonly id: "verify-report";
260
267
  readonly path: "verify-report.md";
@@ -280,14 +287,14 @@ export declare const SDD_ROUTE_EXECUTION_POLICIES: readonly [{
280
287
  readonly planningMode: "fast-forward";
281
288
  readonly validationGates: ["specify", "ready", "closeout"];
282
289
  readonly optionalArtifactsByDefault: false;
283
- readonly routineUserPauses: false;
290
+ readonly routineUserPauses: true;
284
291
  readonly artifactRevisionPolicy: "revalidate-affected-downstream";
285
292
  }, {
286
293
  readonly route: "full";
287
294
  readonly planningMode: "gated";
288
295
  readonly validationGates: ["specify", "plan", "tasks", "ready", "closeout"];
289
296
  readonly optionalArtifactsByDefault: false;
290
- readonly routineUserPauses: false;
297
+ readonly routineUserPauses: true;
291
298
  readonly artifactRevisionPolicy: "revalidate-affected-downstream";
292
299
  }];
293
300
  export declare const SDD_PHASE_PROTOCOLS: readonly [{
@@ -349,17 +356,17 @@ export declare const SDD_PHASE_PROTOCOLS: readonly [{
349
356
  readonly outputSchema: ["tasks.md path", "requirement coverage", "dependency order"];
350
357
  readonly doneWhen: ["Every FR and buildable SC has executable task coverage and every task has a verification step."];
351
358
  readonly blockingConditions: ["A task requires an unresolved requirement, architecture choice, or hidden prerequisite."];
352
- readonly handoff: ["Pass spec.md, plan.md, tasks.md, dependencies, and verification commands to analyze or implement."];
353
- }, {
354
- readonly id: "analyze";
355
- readonly objective: "Perform read-only cross-artifact consistency and readiness analysis before full SDD implementation.";
356
- readonly requiredInputs: ["spec.md", "plan.md", "tasks.md", "Project constitution"];
357
- readonly instructions: ["Detect contradictions, ambiguity, duplication, scope drift, orphan tasks, and uncovered requirements.", "Challenge artifact completeness, requirement correctness, and cross-artifact coherence as separate review dimensions.", "Require task coverage for every FR and buildable SC; assess outcome SC as measurable verification targets without manufacturing implementation tasks.", "Report requirement coverage as a percentage and classify findings as CRITICAL, HIGH, MEDIUM, or LOW.", "Treat constitution violations and baseline requirements with zero task coverage as blocking."];
358
- readonly allowedWrites: ["None; analysis is read-only and returns its report in-session."];
359
- readonly outputSchema: ["findings table with stable IDs and severity", "requirement coverage percentage", "constitution alignment", "readiness verdict: ready | blocked"];
360
- readonly doneWhen: ["Every high-signal cross-artifact inconsistency has a severity and remediation anchor."];
361
- readonly blockingConditions: ["Any unresolved CRITICAL finding or constitution violation blocks implementation."];
362
- readonly handoff: ["On ready, pass the reviewed artifact set and cautions to implement; on blocked, return findings to the owning coordination phase."];
359
+ readonly handoff: ["After ready, pass spec.md, plan.md, tasks.md, dependencies, and verification commands to the user-selected plan-review path or implement."];
360
+ }, {
361
+ readonly id: "plan-review";
362
+ readonly objective: "Perform the user-selected read-only blocker review before Accelerated or Full implementation.";
363
+ readonly requiredInputs: ["spec.md", "plan.md", "tasks.md", "Optional active requirements checklist", "Project constitution", "Explicit user choice to review after the ready gate"];
364
+ readonly instructions: ["Load the bundled plan-reviewer skill and review executability, completeness, correctness, and coherence without redesigning the plan.", "Require task coverage for every FR and buildable SC; assess outcome SC as measurable verification targets without manufacturing implementation tasks.", "Return exact [OKAY] or [REJECT] semantics, default to [OKAY], and report at most three true blockers with the smallest fixes.", "Provide the reviewed artifact set so root can persist plan-review.md with SHA-256 freshness evidence; Oracle never writes it.", "Keep plan-review approval separate from implementation confirmation and mandatory final verify."];
365
+ readonly allowedWrites: ["None; Oracle is read-only. Root persists plan-review.md when review runs."];
366
+ readonly outputSchema: ["status: [OKAY] or [REJECT]", "zero to three blocker findings with smallest fixes", "non-blocking cautions", "requirement coverage percentage", "constitution alignment", "reviewed artifact freshness manifest input"];
367
+ readonly doneWhen: ["Oracle has returned an exact status and every true blocker has a concrete remediation anchor."];
368
+ readonly blockingConditions: ["[REJECT] blocks the review path until root repairs planning blockers, the user explicitly proceeds without review, or an explicit override is recorded."];
369
+ readonly handoff: ["On [OKAY], root persists review evidence, presents the approved-plan overview, and asks whether to implement or stop.", "A plan-review result never satisfies mandatory final verify."];
363
370
  }, {
364
371
  readonly id: "implement";
365
372
  readonly objective: "Execute the accepted task slice with one writer and focused verification.";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  renderOpenCodeAgentConfigs,
4
4
  spawn,
5
5
  spawnSync
6
- } from "./chunk-YUCGIJPP.js";
6
+ } from "./chunk-6GQYMWWT.js";
7
7
  import {
8
8
  POLL_INTERVAL_BACKGROUND_MS,
9
9
  context7,
@@ -12,7 +12,7 @@ import {
12
12
  grep_app,
13
13
  loadPluginConfig,
14
14
  stripJsonComments
15
- } from "./chunk-XO74DXBZ.js";
15
+ } from "./chunk-F2K4CS5J.js";
16
16
 
17
17
  // src/index.ts
18
18
  import { fileURLToPath as fileURLToPath3 } from "url";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thoth-agents",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Adaptive multi-harness orchestration with seven roles, runtime-autonomous Spec Kit-compatible SDD routes, and external provider boundaries.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",