fold: Skill for Claude Code

.claude/skills/discovery-controller/SKILL.md

discovery-controller is a skill for Claude Code from fold-run/fold. It costs 66 tokens per session (1,286 once invoked), scanned A, original, Apache-2.0.

A guide for fold-discovery, a controller that finds labeled Kubernetes Services and turns them into a list of upstream services for the gateway. Kubernetes is a system for running and managing containerized applications.

In plain words
What is it for?
Use it when changing the discovery controller, Kubernetes service mapping, gateway discovery, or related documentation and allowlists.
Why use it?
It helps preserve the security boundary around service-discovery data and avoids adding unnecessary Kubernetes dependencies.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is fold-run/fold's own configuration. It tells Claude Code how to work on fold 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 fold configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fold-run/fold. 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/fold-run/fold/main/.claude/skills/discovery-controller/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/fold-run/fold

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 discovery-controller

README.md
[![agentmods](https://agentmods.dev/badge/skills/fold-run/fold/discovery-controller/github.svg)](https://agentmods.dev/skills/fold-run/fold/discovery-controller)
Your own site
<a href="https://agentmods.dev/skills/fold-run/fold/discovery-controller"><img src="https://agentmods.dev/badge/skills/fold-run/fold/discovery-controller/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for discovery-controller

Your own site · 80×15
<a href="https://agentmods.dev/skills/fold-run/fold/discovery-controller"><img src="https://agentmods.dev/badge/skills/fold-run/fold/discovery-controller.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,286 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.00066 $0.01286
Opus 5.5 $0.00026 $0.00514
Sonnet 5.5 $0.00013 $0.00257
Haiku 4.5 $0.00007 $0.00129

Measured 2mo ago against content hash 3daec6be2b31, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

discovery-controller 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 2mo 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/discovery-controller/SKILL.md · 107 lines

How it starts

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

The Kubernetes discovery controller

fold-discovery lists Services matching a label selector on an interval, maps them to upstream entries via annotations, validates them with fold's own config package, and serves {"upstreams": [...]} for the gateway's discovery.url to poll.

Linux-only (goreleaser builds it for linux alone) — it runs in a cluster, listing Services with the pod's service account.

The constraint that shapes the whole package

Poll-to-poll, no client-go, no informers. fold polls the producer; the producer polls the Kubernetes list API with the pod's service-account token and plain HTTP. That is the entire Kubernetes client.

This keeps fold's module free of the Kubernetes dependency tree, and it is load-bearing rather than incidental: go.mod has 14 direct dependencies and pulling in client-go would multiply that, in a binary operators run at the edge of their network. Do not add client-go, informers, or a controller-runtime dependency to make something more elegant. If a change seems to need watch semantics, it needs a shorter interval.

The trust boundary is the reason for every allowlist flag

A Service annotation is a lower-trust input than the config document. Anyone who can create a Service in a watched namespace can propose an upstream. Every flag below exists to bound what that person can propose, and each defaults to the safe end:

Flag Default What it stops
--allow-auth-strategies none A Service choosing how the gateway authenticates to it
--allow-secret-refs none A Service naming an env var whose value it wants sent
--allow-credential-hosts unrestricted A credentialed Service pointing at an attacker's host
--reserved-ids empty A Service claiming the id or namespace of a static upstream
--allow-unprefixed-ids off (prefixing on) Cross-namespace id collisions; single-tenant clusters only
--min-health-interval-ms 1000 A Service asking for a probe loop that hammers itself
--bearer-env none An unauthenticated reader of the discovery document

Read the full file on GitHub · 107 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. 2mo ago First seen · 107 lines · 66 tokens per session scan A 3daec6be2b31

Subscribe to this mod's changes

discovery-controller is a skill published in the GitHub repository fold-run/fold (1 stars, last pushed 12d ago), licensed Apache-2.0. It adds 66 tokens to every session and 1,286 once invoked, about $0.0003 per session on Opus 5.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-08-31.

Related

discovery-controller compared with skills from other repositories

discovery-controller next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
discovery-controllerfold-run/foldSkill112d agoApache-2.0A66Claude Code
bmad-shard-docmmornati/leanproxy-mcpSkill51mo agoMITA34Claude Code, Codex
bmad-document-projectmmornati/leanproxy-mcpSkill51mo agoMITA29Claude Code, Codex
migrate-goldmark-extension-v1-to-v2yuin/goldmarkSkill5.1k4d agoMITA26Claude Code
octo-driveMininglamp-OSS/octo-cliSkill922yesterdayApache-2.0A55Claude Code, Codex
pi-loop-forensicsdimetron/pi-goSkill2223d agoMITA65Claude Code, Codex
nightly-session-watchdimetron/pi-goSkill2223d agoMITA78Claude Code, Codex