Phase 3: Documentation-Centric Skills β SKILL.md
This phase introduces a documentation-first approach to teaching agents new capabilities. Instead of writing code, users write markdown files (SKILL.md) with YA
Phase 3: Documentation-Centric Skills β SKILL.md
Overview
This phase introduces a documentation-first approach to teaching agents new capabilities. Instead of writing code, users write markdown files (SKILL.md) with YAML frontmatter that describe skills, their requirements, and usage examples. The system discovers, validates, and injects these skills into the agent's context automatically.
What this enables:
Dependencies
Phase 1: Gateway & Channel Foundation
<skill> blocks before LLM callsExisting runtime infrastructure:
SkillRegistry from runtime/src/skills/types.tsruntime/src/skills/runtime/src/tools/Issue Dependency Graph
Implementation Order
- 1065 β SKILL.md parser (M)
- YAML frontmatter extraction, markdown body parsing
- 1070 β Discovery and validation (M)
- 3-tier discovery, requirement checks, caching
- 1066 β Workspace files (S)
- AGENT.md, SOUL.md, USER.md, MEMORY.md
- 1071 β Bundled skills (M)
- 8 starter SKILL.md files
- 1075 β Injection engine (M)
- Context-aware selection, token budget, assembly
- 1074 β Skill CLI (S)
- list, info, validate, create, install commands
Rationale: Parser β discovery β workspace/bundled skills β injection β CLI. Foundation first, content second, then smart loading, finally management tools.
Issue Details
3.1: SKILL.md parser (YAML frontmatter + markdown body) (#1065)
Goal: Parse SKILL.md files with YAML frontmatter and markdown body.
Files to create:
gateway/src/skills/parser.ts β SkillParser classgateway/src/skills/types.ts β MarkdownSkill, SkillFrontmattergateway/src/skills/index.tsgateway/src/skills/parser.test.tsFiles to modify:
gateway/src/index.ts β export skill typesIntegration points:
yaml library for frontmatter parsingmetadata.agenc namespacePatterns to follow:
runtime/src/skills/manifest.tsKey interfaces:
interface MarkdownSkill {
name: string;
description: string;
keywords: string[];
requirements?: SkillRequirements;
content: string;
filePath: string;
}
interface SkillFrontmatter {
name: string;
description: string;
keywords: string[];
version?: string;
requirements?: SkillRequirements;
metadata?: {
agenc?: {
capabilities?: string[];
priority?: number;
};
};
}
interface SkillRequirements {
binaries?: string[];
envVars?: string[];
os?: ('linux' | 'darwin' | 'win32')[];
}
interface SkillParser {
parse(filePath: string): PromiseMarkdownSkill>;
validate(skill: MarkdownSkill): boolean;
}Testing strategy:
Estimated scope: M (400-500 lines)
3.2: Skill discovery and validation (3-tier, requirement checks) (#1070)
Goal: Discover skills from 4 locations and validate their requirements.
Files to create:
gateway/src/skills/discovery.ts β SkillDiscovery classgateway/src/skills/validator.ts β SkillValidator classgateway/src/skills/cache.ts β Skill cache (mtime-based invalidation)gateway/src/skills/discovery.test.tsgateway/src/skills/validator.test.tsFiles to modify:
gateway/src/gateway.ts β integrate SkillDiscoverygateway/src/skills/index.ts β export discovery/validatorIntegration points:
1. ~/.agenc/agents/{agent-id}/skills/ (agent-specific)
2. ~/.agenc/skills/ (user global)
3. ./skills/ (project-local, if in git repo)
4. gateway/bundled-skills/ (built-in)
- Binaries exist on PATH (which <binary>)
- Env vars are set
- OS matches current platform
Patterns to follow:
runtime/src/skills/catalog.tsexecFile('which', [binary])Key interfaces:
interface SkillDiscovery {
discover(): PromiseMarkdownSkill[]>;
discoverFromPath(path: string): PromiseMarkdownSkill[]>;
getSkill(name: string): PromiseMarkdownSkill | null>;
refresh(): Promisevoid>;
}
interface SkillValidator {
validate(skill: MarkdownSkill): PromiseValidationResult>;
checkBinary(name: string): Promiseboolean>;
checkEnvVar(name: string): boolean;
checkOS(skill: MarkdownSkill): boolean;
}
interface ValidationResult {
valid: boolean;
missingBinaries: string[];
missingEnvVars: string[];
osIncompatible: boolean;
}Testing strategy:
which)Estimated scope: M (500-700 lines)
3.3: Skill injection engine (context-aware prompt assembly) (#1075)
Goal: Select and inject relevant skills into the system prompt.
Files to create:
gateway/src/skills/injector.ts β SkillInjector classgateway/src/skills/selector.ts β Skill selection logicgateway/src/skills/token-budget.ts β Token budget enforcementgateway/src/skills/injector.test.tsFiles to modify:
gateway/src/executor/chat-executor.ts β inject skills into system promptgateway/src/skills/index.ts β export injectorIntegration points:
- Keyword matching (message keywords β© skill keywords)
- Capability overlap (agent capabilities & skill required capabilities)
- Manual priority (metadata.agenc.priority)
<skill name="...">content</skill> blocksPatterns to follow:
Key interfaces:
interface SkillInjector {
inject(context: InjectionContext): Promisestring>;
selectSkills(context: InjectionContext): PromiseMarkdownSkill[]>;
}
interface InjectionContext {
message: GatewayMessage;
agentCapabilities: bigint;
maxTokens?: number;
}
interface SkillSelector {
score(skill: MarkdownSkill, context: InjectionContext): number;
rank(skills: MarkdownSkill[], context: InjectionContext): MarkdownSkill[];
}
interface TokenBudget {
count(text: string): number;
enforce(skills: MarkdownSkill[], budget: number): MarkdownSkill[];
}Testing strategy:
<skill name="...">...</skill>)Estimated scope: M (400-500 lines)
3.4: Bundled skills (8 starter SKILL.md files) (#1071)
Goal: Create 8 high-quality SKILL.md files for common tasks.
Files to create:
gateway/bundled-skills/solana-wallet.md β Wallet operationsgateway/bundled-skills/task-management.md β Task lifecyclegateway/bundled-skills/code-review.md β Code review workflowsgateway/bundled-skills/data-analysis.md β Data analysis patternsgateway/bundled-skills/web-research.md β Web research strategiesgateway/bundled-skills/deployment.md β Deployment checklistsgateway/bundled-skills/debugging.md β Debugging approachesgateway/bundled-skills/testing.md β Testing strategiesFiles to modify:
Integration points:
Patterns to follow:
- Overview section
- Step-by-step procedures
- Example commands/code
- Common pitfalls
- Related skills
Key structure (example for solana-wallet.md):
---
name: solana-wallet
description: Solana wallet operations and transaction signing
keywords: [solana, wallet, transaction, signature, keypair, balance]
version: 1.0.0
metadata:
agenc:
capabilities: [COMPUTE]
priority: 5
---
# Solana Wallet Operations
## Overview
This skill covers Solana wallet management, balance queries, and transaction signing.
## Check Balance
Use `solana balance <address>` to check SOL balance.
## Send Transaction
1. Create transaction with `@solana/web3.js`
2. Sign with wallet keypair
3. Send via `connection.sendTransaction()`
## Common Pitfalls
- Don't expose private keys in logs
- Always check recent blockhash expiry
- Use recommended compute unit budgets
## Related Skills
- task-management (for claiming tasks)
- deployment (for program deploys)Testing strategy:
Estimated scope: M (1500-2000 lines total across 8 files)
3.5: Workspace files (AGENT.md, SOUL.md, USER.md, etc.) (#1066)
Goal: Define workspace markdown files for agent context.
Files to create:
gateway/src/workspace/types.ts β WorkspaceFiles interfacegateway/src/workspace/loader.ts β Workspace file loadergateway/src/workspace/index.tsgateway/src/workspace/loader.test.tsexamples/workspace-templates/AGENT.md β Agent identity templateexamples/workspace-templates/SOUL.md β Personality templateexamples/workspace-templates/USER.md β User preferences templateexamples/workspace-templates/MEMORY.md β Long-term memory templateFiles to modify:
gateway/src/executor/chat-executor.ts β load workspace files into system promptgateway/src/skills/index.ts β export workspace typesIntegration points:
~/.agenc/workspace/ directory- AGENT.md: Agent identity (name, role, backstory)
- SOUL.md: Personality traits, tone, communication style
- USER.md: User preferences, goals, context
- MEMORY.md: Long-term facts (updated by memory ingestion)
Patterns to follow:
Key interfaces:
interface WorkspaceFiles {
agent?: string;
soul?: string;
user?: string;
memory?: string;
}
interface WorkspaceLoader {
load(dir: string): PromiseWorkspaceFiles>;
loadFile(path: string): Promisestring | null>;
}Testing strategy:
Estimated scope: S (200-300 lines + 4 template files)
3.6: Skill CLI commands (list, info, validate, create, install) (#1074)
Goal: CLI for skill management.
Files to create:
gateway/src/cli/skill-commands.ts β Skill CLI commandsgateway/src/cli/skill-templates.ts β SKILL.md template generatorFiles to modify:
gateway/src/bin/cli.ts β add skill subcommandsgateway/src/cli/index.ts β export skill commandsIntegration points:
Patterns to follow:
runtime/src/bin/cli.tsgateway/src/commands/Commands:
| Command | Description |
|---|---|
agenc skill list | List all discovered skills with status (valid/invalid) |
agenc skill info <name> | Show skill details (name, description, requirements, path) |
agenc skill validate <name> | Validate skill requirements (binaries, env vars, OS) |
agenc skill create <name> | Create new SKILL.md from template |
agenc skill install <path> | Copy SKILL.md to user skills directory |
Key interfaces:
interface SkillCommand {
name: string;
description: string;
execute(args: string[]): Promisevoid>;
}
interface SkillTemplate {
generate(name: string, description: string): string;
}Testing strategy:
Estimated scope: S (300-400 lines)
Integration Checklist
After completing all issues:
<skill> blocksConfiguration Example
{
"skills": {
"enabled": true,
"discoveryPaths": [
"~/.agenc/agents/{agent-id}/skills",
"~/.agenc/skills",
"./skills",
"gateway/bundled-skills"
],
"tokenBudget": 4000,
"autoValidate": true
},
"workspace": {
"directory": "~/.agenc/workspace",
"files": ["AGENT.md", "SOUL.md", "USER.md", "MEMORY.md"]
}
}Example SKILL.md (Task Management)
---
name: task-management
description: AgenC task lifecycle operations
keywords: [task, claim, complete, cancel, dispute, agenc, solana]
version: 1.0.0
requirements:
binaries: [solana]
metadata:
agenc:
capabilities: [COMPUTE]
priority: 8
---
# Task Management
## Overview
Manage tasks on the AgenC protocol: claim, complete, cancel, dispute.
## Claim Task
1. Find claimable tasks: `agenc task list --status open`
2. Claim: `agenc task claim <task-id>`
3. Verify claim: `agenc task get <task-id>`
## Complete Task
1. Execute task requirements
2. Generate proof if needed
3. Submit: `agenc task complete <task-id> --proof <path>`
## Cancel Task
Only creator can cancel before claim: `agenc task cancel <task-id>`
## Initiate Dispute
If worker submission is invalid: `agenc dispute initiate <task-id> --reason <reason>`
## Common Pitfalls
- Can't claim if insufficient stake
- Deadline expires β auto-cancel
- Dispute requires arbiter votes
## Related Skills
- solana-wallet (for transaction signing)
- debugging (for proof generation issues)