Skip to content

perf(skills): cut the guidance every call carries: references lead with their answer, docs fetched by section - #194

Merged
kazo0 merged 4 commits into
mainfrom
dev/steve/skills-context-trim
Oct 17, 2026
Merged

kazo0 merged 4 commits into
mainfrom
dev/steve/skills-context-trim

Conversation

@kazo0

@kazo0 kazo0 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): n/a (internal)

PR Type

  • Refactoring (no functional changes, no API changes)
  • Build or CI related changes
  • Documentation content changes

What is the current behavior?

In every Uno FieldCheck session, guidance takes 65–89k tokens of each model call's context. Guidance means skill bodies, skill references, docs pages and the uno_discover_tools result. MAUI takes 4–7k on the same benchmark (unoplatform/private#1201). Guidance stays in context from the call that loads it to the end of the session, so every token is paid on the 220–340 calls after it.

The audit behind this PR found three main sources:

  • Whole docs pages: 54 of the 79 references open with "Step 1: fetch the docs page", and the hubs tell the agent to ground every detail in the docs. Each page fetched is 2,000–6,400 tokens.
  • App MCP availability detail in uno-testing's SKILL.md: uno_health codes, licensing tiers and Community fallbacks, which matter only when the tools are missing.
  • The skill's rules, twice: uno-dev repeats uno-build-app's rules, which it always loads first. In new-app mode it also loads discovery.md, though there is nothing to discover in an empty folder.

What is the new behavior?

  • 2eb5715, references lead with their answer. Each reference puts its rules first and its docs pages last, as a fallback fetched by anchor, and the four hubs say so. The questions sessions kept taking to the docs are now answered where the agent already looks:

    • refreshing a feed with a Signal (feed-basics);
    • commands on a background thread (commands);
    • the Android back button and Android 16's subscription rule (navigation code.md);
    • attaching a file with FileOpenPicker (a new build-app recipe).

    The TabBar reference names the sections of its 6,000-token page.

  • 4dcdef5, uno-testing availability detail moves to references/availability.md. Step 2 keeps its rule, and repeats of workflow step 8 are cut. SKILL.md goes from 19,027 to 16,388 characters.

  • 3fc3c1b, uno-dev stops repeating the skill's rules. Applies to the agent and its Codex copy. New-app mode skips discovery.md; new-app.md gets the baseline step instead and drops the Uno.Templates 7.0.0-dev.77 version log.

  • 7204b6a, the CI size report counts 2.4 characters per token, measured from billed-context deltas in the 2026-10 sessions. At 4 the report understated every file by about 40%.

Measured

skill-ab FieldCheck run fieldcheck-20261016-211948 (unoplatform/private#1204) compares the two versions on opus, two sessions each:

  • A is main@471ef25 and B is this branch.
  • Both run as uno-dev on Uno.Sdk 7.0.0-dev.81, App MCP 2.0.0-dev.15 and Uno.Extensions 8.0.0-dev.111.
  • Each session builds FieldCheck from scratch for Android and Windows.
  • Every harness check passes on all four sessions.
A1 main A2 main B1 this PR B2 this PR
guidance per call 65k 80k 54k 69k
of which skill references read 31k 33k 25k 28k
of which docs MCP 7k 10k 3k 6k
model calls 326 305 231 341
cost $31.63 $28.68 $20.54 $34.08
SSIM android / windows 64.8 / 88.8 65.9 / 87.1 70.6 / 87.1 66.8 / 86.6
  • Guidance per call drops about 16%, from a mean of 73k to 61k, where the trims cut: skill references about −5k, docs pages about −4k.
  • Cost doesn't show it at two runs per side. 11k is about 3% of a ~340k context per call. B1 and B2 differ by $13.54, almost entirely in model calls. #1204 defines every row.
  • Quality holds. SSIM is within run-to-run variation on both platforms.

An earlier uno-hot-reload A/B (one session each) also passed every check on both sides. That scenario never fetches docs pages, so it shows the edits break nothing, not that they save anything.

PR Checklist

  • Documentation has been added/updated
  • Associated with an issue (GitHub or internal)

Additional Information

Checks run on the branch: .github/scripts/Test-Plugin.ps1, claude plugin validate . --strict, claude plugin validate plugins/uno-platform-studio --strict, and agentskills validate on all 7 skills. The skills/ mirror is synced.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQ7Ex4N2tQcYujRXRq2hnD

kazo0 and others added 4 commits October 16, 2026 14:52
…ched by section

Every Uno FieldCheck session fetched whole docs pages (2,000 to 6,400 tokens each) that then stayed in context for the 220 to 330 calls after: 54 of the 79 references opened with "Step 1: fetch the page", and the hubs told the agent to ground every detail in the docs. Each reference now puts its rules first and its docs pages last, as a fallback fetched by anchor, and the hubs say so.

The questions four sessions in a row took to the docs are answered where the agent already looks: refreshing a feed with a Signal (feed-basics), commands running on a background thread (commands), the Android back button and Android 16's subscription rule (navigation code), and attaching a file with FileOpenPicker (the attach-file recipe). The TabBar reference names the sections of its 6,000-token page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0139QbnmnkBmmnbb4nFTVMrx
…rence

The uno_health codes, licensing tiers and Community fallbacks matter only when the tools are missing, so they move to references/availability.md. Step 2 keeps its rule without the App MCP 1.4 measurements, and the Studio UI and restart rules no longer repeat workflow step 8. SKILL.md goes from 19,027 to 16,388 characters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0139QbnmnkBmmnbb4nFTVMrx
…s repeating the skill's rules

uno-dev always loads uno-build-app first, so its copy of the skill's rules was in every call twice. New app mode had nothing to discover in an empty folder; new-app.md now carries the baseline step instead, refers to rule 10 for UseStudio, and drops the Uno.Templates 7.0.0-dev.77 version log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0139QbnmnkBmmnbb4nFTVMrx
Measured from billed context: how much each reference grew the next call's input in the 2026-10 FieldCheck sessions. At 4 the report understated every file by about 40%.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0139QbnmnkBmmnbb4nFTVMrx
@kazo0
kazo0 force-pushed the dev/steve/skills-context-trim branch from 7204b6a to 24b2a2f Compare October 17, 2026 14:13
@kazo0
kazo0 merged commit ffb6fad into main Oct 17, 2026
6 checks passed
@kazo0
kazo0 deleted the dev/steve/skills-context-trim branch October 17, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant