thoth-agents 0.3.2 → 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 (33) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +34 -29
  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-NUSODNWE.js → chunk-W5GCMYA3.js} +63 -24
  6. package/dist/cli/codex-plugin-install.d.ts +51 -0
  7. package/dist/cli/index.js +260 -13
  8. package/dist/cli/skills.d.ts +2 -0
  9. package/dist/cli/tui/index.js +2 -2
  10. package/dist/harness/core/agent-pack.d.ts +3 -3
  11. package/dist/harness/core/sdd.d.ts +30 -23
  12. package/dist/index.js +2 -2
  13. package/package.json +1 -1
  14. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +2 -2
  15. package/plugin/.claude-plugin/plugin.json +1 -1
  16. package/plugin/.codex-plugin/plugin.json +1 -1
  17. package/plugin/agents/oracle.md +6 -6
  18. package/plugin/agents/orchestrator.md +8 -7
  19. package/plugin/skills/plan-reviewer/SKILL.md +107 -0
  20. package/plugin/skills/plan-reviewer/templates/plan-review.md +65 -0
  21. package/plugin/skills/thoth-constitution/templates/constitution.md +2 -2
  22. package/plugin/skills/thoth-init/SKILL.md +1 -1
  23. package/plugin/skills/thoth-init/scripts/init.mjs +1 -0
  24. package/plugin/skills/thoth-sdd/SKILL.md +21 -15
  25. package/skills/README.md +4 -2
  26. package/skills/plan-reviewer/SKILL.md +107 -0
  27. package/skills/plan-reviewer/templates/plan-review.md +65 -0
  28. package/skills/thoth-constitution/templates/constitution.md +2 -2
  29. package/skills/thoth-init/SKILL.md +1 -1
  30. package/skills/thoth-init/scripts/init.mjs +1 -0
  31. package/skills/thoth-sdd/SKILL.md +21 -15
  32. package/plugin/skills/thoth-sdd/references/phases/analyze.md +0 -21
  33. 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.2",
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,32 +61,28 @@ 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
 
68
- Register the repository marketplace from a terminal:
69
-
70
- ```bash
71
- codex plugin marketplace add EremesNG/thoth-agents
72
- ```
73
-
74
- Restart Codex, open `/plugins`, and install or enable `thoth-agents`. Then return
75
- to a terminal and apply the mandatory global layer:
73
+ Preview, then run the combined native-plugin and global-layer installer:
76
74
 
77
75
  ```bash
78
76
  npx thoth-agents@latest install --agent=codex --dry-run
79
77
  npx thoth-agents@latest install --agent=codex
80
78
  ```
81
79
 
82
- The CLI writes the orchestrator block to `~/.codex/AGENTS.md`, creates six
83
- custom-agent TOMLs under `~/.codex/agents/`, and merges the managed feature into
84
- `~/.codex/config.toml`. It also installs the external skills and invokes
85
- provider-owned thoth-mem setup. Restart Codex again, then initialize each target
86
- repository's SDD governance:
80
+ The CLI first uses Codex's native manager to register `EremesNG/thoth-agents`
81
+ and install or enable `thoth-agents@thoth-agents`. It then writes the
82
+ orchestrator block to `~/.codex/AGENTS.md`, creates six custom-agent TOMLs under
83
+ `~/.codex/agents/`, merges the managed feature into `~/.codex/config.toml`,
84
+ installs the external skills, and invokes provider-owned thoth-mem setup.
85
+ Restart Codex, then initialize each target repository's SDD governance:
87
86
 
88
87
  ```text
89
88
  $thoth-init
@@ -119,7 +118,7 @@ Restart Claude Code or run `/reload-plugins`, then initialize the repository:
119
118
  /thoth-agents:thoth-init
120
119
  ```
121
120
 
122
- Claude discovers the packaged orchestrator, six namespaced subagents, and four
121
+ Claude discovers the packaged orchestrator, six namespaced subagents, and five
123
122
  thoth-owned skills from the plugin. The CLI installs the external skills into
124
123
  Claude's global skill root and requires thoth-mem's own setup result to be
125
124
  complete. Init creates only the missing project governance files; it never edits
@@ -147,8 +146,8 @@ correctness-critical work.
147
146
  <br>
148
147
  <i>Adaptive root and final synthesis.</i>
149
148
  <br><br>
150
- Keeps task ownership and synthesis, chooses the route, coordinates SDD
151
- 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.
152
151
  <br><br>
153
152
  <b>Mode:</b> <code>adaptive-root</code>
154
153
  </td>
@@ -201,7 +200,7 @@ correctness-critical work.
201
200
  <br>
202
201
  <i>Independent analysis and verification.</i>
203
202
  <br><br>
204
- Challenges plans, owns Full analysis, and independently verifies every
203
+ Reviews plans when the user requests it and independently verifies every
205
204
  implementation.
206
205
  <br><br>
207
206
  <b>Mode:</b> <code>read-only</code>
@@ -273,29 +272,33 @@ Accelerated work.
273
272
  ```text
274
273
  Direct: implement -> verify
275
274
  Accelerated: specify -> plan -> tasks -> implement -> verify -> archive
276
- Full: explore -> specify -> plan -> tasks -> analyze -> implement -> verify -> archive
275
+ Full: explore -> specify -> plan -> tasks -> implement -> verify -> archive
277
276
  ```
278
277
 
279
278
  | Route | Use when | Artifacts |
280
279
  | --- | --- | --- |
281
280
  | Direct | Clear, bounded, low-risk work, including multi-file documentation/mechanical edits | None; oracle returns its verdict in-session. |
282
281
  | Accelerated | Generic SDD request, partial clarity, moderate risk, multi-surface behavior, or architecture | Canonical artifacts with fast-forward specification/planning/tasks. |
283
- | 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. |
284
283
 
285
284
  The root loads only the current phase contract from the bundled `thoth-sdd`
286
285
  skill. It owns specification, clarification, planning, requirements checklists,
287
286
  task decomposition, convergence, report persistence, and archive. `explorer`
288
- owns Full discovery; `oracle` always owns `analyze` and `verify`.
287
+ owns Full discovery; `oracle` owns user-selected plan review and every `verify`.
289
288
 
290
- An explicitly named route wins. A generic request to use SDD sets Accelerated as
291
- the minimum. Accelerated writes `spec.md -> plan.md -> tasks.md` in one
292
- 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.
293
294
 
294
295
  Conditional phases remain deliberately narrow:
295
296
 
296
297
  - `clarify` runs only for a material ambiguity and updates canonical `spec.md`;
297
298
  - `checklist` audits high-risk requirement quality with `CHK###` taxonomy and a
298
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`;
299
302
  - `converge` appends tasks only after failed artifact-backed verification; and
300
303
  - `architectural-grilling` runs before specification only when explicitly
301
304
  requested or a material human-owned decision remains unresolved.
@@ -320,6 +323,7 @@ Every harness package includes the workflow contracts owned by thoth-agents:
320
323
  | `thoth-sdd` | Route rules, phase contracts, templates, and structural validator. |
321
324
  | `thoth-constitution` | Explicit governance SemVer lifecycle; routine plans only read principles. |
322
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. |
323
327
 
324
328
  The installer obtains these mandatory external skills from their single source
325
329
  of truth:
@@ -345,7 +349,7 @@ diagnostics, manual actions, and receipt paths remain visible for recovery.
345
349
  | Harness | Important limitation |
346
350
  | --- | --- |
347
351
  | OpenCode | Strongest integrated path. The CLI installs the npm plugin configuration, external skills, and provider-owned thoth-mem setup; `/thoth-init` materializes thoth-owned project skills/governance. Only the OpenAI built-in preset ships. |
348
- | Codex | Native plugin installation is incomplete without the CLI. The CLI manages global `AGENTS.md`, six agent TOMLs, config, external skills, and thoth-mem setup; `$thoth-init` only initializes per-repository SDD governance. Runtime role matching and some permissions remain instruction-level. |
352
+ | Codex | The CLI installs the native plugin and manages global `AGENTS.md`, six agent TOMLs, config, external skills, and thoth-mem setup; `$thoth-init` only initializes per-repository SDD governance. Runtime role matching and some permissions remain instruction-level. |
349
353
  | Claude Code | Run both native marketplace commands before the CLI installs external skills and requests thoth-mem setup. The native manager owns cache files; fine-grained path restrictions remain instruction-level. |
350
354
 
351
355
  Codex and Claude marketplace manifests are versioned in
@@ -385,7 +389,8 @@ npx thoth-agents@latest install --agent=claude
385
389
  npx thoth-agents@latest model --harness=codex --role=deep --model=gpt-5.6-sol
386
390
  ```
387
391
 
388
- It does not replace native marketplace trust or mutate manager-owned caches.
392
+ It does not bypass native marketplace trust or edit manager-owned caches
393
+ directly; Codex and Claude own their native manager mutations.
389
394
 
390
395
  ## Documentation
391
396
 
@@ -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";
@@ -1411,11 +1411,11 @@ function buildCodexManagedConfigPatch(content, options) {
1411
1411
  ];
1412
1412
  if (options.pluginId) {
1413
1413
  diffSummary.push(
1414
- `plugin enablement for "${options.pluginId}" is not textually merged; use /plugins to enable it`
1414
+ `plugin enablement for "${options.pluginId}" is not textually merged; use the native Codex plugin manager`
1415
1415
  );
1416
1416
  } else {
1417
1417
  diffSummary.push(
1418
- "plugin enablement left to /plugins; no guessed plugin id written"
1418
+ "plugin installation and enablement owned by the native Codex plugin manager; no plugin table written"
1419
1419
  );
1420
1420
  }
1421
1421
  return {
@@ -1843,8 +1843,8 @@ function buildCodexSetupPlan(config) {
1843
1843
  configPath: targets.configPath,
1844
1844
  pluginId: config.pluginId,
1845
1845
  diagnostics: [
1846
- "Register the published marketplace with `codex plugin marketplace add EremesNG/thoth-agents`, restart Codex, then open /plugins to install and enable thoth-agents.",
1847
- "The CLI does not copy a plugin into ~/.codex/plugins or merge ~/.agents/plugins/marketplace.json; Codex owns marketplace snapshots and installed plugin cache state.",
1846
+ "The combined install flow runs `codex plugin marketplace add EremesNG/thoth-agents` and `codex plugin add thoth-agents@thoth-agents` through the native manager; restart Codex, then use /plugins to review its state.",
1847
+ "The CLI does not copy a plugin into ~/.codex/plugins or merge ~/.agents/plugins/marketplace.json directly; Codex owns marketplace snapshots and installed plugin cache state.",
1848
1848
  "The /hooks surface may show hooks from independently installed plugins; this thoth-agents setup plan does not install provider hooks.",
1849
1849
  "Codex Default mode user-input requests require features.default_mode_request_user_input = true and use the request_user_input tool; other modes may not expose it.",
1850
1850
  "Higher-precedence Codex config (project, profile, CLI, system, or admin) may override user config feature flags.",
@@ -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,
@@ -0,0 +1,51 @@
1
+ export type CodexPluginSetupAction = 'register-marketplace' | 'install-plugin';
2
+ export interface CodexCommandResult {
3
+ exitCode: number;
4
+ stdout: string;
5
+ stderr: string;
6
+ }
7
+ export interface CodexCommandOptions {
8
+ cwd: string;
9
+ }
10
+ export interface CodexCommandInvocationOptions {
11
+ platform?: NodeJS.Platform;
12
+ commandShell?: string;
13
+ }
14
+ export interface CodexCommandInvocation {
15
+ command: string;
16
+ args: string[];
17
+ }
18
+ export type CodexCommandExecutor = (command: string, args: readonly string[], options: CodexCommandOptions) => CodexCommandResult;
19
+ export interface CodexPluginInstallConfig {
20
+ dryRun?: boolean;
21
+ projectRoot: string;
22
+ commandExecutor?: CodexCommandExecutor;
23
+ }
24
+ export interface CodexPluginSetupPlanItem {
25
+ action: CodexPluginSetupAction;
26
+ targetPath: string;
27
+ description: string;
28
+ command: {
29
+ executable: 'codex';
30
+ args: string[];
31
+ cwd: string;
32
+ };
33
+ }
34
+ export interface CodexPluginSetupPlan {
35
+ dryRun: boolean;
36
+ items: CodexPluginSetupPlanItem[];
37
+ diagnostics: string[];
38
+ ready: boolean;
39
+ projectRoot: string;
40
+ commandExecutor: CodexCommandExecutor;
41
+ }
42
+ export interface CodexPluginApplyResult {
43
+ success: boolean;
44
+ changed: string[];
45
+ diagnostics: string[];
46
+ error?: string;
47
+ }
48
+ export declare function getCodexCommand(args: readonly string[], options?: CodexCommandInvocationOptions): CodexCommandInvocation;
49
+ export declare function buildCodexPluginSetupPlan(config: CodexPluginInstallConfig): CodexPluginSetupPlan;
50
+ export declare function applyCodexPluginSetup(plan: CodexPluginSetupPlan): CodexPluginApplyResult;
51
+ export declare function formatCodexPluginSetupPlan(plan: CodexPluginSetupPlan): string;