Skip to content

[DEBT] Slim execute body: defer escape-hatches and audit-mode (Lever B) #137

Description

@AdrienneBosch

Context

github-workflow/skills/execute/SKILL.md is 690 lines and loads in full
on every invocation, even though two large sections apply only to a
minority of runs:

  • Escape hatches (~lines 610–690, ~80 lines / ~1,000 tok): failure
    reporting, blocked, problem-found, dependency chaining, story-too-broad,
    review-feedback, story-too-large — all rare branches.
  • Audit mode (~lines 577–607, ~30 lines / ~400 tok): fires only for
    mode=audit, yet loads on every story/feature/maintenance run.

The body is already well progressive-disclosed elsewhere (finish, story
selection, board, claim, worktree hygiene all in references). This extends
that to the last two conditional blocks still on the hot path.

See docs/context-optimization-plan.md → Lever B.

Requirements (acceptance criteria)

  • Escape hatches moved to references/escape-hatches.md, loaded
    only when an escape condition is hit. A one-line pointer remains in the
    body at the decision point.
  • Audit mode moved to references/audit-mode.md, loaded only when
    $ARGUMENTS.mode == audit. The body keeps the "if audit, read X" pointer.
  • The ~40 lines of explanatory prose in Exit cleanup ("why holding
    the claim past exit blocks future agents…") moved to a rationale file; the
    three cleanup commands stay inline.
  • References stay one level deep from SKILL.md (no nested-reference
    partial-read hazard).
  • No instruction moved off the hot path becomes unreachable — verified
    by one real end-to-end dry run covering a normal story, an audit run,
    and at least one escape path (e.g. block).
  • Quality gate green; offline tests green; _shared-skills/ synced if
    applicable; versions bumped.

Savings goal

~1,400 tok off a common successful execute run (escape-hatches ~1,000 +
audit-mode ~400). Execute body lands under 500 lines (Anthropic
guideline) as a side effect — but the goal is the common path no longer
paying for rare branches, not the line count itself.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions