feat: implement Agent Skills specification support
Implements the Agent Skills specification (https://agentskills.io) for portable skill packages that give the agent new capabilities. Changes: - Add skills module with SKILL.md parser (YAML frontmatter + markdown body) - Implement skill discovery from ~/.g3/skills/, config extra_paths, and .g3/skills/ - Generate <available_skills> XML for system prompt injection - Add SkillsConfig to g3-config with enabled flag and extra_paths - Wire skills discovery into CLI startup - Add 29 unit tests for parser, discovery, and prompt generation - Update README with Agent Skills documentation Skill locations (priority order): 1. ~/.g3/skills/ (global) 2. Config extra_paths 3. .g3/skills/ (workspace, highest priority) At startup, g3 scans skill directories and injects a summary into the system prompt. When the agent needs a skill, it reads the full SKILL.md using the read_file tool.
This commit is contained in:
37
README.md
37
README.md
@@ -109,6 +109,43 @@ These commands give you fine-grained control over context management, allowing y
|
||||
- **Code Search**: Embedded tree-sitter for syntax-aware code search (Rust, Python, JavaScript, TypeScript, Go, Java, C, C++) - see [Code Search Guide](docs/CODE_SEARCH.md)
|
||||
- **Final Output**: Formatted result presentation
|
||||
|
||||
### Agent Skills
|
||||
|
||||
g3 supports the [Agent Skills](https://agentskills.io) specification - an open format for portable skill packages that give the agent new capabilities.
|
||||
|
||||
**Skill Locations** (in priority order, later overrides earlier):
|
||||
1. Global: `~/.g3/skills/`
|
||||
2. Extra paths from config
|
||||
3. Workspace: `.g3/skills/` (highest priority)
|
||||
|
||||
**SKILL.md Format**:
|
||||
```yaml
|
||||
---
|
||||
name: pdf-processing # Required: 1-64 chars, lowercase + hyphens
|
||||
description: Extract text... # Required: 1-1024 chars, when to use
|
||||
license: Apache-2.0 # Optional
|
||||
compatibility: Requires git # Optional: environment requirements
|
||||
---
|
||||
|
||||
# PDF Processing
|
||||
|
||||
Detailed instructions for the agent...
|
||||
```
|
||||
|
||||
**Configuration** (in `g3.toml`):
|
||||
```toml
|
||||
[skills]
|
||||
enabled = true # Default: true
|
||||
extra_paths = ["/path/to/skills"] # Additional skill directories
|
||||
```
|
||||
|
||||
At startup, g3 scans skill directories and injects a summary into the system prompt. When the agent needs a skill, it reads the full `SKILL.md` using the `read_file` tool.
|
||||
|
||||
Each skill adds ~50-100 tokens to context (name + description + path). Skills can include:
|
||||
- `scripts/` - Executable code (Python, Bash, etc.)
|
||||
- `references/` - Additional documentation
|
||||
- `assets/` - Templates, data files
|
||||
|
||||
### Provider Flexibility
|
||||
- Support for multiple LLM providers through a unified interface
|
||||
- Hot-swappable providers without code changes
|
||||
|
||||
Reference in New Issue
Block a user