agentleFS
MicrosoftKnown publishermicrosoft/AKS-Lab-GitHubCopilot/.github/skills/maf-agent-skeleton/SKILL.md

maf-agent-skeleton

Skill8 starsChanged 5 months agoMITView on GitHub

Use this skill when generating any specialist agent under src/agents/<name>/. No business logic in server.py. Ever.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when generating any specialist agent under src/agents/<name>/.

    line 3
  2. Very specific:

    No business logic in server.py.

    line 110
  3. Very specific:

    If a tool *is* defined locally (orchestrator's ask_* delegators), use @tool from agent_framework.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: MAF Agent Skeleton

Use this skill when generating any specialist agent under src/agents/<name>/.

Reference layout

src/agents/<name>/
├── __init__.py
├── prompts.py
├── tools.py
├── agent.py
├── server.py
├── Dockerfile
└── tests/__init__.py

agent.py template (specialist with MCP)

from __future__ import annotations

from dataclasses import dataclass

from agent_framework import AgentResponse
from agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions
from copilot.generated.rpc import PermissionDecisionApproveOnce
from copilot.session import PermissionRequestResult

from src.shared.copilot import build_copilot_client
from src.shared.settings import Settings
from .prompts import SYSTEM_PROMPT
from .tools import TOOLS  # usually empty: list[FunctionTool] = []


def _approve_all(_req: object, _ctx: dict[str, str]) -> PermissionRequestResult:
    return PermissionDecisionApproveOnce()


@dataclass(frozen=True)
class _RunnableAgent:
    """Adapter satisfying the shared `make_app` `_Runnable` protocol."""
    agent: GitHubCopilotAgent

    async def run(self, message: str, /) -> AgentResponse[None]:
        return await self.agent.run(message)


async def build_agent(settings: Settings) -> _RunnableAgent:
    agent = GitHubCopilotAgent(
        instructions=SYSTEM_PROMPT,
        client=build_copilot_client(),
        name="<name>",
        description="ZavaShop <name> specialist (...).",
        tools=list(TOOLS),
        default_options=GitHubCopilotOptions(
            model=settings.copilot_model,
            timeout=settings.copilot_timeout_seconds,
            on_permission_request=_approve_all,
            mcp_servers={
                "<key>": {
                    "type": "http",
                    "url": settings.<which>_mcp_url,
                    "tools": ["*"],
                    "timeout": int(settings.copilot_timeout_seconds * 1000),
                },
            },
        ),
    )
    return _RunnableAgent(agent=agent)

Rules:

  • One build_agent per agent. Async. Returns the _RunnableAgent adapter — make_app only needs .run(message).
  • Settings is the only configuration source. No env reads inside agent.py.
  • GitHubCopilotAgent + GitHubCopilotOptions is the only allowed chat surface. No GitHubCopilotChatClient, no ChatAgent(client=...), no MCPStreamableHTTPTool — those do not exist in agent-framework 1.3.x.
  • client=build_copilot_client() is mandatory so GITHUB_TOKEN is honored in local, AKS, and ACA runtimes.
  • on_permission_request=_approve_all returning PermissionDecisionApproveOnce() is mandatory; without it every tool call silently denies and the LLM hallucinates "all specialists rejected".
  • mcp_servers[*].timeout is milliseconds; use int(settings.copilot_timeout_seconds * 1000).
  • For the orchestrator (no MCP), drop mcp_servers and put four @tool-decorated async def ask_<peer>(goal: str) functions in agent.py itself, each calling A2AClient.invoke(...). Tool signatures must be flat scalars, never Pydantic models (the SDK passes a raw dict).

prompts.py template

SYSTEM_PROMPT = """\
You are <Name>Agent for ZavaShop. Role: <one sentence>.

Decision rules:
1. ...
2. ...

Refusal rules:
- Refuse <out-of-scope topic>; redirect to the right agent.
- Never invent SKUs, prices, or supplier names.

Output: a JSON object with keys {...}.
"""

server.py template

from src.shared.server import make_app
from .agent import build_agent

app = make_app(name="<name>", build=build_agent)

No business logic in server.py. Ever.

tools.py rules

  • Specialist agents normally export TOOLS: list[FunctionTool] = [] — external I/O lives in their MCP server, not in tools.py.
  • If a tool is defined locally (orchestrator's ask_* delegators), use @tool from agent_framework. Signature must be flat scalars (goal: str), not a Pydantic input — the Copilot SDK does not marshal dicts into models.
  • Docstring must include a one-line summary, Args:, Returns:.
  • Export the TOOLS list at the bottom — agent.py consumes it.

Acceptance

uv run ruff check src/agents/<name>
uv run pyright src/agents/<name>
uv run python -c "from src.agents.<name>.agent import build_agent; print(build_agent)"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.