cdn — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited cdn (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation. Execute every phase below in sequence, making decisions based on what you find.
============================================================ PHASE 0 -- INPUT ============================================================
$ARGUMENTS may contain:
cloudfront, cloudflare, vercel, fastly, akamaiexample.com or app.example.com--edge -- set up edge functions/workers--terraform -- generate CDN config as Terraform (instead of provider-specific config)--spa -- optimize for single-page application (custom error responses, rewrites)--static -- optimize for static site (aggressive caching, no dynamic content)============================================================ PHASE 1 -- INFRASTRUCTURE DETECTION ============================================================
Scan the project to determine hosting and CDN needs:
Current hosting:
vercel.json, .vercel/netlify.toml, _redirectsamplify.ymlwrangler.toml, Cloudflare in Terraformnginx.conf, Caddyfile, Docker with reverse proxyApplication type:
next export, gatsby build, vite build, astro build -- output in dist/, out/, build/, .next/index.html entry pointAsset analysis:
public/ or static/ directory for static assetsmain.a1b2c3.js)Existing CDN:
x-cache, cf-cache-status, x-amz-cf-id============================================================ PHASE 2 -- CACHING STRATEGY ============================================================
Define cache rules based on content type:
Immutable assets (hashed filenames -- main.a1b2c3.js):
Cache-Control: public, max-age=31536000, immutableStatic assets (non-hashed -- /favicon.ico, /robots.txt):
Cache-Control: public, max-age=86400, stale-while-revalidate=604800max-age=31536000 (versioned by URL path)HTML pages:
Cache-Control: public, max-age=300, stale-while-revalidate=3600max-age=3600 (1 hour)API responses:
Cache-Control: private, no-cache, no-store, must-revalidatepublic, max-age=60, s-maxage=300Media:
Cache-Control: public, max-age=604800============================================================ PHASE 3 -- CDN CONFIGURATION ============================================================
Generate configuration for the detected/specified provider:
CloudFront (Terraform or console config):
resource "aws_cloudfront_distribution" "main" {
enabled = true
is_ipv6_enabled = true
default_root_object = "index.html"
aliases = [var.domain]
price_class = "PriceClass_100" # US, Canada, Europe
http_version = "http2and3"
origin {
domain_name = aws_s3_bucket.static.bucket_regional_domain_name
origin_id = "s3-static"
origin_access_control_id = aws_cloudfront_origin_access_control.main.id
}
default_cache_behavior {
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "s3-static"
cache_policy_id = aws_cloudfront_cache_policy.optimized.id
origin_request_policy_id = "88a5eaf4-2fd4-4709-b370-b4c650ea3fcf" # CORS-S3Origin
viewer_protocol_policy = "redirect-to-https"
compress = true
}
# API origin (if applicable)
origin {
domain_name = var.api_domain
origin_id = "api"
custom_origin_config {
http_port = 80
https_port = 443
origin_protocol_policy = "https-only"
origin_ssl_protocols = ["TLSv1.2"]
}
}
ordered_cache_behavior {
path_pattern = "/api/*"
target_origin_id = "api"
allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
cached_methods = ["GET", "HEAD"]
cache_policy_id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" # CachingDisabled
viewer_protocol_policy = "https-only"
compress = true
}
# SPA custom error response
custom_error_response {
error_code = 403
response_code = 200
response_page_path = "/index.html"
}
viewer_certificate {
acm_certificate_arn = var.certificate_arn
ssl_support_method = "sni-only"
minimum_protocol_version = "TLSv1.2_2021"
}
restrictions {
geo_restriction {
restriction_type = "none"
}
}
}Cloudflare (wrangler.toml + page rules or _headers):
name = "{project-name}"
compatibility_date = "2024-01-01"
[site]
bucket = "./dist"
[[headers]]
for = "/_next/static/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/api/*"
[headers.values]
Cache-Control = "no-store"Generate Cloudflare page rules or cache rules:
*.js, *.css: Cache Level = Cache Everything, Edge TTL = 1 year/api/*: Cache Level = Bypass*.html: Cache Level = Cache Everything, Edge TTL = 5 minutesVercel (vercel.json):
{
"headers": [
{
"source": "/(.*).js",
"headers": [
{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
]
},
{
"source": "/api/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "no-store" }
]
}
]
}Application-level headers (if no CDN config file available): Generate middleware to set Cache-Control headers in the application code.
============================================================ PHASE 4 -- SSL/TLS CONFIGURATION ============================================================
Ensure HTTPS is properly configured:
CloudFront + ACM:
aws_acm_certificate with DNS validationus-east-1 for CloudFrontCloudflare:
max-age=31536000; includeSubDomainsLet's Encrypt (self-hosted):
Generate security headers in CDN config:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 0
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'============================================================ PHASE 5 -- EDGE FUNCTIONS (if --edge) ============================================================
Generate edge function/worker for common patterns:
A/B testing:
Redirects:
_redirects file to edge functionGeolocation:
CF-IPCountry or CloudFront-Viewer-Country headerBot protection:
Image optimization:
============================================================ PHASE 6 -- CACHE INVALIDATION ============================================================
Set up cache invalidation for deployments:
CloudFront:
aws cloudfront create-invalidation \
--distribution-id $DISTRIBUTION_ID \
--paths "/*"/index.html, /about/index.html)Cloudflare:
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/purge_cache" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-d '{"purge_everything": true}'Vercel: automatic on deploy (no manual invalidation needed)
Generate CI/CD step for invalidation after deploy.
============================================================ PHASE 7 -- PERFORMANCE OPTIMIZATION ============================================================
Configure additional optimizations:
Link: <https://cdn.example.com>; rel=preconnect headers============================================================ SELF-HEALING VALIDATION (max 2 iterations) ============================================================
After completing deployment/infrastructure changes, validate:
IF STILL FAILING after 2 iterations:
============================================================ OUTPUT ============================================================
## CDN Configuration Complete
### Provider: {provider}
### Domain: {domain}
### Files Created
{list of files}
### Caching Rules
| Content Type | Cache Duration | Revalidation |
|-------------|---------------|--------------|
| Hashed assets (JS/CSS) | 1 year | Immutable |
| Static assets | 1 day | 7 day stale-while-revalidate |
| HTML pages | 5 minutes | 1 hour stale-while-revalidate |
| API responses | No cache | -- |
| Media files | 7 days | -- |
### Security Headers
{list of security headers configured}
### Cache Invalidation
{command or CI step to invalidate cache}
### Performance
- Compression: Brotli + Gzip
- Protocol: HTTP/2 + HTTP/3
- TLS: 1.2 minimum============================================================ NEXT STEPS ============================================================
curl -I https://yourdomain.com/asset.js -- check Cache-Control header============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /cdn — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
============================================================ DO NOT ============================================================
Cache-Control: no-cache when you mean no-store (no-cache still caches, just revalidates)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.