-
Notifications
You must be signed in to change notification settings - Fork 259
feat(skill): add git skill repository extension #690
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?
feat(skill): add git skill repository extension #690
Conversation
add SkillFileSystemHelper and migrate filesystem behaviors/tests refactor GitSkillRepository to use helper and support custom source introduce ClasspathSkillRepository; deprecate Jar adapters update docs for classpath/git repositories and source behavior
Summary of ChangesHello @fang-tech, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to how AgentScope-Java manages and loads skills. It provides a new Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and well-executed refactoring of the skill repository functionality. The introduction of SkillFileSystemHelper centralizes file system logic, improving code reuse and maintainability. The new ClasspathSkillRepository and GitSkillRepository are valuable additions, and the deprecation of JarSkillRepositoryAdapter is handled correctly. My review focuses on a couple of areas for improvement in the new GitSkillRepository and its tests.
...ill-git-repository/src/main/java/io/agentscope/core/skill/repository/GitSkillRepository.java
Show resolved
Hide resolved
...git-repository/src/test/java/io/agentscope/core/skill/repository/GitSkillRepositoryTest.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new Git-based skill repository extension and refactors existing file system skill repository code to improve maintainability and introduce better separation of concerns.
Changes:
- Introduces
GitSkillRepositoryextension for loading skills from Git repositories (HTTPS/SSH) with automatic sync on each read - Creates
SkillFileSystemHelperutility class to centralize file system operations shared between multiple repository implementations - Adds
ClasspathSkillRepositoryas a proper repository implementation and deprecatesJarSkillRepositoryAdapter - Updates documentation in English and Chinese to reflect new repository types and usage patterns
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
agentscope-extensions/agentscope-extensions-skill-git-repository/src/main/java/io/agentscope/core/skill/repository/GitSkillRepository.java |
New implementation for Git-based read-only skill repository with JGit integration |
agentscope-extensions/agentscope-extensions-skill-git-repository/src/test/java/io/agentscope/core/skill/repository/GitSkillRepositoryTest.java |
Comprehensive unit tests for GitSkillRepository using local file:// protocol |
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillFileSystemHelper.java |
New utility class extracting common file system operations from repositories |
agentscope-core/src/test/java/io/agentscope/core/skill/util/SkillFileSystemHelperTest.java |
Unit tests for SkillFileSystemHelper utility |
agentscope-core/src/main/java/io/agentscope/core/skill/repository/FileSystemSkillRepository.java |
Refactored to delegate file operations to SkillFileSystemHelper, adds custom source support |
agentscope-core/src/main/java/io/agentscope/core/skill/repository/ClasspathSkillRepository.java |
New repository implementation for classpath resources, replaces adapter pattern |
agentscope-core/src/test/java/io/agentscope/core/skill/repository/ClasspathSkillRepositoryTest.java |
Renamed and updated tests (previously JarSkillRepositoryAdapterTest) |
agentscope-core/src/main/java/io/agentscope/core/skill/util/JarSkillRepositoryAdapter.java |
Deprecated, now extends ClasspathSkillRepository for backward compatibility |
agentscope-core/src/main/java/io/agentscope/core/skill/repository/AgentSkillRepository.java |
Updated to extend AutoCloseable interface |
agentscope-core/src/test/java/io/agentscope/core/skill/repository/FileSystemSkillRepositoryTest.java |
Simplified tests, detailed tests moved to SkillFileSystemHelperTest |
docs/en/task/agent-skill.md |
Updated documentation for Git and Classpath repositories |
docs/zh/task/agent-skill.md |
Updated Chinese documentation for Git and Classpath repositories |
agentscope-extensions/pom.xml |
Added new skill-git-repository module |
agentscope-extensions/agentscope-extensions-skill-git-repository/pom.xml |
New POM for Git repository extension |
agentscope-distribution/agentscope-bom/pom.xml |
Added Git skill repository extension to BOM |
agentscope-distribution/agentscope-all/pom.xml |
Added Git skill repository extension to all distribution |
agentscope-dependencies-bom/pom.xml |
Added JGit 6.10.0 dependency |
...ill-git-repository/src/main/java/io/agentscope/core/skill/repository/GitSkillRepository.java
Show resolved
Hide resolved
...git-repository/src/test/java/io/agentscope/core/skill/repository/GitSkillRepositoryTest.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillFileSystemHelper.java
Outdated
Show resolved
Hide resolved
...ill-git-repository/src/main/java/io/agentscope/core/skill/repository/GitSkillRepository.java
Show resolved
Hide resolved
| // Handle SSH format: git@host:owner/repo | ||
| if (normalized.contains("@") && normalized.contains(":")) { | ||
| int colonIndex = normalized.lastIndexOf(':'); | ||
| return normalized.substring(colonIndex + 1); | ||
| } |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extractRepositoryIdentifier method may fail or produce unexpected results for SSH URLs that contain @ in the username or host portion (e.g., git@host.com:port/repo). The logic at line 274 checks for both @ and : but doesn't account for SSH URLs with port numbers (e.g., ssh://git@host:22/repo). Consider using a more robust URL parsing approach or adding validation for edge cases.
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillFileSystemHelper.java
Outdated
Show resolved
Hide resolved
...ill-git-repository/src/main/java/io/agentscope/core/skill/repository/GitSkillRepository.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/repository/ClasspathSkillRepository.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/repository/ClasspathSkillRepository.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/repository/ClasspathSkillRepository.java
Show resolved
Hide resolved
- add GitSkillRepository close() for manual temp cleanup and hook removal - normalize filesystem path validation in SkillFileSystemHelper - return shutdown hook for optional removal - update docs/tests/comments and add overridesapply copilot suggesions
AgentScope-Java Version
[The version of AgentScope-Java you are working on, e.g. 1.0.8, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]Description
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)