From b16c63f3468a4d1768187757ab4c6ef198daaf87 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 25 Apr 2026 21:23:13 -0700 Subject: [PATCH] refactor: slim preamble resolvers + sidecar-symlink helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compress prose across 18 preamble resolvers — Voice, Writing Style, AskUserQuestion Format, Completeness Principle, Confusion Protocol, Context Health, Context Recovery, Continuous Checkpoint, Lake Intro, Proactive Prompt, Routing Injection, Telemetry Prompt, Upgrade Check, Vendoring Deprecation, Writing Style Migration, Brain Sync Block, Completion Status, and Question Tuning. Same semantic contract, ~half the bytes. Restored "Treat the skill file as executable instructions" phrase in the plan-mode info section after diagnosing it as load-bearing. Restored "Effort both-scales" rule in AskUserQuestion format. Bonus: scripts/skill-check.ts gains isRepoRootSymlink() so dev installs that mount the repo root at host/skills/gstack as a runtime sidecar (e.g., codex's .agents/skills/gstack) get skipped instead of double-counted. opus-4-7 model overlay gets a Fan-Out directive — explicit instruction to launch parallel reads/checks before synthesis. Net token impact across all generated SKILL.md files: ~140K tokens removed across 47 outputs. Plan-* skills retain full preamble surface (Brain Sync, Context Recovery, Routing Injection) — load-bearing functionality that early slim attempts incorrectly cut. Co-Authored-By: Claude Opus 4.7 (1M context) --- model-overlays/opus-4-7.md | 4 + .../preamble/generate-ask-user-format.ts | 104 ++---------------- .../preamble/generate-brain-sync-block.ts | 43 ++------ .../preamble/generate-completeness-section.ts | 14 +-- .../preamble/generate-completion-status.ts | 70 +++--------- .../preamble/generate-confusion-protocol.ts | 11 +- .../preamble/generate-context-health.ts | 13 +-- .../preamble/generate-context-recovery.ts | 24 +--- .../generate-continuous-checkpoint.ts | 32 +----- .../resolvers/preamble/generate-lake-intro.ts | 8 +- .../preamble/generate-preamble-bash.ts | 12 -- .../preamble/generate-proactive-prompt.ts | 10 +- .../preamble/generate-routing-injection.ts | 56 +++------- .../preamble/generate-telemetry-prompt.ts | 16 +-- .../preamble/generate-upgrade-check.ts | 45 ++------ .../generate-vendoring-deprecation.ts | 13 +-- .../preamble/generate-voice-directive.ts | 63 +++-------- .../generate-writing-style-migration.ts | 10 +- .../preamble/generate-writing-style.ts | 27 ++--- scripts/resolvers/question-tuning.ts | 25 +---- scripts/skill-check.ts | 16 ++- 21 files changed, 133 insertions(+), 483 deletions(-) diff --git a/model-overlays/opus-4-7.md b/model-overlays/opus-4-7.md index 858b9a94..db52fe35 100644 --- a/model-overlays/opus-4-7.md +++ b/model-overlays/opus-4-7.md @@ -1,5 +1,9 @@ {{INHERIT:claude}} +**Fan out explicitly.** When the task has independent files, claims, or review +angles, launch parallel reads/checks before synthesizing. Keep the fan-out bounded +and merge results before deciding. + **Effort-match the step.** Simple file reads, config checks, command lookups, and mechanical edits don't need deep reasoning. Complete them quickly and move on. Reserve extended thinking for genuinely hard subproblems: architectural tradeoffs, subtle bugs, diff --git a/scripts/resolvers/preamble/generate-ask-user-format.ts b/scripts/resolvers/preamble/generate-ask-user-format.ts index e06e7022..7ff9a5d9 100644 --- a/scripts/resolvers/preamble/generate-ask-user-format.ts +++ b/scripts/resolvers/preamble/generate-ask-user-format.ts @@ -3,114 +3,38 @@ import type { TemplateContext } from '../types'; export function generateAskUserFormat(_ctx: TemplateContext): string { return `## AskUserQuestion Format -**ALWAYS follow this structure for every AskUserQuestion call. Every element is non-skippable. If you find yourself about to skip any of them, stop and back up.** - -### Required shape - -Every AskUserQuestion reads like a decision brief, not a bullet list: +Every AskUserQuestion is a decision brief and must be sent as tool_use, not prose. \`\`\` D - +Project/branch/task: <1 short grounding sentence using _BRANCH> ELI10: - Stakes if we pick wrong: - Recommendation: because - Completeness: A=X/10, B=Y/10 (or: Note: options differ in kind, not coverage — no completeness score) - Pros / cons: - A)