feat(skills): persistent, self-authored skills (learn_skill) - #20
Merged
Conversation
Adds the substrate for a self-improving agent: it can turn a recurring task (or a corrected mistake) into a reusable, keyword-triggered skill that persists across sessions. - AgentSkillStore protocol + FileAgentSkillStore (one markdown file per skill: `# name` / `Triggers:` / instructions body; human-editable). - LearnSkillTool (`learn_skill`): saves a skill to the store AND registers it into the live SkillRegistry so it can fire later in the same session. - Agent.skillStore didSet: loads persisted skills into skillRegistry and auto-registers learn_skill (mirrors memoryStore -> RememberTool). Regression: store round-trip; learn_skill persists + activates on a matching query. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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
The substrate for a self-improving agent — it can turn a recurring task, or a corrected mistake, into a reusable skill that persists across sessions and activates by keyword.
Skills already existed (
AgentSkill+SkillRegistry, progressive-disclosure prompt injection) but were in-memory only. This adds persistence + a tool to author them.AgentSkillStoreprotocol +FileAgentSkillStore— one human-editable markdown file per skill (# name/Triggers: …/ instructions body).LearnSkillTool(learn_skill) — the agent calls it to save a skill; it persists to the store and registers into the liveSkillRegistry, so the skill can fire later in the same session.Agent.skillStore(didSet) — loads previously authored skills intoskillRegistryand auto-registerslearn_skill. Mirrors thememoryStore → RememberToolpattern.Learning from mistakes composes with existing memory: short lessons go to
remember(kindagent, always injected); larger repeatable procedures becomelearn_skillskills (keyword-triggered).Tests
testFileSkillStoreRoundTrips— save → loadAll preserves name/triggers/instructions; matches a query.testLearnSkillToolPersistsAndActivates—learn_skillpersists to the store and the skill fires on a matching query.🤖 Generated with Claude Code