Invocation Architecture

Lesson 5 · Building Better Skills & Agents · ~14 minutes

With 30+ skills, you face a systems design problem: how do you make the right skill fire at the right time without drowning your agent in context or yourself in memorization? This lesson covers the invocation tradeoff, context budgeting, and the art of writing descriptions that route correctly.

The Core Tradeoff

Model-Invoked The agent reaches for it autonomously

Cost: Context load — the skill's description lives in the system prompt on every turn, whether needed or not. With 30 model-invoked skills averaging 50 words each, that's 1,500 words of descriptions consuming context before the conversation even starts.

Benefit: The agent fires the skill when appropriate without the human needing to remember it exists.

Good for: Skills the agent needs mid-task — code-review during implementation, diagnose during debugging, ponytail during any build task.

User-Invoked The human types its name deliberately

Cost: Cognitive load — you must remember the skill exists and know when to use it. It's invisible to the agent otherwise.

Benefit: Zero context cost. The skill is loaded only when explicitly called. Your context window stays clean.

Good for: Skills that represent deliberate human actions — handoff (session management), teach (pedagogical mode), grill-me (stress testing), ask-the-board (advisory).

Context Budgeting

Let's do the math. Your system prompt includes a list of all model-invoked skills with their descriptions. Each description is the only thing the agent sees when deciding whether to load a skill.

ScenarioSkillsAvg DescriptionContext CostImpact
Conservative10 model-invoked40 words~400 wordsManageable
Moderate20 model-invoked50 words~1,000 wordsNoticeable
Aggressive35 model-invoked60 words~2,100 wordsSignificant — 5-10% of usable context consumed by skill routing alone
The budget rule

Every model-invoked skill must justify its per-turn context rent. If the agent wouldn't autonomously reach for a skill in normal workflow, make it user-invoked. The skill still exists — it just doesn't occupy space until called.

The Taxonomy Shift

Early skill systems used "Commands" vs "Skills" as categories — an implementation distinction (slash-command vs auto-loaded). The better taxonomy is invocation mode: who decides when it fires?

Old TaxonomyNew TaxonomyWhat Changed
Command (slash-triggered)User-InvokedSame mechanism, better framing — focuses on who initiates
Skill (auto-loaded)Model-InvokedClarifies the cost: you're paying context rent
RouterNew category: one entry point that maps to many

Decision Framework: Which Mode?

Ask one question: "Does the agent need to reach for this autonomously during a task?"

If yes → Model-InvokedIf no → User-Invoked
code-review (during implementation)handoff (deliberate session end)
diagnose (during debugging)teach (pedagogical mode switch)
ponytail (during any build)grill-me (stress-test a plan)
assess (during exploration)ask-the-board (advisory consultation)
write-a-skill (meta-authoring)
today (daily planning ritual)

Router Skills

A router skill is a single user-invoked entry point that maps to multiple sub-skills. It reduces cognitive load (remember one name instead of many) while keeping context cost low (only loads what's needed).

Router pattern example name: ponytail-help description: Quick-reference card for all ponytail modes, skills, and commands. Use when user says "ponytail help", "what ponytail commands", or "how do I use ponytail". # What it routes to: - ponytail (full mode) - ponytail-review (review for over-engineering) - ponytail-audit (whole-repo audit) - ponytail-debt (harvest ponytail: comments)

The ponytail family is a natural router cluster: one concept (simplicity), multiple applications. The user remembers "ponytail" and the agent routes to the right variant based on context.

Description as Context Pointer

For model-invoked skills, the description is everything. It's the only text the agent sees when deciding whether to load your skill. Bad wording means the skill never fires, or fires too often.

Example: code-review

Reviews code against operating principles — DRY, simplicity, surgical changes, backwards compatibility. Use when the user wants a code review.

Analysis: Clear trigger ("user wants a code review"). Names the principles it checks — helps the agent decide if this is the right tool vs a generic review. Concise (26 words).

Verdict: ✅ Good — fires when appropriate, stays quiet otherwise.

Example: ponytail

Forces the laziest solution that actually works — simplest, shortest, most minimal. Channels a senior dev who has seen everything. Question whether the task needs to exist (YAGNI), reach for stdlib before custom code, native platform features before dependencies. Use when user says "ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path".

Analysis: Highly specific triggers (9 phrases). The agent knows exactly when to fire. But at 67 words, it's paying significant context rent.

Verdict: ⚠️ Trade-off — the specificity is valuable, but consider whether 5 trigger phrases would route just as accurately as 9.

Example: assess

Evaluates a codebase or system and recommends the single highest-leverage improvement. Use when the user needs a technical assessment.

Analysis: Has disable-model-invocation: true — it's user-invoked despite having a description. The description serves human discovery (reading the skill list), not agent routing. Zero context cost.

Verdict: ✅ Correct invocation mode — "assess this codebase" is a deliberate human action, not something the agent should do unprompted.

Granularity: When to Split vs Merge

Every split adds either context load (if model-invoked) or cognitive load (if user-invoked). Every merge makes the resulting skill harder to maintain and its description harder to write precisely.

Split when...Merge when...
The workflows are genuinely different (different steps, different outputs)You hesitate about which to invoke
The triggers are distinct and non-overlappingThey share 50%+ of their steps
The skill exceeds 100 lines and has distinct domainsOne is a strict subset of the other
Different invocation modes are needed (one model-invoked, one user-invoked)Maintaining both costs more than maintaining one

Categorizing Your Portfolio

Here's how a real 30+ skill portfolio breaks down by invocation mode, with reasoning:

SkillModeRationale
code-reviewModelAgent should apply during implementation without being asked
ponytailModelSimplicity mode should activate on trigger phrases mid-task
diagnoseModelAgent should shift to diagnosis mode when hitting errors
architectUserDesign is a deliberate activity — the user knows when they want architecture
handoffUserSession management is a human decision
grill-meUserStress-testing is opted into, never imposed
teachUserPedagogical mode is a deliberate switch
assessUser"Evaluate this" is a deliberate request, not mid-task
ponytail-helpRouterEntry point to the ponytail family

Check Your Understanding

You have a skill called "format-output" that reformats the agent's response into a specific template. The agent should apply it automatically whenever producing a deliverable. Currently it's user-invoked. What's wrong?
Correct. If the agent "should apply it automatically whenever producing a deliverable," that's the definition of model-invoked. The human shouldn't need to remember to invoke formatting every time — the agent should reach for it autonomously.
The key signal is "should apply automatically." If you want the agent to fire it without being asked, it must be model-invoked. User-invoked means you'd have to remember to type "format-output" every single time you want a deliverable formatted — that defeats the purpose.
A model-invoked skill has this description: "Helps with various tasks." It almost never fires. Why?
Correct. The description is the agent's only routing signal. "Helps with various tasks" matches everything and nothing — the agent has no way to distinguish when THIS skill is the right one vs any other. It needs specific triggers: "Use when [exact situation]."
The problem is specificity, not length. "Helps with various tasks" gives the agent no signal about WHEN to load this skill. Compare with: "Reviews code against DRY, simplicity, surgical changes. Use when the user wants a code review." — the agent knows exactly when to fire.
You have 35 model-invoked skills averaging 60 words per description. A colleague suggests making them all user-invoked to save context. What's the right response?
Correct. A blanket switch in either direction is wrong. Each skill has a correct invocation mode based on whether the agent needs autonomous access. The fix is to audit: move user-deliberate actions to user-invoked (saving context), keep genuinely autonomous skills as model-invoked.
The answer is never "all one way." Some skills genuinely need model-invocation (code-review during builds, diagnose during errors). Others are deliberate human actions (handoff, teach, grill-me). The audit finds the natural boundary and moves each skill to its correct mode.

Your Exercise

  1. List all your skills. For each, note: model-invoked or user-invoked?
  2. For each model-invoked skill, ask: "Does the agent need to reach for this autonomously?" If not, switch it to user-invoked.
  3. For each user-invoked skill, ask: "Do I keep forgetting to invoke this when I should?" If yes, consider switching to model-invoked.
  4. Calculate your theoretical context load: count model-invoked skills × average description length.
  5. Look for router opportunities: are there clusters of related skills that could share one entry point?
📖 Primary Source

trail-map.html — Field Guide → Invocation axis — The full taxonomy with decision trees for model-invoked vs user-invoked routing, plus the router skill pattern.

Questions? Paste your skill list (just names and descriptions) and I'll help you categorize each by invocation mode, identify context budget issues, and spot router opportunities.
← Prev Next →