类 Skills

java.lang.Object
com.agentsflex.skill.util.Skills

public class Skills extends Object
作者:
Christian Tzolov, Micahel Yang
  • 构造器详细资料

  • 方法详细资料

    • loadDirectories

      public static List<Skill> loadDirectories(List<String> rootDirectories)
    • loadDirectory

      public static List<Skill> loadDirectory(String rootDirectory)
      Recursively finds all SKILL.md files in the given root directory and returns their parsed contents.
      参数:
      rootDirectory - the root directory to search for SKILL.md files
      返回:
      a list of Skill objects containing the basePath, front-matter, and content of each SKILL.md file
      抛出:
      RuntimeException - if an I/O error occurs while reading the directory or files
    • scanClasspathJarsForSkills

      private static List<Skill> scanClasspathJarsForSkills(String classpathPrefix) throws IOException
      Scans all classpath JARs for SKILL.md files under the given prefix. Discovers JARs via ClassLoader.getResources("META-INF/MANIFEST.MF") — a technique used by Spring internally when standard classpath resolution is insufficient.
      抛出:
      IOException
    • scanJarForSkills

      private static List<Skill> scanJarForSkills(JarFile jarFile, String entryPrefix) throws IOException
      Scans a single JAR file for SKILL.md entries under the given prefix.
      参数:
      jarFile - the JAR to scan
      entryPrefix - the entry prefix to match (must end with '/')
      返回:
      a list of Skill objects found in this JAR
      抛出:
      IOException
    • parseSkill

      private static Skill parseSkill(InputStream is, String entryPath) throws IOException
      Parses a SKILL.md file from an input stream into a Skill.
      参数:
      is - the input stream containing the SKILL.md markdown content
      entryPath - the JAR entry path — used to derive the base directory
      抛出:
      IOException
    • deriveBasePathFromUrl

      private static String deriveBasePathFromUrl(URL skillUrl)
      Derives the JAR-internal base path from a resource URL by stripping the SKILL.md filename and the jar:file:...!/ prefix.