Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计提醒

frontend-scaffold前端脚手架

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

192

周安装

8

GitHub Stars

11

下载量

64
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frontend-scaffold(前端脚手架)
来源仓库:https://github.com/parhumm/jaan-to
仓库路径:skills/frontend-scaffold
安装命令:
npx skills add https://github.com/parhumm/jaan-to --skill frontend-scaffold
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/parhumm/jaan-to --skill frontend-scaffold

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合处理 React、Next.js、Vue、Tailwind、CSS 等主流技术栈的代码生成与审查。
  • 可整理组件结构、定位布局问题,并建议性能优化方案。
  • 需结合项目现有设计系统和构建流程使用,避免生成孤立代码片段。
  • 涉及页面改动时应配合本地预览和构建检查确认实际效果。

SKILL.md

frontend-scaffold

Convert designs and specs into production-ready React/Next.js component scaffolds with typed API hooks.

Context Files

  • $JAAN_CONTEXT_DIR/tech.md - Tech stack context (CRITICAL — determines framework, styling, versions)

- Uses sections: #current-stack, #frameworks, #constraints

  • $JAAN_CONTEXT_DIR/design.md - Design system guidelines (optional)
  • $JAAN_CONTEXT_DIR/brand.md - Brand guidelines (optional)
  • $JAAN_TEMPLATES_DIR/jaan-to-frontend-scaffold.template.md - Output template
  • $JAAN_LEARN_DIR/jaan-to-frontend-scaffold.learn.md - Past lessons (loaded in Pre-Execution)
  • ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocol
  • ${CLAUDE_PLUGIN_ROOT}/docs/extending/frontend-ui-workflow-reference.md - Shared UI workflow reference (CSF3 format)

Input

Upstream Artifacts: $ARGUMENTS

Accepts 1-3 file paths or descriptions:

  • frontend-design — Path to HTML preview or component description (from /jaan-to:frontend-design output)
  • frontend-task-breakdown — Path to FE task breakdown (from /jaan-to:frontend-task-breakdown output)
  • backend-api-contract — Path to OpenAPI YAML (from /jaan-to:backend-api-contract output)
  • Empty — Interactive wizard
  • Cross-role: optionally consumes /jaan-to:ux-microcopy-write output

Pre-Execution Protocol

MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md Skill name: frontend-scaffold Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)

Also read context files if available:

  • $JAAN_CONTEXT_DIR/tech.md — Know the tech stack for framework-specific code generation
  • $JAAN_CONTEXT_DIR/design.md — Know the design system patterns
  • $JAAN_CONTEXT_DIR/brand.md — Know brand colors, fonts, tone

Language Settings

Read and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md Override field for this skill: language_frontend-scaffold

Language exception: Generated code output (variable names, code blocks, schemas, SQL, API specs) is NOT affected by this setting and remains in the project's programming language.

PHASE 1: Analysis (Read-Only)

Thinking Mode

ultrathink

Use extended reasoning for:

  • Analyzing design artifacts to derive component architecture
  • Mapping API contract schemas to TypeScript interfaces and hooks
  • Planning Server Component vs Client Component boundaries
  • Identifying accessibility requirements per component

Step 1: Validate & Parse Inputs

For each provided path:

  • frontend-design: Read HTML preview or component description, extract component list, layout, interactions
  • frontend-task-breakdown: Read markdown, extract component inventory, state matrices, estimates, dependencies
  • backend-api-contract: Read OpenAPI YAML, extract schemas for TypeScript interfaces, endpoints for API hooks
  • Report which inputs found vs missing; suggest fallback for missing

Present input summary:

INPUT SUMMARY
─────────────
Sources Found:    {list}
Sources Missing:  {list with fallback suggestions}
Components:       {extracted component names with atomic level}
API Endpoints:    {count from API contract}
TypeScript Types: {count derivable from schemas}

Step 2: Detect Tech Stack

Read $JAAN_CONTEXT_DIR/tech.md:

  • Extract frontend framework from #current-stack (default: React v19 + Next.js v15)
  • Extract styling approach (default: TailwindCSS v4)
  • Extract state management, testing tools
  • If tech.md missing: ask framework/styling via AskUserQuestion

Storybook detection (check alongside tech stack):

  • Glob:.storybook/main.* — Storybook installed?
  • Grep: "storybook" package.json — Storybook in devDependencies?
  • Glob: src/**/*.stories.tsx — Existing stories pattern?
  • If detected: set storybook_available = true (used in Steps 5, Phase 2 Output, Step 8)

Step 3: Design System Check

Read $JAAN_CONTEXT_DIR/design.md and $JAAN_CONTEXT_DIR/brand.md if available:

  • Extract color tokens, typography, spacing scale
  • Identify existing component patterns to extend
  • Note brand guidelines affecting component appearance

Step 4: Clarify Architecture

AskUserQuestion for items not in tech.md or design.md:

  • State management (TanStack Query only / + Zustand / + URL state via nuqs)
  • Routing (App Router / Pages Router / custom)
  • Testing (Vitest + Testing Library / Playwright / both)
  • Responsive strategy (mobile-first / desktop-first / adaptive)

Step 5: Plan Component Tree

Present component tree with atomic design levels:

COMPONENT TREE
══════════════

STACK: {framework} + {styling} + {state_management}

COMPONENTS ({count} total)
──────────────────────────
Atoms:     {list with estimates}
Molecules: {list with estimates}
Organisms: {list with estimates}
Templates: {list}
Pages:     {list}

API HOOKS ({count})
───────────────────
{list of TanStack Query hooks with endpoints}

TYPES ({count})
───────────────
{list of TypeScript interfaces from API schemas}

STORIES ({count} — if Storybook detected)
──────────────────────────────────────────
{list of CSF3 story files to generate, one per component}

HARD STOP — Review Scaffold Plan

Use AskUserQuestion:

  • Question: "Proceed with generating the frontend scaffold?"
  • Header: "Generate"
  • Options:

- "Yes" — Generate the scaffold code - "No" — Cancel - "Edit" — Let me revise the component tree or architecture first

Do NOT proceed to Phase 2 without explicit approval.


PHASE 2: Generation (Write Phase)

Phase 2 Output — Flat folder

All files in $JAAN_OUTPUTS_DIR/frontend/scaffold/{id}-{slug}/:

{id}-{slug}/
├── {id}-{slug}.md                     # Main doc (architecture + component map)
├── {id}-{slug}-components.tsx          # React components
├── {id}-{slug}-hooks.ts               # Typed API client hooks
├── {id}-{slug}-types.ts               # TypeScript interfaces from API schemas
├── {id}-{slug}-pages.tsx               # Page layouts / routes
├── {id}-{slug}-config.ts              # Package.json + tsconfig + tailwind config
├── {id}-{slug}-stories.tsx            # CSF3 Storybook stories (if Storybook detected)
├── {id}-{slug}-orval-config.ts         # → project root: orval.config.ts
├── {id}-{slug}-msw-handlers.ts         # → src/mocks/handlers.ts
├── {id}-{slug}-msw-browser.ts          # → src/mocks/browser.ts
├── {id}-{slug}-msw-server.ts           # → src/mocks/server.ts
└── {id}-{slug}-readme.md              # Setup + run instructions

Include Source → Destination mapping table in {id}-{slug}-readme.md for dev-output-integrate to consume.

Step 6.5: Generate API Integration Layer (if backend-api-contract provided)

When an API contract (OpenAPI spec) is available from inputs:

  1. Generate {id}-{slug}-orval-config.ts — Orval configuration:

- input.target: relative path to the spec file - output.client: 'react-query' (TanStack Query v5) - output.target: './src/lib/api/generated' - output.schemas: './src/lib/api/schemas' - output.mock: true (generates MSW handlers) - output.mode: 'tags-split'

  1. Generate {id}-{slug}-msw-handlers.ts — MSW request handlers from spec:

- For each endpoint: success handler (200/201), error handler (4xx/5xx with RFC 9457 shape) - Import pattern: import {http, HttpResponse} from 'msw'

  1. Generate {id}-{slug}-msw-browser.ts — MSW browser setup: import {setupWorker} from 'msw/browser'; import {handlers} from './handlers'; export const worker = setupWorker(...handlers);
  2. Generate {id}-{slug}-msw-server.ts — MSW Node.js server setup: import {setupServer} from 'msw/node'; import {handlers} from './handlers'; export const server = setupServer(...handlers);
  3. Update {id}-{slug}-config.ts: add to devDependencies: orval, msw, msw-storybook-addon. Add script: "generate:api": "orval --config./orval.config.ts".
Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/openapi-integration-reference.md for Orval config patterns, MSW handler patterns, and flat output conventions.

Step 7: Generate Content

Read $JAAN_TEMPLATES_DIR/jaan-to-frontend-scaffold.template.md and populate all sections based on Phase 1 analysis.

If tech stack needed, extract sections from tech.md:

  • Current Stack: #current-stack
  • Frameworks: #frameworks
  • Constraints: #constraints

Step 8: Quality Check

Validate generated output against checklist:

  • All components from task breakdown inventory generated
  • Server Components default; 'use client' only where needed
  • TypeScript interfaces match API contract schemas
  • TanStack Query hooks for client-side data fetching
  • Loading/error/empty/success states on all data components
  • Accessibility: ARIA, semantic HTML, keyboard nav
  • No anti-patterns present in generated code
  • Framework-implied build dependencies included (e.g., babel-plugin-react-compiler when reactCompiler: true)
  • CSF3 stories generated for each component (if storybook_available) — see ${CLAUDE_PLUGIN_ROOT}/docs/extending/frontend-ui-workflow-reference.md section "CSF3 Story Format Spec"

If any check fails, fix before preview.

Step 9: Preview & Approval

Present generated output summary. Use AskUserQuestion:

  • Question: "Write scaffold files to output?"
  • Header: "Write Files"
  • Options:

- "Yes" — Write the files - "No" — Cancel - "Refine" — Make adjustments first

Step 10: Generate ID and Folder Structure

source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/frontend/scaffold"
mkdir -p "$SUBDOMAIN_DIR"
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
slug="{project-name-slug}"
OUTPUT_FOLDER="${SUBDOMAIN_DIR}/${NEXT_ID}-${slug}"

Preview output configuration:

Output Configuration - ID: {NEXT_ID} - Folder: $JAAN_OUTPUTS_DIR/frontend/scaffold/{NEXT_ID}-{slug}/ - Main file: {NEXT_ID}-{slug}.md

Step 11: Write Output

  1. Create output folder: mkdir -p "$OUTPUT_FOLDER"
  2. Write all scaffold files to $OUTPUT_FOLDER
  3. Update subdomain index:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
  "$SUBDOMAIN_DIR/README.md" \
  "$NEXT_ID" \
  "${NEXT_ID}-${slug}" \
  "{Project Title}" \
  "{Executive summary — 1-2 sentences}"
  1. Confirm completion:
Scaffold written to: $JAAN_OUTPUTS_DIR/frontend/scaffold/{NEXT_ID}-{slug}/ Index updated: $JAAN_OUTPUTS_DIR/frontend/scaffold/README.md

Step 12: Suggest Next Actions

Scaffold generated successfully! Next Steps: - Copy scaffold files to your project directory - Run npm install to install dependencies - Run /jaan-to:frontend-story-generate to generate additional Storybook stories - Run /jaan-to:frontend-visual-verify to visually verify components (requires Playwright MCP) - Run /jaan-to:dev-output-integrate to integrate scaffold into project - Run /jaan-to:qa-test-cases to generate test cases

Step 13: Capture Feedback

Use AskUserQuestion:

  • Question: "How did the scaffold turn out?"
  • Header: "Feedback"
  • Options:

- "Perfect!" — Done - "Needs fixes" — What should I improve? - "Learn from this" — Capture a lesson for future runs

If "Learn from this": Run /jaan-to:learn-add frontend-scaffold "{feedback}"


Key Generation Rules (Research-Informed)

React 19 Patterns (CRITICAL — differs from React 18):

  • Server Components are default — only add 'use client' when needed
  • async/await in Server Components, NOT useEffect + useState
  • use(promise) with Suspense, NOT useEffect; never create promises during render (infinite loops)
  • ref is a regular prop, NOT forwardRef
  • React Compiler (stable v1.0, October 2025) handles memoization — no useMemo/useCallback/React.memo; enable in next.config.ts with {reactCompiler: true}; requires babel-plugin-react-compiler in devDependencies; up to 12% faster initial loads
  • useActionState + useFormStatus (must be in child component of <form>) for forms
  • Server Actions for mutations, ES6 default parameters (NOT defaultProps)
  • <Context.Provider> deprecated — use <Context> directly
  • ref callbacks support cleanup functions

TailwindCSS v4 Patterns:

  • CSS-first config: @import "tailwindcss" + @theme {} — NO tailwind.config.js
  • Dark mode: @custom-variant dark (&:where(.dark,.dark *)) + next-themes
  • cn() helper (clsx + tailwind-merge), OKLCH colors
  • v3→v4 breaking syntax: !bg-red-500bg-red-500! (suffix), @layer utilities@utility, bg-[--my-var]bg-(--my-var); requires Safari 16.4+, Chrome 111+, Firefox 128+
  • PostCSS uses @tailwindcss/postcss as single plugin — autoprefixer is built-in
  • Content detection is automatic (no content array)

Component Generation:

  • 4 states per data component: loading, error, empty, success
  • Atomic Design: Atoms -> Molecules -> Organisms -> Templates
  • Feature-based organization, aria-* on all interactive elements
  • Minimum 24x24px touch targets (WCAG 2.2 AA); 44x44px recommended (AAA / mobile guideline)
  • Use semantic HTML (<button>, <nav>, <main>) before ARIA; enforce with eslint-plugin-jsx-a11y

API Integration:

  • Orval v7 for TypeScript types + TanStack Query hooks from OpenAPI (ready-to-use useQuery/useMutation with auto-generated keys)
  • Alternative: openapi-typescript (~1.68M weekly downloads) generates only TypeScript types with zero runtime; companion openapi-fetch provides type-safe createClient<paths>() wrapper; requires manually writing TanStack Query hooks but offers more control
  • TanStack Query v5 for client-side fetching; HydrationBoundary for RSC → client data handoff (prefetch with queryClient.prefetchQuery(), dehydrate cache, wrap in <HydrationBoundary state={dehydrate(queryClient)}>)
  • Use queryOptions() factories for type-safe, reusable query definitions with hierarchical key factories
  • Separate generated API code into src/lib/api/generated/ — treated as dependency, never hand-edited
  • Add "generate:api": "orval --config./orval.config.ts" to package.json

State Management:

  • Server/API data → TanStack Query v5
  • Local state → useState/useReducer
  • Global client state → Zustand v5 (no Provider needed, ~1KB gzip); use targeted selectors to minimize re-renders
  • URL state → nuqs v2.5+ (used by Sentry, Supabase, Vercel); type-safe parsers, server-side via createLoader()
  • Form state → useActionState + useFormStatus
  • Optimistic UI → useOptimistic (React 19); instant UI feedback, auto-reconcile or rollback

Next.js 15 Caching:

  • fetch() defaults to no-store (was force-cache in v14); opt into caching with cache: 'force-cache' or next: {revalidate: 3600}
  • unstable_cache deprecated — use 'use cache' directive with cacheTag() and cacheLife()
  • Server Actions for internal mutations; Route Handlers (route.ts) for external consumers
  • ESLint 9 flat config (eslint.config.mjs) replaces .eslintrc.json

CSF3 Story Patterns (when storybook_available):

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/frontend-ui-workflow-reference.md for CSF3 format spec, CVA variant detection, argTypes controls, and state coverage matrix.
  • Generate one {ComponentName}.stories.tsx per component
  • Use Meta<typeof Component> + StoryObj<typeof meta> pattern
  • Cover: Default, Loading, Error, Empty, each CVA variant
  • Declarative args objects only (no render functions)
  • Match existing story conventions from project's *.stories.tsx files

Anti-Patterns to NEVER Generate

React 19: useEffect for data fetching, forwardRef, manual memoization (useMemo/useCallback/React.memo), defaultProps, PropTypes, <Context.Provider>

Next.js 15: 'use client' everywhere, API routes for internal mutations, unstable_cache (deprecated — use 'use cache' directive with cacheTag()/cacheLife()), next lint (removed in Next.js 16 — use ESLint CLI with eslint.config.mjs flat config)

TailwindCSS v4: tailwind.config.js, dynamic class construction, @tailwind directives, v3 bang syntax (!bg-red-500), @layer utilities

Accessibility: <div onClick>, missing alt, color-only indicators, missing form labels

Package Dependencies (Research-Validated)

Production: react ^19, react-dom ^19, next ^15, @tanstack/react-query ^5.60, zustand ^5, nuqs ^2.5, next-themes ^0.4, clsx ^2.1, tailwind-merge ^2.6, zod ^3.23, axios ^1.7

Dev: typescript ^5.7, @types/react ^19, @types/node ^22, @tailwindcss/postcss ^4, tailwindcss ^4, eslint ^9, prettier ^3.4, orval ^7, vitest ^2, @testing-library/react ^16, eslint-plugin-jsx-a11y, babel-plugin-react-compiler (when reactCompiler: true)


Skill Alignment

  • Two-phase workflow with HARD STOP for human approval
  • Framework-agnostic with tech.md detection
  • Template-driven output structure
  • Output to standardized $JAAN_OUTPUTS_DIR path

Definition of Done

  • All components from frontend-task-breakdown inventory generated
  • Server Components default; 'use client' only where needed
  • TypeScript interfaces from API contract schemas
  • TanStack Query hooks for client-side data fetching
  • Loading/error/empty/success states on all data components
  • Accessibility: ARIA, semantic HTML, keyboard nav
  • TailwindCSS v4 CSS-first config
  • Responsive mobile-first breakpoints
  • CSF3 stories generated per component (if Storybook detected)
  • Setup README complete
  • Output follows v3.0.0 structure
  • Index updated with executive summary
  • User approved final result

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.87%
按下载量换算25

Claude

27.05%
按下载量换算17

Cursor

18.76%
按下载量换算12

Gemini CLI

10.12%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills