Conversation
Add .agents/skills to project skill discovery with priority. Co-authored-by: openhands <[email protected]>
all-hands-bot
left a comment
There was a problem hiding this comment.
Review Summary
The change is well-structured and maintains backward compatibility. However, there are a few areas that could be improved:
- Testing coverage: No tests added to verify the new directory priority logic
- Documentation scope: May need updates beyond the docstring
- Implementation clarity: The precedence mechanism could be more explicit
Overall: ✅ Good change, but needs test coverage before merging.
Document .agents/skills priority and add precedence tests. Co-authored-by: openhands <[email protected]>
all-hands-bot
left a comment
There was a problem hiding this comment.
Review Summary
This PR cleanly implements support for .agents/skills directory with proper priority ordering. The implementation is solid and well-tested. I have a few suggestions for enhancement:
🟡 Suggestions
- Add debug logging - Consider logging which directory skills are loaded from to help with troubleshooting
- Migration nudge - Add an info log when both
.agents/skillsand.openhands/skillsexist to encourage migration to the new standard - Test coverage - Add a test for loading different (non-duplicate) skills from multiple directories
✅ Positive Feedback
- Excellent documentation with clear precedence examples
- Clean, minimal implementation
- Comprehensive duplicate-handling tests
- Proper priority ordering in the code
Overall, this is a well-executed feature addition. The suggestions above are optional enhancements that could improve user experience.
| # Load project-specific skills from .agents/skills, .openhands/skills, | ||
| # and legacy microagents (priority order; first wins for duplicates) | ||
| project_skills_dirs = [ | ||
| work_dir / ".agents" / "skills", |
There was a problem hiding this comment.
🟡 Suggestion: Consider adding debug logging to help users understand which directory skills are being loaded from. This would make troubleshooting easier.
Example: Add a comment or logging in the loop that loads from these directories.
| project_skills_dirs = [ | ||
| work_dir / ".agents" / "skills", | ||
| work_dir / ".openhands" / "skills", | ||
| work_dir / ".openhands" / "microagents", # Legacy support |
There was a problem hiding this comment.
🟡 Suggestion: Consider adding an info/warning log when both .agents/skills and .openhands/skills directories exist, to encourage users to migrate to the new standard location. This would help with the transition mentioned in the X post.
Example:
agents_skills_dir = work_dir / ".agents" / "skills"
openhands_skills_dir = work_dir / ".openhands" / "skills"
if agents_skills_dir.exists() and openhands_skills_dir.exists():
logger.info("Both .agents/skills and .openhands/skills found. Consider migrating to .agents/skills as the standard location.")| assert len(skills) == 1 | ||
| assert skills[0].name == "duplicate" | ||
| assert skills[0].content == "From .agents/skills." | ||
|
|
There was a problem hiding this comment.
🟡 Suggestion: Consider adding a test that verifies loading different (non-duplicate) skills from multiple directories works correctly. The current tests cover duplicates well, but not the merge behavior when skills have different names.
Example test case:
def test_load_project_skills_merges_from_multiple_dirs(tmp_path):
"""Test skills from different directories are merged correctly."""
agents_dir = tmp_path / ".agents" / "skills"
skills_dir = tmp_path / ".openhands" / "skills"
agents_dir.mkdir(parents=True)
skills_dir.mkdir(parents=True)
(agents_dir / "skill1.md").write_text("---\nname: skill1\n---\nContent 1.")
(skills_dir / "skill2.md").write_text("---\nname: skill2\n---\nContent 2.")
skills = load_project_skills(tmp_path)
assert len(skills) == 2
skill_names = {s.name for s in skills}
assert skill_names == {"skill1", "skill2"}| Use .agents/skills for new skills. .openhands/skills is the legacy | ||
| OpenHands location, and .openhands/microagents is deprecated. | ||
|
|
||
| Example: If "my-skill" exists in both .agents/skills/ and |
There was a problem hiding this comment.
🟢 Nit: Excellent documentation! The example clearly illustrates the precedence behavior. This will help users understand the priority system.
Summary
Testing
Context
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.13-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:305f559-pythonRun
All tags pushed for this build
About Multi-Architecture Support
305f559-python) is a multi-arch manifest supporting both amd64 and arm64305f559-python-amd64) are also available if needed