Skip to content

render_fallback_skill

autogen.beta.network.client.skill_render.render_fallback_skill #

render_fallback_skill(passport, resume)

Build a SKILL.md-style document from passport + resume.

Used by peers(action="describe") when an agent has no registered SKILL.md. The output mirrors the frontmatter shape Anthropic skills use so the calling LLM gets the same structure either way.

Source code in autogen/beta/network/client/skill_render.py
def render_fallback_skill(passport: Passport, resume: Resume) -> str:
    """Build a SKILL.md-style document from passport + resume.

    Used by ``peers(action="describe")`` when an agent has no
    registered ``SKILL.md``. The output mirrors the frontmatter shape
    Anthropic skills use so the calling LLM gets the same structure
    either way.
    """
    description = resume.summary or "Network-registered agent."
    lines: list[str] = [
        "---",
        f"name: {passport.name}",
        f"description: {description}",
        "---",
        "",
    ]
    if resume.claimed_capabilities:
        lines.append("## Capabilities")
        lines.extend(f"- {cap}" for cap in resume.claimed_capabilities)
        lines.append("")
    if resume.domains:
        lines.append("## Domains")
        lines.extend(f"- {d}" for d in resume.domains)
        lines.append("")
    if resume.observed:
        lines.append("## Track record")
        for cap in sorted(resume.observed.keys()):
            stat = resume.observed[cap]
            lines.append(
                f"- {cap}: {stat.completed} completed / {stat.failed} failed / {stat.expired} expired (n={stat.n})"
            )
        lines.append("")
    if resume.examples:
        lines.append("## Examples")
        for ex in resume.examples:
            lines.append(f"- {ex.title}{ex.outcome or 'no outcome'}")
        lines.append("")
    # Trim the trailing blank line for cleanliness.
    while lines and lines[-1] == "":
        lines.pop()
    return "\n".join(lines) + "\n"