thoth-agents 0.3.10 → 0.3.12

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 (52) hide show
  1. package/README.md +119 -33
  2. package/dist/{chunk-TKIDBRM3.js → chunk-5UBJB5QO.js} +4 -1
  3. package/dist/{chunk-M2WF46BP.js → chunk-DX4U3AD3.js} +387 -231
  4. package/dist/{chunk-JBG7XMIG.js → chunk-VPVBYBPU.js} +602 -180
  5. package/dist/cli/codex-plugin-install.d.ts +16 -2
  6. package/dist/cli/index.js +7 -5
  7. package/dist/cli/tui/index.js +2 -2
  8. package/dist/config/constants.d.ts +3 -3
  9. package/dist/harness/adapters/claude-code.d.ts +8 -0
  10. package/dist/harness/adapters/codex-surfaces.d.ts +2 -2
  11. package/dist/harness/core/agent-pack.d.ts +60 -5
  12. package/dist/harness/core/sdd.d.ts +32 -19
  13. package/dist/harness/writers/codex-plugin-package.d.ts +1 -0
  14. package/dist/index.js +2 -2
  15. package/package.json +4 -4
  16. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +7 -7
  17. package/plugin/.claude-plugin/plugin.json +1 -1
  18. package/plugin/.codex-plugin/plugin.json +1 -1
  19. package/plugin/agents/deep.md +10 -31
  20. package/plugin/agents/designer.md +10 -31
  21. package/plugin/agents/explorer.md +10 -30
  22. package/plugin/agents/librarian.md +10 -30
  23. package/plugin/agents/oracle.md +11 -31
  24. package/plugin/agents/orchestrator.md +48 -35
  25. package/plugin/agents/quick.md +10 -31
  26. package/plugin/skills/plan-reviewer/SKILL.md +54 -15
  27. package/plugin/skills/thoth-archive/SKILL.md +5 -0
  28. package/plugin/skills/thoth-archive/scripts/archive.mjs +30 -10
  29. package/plugin/skills/thoth-constitution/SKILL.md +5 -0
  30. package/plugin/skills/thoth-constitution/templates/constitution.md +19 -2
  31. package/plugin/skills/thoth-init/SKILL.md +5 -0
  32. package/plugin/skills/thoth-sdd/SKILL.md +48 -11
  33. package/plugin/skills/thoth-sdd/references/phases/implement.md +44 -6
  34. package/plugin/skills/thoth-sdd/references/phases/tasks.md +23 -2
  35. package/plugin/skills/thoth-sdd/references/phases/verify.md +7 -5
  36. package/plugin/skills/thoth-sdd/scripts/validate.mjs +263 -30
  37. package/plugin/skills/thoth-sdd/templates/tasks.md +18 -2
  38. package/skills/README.md +2 -1
  39. package/skills/plan-reviewer/SKILL.md +54 -15
  40. package/skills/thoth-archive/SKILL.md +5 -0
  41. package/skills/thoth-archive/scripts/archive.mjs +30 -10
  42. package/skills/thoth-constitution/SKILL.md +5 -0
  43. package/skills/thoth-constitution/templates/constitution.md +19 -2
  44. package/skills/thoth-init/SKILL.md +5 -0
  45. package/skills/thoth-sdd/SKILL.md +48 -11
  46. package/skills/thoth-sdd/references/phases/implement.md +44 -6
  47. package/skills/thoth-sdd/references/phases/tasks.md +23 -2
  48. package/skills/thoth-sdd/references/phases/verify.md +7 -5
  49. package/skills/thoth-sdd/scripts/validate.mjs +263 -30
  50. package/skills/thoth-sdd/templates/tasks.md +18 -2
  51. package/.agents/plugins/marketplace.json +0 -20
  52. package/.claude-plugin/marketplace.json +0 -21
package/README.md CHANGED
@@ -22,10 +22,13 @@ parallelism creates a net gain.
22
22
 
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
- deltas. Accelerated planning fast-forwards without routine pauses; structural
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
25
+ deltas. The root shapes substantive work into dependency-aware, conflict-free
26
+ native waves and joins terminal native results before dependent synthesis.
27
+ Accelerated planning fast-forwards without routine pauses; structural
28
+ `ready`/`closeout` gates and proportional independent review retain rigor. Root
29
+ recommends Direct, Accelerated, or Full after summarizing context; explicit
30
+ answers win and the third answerless route question selects the recommendation.
31
+ After `ready`, artifact-backed routes offer optional Oracle plan review or proceeding
29
32
  without it; every final verification remains mandatory. During
30
33
  installation, the CLI obtains four mandatory external skills
31
34
  from their canonical repositories with `npx skills add` and invokes the official
@@ -41,8 +44,9 @@ before the CLI installs external skills and requests provider-owned thoth-mem
41
44
  setup.
42
45
 
43
46
  Runtime guarantees still differ by harness. OpenCode is the default and most
44
- integrated path; Codex and Claude preserve their own trust, policy, plugin-cache,
45
- and permission semantics.
47
+ integrated path; Codex and Claude preserve their own trust, policy, normal
48
+ plugin-cache, and permission semantics. Codex installation has one bounded
49
+ legacy-cache cleanup contract described below; Claude does not.
46
50
 
47
51
  ## Install
48
52
 
@@ -78,15 +82,23 @@ directly from the globally installed `thoth-sdd` skill; any legacy project
78
82
 
79
83
  ### Codex
80
84
 
81
- Preview, then run the combined native-plugin and global-layer installer:
85
+ Close Codex, preview, then run the combined native-plugin and global-layer
86
+ installer:
82
87
 
83
88
  ```bash
84
89
  npx thoth-agents@latest install --agent=codex --dry-run
85
90
  npx thoth-agents@latest install --agent=codex
86
91
  ```
87
92
 
88
- The CLI first uses Codex's native manager to register `EremesNG/thoth-agents`
89
- and install or enable `thoth-agents@thoth-agents`. It then writes the
93
+ The CLI first uses Codex's native manager to register
94
+ `https://github.com/EremesNG/thoth-plugins.git` as `thoth-plugins` and install
95
+ or enable the executing version of `thoth-agents@thoth-plugins`. After that
96
+ verification it removes only registered legacy IDs
97
+ `thoth-agents@thoth-agents` and `thoth-agents@thoth-agents-codex`, their two
98
+ marketplaces, and any still-orphaned exact thoth-agents roots that pass bounded
99
+ path/provenance checks. It never deletes sibling or discovered paths. A lock or
100
+ race retains the central plugin and asks you to keep Codex closed and retry;
101
+ restart activates state but does not garbage-collect caches. The CLI then writes the
90
102
  orchestrator block to `~/.codex/AGENTS.md`, creates six custom-agent TOMLs under
91
103
  `~/.codex/agents/`, merges the managed feature into `~/.codex/config.toml`,
92
104
  installs the external skills, and invokes provider-owned thoth-mem setup.
@@ -104,16 +116,61 @@ into the repository.
104
116
  Review `/plugins` and `/hooks` after installation. Codex trust and
105
117
  higher-precedence instructions remain in force.
106
118
 
119
+ #### Local Codex development
120
+
121
+ Keep a personal marketplace entry in `~/.agents/plugins/marketplace.json`
122
+ pointed at `./plugins/thoth-agents` relative to the home marketplace root:
123
+
124
+ ```json
125
+ {
126
+ "name": "personal",
127
+ "plugins": [
128
+ {
129
+ "name": "thoth-agents",
130
+ "source": {
131
+ "source": "local",
132
+ "path": "./plugins/thoth-agents"
133
+ },
134
+ "policy": {
135
+ "installation": "AVAILABLE",
136
+ "authentication": "ON_INSTALL"
137
+ },
138
+ "category": "Productivity"
139
+ }
140
+ ]
141
+ }
142
+ ```
143
+
144
+ Then build and synchronize both required Codex layers from this checkout:
145
+
146
+ ```bash
147
+ pnpm run setup:codex:local
148
+ ```
149
+
150
+ The command replaces `~/plugins/thoth-agents` through a staged local copy,
151
+ cache-busts the copied Codex and Claude manifest versions, and refreshes the
152
+ managed global Codex root block, six standalone role TOMLs, model state, and
153
+ feature configuration. It preserves the marketplace file and user model
154
+ overrides. It does not install or remove plugins, install external skills, or
155
+ invoke thoth-mem setup. Select the personal plugin in Codex and restart it after
156
+ each synchronization. The command rejects a state where both
157
+ `thoth-agents@thoth-plugins` and `thoth-agents@personal` are enabled.
158
+
107
159
  ### Claude Code
108
160
 
109
161
  Claude requires its two native marketplace steps before the plugin can expose
110
162
  agents or skills:
111
163
 
112
164
  ```bash
113
- claude plugin marketplace add EremesNG/thoth-agents --scope user
114
- claude plugin install thoth-agents@thoth-agents --scope user
165
+ claude plugin marketplace add https://github.com/EremesNG/thoth-plugins.git --scope user
166
+ claude plugin install thoth-agents@thoth-plugins --scope user
115
167
  ```
116
168
 
169
+ The shared catalog name is `thoth-plugins`. Existing bare or host-specific
170
+ thoth-agents marketplace identities remain manager-owned and are not removed
171
+ automatically; rerunning the current installer adds the central identity and
172
+ preserves legacy entries without updating or uninstalling them.
173
+
117
174
  Then install the mandatory external skills and invoke provider-owned thoth-mem
118
175
  setup:
119
176
 
@@ -193,7 +250,8 @@ correctness-critical work.
193
250
  <br>
194
251
  <i>Authoritative external research.</i>
195
252
  <br><br>
196
- Gathers current authoritative external evidence and labels inference.
253
+ Gathers current, unfamiliar, version-sensitive, or externally sourced
254
+ evidence and labels inference; stable local facts do not trigger research.
197
255
  <br><br>
198
256
  <b>Mode:</b> <code>read-only</code>
199
257
  </td>
@@ -210,8 +268,8 @@ correctness-critical work.
210
268
  <br>
211
269
  <i>Independent analysis and verification.</i>
212
270
  <br><br>
213
- Reviews plans when the user requests it and independently verifies every
214
- implementation.
271
+ Reviews explicitly or bounded-default selected plans and independently verifies material
272
+ risk plus every Accelerated or Full final implementation.
215
273
  <br><br>
216
274
  <b>Mode:</b> <code>read-only</code>
217
275
  </td>
@@ -230,7 +288,8 @@ correctness-critical work.
230
288
  <br>
231
289
  <i>UI/UX ownership and visual quality.</i>
232
290
  <br><br>
233
- Owns UI/UX choices, implementation, and visual verification.
291
+ Owns material UI/UX, interaction, accessibility, implementation, and visual
292
+ verification.
234
293
  <br><br>
235
294
  <b>Mode:</b> <code>write-capable</code>
236
295
  </td>
@@ -247,7 +306,8 @@ correctness-critical work.
247
306
  <br>
248
307
  <i>Fast bounded implementation.</i>
249
308
  <br><br>
250
- Makes narrow, clear, low-risk edits within an explicit surface.
309
+ Makes known narrow, clear, low-risk edits within an isolated explicit
310
+ surface.
251
311
  <br><br>
252
312
  <b>Mode:</b> <code>write-capable</code>
253
313
  </td>
@@ -273,9 +333,13 @@ correctness-critical work.
273
333
  </table>
274
334
 
275
335
  Children do not delegate. Each mutable surface has one writer. Parallel work is
276
- limited to independent surfaces. The implementation writer never reviews or
277
- approves its own result: `oracle` owns every `verify`, including Direct and
278
- Accelerated work.
336
+ limited to independent surfaces. The root marks input-ready lanes ready and
337
+ upstream-dependent lanes blocked, dispatches every ready conflict-free lane in a
338
+ native wave before waiting, and fans in only terminal native results. Every route
339
+ verifies: trivial deterministic Direct work may use focused root checks; material
340
+ risk in Direct and every Accelerated or Full final verify require a fresh
341
+ read-only `oracle`. The implementation writer never reviews or approves its own
342
+ result.
279
343
 
280
344
  ## SDD routes
281
345
 
@@ -287,28 +351,37 @@ Full: explore -> specify -> plan -> tasks -> implement -> verify -> archi
287
351
 
288
352
  | Route | Use when | Artifacts |
289
353
  | --- | --- | --- |
290
- | Direct | Clear, bounded, low-risk work, including multi-file documentation/mechanical edits | None; oracle returns its verdict in-session. |
354
+ | Direct | Clear, bounded, low-risk work, including multi-file documentation/mechanical edits | None; focused root checks cover trivial deterministic work, while material risk requires a fresh Oracle. |
291
355
  | Accelerated | Generic SDD request, partial clarity, moderate risk, multi-surface behavior, or architecture | Canonical artifacts with fast-forward specification/planning/tasks. |
292
356
  | Full | Material uncertainty, cross-cutting behavior/architecture, high contract risk, or high failure cost | Accelerated artifacts plus exploration and separate planning gates. |
293
357
 
294
358
  The root loads only the current phase contract from the bundled `thoth-sdd`
295
359
  skill. It owns specification, clarification, planning, requirements checklists,
296
360
  task decomposition, convergence, report persistence, and archive. `explorer`
297
- owns Full discovery; `oracle` owns user-selected plan review and every `verify`.
361
+ owns broad or uncertain Full discovery; `oracle` owns explicitly or
362
+ bounded-default selected plan review, plus final
363
+ verification gates that require independent judgment.
298
364
 
299
365
  An explicitly named route is the user's selection and wins. Otherwise root
300
- recommends one of all three routes and waits for the user's choice. A generic
301
- request to use SDD sets Accelerated as the minimum recommendation. Accelerated
302
- writes `spec.md -> plan.md -> tasks.md` in one uninterrupted root pass and does
303
- not pause for routine approval between those planning phases.
366
+ summarizes the relevant context, scope, clarity, risk, and why one of the three
367
+ routes is recommended before asking. Any explicit answer wins. After at most
368
+ three total answerless native results, the third selects the recommended route.
369
+ A generic request to use SDD sets Accelerated as the minimum recommendation.
370
+ Accelerated writes `spec.md -> plan.md -> tasks.md` in one uninterrupted root
371
+ pass and does not pause for routine approval between those planning phases.
304
372
 
305
373
  Conditional phases remain deliberately narrow:
306
374
 
307
375
  - `clarify` runs only for a material ambiguity and updates canonical `spec.md`;
308
376
  - `checklist` audits high-risk requirement quality with `CHK###` taxonomy and a
309
377
  separate revalidation pass;
310
- - `plan-review` is offered after `ready` on Accelerated and Full; the user chooses
311
- `Review plan with Oracle (Recommended)` or `Proceed without review`;
378
+ - `plan-review` is offered after `ready` on Accelerated and Full; any explicit
379
+ answer wins, while the third answerless result selects
380
+ `Review plan with Oracle (Recommended)`. Same-intent rejections are repaired
381
+ and revalidated before fresh Oracle rounds until approval or a material human
382
+ blocker. After approval, root summarizes the plan before asking
383
+ `Implement (Recommended)` or `Stop`; the third answerless result selects
384
+ implementation, while an explicit answer always wins;
312
385
  - `converge` appends tasks only after failed artifact-backed verification; and
313
386
  - `architectural-grilling` runs before specification only when explicitly
314
387
  requested or a material human-owned decision remains unresolved.
@@ -323,6 +396,16 @@ Handled failures roll back within the active process; forced process or OS
323
396
  termination is not crash-atomic. See
324
397
  [SDD Pipeline](docs/sdd-pipeline.md).
325
398
 
399
+ The role decision is semantic and route-independent: `librarian` handles current
400
+ or external facts (for example, checking the current official API), `designer`
401
+ handles material user-facing UI/UX or accessibility, and `quick` handles a known
402
+ narrow low-risk isolated edit. `deep` handles coupled or high-risk work, while
403
+ `explorer` handles broad local uncertainty. Native harness execution and
404
+ lifecycle are the sole authority for role selection, fan-out/fan-in,
405
+ status/wait, steering, cancellation, and terminal results; an unavailable
406
+ primitive is reported and followed by a truthful sequential fallback. No
407
+ additional thoth coordination mechanism is involved.
408
+
326
409
  ## Skills
327
410
 
328
411
  Every harness package includes the workflow contracts owned by thoth-agents:
@@ -362,10 +445,11 @@ diagnostics, manual actions, and receipt paths remain visible for recovery.
362
445
  | 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. |
363
446
  | 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. |
364
447
 
365
- Codex and Claude marketplace manifests are versioned in
366
- `.agents/plugins/marketplace.json` and `.claude-plugin/marketplace.json`. The
367
- two catalogs resolve to the same generated `plugin/` bundle. Build and npm
368
- version lifecycle commands keep that shared bundle synchronized.
448
+ Codex and Claude marketplace manifests are versioned in the separate
449
+ `EremesNG/thoth-plugins` repository. Both central entries resolve to this
450
+ repository's generated `plugin/` bundle at an immutable version tag. Build and
451
+ npm version lifecycle commands keep that bundle synchronized; release commands
452
+ publish only the new thoth-agents pin after the product tag is visible remotely.
369
453
 
370
454
  ## Models and provider boundaries
371
455
 
@@ -429,8 +513,10 @@ edit, preview and apply remain limited to the dirty roles. In OpenCode, both
429
513
  `Apply` and `Apply changes` materialize the complete effective roster and
430
514
  activate the named `agents` preset.
431
515
 
432
- It does not bypass native marketplace trust or edit manager-owned caches
433
- directly; Codex and Claude own their native manager mutations.
516
+ It does not bypass native marketplace trust. Codex and Claude own normal native
517
+ manager mutations; the Codex installer additionally owns only the fixed,
518
+ twice-validated thoth-agents legacy-root fallback. Claude cache state is never
519
+ edited directly.
434
520
 
435
521
  ## Documentation
436
522
 
@@ -10,11 +10,13 @@ import {
10
10
  createReadOnlySpecialistPromptSections,
11
11
  createWriteCapableSpecialistPromptSections,
12
12
  getAgentOverride,
13
+ getAgentRole,
13
14
  getModelFamilyPromptSection,
14
15
  getStepBudgetPromptSection,
15
16
  loadAgentPrompt,
17
+ renderAgentRoutingDescription,
16
18
  renderRolePrompt
17
- } from "./chunk-M2WF46BP.js";
19
+ } from "./chunk-DX4U3AD3.js";
18
20
 
19
21
  // src/agents/deep.ts
20
22
  var DEEP_PROMPT = renderRolePrompt(
@@ -405,6 +407,7 @@ function createAgents(config) {
405
407
  const prompts = loadAgentPrompt(name, config?.preset);
406
408
  const model = getPrimaryModelForPrompt(override?.model) ?? DEFAULT_MODELS[name];
407
409
  const agent = factory(model, prompts.prompt, prompts.appendPrompt);
410
+ agent.description = renderAgentRoutingDescription(getAgentRole(name));
408
411
  agent.config.variant = CONFIRMED_OPENAI_SUBAGENT_PRESET[name].effort;
409
412
  return agent;
410
413
  });