agentleFS
passion4it-gmbhpassion4it-gmbh/passionfruit-site/.claude/skills/deploy/SKILL.md

deploy

Skill0 starsChanged 5 months agoMITView on GitHub

Set up deployment to Cloudflare Pages. Guides through account creation, API tokens, GitHub secrets, and verifies the first deploy.

  • Reads credentials
  • Sends data out
  • Commits and pushes

100 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use azure-kusto-graph, azure-kusto-irql and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    azure-kusto-graph

    Build and query Kusto graphs from natural language. Covers transient graphs (make-graph), persistent graph models/snapshots, pattern matching (graph-match), shortest paths, connected components, and graph-to-table export. Generates the edges-first thinking: define edges, define node lookups, union, make-graph. WHEN: make-graph, graph-match, graph-shortest-paths, graph-to-table, graph-mark-components, persistent graph, graph model, graph snapshot, build a graph from data, find paths between nodes, pattern matching in graph, connected components, transient graph, Kusto graph, KQL graph.

    Also in 3 projects that use this

  • MicrosoftSkill

    azure-kusto-irql

    Compose IRQL (Incident Response Query Language) queries for Kusto cybersecurity investigations. Translates natural language hunting questions into composable IRQL pipelines using Get_*, Extract_*, and Enrich_* functions. WHEN: IRQL query, security hunt, threat hunting KQL, incident response query, compose hunting pipeline, failed logins, phishing investigation, lateral movement, process execution, file creation events.

    Also in 3 projects that use this

  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 7 projects that use this

  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 3 projects that use this

  • +8 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the workflow file is missing, create it from the template (see bottom of this file).

    line 23
  2. Distinctive:

    Wait for confirmation before proceeding.

    line 35
  3. Distinctive:

    Wait for both the API token and Account ID.

    line 67
  4. Distinctive:

    If they have a custom domain, use that instead.

    line 100
  5. Very specific:

    If the user has gh CLI, run these automatically:

    line 106
  6. Distinctive:

    If the user wants to use their own domain:

    line 156
  7. Very specific:

    After adding a custom domain, update astro.config.mjs with the custom domain URL.

    line 167
  8. Distinctive:

    Wait for all three values before proceeding.

    line 208
  9. Very specific:

    Check CLOUDFLARE_PROJECT_NAME variable matches the project name in Cloudflare exactly

    line 257
  10. Very specific:

    Check CLOUDFLARE_API_TOKEN secret is set correctly

    line 261
  11. Distinctive:

    Verify the token has Cloudflare Pages Edit permission

    line 262
  12. Very specific:

    Check CLOUDFLARE_ACCOUNT_ID is correct

    line 263
  13. Very specific:

    Check that CLOUDFLARE_PROJECT_NAME variable is set (job is gated on it)

    line 272
  14. Very specific:

    Check the workflow file exists at .github/workflows/deploy.yml

    line 273
  15. Distinctive:

    Check the "Comment preview URL on PR" step in the workflow logs

    line 279

“Common” is measured: kept by at least 6 in 10 of the 85 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

Deploy to Cloudflare Pages

This skill sets up automatic deployment to Cloudflare Pages. Every push to main triggers a build and deploy.

When to trigger

  • User explicitly runs /deploy
  • User asks about hosting, deployment, or "putting the site online"

Prerequisites check

Before starting, verify:

  1. The GitHub repo exists and has a remote (git remote -v)
  2. The site builds locally (pnpm build)
  3. The deploy workflow exists at .github/workflows/deploy.yml

If the workflow file is missing, create it from the template (see bottom of this file).

Step 1: Cloudflare account

Ask:

"Do you have a Cloudflare account? (The free plan is all you need)"

Wait for confirmation before proceeding.

Step 2: Create the Cloudflare Pages project

Guide the user:

"Let's create your Cloudflare Pages project. Go to https://dash.cloudflare.com/ and:

  1. Click Workers & Pages in the left sidebar
  2. Click Create → Pages → Direct Upload (we deploy via GitHub Actions, not Git integration)
  3. Name your project (e.g., your company name in lowercase, like my-company)
  4. Upload any file to create the project (it will be overwritten on first deploy)

Tell me the project name you chose."

Save the project name — it's needed for the GitHub variable.

Step 3: Create API token

Guide the user:

"Now let's create an API token for GitHub to deploy with:

  1. Go to https://dash.cloudflare.com/profile/api-tokens
  2. Click Create Token
  3. Use the Cloudflare Pages — Edit template (or create custom with Account.Cloudflare Pages: Edit permission)
  4. Under Account Resources, select your account
  5. Click Continue to summary → Create Token
  6. Copy the token now — you won't see it again!

Also grab your Account ID from the Cloudflare dashboard sidebar (it's in the URL: dash.cloudflare.com/<account-id>/... or shown on the Workers & Pages overview page on the right side)."

Wait for both the API token and Account ID.

Step 4: Add secrets to GitHub

Guide the user:

"Now add these to your GitHub repository:

  1. Go to your repo → Settings → Secrets and variables → Actions
  2. Add these secrets (click New repository secret):
    • Name: CLOUDFLARE_API_TOKEN — Value: (paste your API token)
    • Name: CLOUDFLARE_ACCOUNT_ID — Value: (paste your account ID)
  3. Switch to the Variables tab and add:
    • Name: CLOUDFLARE_PROJECT_NAME — Value: <the project name from Step 2>

Tell me when that's done."

Alternatively, if the user has gh CLI:

gh secret set CLOUDFLARE_API_TOKEN
gh secret set CLOUDFLARE_ACCOUNT_ID
gh variable set CLOUDFLARE_PROJECT_NAME --body "<project-name>"

Step 5: Update the site URL

Once the user provides their Cloudflare Pages URL (or custom domain), update astro.config.mjs:

site: "https://<project-name>.pages.dev",

If they have a custom domain, use that instead. This URL is used for canonical links, sitemap, and OG tags.

Step 6: Configure repo settings for the PR workflow

passionfruit uses a PR-based workflow: open a PR → Cloudflare deploys a preview → review the preview → squash merge → production deploy. Configure the repo to enforce this.

If the user has gh CLI, run these automatically:

gh repo edit \
  --enable-squash-merge \
  --enable-merge-commit=false \
  --enable-rebase-merge=false \
  --enable-auto-merge \
  --delete-branch-on-merge \
  --squash-merge-commit-title=PR_TITLE \
  --squash-merge-commit-message=PR_BODY

Otherwise, guide them:

"Go to Settings → General → Pull Requests and:

  • ✅ Allow squash merging (default to 'Pull request title and description')
  • ❌ Allow merge commits
  • ❌ Allow rebase merging
  • ✅ Automatically delete head branches

Then Settings → Branches → Add branch protection rule for main:

  • ✅ Require a pull request before merging
  • ✅ Require status checks to pass (the CI workflow)
  • ✅ Require linear history"

Step 7: Trigger first deploy

git add -A
git commit -m "feat: configure Cloudflare Pages deployment"
git push

Then check the deployment:

"Your site is deploying! You can watch the progress at:

Once it's done (usually 1-2 minutes), your site will be live at: https://<project-name>.pages.dev

From now on: never push directly to main. Create a branch, open a PR, and Cloudflare will deploy a preview URL (commented on the PR automatically). Squash-merge to ship to production."

Step 8: Custom domain (optional)

If the user wants to use their own domain:

"Want to use your own domain? In the Cloudflare Pages dashboard:

  1. Go to your project → Custom domains
  2. Click Set up a custom domain
  3. Enter your domain (e.g., www.example.com)
  4. Cloudflare will guide you through DNS setup

If your domain is already on Cloudflare, it's automatic. Otherwise, you'll need to update your DNS records."

After adding a custom domain, update astro.config.mjs with the custom domain URL.

Step 9: Wire the contact form (optional)

Ask:

"Do you want a working contact form that delivers emails, or is the default mailto link fine for now?"

  • mailto is fine — stop here. The form works out of the box with a mailto: fallback; nothing to configure.
  • Working email delivery — proceed.

9a. Create a Turnstile widget

Using the API token and Account ID already collected in Steps 3–4, call the Cloudflare API to create a Turnstile widget for the site's domain. Replace <account_id>, <token>, and <site-domain> with the values you have:

curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/<account_id>/challenges/widgets" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"<project> contact","domains":["<site-domain>"],"mode":"managed"}'

From the response result, capture:

  • sitekey → used as PUBLIC_TURNSTILE_SITE_KEY
  • secret → used as TURNSTILE_SECRET_KEY

If the call returns 403: The token needs two additional scopes — Turnstile › Edit and Account Settings › Read. Either edit the existing token at https://dash.cloudflare.com/profile/api-tokens to add those scopes, or create the widget manually in the Cloudflare dashboard under Turnstile and copy the sitekey and secret from there.

9b. Collect provider details from the user

Ask:

"To send contact-form emails, I need three things:

  1. Brevo API key — from https://app.brevo.com → My account → SMTP & API → API Keys
  2. Sender address — a verified sender or domain in Brevo. Important: Brevo requires you to verify a sender address (or domain) before transactional emails will go through. You can verify one at https://app.brevo.com → Senders & IPs → Senders. This is the address that will appear in the From field.
  3. Recipient inbox — the email address where contact-form submissions should land.

This is the one step I can't automate — Brevo's sender verification requires a human to click a confirmation link."

Wait for all three values before proceeding.

9c. Set the Pages project env vars

Patch the Cloudflare Pages project with all six variables. Replace placeholders with real values:

curl -s -X PATCH "https://api.cloudflare.com/client/v4/accounts/<account_id>/pages/projects/<project_name>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "deployment_configs": {
      "production": {
        "env_vars": {
          "PUBLIC_FORM_ENDPOINT":       { "type": "plain_text",   "value": "/api/contact" },
          "PUBLIC_TURNSTILE_SITE_KEY":  { "type": "plain_text",   "value": "<sitekey>" },
          "BREVO_API_KEY":              { "type": "secret_text",  "value": "<brevo-api-key>" },
          "TURNSTILE_SECRET_KEY":       { "type": "secret_text",  "value": "<widget-secret>" },
          "CONTACT_RECIPIENT":          { "type": "secret_text",  "value": "<recipient-inbox>" },
          "CONTACT_SENDER":             { "type": "secret_text",  "value": "<verified-sender>" }
        }
      }
    }
  }'

Mirror the same block into preview if the user wants contact-form submissions to work on preview deployments too (replace "production" with "preview" and repeat the patch).

Important: PUBLIC_FORM_ENDPOINT and PUBLIC_TURNSTILE_SITE_KEY are build-time variables — Astro inlines them at build. The other four are read at request time by the Pages Function and can be updated without a rebuild. A new deploy is required to pick up the two PUBLIC_* values.

9d. Trigger a redeploy

Trigger a fresh build so Astro inlines the new PUBLIC_* values:

git commit --allow-empty -m "chore: trigger redeploy for contact-form env vars"
git push

Alternatively, the user can go to Cloudflare Pages → your project → Deployments → Retry deployment on the latest production deployment.

Once the build completes, the contact form will validate Turnstile tokens server-side and deliver submissions via Brevo.

Note: The passionfruit showcase at passionfruit.passion4it.de has CONTACT_RECIPIENT pointed at a passion4it inbox so the form is live. Full design rationale and implementation details are in docs/superpowers/specs/2026-06-08-contact-form-delivery-design.md.

Troubleshooting

Deploy fails with "Project not found":

  • Check CLOUDFLARE_PROJECT_NAME variable matches the project name in Cloudflare exactly

Deploy fails with "Authentication error":

  • Check CLOUDFLARE_API_TOKEN secret is set correctly
  • Verify the token has Cloudflare Pages Edit permission
  • Check CLOUDFLARE_ACCOUNT_ID is correct

Build succeeds but site shows old content:

  • Cloudflare Pages caches aggressively. Wait 1-2 minutes or purge cache in Cloudflare dashboard.

Deploy doesn't run on PR / no preview URL:

  • Deploy triggers on PRs against main AND pushes to main
  • Check that CLOUDFLARE_PROJECT_NAME variable is set (job is gated on it)
  • Check the workflow file exists at .github/workflows/deploy.yml
  • You can also manually trigger from Actions → Deploy → Run workflow

Preview URL not commented on PR:

  • The deploy job needs pull-requests: write permission (already set in template)
  • Check the "Comment preview URL on PR" step in the workflow logs

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.