一键导入
gsp-scaffold
Set up the tech stack — install deps, configs, verify build — use when: set up the stack, install shadcn, init the project, scaffold, set up Tailwind
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up the tech stack — install deps, configs, verify build — use when: set up the stack, install shadcn, init the project, scaffold, set up Tailwind
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | gsp-scaffold |
| description | Set up the tech stack — install deps, configs, verify build — use when: set up the stack, install shadcn, init the project, scaffold, set up Tailwind |
Reads project config and stack state, installs dependencies, creates config files, installs component library primitives, and verifies the build compiles. Produces SCAFFOLD-LOG.md.
Works two ways:
/gsp-scaffold directly to set up a project's stack/gsp-project-build invokes this as Phase 1 before spawning builder agents
Input: config.json, STACK.md, install-manifest.md
Output: Working dev environment + {PROJECT_PATH}/build/SCAFFOLD-LOG.md
Agent: None — all commands run inline
Scan .design/projects/ for project directories. If only one project exists, use it. If multiple, ask the user which project to work on.
Set PROJECT_PATH = .design/projects/{project}
Read {PROJECT_PATH}/config.json to get:
preferences.implementation_target (shadcn, rn-reusables, existing, code)preferences.tech_stack (Next.js + Tailwind + shadcn/ui, etc.)preferences.codebase_type (greenfield, existing)preferences.app_path (relative path from repo root to the target app, e.g. apps/web)preferences.repo_type (single or monorepo)Set APP_PATH = value of app_path. If empty, default to . (repo root).
Derive APP_NAME = last segment of APP_PATH (e.g. apps/web → web, . → root).
If implementation_target is figma or skip, log "⚠️ No scaffold needed for target: {target}" and exit.
Read .design/system/stacks/{APP_NAME}.md if it exists — this is the per-app stack file for monorepos. Fall back to .design/system/STACK.md for legacy single-app setups (or when APP_NAME is root and the legacy file exists).
This workspace has a declared stack for this app. Enforce compliance before touching anything.
Read the live stack from components.json (if present) and package.json inside APP_PATH:
cd {APP_PATH} && npx shadcn@latest info --json (if shadcn target) → captures aliases, tailwindVersion, style, base, iconLibrarycd {APP_PATH} && node -e "console.log(require('tailwindcss/package.json').version)" → actual Tailwind versionCompare against STACK.md — flag any of these divergences:
| What to check | STACK.md field | Live source |
|---|---|---|
| Framework | ## Tech Stack → Framework | package.json dependencies |
| Tailwind version | ## Tech Stack → Styling | Installed tailwindcss version |
| shadcn alias | ## Key Paths → Components | shadcn info → aliases.components |
| shadcn style | (if recorded) | shadcn info → style |
| Icon library | (if recorded) | shadcn info → iconLibrary |
Gate on divergence:
⚠️ Stack compliance — divergence detected
STACK.md declares: aliases.components = @/components/ui
Live codebase has: aliases.components = ~/components/ui
Proceeding will write files to the wrong paths.
AskUserQuestion: "Stack divergence detected. Proceed anyway (may break imports), or stop to fix STACK.md first?"STACK.md and re-runsIf the stack file indicates the stack is already initialized (has framework, CSS, component library entries) and no divergence found, log existing state and skip to Step 4 (component installs).
Based on tech_stack and implementation_target, load the matching sibling and follow its setup commands. All shell commands run in APP_PATH (cd {APP_PATH} && ...). Check before overwriting — only create what's missing.
| Detected stack | Load |
|---|---|
Next.js + shadcn (codebase_type: greenfield or existing) | ${CLAUDE_SKILL_DIR}/stacks/nextjs-shadcn.md (covers both modes) |
| Vite + React | ${CLAUDE_SKILL_DIR}/stacks/vite-react.md |
| React Native + NativeWind | ${CLAUDE_SKILL_DIR}/stacks/react-native.md |
| Any web stack using Tailwind | also load ${CLAUDE_SKILL_DIR}/postcss-and-tailwind.md for PostCSS config + Tailwind v4 source scoping (shared) |
Read the relevant sibling(s) at this step (not before) — they're scoped to the detected stack and stay out of context when not needed.
Read preferences.icon_library from project config (defaults to lucide).
| Library | Action |
|---|---|
lucide | No install — ships with shadcn (lucide-react) |
phosphor | cd {APP_PATH} && {pkg-manager} add @phosphor-icons/react |
heroicons | cd {APP_PATH} && {pkg-manager} add @heroicons/react |
tabler | cd {APP_PATH} && {pkg-manager} add @tabler/icons-react |
If shadcn info already reports a different iconLibrary than the project config, log the divergence and use the project config's value (project config is the source of truth). Skip if app_path is empty (no codebase to install into).
Read {PROJECT_PATH}/brief/install-manifest.md if it exists.
Parse the manifest for:
npx shadcn@latest add ... or npx @react-native-reusables/cli add ...npm install ... commandsUse the all-in-one command if the manifest provides one (e.g., npx shadcn@latest add comp1 comp2 comp3).
If a batch install fails (e.g., one component doesn't exist in the registry), retry without the failing component(s):
Common registry gaps:
visually-hidden — removed from some shadcn styles/registries. Implement as a simple utility during foundations phase instead.Run additional dependency installs (npm install ...) separately from component installs. If a dependency fails, log it but continue.
Clear any build cache first (cd {APP_PATH} && rm -rf .next for Next.js), then run the build command in APP_PATH:
| Stack | Build command |
|---|---|
| Next.js | cd {APP_PATH} && npx next build |
| Vite | cd {APP_PATH} && npx vite build |
| TypeScript only | cd {APP_PATH} && npx tsc --noEmit |
| Generic | cd {APP_PATH} && npm run build |
Module not found: Can't resolve '...' with CSS class names in error → Tailwind v4 source scoping issue. Add source("../") to the @import "tailwindcss" directive in globals.cssjsx set to preserve instead of react-jsx → Next.js fixes this on first build, just re-runIf implementation_target is shadcn, run cd {APP_PATH} && npx shadcn@latest info --json and capture the output. This provides:
aliases — the actual alias prefix for imports (@/, ~/)tailwindVersion — "v4" (uses @theme inline) vs "v3" (uses tailwind.config.js)tailwindCssFile — the global CSS file where custom properties gostyle — component visual treatment (nova, vega, etc.)base — primitive library (radix or base)iconLibrary — determines icon imports (lucide-react, @tabler/icons-react, etc.)resolvedPaths — exact file-system destinations for components, utils, hooksframework — routing and file conventions (Next.js App Router, Vite SPA, etc.)isRSC — whether "use client" directives are neededInclude this JSON in the scaffold log under a ## Project Context section so the foundations agent can reference it.
Write {PROJECT_PATH}/build/SCAFFOLD-LOG.md:
# Scaffold Log
> Phase: build (scaffold) | Project: {name} | App: {APP_PATH} | Generated: {DATE}
## Stack
| Layer | Tool | Version |
|-------|------|---------|
| Framework | {e.g. Next.js} | {version} |
| CSS | {e.g. Tailwind CSS} | {version} |
| Components | {e.g. shadcn/ui} | {version} |
## Commands Run
| # | Command | Status |
|---|---------|--------|
| 1 | {command} | success / failed |
| ... | ... | ... |
## Components Installed
| Component | Source |
|-----------|--------|
| {name} | shadcn / rn-reusables / npm |
| ... | ... |
## Dependencies Added
{List of npm packages added}
## Build Verification
- **Command:** `{build command}`
- **Result:** {pass / fail}
- **Output:** {first/last lines if relevant}
## Project Context
{If shadcn target: JSON output from `npx shadcn@latest info --json`. Otherwise: "N/A — non-shadcn target"}
## Issues
{Any problems encountered and how they were resolved, or "None"}
◆ scaffold complete — stack verified
{PROJECT_PATH}/build/
└── SCAFFOLD-LOG.md
Stack: {tech_stack}
Build: {pass/fail}
Components: {count} installed
──────────────────────────────
Add reference material to a project — use when: add a reference, save inspiration, attach examples, link this site as reference, drop in a moodboard
Craft ASCII art interactively — you direct, the artist creates — use when: make ASCII art, terminal art, decorative banner, splash screen, hero ASCII
Audit an existing brand before evolving it — use when: audit our brand, what do we have, before a rebrand, brand health check, current brand state, brand inventory
Sync brand to match a project's shipped state — tokens, voice, visual patterns, personality — use when: brand drifted from the app, reverse-engineer the brand, the code is ahead of the brand docs, sync brand to shipped, update brand from production
Design color systems — palettes, contrast, semantic mapping, dark mode — use when: pick colors, build a palette, semantic tokens, dark mode pairings, brand color, accent color
Design icon systems — library selection, sizing, containers, custom SVG direction — use when: pick an icon library, icon sizing rules, icon containers, custom SVG direction, swap icons, icon strategy