Skip to content

Conversation

@fang-tech
Copy link
Contributor

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

  • 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

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

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
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 GitSkillRepository for seamless integration with version-controlled skill sets and a ClasspathSkillRepository for handling skills packaged within applications. A core part of this change is the extraction of file system-related skill operations into a dedicated SkillFileSystemHelper, which streamlines the implementation of various repository types and improves maintainability. These updates expand the flexibility and robustness of skill discovery and usage within the AgentScope ecosystem.

Highlights

  • Git Skill Repository: Introduced a new GitSkillRepository extension, enabling read-only skill loading directly from remote Git repositories (HTTPS/SSH) with automatic cloning and pulling. This allows for version-controlled skill sets.
  • Classpath Skill Repository: Added ClasspathSkillRepository to efficiently load skills from classpath resources, including those within JAR files. The older JarSkillRepositoryAdapter has been deprecated in favor of this new, more general implementation.
  • Centralized File System Logic: Extracted common file system operations for skill management into a new SkillFileSystemHelper utility. This promotes code reuse, simplifies repository implementations, and improves maintainability across different skill repository types.
  • Resource Management: The AgentSkillRepository interface now extends AutoCloseable, allowing repositories to manage and release resources effectively, particularly for temporary directories used by GitSkillRepository.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@codecov
Copy link

codecov bot commented Jan 31, 2026

Copy link
Contributor

Copilot AI left a 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 GitSkillRepository extension for loading skills from Git repositories (HTTPS/SSH) with automatic sync on each read
  • Creates SkillFileSystemHelper utility class to centralize file system operations shared between multiple repository implementations
  • Adds ClasspathSkillRepository as a proper repository implementation and deprecates JarSkillRepositoryAdapter
  • 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

Comment on lines +273 to +277
// Handle SSH format: git@host:owner/repo
if (normalized.contains("@") && normalized.contains(":")) {
int colonIndex = normalized.lastIndexOf(':');
return normalized.substring(colonIndex + 1);
}
Copy link

Copilot AI Jan 31, 2026

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.

Copilot uses AI. Check for mistakes.
- 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
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