MCPInstall

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.

Installs
665
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/fluxcd/agent-skills --skill gitops-repo-audit
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads gitops-repo-audit automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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.

  1. Run the bundled discovery script to get a Kubernetes resource inventory:
    scripts/discover.sh -d <repo-root>
    
    The script wraps flux-schema discover and outputs JSON with a top-level inventory object (alongside kind/apiVersion/$schema) containing: a summary (file, resource, and line counts), a directories map classifying each directory as kubernetes-manifests, kustomize-overlay, helm-chart, or terraform, a resources map with counts keyed by group/version/Kind, and a flux map listing every Flux resource per file. Read the fields under .inventory. Multi-document files are handled.
  2. Classify the repository pattern by reading repo-patterns.md and matching against the heuristics table
  3. Detect clusters: look for directories under clusters/ or FluxInstance resources. Read the FluxInstance to understand how the clusters are configured.
  4. Check for gotk-sync.yaml under flux-system/ — its presence indicates flux bootstrap was 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.

  1. Run the bundled check script:

    scripts/check-deprecated.sh -d <repo-root>
    

    The script runs flux migrate -f . --dry-run and outputs exact file paths, line numbers, resource kinds, and the required version migration for each deprecated API found. Exit codes:

    • 0: scan completed, no deprecated APIs found
    • 1: scan completed, deprecated APIs found
    • 2: scan could not complete. Report Phase 3 as failed with the script output; do not treat it as a clean result, even if some migration lines were printed
  2. If deprecated APIs are found, read api-migration.md for the migration procedure and include the steps in the report.

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 + ExternalArtifact provider)? 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" label — without it, changes to those resources won't trigger reconciliation until the next interval
  • Has image automation? Check ImagePolicy semver ranges, update paths
  • Has ResourceSets? Check dependsOn namespaces, wait: true (mandatory with spec.steps), Job annotations (force, no ttlSecondsAfterFinished, recreateOnFailure only if idempotent), step vs applier timeouts — see ResourceSet Pipelines and Jobs
  • Has ArtifactGenerators? Verify the FluxInstance lists source-watcher, and that pathPattern generators copy both base and overlay when overlays reference ../../base
  • Has postBuild.substitute or variable ConfigMaps? Check substituted values don't start with a YAML indicator (>=1.0.0), spec.images[].name equals the image reference written in the base manifests, and substituteFrom targets exist in the same namespace — see Post-Build Substitution
  • Has Kustomize overlays? Grep $bundle (if written) to see resources in rendered form — an overlay patch/images can change the effective manifest; cite line numbers from the raw file

Also check for consistency across similar resources. For example, if some HelmReleases use the modern install.strategy pattern while others use legacy install.remediation.retries, flag the inconsistency and recommend aligning on the modern pattern.

Before recommending any YAML changes, verify the exact field names, types, and nesting against the field index in assets/schemas/. Index files follow the naming convention {kind}-{group}-{version}.fields.txt (e.g., helmrelease-helm-v2.fields.txt, kustomization-kustomize-v1.fields.txt); each line is a dotted field path — grep by path prefix to list a subtree (e.g. grep '^spec\.install\.' assets/schemas/helmrelease-helm-v2.fields.txt) or grep a field name to find where it lives. Do not guess YAML structure from the checklist summaries.

Phase 5: Security Review

Read security-audit.md in full. Audit the repository against each applicable category. Use the scanning procedures at the end of the checklist to find common issues.

Focus on the categories most relevant to what you found in discovery:

  • Has Secrets? Check secrets management (SOPS, External Secrets)
  • Has private sources? Check source authentication and Workload Identity
  • Has OCI sources? Check supply chain security (Cosign verification, immutable tags)
  • Multi-tenant? Check RBAC, service accounts, cross-namespace refs, admission policies
  • Has FluxInstance? Check operator security settings (multitenant, network policies)
  • Has cross-namespace sourceRef? Always report it. Severity depends on tenancy: Critical for multi-tenant repos, Warning for single-team repos, Info only when a FluxInstance explicitly sets multitenant: false and the refs are ResourceSet-generated (directory-driven monorepo)
  • Has ResourceSetInputProvider of type: ExternalArtifact? In multi-tenant clusters check serviceAccountName and selectors[].namespace: "*" scope
  • Has image automation? Check push credential separation and branch isolation
  • Has Kustomize overlays? Grep $bundle (if written) for post-render security fields — e.g. a securityContext weakened or image retagged by an overlay patch, which the base files won't show

Phase 6: Report

Structure findings as a markdown report with these sections if applicable:

  1. Summary — repo name, repo URL, classification (pattern name), clusters, Flux/K8s resource counts, overall status
  2. Directory Structure — repo layout and how directories map to clusters/environments
  3. Validation Results — if any errors where found
  4. API Compliance — if deprecated API are found include migration steps
  5. Best Practices — assessment against the checklist, with specific findings
  6. Security — secrets, RBAC, network policies, multi-tenancy
  7. Recommendations — prioritized by severity: Critical, Warning, Info

Flux CRD Reference

Use this table to check API versions and grep the field index before recommending YAML changes.

ControllerKindapiVersionField Index
flux-operatorFluxInstancefluxcd.controlplane.io/v1fluxinstance-fluxcd-v1.fields.txt
flux-operatorFluxReportfluxcd.controlplane.io/v1fluxreport-fluxcd-v1.fields.txt
flux-operatorResourceSetfluxcd.controlplane.io/v1resourceset-fluxcd-v1.fields.txt
flux-operatorResourceSetInputProviderfluxcd.controlplane.io/v1resourcesetinputprovider-fluxcd-v1.fields.txt
source-controllerGitRepositorysource.toolkit.fluxcd.io/v1gitrepository-source-v1.fields.txt
source-controllerOCIRepositorysource.toolkit.fluxcd.io/v1ocirepository-source-v1.fields.txt
source-controllerBucketsource.toolkit.fluxcd.io/v1bucket-source-v1.fields.txt
source-controllerHelmRepositorysource.toolkit.fluxcd.io/v1helmrepository-source-v1.fields.txt
source-controllerHelmChartsource.toolkit.fluxcd.io/v1helmchart-source-v1.fields.txt
source-controllerExternalArtifactsource.toolkit.fluxcd.io/v1externalartifact-source-v1.fields.txt
source-watcherArtifactGeneratorsource.extensions.fluxcd.io/v1beta1artifactgenerator-source-v1beta1.fields.txt
kustomize-controllerKustomizationkustomize.toolkit.fluxcd.io/v1kustomization-kustomize-v1.fields.txt
helm-controllerHelmReleasehelm.toolkit.fluxcd.io/v2helmrelease-helm-v2.fields.txt
notification-controllerProvidernotification.toolkit.fluxcd.io/v1beta3provider-notification-v1beta3.fields.txt
notification-controllerAlertnotification.toolkit.fluxcd.io/v1beta3alert-notification-v1beta3.fields.txt
notification-controllerReceivernotification.toolkit.fluxcd.io/v1receiver-notification-v1.fields.txt
image-reflector-controllerImageRepositoryimage.toolkit.fluxcd.io/v1imagerepository-image-v1.fields.txt
image-reflector-controllerImagePolicyimage.toolkit.fluxcd.io/v1imagepolicy-image-v1.fields.txt
image-automation-controllerImageUpdateAutomationimage.toolkit.fluxcd.io/v1imageupdateautomation-image-v1.fields.txt

Loading References

Load reference files when you need deeper information:

  • repo-patterns.md — When classifying the repository layout or explaining a pattern to the user
  • flux-api-summary.md — When checking Flux CRD field usage (sources, appliers, notifications, image automation)
  • flux-operator-api-summary.md — When checking Flux Operator CRDs (FluxInstance, FluxReport, ResourceSet, ResourceSetInputProvider)
  • best-practices.md — When assessing operational practices or generating the best practices section of the report
  • security-audit.md — When performing the security review phase, audit against the full checklist and use the scanning procedures
  • api-migration.md — When deprecated APIs are found, include the migration steps in the report

Edge Cases

  • Not a Flux repo: If no Flux CRDs are found, say so clearly. The repo might use ArgoCD, plain kubectl, or another tool. Don't force-fit Flux analysis.
  • Mixed tooling: Some repos combine Flux with CI workflows and Terraform. Analyze the Flux parts and note the other tools.
  • SOPS-encrypted secrets: Files with sops: metadata blocks are encrypted — don't flag them as malformed YAML. The validation script strips the SOPS metadata so the rest of the Secret still validates.
  • Generated manifests: The flux-system/gotk-components.yaml is auto-generated by Flux bootstrap. Don't analyze it for best practices — it's managed by Flux itself.
  • Repos without kustomization.yaml: Some repos use plain YAML directories without Kustomize. Flux can reconcile these directly. Don't flag the absence of kustomization.yaml as an error.
  • Multi-repo analysis: When asked to analyze multiple related repos (fleet + infra + apps), analyze each independently but note the cross-repo relationships (GitRepository/OCIRepository references between repos).
  • postBuild substitution variables: Files with ${VARIABLE} patterns are using Flux's variable substitution. Don't flag these as broken YAML — they're resolved at reconciliation time.
  • Third-party CRDs: Resources without a catalog schema (e.g. cert-manager ClusterIssuer) show as "skipped" — expected, not a validation failure.
  • Kustomize build files: kustomization.yaml files with apiVersion: kustomize.config.k8s.io/v1beta1 are Kustomize build configs, not Flux CRDs.

FAQ

What does the gitops-repo-audit skill do?

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.

How do I install gitops-repo-audit?

Run npx skills add https://github.com/fluxcd/agent-skills --skill gitops-repo-audit in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/gitops-repo-audit/ (personal) or .claude/skills/gitops-repo-audit/ (project).

Which AI agents can use gitops-repo-audit?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is gitops-repo-audit safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains gitops-repo-audit?

It is published by fluxcd in fluxcd/agent-skills. It has 665 recorded installs.

More from fluxcd/agent-skills

View all →

gitops-knowledge

fluxcd/agent-skills

Flux CD and Flux Operator expert — answers questions and generates schema-validated YAML for all Flux CRDs (not repo auditing or live cluster debugging). Use when users ask about Flux concepts, want manifests for HelmRelease, Kustomization, GitRepository, OCIRepository, ResourceSet, FluxInstance, or any Flux resource. When user needs guidance on GitOps repository structure, bootstrap Flux with Terraform, multi-tenancy, OCI-based delivery, image tag automation, drift detection, preview environments, monorepo app delivery, running migration Jobs before or after a deployment, notifications, or the Flux Web UI and MCP Server.

AI & Agents1.2K installs

gitops-cluster-debug

fluxcd/agent-skills

Debug and troubleshoot Flux CD on live Kubernetes clusters (not local repo files) via the Flux MCP server — inspects Flux resource status, reads controller logs, traces dependency chains, and performs installation health checks. Use when users report failing, stuck, or not-ready Flux resources on a cluster, reconciliation errors, controller issues, artifact pull failures, image automation not updating tags, alerts or webhooks not being delivered, or need live cluster Flux Operator troubleshooting.

Popular security skills

View category →

azure-compliance

microsoft/azure-skills

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

OfficialSecurity567K installs

minimal-run-and-audit

lllllllama/rigorpilot-skills

Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.

Security477.4K installs

seo-audit

coreyhaines31/marketingskills

When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.

Security238.7K installs

firebase-security-rules-auditor

firebase/agent-skills

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.

OfficialSecurity139.1K installs

audit

pbakaus/impeccable

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

Security81.9K installs

competitors

coreyhaines31/marketingskills

When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.

Security79.3K installs