The current generation of AI coding agents makes it surprisingly easy to create a "skill."
Write a Markdown file. Add instructions. Give it a name. Put it inside .claude/skills/
. Done.
Except it isn't.
As soon as you build more than a handful of skills, a different set of problems appears:
At that point, AI skills stop looking like prompts and start looking like software systems.
A production-grade AI skill is not merely a Markdown prompt. It is a versioned, testable, routable, enforceable software component with a defined lifecycle.
A useful way to understand an AI skill is to look at its entire lifecycle:
Runtime
β
Scope / Fit
β
Triggers
β
Architecture
β
Anatomy
β
Content
β
Enforcement
β
Measurement
β
Shipping
β
Maintenance
β
Portfolio
Each stage answers a different question:
| Stage | Core question |
|---|---|
| Runtime | How does the skill load and execute? |
| Fit & scope | Should this be a skill at all? |
| Typing & triggers | When should it activate? |
| Architecture | How should the workflow operate? |
| Anatomy | What files make up the skill? |
| Content | How should instructions be written? |
| Enforcement | What can be enforced mechanically? |
| Measurement | How do we know it works? |
| Shipping | How do users receive it? |
| Maintenance | How does it survive change? |
| Portfolio | How do many skills coexist? |
The important insight is that skill engineering covers the entire lifecycle, not just the writing of SKILL.md.
Before designing a skill, understand the runtime.
A skill may look simple on disk:
.claude/
βββ skills/
βββ code-review/
βββ SKILL.md
But conceptually the runtime does something like:
User request
β
Skill discovery
β
Trigger evaluation
β
Skill activation
β
Instruction
β
Reference/tool
β
Agent execution
β
Result
The important question is:
What does the agent actually see, and when does it see it?
This matters because context is limited.
A skill might contain:
SKILL.md
references/
database.md
security.md
examples.md
architecture.md
scripts/
validate.js
check.sh
templates/
report.md
You usually don't want every file loaded for every request.
Instead:
Request
β
SKILL.md
β
Determine relevant task
β
Load relevant reference
β
Execute required script
This is **progressive context **.
The main skill file acts as an entry point rather than a giant knowledge dump.
One of the biggest mistakes in AI skill design is treating context as free.
It isn't.
SKILL.md
ββββββββββββββ
3000 lines
50 examples
20 rules
10 workflows
15 edge cases
SKILL.md
β
Routing
β
references/
βββ workflow.md
βββ security.md
βββ examples.md
The second design gives you more control over what enters the model's context.
Design skills around context boundaries, not just file boundaries.
The next question is:
Should this behavior be implemented as a skill?
AI development environments often provide multiple primitives:
Skill
Rule
Agent
Hook
Script
Plugin
They are not interchangeable.
A skill describes how to perform a class of task.
Example:
database-migration
It might define:
1. Inspect schema
2. Inspect migration history
3. Design migration
4. Implement migration
5. Validate migration
6. Test rollback
A rule is a constraint:
Never modify production data directly.
That is policy, not a workflow.
An agent is useful when you need a distinct reasoning or execution role:
Main Agent
βββ Research Agent
βββ Security Agent
βββ Testing Agent
A hook responds to an event:
Before tool call
β
Security check
or:
After file modification
β
Formatter
A script performs deterministic computation:
validate-schema.js
The AI may decide when to run it. The script determines how validation works.
A good skill should explicitly state what it does not do.
For example:
This skill handles:
- PostgreSQL schema migrations
- Migration generation
- Migration validation
- Rollback testing
This skill does not handle:
- Application architecture
- Production deployment
- Database backups
- Infrastructure provisioning
Why?
Because skills tend to grow.
A developer starts with:
database migration
Then adds:
database design
query optimization
backup strategy
production deployment
Eventually the skill becomes:
database-engineering-everything
and becomes difficult to reason about.
Scope is a defense against skill inflation.
Once you know what a skill does, you need to answer:
When should it activate?
Imagine:
frontend-review
backend-review
security-review
performance-review
database-review
The user says:
"Review my authentication API."
Multiple skills may be relevant.
You now have a routing problem:
User request
β
βββββββββββββββΌββββββββββββββ
β β β
Backend Security Performance
If everything activates, the system becomes noisy.
If nothing activates, the skill is useless.
Think of activation as:
User request
β
Intent classification
β
Skill candidates
β
Relevance evaluation
β
Activation
Example:
| Request | Expected skill |
|---|---|
| "Create a PostgreSQL migration" | Database migration |
| "Fix this React component" | Frontend |
| "Audit authentication" | Security |
| "Why is this query slow?" | Database performance |
| "Write a technical article" | Documentation |
A good skill therefore needs a clear activation signature.
"Write a blog about PostgreSQL"
β security skill activates
"Why is my PostgreSQL migration failing?"
β database migration skill does not activate
Both are important.
Therefore, evaluate activation separately from execution.
Once a skill activates, what does it actually do?
There are several useful workflow shapes.
A route chooses a path:
Request
β
classify
/ | / | Bug Feature Refactor
β β β
Debug Implement Refactor
A pipeline is sequential:
Research
β
Analyze
β
Plan
β
Implement
β
Test
β
Review
β
Report
This is particularly useful for engineering skills.
A loop supports iteration:
Implement
β
Test
β
Failed?
/ Yes No
β β
Fix Complete
β
Test again
For coding agents, this is natural:
Write implementation
β
Run tests
β
Read failure
β
Modify implementation
β
Run tests again
Failure becomes an expected workflow state rather than an exceptional event.
A map splits a problem into independent pieces:
Research repository
β
βββββββββββββββΌββββββββββββββ
β β β
Frontend Backend Database
β β β
Findings Findings Findings
βββββββββββββββΌββββββββββββββ
β
Synthesis
Real skills often combine these patterns:
Route
β
Pipeline
β
Map
β
Loop
β
Final report
This is where AI skills start looking like workflow engines rather than prompts.
A mature skill might look like:
skills/
βββ deep-research/
β
βββ SKILL.md
β
βββ references/
β βββ research-methodology.md
β βββ source-evaluation.md
β βββ evidence.md
β
βββ scripts/
β βββ validate-sources.js
β βββ generate-report.js
β
βββ templates/
β βββ report.md
β
βββ examples/
βββ example-1.md
βββ example-2.md
Each part has a job.
SKILL.md
Is the Hub
Think of SKILL.md
as the router and operating manual.
It should explain:
What this skill does
When it activates
What it must accomplish
What references to load
What workflow to follow
What constraints apply
How to validate the result
It should not necessarily contain every piece of knowledge.
SKILL.md
/ | / | β β β
References Scripts Templates
The hub provides orchestration.
The spokes provide specialized resources.
Separate them:
SKILL.md
Tell the agent what to do.
references/
Provide knowledge.
scripts/
Perform deterministic operations.
This separation makes skills easier to maintain and test.
Now we reach the instruction layer.
Compare:
You might want to check whether tests pass.
Run the test suite before declaring the task complete.
Do not declare the task complete until the test suite passes.
The difference is binding strength.
Prefer TypeScript.
Use TypeScript for new files.
Do not create JavaScript files. New implementation files must use TypeScript.
Important rules should be unambiguous.
Instead of:
The agent should inspect the repository.
write:
Inspect the repository before making changes.
Instead of:
The agent will run the tests after implementation.
write:
Run the tests after implementation.
Direct instructions are easier to interpret.
Avoid thousands of words explaining philosophy.
Prefer operational instructions:
1. Inspect X.
2. Determine Y.
3. Run Z.
4. If Z fails, investigate.
5. Do not proceed until Y is verified.
The skill should be operational.
This is one of the most important ideas.
Don't rely on the model to enforce something that software can enforce.
Suppose your skill says:
Always run Prettier.
The agent might comply.
But it might also forget.
A stronger design is:
AI modifies file
β
Hook
β
Prettier
β
Formatted file
Formatting no longer depends entirely on model memory.
Consider:
Never commit secrets.
A prompt can say:
RULE:
Never commit API keys.
But a stronger architecture is:
Agent
β
git commit
β
secret scanner
β
Secret found?
βββ Yes β Block commit
βββ No β Continue
A useful model is:
Human judgment
β
AI instruction
β
Automated validation
β
Mechanical enforcement
The further down the stack you go, the less you rely on model compliance.
Examples of good candidates for automation:
Formatting
Linting
Type checking
Schema validation
Tests
Secret detection
File naming
Generated artifacts
SQL safety
Permission boundaries
The AI should focus on tasks requiring judgment.
Now ask:
How do we know the skill works?
A skill should ideally be evaluated, not merely read and trusted.
There are two major dimensions.
Did the correct skill activate?
Example:
Prompt:
"Create a PostgreSQL migration for the users table."
Expected:
database-migration β activated
You can maintain an evaluation set:
ββββββββββββββββββββββββββββββββββββββ
β Activation Evaluation β
ββββββββββββββββββββββββββββββββββββββ€
β Prompt β
β Expected skill β
β Should activate? β
β Actual skill β
β Result β
ββββββββββββββββββββββββββββββββββββββ
Once activated, did the skill behave correctly?
Suppose the migration skill requires:
Inspect schema
Check migration history
Create migration
Validate SQL
Test migration
Test rollback
Behavior evaluation checks those requirements.
Skill
β
ββββββββββ΄βββββββββ
β β
Activation Behavior
β β
Correct skill? Correct workflow?
A skill could have:
90% activation accuracy
40% behavior accuracy
and still be a poor skill.
Useful metrics include:
correct activations / total activation tests
incorrect activations / total tests
missed activations / applicable tests
successful executions / total executions
required behaviors satisfied / required behaviors
previously passing cases now failing
This turns skill development into an engineering discipline.
Another useful activity is comparing your skill against existing approaches.
Suppose you create:
deep-research
Before declaring it complete, ask:
What existing research workflows already exist?
What evaluation techniques do they use?
What source-quality rules are common?
What am I missing?
Which practices are unnecessarily complicated?
This is prior-art auditing.
You don't need to reinvent every workflow.
A skill isn't useful if nobody can install it.
A typical flow is:
Development
β
Repository
β
Package / Plugin
β
Distribution
β
Installation
β
Skill available
A plugin can act as a distribution container:
Plugin
β
βββ Skills
β βββ research
β βββ testing
β βββ code-review
β
βββ Hooks
βββ Commands
βββ Configuration
This lets users install a cohesive collection rather than manually copying individual files.
Once users depend on a skill, versioning matters:
research-skill@1.0.0
research-skill@1.1.0
research-skill@2.0.0
Changing:
"prefer X"
to:
"must use X"
can change agent behavior significantly.
Therefore skill versions should be treated as meaningful behavioral versions.
A skill may sit unused for months.
Then:
Developer
β
invokes old skill
β
framework changed
β
skill behaves differently
This is skill dormancy.
Skills need lifecycle states and maintenance expectations.
AI skills exist inside rapidly changing ecosystems.
Things change:
AI models
Agent runtimes
APIs
CLI tools
Frameworks
Repository structures
Tool interfaces
Best practices
Security requirements
Therefore:
A skill is software, and software drifts.
Suppose:
Tool v1
β
Skill v1
Later:
Tool v2
β
behavior changed
Your skill still assumes the old behavior.
That is drift.
Suppose your skill contains a copy of external documentation:
external methodology
β
copy
β
your skill
The external source changes.
Your copy doesn't.
Now:
Upstream
β
Version 3
Your skill
β
Version 1
You have a maintenance obligation.
A good update flow is:
Upstream changes
β
Detect change
β
Review
β
Update skill
β
Run evaluation suite
β
Check regressions
β
Release
Not:
Upstream changed
β
blindly copy everything
One skill is easy.
Two are manageable.
Ten are interesting.
Fifty become an architecture problem.
You may eventually have:
skills/
βββ research/
βββ frontend/
βββ backend/
βββ database/
βββ security/
βββ testing/
βββ performance/
βββ deployment/
βββ documentation/
βββ architecture/
βββ debugging/
βββ code-review/
Now you need portfolio management.
Suppose the user says:
"Review my API."
Potential matches:
api-review
backend-review
security-review
performance-review
Which one activates?
This is a collision.
If multiple skills activate, their instructions may conflict.
For example:
Skill A:
"Keep the implementation minimal."
Skill B:
"Add extensive validation."
Skill C:
"Refactor the architecture."
A skill portfolio therefore needs routing and priority policies.
How large should a skill be?
Too broad:
software-engineering
with everything inside it.
Too narrow:
read-file
write-file
check-import
check-variable
run-test
You don't want hundreds of microscopic skills.
A better structure might be:
Engineering
β
βββ Research
βββ Implementation
βββ Testing
βββ Security
βββ Deployment
Each skill owns a meaningful capability.
A router can first identify the broad family:
User request
β
Main Router
β
βββββββββββββββββΌββββββββββββββββ
β β β
Research Engineering Operations
β β β
Research Backend Deployment
skill Security Monitoring
Testing
Instead of asking:
"Which of these 100 skills should run?"
you ask:
Which family?
β
Which subcategory?
β
Which skill?
A healthy portfolio needs a retirement policy.
A skill may become obsolete because:
A lifecycle might be:
Experimental
β
Active
β
Stable
β
Deprecated
β
Retired
This prevents the skill directory from becoming a graveyard.
A mature skill can be viewed as four major layers:
ββββββββββββββββββββββββββββββββββββββββ
β SKILL β
β β
β ββββββββββββββββββββββββββββββββββ β
β β Instructions β β
β β What the agent should do β β
β ββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββ β
β β Workflow β β
β β Route / Pipeline / Loop / Map β β
β ββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββ β
β β Enforcement β β
β β Hooks / Scripts / Tests β β
β ββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββ β
β β Evaluation β β
β β Activation / Behavior / QA β β
β ββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββ
This is the important shift in thinking.
A skill is not merely:
prompt β answer
It is closer to:
intent
β
routing
β
context
β
workflow
β
tools
β
validation
β
feedback
β
result
Suppose you want:
deep-research
Its directory could be:
deep-research/
βββ SKILL.md
βββ references/
β βββ research-methodology.md
β βββ source-quality.md
β βββ evidence-evaluation.md
β βββ synthesis.md
βββ scripts/
β βββ validate-sources.js
β βββ generate-report.js
βββ templates/
β βββ research-report.md
βββ evals/
βββ activation.json
βββ behavior.json
This skill performs structured research.
It handles:
- multi-source research
- source evaluation
- evidence synthesis
- contradiction analysis
- structured reporting
It does not handle:
- software implementation
- deployment
- generic writing
Potential activation prompts:
"Research this topic deeply."
"Investigate the current state of..."
"Compare these technologies using external sources."
"Find evidence for and against this claim."
Non-activation examples:
"Fix this React bug."
"Run the tests."
"Format this file."
Understand question
β
Decompose question
β
Identify evidence requirements
β
Search
β
Evaluate sources
β
Extract evidence
β
Cross-check claims
β
Synthesize
β
Write report
β
Validate citations
If two sources disagree:
Source A β Claim X
Source B β Claim Y
then:
Conflict detected
β
Investigate
β
Find additional sources
β
Re-evaluate evidence
β
Resolve / report uncertainty
Now the skill combines:
Pipeline + Loop
Instead of only telling the AI:
"Make sure every claim has a citation."
build a validator:
Report
β
Citation validator
β
Missing citation?
βββ Yes β fail
βββ No β pass
Example:
Prompt:
"Do a deep investigation into DuckDB vs PostgreSQL for analytics."
Expected:
deep-research β YES
And:
Prompt:
"Fix the DuckDB connection bug."
Expected:
deep-research β NO
For a research request:
β question decomposition
β multiple sources
β source quality assessment
β evidence extraction
β conflicting evidence analysis
β synthesis
β citations
β final report
Now regressions can be detected.
This model becomes especially interesting when building a larger AI development harness.
Imagine:
AI HARNESS
β
β
Intent Router
β
βββββββββββββββββΌββββββββββββββββ
β β β
Research Engineering Operations
β β β
β β β
Skills Skills Skills
β β β
βββββββββββββββββΌββββββββββββββββ
β
Tools
β
Enforcement
β
Evaluation
β
Reporting
This is much more powerful than simply having a folder full of Markdown files.
Traditional software:
Code
β
Execution
β
Result
AI software:
Intent
β
Skill
β
Reasoning
β
Tools
β
Result
But production AI systems need another layer:
Intent
β
Skill
β
Reasoning
β
Tools
β
Policy
β
Validation
β
Result
The skill becomes a bridge between natural-language intent and deterministic engineering systems.
If there is one idea to take away from all of this, it is:
Use AI for judgment. Use software for certainty.
Let the model handle:
Interpretation
Planning
Hypothesis generation
Trade-offs
Synthesis
Creative reasoning
Let software handle:
Formatting
Validation
Testing
Schema checking
Permissions
Secret detection
Deterministic calculations
Policy enforcement
For example:
AI:
"These three files probably need to change."
Software:
"Does the resulting code compile?"
AI:
"This migration should be safe."
Software:
"Does the migration actually execute successfully?"
AI:
"These sources support the conclusion."
Software:
"Are the required citations present?"
That division produces more reliable systems.
As AI agents become more capable, the bottleneck increasingly shifts away from:
"Can the model write code?"
toward:
"Can we reliably control how the model works?"
That is a different engineering problem.
We need to reason about:
Activation
Context
Permissions
Workflow
Tools
Memory
Policies
Evaluation
Regression
Versioning
Distribution
These are systems problems.
That is why skill engineering starts resembling:
software architecture
+
prompt engineering
+
workflow orchestration
+
testing
+
policy enforcement
+
package management
SKILL.md
concise?Putting everything together:
USER INTENT
β
βΌ
ββββββββββββββββββ
β ROUTER β
βββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββ
β SKILL β
β β
β Scope β
β Instructions β
β Workflow β
β References β
ββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββββ
β AI REASONING β
ββββββββββββ¬βββββββββββ
β
ββββββββββββ΄βββββββββββ
β β
Tools / APIs Scripts
β β
ββββββββββββ¬βββββββββββ
β
βββββββββββββββββββ
β ENFORCEMENT β
β β
β Hooks β
β Policies β
β Validators β
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β EVALUATION β
β β
β Activation β
β Behavior β
β Regression β
ββββββββββ¬βββββββββ
β
RESULT
And around the whole system:
βββββββββββββββββββββββββββββββββββββ
β SKILL LIFECYCLE β
β β
β Version β Ship β Observe β β
β Maintain β Update β Deprecate β
β β
βββββββββββββββββββββββββββββββββββββ
The simplest way to build an AI skill is:
Write SKILL.md
The professional way is:
Define scope
β
Define activation
β
Design workflow
β
Structure context
β
Write instructions
β
Add tools
β
Mechanically enforce critical rules
β
Evaluate activation
β
Evaluate behavior
β
Version
β
Ship
β
Monitor drift
β
Maintain
β
Retire when necessary
That is the fundamental shift.
AI skills should be treated less like prompts and more like software components.
A prompt tells an AI what you would like it to do.
A well-engineered skill defines:
Once you start thinking this way, .claude/skills/
stops being a collection of Markdown files.
It becomes an AI-native software architecture layer.
The future of agent engineering is not just better prompts β it is better systems around prompts.