-
Notifications
You must be signed in to change notification settings - Fork 95
feat: support SKILL.md file convention and name validation #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add support for AgentSkills standard fields (https://agentskills.io/specification): - description: Brief description of what the skill does - license: License under which the skill is distributed - compatibility: Environment requirements or compatibility notes - metadata: Arbitrary key-value metadata for extensibility - allowed_tools: List of pre-approved tools for the skill Also adds skills-ref as an optional dependency for future validation and prompt generation utilities. Closes #1474 Co-authored-by: openhands <openhands@all-hands.dev>
The skills-ref library will be added when validation and prompt generation utilities are implemented (issue #1478). Co-authored-by: openhands <openhands@all-hands.dev>
- Add find_skill_md() function to locate SKILL.md files (case-insensitive) - Add validate_skill_name() function for AgentSkills spec validation - Update load_skills_from_dir() to support skill-name/SKILL.md directories - Add directory_name and validate_name parameters to Skill.load() - Export new functions from __init__.py - Add 27 unit tests for new functionality Closes #1475 Co-authored-by: openhands <openhands@all-hands.dev>
Coverage Report •
|
||||||||||||||||||||
Reduce test code while maintaining essential coverage. Co-authored-by: openhands <openhands@all-hands.dev>
Resolved merge conflicts in: - openhands-sdk/openhands/sdk/context/skills/skill.py - tests/sdk/context/skill/test_agentskills_fields.py The resolution keeps both: 1. Pydantic field validators for allowed_tools and metadata from main 2. Skill name validation logic from this branch 3. SKILL.md convention support from this branch Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands think carefully about the |
|
I'm on it! neubig can track my progress at all-hands.dev |
Extract helper functions to simplify the load_skills_from_dir function: - _find_third_party_files: Find .cursorrules, AGENTS.md, etc. in repo root - _find_skill_md_directories: Find AgentSkills-style SKILL.md directories - _find_regular_md_files: Find regular .md files excluding SKILL.md dirs - _load_skill_safe: Load skills with consistent error handling This improves code readability and maintainability by following the single responsibility principle. Each helper function handles one specific aspect of skill discovery or loading. Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI've refactored the Changes MadeThe original function (~120 lines) was doing multiple things: file discovery, skill loading, and categorization. I extracted four focused helper functions:
ResultThe main
Verification
|
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
|
@OpenHands /codereview-roasted |
|
I'm on it! xingyaoww can track my progress at all-hands.dev |
Code Review Summary for PR #1480I provided a Linus Torvalds-style roasted code review for the 🔴 Taste Rating: Needs ImprovementCritical Issues (Must Fix)
Improvement Opportunities
Test Issues
Verdict❌ Needs rework - The refactoring extracted functions but didn't simplify the data flow. The redundant tuple field and wrapper function noise should be addressed before merging. Key InsightGood refactoring eliminates complexity; this one just moved it around and added a redundant tuple field. The data structure choice ( No code changes were made - this was a review-only request. |
Summary
This PR adds support for the SKILL.md file convention and skill name validation according to the AgentSkills standard.
Depends on PR #1479 (AgentSkills fields)
Changes
1. New
find_skill_md()FunctionLocates SKILL.md files in a directory (case-insensitive):
2. New
validate_skill_name()FunctionValidates skill names according to AgentSkills spec:
Validation rules:
3. Updated
Skill.load()Now accepts optional
directory_nameparameter for SKILL.md directory format:When
directory_nameis provided:name)SkillValidationErrorif name is invalid4. Updated
load_skills_from_dir()Now automatically discovers SKILL.md directories:
Backward Compatibility
.mdfiles continue to workdirectory_nameparameter is optionalTesting
Added 27 new tests covering:
find_skill_md()functionalityvalidate_skill_name()validation rulesSkill.load()with directory_name parameterload_skills_from_dir()with SKILL.md directoriesRelated Issues
Closes #1475
Part of #1473 (Support AgentSkills standard)
Diff from Previous PR
View changes from PR #1479
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:8aacbfc-pythonRun
All tags pushed for this build
About Multi-Architecture Support
8aacbfc-python) is a multi-arch manifest supporting both amd64 and arm648aacbfc-python-amd64) are also available if needed