agentleFS
psylchpsylch/cloudflare-dns-skill/skills/cloudflare-dns/SKILL.md

cloudflare-dns

Skill0 starsChanged 9 months agoMITView on GitHub

Comprehensive guide for managing Cloudflare DNS with Azure integration. Use when configuring Cloudflare as authoritative DNS provider for Azure-hosted applications, managing DNS records via API, setting up API tokens, configuring proxy settings, troubleshooting DNS issues, implementing DNS security best practices, or integrating External-DNS with Cloudflare for Kubernetes workloads.

  • Reads credentials
  • Installs packages

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. OpenMinis/MinisSkills★ 602same name
    2. ravidsrk/agent-skills★ 1same name
    3. lsongdev/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When running preflight and credentials are missing, guide the user:

    line 34
  2. Very specific:

    After the user chooses, check if a .env already exists at the target location:

    line 50
  3. Very specific:

    If it exists: show the current contents, ask the user — (A) Append CF_* keys to existing file, (B) Backup and replace (cp .env …

    line 51
  4. Very specific:

    If it does not exist: copy .env.example to .env

    line 52
  5. Very specific:

    When preflight reports ready: false, use this table to resolve each failure:

    line 62
  6. Very specific:

    If ready: false, consult the Check-Fix Table above for specific remediation.

    line 80
  7. Distinctive:

    After any mutation operation (create, update, delete), present a structured report:

    line 125
  8. Distinctive:

    Read these on demand when the user's request needs deeper context.

    line 173

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cloudflare DNS Skill

Language

Match user's language: Respond in the same language the user uses.

Overview

Manage Cloudflare DNS records via REST API. Covers record CRUD, proxy settings, troubleshooting, and Kubernetes External-DNS integration.

Script Directory

Determine this SKILL.md directory as SKILL_DIR, then use ${SKILL_DIR}/scripts/cloudflare-dns.sh.

Environment

Credentials are loaded automatically from .env files. The script checks in this order (highest priority first):

  1. Environment variables (already set in shell — always win)
  2. Project-level <cwd>/.env (auto-loaded by script)
  3. Skill-level ${SKILL_DIR}/.env (auto-loaded by script)
VariableRequiredDescription
CF_API_TOKENYesCloudflare API Token (Zone:Read + DNS:Edit)
CF_ZONE_IDNoDefault zone ID (avoids passing it to every command)

First-time Setup

When running preflight and credentials are missing, guide the user:

Cloudflare API credentials not found.

How to obtain:
1. Visit https://dash.cloudflare.com/profile/api-tokens
2. Create Custom Token with permissions: Zone:Read + DNS:Edit
3. Scope to specific zones (recommended)
4. Copy the token

Where to save?
A) Project-level: <cwd>/.env (this project only)
B) User-level: ${SKILL_DIR}/.env (all projects using this skill)

After the user chooses, check if a .env already exists at the target location:

  • If it exists: show the current contents, ask the user — (A) Append CF_* keys to existing file, (B) Backup and replace (cp .env .env.backup.$(date +%s)), or (C) Skip
  • If it does not exist: copy .env.example to .env

Then fill in the values:

CF_API_TOKEN=<user_input>
CF_ZONE_ID=<user_input_optional>

Preflight Check-Fix Table

When preflight reports ready: false, use this table to resolve each failure:

CheckStatusFix
curlmissingbrew install curl (macOS) / apt install curl (Linux)
jqmissingbrew install jq (macOS) / apt install jq (Linux)
digmissingbrew install bind (macOS) / apt install dnsutils (Linux) — optional, only for verify-dns
kubectlmissingbrew install kubectl — optional, only for External-DNS features
CF_API_TOKENnot_configuredFollow First-time Setup above to create and save the token
CF_API_TOKENinvalidToken exists but live API check failed. Regenerate at https://dash.cloudflare.com/profile/api-tokens with Zone:Read + DNS:Edit permissions
CF_ZONE_IDnot_configuredOptional. Find in Cloudflare dashboard: select zone, copy Zone ID from right sidebar

Workflow

  1. Preflight — Verify credentials and tools:
    bash ${SKILL_DIR}/scripts/cloudflare-dns.sh preflight
    If ready: false, consult the Check-Fix Table above for specific remediation.
  2. List existing records — Understand current state before changes:
    bash ${SKILL_DIR}/scripts/cloudflare-dns.sh list-records
  3. Create / update / delete records as needed:
    bash ${SKILL_DIR}/scripts/cloudflare-dns.sh create-cname $CF_ZONE_ID www target.example.com true
    bash ${SKILL_DIR}/scripts/cloudflare-dns.sh create-a $CF_ZONE_ID app 1.2.3.4 true
  4. Verify DNS propagation:
    bash ${SKILL_DIR}/scripts/cloudflare-dns.sh verify-dns app.example.com

For raw curl commands, read references/dns-operations.md.

Script Reference

Helper script: scripts/cloudflare-dns.sh

CommandDescription
preflightCheck env vars, tools, and token validity
verify-tokenVerify API token
list-zonesList all zones
list-records [zone_id]List DNS records
get-record <zone_id> <name>Get specific record
create-a <zone_id> <name> <ip> [proxied]Create A record
create-cname <zone_id> <name> <target> [proxied]Create CNAME record
delete-record <zone_id> <record_id>Delete record
export <zone_id>Export zone to BIND format
verify-dns <hostname>Verify DNS resolution

Degradation

DependencyWhen missingBehavior
digNot installedSkip verify-dns command; suggest manual check with nslookup or online tools like https://dnschecker.org
kubectlNot installed or no cluster accessSkip check-external-dns; Kubernetes integration features unavailable — user can still manage DNS records directly via API

Core DNS record operations (list, create, update, delete) only require curl and jq.

Completion Report

After any mutation operation (create, update, delete), present a structured report:

DNS Record Updated!

Zone: [zone name] ([zone_id])
Operation: [create | update | delete]
Record: [type] [name] → [content]
Proxied: [yes | no]
TTL: [value]

Verification:
✓ API returned success
✓ dig @1.1.1.1 [name] [type] → [resolved value]  (if dig available)

Next Steps:
→ Full propagation may take 1-5 minutes
→ Verify with: dig @1.1.1.1 [name] [type]

For delete operations, omit the content/proxied/TTL fields and adjust accordingly.

Proxy Decision Guide

Use CaseProxy (orange cloud)Reason
Web apps, APIs, static sitesYesCDN, DDoS protection
Mail (MX), SSH, FTP, VPNNoNon-HTTP protocols

Troubleshooting

SymptomLikely CauseFix
401 UnauthorizedInvalid tokenRegenerate API token
403 ForbiddenInsufficient permissionsAdd Zone:Read, DNS:Edit
429 Rate LimitedToo many requestsIncrease interval, use pagination
"Record exists"DuplicateDelete or update existing record
DNS not resolvingPropagation delayWait 1-5 min, verify with dig @1.1.1.1

Security

  1. Scope tokens — Use specific zones, not "All zones"
  2. IP filtering — Restrict to known IPs when possible
  3. Rotate regularly — Every 90 days for production
  4. Store in .env — Never hardcode tokens in scripts or SKILL.md

References

Read these on demand when the user's request needs deeper context. Do not load all at once.

TopicFileWhen to read
curl examples for all record opsreferences/dns-operations.mdUser wants raw curl instead of script
Kubernetes External-DNS setupreferences/kubernetes-integration.mdUser mentions k8s, External-DNS, AKS
Complete Cloudflare API docsreferences/api-reference.mdUser needs advanced API features not in script
Azure integration patternsreferences/azure-integration.mdUser mentions Azure, App Service, AKS

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.