feat: add native Agent Skills support to ds4-agent#380
Open
fry69 wants to merge 5 commits into
Open
Conversation
…d of rebuilding session /refresh no longer discards the conversation. It rescans skills in memory, compares the old and new catalog text, and if changed, appends the updated catalog as a new user message at the end of the transcript. The model sees the most recent catalog and uses it going forward. No full prefill is needed — only the new tokens are processed. Supporting changes: - worker struct: added catalog_text field for change detection - agent_skills_append_catalog: saves catalog_text after building - agent_skills_free: frees catalog_text alongside skills - help text updated to match new behavior
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.
Here is an implementation to teach
ds4-agentreading skills on startup.This PR soft depends on #379 to keep the current working directory available during startup.
Without keeping the working directory stable skill lookup will only find what is in the home directory, not in the project directory.
Automatically generated PR message follows:
Summary
Add native Agent Skills support to ds4-agent, following the open Agent Skills
specification (agentskills.io). 354 lines added, all in ds4_agent.c — no other
files touched.
Changes
New DSML tool:
activate_skillactivate_skill(name)to load a skill's SKILL.md.and returns the content wrapped in
<skill_content>tags with the skilldirectory path for relative-path resolution.
Skill discovery
<cwd>/.agents/skills/and~/.agents/skills/at session start.Skill catalog
<available_skills>XML catalog isappended as a separate user message. This keeps the system prompt static
and KV-cacheable while the catalog can change independently.
activate_skillwhen a task matches a skill's description.Slash commands
/skills— list discovered skills with names and descriptions./refresh— rescan skills directories, compare catalog text, and if changed,append the updated catalog at the end of the transcript. No full prefill is
needed — only the new tokens are processed. The model sees the most recent
catalog and uses it going forward.
Startup notification
Backward compatibility
No breaking changes. If no skills directories exist, the agent behaves exactly
as before — no catalog message is appended, and
/skillsreports zero skills.