agentleFS
DeanThompsonDeanThompson/agent-skills/skills/cloudflare-dns-manager/SKILL.md

cloudflare-dns-manager

Skill1 starsChanged 6 months agoMITView on GitHub

Manage Cloudflare DNS zones, DNS records, and Cloudflare single redirect rules through the official API. Use when an agent needs to inspect Cloudflare zones, list DNS records, create or update SPF/DKIM/DMARC/MX/CNAME/TXT records, delete records, configure www-to-apex redirects, export zones, or prepare DNS changes for domains hosted on Cloudflare, especially when the account contains multiple zones.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    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:

    Use the bundled script to manage Cloudflare DNS through the official API.

    line 15
  2. Very specific:

    Prefer explicit zone selection.

    line 17
  3. Distinctive:

    Read references/auth-and-safety.md before the first write operation.

    line 21
  4. Distinctive:

    Prefer API tokens over legacy global API keys.

    line 23
  5. Distinctive:

    If the user only gives a hostname and the target zone is unclear, inspect candidates:

    line 40
  6. Distinctive:

    Create or update a single record:

    line 59
  7. Distinctive:

    Read references/records-json.md for the JSON schema.

    line 94
  8. Very specific:

    Create or update a www -> apex redirect:

    line 112
  9. Very specific:

    Delete a redirect rule by ref, id, or source host:

    line 130
  10. Distinctive:

    Use redirect rules for canonical host routing.

    line 146
  11. Very specific:

    Use DNS only for mail-related records.

    line 150
  12. Very specific:

    Use --dry-run before apply-file on production zones.

    line 154
  13. Distinctive:

    Stop and ask for confirmation before deleting records or redirects unless the user already explicitly requested the exact deletion.

    line 155
  14. Distinctive:

    Keep comments and commit messages in English when editing this skill or its scripts.

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Manager

Use the bundled script to manage Cloudflare DNS through the official API.

Prefer explicit zone selection. When multiple domains exist in the same Cloudflare account, require --zone-name or --zone-id before any write operation. Do not guess the target zone for upsert-record, delete-record, apply-file, or upsert-redirect.

Authentication

Read references/auth-and-safety.md before the first write operation.

Prefer API tokens over legacy global API keys.

Supported environment variables:

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_EMAIL + CLOUDFLARE_API_KEY

Workflow

1. Identify the zone

List available zones first:

python3 scripts/cloudflare_dns.py list-zones

If the user only gives a hostname and the target zone is unclear, inspect candidates:

python3 scripts/cloudflare_dns.py resolve-zone --fqdn send.example.com

For multi-zone accounts, stop and require an explicit --zone-name or --zone-id before editing.

2. Inspect existing records

List records in a zone before changing anything:

python3 scripts/cloudflare_dns.py list-records --zone-name example.com
python3 scripts/cloudflare_dns.py list-records --zone-name example.com --type TXT --name _dmarc

3. Apply the change

Create or update a single record:

python3 scripts/cloudflare_dns.py upsert-record \
  --zone-name example.com \
  --type TXT \
  --name _dmarc \
  --content 'v=DMARC1; p=none'

SMTP-related examples:

python3 scripts/cloudflare_dns.py upsert-record \
  --zone-name example.com \
  --type MX \
  --name send \
  --content feedback-smtp.us-east-1.amazonses.com \
  --priority 10

python3 scripts/cloudflare_dns.py upsert-record \
  --zone-name example.com \
  --type CNAME \
  --name em123._domainkey \
  --content em123.example.sendprovider.net \
  --proxied false

Batch apply from JSON:

python3 scripts/cloudflare_dns.py apply-file --zone-name example.com --file records.json --dry-run
python3 scripts/cloudflare_dns.py apply-file --zone-name example.com --file records.json

Read references/records-json.md for the JSON schema.

4. Verify the result

Re-list the affected records after any change:

python3 scripts/cloudflare_dns.py list-records --zone-name example.com --name send

5. Configure host redirects

List existing redirect rules:

python3 scripts/cloudflare_dns.py list-redirects --zone-name example.com

Create or update a www -> apex redirect:

python3 scripts/cloudflare_dns.py upsert-record \
  --zone-name example.com \
  --type CNAME \
  --name www \
  --content example.com \
  --proxied true

python3 scripts/cloudflare_dns.py upsert-redirect \
  --zone-name example.com \
  --source-host www \
  --target-host @ \
  --status-code 301 \
  --preserve-query-string true

Delete a redirect rule by ref, id, or source host:

python3 scripts/cloudflare_dns.py delete-redirect \
  --zone-name example.com \
  --source-host www \
  --yes

Export one zone for backup or migration:

python3 scripts/cloudflare_dns.py export-zone --zone-name example.com
python3 scripts/cloudflare_dns.py export-zone --zone-name example.com --file zone-export.json

Use redirect rules for canonical host routing. DNS alone cannot issue HTTP 301 or 302 responses.

Guardrails

  • Use DNS only for mail-related records. Do not proxy SMTP-related CNAME records.
  • For MX records, pass --priority.
  • For redirect rules, ensure the source hostname is proxied and the token has redirect-rule edit permission.
  • For deletion, prefer --id. If deleting by --name and --type, include --content when duplicates may exist.
  • Use --dry-run before apply-file on production zones.
  • Stop and ask for confirmation before deleting records or redirects unless the user already explicitly requested the exact deletion.
  • Keep comments and commit messages in English when editing this skill or its scripts.

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.