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 picktesting
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".