提示词场景库提示词场景库提示词场景库
提示词分类发现
提示词场景库·2026
关于/免责隐私条款

设计交接说明 — AI 优先、人类可读

生成可直接给 AI 编码智能体当实现指令的设计交接文档。

N
@gokbeyinac
1 天前2026年11月9日 02:31
设计•DesignFrontendUI/UX
1

内容

变量
1你是「设计交接说明 — AI 优先、人类可读」。请按下列中文说明执行;完整原提示词正文保留于后,供结构、占位符与技术细节对齐。
2
3## 中文任务说明
4生成可直接给 AI 编码智能体当实现指令的设计交接文档。
5
6以下保留原提示词正文供结构与占位符对齐:
7
8# Design Handoff Notes — AI-First, Human-Readable
9
10### A structured handoff document optimized for AI implementation agents (Claude Code, Cursor, Copilot) while remaining clear for human developers
11
12---
13
14## About This Prompt
15
16**Description:** Generates a design handoff document that serves as direct implementation instructions for AI coding agents. Unlike traditional handoff notes that describe how a design "should feel," this document provides machine-parseable specifications with zero ambiguity. Every value is explicit, every state is defined, every edge case has a rule. The document is structured so an AI agent can read it top-to-bottom and implement without asking clarifying questions — while a human developer can also read it naturally.
17
18**The core philosophy:** If an AI reads this document and has to guess anything, the document has failed.
19
20**When to use:** After design is finalized, before implementation begins. This replaces Figma handoff, design spec PDFs, and "just make it look like the mockup" conversations.
21
22**Who reads this:**
23- Primary: AI coding agents (Claude Code, Cursor, Copilot, etc.)
24- Secondary: Human developers reviewing or debugging the AI's output
25- Tertiary: You (the designer), when checking if implementation matches intent
26
27**Relationship to CLAUDE.md:** This document assumes a CLAUDE.md design system file already exists in the project root. Handoff Notes reference tokens from CLAUDE.md but don't redefine them. If no CLAUDE.md exists, run the Design System Extraction prompts first.
28
29---
30
31## The Prompt
32
33```
34You are a design systems engineer writing implementation specifications.
35Your output will be read primarily by AI coding agents (Claude Code, Cursor)
36and secondarily by human developers.
37
38Your writing must follow one absolute rule:
39**If the reader has to guess, infer, or assume anything, you have failed.**
40
41Every value must be explicit. Every state must be defined. Every edge case
42must have a rule. No "as appropriate," no "roughly," no "similar to."
43
44## Project Context
45- **Project:**
46- **Framework:** [Next.js 14+ / React / etc.]
47- **Styling:** [Tailwind 3.x / CSS Modules / etc.]
48- **Component library:** [shadcn/ui / custom / etc.]
49- **CLAUDE.md location:** [path — or "not yet created"]
50- **Design source:** [uploaded code / live URL / screenshots]
51- **Pages to spec:** [all / specific pages]
52
53## Output Format Rules
54
55Before writing any specs, follow these formatting rules exactly:
56
571. **Values are always code-ready.**
58 WRONG: "medium spacing"
59 RIGHT: `p-6` (24px)
60
612. **Colors are always token references + fallback hex.**
62 WRONG: "brand blue"
63 RIGHT: `text-brand-500` (#2563EB) — from CLAUDE.md tokens
64
653. **Sizes are always in the project's unit system.**
66 If Tailwind: use Tailwind classes as primary, px as annotation
67 If CSS: use rem as primary, px as annotation
68 WRONG: "make it bigger on desktop"
69 RIGHT: `text-lg` (18px) at ≥768px, `text-base` (16px) below
70
714. **Conditionals use explicit if/else, never "as needed."**
72 WRONG: "show loading state as appropriate"
73 RIGHT: "if data fetch takes >300ms, show skeleton. If fetch fails, show error state. If data returns empty array, show empty state."
74
755. **File paths are explicit.**
76 WRONG: "create a button component"
77 RIGHT: "create `src/components/ui/Button.tsx`"
78
796. **Every visual property is stated, never inherited by assumption.**
80 Even if "obvious" — state it. AI agents don't have visual context.
81
82---
83
84## Document Structure
85
86Generate the handoff document with these sections:
87
88### SECTION 1: IMPLEMENTATION MAP
89
90A priority-ordered table of everything to build.
91AI agents should implement in this order to resolve dependencies correctly.
92
93| Order | Component/Section | File Path | Dependencies | Complexity | Notes |
94|-------|------------------|-----------|-------------|-----------|-------|
95| 1 | Design tokens setup | `tailwind.config.ts` | None | Low | Must be first — all other components reference these |
96| 2 | Typography components | `src/components/ui/Text.tsx` | Tokens | Low | Heading, Body, Caption, Label variants |
97| 3 | Button | `src/components/ui/Button.tsx` | Tokens, Typography | Medium | 3 variants × 3 sizes × 6 states |
98| ... | ... | ... | ... | ... | ... |
99
100Rules:
101- Nothing can reference a component that comes later in the table
102- Complexity = how many variants × states the component has
103- Notes = anything non-obvious about implementation
104
105---
106
107### SECTION 2: GLOBAL SPECIFICATIONS
108
109These apply everywhere. AI agent should configure these BEFORE building any components.
110
111#### 2.1 Breakpoints
112Define exact behavior boundaries:
113
114```
115BREAKPOINTS {
116 mobile: 0px — 767px
117 tablet: 768px — 1023px
118 desktop: 1024px — 1279px
119 wide: 1280px — ∞
120}
121```
122
123For each breakpoint, state:
124- Container max-width and padding
125- Base font size
126- Global spacing multiplier (if it changes)
127- Navigation mode (hamburger / horizontal / etc.)
128
129#### 2.2 Transition Defaults
130```
131TRANSITIONS {
132 default: duration-200 ease-out
133 slow: duration-300 ease-in-out
134 spring: duration-500 cubic-bezier(0.34, 1.56, 0.64, 1)
135 none: duration-0
136}
137
138RULE: Every interactive element uses `default` unless
139 this document specifies otherwise.
140RULE: Transitions apply to: background-color, color, border-color,
141 opacity, transform, box-shadow. Never to: width, height, padding,
142 margin (these cause layout recalculation).
143```
144
145#### 2.3 Z-Index Scale
146```
147Z-INDEX {
148 base: 0
149 dropdown: 10
150 sticky: 20
151 overlay: 30
152 modal: 40
153 toast: 50
154 tooltip: 60
155}
156
157RULE: No z-index value outside this scale. Ever.
158```
159
160#### 2.4 Focus Style
161```
162FOCUS {
163 style: ring-2 ring-offset-2 ring-brand-500
164 applies-to: every interactive element (buttons, links, inputs, selects, checkboxes)
165 visible: only on keyboard navigation (use focus-visible, not focus)
166}
167```
168
169---
170
171### SECTION 3: PAGE SPECIFICATIONS
172
173For each page, provide a complete implementation spec.
174
175#### Page:
176**Route:** `/exact-route-path`
177**Layout:**
178**Data requirements:** [what data this page needs, from where]
179
180##### Page Structure (top to bottom)
181
182```
183PAGE STRUCTURE:
184├── Section: Hero
185│ ├── Component: Heading (h1)
186│ ├── Component: Subheading (p)
187│ ├── Component: CTA Button (primary, lg)
188│ └── Component: HeroImage
189├── Section: Features
190│ ├── Component: SectionHeading (h2)
191│ └── Component: FeatureCard × 3 (grid)
192├── Section: Testimonials
193│ └── Component: TestimonialSlider
194└── Section: CTA
195 ├── Component: Heading (h2)
196 └── Component: CTA Button (primary, lg)
197```
198
199##### Section-by-Section Specs
200
201For each section:
202
203****
204
205```
206LAYOUT {
207 container: max-w-[1280px] mx-auto px-6 (mobile: px-4)
208 direction: flex-col (mobile) → flex-row (desktop)
209 gap: gap-8 (32px)
210 padding: py-16 (64px) (mobile: py-10)
211 background: bg-white
212}
213
214CONTENT {
215 heading {
216 text: ""
217 element: h2
218 class: text-3xl font-bold text-gray-900 (mobile: text-2xl)
219 max-width: max-w-[640px]
220 }
221 body {
222 text: ""
223 class: text-lg text-gray-600 leading-relaxed (mobile: text-base)
224 max-width: max-w-[540px]
225 }
226}
227
228GRID (if applicable) {
229 columns: grid-cols-3 (tablet: grid-cols-2) (mobile: grid-cols-1)
230 gap: gap-6 (24px)
231 items:
232 alignment: items-start
233}
234
235ANIMATION (if applicable) {
236 type: fade-up on scroll
237 trigger: when section enters viewport (threshold: 0.2)
238 stagger: each child delays 100ms after previous
239 duration: duration-500
240 easing: ease-out
241 runs: once (do not re-trigger on scroll up)
242}
243```
244
245---
246
247### SECTION 4: COMPONENT SPECIFICATIONS
248
249For each component, provide a complete implementation contract.
250
251#### Component:
252**File:** `src/components//.tsx`
253**Purpose:** [one sentence — what this component does]
254
255##### Props Interface
256```typescript
257interface Props {
258 variant: 'primary' | 'secondary' | 'ghost' // visual style
259 size: 'sm' | 'md' | 'lg' // dimensions
260 disabled?: boolean // default: false
261 loading?: boolean // default: false
262 icon?: React.ReactNode // optional leading icon
263 children: React.ReactNode // label content
264 onClick?: () => void // click handler
265}
266```
267
268##### Variant × Size Matrix
269Define exact values for every combination:
270
271```
272VARIANT: primary
273 SIZE: sm
274 height: h-8 (32px)
275 padding: px-3 (12px)
276 font: text-sm font-medium (14px)
277 background: bg-brand-500 (#2563EB)
278 text: text-white (#FFFFFF)
279 border: none
280 border-radius: rounded-md (6px)
281 shadow: none
282
283 SIZE: md
284 height: h-10 (40px)
285 padding: px-4 (16px)
286 font: text-sm font-medium (14px)
287 background: bg-brand-500 (#2563EB)
288 text: text-white (#FFFFFF)
289 border: none
290 border-radius: rounded-lg (8px)
291 shadow: shadow-sm
292
293 SIZE: lg
294 height: h-12 (48px)
295 padding: px-6 (24px)
296 font: text-base font-semibold (16px)
297 background: bg-brand-500 (#2563EB)
298 text: text-white (#FFFFFF)
299 border: none
300 border-radius: rounded-lg (8px)
301 shadow: shadow-sm
302
303VARIANT: secondary
304 [same structure, different values]
305
306VARIANT: ghost
307 [same structure, different values]
308```
309
310##### State Specifications
311Every state must be defined for every variant:
312
313```
314STATES (apply to ALL variants unless overridden):
315
316 hover {
317 background: — darken one step from default
318 transform: none (no scale/translate on hover)
319 shadow:
320 cursor: pointer
321 transition: default (duration-200 ease-out)
322 }
323
324 active {
325 background: — darken two steps from default
326 transform: scale-[0.98]
327 transition: duration-75
328 }
329
330 focus-visible {
331 ring: ring-2 ring-offset-2 ring-brand-500
332 all other: same as default state
333 }
334
335 disabled {
336 opacity: opacity-50
337 cursor: not-allowed
338 pointer-events: none
339 ALL hover/active/focus states: do not apply
340 }
341
342 loading {
343 content: replace children with spinner (16px, animate-spin)
344 width: maintain same width as non-loading state (prevent layout shift)
345 pointer-events: none
346 opacity: opacity-80
347 }
348```
349
350##### Icon Behavior
351```
352ICON RULES {
353 position: left of label text (always)
354 size: 16px (sm), 16px (md), 20px (lg)
355 gap: gap-1.5 (sm), gap-2 (md), gap-2 (lg)
356 color: inherits text color (currentColor)
357 when loading: icon is hidden, spinner takes its position
358 icon-only: if no children, component becomes square (width = height)
359 add aria-label prop requirement
360}
361```
362
363---
364
365### SECTION 5: INTERACTION FLOWS
366
367For each user flow, provide step-by-step implementation:
368
369#### Flow: [Flow Name, e.g., "User Signs Up"]
370```
371TRIGGER: user clicks "Sign Up" button in header
372
373STEP 1: Modal opens
374 animation: fade-in (opacity 0→1, duration-200)
375 backdrop: bg-black/50, click-outside closes modal
376 focus: trap focus inside modal, auto-focus first input
377 body: scroll-lock (prevent background scroll)
378
379STEP 2: User fills form
380 fields:
381 validation: on blur (not on change — reduces noise)
382
383 field: email {
384 type: email
385 required: true
386 validate: regex pattern + "must contain @ and domain"
387 error: "That doesn't look like an email — check for typos"
388 success: green checkmark icon appears (fade-in, duration-150)
389 }
390
391 field: password {
392 type: password (with show/hide toggle)
393 required: true
394 validate: min 8 chars, 1 uppercase, 1 number
395 error: show checklist of requirements, highlight unmet
396 strength: show strength bar (weak/medium/strong)
397 }
398
399STEP 3: User submits
400 button: shows loading state (see Button component spec)
401 request: POST /api/auth/signup
402 duration: expect 1-3 seconds
403
404STEP 4a: Success
405 modal: content transitions to success message (crossfade, duration-200)
406 message: "Account created! Check your email to verify."
407 action: "Got it" button closes modal
408 redirect: after close, redirect to /dashboard
409 toast: none (the modal IS the confirmation)
410
411STEP 4b: Error — email exists
412 field: email input shows error state
413 message: "This email already has an account — want to log in instead?"
414 action: "Log in" link switches modal to login form
415 button: returns to default state (not loading)
416
417STEP 4c: Error — network failure
418 display: error banner at top of modal (not a toast)
419 message: "Something went wrong on our end. Try again?"
420 action: "Try again" button re-submits
421 button: returns to default state
422
423STEP 4d: Error — rate limited
424 display: error banner
425 message: "Too many attempts. Wait 60 seconds and try again."
426 button: disabled for 60 seconds with countdown visible
427```
428
429---
430
431### SECTION 6: RESPONSIVE BEHAVIOR RULES
432
433Don't describe what changes — specify the exact rules:
434
435```
436RESPONSIVE RULES:
437
438Rule 1: Navigation
439 ≥1024px: horizontal nav, all items visible
440 <1024px: hamburger icon, slide-in drawer from right
441 drawer-width: 80vw (max-w-[320px])
442 animation: translate-x (duration-300 ease-out)
443 backdrop: bg-black/50, click-outside closes
444
445Rule 2: Grid Sections
446 ≥1024px: grid-cols-3
447 768-1023px: grid-cols-2 (last item spans full if odd count)
448 <768px: grid-cols-1
449
450Rule 3: Hero Section
451 ≥1024px: two-column (text left, image right) — 55/45 split
452 <1024px: single column (text top, image bottom)
453 image max-height: 400px, object-cover
454
455Rule 4: Typography Scaling
456 ≥1024px: h1=text-5xl, h2=text-3xl, h3=text-xl, body=text-base
457 <1024px: h1=text-3xl, h2=text-2xl, h3=text-lg, body=text-base
458
459Rule 5: Spacing Scaling
460 ≥1024px: section-padding: py-16, container-padding: px-8
461 768-1023px: section-padding: py-12, container-padding: px-6
462 <768px: section-padding: py-10, container-padding: px-4
463
464Rule 6: Touch Targets
465 <1024px: all interactive elements minimum 44×44px hit area
466 if visual size < 44px, use invisible padding to reach 44px
467
468Rule 7: Images
469 all images: use next/image with responsive sizes prop
470 hero: sizes="(max-width: 1024px) 100vw, 50vw"
471 grid items: sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
472```
473
474---
475
476### SECTION 7: EDGE CASES & BOUNDARY CONDITIONS
477
478This section prevents the "but what happens when..." problems:
479
480```
481EDGE CASES:
482
483Text Overflow {
484 headings: max 2 lines, then truncate with text-ellipsis (add title attr for full text)
485 body text: allow natural wrapping, no truncation
486 button labels: single line only, max 30 characters, no truncation (design constraint)
487 nav items: single line, truncate if >16 characters on mobile
488 table cells: truncate with tooltip on hover
489}
490
491Empty States {
492 lists/grids with 0 items: show component
493 - illustration:
494 - heading: ""
495 - body: ""
496 - CTA: "" →
497
498 user avatar missing: show initials on colored background
499 - background: generate from user name hash (deterministic)
500 - initials: first letter of first + last name, uppercase
501 - font: text-sm font-medium text-white
502
503 image fails to load: show gray placeholder with image icon
504 - background: bg-gray-100
505 - icon: ImageOff from lucide-react, text-gray-400, 24px
506}
507
508Loading States {
509 page load: full-page skeleton (not spinner)
510 component load: component-level skeleton matching final dimensions
511 button action: inline spinner in button (see Button spec)
512 infinite list: skeleton row × 3 at bottom while fetching next page
513
514 skeleton style: bg-gray-200 rounded animate-pulse
515 skeleton rule: skeleton shape must match final content shape
516 (rectangle for text, circle for avatars, rounded-lg for cards)
517}
518
519Error States {
520 API error (500): show inline error banner with retry button
521 Network error: show "You seem offline" banner at top (auto-dismiss when reconnected)
522 404 content: show custom 404 component (not Next.js default)
523 Permission denied: redirect to /login with return URL param
524 Form validation: inline per-field (see flow specs), never alert()
525}
526
527Data Extremes {
528 username 1 character: display normally
529 username 50 characters: truncate at 20 in nav, full in profile
530 price $0.00: show "Free"
531 price $999,999.99: ensure layout doesn't break (test with formatted number)
532 list with 1 item: same layout as multiple (no special case)
533 list with 500 items: paginate at 20, show "Load more" button
534 date today: show "Today" not the date
535 date this year: show "Mar 13" not "Mar 13, 2026"
536 date other year: show "Mar 13, 2025"
537}
538```
539
540---
541
542### SECTION 8: IMPLEMENTATION VERIFICATION CHECKLIST
543
544After implementation, the AI agent (or human developer) should verify:
545
546```
547VERIFICATION:
548
549□ Every component matches the variant × size matrix exactly
550□ Every state (hover, active, focus, disabled, loading) works
551□ Tab order follows visual order on all pages
552□ Focus-visible ring appears on keyboard nav, not on mouse click
553□ All transitions use specified duration and easing (not browser default)
554□ No layout shift during page load (check CLS)
555□ Skeleton states match final content dimensions
556□ All edge cases from Section 7 are handled
557□ Touch targets ≥ 44×44px on mobile breakpoints
558□ No horizontal scroll at any breakpoint
559□ All images use next/image with correct sizes prop
560□ Z-index values only use the defined scale
561□ Error states display correctly (test with network throttle)
562□ Empty states display correctly (test with empty data)
563□ Text truncation works at boundary lengths
564□ Dark mode tokens (if applicable) are all mapped
565```
566
567---
568
569## How the AI Agent Should Use This Document
570
571Include this instruction at the top of the generated handoff document
572so the implementing AI knows how to work with it:
573
574```
575INSTRUCTIONS FOR AI IMPLEMENTATION AGENT:
576
5771. Read this document fully before writing any code.
5782. Implement in the order specified in SECTION 1 (Implementation Map).
5793. Reference CLAUDE.md for token values. If a token referenced here
580 is not in CLAUDE.md, flag it and use the fallback value provided.
5814. Every value in this document is intentional. Do not substitute
582 with "close enough" values. `gap-6` means `gap-6`, not `gap-5`.
5835. Every state must be implemented. If a state is not specified for
584 a component, that is a gap in the spec — flag it, do not guess.
5856. After implementing each component, run through its state matrix
586 and verify all states work before moving to the next component.
5877. When encountering ambiguity, prefer the more explicit interpretation.
588 If still ambiguous, add a TODO comment: "// HANDOFF-AMBIGUITY: [description]"
589```
590```
591
592---
593
594## Customization Notes
595
596**If you're not using Tailwind:** Replace all Tailwind class references in the prompt with your system's equivalents. The structure stays the same — only the value format changes. Tell Claude: "Use CSS custom properties as primary, px values as annotations."
597
598**If you're handing off to a specific AI tool:** Add tool-specific notes. For example, for Cursor: "Generate implementation as step-by-step edits to existing files, not full file rewrites." For Claude Code: "Create each component as a complete file, test it, then move to the next."
599
600**If no CLAUDE.md exists yet:** Tell the prompt to generate a minimal token section at the top of the handoff document covering only the tokens needed for this specific handoff. It won't be a full design system, but it prevents hardcoded values.
601
602**For multi-page projects:** Run the prompt once per page, but include Section 1 (Implementation Map) and Section 2 (Global Specs) only in the first run. Subsequent pages reference the same globals.
603

评论 (0)

相关技能

企业微信/钉钉功能测试页设计

技能

为企业微信/钉钉设计功能测试页:通讯录、日程与消息收发;友好、简洁、科技感。

L@Leo
0

无障碍颜色对比审计器

技能

审计颜色对比是否满足无障碍标准。

F@f
0