On-Demand Loading of Agent Skills and a Guide to Building Your Own

    This article explains why installing many agent skill packs often inflates context without improving results, how progressive disclosure works, which workflows belong in skills, and how to write, budget, and retire custom skills that encode your own acceptance criteria.

    Clarify the problem before collecting a list

    After introducing coding agents, many teams rush to collect “skills worth installing”: document handling, requirements clarification, writing plans to disk, web transcription, long-video summaries, and so on. Lists can be useful, but installing everything often hits the same wall: context usage keeps rising while task quality does not.

    The issue is not the idea of skills. Skills encode someone else’s workflow. Directory conventions, review criteria, regression scope, and retry behavior live in your acceptance standards, not on a generic card. A common complaint—generating a write-up for every feature while context explodes—is the symptom of hanging another team’s process into your session unchanged.

    Three things matter more than memorizing a list: how skills are loaded, how to write a skill that serves only your workflow, and a learning path from shallow to deep. The rest of this article is product-agnostic engineering practice.

    What a skill actually is

    Treat a skill as a self-contained directory, not a throwaway prompt.

    The core is a skill document. It starts with structured metadata that must include at least a stable short name and a one- or two-sentence description the model can use to decide whether to enable the skill. The body then covers steps, inputs and outputs, prohibitions, and done criteria. The directory can also hold references and static assets: long specs in a references subdirectory; reusable scripts, templates, and sample data in an assets subdirectory.

    That split matches the loading strategy. Names and descriptions should be short, distinctive, and trigger-oriented; the body should be executable; reference material should enter context only when it is actually needed. If you dump manuals, incident history, and full API docs into always-on prompts, a handful of skills will consume the context budget before work starts.

    Progressive disclosure: why installing everything grows context

    For long coding-agent tasks, context is scarce. Skills designed for progressive disclosure split cost into three layers.

    Layer 1 — always resident. Each registered skill exposes only its name and description, typically a few dozen words. The model uses that text for routing: which description matches the current intent.

    Layer 2 — load per task. Only after a match does the agent read the skill body. The body should answer: what the inputs are, what to clarify first, in what order to work, when to stop and ask a human, and what “done” means.

    Layer 3 — load per step. The body points at reference docs or scripts. Those files are read only when the step needs a spec or a check. Until then they should not occupy context.

    Context bloat from over-installing usually stacks several design mistakes:

    • Descriptions read like ads: vague and overlapping, so the model probes multiple bodies.
    • Long text that belongs in references is pasted into the body, so one hit dumps thousands of words.
    • Overlapping duties, e.g. “write a plan,” “write a design,” and “write a task breakdown” each demand another explanation file.
    • No disable or priority rules; experimental and production skills stay resident together.
    • Skills tell the model to “read all related files first,” violating on-demand loading.

    A rough estimate: 20 skills at ~80 words of description each is about 1,600 resident words—usually acceptable. If each body averages 2,000 words and half are misfired, a single round can add ~20,000 words of irrelevant instruction. Long tasks still need code, errors, and dialogue; when instructions crowd that out, the model drops constraints, repeats work, or claims completion early.

    Install policy: default to few and precise. Start with a meta-skill or template for “write this workflow as a skill,” then add skills only for real pain. Each addition should replace a repeatedly pasted prompt, not “look like it might help.”

    What belongs in a skill

    Skills fit work that is recurring, stepwise, and checkable—not one-off cleverness.

    Good fits include: turning requirements into an acceptance list before coding; writing multi-day plans and progress into in-repo marker files so sessions can resume; encoding constraints for spreadsheets, slides, documents, and layout files; branching when web extraction fails (try another render path); summarizing long material with locators, then trimming by topic.

    Poor fits include: a one-time special case in one repo; operations that depend on private accounts and undocumented UIs; and stuffing every engineering virtue into one “super workflow” that cannot be routed.

    Public lists cover common flows others have validated. Skills grown on your own production line will not appear there; you write them. That is normal: the platform supplies loading and a few official capabilities; teams encode their own pitfalls and standards with the same mechanism.

    Writing a skill from scratch: minimal structure

    Below is a neutral, deliberately short skill: lock acceptance criteria before changing code. It illustrates boundaries, not a full engineering handbook.

    Directory:

    • SKILL.md: metadata and steps
    • references/acceptance-template.md: acceptance-list template, read only when drafting the list
    • assets/checklist.md: a copyable blank table

    SKILL.md structure:

    1. name: acceptance-first
    2. description: Before changing code or proposing a design, write acceptance criteria into an in-repo checklist. Use when requirements are vague, changes span files, or the session may be interrupted.
    1. # Acceptance first, then changes
    2. ## When to enable
    3. Enable when the user asks to change code, add tests, or produce a design, but success criteria are not written down.
    4. Do not enable for pure Q&A or one-line explanations.
    5. ## Steps
    6. 1. Write three to seven observable completion statements covering the happy path, failure path, and what must not change.
    7. 2. Write the list into the task’s agreed progress file, not only in the chat.
    8. 3. Start edits only after the user confirms or clearly authorizes continuing.
    9. 4. After each item, update status in the same file.
    10. 5. Before finishing, attach evidence per item: test command, diff scope, or why it cannot be verified.
    11. ## Constraints
    12. - Do not create a separate explanation file for every function.
    13. - Do not read references unrelated to acceptance in this step.
    14. - If information is missing, ask one blocking question only.
    15. ## References
    16. When drafting item wording, read references/acceptance-template.md.

    Lessons from real maintenance:

    • The description states both what it does and when not to use it. Selling only benefits makes routing too wide.
    • The body does not copy the full template; it cites when to read it. Template updates do not change the resident description.
    • Explicitly forbid generating a write-up per feature—a common source of context inflation.
    • Progress lives in a repo file, not only in the session. After a long-task interrupt, a new session reads that file instead of replaying history.
    • Done requires evidence. “Completed” without evidence is polite idle spinning.

    Writing descriptions that route correctly

    The description is the only part that occupies context long-term. Write it like retrieval text, not marketing.

    A practical pattern is one action plus one boundary. Example: “Write plans and progress into in-repo marker files for cross-session resume; not for small changes that finish in five minutes.” Avoid words like “powerful,” “comprehensive,” or “more efficient” that do not match intent.

    Keep names stable, short, and non-synonymous. If two descriptions both match “help me plan,” the model hesitates or double-reads. Merge the skills or make triggers mutually exclusive: one for requirements clarification, one for progress on disk.

    Do not pile paths, command flags, or long examples into the description. Those belong in the body or references. Longer descriptions cost more and do not route more accurately.

    What the body should look like

    The body is an operating procedure. Use a few fixed sections so people and models can maintain it together.

    Trigger and exclude: which requests must use this skill and which must not.

    Inputs: what the user should already have provided; how to ask the smallest question when something is missing.

    Steps: numbered, interruptible; each step’s artifact is a file, a diff, or a conclusion.

    Branches: retry limits and path-change conditions on failure. Example: if extracting page body fails, try static extraction, then a render-based path; after two failures, stop and state what is missing—do not switch strategies forever.

    Acceptance: how to check the artifact. Automated checks if they exist; otherwise what a human should look at.

    Anti-patterns: pitfalls this team has already hit, so the model does not “improvise.”

    Keep the body short enough to execute in one read. Background, historical decisions, and edge cases go to references, with the body stating “read only when condition X.”

    Boundaries for assets and scripts

    Assets are for templates, sample inputs, and small stateless scripts. Scripts should do deterministic work: format checks, filename checks, generating a table of contents from a marker file. Do not hide unverifiable “smart judgment” in scripts nobody reviews, or the body and real behavior will diverge.

    When citing a resource, specify inputs, outputs, and what failure codes mean. The model should decide whether to change inputs, read a reference, or hand the problem back to a human. Do not write “run a command until it succeeds.”

    Do not put secrets, personal access credentials, or internal network addresses in the skill directory. Skills get copied across environments; treat the directory as a shareable process asset.

    Install and retire: manage skills with a budget

    Budget the skill set; do not treat “how many we installed” as a score.

    Cap total resident description length. Near the cap, merge or retire before adding.

    For each production skill, record three columns: trigger scenario, which pasted prompt it replaced, and last time a real task used it. Skills with long-term zero use leave the default registry and can be enabled when needed.

    New skills need a contrast experiment: run the same class of task without the skill, then with it. If the only difference is extra files and acceptance quality does not improve, do not check it in.

    Avoid one-skill-per-feature granularity. Cut by workflow stage: clarify, plan, implement, review, deliver. Small habits in the same stage belong as branches in one skill, with conditions for reading references.

    Official or platform document, spreadsheet, slide, and layout skills are reasonable as a generic base for frequent, format-heavy work. Business-specific flows you write yourself, preferring processes that have already repeated three or more times.

    Working with long tasks and session interrupts

    Skills answer how; progress files answer how far. Design them together.

    A progress file should keep only the current goal, acceptance items, evidence of completion, next step, and what the next step must not do. It is not a diary. On resume, read this short file first, then decide whether the skill body and references are needed. Do not treat the previous session’s full message history as the resume mechanism; that defeats progressive disclosure.

    For multi-day work, the skill body should state the progress-file path convention (for example under a tasks directory, filename including a task id). Path conventions belong in the team skill body, not in every description.

    Common failures and fixes

    Routing wobble: two descriptions look alike. Make triggers exclusive, or merge and branch in the body.

    Enabling a skill reads every reference: the body treated optional reading as “read before starting.” Name files per step instead.

    The skill ignores new user constraints: add that the current-turn user instruction outranks skill defaults. Defaults are defaults, not law.

    Artifact explosion: the skill demands overlapping documents. Use one progress file plus necessary diffs; generate the rest on demand.

    Overfit examples: the body is tied to one repo’s layout. Move repo-specific notes to that repo; keep only portable steps in the skill.

    Unmaintainable: only the author can change it. Add a changelog stating whether this edit changed triggers or acceptance. Trigger changes invalidate routing assumptions.

    A four-week learning path

    Week 1 — structure. Build a directory: name, description, body, one reference, one template. On a tiny task, verify the description stays quiet when it should not fire, and that a real fire loads only the body.

    Week 2 — load cost. Put a long document in the body once and in references once; compare context use and drift on the same task. Internalize “resident text is routing only.”

    Week 3 — workflow skills. Pick real repeated labor (starting work with unclear requirements, or web extract with no fallback). Write a skill with exclusions, failure branches, and evidence; revise it on two real tasks.

    Week 4 — governance. Inventory, description budget, zero-use retirement, contrast experiments. Move from “can write a skill” to “can decide which skill should not exist.”

    Later progress is not collecting more generic packs. Quarterly: which steps are still pasted by hand, which skills conflict with current standards, which references were never read. Unread references get deleted or their triggers get fixed.

    Minimal checklist before you ship a skill

    • Unique name; description includes action and exclusion; length is controlled.
    • Body steps have artifacts, stop conditions, and completion evidence.
    • Long material lives in references or assets, with read conditions.
    • Does not require an explanation file per sub-feature.
    • No secrets or machine-specific paths.
    • Routing tested with one positive and one negative example.
    • Recorded which manual step it replaces; if you cannot say, do not enable it by default.

    Closing

    The value of a skill system is turning a stable workflow into a directory that can be routed, expanded on demand, and resumed—not parking as many procedure texts as possible in context forever. Generic capabilities handle common documents and generic engineering stages. What actually moves quality is custom skills that encode your acceptance criteria and failure fallbacks. Control resident information first, keep bodies short, and leave detail until the step that needs it. Then skills cut repeated labor instead of creating another form of context debt.