Repository navigation
feat!: skills and rules load once - #517
Conversation
Quest-Claim: 853d916cba1a69c5
Claude Code's skill stubs inline `quest skill <name>`, which now prints the skill with the guide sections and skills it builds on, so a skill's first turn holds everything and survives compaction. Codex's stubs still run it once. `quest setup` installs user-level SessionStart and SubagentStart hooks running `quest hook`, which adds `quest context` to sessions in repositories with the `Quests: ` line. `quest context` shrinks to the rules every task needs, under Claude Code's 10,000-character hook cap: the review procedure moves to /quest-review and `quest review`'s `next` line, review counting to /quest-merge, and question mechanics and Prompting to guide sections that skills include and `quest guide <section>` prints. BREAKING CHANGE: `quest skill --stub` is gone; rerun `quest init` to rewrite stubs and the reference line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l links PowerShell refuses to pre-approve a command chained with `||`, so the Claude Code stub now echoes its setup pointer after `quest skill <name>;` and allows the call in both Bash and PowerShell. afk omits grill and the Creation and Questions sections it never uses, keeping every composed skill under Claude Code's 30,000-character inline output ceiling, which a test now enforces. Init gives a skill both directories read through a per-skill link the pointer stub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 5c99b2a against base 4b69ad1.
No actionable findings from this GitHub-only static review. The composed skills, per-agent stubs, hook installation/removal, linked-skill handling, and corresponding tests are consistent with the intended single-load direction. The latest fixes address inline size, PowerShell expansion, and shared skill targets.
Limits: I did not run tests or reproduce Claude Code/PowerShell behavior. The head's build is still running; the other listed checks are skipped or neutral. This comment is not merge approval.
(Written by review (OpenAI); model unknown)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
quest land watch: the merge queue removed this pull request at 9e672d9 because it conflicts with The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs. (written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
codex, gpt-6.1-sol, medium effort land fixer: CONFLICT (content): Merge conflict in SETUP.md Auto-merging assets/CONTEXT.md Auto-merging assets/skills/complete.md Auto-merging quest/m0/token-waste/README.md Auto-merging src/cli/main.ts CONFLICT (content): Merge conflict in src/cli/main.ts Automatic merge failed; fix conflicts and then commit the result. (written by codex, gpt-6.1-sol, medium effort) |
Main's `quest setup` (env.BASH_MAX_TIMEOUT_MS) and this branch's (Quest's hooks) become one command: it validates the whole settings file, env and hooks, before writing once. `--remove` takes out Quest's hooks and the timeout while it still holds Quest's value. The context's Reviews prose this branch moved gains main's #514 changes in /quest-review and /quest-merge, and `quest review` prints `next finish` for a round whose findings are all low severity. The context stays under the 10,000-character hook cap: main's coordinator lines move to a guide Coordination section that /quest-spawn and /quest-complete include, and the rest is tightened without dropping a rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore /quest-review publishes Running no code from a PR whose author lacks write access moved with the review procedure into /quest-review, which /quest-iterate never loads, so it returns to the context's Required rules. /quest-iterate invoked the publishing /quest-review before a mid-iteration push, pushing and releasing its hold before disabling auto-merge; it now disables auto-merge first and runs `quest review` itself when it pushes without finishing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head ff6593e against base 1c3cf6a, comparing the branch-specific changes with previously reviewed head 5c99b2a and accounting for changes inherited from main.
No new actionable findings. The substantive integration preserves main's foreground timeout setting alongside the new hooks: setup validates the settings before one write, preserves unrelated entries, and removal only drops the timeout when it matches Quest's value. The tests cover that combined lifecycle and malformed-input preservation. The all-low-severity finish path precedes the every-third-round checkpoint and matches the relocated review/merge instructions.
The latest local-review fixes are present: the shared context retains the prohibition on executing contributor PR code, and iterate disables auto-merge before pushing and separates an unfinished iteration's local review from the publishing /quest-review workflow. The context is 9,997 characters, within the declared 10,000-character limit; coordinator guidance has moved to the guide sections included by complete/spawn.
Direction: proceed through normal validation/merge checks, retaining the existing documented host rollout requirement that Quest be available on Claude Code's PATH.
Verification limits: GitHub-only static comparison and source/test inspection. I did not run tests, reproduce Claude Code or PowerShell behavior, or change host settings. This comment is not merge approval.
(Written by review (OpenAI))
|
quest land watch: the merge queue removed this pull request at ff6593e because it conflicts with The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs. (written by quest land watch) |
|
quest land watch: armed auto-merge on this pull request at 6103724, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix ( (written by quest land watch) |

Finishes Rules load once from the token waste epic.
Problem
A quest skill took 3-4 turns before any work: the stub said to run
quest skill <name>, whose output said to runquest guideand other skills, and the guide said to runquest context. That was about 27KB of rules arriving as Bash output, which compaction summarizes away, so agents ranquest guide2,283 times andquest skill3,057 times in a week. Every implementer also loaded the review procedure (36% ofquest context) and the prompt-writing rules.What changes
.claude/skills/quest-*/SKILL.mdis now!`quest skill <name>; echo "<setup pointer>"`withallowed-tools: Bash(quest skill <name>) PowerShell(quest skill <name>). Claude Code runs it when the skill is invoked, through Bash, or PowerShell where Git Bash is missing, and reads the output in place, so the first turn holds everything and Claude Code re-attaches it after compaction (the first 5k tokens of each skill). Withoutallowed-tools, Claude Code aborts the skill silently in default permission mode. A failing command would abort it too, and PowerShell refuses to pre-approve a command chained with||, so the one-line setup pointer always follows the skill: a missing or outdatedquestshows its error and the pointer instead of aborting. Verified end to end with headlessclaude -pin default permission mode, in Bash and PowerShell 7..agents/skills(Codex) keeps the pointer stub, so Codex runs a singlequest skill <name>. A skill both directories read through a link, of the directories or of one skill, gets the pointer stub, since every agent can follow it.quest skill <name>composes. Each skill's frontmatter names the guide sections (guide:) and other skills (skills:) it builds on; the output is its own body first, then each skill it builds on, depth first and once, then the guide sections, once. No skill tells the agent to runquest guide,quest skill, orquest contextanymore; a test enforces it. An unknown section or skill name fails every command. Every composed skill stays within Claude Code's 30,000-character inline output ceiling, past which it would arrive as a file path and a 2,000-character preview; a test enforces it. To fit,/quest-afkdeclaresomit: grill, Creation, Questions, since it asks nothing and plans no follow-ups.quest setupalso installs user-level hooks in$CLAUDE_CONFIG_DIR/settings.jsonor~/.claude/settings.json, beside main'senv.BASH_MAX_TIMEOUT_MS:SessionStart(startup|resume|clear|compact) andSubagentStart, each runningquest hook. The table isHOOKSinsrc/cli/hooks.ts, andquest hookdispatches on the event, so rule checks adds a row and a case. It validates the whole file (env and hooks) before writing once, prints each change, and refuses malformed settings unchanged; rerunning replaces Quest's earlier hooks and changes nothing when all is set.--removetakes out Quest's hooks, andenv.BASH_MAX_TIMEOUT_MSonly while it still holds Quest's value. Repositories still write no hooks.quest hookprintsquest contextasadditionalContextwhen the rootAGENTS.mdorCLAUDE.mdof the checkout holding the session's cwd has theQuests:line, and nothing elsewhere. Verified end to end: both the session and a spawned subagent quoted the rules without running anything.assets/CONTEXT.mdis split by role, from 17,829 to 9,771 characters, under Claude Code's 10,000-character cap on hook context (a test enforces the cap):/quest-review(running rounds, refuting, the design checkpoint, outages, the## Reviewrecord) and toquest review's own output, whose last line is nownext respond,next checkpoint(every third round that reports findings), ornext done./quest-merge, which defines landable.Questionssection that the asking skills include; the always-on rules keep clickable references, background agents reporting decisions, newest-decision-wins, and never closing a PR on a decision.quest guide promptingprints, which the always-on rule and this repository's path-scoped rule point at.## Modelsrecord, read-only CI, and AI comments as suggestions.quest guide [section...]prints named sections.quest contextand follow it, unless this session already holds its rules.";quest initupgrades the previous default in place./quest-reviewto every workflow since its work reaches the runner's review, and the guide's Model, Format, and Execution sections to merge jobs for the no-questtree check.What a skill loads before its first real turn, from
origin/main's assets (context, the whole guide, and the skills its first line names, transitively) against now (the hook's 9.8KB plusquest skill <name>):/quest-afk/quest-audit/quest-complete/quest-delete/quest-export/quest-grill/quest-import/quest-iterate/quest-merge/quest-plan/quest-recurring/quest-review/quest-spawn/quest-start/quest-unblockBefore, that took 3-4 tool turns, each re-sending the context; now it takes none in Claude Code and one in Codex.
Public API
quest setup --remove,quest hook;quest setupalso installs Quest's hooks and prints one line per change;quest guidetakes optional section names.quest skill --stubis gone (quest initwrites the stubs, which now differ per directory), andquest skill <name>prints the composed instructions instead of the bare body. The core'sStubinterface carriesstubsper skill directory instead of onestub; the Worker'sbuild/stubs.jsonfollows.quest reviewprints a finalnextline (finish,checkpoint,respond, ordone), and its--jsonobject gainsnext.quest initto rewrite the stubs and reference line; runquest setuponce per Claude Code profile.Decisions
quest setup(env timeout, moq-dev/quest#515) and this PR's (hooks) combine? (user, 2026-11-07, after the merge queue dropped this PR formerge_conflict) ✅ One command, one write:quest setupvalidates the whole settings file first, then writes the timeout and Quest's hooks once;--removeremoves Quest's hooks, and the timeout only while it holds Quest's value (rejected:--removeremoves hooks only; skip this PR; delete it).Choices made without asking
quest hook, needingqueston thePATHClaude Code starts with, as the worktree hooks already do. Writing an absolute path at setup would break when a Nix store path is collected or a mise version is pruned. Wherequestis missing, Claude Code shows a hook error and agents fall back to runningquest contextthrough the reference line.clearjoins the decidedstartup,resume, andcompact, since/clearempties the context;forkis left out because a fork already holds the rules.SubagentStarthook too, since subagents start without the session's context, and/quest-spawnand/quest-completerun their work in subagents.Quests:line, so a user-level hook never imposes Quest's rules on other projects. This repository'sAGENTS.mdgains the standard line for that reason; its Development bullet now asks only forquest guide.quest skill <name>call. Codex now supportsSessionStartcontext, but a user-level Codex hook may also run inquest review's Codex sessions, which Single-pass review is cutting; see the follow-up below./quest-iterateand/quest-completeno longer inline/quest-reviewor/quest-plan, which they invoke at the step that runs them.Validation
just checkandjust testpass, after the second merge too.claude -p(2.1.316, default permission mode) checked the generated stub: with this checkout'squestonPATHthe skill rendered from its body through the guide's Deletion section; with a failingquestit rendered the setup pointer; withoutallowed-toolsthe skill aborted.claude -pwithCLAUDE_CODE_USE_POWERSHELL_TOOL=1, pwsh 7.6.9, andshell: powershell, the routing Windows without Git Bash gets: the||form aborted on PowerShell's permission check even with aPowerShell(...)rule; the;form rendered, and withquestmissing it rendered PowerShell's error and the pointer. ASessionStarthook'sCLAUDE_ENV_FILEexports reach the inline command, so a dev shell'squestworks there.claude -pwithquest hookon both events: the session and a subagent each quoted the rules from context.Concurrent work
moq-dev/quest#534 edits some of the same skill files (
complete.md,iterate.md,afk.md,unblock.md); whichever lands second merges the base.Follow-ups
"findings": 0fails withthe reviewer's reply does not settle each of the last round's undefined finding(s) once, so this branch neededquest review --new.quest reviewshould read or reject that older state with a clear error, not crash after a reviewer turn. Any branch reviewed before feat(review): explore the change once per round #514 hits it.Merge with main
Second merge, 2026-11-07 (main at 1c3cf6a):
src/cli/main.ts,SETUP.md,README.md: onequest setupas decided above. Main'ssetup/claudeSettingsleavesrc/cli/setup.tsforsetup/settingsPathinsrc/cli/hooks.ts, andtest/setup.test.tsfolds intotest/hooks.test.ts.assets/CONTEXT.md: main's Reviews changes from moq-dev/quest#514 move with that prose:/quest-reviewsaysquest reviewreads## Models(so write it before the first round,--exclude-model/--sizeonly when the body cannot hold it) and that an all-low-severity round ends the loop;/quest-mergegains that round's exemption.quest reviewprintsnext finishfor such a round, ahead of the checkpoint, since main's rule ends the loop there.Coordinationsection that/quest-spawnand/quest-complete(and so/quest-afk) include; the rest is reworded shorter without dropping a rule. It is now 9,997; context rules records that and still makes its own room./quest-iteratenever loads/quest-review; it is back in Required. It also found that/quest-iterateinvoked the publishing/quest-reviewbefore a mid-iteration push; it now disables auto-merge first and runsquest reviewitself when it pushes without finishing.First merge:
quest/m0/token-waste/rule-checks.mdconflicted: kept this PR'sHOOKS/quest hookwording and main's new Codex parity bullet.quest/m0/context-rules.md(new on main) pointed at the context's Prompting section, which this PR moves; it now points atquest guide promptingand notes the 10,000-characterCONTEXT_LIMITwith about 230 characters to spare.Rollout
Repositories pick this up when their
questpin moves and they rerunquest init.quest setupis per Claude Code profile, and its hook needsqueston thePATHClaude Code starts with: the maintainer's hosts havequestonly in dev shells today, so the hook would show an error each session there until one is installed outside them (nix profile add, or mise once a release exists). That is host setup in dotfiles, outside this tree.Review
mechanical fix by codex, gpt-6.1-sol, medium effort:
Merged base and mechanically re·solved four content conflicts, preserving both sides' skill changes and lifecycle assertions; ran just check and just test successfully.(head 6103724)Rewritten by
quest reviewafter each round.01a1b764-d101-7900-b7fb-9afbaeba4663, round 2Both reported regressions are fixed, and the incremental changes reveal no new findings; builds, tests, and quest commands were not run.assets/skills/review.md:16:Preserve the trust boundary before iterating on contributor PRs;assets/CONTEXT.md restores the shared prohibition on running contributor PR code, and its 9,997 characters remain below the 10,000-character hook cap.assets/skills/iterate.md:26:Keep the pre-push review separate from the publishing workflow;assets/skills/iterate.md now disables auto-merge before publishing, invokes /quest-review once when work is complete, and otherwise uses local quest review with each round's next instructions.Models
Size: L
Implementer: Claude Code, claude-opus-5-5, xhigh effort
Implementer: Claude Code, claude-opus-5-5, high effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with xhigh effort; merges with main by Claude Opus 5.5 with high effort)