quest-loop 0.1.0 → 0.3.2

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,143 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [SemVer](https://semver.org/).
6
6
 
7
+ ## Unreleased
8
+
9
+ ## [0.3.2] — 2026-07-08
10
+
11
+ ### Added
12
+ - Added Claude setup parity: `quest claude install-agents --scope project` and
13
+ `quest claude doctor` now mirror the existing Codex setup flow.
14
+
15
+ ### Changed
16
+ - `quest init` now installs project-scoped Codex and Claude native agent
17
+ templates by default, `--no-agents` skips that install, and conflicting
18
+ project templates fail init before `.quests/` is created unless users
19
+ intentionally rerun the explicit provider install command with `--force`.
20
+ - `$quest:orchestrate` now states that Codex native subagents are the default
21
+ dispatch path for serial and parallel waves; `quest-run` is fallback-only
22
+ unless headless/background execution is explicitly requested.
23
+ - `$quest:plan` now routes accepted Plan Mode implementation requests straight
24
+ to the orchestrator role instead of leaving room for parent-session
25
+ `$quest:work` execution.
26
+
27
+ ### Fixed
28
+ - `quest codex doctor` now fails on stale `quest` binaries on PATH, stale
29
+ installed Codex plugin versions, and duplicate Quest skill roots in
30
+ `codex debug prompt-input "noop"` output.
31
+
32
+ ## [0.3.1] — 2026-07-08
33
+
34
+ ### Changed
35
+ - `$quest:orchestrate` now documents Codex/Claude native subagent parity:
36
+ orchestrator-level goals, goal-mode executor/reviewer dispatch prompts, and
37
+ `quest-run --codex-goal-mode require` as the Codex headless fallback.
38
+ - `$quest:plan` now makes the accepted Plan Mode handoff explicit: the parent
39
+ session becomes the orchestrator and spawned quest executors implement the
40
+ code.
41
+ - `$quest:plan` now requires generated `quest create` commands to specify
42
+ `--worker`, `--model`, and `--effort` explicitly, and asks the user before
43
+ entering `$quest:orchestrate`.
44
+ - `quest codex doctor` now checks Codex `multi_agent` feature availability and
45
+ describes native-agent checks as installed template parity.
46
+ - Wave-level orchestrator goals now treat `cancelled` quests as terminal
47
+ alongside `complete` and `blocked` store statuses.
48
+
49
+ ### Fixed
50
+ - `quest codex doctor` now checks Codex `goals` feature availability, so a
51
+ setup with `multi_agent=true` but goal tools disabled fails readiness instead
52
+ of green-lighting native goal-mode dispatch.
53
+
54
+ ## [0.3.0] — 2026-07-08
55
+
56
+ ### Added
57
+ - `$quest:setup` skill plus `quest codex doctor` for native Codex validation:
58
+ checks Codex CLI availability, installed `quest@quest` version, hook parser
59
+ health, neutral-directory Quest skill roots, and native `quest-executor` /
60
+ `quest-reviewer` custom-agent availability.
61
+ - `quest codex install-agents --scope project|user` installs Quest's bundled
62
+ agent TOML files into Codex's native `.codex/agents` or `~/.codex/agents`
63
+ locations. The command is idempotent, supports `--dry-run`, and requires
64
+ `--force` before replacing different existing agent files.
65
+ - `quest --version` reports the package version.
66
+ - `quest-run --codex-goal-mode auto|require|off` controls how headless Codex
67
+ runs treat goal tools. `auto` is the default and uses documented
68
+ `codex exec --json --output-schema` output as the contract; `require` blocks
69
+ honestly when `create_goal` is not observed; `off` avoids goal-tool prompts.
70
+
71
+ ### Changed
72
+ - Codex is now the first-class plugin path in docs and skill UI metadata:
73
+ examples use `$quest:*`, the Codex setup flow runs `quest codex doctor`, and
74
+ `package.json`, `.claude-plugin/plugin.json`, and `.codex-plugin/plugin.json`
75
+ now share the same version.
76
+ - `codex exec resume` invocations no longer pass unsupported `-C`; the runner
77
+ relies on the child process working directory and original Codex session.
78
+ - Bundled hooks now prefer `CODEX_PLUGIN_ROOT` with a `CLAUDE_PLUGIN_ROOT`
79
+ fallback, include a `resume` SessionStart matcher, status messages, timeouts,
80
+ and Windows command variants.
81
+
82
+ ### Fixed
83
+ - SubagentStop hook now recognizes Codex JSONL `command_execution` entries in
84
+ addition to Claude-style `tool_use.input.command` blocks, while preserving the
85
+ mutating-verb-only detection rule.
86
+
87
+ ## [0.2.0] — 2026-07-08
88
+
89
+ ### Added
90
+ - `quest reopen <id> --reason <why>` — the audited exit from `complete`. Flips a
91
+ completed quest back to `in_progress` on both backends, recording the reason in
92
+ a real checkpoint via the new optional `reopen_reason` field; the GitHub backend
93
+ reopens the mirrored issue and swaps `quest:complete → quest:in-progress`.
94
+ `TRANSITIONS.complete` stays empty — a checkpoint can never resurrect a complete
95
+ quest; only the explicit verb can, and `cancelled` remains fully terminal.
96
+ Reopening a child of a complete parent epic warns on stderr that the epic's
97
+ verdict may be falsified. Reopened quests do not re-enter `quest list --ready`;
98
+ they are dispatched directly by id. `quest edit` on a complete or cancelled
99
+ quest now errors with a reopen-first / file-a-new-quest hint, and `quest-run`
100
+ on an already-complete quest suggests the verb instead of silently no-opping.
101
+
102
+ ### Changed
103
+ - Wave composition now treats epics (parent quests) as orchestrator-closed, not
104
+ worker-dispatched. `quest list --ready` excludes any quest with a non-terminal
105
+ child (a child in complete or cancelled is terminal, so a cancelled child no
106
+ longer wedges its epic), in both the local and GitHub backends. `quest-run
107
+ --ready` additionally refuses to auto-dispatch a quest that has children even
108
+ once they are all terminal, logging an actionable "is an epic — close it inline
109
+ per $quest:orchestrate" line; a direct `quest-run <id>` on an epic stays
110
+ allowed. The orchestrate skill gains a "Closing an epic" procedure and the plan
111
+ skill documents that epic contracts are integration-level only.
112
+
113
+ ### Fixed
114
+ - SubagentStop hook now keys quest-executor detection to real *mutating*
115
+ invocations — `quest start <id>` or `quest checkpoint <id>` (under any binary
116
+ prefix: `quest`, `./bin/quest`, `node bin/quest`) — instead of the read-only
117
+ `quest show <id> --json` orientation call. Reviewers and orchestrators that run
118
+ only read verbs (show / list / protocol / runs) never owned a quest, so they are
119
+ allowed silently; this removes a false positive where a read-only quest-reviewer
120
+ was blocked at stop for merely inspecting a terminal quest. A `quest checkpoint`
121
+ invocation counts too, so an executor resuming an already-in_progress quest
122
+ (which skips `quest start`) is still detected. The first mutating invocation wins
123
+ (deterministic); the executor block, per-entry parsing that keeps skill-text
124
+ examples from keying detection, and conservative allow-on-ambiguity are all
125
+ preserved.
126
+ - SubagentStop hook now derives the quest-executor id by parsing the transcript
127
+ JSONL per-entry and matching its marker only inside real tool_use command
128
+ invocations — never prose, examples, or echoed file contents. This removes a
129
+ false positive where skill-text examples keyed the detection ahead of the
130
+ executor's real call. The first real invocation wins (deterministic);
131
+ conservative allow-on-ambiguity is preserved.
132
+
133
+ ## [0.1.1] — 2026-07-07
134
+
135
+ ### Fixed
136
+ - Codex plugin hook config now uses the strict top-level `hooks` schema that
137
+ Codex accepts, removing the startup parse warning caused by an extra
138
+ `description` field.
139
+
140
+ ### Changed
141
+ - Manifest validation now checks `hooks/hooks.json` for Codex-compatible
142
+ top-level fields before packaging or release.
143
+
7
144
  ## [0.1.0] — 2026-07-07
8
145
 
9
146
  First public release. The build of this release was itself executed as quests
package/README.md CHANGED
@@ -12,17 +12,17 @@ actually read.
12
12
  - `quest` — the quest store: contracts, checkpoints, wave scheduling. Local
13
13
  markdown files by default; GitHub Issues opt-in.
14
14
  - `quest-run` — the headless runner: drives `claude -p` or `codex exec` workers
15
- in native goal mode with deterministic budgets and notifications.
16
- - Five skills — `/quest:plan`, `/quest:work`, `/quest:orchestrate`,
17
- `/quest:retro`, `/quest:protocol`.
18
- - Two agents — `quest-executor`, `quest-reviewer`.
15
+ with deterministic budgets, notifications, and checkpoint-based stop checks.
16
+ - Six skills — `$quest:plan`, `$quest:work`, `$quest:orchestrate`,
17
+ `$quest:retro`, `$quest:protocol`, `$quest:setup`.
18
+ - Two native-agent templates — `quest-executor`, `quest-reviewer`.
19
19
 
20
20
  ## The idea in 30 seconds
21
21
 
22
22
  ```
23
- you: /quest:plan add dark mode to the settings page
23
+ you: $quest:plan add dark mode to the settings page
24
24
  agent: creates quest 12 — Objective, Done-when, Validation loop… (quest create)
25
- you: /quest:orchestrate
25
+ you: $quest:orchestrate
26
26
  agent: dispatches a worker on quest 12; it iterates: milestone → validate →
27
27
  commit → checkpoint. You review evidence, not vibes.
28
28
  ```
@@ -39,7 +39,7 @@ npm install -g quest-loop
39
39
  ```
40
40
 
41
41
  Puts `quest` and `quest-run` on your PATH everywhere — no harness required.
42
- The plugin installs below add the skills, agents, and hooks on top.
42
+ The plugin installs below add the skills, hooks, and native-agent setup on top.
43
43
 
44
44
  ### Claude Code
45
45
 
@@ -53,6 +53,14 @@ Then, inside a Claude Code session:
53
53
  /plugin install quest@quest
54
54
  ```
55
55
 
56
+ Install Quest's project-scoped Claude agent templates and verify the local
57
+ Claude setup with:
58
+
59
+ ```bash
60
+ quest claude install-agents --scope project
61
+ quest claude doctor
62
+ ```
63
+
56
64
  For local development against a checkout, point Claude Code at the repo directly
57
65
  — no marketplace needed:
58
66
 
@@ -62,14 +70,46 @@ claude --plugin-dir .
62
70
 
63
71
  ### Codex
64
72
 
65
- The plugin ships a `.codex-plugin/` manifest and discovers its skills from the
66
- repo checkout (`skills/`, surfaced under `.agents/` for Codex). Until a public
67
- Codex marketplace listing is approved upstream, wire it up from a clone or
68
- submodule:
73
+ The plugin ships a `.codex-plugin/` manifest plus the same Git marketplace
74
+ metadata used by Claude Code. Install the marketplace once, then install the
75
+ plugin from that marketplace:
76
+
77
+ ```bash
78
+ codex plugin marketplace add robertsreberski/quest
79
+ codex plugin add quest@quest
80
+ ```
81
+
82
+ Start a new Codex thread after installing so the skills and hooks are loaded.
83
+ Verify the install with:
84
+
85
+ ```bash
86
+ codex plugin list --marketplace quest
87
+ quest codex install-agents --scope project
88
+ quest codex doctor
89
+ codex debug prompt-input "noop"
90
+ ```
91
+
92
+ `quest codex doctor` checks the installed plugin version, Codex `multi_agent`
93
+ support, hook parser, neutral skill roots, and installed native-agent templates.
94
+ `codex debug prompt-input "noop"` should not print any hook parse warnings.
95
+
96
+ #### Updating the Codex plugin
97
+
98
+ Codex installs plugins from a marketplace snapshot. Pulling this Git repo or
99
+ publishing a new tag is not enough to update the already-installed plugin cache.
100
+ Refresh the marketplace snapshot, then reinstall the plugin from it:
101
+
102
+ ```bash
103
+ codex plugin marketplace upgrade quest
104
+ codex plugin add quest@quest
105
+ codex plugin list --marketplace quest
106
+ quest codex doctor
107
+ ```
108
+
109
+ Then start a new Codex thread. If the update contains hook changes, re-run:
69
110
 
70
111
  ```bash
71
- git clone https://github.com/robertsreberski/quest
72
- # add the checkout to your Codex plugin/skill discovery path (clone or submodule)
112
+ codex debug prompt-input "noop"
73
113
  ```
74
114
 
75
115
  The CLI (`quest`, `quest-run`) is harness-agnostic — it works the same whether
@@ -97,18 +137,62 @@ quest lint --all
97
137
  quest list --ready
98
138
  ```
99
139
 
100
- Work the quest **in-session** with the skill:
140
+ By default, `quest init` also installs project-scoped native agent templates for
141
+ both providers:
142
+
143
+ - `.codex/agents/quest-executor.toml`
144
+ - `.codex/agents/quest-reviewer.toml`
145
+ - `.claude/agents/quest-executor.md`
146
+ - `.claude/agents/quest-reviewer.md`
147
+
148
+ Use `quest init --no-agents` when you only want the `.quests/` store. If an
149
+ existing project agent template would be replaced, init fails before creating
150
+ `.quests/`; inspect the conflicting files, run the explicit provider install
151
+ command with `--force` only if you intend to replace them, then rerun
152
+ `quest init`.
153
+
154
+ Project-scoped agent templates install at the Git repository root. For a nested
155
+ quest store, run `quest init --no-agents` in the nested directory and set
156
+ `QUEST_DIR` for agents launched from elsewhere, or initialize from the repo root.
157
+
158
+ Work one small quest **in-session** with the skill:
101
159
 
102
160
  ```
103
- /quest:work 12
161
+ $quest:work 12
104
162
  ```
105
163
 
164
+ In Claude Code, use the same bundled skills through the `/quest:*` slash-command
165
+ form.
166
+
106
167
  …or **headless** with the runner:
107
168
 
108
169
  ```bash
109
170
  quest-run 12
110
171
  ```
111
172
 
173
+ For planned or multi-quest work, prefer orchestration:
174
+
175
+ ```
176
+ $quest:orchestrate
177
+ ```
178
+
179
+ In Codex, the orchestrator sets a wave-level `create_goal`, then spawns native
180
+ `quest-executor` / `quest-reviewer` subagents with their own quest-level goals.
181
+ In Claude Code, the same flow uses `/goal` and the same bundled subagents. If a
182
+ Codex native subagent surface is unavailable after `tool_search`, or if you
183
+ explicitly want headless/background execution, use the fallback with goal mode
184
+ required:
185
+
186
+ ```bash
187
+ quest-run 12 --worker codex --codex-goal-mode require
188
+ ```
189
+
190
+ When a `$quest:plan` result is accepted from Plan Mode, the parent agent should
191
+ stay the orchestrator: create/lint quest records if needed, set the wave goal,
192
+ spawn subagents, verify checkpoints, and rule on reviewer findings. Product
193
+ implementation belongs to the spawned executor for each quest, not to the parent
194
+ session via `$quest:work`.
195
+
112
196
  Each iteration ends by recording evidence — a checkpoint a fresh session can
113
197
  resume from:
114
198
 
@@ -137,26 +221,29 @@ full base protocol lives in
137
221
 
138
222
  | Command | Purpose |
139
223
  |---|---|
140
- | `quest init` | Create a quest store (`.quests/`) in the current directory |
224
+ | `quest init` | Create a quest store (`.quests/`) and install project-scoped Codex/Claude agent templates by default |
141
225
  | `quest create` | Create a new quest (the only way records are born) |
142
226
  | `quest list` | List quests (filter by status, parent, or readiness) |
143
227
  | `quest show` | Show a quest record in full |
144
228
  | `quest start` | Mark a quest in_progress (todo → in_progress) |
145
229
  | `quest checkpoint` | Record iteration evidence and drive the quest's status |
146
230
  | `quest cancel` | Cancel a quest (terminal; reason is recorded) |
231
+ | `quest reopen` | Reopen a complete quest back into the loop (complete → in_progress; reason recorded) |
147
232
  | `quest edit` | Compatibly expand a quest (additions only; anchors are immutable) |
148
233
  | `quest lint` | Check records against the contract spec |
149
234
  | `quest amend` | Append a numbered protocol amendment (retro output) |
150
235
  | `quest protocol` | Print the loop protocol + this store's local amendments |
151
236
  | `quest runs` | Show headless runner activity (from `.quests/runs.ndjson`) |
237
+ | `quest codex` | Validate Codex-native setup and install Codex native agent templates |
238
+ | `quest claude` | Validate Claude-native setup and install Claude native agent templates |
152
239
 
153
240
  ## quest-run (headless runner)
154
241
 
155
242
  `quest-run <id>` drives a worker through the same loop without you in the chair:
156
243
 
157
244
  - **Workers** — `claude` (`claude -p`) or `codex` (`codex exec`), selected per
158
- quest. Both run in **native goal mode** with a machine-verifiable completion
159
- condition.
245
+ quest. Both use a machine-verifiable Quest checkpoint completion condition;
246
+ Codex goal tools are optional by default and can be required explicitly.
160
247
  - **Budgets** — deterministic iteration, cost, token, and per-session
161
248
  wall-clock (`--session-timeout`, default 1800s) caps; two sessions without a
162
249
  new checkpoint (a killed hung session counts as one) auto-writes a `blocked`
@@ -165,6 +252,12 @@ full base protocol lives in
165
252
  goes through the `quest` CLI, and the runs journal stays local.
166
253
  - **`--parallel N`** — with `--ready`, promotes and works newly-ready quests
167
254
  across dependency waves, up to N at a time.
255
+ - **Epics are never auto-dispatched** — a quest with children stays out of
256
+ `--ready` until every child is terminal, and `quest-run --ready` refuses it
257
+ even then (it logs an "is an epic" skip line). Epics are closed by the
258
+ orchestrator inline per `$quest:orchestrate`, not by burning a worker run on
259
+ pure verification. A direct `quest-run <id>` on an epic still runs, if you
260
+ really mean to.
168
261
  - **`--notify '<cmd>'`** — runs a templated command on run start/stop so you get
169
262
  pinged; notify failures are isolated from the run.
170
263
  - **`--codex-sandbox <mode>`** — selects the `codex exec` sandbox
@@ -175,12 +268,19 @@ full base protocol lives in
175
268
  must commit has to opt into **`danger-full-access`** — which also grants full
176
269
  disk and network access. The runner never escalates the sandbox silently; the
177
270
  safe `workspace-write` stays the default. (Claude workers ignore this flag.)
271
+ - **`--codex-goal-mode <mode>`** — selects how `quest-run` treats Codex goal
272
+ tools (`auto` | `require` | `off`; resolved as flag → config
273
+ `defaults.codex.goal_mode` → default `auto`). `auto` uses the documented
274
+ `codex exec --json --output-schema` stream as the contract and lets Codex use
275
+ goal tools if they are available. `require` blocks honestly if the exec
276
+ surface does not expose or invoke `create_goal`. `off` never asks for goal
277
+ tools.
178
278
 
179
279
  Inspect activity with `quest runs --active`.
180
280
 
181
281
  > **Note:** `quest-run` ships with this build's runner milestone (tracked as
182
282
  > quest 5). On a pre-0.1.0 checkout where `bin/quest-run` isn't present yet, use
183
- > `/quest:work` in-session instead.
283
+ > `$quest:work` in-session instead.
184
284
 
185
285
  ## Store backends
186
286
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quest-executor
3
- description: Works exactly one quest record iteratively per the quest protocol until complete or blocked, recording checkpoint evidence via the quest CLI. Dispatch with the quest id; pass the record's model/effort as the dispatch override. <example>Orchestrator sees quest 12 ready with worker claude → dispatches quest-executor with "Work quest 12 per /quest:work"; it iterates milestone-by-milestone and ends with a recorded checkpoint.</example> <example>A quest sits blocked after a human ruling → redispatch quest-executor with the ruling; it resumes from the checkpoint trail alone.</example>
3
+ description: Works exactly one quest record iteratively per the quest protocol until complete or blocked, recording checkpoint evidence via the quest CLI. Dispatch with the quest id; pass the record's model/effort as the dispatch override. <example>Orchestrator sees quest 12 ready with worker claude → dispatches quest-executor with "Work quest 12 per $quest:work"; it iterates milestone-by-milestone and ends with a recorded checkpoint.</example> <example>A quest sits blocked after a human ruling → redispatch quest-executor with the ruling; it resumes from the checkpoint trail alone.</example>
4
4
  model: opus
5
5
  effort: xhigh
6
6
  tools: Bash, Read, Edit, Write, Glob, Grep, WebFetch, WebSearch, NotebookEdit
@@ -12,13 +12,23 @@ only insofar as it is recorded in the quest's checkpoint trail.
12
12
 
13
13
  ## First actions, always
14
14
 
15
+ Enter native goal mode before doing implementation work:
16
+
17
+ ```text
18
+ /goal quest <id> has a new checkpoint whose quest_status is complete or blocked
19
+ in `quest show <id> --json`
20
+ ```
21
+
22
+ If the harness cannot set that goal, say so in your final report; the
23
+ checkpoint trail is still mandatory.
24
+
15
25
  ```bash
16
26
  quest show <id> --json # the contract and every prior checkpoint
17
27
  quest protocol # the loop rules + this store's amendments
18
28
  git log --oneline -5
19
29
  ```
20
30
 
21
- Then follow the work skill (`/quest:work`) exactly: smallest unfinished
31
+ Then follow the work skill (`$quest:work`) exactly: smallest unfinished
22
32
  milestone → the quest's STATED validation loop → commit green → `quest
23
33
  checkpoint`. The record is your entire spec; if you need context it doesn't
24
34
  give you, read the code it points at — and if it's genuinely insufficient,
@@ -6,11 +6,17 @@ You execute ONE quest. Decomposition, dispatching, and rulings belong to the
6
6
  orchestrator. Your work exists only insofar as it is recorded in the quest's
7
7
  checkpoint trail.
8
8
 
9
- First actions, always: `quest show <id> --json`, `quest protocol`,
10
- `git log --oneline -5`. Then follow the work skill exactly: smallest unfinished
11
- milestone -> the quest's STATED validation loop -> commit green ->
12
- `quest checkpoint`. The record is your entire spec; if it is genuinely
13
- insufficient, checkpoint blocked saying exactly what is missing.
9
+ First actions, always: call `create_goal` with the stopping condition "quest
10
+ <id> has a new checkpoint whose quest_status is complete or blocked in
11
+ `quest show <id> --json`"; verify it with `get_goal`; then run `quest show <id>
12
+ --json`, `quest protocol`, and `git log --oneline -5`. If goal tools are not
13
+ available, say so honestly in your final report; the checkpoint trail is still
14
+ mandatory.
15
+
16
+ Then follow the work skill exactly: smallest unfinished milestone -> the quest's
17
+ STATED validation loop -> commit green -> `quest checkpoint`. The record is your
18
+ entire spec; if it is genuinely insufficient, checkpoint blocked saying exactly
19
+ what is missing.
14
20
 
15
21
  Non-negotiable backstops:
16
22
  - Never stop without recording a checkpoint via `quest checkpoint`.
@@ -23,5 +29,6 @@ Non-negotiable backstops:
23
29
 
24
30
  Final report: run `quest show <id>` so recorded state is visible, then report
25
31
  the quest_status you recorded, the checkpoint timestamp, and a one-line
26
- evidence summary citing the decisive command + result.
32
+ evidence summary citing the decisive command + result. Only call
33
+ `update_goal(status="complete")` after the checkpoint exists.
27
34
  """
@@ -11,6 +11,15 @@ not fix anything — you report findings the orchestrator must disposition.
11
11
 
12
12
  ## Procedure
13
13
 
14
+ Enter native goal mode before verification:
15
+
16
+ ```text
17
+ /goal return an accept or iterate verdict for quest <id> with evidence
18
+ ```
19
+
20
+ If the harness cannot set that goal, say so in your report; the review verdict
21
+ and evidence are still mandatory.
22
+
14
23
  1. Read the contract and trail: `quest show <id> --json`, `quest protocol`.
15
24
  2. Read the ACTUAL changes (diff/commits the checkpoints cite), not the
16
25
  summary of them.
@@ -5,17 +5,21 @@ developer_instructions = """
5
5
  You verify, adversarially, that a quest claiming complete earned it. You do not
6
6
  fix anything — you report findings the orchestrator must disposition.
7
7
 
8
- Procedure: read the contract and trail (`quest show <id> --json`,
9
- `quest protocol`); read the ACTUAL changes the checkpoints cite, not the
10
- summary; re-run the quest's stated Validation loop yourself claims must
11
- reproduce; interrogate each Done-when item (which command output proves it?
12
- was a stated check substituted silently? were tests edited to pass? did scope
13
- drift past the Objective without a recorded expansion?); check the trail
14
- itself (could a zero-context session resume from the record alone?).
8
+ Procedure: first call `create_goal` with the stopping condition "return an
9
+ accept or iterate verdict for quest <id> with evidence"; verify it with
10
+ `get_goal`. If goal tools are not available, say so honestly in your report;
11
+ the review verdict and evidence are still mandatory. Then read the contract and
12
+ trail (`quest show <id> --json`, `quest protocol`); read the ACTUAL changes the
13
+ checkpoints cite, not the summary; re-run the quest's stated Validation loop
14
+ yourself claims must reproduce; interrogate each Done-when item (which command
15
+ output proves it? was a stated check substituted silently? were tests edited to
16
+ pass? did scope drift past the Objective without a recorded expansion?); check
17
+ the trail itself (could a zero-context session resume from the record alone?).
15
18
 
16
19
  Report findings ordered by severity, each with the evidence (command + output
17
20
  or file + symbol) and why it blocks acceptance. If nothing survived scrutiny,
18
21
  say "no findings" plainly — do not invent nitpicks. End with a verdict:
19
22
  accept, or iterate with exactly what must change. Every finding must receive a
20
23
  disposition (fixed / follow-up quest / rejected-with-reason) before acceptance.
24
+ Only call `update_goal(status="complete")` after the verdict exists.
21
25
  """
package/hooks/hooks.json CHANGED
@@ -1,30 +1,65 @@
1
1
  {
2
- "description": "Quest goal-loop hooks: inject in-flight quest context at session start, and block quest-executor subagents that try to stop without recording a checkpoint.",
3
2
  "hooks": {
4
3
  "SessionStart": [
5
4
  {
6
5
  "matcher": "startup",
7
6
  "hooks": [
8
- { "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs\"" }
7
+ {
8
+ "type": "command",
9
+ "command": "root=\"${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; [ -n \"$root\" ] && node \"$root/hooks/session-start.mjs\"",
10
+ "commandWindows": "if defined CODEX_PLUGIN_ROOT (node \"%CODEX_PLUGIN_ROOT%\\hooks\\session-start.mjs\") else if defined CLAUDE_PLUGIN_ROOT (node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\session-start.mjs\")",
11
+ "timeout": 10,
12
+ "statusMessage": "Loading quest state"
13
+ }
14
+ ]
15
+ },
16
+ {
17
+ "matcher": "resume",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "root=\"${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; [ -n \"$root\" ] && node \"$root/hooks/session-start.mjs\"",
22
+ "commandWindows": "if defined CODEX_PLUGIN_ROOT (node \"%CODEX_PLUGIN_ROOT%\\hooks\\session-start.mjs\") else if defined CLAUDE_PLUGIN_ROOT (node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\session-start.mjs\")",
23
+ "timeout": 10,
24
+ "statusMessage": "Loading quest state"
25
+ }
9
26
  ]
10
27
  },
11
28
  {
12
29
  "matcher": "clear",
13
30
  "hooks": [
14
- { "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs\"" }
31
+ {
32
+ "type": "command",
33
+ "command": "root=\"${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; [ -n \"$root\" ] && node \"$root/hooks/session-start.mjs\"",
34
+ "commandWindows": "if defined CODEX_PLUGIN_ROOT (node \"%CODEX_PLUGIN_ROOT%\\hooks\\session-start.mjs\") else if defined CLAUDE_PLUGIN_ROOT (node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\session-start.mjs\")",
35
+ "timeout": 10,
36
+ "statusMessage": "Loading quest state"
37
+ }
15
38
  ]
16
39
  },
17
40
  {
18
41
  "matcher": "compact",
19
42
  "hooks": [
20
- { "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs\"" }
43
+ {
44
+ "type": "command",
45
+ "command": "root=\"${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; [ -n \"$root\" ] && node \"$root/hooks/session-start.mjs\"",
46
+ "commandWindows": "if defined CODEX_PLUGIN_ROOT (node \"%CODEX_PLUGIN_ROOT%\\hooks\\session-start.mjs\") else if defined CLAUDE_PLUGIN_ROOT (node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\session-start.mjs\")",
47
+ "timeout": 10,
48
+ "statusMessage": "Loading quest state"
49
+ }
21
50
  ]
22
51
  }
23
52
  ],
24
53
  "SubagentStop": [
25
54
  {
26
55
  "hooks": [
27
- { "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/subagent-stop.mjs\"" }
56
+ {
57
+ "type": "command",
58
+ "command": "root=\"${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; [ -n \"$root\" ] && node \"$root/hooks/subagent-stop.mjs\"",
59
+ "commandWindows": "if defined CODEX_PLUGIN_ROOT (node \"%CODEX_PLUGIN_ROOT%\\hooks\\subagent-stop.mjs\") else if defined CLAUDE_PLUGIN_ROOT (node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\subagent-stop.mjs\")",
60
+ "timeout": 10,
61
+ "statusMessage": "Checking quest checkpoint"
62
+ }
28
63
  ]
29
64
  }
30
65
  ]