How Agent Skills Extend AI Coding Assistants Without Bloating Context
Problem
I kept running into the same issue with my AI coding assistant. Every time I wanted it to follow my team’s coding standards, I had to paste the same 2,000-word document into the chat. Then I wanted it to run TDD workflows, so I pasted another 1,500 words. By the time I added security review checklists and testing patterns, my context window was half gone before I even asked my actual question.
The error wasn’t a crash. It was worse. The assistant started forgetting earlier parts of our conversation. It gave generic advice instead of following my specific patterns. And when I switched projects, I had to re-paste everything.
What Are Agent Skills?
Agent Skills are modular packages that extend AI coding assistants with specialized knowledge. Think of them as onboarding guides for specific domains. Instead of a general-purpose AI, you get an AI that knows your coding standards, testing workflows, and security requirements.
The key innovation is progressive disclosure. Skills don’t dump everything into context at once. They load in stages:
┌─────────────────────────────────────────────────────────────┐│ Agent Skill Loading │├─────────────────────────────────────────────────────────────┤│ ││ Level 1: METADATA (always loaded) ││ ┌─────────────────────────────────────────┐ ││ │ name: coding-standards │ ~100 tokens ││ │ description: Use for TS/JS best practices│ ││ └─────────────────────────────────────────┘ ││ ↓ triggers when needed ││ ││ Level 2: INSTRUCTIONS (loaded on trigger) ││ ┌─────────────────────────────────────────┐ ││ │ Full SKILL.md content │ <5000 tokens ││ │ - Code quality principles │ ││ │ - Immutability patterns │ ││ │ - Error handling guidelines │ ││ └─────────────────────────────────────────┘ ││ ↓ referenced when needed ││ ││ Level 3: RESOURCES (loaded as needed) ││ ┌─────────────────────────────────────────┐ ││ │ scripts/extract.py │ Unlimited* ││ │ references/API.md │ ││ │ assets/template.json │ ││ └─────────────────────────────────────────┘ ││ ││ * Scripts execute without loading into context │└─────────────────────────────────────────────────────────────┘This architecture solves the context bloat problem. The AI always knows what skills are available (Level 1), but only loads the detailed instructions when you actually need them (Level 2).
The Anatomy of a Skill
A skill is just a directory with a SKILL.md file. Here’s the structure:
skill-name/├── SKILL.md (required - the main instruction file)│ ├── frontmatter (required - name and description)│ └── markdown body (the actual instructions)├── scripts/ (optional - executable code)├── references/ (optional - documentation files)└── assets/ (optional - templates, images, fonts)The SKILL.md file has a simple format:
---name: pdf-processingdescription: Extract text and tables from PDF files. Use when working with PDFs or document extraction.---
# PDF Processing
## Quick Start
Extract text with pdfplumber:
```pythonimport pdfplumber
with pdfplumber.open("document.pdf") as pdf: for page in pdf.pages: text = page.extract_text() print(text)```The frontmatter is critical. The name and description fields become the Level 1 metadata that’s always loaded. The AI uses the description to decide when to trigger the skill.
Why Progressive Disclosure Matters
I tried the naive approach first. I put all my coding standards, testing patterns, and security checklists into a single massive prompt. The result? The AI followed my standards but had no room left for actual work.
Here’s the token math:
| Approach | Tokens Used | Tokens Remaining |
|---|---|---|
| All prompts upfront | 15,000 | 185,000 |
| Skills (metadata only) | 500 | 199,500 |
| Skills (one triggered) | 5,500 | 194,500 |
With skills, I start with 500 tokens of metadata. When I ask about coding standards, that skill triggers and adds 5,000 tokens. But my security review skill stays dormant until I need it.
Cross-Platform Support
One of the best things about Agent Skills is cross-platform compatibility. The same skill format works across multiple AI coding tools:
| Platform | Directory | Status |
|---|---|---|
| Claude Code | ~/.claude/skills/ | Originator |
| Cursor | .cursor/skills/ | Full support |
| Codex | .codex/skills/ | Full support |
| Gemini CLI | .gemini/skills/ | Full support |
I can write a skill once and use it across all my AI tools. Migration typically involves just changing the directory path.
Skills vs MCP: When to Use Each
I was confused about the difference between Agent Skills and MCP (Model Context Protocol). They serve different purposes:
┌─────────────────────────────────────────────────────────────┐│ Skills vs MCP Comparison │├─────────────────────────────────────────────────────────────┤│ ││ AGENT SKILLS MCP (Model Context Protocol) ││ ───────────── ───────────────────────────── ││ ││ Purpose: Prompt management Purpose: Tool invocation ││ ││ Format: Markdown files Format: Protocol messages ││ ││ Complexity: Low Complexity: Medium ││ (just write markdown) (implement protocol) ││ ││ Token efficiency: High Token efficiency: Medium ││ (progressive disclosure) ││ ││ Best for: Best for: ││ - Coding standards - Database connections ││ - Testing workflows - API integrations ││ - Security checklists - External tool calls ││ │└─────────────────────────────────────────────────────────────┘The best practice is to use both together. Skills manage your prompts and domain knowledge. MCP handles standardized tool calls. They complement each other.
Real Example: Coding Standards Skill
Here’s a skill I use daily. It enforces coding standards across my projects:
---name: coding-standardsdescription: Universal coding standards for TypeScript, JavaScript, React, and Node.js. Use when writing or reviewing code.---
# Coding Standards
## Immutability (CRITICAL)
Always create new objects. Never mutate:
```typescript// WRONG: Mutationfunction updateUser(user, name) { user.name = name // MUTATION! return user}
// CORRECT: Immutabilityfunction updateUser(user, name) { return { ...user, name }}```
## Error Handling
Always handle errors comprehensively:
```typescripttry { const result = await riskyOperation() return result} catch (error) { console.error('Operation failed:', error) throw new Error('User-friendly message')}```When I ask the AI to write code, it checks the skill metadata. If the task involves TypeScript or React, it triggers the skill and follows my standards.
How to Install Skills
Installation varies by platform. For Claude Code:
# Install from marketplacenpx claude-plugins install coding-standards
# List installed pluginsnpx claude-plugins list
# Enable/disablenpx claude-plugins enable coding-standardsnpx claude-plugins disable coding-standardsFor other platforms, you typically copy the skill directory to the appropriate folder.
The Reason Agent Skills Work
I think the key insight is that AI assistants don’t need all knowledge at once. They need:
- Awareness of what they can do (Level 1 metadata)
- Instructions when a task matches (Level 2 content)
- Resources for complex operations (Level 3 files)
Traditional prompts try to load everything upfront. Skills load progressively. This matches how humans work too. I don’t memorize every API. I know what’s available and look up details when needed.
Summary
In this post, I showed how Agent Skills extend AI coding assistants without bloating context. The key points are:
- Skills use progressive disclosure: metadata always loaded, instructions on trigger, resources as needed
- A skill is just a
SKILL.mdfile with YAML frontmatter and markdown instructions - Skills work across Claude Code, Cursor, Codex, and Gemini CLI
- Use Skills for prompt management and MCP for tool invocation
- Start with foundational skills: coding-standards, testing workflows, security reviews
The modular nature means you can build a custom toolkit that travels with you across projects and platforms.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Agent Skills Official Specification
- 👨💻 Claude Code Plugins Documentation
- 👨💻 Claude Plugins Marketplace
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments