# Clinic API Environment Compatibility Plan

## Summary

Fix the `clinic-api` follow-up query failure observed in workspace
`ws-1776220777461-75f939e68` / `O11Y-2396397`.

The immediate failure mode was that follow-up shell commands used an older
base-url variable name, while the `clinic-api` skill reliably exports
`CLINIC_ENDPOINT` and `CLINIC_API_BASE`. The fix is to standardize all
agent-facing runtime configuration on `CLINIC_ENDPOINT` and remove the old
base-url naming from agent/MCP runtime configuration.

## Key Changes

- Keep `agentkit/skills/nutshell-skills/platform/clinic-api/scripts/clinic-auth.sh`
  on `CLINIC_ENDPOINT` and `CLINIC_API_BASE`; do not introduce a second
  exported URL name for new shell snippets.
- Update `agentkit/config/opencode.json.template` so the clinic MCP
  environment uses `CLINIC_ENDPOINT`.
- Update `agentkit/mcp/aiops-mcp-demo` so Clinic MCP reads
  `CLINIC_ENDPOINT`.
- Keep documentation and new examples on `CLINIC_ENDPOINT`; do not document the
  old base-url variable for agent/MCP runtime configuration.

## Test Plan

- Source the clinic shell helper and run `get_clinic_auth`; verify
  `CLINIC_ENDPOINT` and `CLINIC_API_BASE` are non-empty.
- Verify Clinic MCP uses `CLINIC_ENDPOINT`.
- Create or refresh a workspace `.opencode/opencode.json` and confirm the
  clinic MCP environment uses `CLINIC_ENDPOINT`.

## Assumptions

- `CLINIC_ENDPOINT` remains the canonical variable for skill scripts.
- This plan does not change Clinic API key discovery or injection.
- Existing workspaces will receive the template update only when their
  workspace opencode config is refreshed. Existing MCP configs that only set
  the old base-url variable must be refreshed or migrated.
