Assistant Skills and Dynamic Injection
The skills system is a dynamic expansion framework that allows agents to acquire domain-specific expertise, specialized tools, and project-aware context at runtime.
1. Skill Architecture (skills.go)
The SkillCatalog is the centralized, thread-safe registry for all available capabilities.
Key Implementation Details
InitSkillSystem(): Scans theprompts/agent/subagents/skills/directory for JSON manifests and loads them into a globalsync.Map.InjectSkill(session, skillID): The core injection engine. It recursively validates prerequisites and merges the skill's data into the activeChatSession.GetSkill(skillID): Retrieves a manifest from the catalog.
2. Skill Mastery and Prerequisites
As seen in Git commit 229707c3, the system supports a hierarchical dependency model. This ensures that agents only attempt complex high-level tasks once foundational capabilities are confirmed.
prerequisite_skills: A list of IDs that must be injected before the current skill can be activated.- Recursive Injection: When an agent requests
api-development, the system automatically checks for and injectsgo_web_backendandlinux-sysadminif they are missing.
3. The Manifest Structure
Skills are defined in JSON files. A typical manifest includes:
| Field | Purpose |
|---|---|
required_tools |
List of tools (e.g., git, bwrap) that must be present in the session. |
prompt_suffixes |
Expert instructions appended to the agent's system prompt. |
context_variables |
Project-specific paths, IDs, or rules injected into the context. |
swarm_config |
Preferred ant worker roles and model tiers for this domain. |
4. Sequence Diagram: Skill Injection Flow
sequenceDiagram
participant A as Agent Tool Call
participant SC as SkillCatalog
participant S as ChatSession
participant TR as Tool Registry
A->>SC: InjectSkill("react_frontend")
SC->>SC: Check Prerequisites (js_runtime)
Note right of SC: Found Missing Prerequisite
SC->>S: Inject FOUNDATION: js_runtime
SC->>TR: Verify Tools (npm, npx)
TR-->>SC: Tools Valid
SC->>S: Append Prompt Suffixes
SC->>S: Inject Context Variables
S-->>A: Injection Complete (Skill Active)
5. Global Skill Taxonomy
The system currently manages 92+ specialized skills across several key categories:
- Technical Foundations:
linux-sysadmin,git-expert,network-engineer. - Backend Development:
go_web_backend,postgres-expert,api-design. - Frontend & Design:
react_frontend,tailwind-css,vector-artist. - Specialized Intelligence:
security-auditor,threat-hunter,crypto-analyst.
Guidance for AI Agents
- Identify Blockers: If a task requires knowledge you don't have (e.g., "Write a React component"), use the
get_capabilitiestool to see if a relevant skill is available in the catalog. - State Prerequisites: When explaining why a skill injection failed, clearly list the missing prerequisites so the user can address them.