# Wetech OP Diagnosis Skill Plan

## Current Design

- Auto-oncall installs `clinic-api` and `wetech-op-grafana` from an external
  read-only skills volume.
- The run prompt lets the agent call the Wetech transport skill directly, so
  evidence selection and root-cause checks are not governed by one diagnosis
  contract.

## Risks

- Copying the Investibook Clinic collector would introduce Clinic-only APIs,
  workspace paths, and report writers that do not work in Wetech OP.
- A partial Grafana or Dashboard response can otherwise be mistaken for proof
  that an unobserved root-cause class is healthy.
- Browser-backed Dashboard requests share a profile and must remain serial.

## Target Contract

- `wetech-op-diagnosis` is the canonical workflow for Wetech OP performance
  diagnosis; `wetech-op-grafana` remains the read-only transport.
- The repository-owned diagnosis skill is bundled in the image and its absence
  is fatal at container startup. External PVC skills remain optional transport
  skills.
- The diagnosis skill uses a canonical time window, records evidence coverage,
  treats missing dimensions as unverified, and emits a fixed concise RCA.
- It never invokes Clinic collectors or performs writes/production operations.

## Implementation Steps

1. Add the repository-owned diagnosis skill.
2. Copy bundled skills into the image and install the required skill before
   optional external transport skills.
3. Route Wetech OP performance prompts through the diagnosis skill.
4. Add installer and prompt contract tests.

## Verification Checklist

- Bundled skill installs into `CODEX_HOME/skills`.
- Startup fails if its `SKILL.md` is missing.
- External Clinic/Wetech transport installation remains supported.
- Dry-run and live prompts require diagnosis-workflow-first routing.
- Typecheck and focused/full tests pass.

## Not Doing

- Do not copy or execute Investibook's Clinic evidence collector.
- Do not change ST routing or the Investibook workspace client.
- Do not add deployment toggles, Jira writes, or customer-visible automation.
