thoth-agents 0.4.2 → 0.5.1

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 (115) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +86 -58
  3. package/dist/agents/prompt-sections.d.ts +5 -3
  4. package/dist/agents/prompt-utils.d.ts +1 -1
  5. package/dist/agents/worker.d.ts +2 -0
  6. package/dist/{chunk-STCURXAQ.js → chunk-MRFCA3U2.js} +33 -67
  7. package/dist/{chunk-EFGSGPYM.js → chunk-OW6I7ZUU.js} +391 -416
  8. package/dist/chunk-V7HSGRMB.js +1016 -0
  9. package/dist/{chunk-WCLUZZHI.js → chunk-VUNYH263.js} +1580 -351
  10. package/dist/cli/claude-code-paths.d.ts +2 -2
  11. package/dist/cli/codex-install.d.ts +5 -2
  12. package/dist/cli/codex-paths.d.ts +2 -2
  13. package/dist/cli/index.js +47 -11
  14. package/dist/cli/operations/pi.d.ts +1 -0
  15. package/dist/cli/pi-effort.d.ts +1 -1
  16. package/dist/cli/pi-external-package.d.ts +24 -0
  17. package/dist/cli/pi-git-source.d.ts +1 -0
  18. package/dist/cli/pi-install.d.ts +92 -15
  19. package/dist/cli/pi-managed-write.d.ts +3 -0
  20. package/dist/cli/pi-model-config.d.ts +17 -0
  21. package/dist/cli/pi-native-probe.d.ts +2 -0
  22. package/dist/cli/pi-paths.d.ts +2 -0
  23. package/dist/cli/pi-resources.d.ts +3 -1
  24. package/dist/cli/pi-tool-config.d.ts +32 -0
  25. package/dist/cli/tui/index.js +3 -3
  26. package/dist/cli/types.d.ts +2 -0
  27. package/dist/config/constants.d.ts +4 -8
  28. package/dist/config/schema.d.ts +7 -36
  29. package/dist/harness/adapters/claude-code.d.ts +2 -4
  30. package/dist/harness/core/agent-pack.d.ts +52 -42
  31. package/dist/harness/core/memory-governance.d.ts +2 -2
  32. package/dist/harness/core/sdd.d.ts +159 -319
  33. package/dist/harness/writers/pi-agent.d.ts +3 -1
  34. package/dist/index.js +12 -6
  35. package/dist/pi/tools-panel.d.ts +51 -0
  36. package/dist/pi.d.ts +44 -2
  37. package/dist/pi.js +471 -9
  38. package/dist/utils/subprocess.d.ts +1 -0
  39. package/package.json +23 -6
  40. package/pi/.thoth-agents-assets.json +5 -6
  41. package/pi/agents/thoth-designer.md +23 -8
  42. package/pi/agents/thoth-explorer.md +29 -9
  43. package/pi/agents/thoth-librarian.md +30 -8
  44. package/pi/agents/thoth-oracle.md +18 -10
  45. package/pi/agents/thoth-worker.md +96 -0
  46. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +7 -12
  47. package/plugin/.claude-plugin/plugin.json +2 -2
  48. package/plugin/.codex-plugin/plugin.json +2 -2
  49. package/plugin/agents/designer.md +13 -5
  50. package/plugin/agents/explorer.md +16 -5
  51. package/plugin/agents/librarian.md +15 -4
  52. package/plugin/agents/oracle.md +13 -7
  53. package/plugin/agents/orchestrator.md +82 -91
  54. package/plugin/agents/worker.md +76 -0
  55. package/plugin/skills/plan-reviewer/SKILL.md +39 -141
  56. package/plugin/skills/thoth-archive/SKILL.md +50 -47
  57. package/plugin/skills/thoth-archive/scripts/archive.mjs +287 -654
  58. package/plugin/skills/thoth-constitution/SKILL.md +23 -42
  59. package/plugin/skills/thoth-constitution/templates/constitution.md +54 -44
  60. package/plugin/skills/thoth-init/SKILL.md +19 -29
  61. package/plugin/skills/thoth-init/scripts/init.mjs +73 -66
  62. package/plugin/skills/thoth-sdd/SKILL.md +164 -117
  63. package/plugin/skills/thoth-sdd/references/phases/checklist.md +2 -22
  64. package/plugin/skills/thoth-sdd/references/phases/clarify.md +14 -12
  65. package/plugin/skills/thoth-sdd/references/phases/converge.md +2 -13
  66. package/plugin/skills/thoth-sdd/references/phases/explore.md +3 -8
  67. package/plugin/skills/thoth-sdd/references/phases/implement.md +58 -57
  68. package/plugin/skills/thoth-sdd/references/phases/plan.md +2 -18
  69. package/plugin/skills/thoth-sdd/references/phases/specify.md +2 -33
  70. package/plugin/skills/thoth-sdd/references/phases/tasks.md +4 -45
  71. package/plugin/skills/thoth-sdd/references/phases/verify.md +4 -22
  72. package/plugin/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  73. package/plugin/skills/thoth-sdd/templates/change.md +94 -0
  74. package/skills/README.md +11 -13
  75. package/skills/plan-reviewer/SKILL.md +39 -141
  76. package/skills/thoth-archive/SKILL.md +50 -47
  77. package/skills/thoth-archive/scripts/archive.mjs +287 -654
  78. package/skills/thoth-constitution/SKILL.md +23 -42
  79. package/skills/thoth-constitution/templates/constitution.md +54 -44
  80. package/skills/thoth-init/SKILL.md +19 -29
  81. package/skills/thoth-init/scripts/init.mjs +73 -66
  82. package/skills/thoth-sdd/SKILL.md +164 -117
  83. package/skills/thoth-sdd/references/phases/checklist.md +2 -22
  84. package/skills/thoth-sdd/references/phases/clarify.md +14 -12
  85. package/skills/thoth-sdd/references/phases/converge.md +2 -13
  86. package/skills/thoth-sdd/references/phases/explore.md +3 -8
  87. package/skills/thoth-sdd/references/phases/implement.md +58 -57
  88. package/skills/thoth-sdd/references/phases/plan.md +2 -18
  89. package/skills/thoth-sdd/references/phases/specify.md +2 -33
  90. package/skills/thoth-sdd/references/phases/tasks.md +4 -45
  91. package/skills/thoth-sdd/references/phases/verify.md +4 -22
  92. package/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  93. package/skills/thoth-sdd/templates/change.md +94 -0
  94. package/thoth-agents.schema.json +9 -77
  95. package/dist/agents/deep.d.ts +0 -2
  96. package/dist/agents/quick.d.ts +0 -2
  97. package/dist/chunk-2U5MBLLV.js +0 -312
  98. package/pi/agents/thoth-deep.md +0 -81
  99. package/pi/agents/thoth-quick.md +0 -81
  100. package/plugin/agents/deep.md +0 -68
  101. package/plugin/agents/quick.md +0 -68
  102. package/plugin/skills/plan-reviewer/templates/plan-review.md +0 -65
  103. package/plugin/skills/thoth-sdd/templates/archive-report.md +0 -25
  104. package/plugin/skills/thoth-sdd/templates/checklist.md +0 -27
  105. package/plugin/skills/thoth-sdd/templates/plan.md +0 -46
  106. package/plugin/skills/thoth-sdd/templates/spec.md +0 -62
  107. package/plugin/skills/thoth-sdd/templates/tasks.md +0 -58
  108. package/plugin/skills/thoth-sdd/templates/verify-report.md +0 -28
  109. package/skills/plan-reviewer/templates/plan-review.md +0 -65
  110. package/skills/thoth-sdd/templates/archive-report.md +0 -25
  111. package/skills/thoth-sdd/templates/checklist.md +0 -27
  112. package/skills/thoth-sdd/templates/plan.md +0 -46
  113. package/skills/thoth-sdd/templates/spec.md +0 -62
  114. package/skills/thoth-sdd/templates/tasks.md +0 -58
  115. package/skills/thoth-sdd/templates/verify-report.md +0 -28
@@ -1,130 +1,177 @@
1
1
  ---
2
2
  name: thoth-sdd
3
- description: Run thoth-agents Direct, Accelerated, or Full specification-driven development with Spec Kit-grade artifacts, OpenSpec-style durable deltas, fast-forward planning, and proportional independent verification.
3
+ description: Apply proportional understanding and risk-aware SDD classification, with one ID-named record for substantial changes.
4
4
  license: MIT
5
- compatibility: Requires Node.js >=22.19 for bundled validation scripts.
5
+ compatibility: Requires Node.js >=22.19 for bundled product validation.
6
6
  metadata:
7
7
  author: thoth-agents
8
- version: "1.0"
8
+ version: "2.0"
9
9
  ---
10
10
 
11
11
  # Thoth SDD
12
12
 
13
- Assess the work, recommend the lightest route that preserves correctness, and
14
- let the user select:
15
-
16
- - **Direct**: `implement -> verify`
17
- - **Accelerated**: `specify -> plan -> tasks -> implement -> verify -> archive`
18
- - **Full**: `explore -> specify -> plan -> tasks -> implement -> verify -> archive`
19
-
20
- Conditional phases are `clarify`, `checklist`, `plan-review`, and `converge`. Direct creates no
21
- SDD artifacts and may cover multiple documentation or mechanical files when the
22
- intent is clear and risk is low.
23
-
24
- Accelerated is a **fast-forward** route: root writes `spec.md`, `plan.md`, and
25
- `tasks.md` in one uninterrupted pass and creates optional artifacts only for a
26
- concrete risk. After `ready`, both artifact-backed routes offer
27
- `Review plan with Oracle (Recommended)` or `Proceed without review`. Full uses
28
- separate planning gates because uncertainty or failure cost justifies them.
29
-
30
- An explicitly named route counts as the user's selection. Otherwise assess and
31
- recommend Direct, Accelerated, or Full, first summarize the relevant request
32
- context, scope, clarity, risk, and why the recommendation fits, then ask. When a
33
- native route question returns answerless, make at most three total attempts;
34
- after the third answerless result, treat the recommended route as selected. Any
35
- explicit answer wins. A generic request to “use SDD” makes Accelerated the
36
- minimum recommendation but does not force it.
37
-
38
- At the post-`ready` review choice, an explicit answer wins, including
39
- `Proceed without review`. When the native question returns answerless, make at
40
- most three total attempts; after the third answerless result, treat
41
- `Review plan with Oracle (Recommended)` as selected. Once review is selected,
42
- repair actionable same-intent planning blockers, revalidate affected gates, and
43
- use a fresh Oracle for every new approval round until `[OKAY]`; stop instead on
44
- a material human-owned blocker.
45
-
46
- These bounded fallbacks apply only to the route, plan-review, and implementation
47
- questions. Never apply them to secrets, destructive or security-sensitive
48
- actions, or material human-owned product or architecture decisions.
49
-
50
- ## Ownership
51
-
52
- - Root owns sequential coordination artifacts, gate execution, and archive.
53
- - Explorer owns Full-route repository discovery.
54
- - SDD routes govern artifacts and gates, not implementation ownership. Root,
55
- `designer`, `quick`, or `deep` may implement in Direct, Accelerated, or Full.
56
- - Root decides ownership from explicit safe user direction and demonstrated net
57
- gain. Delegation benefits include specialization, context isolation,
58
- independent bounded work, quality, latency, or total cost; root continuity
59
- benefits include short or sequential work, shared mutable state, accumulated
60
- context, rediscovery, and coordination overhead. Route, file count, or cheaper
61
- model price alone never selects an owner.
62
- - Only after deciding to delegate implementation, select `designer` for UI/UX,
63
- `quick` for known narrow low-risk work, or `deep` for coupled, edge-case-heavy,
64
- migration, concurrency, shared-contract, or high-risk work.
65
- - Each mutable surface has one writer; independent non-overlapping surfaces may
66
- split, while coupled surfaces use one `deep` writer and ordered handoffs.
67
- - Oracle owns `plan-review` when review is explicitly selected or chosen by the
68
- bounded recommended fallback. Every route requires
69
- mandatory verification, but final-verification ownership is proportional:
70
- trivial deterministic Direct work may be verified by Root when Root is not
71
- self-approving its own implementation; materially risky Direct work and every
72
- Accelerated or Full final verify require a fresh read-only Oracle. The
73
- implementation writer never approves its own work.
74
-
75
- ## Progressive loading
76
-
77
- Resolve `<skill-dir>` as the directory containing this `SKILL.md`, and resolve
78
- `<skills-root>` as its parent directory. Every bundled path below is anchored to
79
- one of those installed roots, never to the project or current working directory.
80
-
81
- Use only installed local contracts during the pipeline. Never invoke the
82
- thoth-agents CLI, `npx skills add`, or a network fetch to advance an SDD phase.
83
- If a required contract or external skill is missing, stop and report an
84
- incomplete installation instead of provisioning it mid-workflow.
85
-
86
- Read only the current phase contract:
87
-
88
- | Phase | Contract |
89
- | --- | --- |
90
- | explore | `<skill-dir>/references/phases/explore.md` |
91
- | specify | `<skill-dir>/references/phases/specify.md` |
92
- | clarify | `<skill-dir>/references/phases/clarify.md` |
93
- | plan | `<skill-dir>/references/phases/plan.md` |
94
- | checklist | `<skill-dir>/references/phases/checklist.md` |
95
- | tasks | `<skill-dir>/references/phases/tasks.md` |
96
- | plan-review | `<skills-root>/plan-reviewer/SKILL.md` |
97
- | implement | `<skill-dir>/references/phases/implement.md` |
98
- | verify | `<skill-dir>/references/phases/verify.md` |
99
- | converge | `<skill-dir>/references/phases/converge.md` |
100
- | archive | `<skills-root>/thoth-archive/SKILL.md` |
101
-
102
- ## Validation gates
103
-
104
- Run the validator from its installed absolute path:
13
+ Every change begins with three proportional reasoning steps, in order:
14
+
15
+ 1. **Explore** enough repository and user context to understand the current
16
+ behavior, constraints, and uncertainty.
17
+ 2. **Specify** the intended outcome, non-goals, and observable acceptance in
18
+ concise working notes.
19
+ 3. **Clarify** material uncertainty. Use evidence or a safe bounded assumption
20
+ when it preserves the user's intent; ask only when a material human-owned
21
+ decision cannot safely be inferred. An unresolved material decision blocks
22
+ classification and implementation.
23
+
24
+ The root orchestrator owns completing these steps at a scale appropriate to the
25
+ change; discovery ownership follows the root delegation policy. The sequence
26
+ does not itself force a saved document, specialist-agent dispatch, or interview;
27
+ the root delegation policy determines staffing. The understanding sequence is
28
+ mandatory. Only after all three steps are complete does the orchestrator classify
29
+ using scope, uncertainty, and risk. Scope or risk that increases during implementation
30
+ reopens understanding and classification before further work. Never silently
31
+ resolve material product, architecture, security, or destructive choices.
32
+
33
+ ## Proportional classification
34
+
35
+ - **Small** means local impact, clear intent, and low risk. Local work may touch
36
+ several files within one area; file count alone never increases scope. Use
37
+ test-first implementation and focused verification; create no persistent
38
+ change record.
39
+ - **Substantial** means coordinated impact across multiple areas, cross-cutting
40
+ contract changes, material uncertainty, or elevated failure/contract risk. A
41
+ small patch can still be substantial when its risk demands planning. Persist
42
+ one record, plan and validate before implementation, then independently
43
+ verify and archive.
44
+
45
+ A user request cannot bypass the understanding sequence or material clarification.
46
+ Do not auto-increment package versions. Use native harness lifecycle and status;
47
+ never build a scheduler, state mirror, or process tooling.
48
+
49
+ ## Ownership and decisions
50
+
51
+ Root owns user intent, scope, material decisions, classification, and final
52
+ acceptance. Root also owns completing understanding, while the specific discovery
53
+ ownership policy determines who gathers evidence; that policy takes precedence
54
+ over generic permission for root to inspect directly. Choose an implementation
55
+ owner from the actual task shape after classification, following
56
+ specialist-default ownership and bounded direct-work exceptions.
57
+ Root retains known low-risk mechanical work, including reviewed commits, without
58
+ rediscovery.
59
+ Explicit direct-work or no-delegation instructions win. Preserve operator-selected
60
+ model and effort, including max. Keep one writer per mutable surface.
61
+
62
+ Every orchestrator choice with a meaningful recommended action states that
63
+ recommendation. Track confirmed answerless native returns separately per
64
+ question: after the first and second, repeat the same question without starting
65
+ dependent work; after the third, select the recommendation. Explicit answers win
66
+ and explicit `Stop` always wins. Pending, unavailable, failed, interrupted, or
67
+ host-prohibited attempts do not count. Report higher-priority host limits
68
+ accurately; do not claim three returns or an explicit user choice when they did
69
+ not occur. Never invent missing facts or secrets. When a human-owned choice
70
+ remains unresolved, a safe deferral can be the recommendation and leaves the
71
+ decision open.
72
+
73
+ At substantial `ready`, first show the user a concise plan summary (goal,
74
+ acceptance, key decisions, units, risks, record path), then always offer
75
+ `Review plan with Oracle (Recommended)` or `Proceed without review`, even when implementation was already authorized.
76
+ Silence is never an explicit review skip; run a fresh read-only review only when
77
+ selected. After a selected `[OKAY]`, separately offer `Implement (Recommended)` /
78
+ `Stop`; prior explicit authorization remains valid, while an explicit later
79
+ `Stop` supersedes it. Record the plan-review selection as
80
+ `EXPLICIT_REVIEW`, `EXPLICIT_SKIP`, or `DEFAULT_REVIEW_AFTER_3`; `SKIPPED`
81
+ requires `EXPLICIT_SKIP`, and `OKAY` requires an explicit review or the third-
82
+ return review default. A review result does not authorize implementation. Final
83
+ verification is always required: small low-risk work can use focused root
84
+ verification, while substantial or materially risky work requires a fresh
85
+ independent Oracle. An implementation writer never approves its own work. If the
86
+ user forbids delegation, perform authorized work directly but report unavailable
87
+ independent review; never claim independent PASS or archive.
88
+
89
+ ## Bounded execution
90
+
91
+ Apply these rules across all workflow stages. Each assignment names one
92
+ independently acceptable outcome, exact known entrypoints and skill paths,
93
+ concrete accepted inputs and dependencies, its produced result, owned writes and
94
+ interface boundaries, focused checks with pass evidence, and a meaningful return
95
+ milestone and stop condition. A task row names one outcome and may repeat an
96
+ `AC-n` when useful; split phases with separately acceptable outcomes and keep
97
+ tiny cohesive mechanical edits together. Independent, precise Explorer questions
98
+ may run in parallel within native capacity; dependent questions wait until root
99
+ accepts the named upstream output. Do not duplicate discovery. Missing inputs or
100
+ interfaces, conflicting ownership, a new independent outcome, or material scope
101
+ growth returns bounded progress to root for reassessment before expansion. Root reacts to
102
+ native attention or a missed agreed milestone; a timeout is not a progress plan.
103
+ After two consecutive attempts without new evidence or progress, return the
104
+ smallest blocker rather than looping. Use native notifications/waits without
105
+ polling or custom timers. Freeze relevant inputs before final validation, reuse fresh checks,
106
+ and preserve substantive handoffs across late notifications. Load the
107
+ [implementation phase](references/phases/implement.md) for the concrete procedure.
108
+
109
+ ## The sole substantial-change record
110
+
111
+ After substantial classification, create only
112
+ `.thoth/changes/<id>/<id>.md` from
113
+ `<skill-dir>/templates/change.md`. Use a safe lowercase kebab-case ID; reject
114
+ Windows-reserved names and unsafe path components. The record covers grounded
115
+ exploration, intent, non-goals, acceptance, material clarifications and settled
116
+ decisions, declared durable deltas, technical plan, tasks, authorization,
117
+ verification, and closeout. The record is the only per-change artifact. Do not
118
+ create sidecar specifications, plans, task lists, checklists, review or
119
+ verification reports, evidence directories, worker reports, scripts, execution
120
+ wrappers, or evidence generators, including temporary ones.
121
+
122
+ A durable delta uses `- \`ADDED capability\` **Exact title** — Normative statement.`
123
+ (or `MODIFIED`, `REMOVED`, `RENAMED capability FROM Previous title`). Every
124
+ non-removal includes ` - GIVEN ...; WHEN ...; THEN ... .` Before review, verify
125
+ the exact canonical baseline under `.thoth/specs/<capability>/spec.md`. In the
126
+ same change record's Verification section, include exactly one reviewed source
127
+ entry for every affected capability: the existing file's `sha256:<digest>` or
128
+ `absent` if no canonical spec exists. `ADDED` may target either an existing or
129
+ absent capability; other operations require an existing matching baseline. The
130
+ validator checks each digest or reviewed absence at `verify` and `closeout`,
131
+ not semantic quality.
132
+
133
+ Archiving moves the same record to
134
+ `.thoth/changes/archive/YYYY-MM-DD-<id>/<id>.md`; the date prefixes only the
135
+ directory and never changes the record filename or identity. Preserve historical
136
+ changes and fail closed on collisions or symlinked ancestors.
137
+
138
+ ## Progressive phase loading
139
+
140
+ Resolve `<skill-dir>` as this SKILL.md's directory and `<skills-root>` as its
141
+ parent. Read only the current phase under
142
+ `<skill-dir>/references/phases/{explore,specify,clarify,plan,checklist,tasks,implement,verify,converge}.md`;
143
+ plan review and archive are sibling skill contracts. Use installed local assets
144
+ only; do not provision skills or run a network installer mid-workflow.
145
+
146
+ ## Gates and CLI
105
147
 
106
148
  ```text
107
- node "<skill-dir>/scripts/validate.mjs" --change openspec/changes/<feature> --route <accelerated|full> --through <specify|plan|tasks|checklist|ready|closeout> --json
149
+ node "<skill-dir>/scripts/validate.mjs" --change .thoth/changes/<id> --through <explore|specify|clarify|plan|tasks|checklist|ready|verify|closeout> --json
108
150
  ```
109
151
 
110
- - **Accelerated**: `specify`, then `ready` after the fast-forward planning pass,
111
- then `closeout` after independent verification and an archive report marked
112
- `READY`.
113
- - **Full**: `specify`, `plan`, `tasks`, then `ready` before the optional review
114
- choice or implementation, and `closeout` after independent verification.
115
- - **Checklist**: run only when activated; the later `ready` gate includes it if
116
- present.
117
-
118
- `ready` validates the artifacts needed before the explicit or bounded-default
119
- `Review plan with Oracle (Recommended)` / `Proceed without review` choice.
120
- Review approval remains separate from implementation confirmation and never
121
- satisfies final verification.
122
- `closeout` additionally requires completed tasks, independent oracle PASS,
123
- complete FR/buildable-SC evidence, an observed PASS or explicit residual RISK
124
- for every outcome SC, and an archive report ready for the transactional archive
125
- transition.
126
-
127
- When implementation evidence refines the same intent, root updates the canonical
128
- artifact and revalidates only affected downstream artifacts/gates. A changed
129
- intent starts a new change. Structural validation prevents malformed artifacts;
130
- oracle still judges completeness, correctness, coherence, and evidence.
152
+ The early gates validate the one record proportionally. `plan` validates without
153
+ requiring tasks. `tasks` and `ready` require concrete coverage of every accepted
154
+ outcome. `ready` requires settled material decisions before the mandatory
155
+ plan-review offer or implementation authorization. Run `--through verify`
156
+ before requesting final Oracle: it requires everything `ready` does plus complete
157
+ tasks, review disposition and `**Plan review selection**` provenance,
158
+ implementation authorization, and reviewed source digests/baselines. It permits
159
+ final-review and Archive placeholders. `closeout` additionally requires a fresh
160
+ independent Oracle PASS, every acceptance outcome with concrete PASS
161
+ check/evidence, exactly one matching record SHA-256 field, and Archive READY.
162
+ The initial `PENDING` selection placeholder is allowed before `verify` only.
163
+ `SKIPPED` requires `EXPLICIT_SKIP`; `OKAY` requires `EXPLICIT_REVIEW` or
164
+ `DEFAULT_REVIEW_AFTER_3`. Every canonical spec affected by a durable delta must
165
+ have exactly one `Source` entry in the same record:
166
+ `- Source: .thoth/specs/<capability>/spec.md | sha256:<digest>` when present, or
167
+ `- Source: .thoth/specs/<capability>/spec.md | absent` when absent. Missing or
168
+ stale coverage blocks `verify`, closeout, and archive. Calculate the record hash
169
+ from exact UTF-8 bytes preceding the case-sensitive `## Authorization` heading.
170
+ After PASS, edits confined to Authorization, Verification, or Closeout need no
171
+ new review; any edit before `## Authorization` requires fresh independent review
172
+ and a new digest. This allowance never waives structural checks, truthful
173
+ provenance, stale-source rejection, or review of changed implementation.
174
+ Structural validation is not human authorization or independent approval. Oracle
175
+ examines the actual diff and checks, not just listed file digests.
176
+
177
+ Archive with the installed sibling `thoth-archive` only after closeout passes.
@@ -1,23 +1,3 @@
1
- # Checklist contract
1
+ # Checklist
2
2
 
3
- **Owner**: root<br>
4
- **Output**: `checklists/requirements.md`<br>
5
- **Activation**: high contract/failure risk, compliance sensitivity, or
6
- ambiguity-prone scope
7
-
8
- When activated, start from `<skill-dir>/templates/checklist.md`, where
9
- `<skill-dir>` is the directory containing the installed `thoth-sdd/SKILL.md`.
10
-
11
- Record the concrete activation reason. Use sequential `CHK###` items to audit
12
- the requirements—not implementation—across the base taxonomy: Completeness,
13
- Clarity, Consistency, Measurability, and Coverage.
14
-
15
- Add only applicable domain lenses, such as security, privacy, accessibility,
16
- compliance, performance, migration, or domain-specific failure rules. If none
17
- apply, record an evidence-backed `None` decision instead of boilerplate checks.
18
- Map every US, FR, SC, actor, failure mode, and relevant constraint to evidence.
19
-
20
- After clarification or planning changes, check affected revalidation items. If
21
- no requirement-affecting artifact changed, record an evidence-backed `Not
22
- required` no-op. Unresolved high-risk gaps return to specify; checklist status
23
- must never be inferred from code tests.
3
+ Optional audit for risk or acceptance ambiguity after planning. Assess completeness, clarity, consistency, measurability, and relevant domain coverage in the sole substantial record. Correct gaps there and revalidate affected gates; never create a second checklist artifact. An unresolved material gap blocks implementation. Checklist is not a prerequisite to planning or tasks.
@@ -1,15 +1,17 @@
1
- # Clarify contract
1
+ # Clarify
2
2
 
3
- **Owner**: root<br>
4
- **Activation**: material ambiguity only
3
+ Required for every change, but often satisfied by recording that no material
4
+ question remains. Use repository evidence or safe bounded assumptions for local
5
+ technical details. Ask only when unresolved human-owned intent materially
6
+ changes scope, behavior, architecture, security, or destructive impact; do not
7
+ force an interview.
5
8
 
6
- Classify requirement dimensions as **Clear**, **Partial**, or **Missing** across
7
- scope, actors, data, interactions, non-functional constraints, failure behavior,
8
- and success evidence. Resolve from repository evidence or a safe documented
9
- assumption first. Ask one targeted human question only when the answer materially
10
- changes the result; Full SDD should normally ask no more than five high-impact
11
- questions in one clarification pass.
9
+ When an orchestrator choice question has a meaningful recommended action, state
10
+ it and follow the per-question retry rule in the [Thoth SDD entrypoint](../../SKILL.md):
11
+ repeat after the first and second confirmed answerless returns without dependent
12
+ work, then select the recommendation after the third. Pending, unavailable,
13
+ failed, interrupted, and host-prohibited attempts do not count. Do not fabricate
14
+ facts or secrets; a safe deferral may preserve a human-owned choice as unresolved.
12
15
 
13
- Write every accepted answer directly into `spec.md`, cite the changed FR/SC/story,
14
- then re-run structural validation and revalidate any existing requirements
15
- checklist. Do not create a parallel clarification document.
16
+ Record the outcome in the one substantial record if one exists. An unresolved
17
+ material decision blocks classification, planning, and implementation.
@@ -1,14 +1,3 @@
1
- # Converge contract
1
+ # Converge
2
2
 
3
- **Owner**: root<br>
4
- **Activation**: failed artifact-backed verification
5
-
6
- Classify every oracle gap as `missing`, `partial`, `contradicts`, or
7
- `unrequested`. Append one traceable remediation task per actionable gap to a new
8
- Convergence section in `tasks.md`, ordered by severity and linked to its finding,
9
- FR/buildable SC, exact writer surface, and verification outcome.
10
-
11
- Never rewrite, renumber, reorder, or delete earlier tasks, and never edit product
12
- code during convergence. If no actionable gap exists, leave `tasks.md`
13
- byte-for-byte unchanged. Return to implement, then always ask oracle to verify
14
- again.
3
+ Optional after verification finds actionable defects. Root records only bounded remaining acceptance-linked work in the same substantial record; for small work, keep the in-session scope concise. Repair within settled intent, then repeat implementation and independent verification as warranted. If intent, scope, or risk materially changes, stop and reopen understanding and classification; do not widen silently. No convergence report.
@@ -1,10 +1,5 @@
1
- # Explore contract
1
+ # Explore
2
2
 
3
- **Owner**: explorer (read-only)<br>
4
- **Applies to**: Full
3
+ Required for every change, proportional to its scope and uncertainty. Root owns completing understanding and accepting evidence; the specific discovery ownership policy decides who gathers local evidence and takes precedence over generic permission for root to inspect directly. Use a bounded known-source question only where that policy permits it, and return before another unlocated discovery path. Do not repeat accepted discovery.
5
4
 
6
- Resolve only repository uncertainty that affects requirements or design. Inspect
7
- the smallest useful anchors and return relevant paths/symbols, confirmed current
8
- behavior, constraints, safe assumptions, unresolved human-owned decisions, and
9
- recommended specification anchors. Do not write files or return raw logs. Stop
10
- when root can specify without repeating discovery.
5
+ When evidence gathering is assigned, give each unit one precise question and one bounded result. Independent, precise Explorer questions can run in parallel within native capacity; dependent questions wait until root accepts the producer's concrete output. Return useful partial evidence at the agreed milestone, and stop before classification if a material human-owned decision cannot be safely inferred. No agent, document, report, or evidence directory is forced.
@@ -1,57 +1,58 @@
1
- # Implement contract
2
-
3
- **Owner**: adaptive root, `designer`, `quick`, or `deep` in every route; exactly
4
- one writer per mutable surface
5
-
6
- SDD routes govern artifacts and gates, not implementation ownership. Before
7
- implementation or dispatch, root records the decided owner, task-shape/net-gain
8
- rationale, exact paths, accepted FR/buildable-SC scope, non-goals, and
9
- verification commands. Route, file count, or cheaper model price alone is not an
10
- ownership rationale.
11
-
12
- Root may retain implementation when short or sequential work, shared mutable
13
- state, accumulated context, rediscovery, or coordination overhead outweighs
14
- delegation benefit. Delegate when specialization, context isolation, independent
15
- bounded work, quality, latency, or total cost creates demonstrated net gain. If
16
- root owns the surface, do not dispatch a writer. If a specialist owns it, send a
17
- bounded handoff with the exact surface, requirements, and checks.
18
-
19
- Root marks selected artifact-backed tasks `[~]`; Direct or no-artifact work has
20
- no task state. Use the mandatory `tdd` skill for behavior changes and work in
21
- vertical red/green slices. Child writers never edit task state; root marks `[x]`
22
- only after checking task-specific evidence.
23
-
24
- After deciding delegation creates net gain, select deterministically:
25
-
26
- - `designer` for user-facing UI/UX, interaction, accessibility, responsive, or
27
- visual-quality work;
28
- - `quick` for a known narrow mechanical low-risk surface with exact targets;
29
- - `deep` for coupled multi-file, shared-contract, migration, concurrency,
30
- edge-case-heavy, or high-risk work.
31
-
32
- Proven independent surfaces may use different writers only with non-overlapping
33
- ownership. Overlapping or compatibility-coupled work uses one `deep` writer and
34
- ordered handoffs. A writer escalates before expanding beyond its routing
35
- boundary. Every route requires mandatory verification, and the implementation
36
- writer never approves its own work. For trivial deterministic Direct work, Root
37
- may run the proportionate focused checks when Root is not self-approving its own
38
- implementation. For materially risky Direct work and every Accelerated or Full
39
- final verify, root hands the unchanged candidate to a fresh read-only Oracle.
40
-
41
- Implementation evidence may refine an artifact without restarting the workflow:
42
-
43
- - If it preserves the accepted intent, return the evidence to root; root updates
44
- the canonical artifact and revalidates only affected downstream artifacts and
45
- gates.
46
- - If it changes intent or accepted product scope, start a new change rather than
47
- silently expanding this one.
48
-
49
- Report files changed, checks executed, deviations, and remaining work.
50
-
51
- ## Native dispatch groups and waves
52
-
53
- For each ready group, confirm prerequisites, ordered lane tasks, exact path
54
- union, owner, requirements, and checks. Select the capacity-bounded set of
55
- undispatched ready lanes and create one fresh native specialist assignment per admitted lane. Issue every dispatch in that native wave before any wait, status,
56
- result collection, or root implementation action. Retain handles; when terminal evidence frees capacity, dispatch the next undispatched ready lane before waiting again. Validate terminal evidence per lane, while root alone updates task state. Cross the declared barrier only after every lane is terminal and reconciled. Preserve truthful capability/capacity fallback: when native
57
- concurrency is unavailable or width is one, use a truthful sequential fallback.
1
+ # Implement
2
+
3
+ Use the settled small request or authorized substantial record, exact mutable
4
+ bounds, and focused checks. Root owns user decisions and acceptance. Keep one
5
+ writer per surface. No process tools, wrappers, reports, or temporary artifacts.
6
+
7
+ ## Choose ownership, then bound the outcome
8
+
9
+ - Root retains known low-risk mechanical work, including reviewed commits;
10
+ inspect the relevant diff/index, check it, commit, and stop. Do not restart
11
+ exploration, planning, delegation, or full tests for an unchanged reviewed tree.
12
+ - Explicit direct-work or no-delegation instructions win. Otherwise delegate for
13
+ a concrete discovery, implementation, parallelism, or judgment benefit. Another
14
+ targeted search or file count does not force a new agent.
15
+ - Preserve operator-selected model and effort, including max. Efficiency comes
16
+ from bounded work and supervision, not changing those settings.
17
+ - Each assignment delivers one independently acceptable outcome. Start from its
18
+ accepted inputs and named dependencies; state the concrete output, exact known
19
+ entrypoints and skill paths, owner, owned writes and interface boundaries,
20
+ focused checks with pass evidence, and a meaningful return milestone and stop
21
+ condition. Read-only assignments state `none` for writes. Do not delegate an
22
+ entire broad integration without separately acceptable outputs or split by
23
+ file count.
24
+ - A dependent assignment starts only after root accepts the producer's output.
25
+ Missing inputs or interfaces, conflicting ownership, a new independent
26
+ outcome, or material scope or risk growth returns bounded progress to root for
27
+ reassessment before expansion. Keep one writer per surface and preserve the
28
+ native lifecycle, configured effort, and required independent verification.
29
+
30
+ ## Work until the outcome is satisfied, not until time runs out
31
+
32
+ - Start with supplied evidence. Read further only to answer a specific missing
33
+ fact; do not rediscover unchanged facts or search the user home for known skills.
34
+ - Behavior changes use focused red -> green tests. Batch independent short reads
35
+ or checks where supported. Stop cleanup at the assigned outcome's boundary.
36
+ - After two consecutive attempts without new evidence or progress, return the
37
+ partial result and smallest blocker. Escalate a missing interface or ownership
38
+ conflict before expanding scope. Productive long work is not failure by time.
39
+ - Root responds to native attention or a missed agreed milestone: inspect the
40
+ delta and next action, then continue concretely, narrow, or stop safely. A long
41
+ timeout is a safety ceiling, not a progress plan. Do not merely extend it.
42
+ - Use native completion notifications/waits, never polling, custom timers, or
43
+ scheduler tools. Without attention delivery, bound an assignment to return at
44
+ an agreed milestone. Reconcile termination before assigning a replacement.
45
+
46
+ ## Finish once, with fresh evidence
47
+
48
+ - Freeze relevant inputs before final validation. Reuse fresh checks for unchanged
49
+ inputs; rerun only checks invalidated by edits. Consolidate whole-project checks
50
+ after integration, not in every child. Report known external failures rather
51
+ than repeatedly rerunning identical checks without changed prerequisites.
52
+ - Reconcile owned background commands before returning. The final handoff includes
53
+ the actual outcome, changed surfaces, checks, limitations, and next action. A
54
+ late notification must preserve that handoff, not replace it with an acknowledgment.
55
+ - Final independent review remains separate. If explicitly prohibited, report
56
+ root-only checks and leave independent PASS/archive unavailable; no self-approval.
57
+
58
+ These are instruction-level safeguards, not a runtime scheduler or latency guarantee.
@@ -1,19 +1,3 @@
1
- # Plan contract
1
+ # Plan
2
2
 
3
- **Owner**: root<br>
4
- **Output**: `openspec/changes/<feature>/plan.md`
5
-
6
- Start from `<skill-dir>/templates/plan.md`, where `<skill-dir>` is the directory
7
- containing the installed `thoth-sdd/SKILL.md`. Read active constitution
8
- principles and record evidence-backed pre-design and post-design Constitution
9
- Checks. Extract the exact active numbered principle headings once, then reuse
10
- that same ordered name set in both checks; only status and evidence may differ.
11
- Routine SDD does not amend the constitution or run its lifecycle validator;
12
- activate `thoth-constitution` only when an explicit constitution amendment is
13
- in scope.
14
-
15
- Map each technical choice to FR/SC or a confirmed repository constraint. Name
16
- affected components, interfaces, exact paths, migrations, risks, rollback, and
17
- verification seams. Create `research.md`, `data-model.md`, `contracts/`, or
18
- `quickstart.md` only when that artifact resolves a concrete implementation risk.
19
- Any unexplained constitution failure blocks tasks.
3
+ For substantial work, translate settled intent into a compact technical approach in the same ID-named `.thoth/changes/<id>/<id>.md` record. Capture relevant interfaces, mutable surfaces, durable deltas, dependencies, risks, and focused verification seams. Describe useful work-unit boundaries with concrete accepted inputs, produced outputs, and dependencies; identify owned writes, interface boundaries, focused checks with pass evidence, and meaningful return and stop conditions where known. Keep the approach decision-ready without writing task rows before the tasks phase. Plan validation is independent of tasks: the `plan` gate must pass before tasks exist. A later material change reopens understanding and classification. Do not make an auxiliary plan document or auto-increment package versions.
@@ -1,34 +1,3 @@
1
- # Specify contract
1
+ # Specify
2
2
 
3
- **Owner**: root<br>
4
- **Output**: `openspec/changes/<feature>/spec.md`
5
-
6
- Start from `<skill-dir>/templates/spec.md`, where `<skill-dir>` is the directory
7
- containing the installed `thoth-sdd/SKILL.md`, and remain
8
- implementation-neutral.
9
-
10
- - Record **Why**, **Impact**, and affected kebab-case capability slugs (or
11
- `None`).
12
- - Define prioritized, independently testable `US#` stories. Every story needs
13
- `Covers: FR-###, SC-###` and Given/When/Then acceptance scenarios.
14
- - Before choosing durable delta metadata, read
15
- `openspec/specs/<capability>/spec.md` when it exists and compare the exact
16
- `### Requirement:` titles and normative behavior:
17
- - use `ADDED` only when no canonical requirement already expresses the
18
- behavior;
19
- - use `MODIFIED` or `REMOVED` only with the exact existing title;
20
- - use `RENAMED <capability> FROM <exact previous title>` when the title changes;
21
- - only `ADDED` is valid when the canonical capability does not exist.
22
- A validator warning on `ADDED` into an existing nonempty capability requires
23
- semantic-overlap review; exact-title validity alone does not prove new intent.
24
- - Give every sequential FR a descriptive title, a normative `MUST`/`SHALL`
25
- statement, and exactly one delta marker: `INTERNAL`, `ADDED`, `MODIFIED`,
26
- `REMOVED`, or `RENAMED ... FROM ...`.
27
- - Type each measurable SC as `buildable` or `outcome`. Buildable criteria require
28
- implementation coverage; outcome criteria remain product/operational
29
- verification targets without fake tasks.
30
- - State assumptions, dependencies, edge cases, and explicit non-goals.
31
-
32
- Do not advance while a material ambiguity would change scope, behavior,
33
- architecture, or durable delta intent. Run the `specify` gate before planning;
34
- do not defer canonical delta reconciliation until archive.
3
+ Required for every change, proportional to its impact. From accepted user intent and exploration, define concise observable outcomes, non-goals, and meaningful edge cases. Do not create a document or dispatch a specialist as a prerequisite. After all understanding steps, a substantial classification creates the sole `.thoth/changes/<id>/<id>.md` record; small work leaves no persistent record. Check `.thoth/specs/` baselines for declared durable deltas. A material ambiguity must be clarified before classification; do not invent authorization.