agentleFS
MicrosoftKnown publishermicrosoft/AKS-Lab-GitHubCopilot/.github/skills/a2a-loopback-tests/SKILL.md

a2a-loopback-tests

Skill8 starsChanged 5 months agoMITView on GitHub

Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 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.

  • 4

    Very specific

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

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

    Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.

    line 3
  2. Very specific:

    Never: import GitHubCopilotAgent directly in a test — always patch its import site so the real SDK / Node CLI never runs.

    line 46
  3. Very specific:

    Never: start a real network server (no uvicorn.run).

    line 47
  4. Very specific:

    Do not patch MCPStreamableHTTPTool — it is not used in this repo.

    line 48

≈ “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: A2A Loopback Tests

Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.

The fixture

# tests/integration/conftest.py
import httpx
import pytest
from httpx import ASGITransport
from agent_framework.testing import MockChatClient

from src.agents.inventory.server import app as inventory_app
from src.agents.supplier.server import app as supplier_app
# ...orchestrator etc.


@pytest.fixture
async def fleet(monkeypatch):
    # 1. Patch GitHubCopilotAgent at every agent's import site so the
    #    real SDK / bundled Node CLI never starts.
    fake = MockChatClient()  # exposes async .run(message) -> AgentResponse[None]
    for mod in (
        "src.agents.inventory.agent",
        "src.agents.supplier.agent",
        "src.agents.logistics.agent",
        "src.agents.pricing.agent",
        "src.agents.orchestrator.agent",
    ):
        monkeypatch.setattr(f"{mod}.GitHubCopilotAgent", lambda **_: fake)

    # 2. Mount each FastAPI app behind ASGITransport.
    clients = {
        "inventory": httpx.AsyncClient(transport=ASGITransport(app=inventory_app),
                                       base_url="http://inventory"),
        # ... etc
    }
    yield clients
    for c in clients.values():
        await c.aclose()

Rules

  1. Never import GitHubCopilotAgent directly in a test — always patch its import site so the real SDK / Node CLI never runs.
  2. Never start a real network server (no uvicorn.run). ASGITransport only.
  3. Do not patch MCPStreamableHTTPTool — it is not used in this repo. MCP wiring lives inside GitHubCopilotOptions(mcp_servers={...}); the agent is already mocked at step 1, so MCP is short-circuited automatically.
  4. Assert structure (response.json()["tool_calls"]) and keyword presence ("store-101" in response.json()["output"]). No exact string equality.
  5. Mark every test pytest.mark.asyncio (or rely on asyncio_mode = "auto" in pyproject.toml).

Eval runner shape

# tests/evals/run_evals.py
async def run() -> int:
    failures = 0
    async with httpx.AsyncClient(base_url=os.environ.get("ZAVA_ENDPOINT", "http://localhost:8000")) as c:
        for line in scenarios_path.read_text().splitlines():
            sc = json.loads(line)
            r = (await c.post("/invoke", json={"run_id": sc["id"], "goal": sc["goal"]})).json()
            failures += not all(kw in r["output"] for kw in sc["must_mention"])
            failures += not set(sc["must_call"]).issubset(set(r["tool_calls"]))
    return failures

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.