skills/new-astro-app/SKILL.md
--- name: new-astro-app description: Orchestrate scaffolding a new Astro app on the canonical stack (Astro 5 + `output: 'server'` on @astrojs/cloudflare + Sentry EU + PostHog EU + pnpm). For marketing/landing/portfolio sites where most pages are static and only a thin runtime exists for /api routes. Sister skill to /ro:new-tanstack-app — Astro path of the stack-decision-map's "App shape → Marketing site / static-leaning" leaf. Dispatches to /ro:sentry, /ro:posthog, /ro:cloudflare-dns, /ro:cf-shi
npx skillsauth add RonanCodes/ronan-skills skills/new-astro-appInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scaffolds a new Astro 5 site on Cloudflare Workers using the same stack as the sister /ro:new-tanstack-app. Output mode 'server' with prerender-by-default for marketing pages, observability via Sentry + PostHog (EU region for both), pnpm-pinned, GitHub Actions deploy on merge to main.
/ro:new-astro-app my-site --posthog --sentry --domain my-site.com
/ro:new-astro-app my-site --interactive
/ro:new-astro-app my-site --no-i18n --skip-deploy
Sub-flags map to the same dispatched sub-skills as the TanStack orchestrator. See /ro:new-tanstack-app for --posthog, --sentry, --uptime, --domain semantics — they're identical here, just running against an Astro project tree.
@astrojs/cloudflare adapter with output: 'server', imageService: 'compile', platformProxy: { enabled: true }/api/config) so DSN + PostHog phc_ aren't baked into the bundle--no-i18n to skip)packageManager field pin, pnpm.onlyBuiltDependencies allowlist for @sentry/cli, esbuild, sharp, workerdprettier-plugin-astro + Vitest + Playwright + the smoke e2e tests[[astro-cf-workers-migration-gotchas]] from day onemain/ro:cf-ship and binds the custom domain via /ro:cloudflare-dnsCLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID. The skill sources via $(ro context env), so context resolves automatically from a .ro-context file at the repo root (cleanest), a cwd-glob rule in ~/.claude/contexts.json, or a manual ro context use <name> override. If credentials are missing, run /ro:cloudflare-setup first.--sentry: SENTRY_AUTH_TOKEN, SENTRY_ORG (use sntrys_ org-scoped token in CI; sntryu_ user token for project create)--posthog: POSTHOG_PERSONAL_API_KEY (phx_ admin), region host--interactive)Same flow as /ro:new-tanstack-app --interactive: walk through the project's open questions one by one with AskUserQuestion. Astro-specific decisions:
nl, de, etc. when the audience demands it.src/content/ (the built-in collections — recommended for blogs / case studies) vs no content layer (pages-only)./ro:sentry "Footer-attached feedback button" section). This is a hard default; don't ask.pnpm create astro@latest <app-name> -- --template minimal --typescript strict --git --install
cd <app-name>
/ro:harden-npmRun immediately after scaffold. Locks in pnpm 11 defaults (minimumReleaseAge=1440, strictDepBuilds=true, blockExoticSubdeps=true), pins packageManager to current pnpm in package.json (replaces the old hardcoded corepack use [email protected] step), writes per-repo .npmrc, installs husky pre-push.
/ro:harden-npm
Background: Mini Shai-Hulud v2 (CVE-2026-45321). See llm-wiki-security/wiki/playbooks/npm-supply-chain-hardening.md.
pnpm add @astrojs/cloudflare sharp posthog-js @sentry/browser
pnpm add -D @sentry/vite-plugin wrangler
Edit astro.config.mjs:
import { defineConfig } from "astro/config";
import cloudflare from "@astrojs/cloudflare";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { execSync } from "node:child_process";
const release = (() => {
if (process.env.VITE_RELEASE) return process.env.VITE_RELEASE;
try { return execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim(); }
catch { return "dev"; }
})();
const sentryAuthToken = process.env.SENTRY_AUTH_TOKEN;
const sentryPlugin = sentryAuthToken ? sentryVitePlugin({ /* ... see /ro:sentry */ }) : null;
export default defineConfig({
output: "server",
adapter: cloudflare({
imageService: "compile", // gotcha #3 — don't use 'passthrough' with assets binding
platformProxy: { enabled: true },
}),
vite: {
define: { __APP_RELEASE__: JSON.stringify(release) },
build: { sourcemap: true },
plugins: [...(sentryPlugin ? [sentryPlugin] : [])],
},
});
Add to package.json:
{
"packageManager": "[email protected]",
"scripts": {
"build": "astro build",
"postbuild": "echo _worker.js > dist/.assetsignore", // gotcha #4
"deploy": "pnpm run build && wrangler deploy",
// ... format / lint / typecheck / test / test:e2e / quality-checks:ci
},
"pnpm": {
"onlyBuiltDependencies": ["@sentry/cli", "esbuild", "sharp", "workerd"]
}
}
Create wrangler.jsonc:
{
"name": "<app-name>",
"compatibility_date": "<today>",
"compatibility_flags": ["nodejs_compat"],
"main": "./dist/_worker.js/index.js",
"assets": { "directory": "./dist", "binding": "ASSETS" },
"observability": { "enabled": true },
"routes": [
{ "pattern": "<host>", "custom_domain": true },
{ "pattern": "www.<host>", "custom_domain": true }
],
"vars": {
"SENTRY_DSN": "",
"POSTHOG_PROJECT_KEY": "",
"POSTHOG_INGEST_HOST": "https://eu.i.posthog.com"
}
}
Astro 5 with output: 'server' defaults to dynamic. Marketing sites should prerender by default; only /api/* runs at the edge:
find src/pages -name "*.astro" -not -path "*/api/*" \
| while read f; do
grep -q "export const prerender" "$f" && continue
awk 'NR==1{print; print "export const prerender = true;"; next} 1' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
done
Run this after every new page is added too — bake it into the project's pre-commit hook or document it in CLAUDE.md.
--sentry or --posthog)Copy from the canonical reference (ronanconnolly-dev):
src/lib/runtime-config.ts — fetches /api/config, memoisedsrc/lib/sentry.ts — lazy init, EU region, replay + feedback (see /ro:sentry for the full file). Footer-attached feedback button is the Ronan default — autoInject: false + attachTo wiring on every project.src/lib/posthog.ts — lazy init, EU ingest, autocapture, session recording, test-user filter (uses @<your-domain> test emails so the project's "Internal & Test Accounts" filter excludes them with one rule)src/pages/api/config.ts — returns SENTRY_DSN, POSTHOG_PROJECT_KEY, POSTHOG_INGEST_HOST from locals.runtime.env, cached 5minpnpm add -D \
prettier prettier-plugin-astro \
eslint @eslint/js typescript-eslint eslint-plugin-astro globals \
@astrojs/check typescript \
vitest jsdom @types/jsdom \
@playwright/test
Configs (mirror the simplicity-labs-site reference repo verbatim — they bake in gotchas #1, #9, #10):
prettier.config.js (with prettier-plugin-astro).prettierignore (always include .claude/, wiki/, CLAUDE.md, README.md, TASKS.md — gotcha #9)eslint.config.js (flat config with globals.browser + globals.node — gotcha #10)playwright.config.ts (webServer: pnpm exec astro dev --port 4321)vitest.config.ts (jsdom env)e2e/homepage.spec.ts (smoke: every key route renders without console errors)--sentry / --posthog)Dispatch:
--sentry → /ro:sentry project create --name <app-name> to mint the project + DSN, then write SENTRY_DSN into ~/.claude/.env--posthog → /ro:posthog project create --name "<App Name>" for the phc_, write to envFor both, follow /ro:sentry's guidance on footer-attached feedback button — autoInject:false + footer trigger. Every Ronan Astro app has the same UX.
--uptime, post-deploy)/ro:uptimerobot monitor create --url https://<host>/ --type http --interval 5 — same as TanStack flow.
--skip-ci)Write .github/workflows/ci.yml with three jobs (mirror simplicity-labs-site/.github/workflows/ci.yml):
quality (format + lint + typecheck + build + test)e2e (Playwright, depends on quality)deploy (depends on both, gated on main push, environment: Production)Deploy job:
- run: >
pnpm exec wrangler deploy
--var SENTRY_DSN:"$SENTRY_DSN"
--var POSTHOG_PROJECT_KEY:"$POSTHOG_PROJECT_KEY"
--var POSTHOG_INGEST_HOST:"$POSTHOG_INGEST_HOST"
Public-by-design keys ride in via --var, not wrangler secret put.
--domain <host>, always unless --skip-deploy)For a fresh project (no existing DNS displaces), the wrangler routes: [{ custom_domain: true }] block plus /ro:cloudflare-dns for any extra subdomains is enough. If the domain already has VPS-pointing records, dispatch to /ro:migrate-to-astro instead — the cutover sequence is different.
/ro:cf-ship # build + deploy
/ro:cloudflare-dns add www.<host> <ip> # only if extra subdomains needed
/ro:commitSingle commit with the standard emoji-conventional format.
After this skill runs the project should:
pnpm quality-checks:ci exits 0pnpm exec wrangler deploy exits 0, hostname+www both bound/api/config returns the DSN + phc_, no /_image?... URLs in HTML, no /favicon.svg 404simageService: "passthrough" (gotcha #3 — breaks <Image>)prerender = true on marketing pages (gotcha #11)PUBLIC_* env vars) — use runtime-configronanconnolly.dev / personal email in JSON-LD or footer copydist/.assetsignore postbuild step (gotcha #4)[[astro-cf-workers-migration-gotchas]] (LLM wiki research vault) — the twelve gotchas this skill bakes in/ro:migrate-to-astro — when there's an existing site to port/ro:new-tanstack-app — when the project actually needs a server runtime, not just a marketing surface[[stack-decision-map]] — when you're not sure which to pickdevelopment
Close the loop on a Linear ticket when its work ships - move the status and post a deploy comment with the PR link, what shipped, and a try-it link, mentioning the collaborator. Used as the tail of /ro:linear-nightshift for every merged mirror, or manually after an ad-hoc build. Triggers on "linear update", "update the linear ticket", "mark NUT-x done", "tell eoin it shipped", "/ro:linear-update".
devops
Run a night-shift against a collaborator's Linear board. Pulls the team's Grilled tickets (/ro:linear-grill moves a ticket to Grilled once its questions are answered), VERIFIES the questions were actually answered (unanswered → bounce the ticket to the "Question for <name>" state), mirrors verified tickets to ephemeral GitHub issues with ready-for-agent, then runs the standard /ro:night-shift machinery on GitHub. Tail-calls /ro:linear-update for everything that merged + deployed. Triggers on "linear nightshift", "nightshift linear", "drain the linear board", "run the shift off linear", "/ro:linear-nightshift".
development
Grill a collaborator's Linear tickets and move every processed ticket to where it belongs. Resolves the board from the repo's .ro-linear.json, reads the collaborator's Backlog / Ready-for-agent issues, then per ticket either posts 3-5 decision-extracting questions (state moves to "Question for <name>") or confirms it build-ready (state moves to "Grilled", the gate /ro:linear-nightshift consumes); shipped-and-confirmed tickets close as Done. The async-collaborator counterpart of /ro:day-shift for people who never touch GitHub. Triggers on "grill linear", "grill eoin's tickets", "linear grill", "add questions to the linear tickets", "/ro:linear-grill".
development
--- name: about-page description: Add a standard About page to any web app, what it is, the tech stack, and an FAQ, wired into a footer link with a sticky footer. Built with Spartan + Tailwind (the canonical component layer) and falls back to semantic HTML so it ships reliably. Use whenever building, polishing, or shipping an app, every app should have one. Triggers on "add an about page", "about page", "footer about link", or as a standard step in app build/polish. category: frontend argument-h