Skip to main content
agentscope-extensions-skill-git-repository treats a remote Git repo as a skill repository. It runs a lightweight remote-ref check on each read and only pulls when the remote HEAD changes — near-zero overhead at idle.

When to use

  • You want Git to manage versioning and review of skill content.
  • You want to share a single skill set across multiple projects.
  • You don’t want to embed a database or config center in production.

Add the dependency

It uses JGit under the hood and supports both HTTPS and SSH.

Quickstart

Pin branch / use a fixed local path

Auth for private repos

GitSkillRepository reuses system-level Git config; it doesn’t manage credentials in Java:
  • HTTPS: uses the credential helper from ~/.gitconfig (osxkeychain, libsecret, …).
  • SSH: uses keys under ~/.ssh/ and ssh-agent.
In CI, make sure the runner user has the credentials or has the SSH agent configured.

Auto-sync vs. manual sync

  • autoSync=true (default): every read first runs ls-remote; pull happens only if the remote moved.
  • autoSync=false: never pulls automatically; call repo.sync() to refresh.

Operational notes

  • Hold the repo as a singleton Spring Bean; close it once during shutdown.
  • The temp directory has a JVM shutdown hook, but force-killed processes may leave residue — clean up externally if needed.
  • Multi-instance deployments each maintain their own clone; no lock contention.