Skip to content

[Task]: Bring every root skill under the 3,000-token budget and enforce it in the audit #798

Open

Description

@sumithr

Priority / sequencing

P1 / priority: next. Child of #508. Lands after #512 (token audit command and bundle mode) and #802 (bundle wiring for the skills this task splits).

Suggested labels

  • tooling
  • ux

Roadmap fields

Status: Backlog; Priority: P1; Size: L; Order: 12; Depends on: #802

Problem

Epic #508 requires that no root skill exceeds 3,000 estimated tokens without a narrow documented exception. No existing child owns that criterion: #451 compacted only reviewing-before-merge, and #512 adds the audit but not the compaction.

Measured on origin/main at 2ef15a7 (0.69.0) with the repository's canonical estimator ((len(text) + 3) // 4 over characters, as in src/sumo_qa/skill_prompts.py), six shipped root SKILL.md files are over budget. None of the six has lazy modules yet.

Root skill Est. tokens Over by Fix
sumo-qa-implementing-with-tdd 4,591 1,591 Split into lazy modules
using-sumo-qa 4,118 1,118 Trim only, never split
sumo-qa-preparing-for-work 3,881 881 Split into lazy modules
sumo-qa-triaging-test-failures 3,517 517 Split into lazy modules
sumo-qa-deciding-approach 3,490 490 Trim only, never split
sumo-qa-answering-testing-question 3,079 79 Trim

closing-qa-gaps, strengthening-tests and reviewing-before-merge sit at 2,996 to 2,998, inside the budget with almost no headroom.

Why the split is not the default fix

#512 measured that each extra loader call re-sends the whole conversation, and that chained loader calls are the main session-token multiplier (81% of a measured review's tokens were re-sent context). Splitting a root lowers its first-load size but can add turns later, so it can make the complete flow more expensive. The split is used only where the overshoot is large, and its modules must arrive through #512's single bundled-context call, not through extra load_skill_context calls.

  • Trim only: answering-testing-question, 79 tokens over. Tightening prose clears the budget with no structural change.
  • Never split: using-sumo-qa and deciding-approach are the routing steps on every QA request. A split there adds a turn to every workflow, so they are trimmed (moving any non-routing content to where it is used) or take a documented exception.
  • Split: implementing-with-tdd, preparing-for-work, triaging-test-failures, strengthening-tests, following the [Task]: split reviewing-before-merge into a compact root and lazy modules #451 compact-root plus lazy-module pattern, with modules delivered by the bundled call.
  • Why strengthening-tests is split while under budget (absorbed from [Task]: split the strengthening-tests, implementing-with-tdd and triaging skills into lazy modules before their next edit #703): it sits within a few tokens of its pinned budget in tests/test_skill_md_token_budget.py, and the cheap duplicate cuts are spent, so the next eval-driven fix has no room. The same budget pressure applies to implementing-with-tdd and triaging-test-failures.

Expected outcome

Every shipped root skill is at or under 3,000 estimated tokens under the repository's canonical estimator (the one #512's audit uses), or carries a narrow documented exception. Each skill's load-bearing behaviour is unchanged, and the complete workflow costs no more turns or session tokens than before. The audit fails CI when a root exceeds the budget.

Scope

Acceptance criteria

Test plan

  • Audit budget test: an over-budget fixture root fails, an excepted one passes.
  • Per-skill promptfoo eval before and after, proportionate to the change.
  • Turn-count and session-token comparison for one split skill's workflow, before and after, with the compare-mcp-versions harness.
  • Deterministic routing suite.
  • Full Python suite.

Context

Child of #508 (AC: "No root skill exceeds 3,000 estimated tokens without a narrow documented exception"). Related: #451 (split pattern), #512 (audit, bundled context, and the loader-chain measurement). Absorbs #703 (closed as a duplicate), which added strengthening-tests and the 10% headroom criterion.

Activity

  1. added
    enhancement
    ux
    on Oct 2, 2026
  2. added
    priority: next
    on Oct 2, 2026
  3. sumithr commented on Oct 4, 2026

    @sumithr
    OwnerAuthor

    Compact rule style for the trims (2026-10-04)

    The ponytail and i-have-adhd skills are a reference for writing a trimmed root. Each is a single root of about 1,700 estimated tokens (ponytail SKILL.md 6,637 chars, i-have-adhd 7,207 chars), with no router hop in front. Their structure:

    1. Numbered one-line rules. The reason is one sentence, not a paragraph.
    2. One bad/good pair only where a rule is easy to misread. Not one per rule.
    3. An explicit output shape. ponytail ends with [code] → skipped: [X], add when [Y], and i-have-adhd has a pre-send check. Pinning the answer shape cuts output tokens, and output is re-sent on every later turn.
    4. One "when to break the rules" section. It replaces scattered per-rule exceptions.
    5. Measured by evals. ponytail has promptfoo benchmarks and i-have-adhd has judge evals. Here that means the per-skill promptfoo gate plus the context-budget audit.

    Limit: those two skills only set a style, while sumo-qa roots carry workflow gates. Use the style for wording and keep every load-bearing gate. The eval gate decides, not the token count.

    Current numbers (scripts/audit_context_budget.py on main at ad44ce57):

    Root Est. tokens
    sumo-qa-implementing-with-tdd 4,610
    using-sumo-qa 4,118
    sumo-qa-preparing-for-work 3,864
    sumo-qa-deciding-approach 3,503
    sumo-qa-triaging-test-failures 3,431
    sumo-qa-answering-testing-question 3,060

    The two routing roots together cost about 7,600 tokens before any specialist skill loads, so they are the trims with the widest reach.

    #703 is closed as a duplicate of this issue. Its scope (strengthening-tests) and its 10% headroom criterion are now in the body above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-taskenhancementpriority: nexttoolingux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions