Fills a gap needed for the planned forge orchestrator skill: neither doc set previously stated when to build a skill vs a subagent/custom agent. Sourced via context7 against the same libraries already recorded in each sources.md. Also confirms agentskills.io's spec is runtime-agnostic and defines no agent concept, so it has no bearing on this decision by design.
2.1 KiB
topic, source_keys
| topic | source_keys | |
|---|---|---|
| decision-criteria |
|
Skill vs Subagent
Official comparison (Compare similar features > Skill vs Subagent): skills add to the main context window and are best for reference material or invocable workflows; subagents use a separate context window with their own input/output tokens, making them ideal for tasks that read many files, run in parallel, or need a specialized worker — especially when the main context window is getting full.
Restated: skills are reusable content (instructions, knowledge, workflows) loaded into any context, benefiting from content sharing across the conversation. Subagents are isolated workers with their own context, designed for context isolation — work happens separately and only a summary returns to the main conversation.
Combining skills and subagents
The two are not mutually exclusive — Claude Code documents two explicit combination mechanisms, inverses of each other:
skills:field on a subagent — preloads specific skill content into that subagent's own system prompt. The subagent controls the prompt; skill content is injected into it at startup.context: forkfield on a skill — runs the skill's own body in an isolated agent context instead of the calling conversation. Theagentfield selects which subagent type executes it (built-inExplore,Plan,general-purpose, or a custom subagent); defaults togeneral-purposeif omitted. The skill's content becomes the task prompt injected into that agent.
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file references
This means a single skill file can declare that it should always execute in isolation, without needing a separate agent definition file — useful when the isolation need is inherent to the task (e.g., broad file search) rather than something the caller decides per-invocation.