Serves sites and reverse proxies with Caddy: Caddyfile authoring, automatic HTTPS, file servers, and reloads.
Agentic Workflow: Read -> Reason -> Act (caddy)
You are Caddy (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for caddy
- Domain: Serves sites and reverse proxies with Caddy: Caddyfile authoring, automatic HTTPS, file servers, and reloads.
- serve: Run Caddy as a file server or site server. —
caddy run - config: Validate and adapt Caddyfile configs. —
caddy validate --config Caddyfile - tls: Manage automatic HTTPS and certificates. —
caddy cert-manager list - Check
knowledgeandprerequisites: caddy
2. Reason — think for caddy
- For
serve: Run Caddy as a file server or site server. — decide which checks to run - For
config: Validate and adapt Caddyfile configs. — decide which checks to run - For
tls: Manage automatic HTTPS and certificates. — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with caddy tools
- Tools:
Glob,Grep,Read,Caddy,Bash(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
caddy:aca2a9bd
Caddy
What this skill does
Serves sites and proxies with Caddy: Caddyfile authoring, automatic HTTPS with Let's Encrypt, static file serving, reverse proxying, and safe reloads.
When to use
- Stand up a static site with HTTPS in seconds
- Reverse-proxy an API with automatic TLS
- Replacing nginx config complexity
Real commands
# Serve static files
caddy file-server --root ./dist --listen :8080
# Reverse proxy
caddy reverse-proxy --from localhost:8080 --to localhost:3000
# Run with a Caddyfile
caddy run --config Caddyfile
# Validate before reload
caddy validate --config Caddyfile
caddy reload --config Caddyfile
# Format the Caddyfile
caddy fmt --overwrite Caddyfile
Caddyfile example
api.your-app.test {
reverse_proxy localhost:3000
encode gzip zstd
header Cache-Control "max-age=3600"
}
Testing
- caddy validate catches syntax errors pre-reload
- curl -sI to verify headers and certs
Best practices
- Use caddy fmt for consistent formatting
- Keep Caddyfiles in version control; caddy reload is zero-downtime
- Let Caddy manage TLS; don't hand-manage certs unless needed
Capabilities
serve
Run Caddy as a file server or site server.
Parameters:
root(string): Document rootlisten(string): Listen addressconfig(string): Caddyfile path
Commands:
caddy runcaddy file-server --root ./public --listen :8080caddy reverse-proxy --from localhost:8080 --to localhost:3000caddy run --config Caddyfilecaddy stop
Examples:
- caddy file-server --root ./dist --listen :8080 --browse
- caddy reverse-proxy --from api.your-app.test --to localhost:3000
- caddy run --watch --config Caddyfile
config
Validate and adapt Caddyfile configs.
Parameters:
config(string): Caddyfile pathpretty(boolean): Pretty-print adapted JSON
Commands:
caddy validate --config Caddyfilecaddy adapt --config Caddyfilecaddy adapt --config Caddyfile --prettycaddy fmt Caddyfilecaddy reload --config Caddyfile
Examples:
- caddy validate --config Caddyfile
- caddy adapt --config Caddyfile --pretty > caddy.json
- caddy fmt --overwrite Caddyfile
tls
Manage automatic HTTPS and certificates.
Parameters:
domain(string): Domain for cert managementca(string): CA file path
Commands:
caddy cert-manager listcaddy trustcaddy untrustcurl -sI https://localhost:8443 | head -5caddy list-modules | grep tls
Examples:
- caddy trust --ca /etc/caddy/ca.crt
- caddy cert-manager list --domain api.your-app.test
- caddy list-modules | grep -i tls