[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EXJ55AY7YWW386BJMFQ235":3,"skill-same:01M7EXJ55AY7YWW386BJMFQ235":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7EXJ55AY7YWW386BJMFQ235","building-agents",null,"Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI\u002FAnthropic\u002FGemini\u002FOSS so a model swap is a config change. NOT vector-store SQL alone (that is `postgresdb`) or service deployment (that is `deployment`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: building-agents\ndescription: \"Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI\u002FAnthropic\u002FGemini\u002FOSS so a model swap is a config change. NOT vector-store SQL alone (that is `postgresdb`) or service deployment (that is `deployment`).\"\ntags: [agents, llm, mcp, rag, evals, ai]\nrecommends: [secure-coding, deployment]\norigin: risco\n---\n\n# Building production LLM agents (model-agnostic)\n\nA thin provider adapter, a disciplined agent loop, schema-validated tools, provider-neutral RAG, eval gates, OTel tracing, and optionally an MCP server — so swapping OpenAI ↔ Anthropic ↔ Gemini ↔ OSS is a config change, not a rewrite.\n\n## The one rule\n\n> Program against a **capability interface**, never a vendor SDK. Vendor specifics (model id, tool-schema shape, JSON mode, caching, token limits) live behind one adapter resolved from config. Model names and prices rot — if one appears in business logic it's a bug, and re-verify the dated tables before quoting a number.\n\n**Hand off instead when:** a new non-trivial feature has no approved spec + plan under `02-DOCS\u002Fwiki\u002Fsdd\u002F` → stop and run [`specify`](..\u002Fspecify\u002FSKILL.md) first (method: [`sdd`](..\u002Fsdd\u002FSKILL.md)), which routes back here once the plan is approved; one-line\u002Flow-risk changes go straight through. Anthropic-SDK internals (caching, thinking, batch) in a file that *only* imports `anthropic` → `claude-api` if your environment has it, since this skill stays multi-provider. Workspace scaffolding → [`harness`](..\u002Fharness\u002FSKILL.md). Choosing *which* coding agent to use → agent-eval territory. Pure prompt-wording tuning with no architecture change → prompt engineering, not this. A one-shot throwaway prompt, or no retrieval\u002Ftools\u002Floop\u002Fevals at all → you don't need an agent; call the SDK directly and say so.\n\n## Decision rules (read before writing code)\n\n1. **Adapter first** — define the `LLMProvider` Protocol before any provider call.\n2. **Smallest loop that works** — single-agent before multi-agent; ReAct only when the path is uncertain; plan-execute when steps are knowable. Multi-agent means orchestrator-worker with a semaphore-bounded parallel fan-out, never a free-for-all.\n3. **Tools are typed contracts** — schema + validation + idempotency key on every side-effecting tool; no catch-all tools.\n4. **Retrieve, don't stuff** — RAG when ground truth lives in data; cite or refuse.\n5. **Eval before ship** — a golden set + regression gate in CI, or it's not production.\n6. **Cheapest model that passes the eval** — route\u002Fcascade up, never default to flagship.\n\n## The provider adapter (the heart of the skill)\n\nThe one payload to internalize. Python 3.12+, Pydantic v2, **async** so it composes directly with the bounded loop (and orchestrator-worker fan-out) in [`references\u002Fagent-loops-and-harness.md`](references\u002Fagent-loops-and-harness.md). Structured output is the quirk that differs most per vendor: strict JSON Schema (OpenAI), tool-forcing (Anthropic), `response_json_schema` (Gemini). Streaming, the Gemini and OSS\u002Flitellm adapters, tool-result plumbing, and a `route()` registry live in [`references\u002Fprovider-abstraction.md`](references\u002Fprovider-abstraction.md) — this excerpt is the load-bearing core, not the whole interface.\n\n```python\nfrom __future__ import annotations\n\nimport os\nfrom typing import Literal, Protocol, runtime_checkable\n\nfrom pydantic import BaseModel, Field\n\n\nclass Message(BaseModel):\n    role: Literal[\"system\", \"user\", \"assistant\", \"tool\"]\n    content: str\n\n\nclass ToolSpec(BaseModel):\n    name: str\n    description: str\n    parameters: dict  # JSON Schema for the tool's arguments\n\n\nclass Usage(BaseModel):\n    input_tokens: int = 0\n    output_tokens: int = 0\n    cost_usd: float = 0.0\n\n\nclass CompletionRequest(BaseModel):\n    model: str  # resolved from config, e.g. \"claude-sonnet-4-6\" — never literal in logic\n    messages: list[Message]\n    tools: list[ToolSpec] = Field(default_factory=list)\n    response_schema: dict | None = None  # JSON Schema -> structured output\n    temperature: float = 0.0\n    max_tokens: int = 1024\n\n\nclass CompletionResponse(BaseModel):\n    text: str = \"\"\n    tool_calls: list[dict] = Field(default_factory=list)  # [{id, name, arguments}]\n    usage: Usage = Field(default_factory=Usage)\n    raw: dict | None = None\n\n\n@runtime_checkable\nclass LLMProvider(Protocol):\n    # Async so it drives the async agent loop directly. The full interface in\n    # references\u002Fprovider-abstraction.md adds stream() and embed().\n    async def complete(self, req: CompletionRequest) -> CompletionResponse: ...\n\n\nclass OpenAIAdapter:\n    def __init__(self, model: str) -> None:\n        from openai import AsyncOpenAI\n\n        self.model, self.client = model, AsyncOpenAI()\n\n    async def complete(self, req: CompletionRequest) -> CompletionResponse:\n        # Chat Completions shape (universal, still current); references\u002Fprovider-abstraction.md\n        # gives the preferred Responses-API adapter. system stays a `system` role message here.\n        kwargs: dict = {\"model\": self.model, \"messages\": [m.model_dump() for m in req.messages],\n                        \"temperature\": req.temperature, \"max_tokens\": req.max_tokens}\n        if req.tools:\n            kwargs[\"tools\"] = [{\"type\": \"function\", \"function\": {\"name\": t.name, \"description\": t.description, \"parameters\": t.parameters}} for t in req.tools]\n        if req.response_schema:\n            kwargs[\"response_format\"] = {\"type\": \"json_schema\", \"json_schema\": {\"name\": \"out\", \"schema\": req.response_schema, \"strict\": True}}\n        r = await self.client.chat.completions.create(**kwargs)\n        msg = r.choices[0].message\n        calls = [{\"id\": c.id, \"name\": c.function.name, \"arguments\": c.function.arguments} for c in (msg.tool_calls or [])]\n        return CompletionResponse(text=msg.content or \"\", tool_calls=calls, raw=r.model_dump(),\n            usage=Usage(input_tokens=r.usage.prompt_tokens, output_tokens=r.usage.completion_tokens))\n\n\nclass AnthropicAdapter:\n    def __init__(self, model: str) -> None:\n        from anthropic import AsyncAnthropic\n\n        self.model, self.client = model, AsyncAnthropic()\n\n    async def complete(self, req: CompletionRequest) -> CompletionResponse:\n        # QUIRKS: system is a top-level param (not a message); tools use input_schema (not function).\n        system = \"\\n\".join(m.content for m in req.messages if m.role == \"system\") or None\n        turns = [{\"role\": m.role, \"content\": m.content} for m in req.messages if m.role != \"system\"]\n        kwargs: dict = {\"model\": self.model, \"system\": system, \"messages\": turns, \"max_tokens\": req.max_tokens, \"temperature\": req.temperature}\n        if req.tools:\n            kwargs[\"tools\"] = [{\"name\": t.name, \"description\": t.description, \"input_schema\": t.parameters} for t in req.tools]\n        if req.response_schema:  # structured output via tool-forcing\n            kwargs[\"tools\"] = [{\"name\": \"out\", \"description\": \"Emit the result\", \"input_schema\": req.response_schema}]\n            kwargs[\"tool_choice\"] = {\"type\": \"tool\", \"name\": \"out\"}\n        r = await self.client.messages.create(**kwargs)\n        text = \"\".join(b.text for b in r.content if b.type == \"text\")\n        calls = [{\"id\": b.id, \"name\": b.name, \"arguments\": b.input} for b in r.content if b.type == \"tool_use\"]\n        return CompletionResponse(text=text, tool_calls=calls, raw=r.model_dump(),\n            usage=Usage(input_tokens=r.usage.input_tokens, output_tokens=r.usage.output_tokens))\n\n\ndef get_provider(spec: str | None = None) -> LLMProvider:\n    \"\"\"Parse 'provider:model' (default from env LLM) into a concrete adapter.\"\"\"\n    provider, _, model = (spec or os.environ[\"LLM\"]).partition(\":\")\n    if provider == \"openai\":\n        return OpenAIAdapter(model)\n    if provider == \"anthropic\":\n        return AnthropicAdapter(model)\n    raise ValueError(f\"unknown provider: {provider!r}\")\n# Gemini + OSS\u002Flitellm adapters, streaming, tool-result plumbing, and route() registry\n# -> references\u002Fprovider-abstraction.md\n```\n\n## Good vs Bad\n\nCall-sites use the adapter and never name a model: `provider = get_provider(settings.llm)` (e.g. `\"anthropic:claude-sonnet-4-6\"`), then `await provider.complete(req)`. The two failures that survive that discipline:\n\n```python\n# BAD — parse-and-pray; wrong shape fails silently at 3am.\nraw = (await provider.complete(req)).text\ntry:\n    data = json.loads(raw)\nexcept json.JSONDecodeError:\n    data = {}  # the bug is now invisible\n```\n\n```python\n# GOOD — strict structured output + schema validation that fails loudly on drift.\nclass Answer(BaseModel):\n    sentiment: Literal[\"pos\", \"neg\", \"neu\"]\n    score: float\n\nreq.response_schema = Answer.model_json_schema()\nans = Answer.model_validate_json((await provider.complete(req)).text)\n```\n\n```python\n# BAD — unbounded loop; no cap\u002Ftimeout\u002Fidempotency. Burns budget, repeats side effects, wedges.\nwhile True:\n    resp = await provider.complete(req)\n    if not resp.tool_calls:\n        break\n    for call in resp.tool_calls:\n        await run_tool(call)\n```\n\n```python\n# GOOD — bounded loop: step cap + per-tool timeout + idempotency key (safe to retry).\nfor step in range(max_steps):\n    resp = await provider.complete(req)\n    if not resp.tool_calls:\n        break\n    for call in resp.tool_calls:\n        async with asyncio.timeout(tool_timeout_s):\n            await run_tool(call, idempotency_key=call[\"id\"])\n# full loop, budgets, recovery -> references\u002Fagent-loops-and-harness.md\n```\n\n## Tools & structured output (minimum viable)\n\n```python\nfrom typing import Callable, Literal\n\nfrom pydantic import BaseModel, ConfigDict, Field, ValidationError\n\n\nclass CreateInvoiceArgs(BaseModel):\n    model_config = ConfigDict(extra=\"forbid\")  # reject unknown keys from the model\n    customer_id: str = Field(min_length=1)\n    amount_cents: int = Field(gt=0)\n    currency: Literal[\"EUR\", \"USD\"] = \"EUR\"\n\n\nclass ToolResult(BaseModel):\n    status: Literal[\"success\", \"warning\", \"error\"]\n    summary: str\n    data: dict | None = None\n    next_actions: list[str] = Field(default_factory=list)\n\n\ndef _create_invoice(args: CreateInvoiceArgs) -> ToolResult:\n    invoice_id = f\"inv_{args.customer_id}_{args.amount_cents}\"  # real impl: DB insert + idempotency\n    return ToolResult(status=\"success\", summary=f\"Created {invoice_id}\", data={\"id\": invoice_id})\n\n\nTOOLS: dict[str, tuple[type[BaseModel], Callable]] = {\n    \"create_invoice\": (CreateInvoiceArgs, _create_invoice),\n}\n\n\ndef dispatch(name: str, raw_args: dict) -> ToolResult:\n    spec = TOOLS.get(name)\n    if spec is None:\n        return ToolResult(status=\"error\", summary=f\"unknown tool {name!r}\", next_actions=[\"pick a registered tool\"])\n    args_model, handler = spec\n    try:\n        args = args_model.model_validate(raw_args)  # validate BEFORE side effects\n    except ValidationError as e:\n        return ToolResult(status=\"error\", summary=\"invalid args\", data={\"errors\": e.errors()},\n                          next_actions=[\"fix the arguments and retry\"])\n    return handler(args)\n```\n\nSchema design, sandboxing, idempotency, DI-scoped DB sessions, plus the RAG internals below — chunking, hybrid RRF, rerank, the citation grader, memory — are in [`references\u002Ftools-and-rag.md`](references\u002Ftools-and-rag.md).\n\n## RAG in 30 lines (provider-agnostic embeddings)\n\n```sql\nCREATE EXTENSION IF NOT EXISTS vector;\nCREATE TABLE IF NOT EXISTS docs (\n    id        bigserial PRIMARY KEY,\n    content   text NOT NULL,\n    embedding vector(1536) NOT NULL,\n    meta      jsonb NOT NULL DEFAULT '{}'\n);\nCREATE INDEX IF NOT EXISTS docs_embedding_hnsw\n    ON docs USING hnsw (embedding vector_cosine_ops);\n```\n\n```python\nasync def embed(texts: list[str]) -> list[list[float]]:\n    # Same provider interface as completions; impl in references\u002Ftools-and-rag.md.\n    return await provider.embed(texts)  # returns one 1536-d vector per text\n\n\nasync def retrieve(query: str, k: int = 5, min_sim: float = 0.25) -> list[dict]:\n    [q] = await embed([query])\n    rows = await db.fetch(  # cosine distance \u003C=>; similarity = 1 - distance\n        \"SELECT id, content, 1 - (embedding \u003C=> $1) AS sim \"\n        \"FROM docs ORDER BY embedding \u003C=> $1 LIMIT $2\",\n        q, k,\n    )\n    return [dict(r) for r in rows if r[\"sim\"] >= min_sim]\n\n\nasync def answer(query: str) -> str:\n    chunks = await retrieve(query)\n    if not chunks:                                   # refuse rather than hallucinate\n        return \"I don't have grounded information to answer that.\"\n    context = \"\\n\".join(f\"[{c['id']}] {c['content']}\" for c in chunks)\n    req = CompletionRequest(\n        model=settings.model_id,\n        messages=[Message(role=\"system\", content=\"Answer ONLY from context; cite chunk ids like [12].\"),\n                  Message(role=\"user\", content=f\"{context}\\n\\nQ: {query}\")],\n    )\n    return (await provider.complete(req)).text\n```\n\n## Evals & cost gates (the production line)\n\n```python\nimport json\nimport statistics\nimport sys\nimport time\n\n\nasync def run_eval(golden_path: str, graders: list, thresholds: dict[str, float]) -> None:\n    cases = [json.loads(line) for line in open(golden_path)]  # {\"input\",\"expected\",\"meta\"}\n    results = []\n    for case in cases:\n        t0 = time.perf_counter()\n        out = await provider.complete(CompletionRequest(model=settings.model_id,\n              messages=[Message(role=\"user\", content=case[\"input\"])]))\n        scores = {g.name: g.grade(case, out) for g in graders}  # exact \u002F schema \u002F LLM-judge\n        results.append({\"scores\": scores, \"cost\": out.usage.cost_usd,\n                        \"ms\": (time.perf_counter() - t0) * 1000})\n    n = len(results)\n    metrics = {\n        \"accuracy\": sum(r[\"scores\"][\"exact\"] for r in results) \u002F n,\n        \"faithfulness\": sum(r[\"scores\"][\"judge\"] for r in results) \u002F n,\n        \"p95_latency_ms\": statistics.quantiles([r[\"ms\"] for r in results], n=20)[-1],\n        \"cost_per_task\": sum(r[\"cost\"] for r in results) \u002F n,\n    }\n    failed = [k for k, lo in thresholds.items() if metrics[k] \u003C lo]\n    print(json.dumps(metrics, indent=2))\n    sys.exit(1 if failed else 0)  # CI gate: non-zero blocks the merge\n```\n\nRouting cascade in one line: `route(task) → cheapest model whose eval passes; escalate only on a failed self-check`.\nFull runner, judge, CI gate, caching, batching and budgets →\n[`references\u002Fevals-and-observability.md`](references\u002Fevals-and-observability.md).\n\n## Observability (OTel GenAI, vendor-neutral)\n\n```python\nfrom opentelemetry import trace\n\ntracer = trace.get_tracer(\"agent\")\n\n\nasync def traced_complete(provider: LLMProvider, req: CompletionRequest) -> CompletionResponse:\n    with tracer.start_as_current_span(\"chat\") as span:\n        span.set_attribute(\"gen_ai.system\", settings.llm.split(\":\")[0])\n        span.set_attribute(\"gen_ai.request.model\", req.model)\n        resp = await provider.complete(req)\n        span.set_attributes({\"gen_ai.usage.input_tokens\": resp.usage.input_tokens,\n                             \"gen_ai.usage.output_tokens\": resp.usage.output_tokens,\n                             \"gen_ai.usage.cost_usd\": resp.usage.cost_usd})\n        return resp\n# Langfuse \u002F Phoenix \u002F Braintrust are swappable OTLP backends: emit spans, swap the exporter.\n# span-per-tool, trace-id propagation, exporters -> references\u002Fevals-and-observability.md\n```\n\n## MCP: when and the smallest server\n\n**Native tools** when the agent and tools share a process\u002Frepo. **MCP** when tools must be reused across clients\u002Fteams or run out-of-process — accept the MCP cost (schema tokens, transport, ops) in exchange for reuse. TypeScript server, transports, HTTP+auth and testing are in [`references\u002Fmcp-servers.md`](references\u002Fmcp-servers.md).\n\n```python\nfrom fastmcp import FastMCP  # standalone fastmcp 2.x\n\nmcp = FastMCP(\"invoices\")\n\n\n@mcp.tool()\ndef create_invoice(customer_id: str, amount_cents: int, currency: str = \"EUR\") -> dict:\n    \"\"\"Create an invoice. amount_cents must be > 0.\"\"\"\n    if amount_cents \u003C= 0:\n        raise ValueError(\"amount_cents must be positive\")\n    return {\"id\": f\"inv_{customer_id}_{amount_cents}\", \"currency\": currency}\n\n\n@mcp.resource(\"invoice:\u002F\u002F{invoice_id}\")\ndef read_invoice(invoice_id: str) -> str:\n    \"\"\"Read-only invoice lookup by id.\"\"\"\n    return f\"Invoice {invoice_id}: status=open\"\n\n\nif __name__ == \"__main__\":\n    mcp.run()  # stdio transport\n# (MCP spec 2025-11-25; stateless-core RC 2026-07-28; verify before quoting)\n```\n\n## Anti-patterns\n\n| Anti-pattern | Reality |\n|---|---|\n| \"I'll just call the OpenAI SDK directly, we'll never switch\" | The adapter is ~40 lines; retrofitting it across 30 call-sites later is a rewrite. Adapter first. |\n| \"JSON output is usually valid, I'll parse it\" | \"Usually\" = pages at 3am. Use strict structured output + schema validation. |\n| \"The agent loop works, I don't need a step cap\" | Unbounded loops burn budget and wedge on errors. Cap steps, timeouts, and budget. |\n| \"One mega-tool that takes a freeform command is flexible\" | It's unobservable and unsafe. Narrow typed tools with idempotency keys. |\n| \"We can eval by eyeballing outputs\" | Vibes don't gate CI. Golden set + graders + threshold or it's not production. |\n| \"Default everything to the flagship model, it's smartest\" | 5–20× cost for no measured gain. Route to the cheapest model that passes the eval. |\n| \"Stuff the whole doc in the prompt instead of RAG\" | Blows context + cost and still hallucinates. Retrieve + cite + refuse. |\n| \"Retry on every exception\" | Retrying a 400\u002F401 wastes budget. Retry only transient (429\u002F5xx\u002Ftimeout) with backoff+jitter. |\n| \"Hardcode the model name, it's fine\" | Names rot (Opus 4.7 → 4.8 in weeks). Resolve from config\u002Fregistry. |\n| \"MCP for everything\" | In-process native tools are simpler and faster when reuse isn't needed. MCP only for cross-client reuse. |\n| \"Tool results just return the raw API blob\" | Give the model `status\u002Fsummary\u002Fnext_actions`; raw blobs waste context and stall recovery. |\n| \"Prompt caching is Anthropic-only so skip caching\" | Each provider has its own caching\u002Fdedup; abstract it behind the adapter, don't skip it. |\n\n## verify.sh\n\n`scripts\u002Fverify.sh` lints example agent code and dry-runs the eval smoke test in **the user's project** — not in this skill repo. It detects each tool (`ruff`, `mypy`, `tsc`\u002F`node`, `go`, the eval entrypoint, `markdownlint`) and skips any that are missing with a yellow WARN; a missing tool never fails the run. Invoke it with `bash scripts\u002Fverify.sh` from the project root. Exit 0 means clean (or only skips); a non-zero exit means a real lint\u002Ftypecheck\u002Fvet\u002Feval failure.\n\n## Project grounding\n\nIn a project with a `02-DOCS\u002F` layer ([`harness`](..\u002Fharness\u002FSKILL.md)), read `02-DOCS\u002Fwiki\u002Fstack\u002Fagents.md` first on every use and stay consistent with it. If it is missing or stale, write this project's real choices there — provider(s) and model routing, where the adapter lives, tool\u002FRAG conventions, eval gates, observability backend — as a `type: stack` article per the harness [`wiki-article-template.md`](..\u002Fharness\u002Freferences\u002Fwiki-article-template.md), index it in `02-DOCS\u002Fwiki\u002Findex.md`, and bump its `timestamp` in the same change as any convention change. No `02-DOCS\u002F`? Skip silently — technical conventions here are *recorded, not gated*; never block the task on this.\n\n## See also\n\n- Stacks the examples target: [`fastapi`](..\u002Ffastapi\u002FSKILL.md), [`nextjs`](..\u002Fnextjs\u002FSKILL.md), [`go`](..\u002Fgo\u002FSKILL.md), [`postgresdb`](..\u002Fpostgresdb\u002FSKILL.md), [`flutter`](..\u002Fflutter\u002FSKILL.md). Harden with [`secure-coding`](..\u002Fsecure-coding\u002FSKILL.md), ship with [`deployment`](..\u002Fdeployment\u002FSKILL.md).\n- External (no sibling here; use if your environment provides them): `claude-api` for Anthropic-SDK-only tuning, `deep-research` for the research-harness fan-out \u002F verify pattern.\n","# Building production LLM agents (model-agnostic)\n\nA thin provider adapter, a disciplined agent loop, schema-validated tools, provider-neutral RAG, eval gates, OTel tracing, and optionally an MCP server — so swapping OpenAI ↔ Anthropic ↔ Gemini ↔ OSS is a config change, not a rewrite.\n\n## The one rule\n\n> Program against a **capability interface**, never a vendor SDK. Vendor specifics (model id, tool-schema shape, JSON mode, caching, token limits) live behind one adapter resolved from config. Model names and prices rot — if one appears in business logic it's a bug, and re-verify the dated tables before quoting a number.\n\n**Hand off instead when:** a new non-trivial feature has no approved spec + plan under `02-DOCS\u002Fwiki\u002Fsdd\u002F` → stop and run [`specify`](..\u002Fspecify\u002FSKILL.md) first (method: [`sdd`](..\u002Fsdd\u002FSKILL.md)), which routes back here once the plan is approved; one-line\u002Flow-risk changes go straight through. Anthropic-SDK internals (caching, thinking, batch) in a file that *only* imports `anthropic` → `claude-api` if your environment has it, since this skill stays multi-provider. Workspace scaffolding → [`harness`](..\u002Fharness\u002FSKILL.md). Choosing *which* coding agent to use → agent-eval territory. Pure prompt-wording tuning with no architecture change → prompt engineering, not this. A one-shot throwaway prompt, or no retrieval\u002Ftools\u002Floop\u002Fevals at all → you don't need an agent; call the SDK directly and say so.\n\n## Decision rules (read before writing code)\n\n1. **Adapter first** — define the `LLMProvider` Protocol before any provider call.\n2. **Smallest loop that works** — single-agent before multi-agent; ReAct only when the path is uncertain; plan-execute when steps are knowable. Multi-agent means orchestrator-worker with a semaphore-bounded parallel fan-out, never a free-for-all.\n3. **Tools are typed contracts** — schema + validation + idempotency key on every side-effecting tool; no catch-all tools.\n4. **Retrieve, don't stuff** — RAG when ground truth lives in data; cite or refuse.\n5. **Eval before ship** — a golden set + regression gate in CI, or it's not production.\n6. **Cheapest model that passes the eval** — route\u002Fcascade up, never default to flagship.\n\n## The provider adapter (the heart of the skill)\n\nThe one payload to internalize. Python 3.12+, Pydantic v2, **async** so it composes directly with the bounded loop (and orchestrator-worker fan-out) in [`references\u002Fagent-loops-and-harness.md`](references\u002Fagent-loops-and-harness.md). Structured output is the quirk that differs most per vendor: strict JSON Schema (OpenAI), tool-forcing (Anthropic), `response_json_schema` (Gemini). Streaming, the Gemini and OSS\u002Flitellm adapters, tool-result plumbing, and a `route()` registry live in [`references\u002Fprovider-abstraction.md`](references\u002Fprovider-abstraction.md) — this excerpt is the load-bearing core, not the whole interface.\n\n```python\nfrom __future__ import annotations\n\nimport os\nfrom typing import Literal, Protocol, runtime_checkable\n\nfrom pydantic import BaseModel, Field\n\n\nclass Message(BaseModel):\n    role: Literal[\"system\", \"user\", \"assistant\", \"tool\"]\n    content: str\n\n\nclass ToolSpec(BaseModel):\n    name: str\n    description: str\n    parameters: dict  # JSON Schema for the tool's arguments\n\n\nclass Usage(BaseModel):\n    input_tokens: int = 0\n    output_tokens: int = 0\n    cost_usd: float = 0.0\n\n\nclass CompletionRequest(BaseModel):\n    model: str  # resolved from config, e.g. \"claude-sonnet-4-6\" — never literal in logic\n    messages: list[Message]\n    tools: list[ToolSpec] = Field(default_factory=list)\n    response_schema: dict | None = None  # JSON Schema -> structured output\n    temperature: float = 0.0\n    max_tokens: int = 1024\n\n\nclass CompletionResponse(BaseModel):\n    text: str = \"\"\n    tool_calls: list[dict] = Field(default_factory=list)  # [{id, name, arguments}]\n    usage: Usage = Field(default_factory=Usage)\n    raw: dict | None = None\n\n\n@runtime_checkable\nclass LLMProvider(Protocol):\n    # Async so it drives the async agent loop directly. The full interface in\n    # references\u002Fprovider-abstraction.md adds stream() and embed().\n    async def complete(self, req: CompletionRequest) -> CompletionResponse: ...\n\n\nclass OpenAIAdapter:\n    def __init__(self, model: str) -> None:\n        from openai import AsyncOpenAI\n\n        self.model, self.client = model, AsyncOpenAI()\n\n    async def complete(self, req: CompletionRequest) -> CompletionResponse:\n        # Chat Completions shape (universal, still current); references\u002Fprovider-abstraction.md\n        # gives the preferred Responses-API adapter. system stays a `system` role message here.\n        kwargs: dict = {\"model\": self.model, \"messages\": [m.model_dump() for m in req.messages],\n                        \"temperature\": req.temperature, \"max_tokens\": req.max_tokens}\n        if req.tools:\n            kwargs[\"tools\"] = [{\"type\": \"function\", \"function\": {\"name\": t.name, \"description\": t.description, \"parameters\": t.parameters}} for t in req.tools]\n        if req.response_schema:\n            kwargs[\"response_format\"] = {\"type\": \"json_schema\", \"json_schema\": {\"name\": \"out\", \"schema\": req.response_schema, \"strict\": True}}\n        r = await self.client.chat.completions.create(**kwargs)\n        msg = r.choices[0].message\n        calls = [{\"id\": c.id, \"name\": c.function.name, \"arguments\": c.function.arguments} for c in (msg.tool_calls or [])]\n        return CompletionResponse(text=msg.content or \"\", tool_calls=calls, raw=r.model_dump(),\n            usage=Usage(input_tokens=r.usage.prompt_tokens, output_tokens=r.usage.completion_tokens))\n\n\nclass AnthropicAdapter:\n    def __init__(self, model: str) -> None:\n        from anthropic import AsyncAnthropic\n\n        self.model, self.client = model, AsyncAnthropic()\n\n    async def complete(self, req: CompletionRequest) -> CompletionResponse:\n        # QUIRKS: system is a top-level param (not a message); tools use input_schema (not function).\n        system = \"\\n\".join(m.content for m in req.messages if m.role == \"system\") or None\n        turns = [{\"role\": m.role, \"content\": m.content} for m in req.messages if m.role != \"system\"]\n        kwargs: dict = {\"model\": self.model, \"system\": system, \"messages\": turns, \"max_tokens\": req.max_tokens, \"temperature\": req.temperature}\n        if req.tools:\n            kwargs[\"tools\"] = [{\"name\": t.name, \"description\": t.description, \"input_schema\": t.parameters} for t in req.tools]\n        if req.response_schema:  # structured output via tool-forcing\n            kwargs[\"tools\"] = [{\"name\": \"out\", \"description\": \"Emit the result\", \"input_schema\": req.response_schema}]\n            kwargs[\"tool_choice\"] = {\"type\": \"tool\", \"name\": \"out\"}\n        r = await self.client.messages.create(**kwargs)\n        text = \"\".join(b.text for b in r.content if b.type == \"text\")\n        calls = [{\"id\": b.id, \"name\": b.name, \"arguments\": b.input} for b in r.content if b.type == \"tool_use\"]\n        return CompletionResponse(text=text, tool_calls=calls, raw=r.model_dump(),\n            usage=Usage(input_tokens=r.usage.input_tokens, output_tokens=r.usage.output_tokens))\n\n\ndef get_provider(spec: str | None = None) -> LLMProvider:\n    \"\"\"Parse 'provider:model' (default from env LLM) into a concrete adapter.\"\"\"\n    provider, _, model = (spec or os.environ[\"LLM\"]).partition(\":\")\n    if provider == \"openai\":\n        return OpenAIAdapter(model)\n    if provider == \"anthropic\":\n        return AnthropicAdapter(model)\n    raise ValueError(f\"unknown provider: {provider!r}\")\n# Gemini + OSS\u002Flitellm adapters, streaming, tool-result plumbing, and route() registry\n# -> references\u002Fprovider-abstraction.md\n```\n\n## Good vs Bad\n\nCall-sites use the adapter and never name a model: `provider = get_provider(settings.llm)` (e.g. `\"anthropic:claude-sonnet-4-6\"`), then `await provider.complete(req)`. The two failures that survive that discipline:\n\n```python\n# BAD — parse-and-pray; wrong shape fails silently at 3am.\nraw = (await provider.complete(req)).text\ntry:\n    data = json.loads(raw)\nexcept json.JSONDecodeError:\n    data = {}  # the bug is now invisible\n```\n\n```python\n# GOOD — strict structured output + schema validation that fails loudly on drift.\nclass Answer(BaseModel):\n    sentiment: Literal[\"pos\", \"neg\", \"neu\"]\n    score: float\n\nreq.response_schema = Answer.model_json_schema()\nans = Answer.model_validate_json((await provider.complete(req)).text)\n```\n\n```python\n# BAD — unbounded loop; no cap\u002Ftimeout\u002Fidempotency. Burns budget, repeats side effects, wedges.\nwhile True:\n    resp = await provider.complete(req)\n    if not resp.tool_calls:\n        break\n    for call in resp.tool_calls:\n        await run_tool(call)\n```\n\n```python\n# GOOD — bounded loop: step cap + per-tool timeout + idempotency key (safe to retry).\nfor step in range(max_steps):\n    resp = await provider.complete(req)\n    if not resp.tool_calls:\n        break\n    for call in resp.tool_calls:\n        async with asyncio.timeout(tool_timeout_s):\n            await run_tool(call, idempotency_key=call[\"id\"])\n# full loop, budgets, recovery -> references\u002Fagent-loops-and-harness.md\n```\n\n## Tools & structured output (minimum viable)\n\n```python\nfrom typing import Callable, Literal\n\nfrom pydantic import BaseModel, ConfigDict, Field, ValidationError\n\n\nclass CreateInvoiceArgs(BaseModel):\n    model_config = ConfigDict(extra=\"forbid\")  # reject unknown keys from the model\n    customer_id: str = Field(min_length=1)\n    amount_cents: int = Field(gt=0)\n    currency: Literal[\"EUR\", \"USD\"] = \"EUR\"\n\n\nclass ToolResult(BaseModel):\n    status: Literal[\"success\", \"warning\", \"error\"]\n    summary: str\n    data: dict | None = None\n    next_actions: list[str] = Field(default_factory=list)\n\n\ndef _create_invoice(args: CreateInvoiceArgs) -> ToolResult:\n    invoice_id = f\"inv_{args.customer_id}_{args.amount_cents}\"  # real impl: DB insert + idempotency\n    return ToolResult(status=\"success\", summary=f\"Created {invoice_id}\", data={\"id\": invoice_id})\n\n\nTOOLS: dict[str, tuple[type[BaseModel], Callable]] = {\n    \"create_invoice\": (CreateInvoiceArgs, _create_invoice),\n}\n\n\ndef dispatch(name: str, raw_args: dict) -> ToolResult:\n    spec = TOOLS.get(name)\n    if spec is None:\n        return ToolResult(status=\"error\", summary=f\"unknown tool {name!r}\", next_actions=[\"pick a registered tool\"])\n    args_model, handler = spec\n    try:\n        args = args_model.model_validate(raw_args)  # validate BEFORE side effects\n    except ValidationError as e:\n        return ToolResult(status=\"error\", summary=\"invalid args\", data={\"errors\": e.errors()},\n                          next_actions=[\"fix the arguments and retry\"])\n    return handler(args)\n```\n\nSchema design, sandboxing, idempotency, DI-scoped DB sessions, plus the RAG internals below — chunking, hybrid RRF, rerank, the citation grader, memory — are in [`references\u002Ftools-and-rag.md`](references\u002Ftools-and-rag.md).\n\n## RAG in 30 lines (provider-agnostic embeddings)\n\n```sql\nCREATE EXTENSION IF NOT EXISTS vector;\nCREATE TABLE IF NOT EXISTS docs (\n    id        bigserial PRIMARY KEY,\n    content   text NOT NULL,\n    embedding vector(1536) NOT NULL,\n    meta      jsonb NOT NULL DEFAULT '{}'\n);\nCREATE INDEX IF NOT EXISTS docs_embedding_hnsw\n    ON docs USING hnsw (embedding vector_cosine_ops);\n```\n\n```python\nasync def embed(texts: list[str]) -> list[list[float]]:\n    # Same provider interface as completions; impl in references\u002Ftools-and-rag.md.\n    return await provider.embed(texts)  # returns one 1536-d vector per text\n\n\nasync def retrieve(query: str, k: int = 5, min_sim: float = 0.25) -> list[dict]:\n    [q] = await embed([query])\n    rows = await db.fetch(  # cosine distance \u003C=>; similarity = 1 - distance\n        \"SELECT id, content, 1 - (embedding \u003C=> $1) AS sim \"\n        \"FROM docs ORDER BY embedding \u003C=> $1 LIMIT $2\",\n        q, k,\n    )\n    return [dict(r) for r in rows if r[\"sim\"] >= min_sim]\n\n\nasync def answer(query: str) -> str:\n    chunks = await retrieve(query)\n    if not chunks:                                   # refuse rather than hallucinate\n        return \"I don't have grounded information to answer that.\"\n    context = \"\\n\".join(f\"[{c['id']}] {c['content']}\" for c in chunks)\n    req = CompletionRequest(\n        model=settings.model_id,\n        messages=[Message(role=\"system\", content=\"Answer ONLY from context; cite chunk ids like [12].\"),\n                  Message(role=\"user\", content=f\"{context}\\n\\nQ: {query}\")],\n    )\n    return (await provider.complete(req)).text\n```\n\n## Evals & cost gates (the production line)\n\n```python\nimport json\nimport statistics\nimport sys\nimport time\n\n\nasync def run_eval(golden_path: str, graders: list, thresholds: dict[str, float]) -> None:\n    cases = [json.loads(line) for line in open(golden_path)]  # {\"input\",\"expected\",\"meta\"}\n    results = []\n    for case in cases:\n        t0 = time.perf_counter()\n        out = await provider.complete(CompletionRequest(model=settings.model_id,\n              messages=[Message(role=\"user\", content=case[\"input\"])]))\n        scores = {g.name: g.grade(case, out) for g in graders}  # exact \u002F schema \u002F LLM-judge\n        results.append({\"scores\": scores, \"cost\": out.usage.cost_usd,\n                        \"ms\": (time.perf_counter() - t0) * 1000})\n    n = len(results)\n    metrics = {\n        \"accuracy\": sum(r[\"scores\"][\"exact\"] for r in results) \u002F n,\n        \"faithfulness\": sum(r[\"scores\"][\"judge\"] for r in results) \u002F n,\n        \"p95_latency_ms\": statistics.quantiles([r[\"ms\"] for r in results], n=20)[-1],\n        \"cost_per_task\": sum(r[\"cost\"] for r in results) \u002F n,\n    }\n    failed = [k for k, lo in thresholds.items() if metrics[k] \u003C lo]\n    print(json.dumps(metrics, indent=2))\n    sys.exit(1 if failed else 0)  # CI gate: non-zero blocks the merge\n```\n\nRouting cascade in one line: `route(task) → cheapest model whose eval passes; escalate only on a failed self-check`.\nFull runner, judge, CI gate, caching, batching and budgets →\n[`references\u002Fevals-and-observability.md`](references\u002Fevals-and-observability.md).\n\n## Observability (OTel GenAI, vendor-neutral)\n\n```python\nfrom opentelemetry import trace\n\ntracer = trace.get_tracer(\"agent\")\n\n\nasync def traced_complete(provider: LLMProvider, req: CompletionRequest) -> CompletionResponse:\n    with tracer.start_as_current_span(\"chat\") as span:\n        span.set_attribute(\"gen_ai.system\", settings.llm.split(\":\")[0])\n        span.set_attribute(\"gen_ai.request.model\", req.model)\n        resp = await provider.complete(req)\n        span.set_attributes({\"gen_ai.usage.input_tokens\": resp.usage.input_tokens,\n                             \"gen_ai.usage.output_tokens\": resp.usage.output_tokens,\n                             \"gen_ai.usage.cost_usd\": resp.usage.cost_usd})\n        return resp\n# Langfuse \u002F Phoenix \u002F Braintrust are swappable OTLP backends: emit spans, swap the exporter.\n# span-per-tool, trace-id propagation, exporters -> references\u002Fevals-and-observability.md\n```\n\n## MCP: when and the smallest server\n\n**Native tools** when the agent and tools share a process\u002Frepo. **MCP** when tools must be reused across clients\u002Fteams or run out-of-process — accept the MCP cost (schema tokens, transport, ops) in exchange for reuse. TypeScript server, transports, HTTP+auth and testing are in [`references\u002Fmcp-servers.md`](references\u002Fmcp-servers.md).\n\n```python\nfrom fastmcp import FastMCP  # standalone fastmcp 2.x\n\nmcp = FastMCP(\"invoices\")\n\n\n@mcp.tool()\ndef create_invoice(customer_id: str, amount_cents: int, currency: str = \"EUR\") -> dict:\n    \"\"\"Create an invoice. amount_cents must be > 0.\"\"\"\n    if amount_cents \u003C= 0:\n        raise ValueError(\"amount_cents must be positive\")\n    return {\"id\": f\"inv_{customer_id}_{amount_cents}\", \"currency\": currency}\n\n\n@mcp.resource(\"invoice:\u002F\u002F{invoice_id}\")\ndef read_invoice(invoice_id: str) -> str:\n    \"\"\"Read-only invoice lookup by id.\"\"\"\n    return f\"Invoice {invoice_id}: status=open\"\n\n\nif __name__ == \"__main__\":\n    mcp.run()  # stdio transport\n# (MCP spec 2025-11-25; stateless-core RC 2026-07-28; verify before quoting)\n```\n\n## Anti-patterns\n\n| Anti-pattern | Reality |\n|---|---|\n| \"I'll just call the OpenAI SDK directly, we'll never switch\" | The adapter is ~40 lines; retrofitting it across 30 call-sites later is a rewrite. Adapter first. |\n| \"JSON output is usually valid, I'll parse it\" | \"Usually\" = pages at 3am. Use strict structured output + schema validation. |\n| \"The agent loop works, I don't need a step cap\" | Unbounded loops burn budget and wedge on errors. Cap steps, timeouts, and budget. |\n| \"One mega-tool that takes a freeform command is flexible\" | It's unobservable and unsafe. Narrow typed tools with idempotency keys. |\n| \"We can eval by eyeballing outputs\" | Vibes don't gate CI. Golden set + graders + threshold or it's not production. |\n| \"Default everything to the flagship model, it's smartest\" | 5–20× cost for no measured gain. Route to the cheapest model that passes the eval. |\n| \"Stuff the whole doc in the prompt instead of RAG\" | Blows context + cost and still hallucinates. Retrieve + cite + refuse. |\n| \"Retry on every exception\" | Retrying a 400\u002F401 wastes budget. Retry only transient (429\u002F5xx\u002Ftimeout) with backoff+jitter. |\n| \"Hardcode the model name, it's fine\" | Names rot (Opus 4.7 → 4.8 in weeks). Resolve from config\u002Fregistry. |\n| \"MCP for everything\" | In-process native tools are simpler and faster when reuse isn't needed. MCP only for cross-client reuse. |\n| \"Tool results just return the raw API blob\" | Give the model `status\u002Fsummary\u002Fnext_actions`; raw blobs waste context and stall recovery. |\n| \"Prompt caching is Anthropic-only so skip caching\" | Each provider has its own caching\u002Fdedup; abstract it behind the adapter, don't skip it. |\n\n## verify.sh\n\n`scripts\u002Fverify.sh` lints example agent code and dry-runs the eval smoke test in **the user's project** — not in this skill repo. It detects each tool (`ruff`, `mypy`, `tsc`\u002F`node`, `go`, the eval entrypoint, `markdownlint`) and skips any that are missing with a yellow WARN; a missing tool never fails the run. Invoke it with `bash scripts\u002Fverify.sh` from the project root. Exit 0 means clean (or only skips); a non-zero exit means a real lint\u002Ftypecheck\u002Fvet\u002Feval failure.\n\n## Project grounding\n\nIn a project with a `02-DOCS\u002F` layer ([`harness`](..\u002Fharness\u002FSKILL.md)), read `02-DOCS\u002Fwiki\u002Fstack\u002Fagents.md` first on every use and stay consistent with it. If it is missing or stale, write this project's real choices there — provider(s) and model routing, where the adapter lives, tool\u002FRAG conventions, eval gates, observability backend — as a `type: stack` article per the harness [`wiki-article-template.md`](..\u002Fharness\u002Freferences\u002Fwiki-article-template.md), index it in `02-DOCS\u002Fwiki\u002Findex.md`, and bump its `timestamp` in the same change as any convention change. No `02-DOCS\u002F`? Skip silently — technical conventions here are *recorded, not gated*; never block the task on this.\n\n## See also\n\n- Stacks the examples target: [`fastapi`](..\u002Ffastapi\u002FSKILL.md), [`nextjs`](..\u002Fnextjs\u002FSKILL.md), [`go`](..\u002Fgo\u002FSKILL.md), [`postgresdb`](..\u002Fpostgresdb\u002FSKILL.md), [`flutter`](..\u002Fflutter\u002FSKILL.md). Harden with [`secure-coding`](..\u002Fsecure-coding\u002FSKILL.md), ship with [`deployment`](..\u002Fdeployment\u002FSKILL.md).\n- External (no sibling here; use if your environment provides them): `claude-api` for Anthropic-SDK-only tuning, `deep-research` for the research-harness fan-out \u002F verify pattern.\n",{"name":5,"tags":24,"origin":31,"recommends":32,"description":7},[25,26,27,28,29,30],"agents","llm","mcp","rag","evals","ai","risco",[33,34],"secure-coding","deployment","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fbuilding-agents",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill building-agents",{"tool":49,"command":50},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill building-agents",{"tool":52,"command":53},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill building-agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002FSKILL.md",true,[57,63,67,71,75,79,83],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"evals\u002Fcases.yaml","REFERENCE","参考文档",6464,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Fevals\u002Fcases.yaml",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"evals\u002FREADME.md",2993,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Fevals\u002FREADME.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fagent-loops-and-harness.md",14778,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Freferences\u002Fagent-loops-and-harness.md",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fevals-and-observability.md",15953,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Freferences\u002Fevals-and-observability.md",{"path":76,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fmcp-servers.md",11855,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Freferences\u002Fmcp-servers.md",{"path":80,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fprovider-abstraction.md",21291,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Freferences\u002Fprovider-abstraction.md",{"path":84,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Ftools-and-rag.md",15964,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fbuilding-agents\u002Freferences\u002Ftools-and-rag.md",[88,96,101,108,115,122],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":95},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":97,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":95},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":95},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":95},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":95},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":95},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]