Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

Add skill loading support to generic agent - #279

Merged
pdettori merged 3 commits into
rossoctl:mainfrom
eranra:feature/add-skill-loading-support
May 6, 2026
Merged

pdettori merged 3 commits into
rossoctl:mainfrom
eranra:feature/add-skill-loading-support

Conversation

@eranra

@eranra eranra commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Closes #278

Summary

This PR implements comprehensive skill loading functionality for the generic agent, enabling it to dynamically load and utilize custom skills from configurable folder paths.

Changes

Core Features

  • Skill Loading System: Added load_skills_content() function to read skill files (SKILL.md, *.py, *.md) from configured directories
  • Configuration: New SKILL_FOLDERS environment variable for specifying skill folder paths (default: /app/skills/)
  • Enhanced System Prompt: Skills are automatically integrated into the agent's system prompt with their descriptions and capabilities
  • Agent Card Updates: Available skills are now displayed alongside MCP servers in the agent card

Error Handling & Resilience

  • Graceful degradation when MCP servers are unavailable (warning instead of failure)
  • Robust error handling for missing or invalid skill folders
  • Continues operation with partial skill loading if some skills fail
  • Comprehensive logging throughout the skill loading process

Testing Infrastructure

  • Complete test suite in a2a/generic_agent/tests/
  • test_skill_loading.py: Full integration tests with mock skills
  • test_skill_loading_simple.py: Basic functionality tests
  • run_skill_test.sh: Convenient test execution script
  • tests/README.md: Comprehensive testing documentation

Documentation

  • Updated main README.md with skill loading information
  • Added testing section with quick start guide
  • Documented SKILL_FOLDERS environment variable
  • Included example skill structure

Code Quality

  • Fixed trailing whitespace and newline issues across multiple files
  • Added proper logging with appropriate log levels
  • Improved error messages for better debugging experience

Testing

The changes have been tested with:

  1. Mock skill loading scenarios
  2. Error handling for missing/invalid skill folders
  3. Integration with existing MCP tool functionality
  4. Agent card generation with skills

To run tests:

cd a2a/generic_agent/tests
./run_skill_test.sh

Design Decisions

  1. Skill Folder Structure: Each skill is a directory containing SKILL.md (main description), Python scripts (tools), and additional markdown files (documentation)
  2. Error Handling: Non-blocking failures allow the agent to continue operating even if some skills fail to load
  3. System Prompt Integration: Skills are appended to the system prompt to make them available to the LLM
  4. Configuration: Environment variable approach allows easy customization without code changes

Breaking Changes

None. This is a backward-compatible addition that doesn't affect existing functionality.

Signed-off-by: Eran Raichstein [email protected]

This commit introduces comprehensive skill loading functionality to the generic agent:

Core Features:
- Added SKILL_FOLDERS configuration to load custom skills from specified directories
- Implemented load_skills_content() function to read skill files (SKILL.md, *.py, *.md)
- Enhanced system prompt to include loaded skill descriptions and capabilities
- Updated agent card to display available skills alongside MCP servers

Error Handling:
- Graceful degradation when MCP servers are unavailable
- Warning messages instead of failures for missing skill folders
- Continues operation with partial skill loading if some skills fail

Testing:
- Added comprehensive test suite in tests/ directory
- Includes test_skill_loading.py for full integration tests
- Includes test_skill_loading_simple.py for basic functionality tests
- Added run_skill_test.sh script for easy test execution
- Created tests/README.md with testing documentation

Documentation:
- Updated README.md with skill loading information
- Added testing section with quick start guide
- Documented SKILL_FOLDERS environment variable

Code Quality:
- Fixed trailing whitespace and newline issues in multiple files
- Added proper logging throughout skill loading process
- Improved error messages for better debugging

Signed-off-by: Eran Raichstein <[email protected]>
@eranra
eranra force-pushed the feature/add-skill-loading-support branch from ef6dd6a to b54ca35 Compare April 29, 2026 15:28

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

The core concept of skill loading (reading files from configurable folders into the LLM system prompt) is reasonable and the code structure is clean. However, there are two must-fix issues: a dead try/except in get_mcpclient() and a broken relative import in the summarizer scripts.

Areas reviewed: Python, Shell, Dockerfile, Docs
Commits: 1 commit, signed-off: yes
CI status: passing (DCO)

Comment thread skills/summarizer/scripts/summarizer.py Resolved
- Remove @lru_cache from get_mcpclient() to allow retry on transient failures
- Add 100KB content size limit to prevent ConfigMap and context window issues
- Add size tracking and warnings when limits are exceeded
- Simplify MCP client configuration (remove unnecessary try-catch)
- Fix test script to use correct test file (manual_test_skill_loading.py)
- Improve shell script error handling with set -euo pipefail
- Fix relative import in summarizer skill

These changes address PR review feedback and improve the reliability
of skill loading in production environments.

Signed-off-by: Eran Raichstein <[email protected]>
@eranra

eranra commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

@pdettori thanks for the quick review and comments. I fixed and pushed an updated version of the PR for you review ^^^^

@eranra
eranra requested a review from pdettori April 30, 2026 11:34
@eranra

eranra commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

FYI: @pavelanni

Signed-off-by: Eran Raichstein <[email protected]>
@eranra

eranra commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@pdettori can you review

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All review comments from the initial review have been addressed in efd25f8:

  • Dead try/except removed
  • 100KB size limit added to skill loading with warning logs
  • Broken absolute import fixed (now relative)
  • Manual test properly named (manual_test_skill_loading.py)
  • Shell script uses set -euo pipefail
  • @lru_cache removed to allow retry on transient failures

CI is green. LGTM.

@pdettori
pdettori merged commit bdbdfd1 into rossoctl:main May 6, 2026
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add skill loading support to generic agent

2 participants