Class SkillPromptBuilder

java.lang.Object
io.agentscope.harness.agent.skill.runtime.SkillPromptBuilder

public final class SkillPromptBuilder extends Object
Renders the harness <available_skills> system-prompt block from a SkillCatalog.

Differences from the legacy AgentSkillPromptProvider:

  • Each <skill> optionally carries a <files-root> child giving the absolute path to that skill's files. The middleware decides whether to populate this based on shell availability and skill source.
  • The <code_execution> section is emitted only when at least one entry in the catalog has a non-null filesRoot (i.e. shell is available and at least one skill's files are reachable). The new instruction tells the LLM to use each skill's <files-root> rather than a single hardcoded root.
  • Resource fallback for non-SKILL.md paths is implemented by SkillLoadTool; the prompt does not need to mention it.
  • Field Details

  • Constructor Details

    • SkillPromptBuilder

      public SkillPromptBuilder()
    • SkillPromptBuilder

      public SkillPromptBuilder(String header, String codeExecutionInstruction, boolean exposeAllMetadata)
  • Method Details

    • render

      public String render(SkillCatalog catalog, io.agentscope.core.skill.SkillFilter filter)
      Render the prompt block. Returns an empty string when no skills pass the filter, so the caller can no-op concatenation.
      Parameters:
      catalog - the per-call snapshot (non-null)
      filter - visibility filter applied per skillId (non-null; use SkillFilter.all())
      Returns:
      prompt text, or empty string when nothing is visible
    • render

      public String render(SkillCatalog catalog)
      Convenience overload used by the middleware when no extra filter is active.