scaffold
Create a new Next.js or Astro project on the bundled Cloudflare Workers stack with pnpm, Biome and Tailwind. Use for an empty target directory; skip existing applications and requests for a different stack.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 5
- Forks
- 0
01 前言 Front Matter
- name
- scaffold
- license
- MIT
- metadata
- { "author": "coroboros" }
- description
- Create a new Next.js or Astro project on the bundled Cloudflare Workers stack with pnpm, Biome and Tailwind. Use for an empty target directory; skip existing applications and requests for a different stack.
- compatibility
- Requires bash, jq, pnpm and a Node.js version accepted by the bundled preflight. Creates an empty-target Cloudflare project and installs its requested dependencies; provider activation and deployment require separate applicable authorization.
02 资源文件 28
- 参考文档evals/evals.json8.0 KB
- 参考文档references/astro-cloudflare-notes.md1.3 KB
- 参考文档references/decisions.md2.1 KB
- 参考文档references/setup-astro-cloudflare.md2.0 KB
- 参考文档references/setup-next-cloudflare.md1.9 KB
- 脚本scripts/overlay_templates.sh12.2 KB
- 脚本scripts/preflight.sh3.4 KB
- 脚本scripts/project-name.sh1.4 KB
- 脚本scripts/verify_scaffold.sh1.6 KB
- 参考文档templates/astro-cloudflare/AGENTS.md3.8 KB
- 其他templates/astro-cloudflare/astro.config.mjs.template397 B
- 其他templates/astro-cloudflare/index.astro.template277 B
- 参考文档templates/astro-cloudflare/scripts.json432 B
- 参考文档templates/astro-cloudflare/seo.md485 B
- 其他templates/astro-cloudflare/tsconfig.json.template42 B
- 其他templates/astro-cloudflare/wrangler.jsonc.template358 B
- 参考文档templates/next-cloudflare/AGENTS.md6.2 KB
- 其他templates/next-cloudflare/open-next.config.ts.template823 B
- 参考文档templates/next-cloudflare/scripts.json877 B
- 其他templates/next-cloudflare/wrangler.jsonc.template2.5 KB
- 其他templates/shared/biome.json.template1.1 KB
- 参考文档templates/shared/CLAUDE.md11 B
- 参考文档templates/shared/cloudflare-tooling.md1.8 KB
- 其他templates/shared/dev.vars.example61 B
- 其他templates/shared/gitignore421 B
- 其他templates/shared/node-version8 B
- 其他templates/shared/tailwind.css23 B
- 其他templates/shared/worktreeinclude435 B
03 SKILL.md 正文
Scaffold
Bootstrap the requested project with the opinionated stack.
The deterministic work — environment preflight, template overlay, package.json merge, post-scaffold verification — happens in three bundled scripts. Parse the invocation arguments, run the framework CLI, invoke the scripts in order, and turn their RESULT: lines into a concise report.
Available scaffolds
| Scaffold | Framework | Infra | Stack highlights |
|---|---|---|---|
next-cloudflare |
Next.js 16 (App Router) | Cloudflare Workers via OpenNext | Drizzle + Neon, Better-Auth, shadcn/ui, Vitest + Playwright |
astro-cloudflare |
Astro 6 (SSG-first, islands) | Cloudflare Workers | Zero JS by default, Content Collections, SEO rules |
Shared across all scaffolds: TypeScript strict, pnpm, Biome (no ESLint/Prettier), Tailwind CSS, .node-version 22.12.0.
If the user does not specify a scaffold or is ambiguous, show this table and ask which one.
Workflow
$SKILL_DIR = this skill's folder — ${CLAUDE_SKILL_DIR} in Claude Code, the directory containing this SKILL.md elsewhere.
1. Parse arguments
Extract {scaffold} and {project_name} from the invocation arguments. Aliases: next-cf → next-cloudflare, astro-cf → astro-cloudflare. Missing {scaffold} → show the Available scaffolds table and ask. Missing {project_name} → derive from cwd or ask. {project_dir} defaults to ..
2. Preflight
bash "$SKILL_DIR"/scripts/preflight.sh "{project_dir}" "{project_name}" → check RESULT: lines. Stop on error=invalid-project-name, error=invalid-cloudflare-service-name, or error=invalid-target-name and request the named constraint; on pnpm=no, jq=no, or node=no|too-old|unsupported, provide the official install or version remediation; on target=occupied, require an empty target including dotfiles. Continue only on ok=true.
3. Install
Per-scaffold steps (framework CLI, conflict removal, dependency installs, CSS-token setup): references/setup-{scaffold}.md. Then apply the shared overlay:
bash "$SKILL_DIR"/scripts/overlay_templates.sh "{scaffold}" "{project_name}" "{project_dir}"
Writes opinionated configs (biome.json, .worktreeinclude, canonical AGENTS.md, thin CLAUDE.md, .agents/rules/, .node-version, .dev.vars.example, wrangler.jsonc, framework configs), ensures Tailwind is imported, merges the shared rules into the generator's .gitignore, and applies the validated name plus scripts and module settings to package.json. Every publication uses a same-directory temporary file and rejects destination or parent symlinks. Idempotent — skips existing files unless --force; ok=partial → show the skipped list, ask whether to rerun or keep partial.
4. Verify and summarize
bash "$SKILL_DIR"/scripts/verify_scaffold.sh "{project_dir}" runs pnpm biome check --write . and pnpm typecheck. On failure, surface the first 60 diagnostic lines + a fix; do not mark the scaffold complete. On success, report files created and next steps: configure .dev.vars, optionally hand off to /award-design <brief> (award-level direction, then /design-system audit DESIGN.md) or /frontend-dev (everyday UI) when those skills are installed, then run pnpm dev.
Rules
- Use Biome for linting and formatting.
- Use ES modules (
"type": "module"). - Use pnpm.
- Treat
target=occupiedas a hard stop; this skill creates new projects only. - Preserve framework-generated
README.md; leave project-specific documentation and Git initialization to the user. - Read
"$SKILL_DIR"/references/decisions.mdonly when the brief requires an application decision beyond scaffolding. Record established choices; ask only for a material unresolved decision. Do not add a mandatory questionnaire after a completed scaffold.
astro-cloudflare specifics
When scaffolding astro-cloudflare or later editing its astro.config.mjs / wrangler.jsonc, read "$SKILL_DIR"/references/astro-cloudflare-notes.md — covers imageService, assets.directory, the pre-build shim, and the Sharp pitfall.
04 同仓库更多 Skills
foo
Fixture skill for repo-kind classifier tests.
foo
Fixture for compound skills + npm tooling detection.
write-clear-readme
Author, restructure, audit or polish a project README for clarity and scannability. Reads repository truth, preserves anchors and code, and verifies rendering. Explicit author/polish requests apply local changes; audit/propose stays read-only. Use for README creation, wording, structure and navigation, including skill collections and CLI/SDK docs.
video-loop
Prepare a background video loop for a website with optional crossfade, MP4/WebM encoding and poster extraction. Use for loop joins or web delivery of an existing clip.
ultrapex
Adaptive implementation when the user explicitly selects /ultrapex or asks for this adaptive workflow. Establish accepted outcomes, implement, and verify the final result. Generic implementation requests use /apex; use /forge for decisions only and /oneshot for small focused changes.
suno-produce
Create and revise Suno v5.5 prompt artifacts from a song, track or album brief. Produces TRACK.md, ALBUM.md for explicit multi-track work, and optional ARTIST.md identity. Validates prompt fields and preserves supplied lyrics. Artifact-only; audio generation stays in Suno. Pure lyric writing and audio post-production use other skills.