Skip to content

Feat/skills#52

Open
sjy3 wants to merge 2 commits intomainfrom
feat/skills
Open

Feat/skills#52
sjy3 wants to merge 2 commits intomainfrom
feat/skills

Conversation

@sjy3
Copy link
Collaborator

@sjy3 sjy3 commented Mar 13, 2026

Description of Change

Problem:
The agent currently lacks a standardized, modular way to extend its capabilities using file-based "skills" (collections of instructions, resources, and executable scripts). There is also no built-in mechanism to execute local scripts provided by these skills, which limits the agent's ability to perform specialized tasks defined in external skill repositories.

Solution:
I have implemented an experimental "Skill" feature . The changes include:

  1. Core Model (skills package): Defined the data structures for Skill, Frontmatter, Resources, and Script to parse and validate skill directories.
  2. Skill Toolset (tool/skilltool): Implemented SkillToolset which exposes the following tools to the agent:
    • list_skills: Discover available skills.
    • load_skill: Read skill instructions (SKILL.md).
    • load_skill_resource: Access auxiliary files (references, assets).
    • run_skill_script: Execute scripts contained within a skill.
  3. Code Executor (code_executors): Added UnsafeLocalCodeExecutor to support running Python and Bash scripts locally via os/exec.
  4. Example (examples/skill): Added a main.go example demonstrating how to initialize an agent with the SkillToolset and load skills from a directory.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
  • tool/skilltool: Added skill_toolset_test.go which tests all tool handlers (list_skills, load_skill, etc.) using mock skills.
  • code_executors: Added unsafe_local_code_executor_test.go which verifies script execution (Python/Bash), argument passing, and timeout handling.

Manual End-to-End (E2E) Tests:

  1. Navigate to the example directory: cd examples/skill.
  2. Ensure you have a valid GOOGLE_API_KEY environment variable set.
  3. Prepare a sample skill directory (or use a mock one).
  4. Run the example agent:
    go run main.go
  5. Interact with the agent and ask it to perform a task that requires a skill (e.g., "use the multiplication skill to calculate 5 * 5").
  6. Verify that the agent correctly calls load_skill and run_skill_script, and returns the correct result.

Additional context

Add any other context or screenshots about the feature request here.

This feature is currently experimental. The UnsafeLocalCodeExecutor executes code directly on the host machine and should be used with caution. Future improvements may include sandboxed execution environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant