AGENT SKILL

多集群配置一致性审计

audit-fleet-conformance

当用户希望验证跨集群队列的一致性(conformance)时使用——包括多个命名空间、多个集群,或某个已定义的 View 范围。自然表述:'哪些集群是符合规范的?'、'依据此 View 审计集群队列的一致性'、'展示生产集群队列中的所有异常项'、'将每个服务与其源真相策略进行对比'、'针对漂移进行全范围三方核对'、'集群级合规审计'、'哪些部署在整个集群中出现了漂移?'。由 `compare three-way --view` + `compare source-truth` + `fleet outliers` 组合实现多资源/多集群检查。需要 View + ConfigHub 接口处于连接模式。不要在以下情况加载:单个资源(使用 investigate-drift)、分诊排查(使用 triage-unhealthy-workload)、单个事件的事件证据(使用 operator-incident-evidence),或任何变更类操作。

License 许可
MIT
最近更新
2026-11-14
Stars
★ 14
Forks
1

01 前言 Front Matter

name
audit-fleet-conformance
phase
cross-cutting
description
Use when the user wants to verify CONFORMANCE ACROSS A FLEET — multiple namespaces, multiple clusters, or a defined View scope. Natural phrasing: "which clusters are conformant?", "audit fleet conformance against this View", "show me all outliers in prod fleet", "compare every service against its source-truth strategy", "scope-wide three-way check for drift", "fleet-level compliance audit", "which deployments drift across the cluster?". Composes `compare three-way --view` + `compare source-truth` + `fleet outliers` for multi-resource / multi-cluster checks. Requires connected mode for the View + ConfigHub surfaces. Do NOT load for: a single resource (use investigate-drift), a triage (use triage-unhealthy-workload), incident evidence for one event (use operator-incident-evidence), or anything mutating.
allowed-tools
Bash(./cub-scout compare three-way *) Bash(cub-scout compare three-way *) Bash(cub scout compare three-way *) Bash(./cub-scout compare source-truth *) Bash(cub-scout compare source-truth *) Bash(cub scout compare source-truth *) Bash(./cub-scout fleet outliers *) Bash(cub-scout fleet outliers *) Bash(cub scout fleet outliers *) Bash(./cub-scout views resolve *) Bash(cub-scout views resolve *) Bash(cub scout views resolve *) Bash(./cub-scout views project *) Bash(cub-scout views project *) Bash(cub scout views project *) Bash(./cub-scout scan *) Bash(cub-scout scan *) Bash(cub scout scan *) Bash(./cub-scout map list *) Bash(./cub-scout map workloads *) Bash(./cub-scout map orphans *) Bash(cub-scout map list *) Bash(cub-scout map workloads *) Bash(cub-scout map orphans *) Bash(cub scout map list *) Bash(cub scout map workloads *) Bash(cub scout map orphans *) Bash(./cub-scout summary list *) Bash(cub-scout summary list *) Bash(cub scout summary list *) Bash(./cub-scout receipt verify *) Bash(cub-scout receipt verify *) Bash(cub scout receipt verify *) Bash(kubectl get *) Bash(cub space list *) Bash(cub unit get *) Bash(cub unit list *) Bash(cub link get *) Bash(cub link list *) Bash(cub view get *) Bash(cub view list *) Bash(cub unit-event list *) Bash(cub resource list *) Bash(cub release list *) Bash(cub changeset list *) Bash(cub view list)

02 资源文件 1

03 SKILL.md 正文

audit-fleet-conformance

The fleet-wide conformance loop. Multiple resources, possibly multiple clusters, need a structured "are these in agreement with their declared source of truth?" verdict. Composes compare three-way --view + compare source-truth --strategy + fleet outliers (+ optionally receipt verify --save for evidence persistence).

Requires connected mode (cub auth login) for the View, source-truth, and fleet surfaces.

When to use

Explicit phrasings:

  • "Which clusters are conformant against View monthly-spend-by-team?"
  • "Audit fleet conformance against this Hub View"
  • "Show me all outliers in the prod fleet"
  • "Compare every service against its declared source-truth strategy"
  • "Scope-wide three-way check for drift across namespace/payments"
  • "Fleet-level compliance audit"
  • "Which deployments drift across the cluster?"

Implicit intents:

  • The user is doing compliance / governance, not real-time response
  • The scope is multi-resource (namespace, View, scope=cluster) — not a single workload
  • The user wants a per-resource verdict with rolled-up statistics
  • The result may feed Pilot acceptance, a release-gate dashboard, or a periodic audit log

Do not load for

The loop

  1. Define the scope. A View (--view <uuid-or-url>), a namespace (--scope namespace/<ns>), a cluster (--scope cluster), or the whole fleet via fleet outliers.
  2. Pick the verb. compare three-way --view for DRY/WET/LIVE conformance per resource. compare source-truth --strategy <s> for strategy-typed verdict per resource. fleet outliers --view for cross-cluster comparison against a View baseline.
  3. Roll up the verdict. --format json for machine-readable per-resource verdicts; ASCII for human review. The summary.agreement field on three-way output (agreed / converging / diverged / partial) is the headline.
  4. Persist the audit (optional). receipt verify <kind>/<name> --strategy <s> --save per resource if the audit needs fingerprinted evidence. Useful for periodic compliance reports.

Step-by-step

Step 1 — define the scope

A View is the canonical scope for fleet-wide audits. Views are declared in ConfigHub (cub view ...) and resolved by cub-scout from a UUID or a hub.confighub.com URL:

$ cub-scout views resolve https://hub.confighub.com/views/monthly-spend-by-team
View: monthly-spend-by-team
  scope: cluster
  columns: [team, service, replicas, monthly_cost_estimate]
  resolved at: 2026-05-22T10:30:00Z

If no View applies, fall back to a namespace or cluster scope:

$ cub-scout compare three-way --scope namespace/payments --format json | jq '.summary.agreement'
"diverged"

Step 2 — three-way conformance

$ cub-scout compare three-way --view monthly-spend-by-team --format json

The output structures per-resource agreement (DRY/WET/LIVE) + rolls up to a scope-level summary.agreement field with four states:

State Meaning
agreed All resources in scope have DRY=WET=LIVE for every field. The fleet matches its intent.
converging Most resources agree; a small subset is in active reconciliation (controller-drift causes). The fleet is recovering.
diverged At least one resource has a hard mismatch with no controller-drift cause. Investigate.
partial Mixed; the rollup couldn't pick a single label. Read the per-resource detail.

Per-resource fieldMismatches[] carries the same attribution evidence as the single-resource case (see investigate-drift).

Step 3 — strategy-typed source-truth across the fleet

When the audit is strategy-anchored (e.g., "all of payments should be Argo-reading-from-Git"), iterate compare source-truth per resource with the declared strategy:

$ for d in $(cub-scout map workloads --namespace payments --format json | jq -r '.[] | "\(.kind)/\(.name)"'); do
    cub-scout compare source-truth "$d" -n payments --strategy git-argo --format json | jq '{name: "'"$d"'", status: .status, verdict: .source_truth}'
  done

Each output is a one-line verdict per resource. The source-truth contract has two separate enums:

  • status (the four-valued evidence-quality verdict): PASS / WATCH / BLOCK / ASK
  • source_truth (the five-valued cross-surface agreement): AGREED / MISMATCH / INCOMPLETE / BLOCKED / UNKNOWN

INCONCLUSIVE is the receipt-level verdict for receipts that themselves can't be evaluated; it does NOT appear in compare source-truth's own status enum. When you wrap the source-truth result in a cub-scout receipt verify --strategy <s> receipt, ASK status maps to receipt WATCH (per the locked synthesis in docs/proposals/receipts-way-forward.md).

Group the audit matrix by status: PASS / WATCH / BLOCK / ASK. INCOMPLETE on source_truth is recoverable (missing proof gaps); MISMATCH is not.

Step 4 — cross-cluster outliers (true fleet scope)

fleet outliers --view does the multi-cluster comparison. It walks each cluster's snapshot for the View's columns and flags rows where one cluster deviates:

$ cub-scout fleet outliers --view monthly-spend-by-team
View: monthly-spend-by-team
Clusters: 12

  payments  EXPECTED 3 deploys / cluster   prod-euw1: 2 (outlier: missing payments-worker)
  checkout  EXPECTED 5 deploys / cluster   ALL match
  search    EXPECTED 4 deploys / cluster   staging-use2: 3 (outlier: missing search-replica)

Each row names the expectation (EXPECTED) and the offending cluster (outlier). Fleet outliers requires connected mode because the cross-cluster snapshots live in ConfigHub.

Step 5 — persist as receipts (optional)

If the audit feeds a compliance dashboard or a Pilot acceptance kernel, generate a typed evidence artifact per resource:

$ for d in $(cub-scout map workloads --namespace payments --format json | jq -r '.[] | "\(.kind)/\(.name)"'); do
    cub-scout receipt verify "$d" -n payments --strategy git-argo --save
  done
$ cub-scout receipt list --format json | jq '[.[] | select(.verdict == "BLOCK")]'

See scout-verify for the receipt surface; the source-truth-pass predicate is the audit-aligned one.

Worked example

$ cub-scout compare three-way --view monthly-spend-by-team --format json | jq '.summary'
{
  "agreement": "partial",
  "agreed": 18,
  "converging": 1,
  "diverged": 3,
  "scope": "view:monthly-spend-by-team"
}

$ cub-scout fleet outliers --view monthly-spend-by-team
View: monthly-spend-by-team
Clusters: 12

  payments  EXPECTED 3 deploys / cluster   prod-euw1: 2 (outlier: missing payments-worker)

Reading: 22 resources in the View; 18 conformant, 1 reconciling, 3 truly divergent, 1 multi-cluster outlier (a missing deploy in prod-euw1).

For the three divergent resources, drill into each with compare three-way <kind>/<name> to see the per-field attribution. For the outlier, drill into cub view get monthly-spend-by-team to confirm the expectation and then cub-scout explain the missing resource's cluster context.

Connected-mode requirement

Most of this skill requires cub auth login. Specifically:

  • compare three-way (DRY layer needs ConfigHub)
  • compare source-truth (the contract is meaningless without all three surfaces)
  • views resolve
  • fleet outliers

The compare drift standalone variant works without ConfigHub for file-vs-live diffs, but it's narrower in scope than a fleet audit. Run cub-scout status first to confirm the mode; if standalone, tell the user the audit needs auth.

CI integration

For periodic compliance checks (e.g., a daily audit job), the verbs are CI-shaped:

# Exit non-zero if any resource in scope is diverged (i.e., gate on conformance)
$ cub-scout compare three-way --view monthly-spend-by-team --fail-on warning

--fail-on warning|info (added in compare three-way) maps the agreement state to exit codes. The flag itself is read-only — it just decides whether to fail the pipeline, not whether to apply a fix.

Receipts are the more durable artifact:

# Save one receipt per workload in scope; commit them to an audit branch
$ ./audit.sh > audit-results.txt
$ cub-scout receipt list --format json > audit-receipts.json
$ git add audit-receipts.json && git commit -m "daily audit $(date -u +%F)"

Tool boundary

  • Allowed: the four Compare verbs; fleet outliers; views resolve / project; scan (risk-classification overlay); map; summary list (connected snapshot reads); receipt verify --save for evidence persistence.
  • Not allowed: any mutation to cluster state or ConfigHub. cub-scout's --fail-on flag fails CI; it does not patch. ApplicationSet generation, unit creation, target binding are all cub operations.

References

Constraints

  • Connected mode required for the View + ConfigHub + fleet surfaces. Standalone audits are limited to per-resource three-way + drift.
  • Views need to be declared in ConfigHub before they can be referenced. Authoring Views is a cub view create operation; out of cub-scout scope.
  • The audit produces evidence; remediation of any outlier is the user's call. cub-scout's receipt verify --save is the suggested persistence path for the audit trail.

04 同仓库更多 Skills

confighub
confighub/cub-scout

异常工作负载故障分诊

triage-unhealthy-workload

当用户需要在时间压力下应对出现故障的 Kubernetes 工作负载时使用——例如寻呼告警响起、CI 飘红、“生产环境挂了”的场景。自然表述包括:“deploy/api 出现 CrashLoopBackOff,该怎么办?”“发布卡住了,帮帮我”“这个 pod 起不来”“支付服务触发了寻呼告警”“argocd 里全红了”“我应该先检查什么?”“给我一份针对这个工作负载的分诊方案”。它将 doctor → explain → trace 组合成一个紧凑的约 30 秒循环,运维人员可在已确认寻呼告警的上下文中执行。不要用于:没有紧迫性的计划性排查(直接使用 scout-diagnose)、漂移相关问题(使用 investigate-drift),或任何变更操作(cub-scout 从不做变更——应由用户主导,转由 kubectl 处理)。

SRE 工程师生产事故响应与应急处置
★ 14
confighub
confighub/cub-scout

资源证据收据生成与校验

scout-verify

当用户需要针对某个 Kubernetes 资源生成带类型、带指纹、不可篡改(TYPED、FINGERPRINTED、IMMUTABLE)的证据工件时使用——即 cub-scout 的 Verify 动词组(在 #446 中发布的收据能力)。自然表述包括:“出具一份证明此资源合规的收据”“给我一份证明集群与 Git 一致的证明”“我需要一份可用于审计跟踪的可验证记录”“生成一份收据,证明自部署以来没有人工改动”“对照事实源(source-truth)校验 deploy/api 并保存工件”“验证此收据未被篡改”“展示我们有哪些收据”“此收据是否被篡改过?”“把证据附加到我的 CI 关卡”。当意图涉及 receipt / attestation / evidence-artifact / tamper-evident-record / verified-record / audit-trail / postmortem-evidence / acceptance-judge-input 时均应加载。不要用于:不落盘工件的实时比对(使用 scout-compare)、解读单个字段的来源出处(使用 scout-attribute),或真正实施修复(cub-scout 从不做变更——应由用户主导,转由 cub / argocd / kubectl 处理)。

SRE 工程师审计准备与证据管理
★ 14
confighub
confighub/cub-scout

scout-observe

Use when the user wants to SEE what is running in a Kubernetes cluster, who owns it, and how it is structured — the read-only Observe verb group of cub-scout. Natural phrasing: "what is running in my cluster?", "give me a map of resources", "who owns this Deployment?", "trace this back to its source", "show me the ownership tree", "scan this cluster for risk", "dump the cluster as JSON", "stream cluster events", "run cub-scout as a bot", "what is the connection status?", "is this cluster healthy?". Load when intent is observe / inventory / map / show / list / trace / scan / dump / stream / bot / health-check over a Kubernetes cluster. Do NOT load for: explaining WHY something is broken (use scout-diagnose), comparing cluster state to intended state (use scout-compare), provenance of individual field values (use scout-attribute), or any action that mutates the cluster (cub-scout never mutates — route to cub or kubectl with the user driving).

★ 14
confighub
confighub/cub-scout

scout-mcp

Use when the user wants to expose cub-scout to an AI agent over MCP, wants a deterministic AI-ready snapshot of cluster context, or wants cub-scout running as a read-only event bot — the Integrate verb group. Natural phrasing: "start the MCP server", "expose cub-scout to Claude / Codex / my agent", "give me an AI-ready context pack of this cluster", "set up the MCP gateway", "what MCP tools does cub-scout expose?", "run cub-scout as a bot", "produce JSON context for an LLM to reason about this cluster". Load whenever intent is mcp / mcp-gateway / mcp-serve / context-pack / bot / agent-context / ai-snapshot / llm-context / model-context-protocol. Do NOT load for: actually running a non-integrate verb (those are scout-observe / scout-diagnose / scout-compare / scout-attribute / scout-ingest / scout-govern / scout-verify), or `cub` MCP integration (that's a separate tool surface).

★ 14
confighub
confighub/cub-scout

scout-ingest

Use when the user wants to ADOPT existing Kubernetes / GitOps workload structure into ConfigHub after observing the live cluster — the adoption/import verb group of cub-scout. Natural phrasing: "discover workloads in this cluster and propose ConfigHub units", "show me the import proposal before I apply", "import this Argo Application set", "bring my Flux Kustomizations into ConfigHub", "preview what would land in ConfigHub if I imported this repo", "parse my git repo as a ConfigHub import bundle", "import a cluster aggregator", "what would --git-path produce for this repo?". Load whenever intent is adopt / import / ingest / preview / propose / parse-repo / discovery / aggregator / bring-into-confighub / what-would-confighub-see. Do NOT load for: questions about who changed a resource, whether it was edited by hand or drifted (use scout-attribute or investigate-drift); reading an exported `kubectl get -o yaml` dump to answer a question about the cluster (that is not an import); basic live-cluster inventory (use scout-observe), troubleshooting (use scout-diagnose), comparing live state to ConfigHub (use scout-compare), or the actual write to ConfigHub via `cub variant upload` (that is `cub`, not cub-scout — route to cub skills). Important: `cub-scout import apply` IS the mutating write into ConfigHub — this skill teaches the read-only preview path and explicitly refuses to invoke `import apply` itself.

★ 14
confighub
confighub/cub-scout

ConfigHub 治理信号查询

scout-govern

当用户希望从 cub-scout 获取已连接的(CONNECTED)ConfigHub 治理信号时使用该技能 —— Govern(治理)动词组。自然表述:"给我看这个单元的 ChangeSet 历史"、"如果我修改这个单元,影响范围(blast radius)有多大?"、"我的机群中哪些集群是异常值?"、"给我看昨天的连接摘要"、"在整个机群中呈现这个视图"、"审计谁修改了这个"、"上一次应用来自哪里?"、"列出我拥有的 ConfigHub bundle"、"给我看过往快照的目录"。当意图为历史 / 影响 / 影响范围 / 机群异常 / 摘要 / 视图 / 审计 / bundle / 目录 / 连接上下文时加载。不要用于:实时集群比较(使用 scout-compare)、回执(使用 scout-verify)、正在运行的 Pod 清单(使用 scout-observe),或通过 cub 进行的任何修改。该技能的大部分功能需要 `cub auth login` —— 请提前说明。

SRE 工程师工程变更管理
★ 14