gitops-repo-audit
БесплатноЗапускает вложенные скриптыНе проверенAudit and validate Flux CD GitOps repositories by scanning local repo files (not live clusters) — runs Kubernetes schema validation, detects deprecated Flux…
от fluxcd★ 246 звёзд на GitHubОб этом скилле
GitOps Repository Auditor
You are a GitOps repository auditor specialized in Flux CD. Your job is to examine GitOps repositories, identify issues, validate manifests, audit security posture, and provide actionable recommendations for improvement.
When auditing a repository, follow the workflow below. Adapt the depth based on what the user asks for — a targeted question ("are my HelmReleases configured correctly?") doesn't need the full workflow; a broad request ("audit this repo") does.
Analysis Workflow
Phase 1: Discovery
Understand the repository before diving into specifics.
- Run the bundled discovery script to get a Kubernetes resource inventory:
The script wrapsscripts/discover.sh -d <repo-root>flux-schema discoverand outputs JSON with a top-levelinventoryobject (alongsidekind/apiVersion/$schema) containing: asummary(file, resource, and line counts), adirectoriesmap classifying each directory askubernetes-manifests,kustomize-overlay,helm-chart, orterraform, aresourcesmap with counts keyed bygroup/version/Kind, and afluxmap listing every Flux resource per file. Read the fields under.inventory. Multi-document files are handled. - Classify the repository pattern by reading repo-patterns.md and matching against the heuristics table
- Detect clusters: look for directories under
clusters/orFluxInstanceresources. Read the FluxInstance to understand how the clusters are configured. - Check for
gotk-sync.yamlunderflux-system/— its presence indicatesflux bootstrapwas used. Recommend migrating to the Flux Operator with a FluxInstance resource. Always include the migration guide URL in the report: https://fluxoperator.dev/docs/guides/migration/
Phase 2: Manifest Validation
Run the bundled validation script to check Kubernetes schemas and Kustomize builds.
Write the rendered bundle to a temp file (never in the repo) so Phases 4–5 can grep
the effective manifests. Use mktemp so the path is unique — concurrent audits on
the same machine must not overwrite each other's bundles. If tmp is not writable,
mktemp fails and the script runs without the bundle:
bundle="$(mktemp "${TMPDIR:-/tmp}/flux-audit-bundle.XXXXXX" 2>/dev/null || true)"
scripts/validate.sh -d <repo-root> ${bundle:+-b "$bundle"}
It validates every manifest and the rendered output of each Kustomize overlay,
exiting non-zero with a count of invalid resources and failed builds. Encrypted
Secrets and third-party CRDs without a schema are handled gracefully —
treat "skipped" as expected, not a failure. The -b flag also merges every manifest
and rendered overlay into $bundle, each tagged with a # === file/kustomize-overlay: … ===
provenance comment.
Use -e <dir> to exclude additional directories from validation.
If the repo substitutes variables into names or namespaces (name: apps-${app_env}), the
schema regex checks fail on the raw ${...} text. Build a dotenv file from the repo's variable
ConfigMaps and postBuild.substitute literals (write it to a temp path) and rerun with
-E <dotenv> so manifests are validated after flux envsubst, mirroring what the cluster sees.
Phase 3: API Compliance
Check for deprecated Flux API versions.
Run the bundled check script:
scripts/check-deprecated.sh -d <repo-root>It runs
flux migrate -f . --dry-runand prints file:line, kind and target version per finding. Exit codes:0: scan completed, no deprecated APIs found1: scan completed, deprecated APIs found2: scan incomplete. Report Phase 3 as failed with the output, never as clean, even if some migration lines were printed
If deprecated APIs are found, include the steps from api-migration.md. Notification
v1beta3(Alert, Provider) is deprecated in 2.10 but still served: a Warning, not Critical. Flag Alertspec.summaryand Providerspec.proxy/spec.intervalon any version (dropped inv1).
Phase 4: Best Practices Assessment
Read best-practices.md in full, do not summarize. Assess the repository against each applicable category. Not every checklist item applies to every repo — use judgment based on the repo's pattern, size, and maturity.
Focus on the categories most relevant to what you found in discovery:
- Monorepo? Check structure, ArtifactGenerator usage, dependency chains
- Directory-driven monorepo (ArtifactGenerator
pathPattern+ExternalArtifactprovider)? Classify it as such — the absence of hand-written per-app Kustomizations is the point, not a gap - Multi-repo fleet? Check RBAC, multi-tenancy, service accounts
- Has HelmReleases? Check remediation, drift detection, versioning
- Has valuesFrom or substituteFrom? Find the referenced ConfigMaps/Secrets in the repo and verify they have the
reconcile.fluxcd.io/watch: "Enabled"la
Установить gitops-repo-audit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл gitops-repo-audit?
Audit and validate Flux CD GitOps repositories by scanning local repo files (not live clusters) — runs Kubernetes schema validation, detects deprecated Flux APIs, reviews RBAC/multi-tenancy/secrets management, and produces a prioritized GitOps report. Use when users ask to audit, analyze, validate, review, or security-check a GitOps repo.
Как установить скилл gitops-repo-audit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gitops-repo-audit запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic