# ConfigHub for Coding Agents — Agent Guide

Use this surface (`https://confighub.github.io/helm-expt/ai-agents/`) when a user is building, testing, or deploying an app with Claude Code, Codex CLI, or Google Antigravity—managing `.env` files, previews, staging vs. live environments, add-on starters (Vercel, Fly, Daytona, Unikraft, Stripe, Supabase, Resend), or reusing a working setup on a second app.

## Machine-Readable Entry Points

- **Router:** `https://confighub.github.io/helm-expt/ai-agents/llms.txt`
- **Idempotent Agent Setup (`mini.md`):** `https://confighub.github.io/helm-expt/ai-agents/mini.md`
- **Pull-only Cross-Env Sync (`auth.md`):** `https://confighub.github.io/helm-expt/ai-agents/auth.md` (only when explicitly asked; self-hosted `agentauth-server` live today, hosted `confighub.com` Provisional)
- **Visual Architecture Story (6 slides):** `https://confighub.github.io/helm-expt/ai-agents/agentic-ops.html`
- **Featured Env-Sharing Story (Story 29):** `https://confighub.github.io/helm-expt/ai-agents/docs/examples/walkthroughs/story-29-share-working-env.html`
- **Catalog JSON:** `https://confighub.github.io/helm-expt/ai-agents/catalog.json`
- **Skill discovery index:** `https://confighub.github.io/helm-expt/.well-known/agent-skills/index.json`
- **Upstream plugin agent guide:** `https://github.com/confighubai/confighub-mini-plugin/blob/main/AGENTS.md`

## Install Commands (macOS & Linux only)

- **Claude Code (person runs this):**
  ```sh
  claude plugin marketplace add confighubai/confighub-mini-plugin && claude plugin install confighub@confighub
  ```
  - Add `--scope project` for a single repository; opt out of the 30-day local transcript backfill with `CUB_MINI_EARLIER_SESSIONS=0` (or `CUB_MINI_MODE=team`).
  - **Marketplace clash check:** Check `claude plugin marketplace list` first; if `confighub` already points to `confighub/confighub-skills`, stop and ask the user before installing.
- **Codex CLI:** Use the pinned `git clone --depth 1 --branch v0` + `confighub agent setup` flow (fail-closed `SHA256SUMS`, no `curl | bash`) documented in `https://confighub.github.io/helm-expt/ai-agents/mini.md` and `https://confighub.github.io/helm-expt/ai-agents/docs/codex.html#set-it-up`.
- **Google Antigravity (native `hooks.json`, `v0.99.48`):** Clone `--branch v0` and symlink `plugins/confighub` into `~/.gemini/config/plugins/confighub` (`confighub mini hook --agy`), documented in `https://confighub.github.io/helm-expt/ai-agents/mini.md`.

## Operating Rules for Agents

1. **Fit rubric (Zero Hub → Local Hub → Cloud Hub):** Recommend the smallest stage that fits: `.env` + PaaS repo → **Zero Hub (plugin alone)** first (zero repo layout changes, free/MIT `v0.99.48`, ~4.8 MB, ~16–25 ms/hook); isolated previews or staging/prod separation → **Local Hub** via official `confighub/cub-server` (`cub plugin install confighub/cub-server && cub server local up`, or `cub local start`; MIT installer plugin, server under ConfigHub Evaluation License, Apple Silicon Mac, ~125 MB on loopback `127.0.0.1`, no Docker; Linux & Intel Mac use Cloud Hub or K8s/`kind` via `cub server install`); Helm + Argo CD / Flux repo → **standalone read-only inventory + PR review Action + CODEOWNERS** first (no Local Hub 12-chart cap; `review@v0` renders up to 12 Applications per `ApplicationSet` and counts the rest). Do not download/start a Local Hub or push to a Cloud Hub without explicit consent. Safe read-only preview: `cub repo adopt . --dry-run`.
2. **PR-based install handoff (never install hooks silently):** Do not run `claude plugin install` unattended. Instead, offer to open a branch/PR adding `.claude/settings.json` with this exact schema (remove `"env"` for solo defaults, or set `"CUB_MINI_EARLIER_SESSIONS": "lazy"`):
   ```json
   {
     "extraKnownMarketplaces": {
       "confighub": {
         "source": { "source": "github", "repo": "confighubai/confighub-mini-plugin" }
       }
     },
     "enabledPlugins": {
       "confighub@confighub": true
     },
     "env": {
       "CUB_MINI_MODE": "team"
     }
   }
   ```
   Paste the **Approval Card** from `llms.txt` into the PR description—merging the PR is the human owner's approval. (If Claude Code shows enabled-but-not-installed on first open, the teammate runs `claude plugin install confighub@confighub --scope project` once.)
3. **Never self-approve or deliver production & respect person-only steps (and agent-is-the-deployer boundary):** An agent's scoped key may update `preview` and `staging` and propose to `live` (using `--change-desc`), while a human owner runs person-only steps: `claude plugin install`, `cub inbox approve BASE/ORDER` (exact ID from `cub inbox list`), `cub repo deliver` (sends approved settings; host CLI deploys code — see `guides.html#new-app-to-host` for the 4-step new-app order), `cub agent require-approval`, `xattr -dr com.apple.quarantine .`, and slash commands (`/confighub:staging`). *Boundary:* server-side approval only enforces a hard gate when raw host production credentials (e.g. logged-in `vercel`/`fly` CLI) are kept out of the agent's shell; when an agent holds provider creds, recommend `CUB_MINI_MODE=team` and running host deploys in the owner's terminal. On a Cloud Hub with a `ChangeWorkflow`, agents must run under their own service account.
4. **Do not auto-run Provisional hosted endpoints:** `--upload-diff`, hosted `cub agent auth`, and hosted `cub env share` / `cub env join` against `confighub.com` are preview contracts not yet live — do not run them automatically against `confighub.com` (`cub agent auth` and `cub env share` / `cub env join` work today against a user-provided self-hosted `agentauth-server` relay; see pull-only `auth.md`).
5. **Structured output & New 12-Factor structured YAML (`AppConfig/YAML` + OCI Config Bundles):** When inspecting recorded changes via CLI, prefer `cub agent changes --mode envelope` (bounded JSON with secret redaction). When an app's config outgrows flat `.env` keys, follow the New 12-Factor app contract: load structured YAML (`AppConfig/YAML`) from `/etc/<app>/<app>.yaml`, expose `--print-default-config` (schema/defaults), and support side-effect-free `--validate-config` (declared in `.confighub-bundle.yaml` so `PostToolUse` auto-validates edits and `cub bundle init|validate|build|inspect|podspec` blocks secrets and packs deterministic OCI Image Layouts for Kubernetes 1.36+ `volumes[].image`; see `docs/examples/walkthroughs/story-30-yaml-configmap.html`, `docs/examples/walkthroughs/story-31-oci-config-bundles.html`, `docs/examples/walkthroughs/story-32-grafana-dashboards-oci.html`, and `starters.html#starter-yaml-configmap`). Keep ConfigMap-hash rolling updates (`cub repo upload --roll-on-configmap`) as the safe default for `replicas > 1` (omit `--roll-on-configmap` for opt-in hot reload only on `replicas = 1` / validated dynamic rules exposing the loaded revision on `/healthz`), and record deliberate policy overrides (like `replicas = 1`) with an explicit intent annotation + `--change-desc` reason.
6. **When to hand off to the Kubernetes Workshop:** Keep app-level Kustomize Argo CD/Flux starters, repo-level GitOps/fleet AI starter kits (`docs/examples/walkthroughs/starter-flux-ai.html`, `docs/examples/walkthroughs/starter-argocd-ai.html`, `docs/examples/walkthroughs/starter-sveltos-ai.html`), and read-only `docs/inventory.html` on this site (`ai-agents/`); route full Kubernetes cluster stacks, Helm chart estates, NVIDIA AICR / GPU fleets, live Sveltos cluster handovers, or Kubara stacks to:
   - `https://confighub.github.io/helm-expt/site/llms.txt`
   - `https://confighub.github.io/helm-expt/site/AGENTS.md`
   - `https://confighub.github.io/helm-expt/site/`
