This commit is contained in:
Yiorgis Gozadinos 2026-03-24 16:06:46 +02:00
parent ce95234cc8
commit 7309d13317
No known key found for this signature in database
3 changed files with 91 additions and 0 deletions

View file

@ -1,6 +1,13 @@
# Changelog
## [Unreleased]
### Added
- **`create-skill` CLI command**: Generate standalone skill packages with embedded LanceDB databases. Supports tool selection, custom preamble/description, and optional config embedding. Generated packages register as `haiku.skills` entry points.
- **`haiku.rag.skill_generator`**: Programmatic API for skill generation (`generate_skill()`, `render_templates()`)
- **`haiku.rag.skills._tools`**: Reusable tool implementations and `create_skill_tools()` factory shared by built-in and generated skills
- **Jinja2 dependency**: Added for skill template rendering
## [0.35.0] - 2026-03-24
### Added

View file

@ -247,6 +247,64 @@ Flags:
See [RLM Agent](agents/rlm.md) for details on capabilities and configuration.
## Create Skill
Generate a standalone skill package with an embedded database:
```bash
haiku-rag create-skill --name myskill --db /path/to/database.lancedb
```
The generated package is a pip-installable Python package that registers as a `haiku.skills` entry point.
### Options
| Flag | Description | Default |
|------|-------------|---------|
| `--name` | Skill name (lowercase Python identifier, required) | — |
| `--db` | Path to LanceDB database to embed (required) | — |
| `--description` | Skill description | Standard RAG description |
| `--tools` | Comma-separated tool names, or `all` | `all` |
| `--preamble` | Custom preamble for skill instructions | Standard RAG preamble |
| `--config-file` | Path to `haiku.rag.yaml` to embed | None |
| `--output` / `-o` | Output directory | Current directory |
### Available Tools
`analyze`, `ask`, `get_document`, `list_documents`, `research`, `search`
### Example
```bash
# Generate a skill with specific tools and custom preamble
haiku-rag create-skill \
--name medic \
--db /path/to/medic.lancedb \
--tools search,ask \
--config-file /path/to/haiku.rag.yaml \
--description "Military medic knowledge base" \
--preamble "You are a military medic expert."
# Install the generated package
uv pip install -e ./medic-skill
# Use with haiku-skills
haiku-skills chat --use-entrypoints --skill medic
```
### Generated Package Structure
```
{name}-skill/
├── pyproject.toml
└── {name}_skill/
├── __init__.py # create_skill() entry point
├── SKILL.md # Skill metadata and instructions
└── assets/
├── {name}.lancedb/ # Embedded database
└── haiku.rag.yaml # Optional config
```
## Server
Start services (requires at least one flag):

View file

@ -39,6 +39,32 @@ agent = Agent(
result = await agent.run("What documents do we have?")
```
## Generating Custom Skills
Use `create-skill` to generate a standalone skill package with an embedded database:
```bash
haiku-rag create-skill \
--name recipes \
--db /path/to/recipes.lancedb \
--tools search,ask \
--description "Recipe knowledge base" \
--preamble "You are a recipe expert."
```
This generates a pip-installable package (`recipes-skill/`) that bundles the database and registers as a `haiku.skills` entry point. After installing (`uv pip install -e ./recipes-skill`), the skill is automatically discovered:
```bash
haiku-skills list --use-entrypoints
# recipes — Recipe knowledge base
haiku-skills chat --use-entrypoints --skill recipes
```
Since each generated skill is self-contained with its own database and instructions, you can generate multiple skills for different domains and run them together. The agent sees each skill's description and routes questions to the appropriate knowledge base automatically.
See [CLI: Create Skill](../cli.md#create-skill) for all options.
## Database Path Resolution
Both skills resolve the database path in the same order: