feat(agents): add skills system for dynamic knowledge loading#4155
Open
feat(agents): add skills system for dynamic knowledge loading#4155
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4155 +/- ##
==========================================
+ Coverage 68.08% 68.28% +0.19%
==========================================
Files 130 134 +4
Lines 16211 16543 +332
Branches 3907 4019 +112
==========================================
+ Hits 11037 11296 +259
- Misses 5170 5243 +73
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a skills registry that scans markdown files at startup and provides use_skill/remove_skill tools to Horton for on-demand knowledge injection. Includes an interactive tutorial skill for the perspectives analyzer pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cb0de9f to
f7144b3
Compare
The tutorial skill was over-trimmed and lost important introductory content about Electric Agents concepts (entities, handlers, wakes, agent loop, spawning, workers, state). Restore these so new users get proper context before building their first entity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The agents package has internal skills (not intent skills), so intent validate fails with "No SKILL.md files found". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a skills system to the
@electric-ax/agentspackage so Horton can load specialized knowledge, instructions, and tutorials on demand viause_skill/remove_skilltools. Includes a built-in interactive tutorial that walks users through building a perspectives analyzer with the manager-worker pattern.Ported from
electric-sql/durable-streamsfeat/entity-skills-registrybranch with full rebrand from Darix → Electric Agents naming.Reviewer Guidance
Approach
The skills system has five layers:
src/skills/preamble.ts) — extracts YAML frontmatter from.mdskill files (description, keywords, arguments, etc.)src/skills/extract-meta.ts) — tries preamble first, falls back to Claude Haiku for incomplete metadatasrc/skills/registry.ts) — scans two directories (built-in + app-provided), caches by content hash, renders catalog with progressive truncation (full → compact → names-only) to fit context budgetssrc/skills/tools.ts) —use_skillinjects content into agent context with argument substitution and auto-loads.mdreference files;remove_skillcleans upKey Invariants
createBuiltinAgentHandleris now async (was sync) — callers mustawaititNon-goals
.mdfiles on diskTrade-offs
Verification
New test files cover: preamble parsing (8 tests), registry scanning/caching/rendering (11 tests), tool execution/argument substitution (9 tests), end-to-end lifecycle (1 test).
Also includes
docker-compose.full.ymlfix:postgres:18-alpine→postgres:17-alpine(PG 18 broke volume mount path convention).Files Changed
packages/agents/src/skills/types.tsSkillMetaandSkillsRegistryinterfacespackages/agents/src/skills/preamble.tspackages/agents/src/skills/extract-meta.tspackages/agents/src/skills/registry.tspackages/agents/src/skills/tools.tsuse_skill/remove_skillagent toolspackages/agents/skills/tutorial.mdpackages/agents/skills/tutorial/scaffold/packages/agents/src/agents/horton.tspackages/agents/src/bootstrap.tspackages/agents/src/server.tsawaitasync bootstrap +Awaited<>type fixpackages/agents/test/skills-*.test.tspackages/electric-ax/docker-compose.full.yml🤖 Generated with Claude Code