Repository navigation
Description
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-qaanddeciding-approachare 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-testsis 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 intests/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 toimplementing-with-tddandtriaging-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
- Apply the per-file fix in the table above: trim, trim-only routing hops, or split.
- Split skills deliver their modules through [Task]: Make session bootstrap conditional, collapse skill-loading turns, and enforce context token budgets #512's bundled-context call; no new chained loader calls.
- Add the 3,000-token root budget to the [Task]: Make session bootstrap conditional, collapse skill-loading turns, and enforce context token budgets #512 audit config, with an exception list that requires a stated reason per entry.
- Author SKILL.md changes through skill-creator, not by hand.
- Write trimmed text in the compact rule style described in the 2026-10-04 comment below (numbered one-line rules, one bad/good pair where a rule needs it, an explicit output shape, a single "when to break the rules" section).
- Keep the pinned budgets in
tests/test_skill_md_token_budget.pyin step with the audit; never raise a budget to fit a change. using-sumo-qais also the bootstrap body: coordinate with whatever [Task]: Make session bootstrap conditional, collapse skill-loading turns, and enforce context token budgets #512 shipped for bootstrap so the two do not fight.
Acceptance criteria
- Every root
skills/*/SKILL.mdis at most 3,000 estimated tokens, or is listed as an exception with a one-line reason. -
using-sumo-qaanddeciding-approachare not split into lazy modules. - Split skills load their working context in one bundled call; the turn count of each split skill's workflow does not increase.
- The audit command fails when a root exceeds the budget and is not on the exception list; CI runs it.
- Moved material is reachable through lazy modules or the bundled context call, and no content is silently dropped.
- Promptfoo evals for each changed skill show no material regression against the pre-change baseline (lift, not a loosened rubric).
- Deterministic routing/conformance scenarios stay green.
- Each split skill's root is at least 10% under its budget, with no budget raise (from [Task]: split the strengthening-tests, implementing-with-tdd and triaging skills into lazy modules before their next edit #703).
- The eval-load-bearing text named in each budget comment stays in the root or in a module the manifest routes to (from [Task]: split the strengthening-tests, implementing-with-tdd and triaging skills into lazy modules before their next edit #703).
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-versionsharness. - 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
feat(context): compact the session bootstrap, bundle a routed skill's…
feat(context): compact the session bootstrap, bundle a routed skill's…
feat(context): compact the session bootstrap, bundle a routed skill's…
feat(context): compact the session bootstrap, bundle a routed skill's…
sumithr commentedon Oct 4, 2026
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.md6,637 chars, i-have-adhd 7,207 chars), with no router hop in front. Their structure:[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.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.pyonmainatad44ce57):sumo-qa-implementing-with-tddusing-sumo-qasumo-qa-preparing-for-worksumo-qa-deciding-approachsumo-qa-triaging-test-failuressumo-qa-answering-testing-questionThe 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.