Managing Skills
Relevant source files
The following files were used as context for generating this wiki page:
Skills in Autohand are specialized instruction packages—contained within SKILL.md files—that provide the agent with specific workflows, best practices, and guided steps for complex technical tasks. These modular extensions function similarly to on-demand project instruction files, allowing for persistent and reusable domain-specific knowledge across different sessions and projects.
Sources: src/skills/types.ts:7-11, src/core/agent.ts:1082-1087
The system provides a comprehensive lifecycle for skills, including automated discovery from existing vendor tools (like Claude or Codex), interactive marketplace installation from GitHub, and automated generation via project analysis using Large Language Models (LLMs).
Core Architecture and Data Structures
The skill system is centered around the SkillsRegistry, which manages the discovery, parsing, and activation of skill definitions.
Skill Definition
A skill is defined by a markdown file containing YAML frontmatter and a markdown body. The frontmatter specifies metadata such as name, description, and allowed tools.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Max 64 chars, a-z/0-9/hyphens only. |
description | string | Yes | Purpose of the skill, max 1024 chars. |
allowed-tools | string | No | Space-delimited list of permitted tools. |
body | string | Yes | Markdown content with instructions. |
isActive | boolean | Yes | Whether the skill is currently injected into the agent's context. |
Sources: src/skills/types.ts:36-62, src/skills/types.ts:114-135
Skill Discovery and Sources
Skills are loaded from multiple locations with specific precedence. If names collide, sources later in the hierarchy override earlier ones.
The diagram shows the hierarchy of skill sources and the auto-migration path for vendor-specific skills.
Sources: src/skills/types.ts:17-25, src/skills/SkillsRegistry.ts:162-177, src/skills/SkillsRegistry.ts:208-226
Skill Activation and Injection
The AutohandAgent integrates active skills directly into its system prompt. When a skill is marked as isActive, its full markdown body is loaded and appended to the agent's core instructions.
- Registry Initialization: The registry scans specified directories for
SKILL.mdfiles. - Explicit Activation: Users activate skills via
/skills use <name>. - Context Injection: The
buildSystemPromptfunction iterates through active skills and appends their content under the "Active Skills" section.
Sources: src/core/agent.ts:1089-1107, src/commands/skills.ts:153-171
Automated Skill Generation (Auto-Skill)
The project includes an "Auto-Skill" system that analyzes a project's structure to generate tailored skill definitions using an LLM.
Project Analysis Flow
The ProjectAnalyzer inspects the workspace for specific identifiers:
- Languages: Detection of
.ts,.js,.py,.rs, and.gofiles. - Frameworks: Identification of dependencies in
package.json(e.g., React, Next.js, Express) orrequirements.txt(e.g., Flask, Django). - Patterns: Detection of testing frameworks (Vitest, Pytest), monorepos, and CI/CD configurations.
This sequence illustrates the process of analyzing project metadata to generate and save new skills.
Sources: src/skills/autoSkill.ts:150-250, src/skills/autoSkill.ts:405-430, src/skills/autoSkill.ts:510-530
Interactive Marketplace and Installation
Users can browse and install community-contributed skills using the /skills install command, which provides a TUI (Text User Interface) powered by ink.
Installation Scopes
When installing a skill, users must choose between two scopes:
- User Scope: Installed to
~/.autohand/skills/, making the skill available across all projects. - Project Scope: Installed to
.autohand/skills/within the current workspace, keeping it project-specific.
Sources: src/commands/skills-install.ts:213-228, src/ui/skillsBrowser/SkillsBrowserUI.tsx:325-360
Community Registry Fetching
The GitHubRegistryFetcher retrieves a registry index from GitHub. The browser interface categorizes these skills (e.g., languages, workflows) and displays ratings and download counts.
Sources: src/commands/skills-install.ts:46-65, src/ui/skillsBrowser/SkillsBrowserUI.tsx:85-110
Command Reference
The /skills slash command serves as the primary interface for managing the system.
| Subcommand | Action |
|---|---|
/skills | Lists all available and active skills. |
/skills use <name> | Sets a skill to active status. |
/skills deactivate <name> | Removes a skill from the active instruction set. |
/skills info <name> | Displays metadata and content preview for a skill. |
/skills install | Launches the marketplace browser. |
/skills new | Generates a new skill template from a user description. |
Sources: src/commands/skills.ts:24-46, src/commands/skills-new.ts:40-75
Summary
Managing Skills in Autohand provides a robust framework for extending agent capabilities through modular, instruction-based packages. By supporting multi-source discovery, automated project analysis, and a community marketplace, the system ensures that the AI agent can adapt its internal logic and tool usage to the specific requirements of any codebase or workflow. Managing these skills effectively allows developers to maintain consistency in code reviews, testing patterns, and architectural conventions.