Skip to main content

Skills vs Agents

SpecWeave extends AI coding assistants (Claude Code, Cursor, Copilot, Windsurf, and others) with two core AI components: Skills (portable instructions) and Custom Subagents (isolated workers with memory). Understanding the difference — and how they compose — is key to building effective AI-assisted workflows.


Quick Comparison

AspectSkillsCustom Subagents
ActivationNatural language, /command, or CLI keywordExplicit (Agent() call)
ContextMain conversation or forked (context: fork)Always isolated
MemoryNone (stateless)Persistent (memory: project/user/local)
ResumableNoYes (by agent ID)
Background execNoYes (run_in_background: true)
Fileskills/name/SKILL.mdagents/name.md
Preloads skillsNoYes (skills: field)

Skills

Skills are markdown instructions that AI assistants follow. They can be invoked three ways: natural language (auto-activation on keywords), slash commands (sw:name) in Claude Code, or CLI keywords (name) in other AI tools. Skills can also be preloaded by subagents.

How They Work

Execution Modes

ModeWhenHow
InlineReference knowledge (conventions, patterns)No context: fork — enriches main conversation
ForkedStandalone tasks (grill, brainstorm)context: fork — isolated context
PreloadedInside a subagentskills: field on subagent — subagent provides isolation

Skill File Structure

# skills/pm/SKILL.md
---
description: Product Manager for spec-driven development.
context: fork
model: opus
---

# Product Manager Skill

## Workflow
[Phased domain logic, templates, validation rules...]

Example Skills

The most common entry point — starting a new feature:

"Let's build user authentication with OAuth"

Other frequently used skills:

sw:pm                 # Product management domain logic (preloaded by sw-pm subagent)
sw:architect # Architecture domain logic (preloaded by sw-architect subagent)
sw:grill # Code review (standalone, context: fork)
sw:brainstorm # Multi-perspective ideation (standalone, context: fork)

Custom Subagents

Custom subagents are isolated AI workers with their own context, persistent memory, and optional skills preloading. They run in a separate conversation, can be resumed, and support background execution.

How They Work

Key Capabilities (beyond Skills)

  • Persistent memory — retains learnings across sessions (memory: project)
  • Resumability — can be resumed by agent ID for multi-turn workflows
  • Background execution — runs concurrently while you keep chatting
  • Auto-compaction — handles context overflow at ~95% capacity
  • Skills preloadingskills: field guarantees domain logic injection at startup
  • Permission overrides — can restrict tool access for safety

Subagent File Structure

# agentssw-pm.md
---
name: sw-pm
description: Product Manager for writing spec.md
model: opus
memory: project
skills:
- sw:pm
---

# Product Manager Subagent

You are a PM specializing in spec-driven development.
The sw:pm skill is preloaded with full domain logic.

SpecWeave Core Subagents

SubagentPreloads SkillWritesModel
sw-pmsw:pmspec.mdOpus
sw-architectsw:architectplan.mdOpus
sw-planner(inline BDD logic)tasks.mdSonnet

The most powerful pattern combines both: subagents own isolation and memory, skills own domain logic.

plugins/specweave/
├── agents/
│ ├── sw-pm.md # Subagent: memory, model, skills: [sw:pm]
│ ├── sw-architect.md # Subagent: memory, model, skills: [sw:architect]
│ └── sw-planner.md # Subagent: memory, model, inline BDD task logic
├── skills/
│ ├── pm/
│ │ ├── SKILL.md # Domain logic, phases, templates
│ │ ├── phases/ # Supporting files loaded on demand
│ │ └── templates/
│ └── architect/
│ └── SKILL.md

How the increment skill orchestrates them:

// PM writes spec.md
Agent({ subagent_type: "sw:sw-pm", prompt: "Write spec for increment..." })

// Architect writes plan.md
Agent({ subagent_type: "sw:sw-architect", prompt: "Design architecture..." })

// Planner writes tasks.md
Agent({ subagent_type: "sw:sw-planner", prompt: "Generate tasks..." })

When to Use Which

Use Skills When:

  • Reference knowledge — conventions, patterns, style guides that enrich the main conversation
  • Standalone tasks — one-shot work like code review (sw:grill), brainstorming, validation
  • User-invocable commandssw:pm, sw:grill, sw:brainstorm
  • Repetitive instructions — the DRY principle for AI instructions

Use Custom Subagents When:

  • Persistent memory needed — agent retains learnings across sessions
  • Resumability needed — multi-turn workflows that may span sessions
  • Background execution — run concurrently while user continues chatting
  • Skills preloading — guarantee domain logic injection at startup
  • Orchestrated pipelines — PM → Architect → Planner chain

Use Them Together When:

Subagents preload skills for combined benefits:

Subagent (isolation, memory, resumability)
├── Preloads: Domain skill (full logic, phases, templates)
├── Has: Persistent memory across sessions
└── Produces: Deliverable (spec.md, plan.md, tasks.md)

Decision Flowchart

Does it need persistent memory or resumability?
YES → Custom subagent (with skills: preloading)
NO →
Is it a standalone task producing output?
YES → Skill with context: fork
NO →
Is it reference knowledge for the main conversation?
YES → Skill, NO context: fork (runs inline)
NO → Built-in subagent (Explore/Plan/general-purpose)

Beyond Claude: Extending Any AI Tool

While SpecWeave's skills and subagents are most deeply integrated with Claude Code, the architecture is designed to extend any AI coding assistant:

ExtensionClaude CodeCursor / Copilot / Windsurf
SkillsFull support (auto-activate, /commands, context: fork)Via AGENTS.md instruction files
Custom subagentsFull support (memory, resume, background)Not available (Claude Code exclusive)
HooksShell scripts on tool eventsNot available
MCP serversFull supportVaries by tool
PluginsBundle skills + agents + hooksSkills only (via AGENTS.md)

See AGENTS.md in any SpecWeave project for non-Claude tool instructions.


Skills vs MCP

MCP connects AI to data; Skills teach AI what to do with that data.

NeedUseExample
Access a database or APIMCPQuery your PostgreSQL database
Procedure for using that dataSkill"When querying our database, always filter by date range first"
Read Excel filesMCPOpen and parse spreadsheet data
Format Excel reportsSkill"Format reports with these specific formulas and layouts"

Use both together: MCP for connectivity, Skills for procedural knowledge.


Context Management

Skills: Shared or Forked

Main Context (200K tokens)
├── User conversation
├── Inline skill (loaded, 3K) ← shared context
├── Forked skill (context: fork) ← isolated context
└── Response

Subagents: Always Isolated

Main Context
├── User conversation
├── Agent() call
│ └── Subagent Context (separate)
│ ├── Preloaded skill instructions
│ ├── Persistent memory
│ ├── Relevant files
│ └── Generated output (spec.md, plan.md, etc.)
└── Subagent result returned

Decision Framework Summary

QuestionSkillsCustom SubagentsMCP
What does it do?Provides instructionsExecutes isolated workProvides data access
MemoryNonePersistent across sessionsNone
Context modelShared or forkedAlways isolatedShared (tool results)
Best forConventions, expertise, commandsComplex workflows, pipelinesData access, external services
AI tool supportAny (via AGENTS.md)Claude Code onlyVaries

Further Reading