home-ops: Skill for Claude Code

.claude/skills/authentik-terraform/SKILL.md

authentik-terraform is a skill for Claude Code from Aviator-Coding/home-ops. It costs 91 tokens per session (2,384 once invoked), scanned A, original, MIT.

A project guide for managing Authentik single sign-on and its OpenTofu infrastructure. It explains the rules for changing login providers, access flows, protected routes, and stored infrastructure state.

In plain words
What is it for?
Use it when adding or importing an Authentik application, changing SSO behaviour, updating Terraform or OpenTofu state storage, protecting a route with login, or investigating an infrastructure-plan failure.
Why use it?
It prevents risky infrastructure changes from breaking login, access control, or the saved record of deployed resources. It also records project-specific lessons for diagnosing failed plans and deployments.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is Aviator-Coding/home-ops's own configuration. It tells Claude Code how to work on home-ops itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything home-ops configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Aviator-Coding/home-ops. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Aviator-Coding/home-ops/main/.claude/skills/authentik-terraform/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Aviator-Coding/home-ops

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for authentik-terraform

README.md
[![agentmods](https://agentmods.dev/badge/skills/aviator-coding/home-ops/authentik-terraform.svg)](https://agentmods.dev/skills/aviator-coding/home-ops/authentik-terraform)
Your own site
<a href="https://agentmods.dev/skills/aviator-coding/home-ops/authentik-terraform"><img src="https://agentmods.dev/badge/skills/aviator-coding/home-ops/authentik-terraform.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,384 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.02384
Opus 5 $0.00046 $0.01192
Sonnet 5 $0.00018 $0.00477
Haiku 4.5 $0.00009 $0.00238

Measured 3d ago against content hash 8da8ae6d28bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

authentik-terraform scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/authentik-terraform/SKILL.md · 34 lines

How it starts

The opening of the file, as written. The whole thing — 34 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authentik SSO and the terraform/authentik OpenTofu stack

Relocated verbatim from AGENTS.md on 2026-09-01 so it loads only when this subsystem is in play. The text below is unchanged; only line breaks were inserted. AGENTS.md keeps a one-sentence pointer. Add new findings here or to the owning document, not back into AGENTS.md - see its "Maintaining this file" section for the rule.

  • terraform/authentik/ HAS been applied and now holds live state (first apply 2026-08-27: 9 imported, 4 added, 4 changed, 0 destroyed; second apply 2026-08-28 landed litellm_role, the LiteLLM-only invalidation flow, and the provider wiring; third apply the same day set grant_types = ["authorization_code"] on the created LiteLLM provider after post-merge SSO verification found Authentik rejecting authorize). It owns the remaining adopted apps/providers (coder, pg-admin, echo ExtAuth) plus the full LiteLLM SSO surface. open-webui was intentionally deleted from Authentik and removed from the stack (tofu state rm). A fresh tofu plan is empty (-detailed-exitcode 0) on the READ-ONLY token, and scopes_supported includes litellm_role so SSO users land as proxy_admin. Two credentials exist, both least-privilege service accounts minted through ak shell: tofu-readonly (plan) and tofu-writer (apply; fourteen add/change permissions including model-level change_flow, no delete on anything, proven by create-then-delete 201/403 and a scope-mapping POST 201). AUTHENTIK_APPLY_TOKEN is deliberately ABSENT from 1Password so a stray tofu apply fails closed. The state backend is NOT reachable through the gateway: OpenTofu's aws-sdk-go-v2 signs accept-encoding/amz-sdk-*, Envoy rewrites one of them, and RGW returns SignatureDoesNotMatch - boto3 and minio-go sign none of those and keep working, so VolSync never noticed. Endpoint is env-supplied via AWS_ENDPOINT_URL_S3 (backend.tofu omits endpoints so the env var wins): local secrets.vals.yaml uses http://127.0.0.1:18081 after kubectl -n rook-ceph port-forward svc/rook-ceph-rgw-ceph-objectstore 18081:80; CI secrets-ci.vals.yaml uses the in-cluster Service DNS because the ARC runner cannot port-forward. Runbook: docs/authentik/terraform.md.

  • Four OpenTofu/Authentik traps, none of which tofu validate can catch.

(0) grant_types is optional+computed, so omitting it is right for an IMPORTED provider (the read adopts the live set) and wrong for a CREATED one: it writes grant_types = {} and Authentik rejects every authorize with invalid_request / Invalid grant_type for provider. Same shape as client_secret, opposite answer, and a clean plan plus -detailed-exitcode 0 both hold while login is impossible.

(1) authentik_flow's terraform id is the slug, not the UUID, so a provider's invalidation_flow set from .id fails with 400 "<slug>" is not a valid UUID - use .uuid (same for authentik_flow_stage_binding.target).

(2) The S3 backend fails open to real AWS: backend.tofu omits endpoints so AWS_ENDPOINT_URL_S3 can point at the RGW port-forward, and if that variable is unset the SDK silently talks to genuine AWS S3 rather than erroring.

(3) The write role now holds model-level change_flow, which reaches every flow including default-authentication-flow, so verify each apply against a before/after snapshot of all flows and their stage bindings taken from the database, not against terraform's own summary. Evidence and commands: docs/authentik/terraform.md.

  • terraform/ is not Flux-reconciled and nothing applies it automatically. It holds OpenTofu stacks for configuration that lives inside an application's own API, where a chart cannot reach. Today that is terraform/authentik/ only. .github/workflows/validate.yaml's terraform job (scripts/ci/tofu-validate.sh) stays a pure schema check: tofu fmt -check plus tofu validate with -backend=false, no credentials. .github/workflows/terraform-diff.yaml is separate and does carry credentials: on every same-repo PR touching terraform/** it runs a real tofu init/tofu plan -lock=false against a stack's live state backend (and, for authentik, the live read-only Authentik API) and posts the plan as a PR comment, whenever that stack provides its own secrets-ci.vals.yaml (a ref+onepasswordconnect://-scheme mirror of its secrets.vals.yaml, resolved via the in-cluster 1Password Connect since CI has no interactive op session) - a stack without one gets schema-only checks. This is a deliberate, captain-approved design (2026-08-27) that consciously reverses an earlier "CI can never reach the live instance" boundary; it never touches tofu apply, which against the Authentik stack changes the cluster's live SSO, including the ExtAuth that kubernetes/apps/base/network/echo/app/securitypolicy.yaml and kubernetes/apps/base/ai/agentgateway/app/policies/authentik-policy.yaml route every request on their listeners through, and remains an explicitly approved operator action, never a follow-on to a green PR. Runbook, inventory, the CI credential and its vault-wide read scope, and the apply approval gate: docs/authentik/terraform.md (see section 9 for CI). Conventions: terraform/tofu.md.

Read the full file on GitHub · 34 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 34 lines · 91 tokens per session scan A 8da8ae6d28bf

Subscribe to this mod's changes

authentik-terraform is a skill published in the GitHub repository Aviator-Coding/home-ops (2 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 2,384 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens