{
  "schema_version": "0.2",
  "policy": {
    "copy_scripts_by_default": false,
    "description": "PRD Plugin scripts are not blanket-installed into downstream repositories. Install or copy only explicitly scoped helper scripts when a repository opts into local helper execution.",
    "options": {
      "codex": "Codex host agent skill discovery (.agents/skills/).",
      "opencode": "opencode host agent skill discovery (.opencode/skill/) and plugin install via opencode.json.",
      "claude": "Claude Code plugin-primary support, hooks, commands, and optional .claude/skills escape hatch.",
      "opencode-skill-inject": "Add opencode-agent-skills plugin and prd-plugin skill permission to opencode.json."
    },
    "option_defaults": {
      "codex": true,
      "opencode": true,
      "claude": true,
      "opencode-skill-inject": true
    },
    "matrix_doc": "docs/INSTALL-MATRIX.md"
  },
  "scripts": {
    "archive_automation_session.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex"
      ],
      "description": "Optional Codex Stop-hook helper for archiving completed automation sessions after verifying a known Automation ID. Opencode hosts handle session cleanup through their own archive mechanism."
    },
    "automation_guard.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Repo-local single-run lock and pending marker helper for recurring request/mailbox automations. Installed whenever a host agent option is enabled."
    },
    "drift_monitor.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional longitudinal drift monitor for agentic PRD Plugin sessions. Records validator snapshots and action streams for observational research. Installed only when --include-optional-scripts is enabled."
    },
    "feature_skill_audit.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub semantic audit that maps shipped capabilities, workflows, and commands to current owning-skill guidance and reports CHML findings."
    },
    "fork_version_check.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Read-only generic fork/upstream version drift check (--drift): polls a configured JSON URL (a static manifest or a node /v1/status), reads a configured version field, and compares to a local marker (default FORK-VERSION); surfaces a newer fork version on Stop. Inert by default and a no-op unless the repo is a configured fork consumer; TTL-cached, fail-open."
    },
    "gap_audit.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "PRD Plugin development pre-version-bump release metadata audit. Never installed in downstream."
    },
    "generate_command_skills.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub build tool that derives the source-command-* host-native command skills from commands/*.md."
    },
    "generate_skills_manifest.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub build tool that versions the skill bundle into skills-manifest.json (per-skill sha256 + bundle hash + plugin version)."
    },
    "ingest_manual_drift.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Read-only drift detector for docs/<repo>-ingest-manual.html (ingest-manual/v1): flags when the manual's meta.commit is far behind HEAD, carries no commit stamp, or no longer conforms (--drift). Fail-open and a no-op where no manual exists, so it ships safely to every repo. Wired into drift_monitor's default + on-Stop validator sets."
    },
    "instruction_parity.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub validator that the agent instruction files (CLAUDE.md, AGENTS.md and their repo-skeleton counterparts) carry the same rule set, and that a rule declared always-in-force has not been demoted below CLAUDE.md's skills heading where it reads as a routing hint."
    },
    "local_workflow_check.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "PRD Plugin development repository validation runner. Never installed in downstream."
    },
    "message_check.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Required read-only runtime for the prd_check_messages tool and current-repo inbox, outbox, mailbox, and request-thread discovery."
    },
    "prd_config.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "One documented, validated contract for toggling PRD Plugin monitors/modes from JSON: a canonical TOGGLES registry + get/set/list over .prd_plugin/config.json (validates types + enum values, preserves file style). 'list --json' is the machine-consumable surface for external apps."
    },
    "prd_doctor.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional read-only downstream repo diagnostic helper for PRD Plugin config, request state, privacy warnings, stale requests, and copied script policy."
    },
    "prd_gate.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Enforcement gate: repo-state check (duplicate ids, version-marker drift, implemented-without-graduated_to, stranded outbox, state consistency) for pre-commit/CI, plus an autonomy-tier decision check. Reads the config policy flags."
    },
    "prd_graph.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Read-only machine-first traceability graph over .prd_plugin state: nodes per ID, directed {cause,effect,rel} edges, provenance/impact traversal, gap detection, and an AI-Collab-v3 {cause,effect,label} export. Backs the /prd-graph command."
    },
    "prd_hooks.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "claude"
      ],
      "description": "Enable/disable/show the Claude Code hooks (nudge, skill-usage logger, auto-report) by stashing the .claude/settings.json hooks block. Backs the /prd-hooks command."
    },
    "prd_install.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub-only bootstrap installer for copying the PRD Plugin skeleton, skills, and allowed downstream scripts into a target repository. Never installed in downstream."
    },
    "prd_install_skills.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper for installing PRD Plugin skills into the repo-local host agent discovery directory."
    },
    "prd_reflections.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Manage categorized Stop-hook reflection questions with validated list/create/update/delete, category and per-question activation, collision-free RFQ IDs, shared locking, and atomic config writes."
    },
    "prd_reporting.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Provider-neutral delegated-reporting control plane: validates policy, builds deterministic source-referenced bundles, chooses configured fallbacks, and validates AI-Collab results without calling a model or writing project state."
    },
    "prd_runtime_worker.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Dispatches hash-bound workflow judgment and delegated-reporting envelopes through AI-Collab and requires results to return through validating PRD MCP callbacks."
    },
    "prd_selective_promote.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional selective-promote guardrail for PRD Plugin memory."
    },
    "prd_self_audit.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional repo self-audit. Mines AGENTS.md / CLAUDE.md rules and source-code debt markers, produces a rule-vs-reality gap report, and optionally persists REQ-* and HLT-* records for high-leverage rules."
    },
    "prd_services.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Validated repository-owned service consume/provide manifest CRUD, audit, reconciliation, and hash projection used by Substrate discovery and workflows."
    },
    "prd_status.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Read-only one-screen status: requests by status, active tracking, open health, stale items, and skill-usage summary. Backs the /prd-status command."
    },
    "prd_substrate.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Executable contract-v2 bridge: live UTCP discovery, identity/health negotiation, source-bound allowlisted calls, record/graph/event projection, service advertisement, and bounded runtime receipts without canonical-state authority."
    },
    "prd_substrate_catalog.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Validates the versioned capability/intent catalog that maps every shipped AI-Collab tool group to PRD workflow policy, fallback, and explicit-only boundaries."
    },
    "prd_substrate_links.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Duplicate-safe runtime link registry for PRD records bound to Substrate goals, capsules, threads, watches, apps, specialist cases, or exports."
    },
    "prd_test_scope.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Deterministic verification planner and executor: collects exact local changes, queries AI-Collab impact, maps nearby tests, executes safe argv-only focused commands, and widens to full verification on uncertainty."
    },
    "prd_tools.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "The UTCP tool surface: read-only observe/recall tools (status, tracking, decisions, evidence, wiki, drift, gate, reporting) over a repo's .prd_plugin method state, with --utcp-manual discovery. Reporting builds deterministic bundles only; a UTCP host such as AI-Collab owns model execution. Writes stay on the validated MCP/script path."
    },
    "prd_ui_export.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper that renders PRD Plugin state as one self-contained HTML page, embeddable in a host app shell or opened standalone. Every repo with the plugin can view its own state, so it installs when a host agent option is enabled."
    },
    "prd_ui_serve.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe loopback-only server that turns the UI into a live control surface: it serves the page and applies toggle changes through the validated prd_config authority. Refuses any non-loopback bind because it mutates configuration."
    },
    "prd_version_check.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Auto plugin-version-available check: queries npm for the latest prd-plugin version (TTL-cached, fail-open, network-optional), compares to the installed version, and reports whether an update is available. Surfaced by the nudge and /prd-status; toggle with /prd-version."
    },
    "prd_wiki_backfill.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "LLM-wiki utility: inventories a grounded deep-backfill plan, reports pending/stale state, and audits local .md references; read-only by default, with explicit --lint-links --fix for unambiguous inline-link repair."
    },
    "prd_workflows.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Deterministic workflow engine with service audits, optional Substrate preflight/recall/goals/notices/telemetry, focused verification execution, persistent WFR receipts, and automatic hash-bound judgment dispatch."
    },
    "publish_verify.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub release gate: npm registry read-back confirming a version actually published before publication evidence may be recorded (fail-closed)."
    },
    "release_check.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "PRD Plugin development release hygiene checker. Never installed in downstream."
    },
    "reason_guard_benchmark.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub-only latency benchmark for the deterministic reasoning diagnostic hook. Never installed in downstream."
    },
    "request_autosubmit.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Submits a filed request upstream automatically when it names a plugin-owned surface: flags the local record, exports a sanitized package to .prd_plugin/outbox/, and delivers it into the hub inbox when PRD_UPSTREAM_HUB or config.requests.upstream_hub_path points at one. Fail-open; called by the MCP prd_file_request tool."
    },
    "request_export.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper for exporting sanitized upstream request packages. Installed when a host agent option is enabled."
    },
    "request_import.py": {
      "install_scope": "hub_runtime",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub-only helper for staging downstream request packages into the upstream inbox. Never installed in downstream."
    },
    "request_mailbox.py": {
      "install_scope": "hub_runtime",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub-only helper for publishing repo-scoped downstream mailboxes. Never installed in downstream."
    },
    "request_pull.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper for merging scoped mailbox replies into local request state. Installed when a host agent option is enabled."
    },
    "request_reply.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper for appending MSG-* request-thread replies. Installed when a host agent option is enabled."
    },
    "request_report.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional report helper for summarizing local request state, staleness, and privacy warnings."
    },
    "request_routing.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe helper for addressing a request to a declared peer repo and delivering it into that repo's inbox. Peer-to-peer messaging is for any repo, not just the hub, so it installs when a host agent option is enabled."
    },
    "request_thread.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Downstream-safe validated entry point that closes a finished request thread with a reason, under the shared state lock, so message_check stops reporting settled conversations as unresolved."
    },
    "skill_usage_report.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional read-only report joining skill-usage telemetry (.prd_plugin/local/skill-usage.jsonl) with the ID records into a timeline and per-session summary; flags work shipped without logged verification/TDD skill use."
    },
    "staleness_audit.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Required read-only auditor used by enabled deterministic workflows to flag stale REQ/TRK/HLT records by the config staleness thresholds."
    },
    "state_consistency_check.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Required read-only validator for claimed IDs, tracking-branch promotion, registry counters, and future timestamps across PRD Plugin state, evidence, and session summaries."
    },
    "traceability_sync_auto.py": {
      "install_scope": "downstream_optional",
      "installed_by_default": false,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Optional read-only first-pass traceability scan that reports dangling links and orphan records to seed project-traceability-sync."
    },
    "version_advice.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub-side helper for comparing a target repository's installed PRD Plugin version against hub release metadata. Never installed in downstream."
    },
    "wiki_html_export.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Offline self-contained HTML viewer for the repo's LLM wiki with Copy-Markdown and Download-.md controls (page contract v1)."
    },
    "wiki_ingest_drift.py": {
      "install_scope": "downstream_runtime",
      "installed_by_default": true,
      "requires_options": [
        "codex",
        "opencode",
        "claude"
      ],
      "description": "Read-only auditor reporting implemented requests with no corresponding wiki ingest, so 'ingest on close' is a checked condition rather than an instruction agents skip. Surfaced by prd_status."
    },
    "workflow_chml_audit.py": {
      "install_scope": "plugin_development",
      "installed_by_default": false,
      "requires_options": [],
      "description": "Hub release audit that deterministically checks workflow catalog, security, config, state, interface, mirror, installer, skill, command, and documentation coverage and reports critical/high/medium/low counts."
    }
  }
}
