medesign 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -2
- package/bin/medesign.js +200 -0
- package/integrations/claude-code/SKILL.md +20 -0
- package/integrations/cursor/medesign.mdc +26 -0
- package/medesign.config.js +46 -0
- package/package.json +62 -4
- package/presets/apple/design-tokens.css +115 -0
- package/presets/apple/guidelines.md +19 -0
- package/presets/apple/preset.json +53 -0
- package/presets/metha/design-tokens.css +127 -0
- package/presets/metha/guidelines.md +23 -0
- package/presets/metha/preset.json +53 -0
- package/presets/schema.json +102 -0
- package/presets/tesla/design-tokens.css +112 -0
- package/presets/tesla/guidelines.md +17 -0
- package/presets/tesla/preset.json +53 -0
- package/references/ai-tells.md +127 -0
- package/references/appendices.md +220 -0
- package/references/architecture.md +39 -0
- package/references/argon-design-archetypes.md +317 -0
- package/references/banner-sizes-and-styles.md +118 -0
- package/references/block-library.md +61 -0
- package/references/brand-design-tokens.md +42 -0
- package/references/catalog.json +108 -0
- package/references/cip-deliverable-guide.md +95 -0
- package/references/cip-design.md +121 -0
- package/references/cip-prompt-engineering.md +84 -0
- package/references/cip-style-guide.md +68 -0
- package/references/cli-architecture.md +146 -0
- package/references/components.md +240 -0
- package/references/dark-mode.md +23 -0
- package/references/design-core.md +42 -0
- package/references/design-md-protocol.md +75 -0
- package/references/design-routing.md +207 -0
- package/references/eng-imagery-content.md +71 -0
- package/references/eng-layout.md +28 -0
- package/references/eng-other.md +26 -0
- package/references/eng-states-theme.md +22 -0
- package/references/eng-type-color.md +44 -0
- package/references/icon-design.md +122 -0
- package/references/image-mockup-direction.md +53 -0
- package/references/image-to-code.md +46 -0
- package/references/impeccable-polish.md +85 -0
- package/references/intake.md +90 -0
- package/references/logo-color-psychology.md +101 -0
- package/references/logo-design.md +110 -0
- package/references/logo-prompt-engineering.md +158 -0
- package/references/logo-style-guide.md +109 -0
- package/references/mesurv-dna.md +104 -0
- package/references/micro-interactions-and-auto-animate.md +71 -0
- package/references/modern-craft-invariants.md +332 -0
- package/references/motion-tokens.md +99 -0
- package/references/preflight.md +110 -0
- package/references/proactive-motion.md +167 -0
- package/references/quality-gate.md +147 -0
- package/references/redesign-audit.md +38 -0
- package/references/redesign.md +52 -0
- package/references/slides-copywriting-formulas.md +84 -0
- package/references/slides-create.md +4 -0
- package/references/slides-html-template.md +295 -0
- package/references/slides-layout-patterns.md +137 -0
- package/references/slides-strategies.md +94 -0
- package/references/slides.md +42 -0
- package/references/social-photos-design.md +329 -0
- package/references/spatial-canvas-engine.md +160 -0
- package/references/stitch-system.md +184 -0
- package/references/style-extraction.md +17 -0
- package/references/styles/brutalist.md +88 -0
- package/references/styles/minimalist.md +81 -0
- package/references/styles/soft.md +94 -0
- package/references/threeui-spatial-engine.md +224 -0
- package/references/ui-styling-shadcn.md +336 -0
- package/references/ui-ux-vocabulary-vault.json +1223 -0
- package/references/ui-ux-vocabulary-vault.md +438 -0
- package/references/vocab-protocol.md +52 -0
- package/references/vocabulary.md +78 -0
- package/scripts/export-tokens.js +403 -0
- package/tests/browser-audit.js +442 -0
- package/tests/linter.js +412 -0
- package/tests/schemas/sarif-2.1.0.schema.json +2915 -0
- package/tests/visual-testbed.html +681 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
## 5. CONTEXT-AWARE PROACTIVITY
|
|
2
|
+
|
|
3
|
+
These are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**
|
|
4
|
+
|
|
5
|
+
* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or "boring B2B." When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.
|
|
6
|
+
* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.
|
|
7
|
+
* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: "spring", stiffness: 100, damping: 20`) - no linear easing.
|
|
8
|
+
* **"Motion claimed, motion shown."** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).
|
|
9
|
+
* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: "what does this animation communicate?" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: "it looked cool". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.
|
|
10
|
+
* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees ("logos endlessly scrolling", "manifesto scrolling sideways", "kinetic word strip") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.
|
|
11
|
+
* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A "card stack on scroll" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: "top top"` not `start: "top center"` or `"top 80%"`.
|
|
12
|
+
* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: "top top"`, pin the wrapper, scrub the inner track.
|
|
13
|
+
|
|
14
|
+
### 5.A Sticky-Stack - Canonical Skeleton
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
"use client";
|
|
18
|
+
import { useRef, useEffect } from "react";
|
|
19
|
+
import { gsap } from "gsap";
|
|
20
|
+
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
|
21
|
+
import { useReducedMotion } from "motion/react";
|
|
22
|
+
|
|
23
|
+
gsap.registerPlugin(ScrollTrigger);
|
|
24
|
+
|
|
25
|
+
export function StickyStack({ cards }: { cards: React.ReactNode[] }) {
|
|
26
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
27
|
+
const reduce = useReducedMotion();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (reduce || !ref.current) return;
|
|
31
|
+
const ctx = gsap.context(() => {
|
|
32
|
+
const cardEls = gsap.utils.toArray<HTMLElement>(".stack-card");
|
|
33
|
+
cardEls.forEach((card, i) => {
|
|
34
|
+
if (i === cardEls.length - 1) return;
|
|
35
|
+
ScrollTrigger.create({
|
|
36
|
+
trigger: card,
|
|
37
|
+
start: "top top", // pin at viewport top
|
|
38
|
+
endTrigger: cardEls[cardEls.length - 1],
|
|
39
|
+
end: "top top",
|
|
40
|
+
pin: true,
|
|
41
|
+
pinSpacing: false,
|
|
42
|
+
});
|
|
43
|
+
gsap.to(card, {
|
|
44
|
+
scale: 0.92,
|
|
45
|
+
opacity: 0.55,
|
|
46
|
+
ease: "none",
|
|
47
|
+
scrollTrigger: {
|
|
48
|
+
trigger: cardEls[i + 1],
|
|
49
|
+
start: "top bottom",
|
|
50
|
+
end: "top top",
|
|
51
|
+
scrub: true,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}, ref);
|
|
56
|
+
return () => ctx.revert();
|
|
57
|
+
}, [reduce]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div ref={ref} className="relative">
|
|
61
|
+
{cards.map((card, i) => (
|
|
62
|
+
<div
|
|
63
|
+
key={i}
|
|
64
|
+
className="stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center"
|
|
65
|
+
>
|
|
66
|
+
{card}
|
|
67
|
+
</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Critical points: `start: "top top"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).
|
|
75
|
+
|
|
76
|
+
### 5.B Horizontal-Pan - Canonical Skeleton
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
"use client";
|
|
80
|
+
import { useRef, useEffect } from "react";
|
|
81
|
+
import { gsap } from "gsap";
|
|
82
|
+
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
|
83
|
+
import { useReducedMotion } from "motion/react";
|
|
84
|
+
|
|
85
|
+
gsap.registerPlugin(ScrollTrigger);
|
|
86
|
+
|
|
87
|
+
export function HorizontalPan({ children }: { children: React.ReactNode }) {
|
|
88
|
+
const wrap = useRef<HTMLDivElement>(null);
|
|
89
|
+
const track = useRef<HTMLDivElement>(null);
|
|
90
|
+
const reduce = useReducedMotion();
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (reduce || !wrap.current || !track.current) return;
|
|
94
|
+
const ctx = gsap.context(() => {
|
|
95
|
+
const distance = track.current!.scrollWidth - window.innerWidth;
|
|
96
|
+
gsap.to(track.current, {
|
|
97
|
+
x: -distance,
|
|
98
|
+
ease: "none",
|
|
99
|
+
scrollTrigger: {
|
|
100
|
+
trigger: wrap.current,
|
|
101
|
+
start: "top top", // pin starts when section top hits viewport top
|
|
102
|
+
end: () => `+=${distance}`, // scroll distance = track width minus viewport
|
|
103
|
+
pin: true,
|
|
104
|
+
scrub: 1,
|
|
105
|
+
invalidateOnRefresh: true,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}, wrap);
|
|
109
|
+
return () => ctx.revert();
|
|
110
|
+
}, [reduce]);
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<section ref={wrap} className="relative overflow-hidden">
|
|
114
|
+
<div ref={track} className="flex h-[100dvh] items-center">
|
|
115
|
+
{children}
|
|
116
|
+
</div>
|
|
117
|
+
</section>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Critical points: `start: "top top"`, `pin: true`, `end: "+=${distance}"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.
|
|
123
|
+
|
|
124
|
+
### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)
|
|
125
|
+
|
|
126
|
+
For simple "items appear as they enter viewport" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
"use client";
|
|
130
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
131
|
+
|
|
132
|
+
export function RevealStagger({ items }: { items: string[] }) {
|
|
133
|
+
const reduce = useReducedMotion();
|
|
134
|
+
return (
|
|
135
|
+
<ul className="grid gap-6">
|
|
136
|
+
{items.map((item, i) => (
|
|
137
|
+
<motion.li
|
|
138
|
+
key={item}
|
|
139
|
+
initial={reduce ? false : { opacity: 0, y: 24 }}
|
|
140
|
+
whileInView={{ opacity: 1, y: 0 }}
|
|
141
|
+
viewport={{ once: true, amount: 0.3 }}
|
|
142
|
+
transition={{
|
|
143
|
+
duration: 0.6,
|
|
144
|
+
delay: i * 0.06,
|
|
145
|
+
ease: [0.16, 1, 0.3, 1],
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
{item}
|
|
149
|
+
</motion.li>
|
|
150
|
+
))}
|
|
151
|
+
</ul>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Use this for: feature lists, testimonial grids, logo walls, anything that just needs "enter on scroll." Save GSAP for actual pin/scrub work.
|
|
157
|
+
|
|
158
|
+
### 5.D Forbidden Animation Patterns
|
|
159
|
+
|
|
160
|
+
* **`window.addEventListener("scroll", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).
|
|
161
|
+
* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.
|
|
162
|
+
* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.
|
|
163
|
+
* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props "for safety" - it costs measurement work.
|
|
164
|
+
* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
## 9. Multi-Skill Design Optimization Engine (11-Skill Unified Synthesis)
|
|
2
|
+
|
|
3
|
+
เมื่อเรียกใช้ `/medesign` (ทั้งในโหมดสร้างหน้าใหม่, โหมดรีดีไซน์, และโหมด Auto-Blueprint `FINAL-01..04`) ระบบจะบังคับใช้ **กฎวิศวกรรมดีไซน์และเกณฑ์ตรวจสอบคุณภาพจาก 11 สกิลหลัก** โดยอัตโนมัติ:
|
|
4
|
+
|
|
5
|
+
### 9.1 🎛️ Design Dials & Spatial Topology (`taste-skill`)
|
|
6
|
+
- **3-Axis Design Dials (Locked Calibration):**
|
|
7
|
+
- `DESIGN_VARIANCE = 8–9/10` (Asymmetric Grids: `3:6:3` Newspaper Command, `8:4` Bento Split, `45:55` Master-Detail, หรือ Expandable Executive Stream — **ห้ามใช้ 3-Card Equal Generic Row ติดกันโดยไม่มีจังหวะลำดับขั้น**)
|
|
8
|
+
- `MOTION_INTENSITY = 6/10` (Spring Physics `cubic-bezier(0.22, 1, 0.36, 1)` สำหรับ Hover/Drawer + 0ms Instant State Sync สำหรับการสลับเหรียญ/กรองตาราง + เคารพ `@media (prefers-reduced-motion: reduce)`)
|
|
9
|
+
- `VISUAL_DENSITY = 7–8/10` (High-Craft Telemetry Density: ใช้ `font-variant-numeric: tabular-nums` ทุกตัวเลขราคา/พิกัด/เวลา, ช่องว่างภายในสัมพันธ์กับรัศมีขอบ)
|
|
10
|
+
- **Gapless Bento & Viewport Budget:**
|
|
11
|
+
- กริดแบบ Bento ต้องใส่ `grid-auto-flow: dense;` เสมอเพื่อไม่ให้เกิดหลุมว่าง (No orphan grid holes)
|
|
12
|
+
- ใช้ `min-height: 100dvh;` แทน `100vh` และล็อก `overflow-x: hidden;` บน `body`
|
|
13
|
+
- **Viewport Budget:** ใน 1 หน้าจอแรก (Above the Fold) ห้ามมีกลุ่มองค์ประกอบแยกกันเกิน 3 โซนหลัก และต้องมีพื้นที่ว่าง (Whitespace / Surface Canvas) อย่างน้อย 25%
|
|
14
|
+
|
|
15
|
+
### 9.2 📐 Concentric Surface Physics & Tactile Telemetry (`soft-skill` + `minimalist-skill` + `brutalist-skill`)
|
|
16
|
+
- **Safe Concentric Border Radius Formula:**
|
|
17
|
+
- บังคับใช้: `border-radius: max(0px, calc(var(--r-outer) - var(--border-w, 0px) - var(--pad)));` เพื่อป้องกันค่าติดลบจน Browser ทิ้งคำสั่ง และชดเชยความหนาของ Border อย่างถูกต้อง
|
|
18
|
+
- สำหรับปุ่มหรือแคปซูลที่มีการ Animate ขยาย/ยุบรูปทรง (Morphing) ให้ใช้ `calc(infinity * 1px)` หรือ `calc(var(--el-height) / 2)` แทน `9999px` เพื่อไม่ให้มุมโค้งกระตุกค้างช่วงท้าย
|
|
19
|
+
- **Doppelrand & Tactile Framing:**
|
|
20
|
+
- ผสมผสานความละมุนของ `soft-skill` (`box-shadow: inset 0 1px 0 rgba(255,255,255,0.06)` Doppelrand inner highlight) เข้ากับความคมชัดของ `minimalist-skill` & `brutalist-skill` (`1px solid` structural hairline + `3px solid` top category accent bar + `border-dashed` ticket perforation + `<kbd>` shortcut tags เช่น `T`)
|
|
21
|
+
- **Custom Browser Surfaces:**
|
|
22
|
+
- ต้องกำหนดสี `::selection` ให้เข้ากับธีม, แต่ง `::-webkit-scrollbar` ให้บางคม (`6px`), ล็อก `scrollbar-gutter: stable;`, และกำหนด `color-scheme: light dark;` บน `:root` เสมอ
|
|
23
|
+
|
|
24
|
+
### 9.3 🪙 2.5-Tier Semantic Token Contract & Polarity Discipline (`stitch-skill` + `ui-styling` + `redesign-skill`)
|
|
25
|
+
- **2.5-Tier Token Architecture (Zero Cascade Waterfall):**
|
|
26
|
+
- *Tier 1 (Primitive) & Tier 2 (Semantic):* กำหนดที่ `:root` ผ่านฟังก์ชัน `light-dark()` เพื่อให้ไฟล์ CSS กระชับและสลับธีมได้ทันที
|
|
27
|
+
- *Tier 3 (Component):* ห้ามประกาศเป็น Global Tokens เด็ดขาด ให้ใช้เฉพาะ **Private Scoped Aliases** ที่ขึ้นต้นด้วย Underscore (`--_bg`, `--_border`, `--_text`) ภายใน Class ของ Component นั้นๆ เพื่อป้องกัน Style Recalculation ซ้ำซ้อนบนตารางหมื่นเซลล์
|
|
28
|
+
- **Contrast-Safe CTA Foreground (`--accent-on-primary`):**
|
|
29
|
+
- **กฎเหล็กป้องกันบั๊กสีกลืนในโหมดมืด:** ห้ามเขียน `color: #ffffff` ตายตัวบนปุ่มที่ใช้พื้นหลัง `var(--accent-primary)` เด็ดขาด เพราะเมื่อสลับเป็นโหมดมืด (`velvet-obsidian` ที่ใช้สีเขียวสว่าง `#34d399`) ตัวหนังสือสีขาวจะมี Contrast เพียง `1.92:1` (อ่านไม่ออก/ตกเกณฑ์ WCAG)
|
|
30
|
+
- ต้องใช้ `color: var(--accent-on-primary)` เสมอ โดยในโหมดสว่าง (`editorial-paper` พื้นเขียวเข้ม `#0f6b32`) กำหนด `--accent-on-primary: #ffffff` (`6.66:1` AA/AAA) และในโหมดมืด (`velvet-obsidian` พื้นเขียวมิ้นต์ `#34d399`) กำหนด `--accent-on-primary: #042f1e` (`10.8:1` AAA)
|
|
31
|
+
- **Non-Text SVG Contrast:**
|
|
32
|
+
- เส้นกราฟหลักและวงแหวนเกจวัด (SVG `stroke`) ห้ามฮาร์ดโค้ดสีสว่างที่จมบนพื้นขาว ต้องผูกกับ `stroke="var(--accent-primary)"` เพื่อให้ผ่านเกณฑ์ WCAG Non-Text Contrast (`> 3:1`) ทั้งในโหมดกระดาษครีมและโหมดมืด
|
|
33
|
+
|
|
34
|
+
### 9.4 🛡️ 4-Tier Quality Governance & Pre-Flight Gate
|
|
35
|
+
|
|
36
|
+
เปลี่ยนผ่านจากการเป็นเพียง CSS Style Enforcer สู่ **Design Decision Engine** ด้วยการแบ่งระดับการตรวจสอบออกเป็น 4 ชั้นชัดเจน:
|
|
37
|
+
|
|
38
|
+
| ระดับการตรวจสอบ | เกณฑ์ประเมิน | ตัวอย่างข้อกำหนด | กลไกการตรวจรับ (Gate) |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| **Tier 1: Hard Invariants** | ไม่มีการประนีประนอม (Pass/Fail) | WCAG Dual-Theme Contrast, Keyboard Focus Visible, 44px Touch Targets, Reduced-Motion Compliance, Semantic State Contract | Automated Unit & Contrast Test |
|
|
41
|
+
| **Tier 2: Soft Heuristics** | ปรับตามบริบทและขนาดหน้าจอ | Safe Concentric Radius, Motion Timing, Accent Budget ($\le 15\%$), Whitespace Budget ($\ge 25\%$) | Design Review & Optical Comparison |
|
|
42
|
+
| **Tier 3: Progressive Enhancements** | เสริมความลื่นไหลเมื่อเบราว์เซอร์รองรับ | CSS Anchor Positioning, Scroll-Driven Animations, View Transitions L2, `@starting-style` | Feature Detection (`@supports` / JS Fallback) |
|
|
43
|
+
| **Tier 4: Domain Rules** | สอดคล้องกับงานเฉพาะทางของผู้ใช้ | High-Density Telemetry, Map Canvas 100dvh, 0W Idle WebGL `frameloop="demand"` | Domain User Workflow Audit |
|
|
44
|
+
|
|
45
|
+
#### 1. Complete Semantic State Contract (Hard Invariant):
|
|
46
|
+
ทุก Interactive Component ต้องผ่านการออกแบบและมี CSS ครบทั้ง 6 สถานะ:
|
|
47
|
+
$$\text{default} \longrightarrow \text{hover} \longrightarrow \text{pressed} \longrightarrow \text{focus-visible} \longrightarrow \text{disabled / loading} \longrightarrow \text{success / error}$$
|
|
48
|
+
- **Focus Rings:** ทุกปุ่ม/ลิงก์/อินพุตต้องมี `:focus-visible` ชัดเจน (`outline: 2px solid var(--border-focus); outline-offset: 2px;`)
|
|
49
|
+
- **Press Displacement:** ปุ่มยุบตัวทางสายตาด้วย Area-Proportional Scaling โดยไม่ลดขนาดกล่อง Hit Target
|
|
50
|
+
- **Reduced Motion:** หากผู้ใช้เปิด `prefers-reduced-motion: reduce` ต้องตัด Transition เหลือ `0ms` ทันที
|
|
51
|
+
|
|
52
|
+
#### 2. Dual-Theme Contrast & Polarity Discipline (Hard Invariant):
|
|
53
|
+
- ข้อความหลัก (`--text-1`) $> 12:1$ (AAA)
|
|
54
|
+
- ข้อความรอง (`--text-2`) $> 7:1$ (AAA)
|
|
55
|
+
- ข้อความกำกับ/หน่วย (`--text-3`) $> 4.5:1$ (AA)
|
|
56
|
+
- ปุ่มหลัก (`--accent-on-primary` บน `--accent-primary`) $> 4.5:1$ ทั้ง Light (`editorial-paper`) และ Dark (`velvet-obsidian`)
|
|
57
|
+
- เส้นกราฟ/ไอคอน (Non-text) $> 3:1$ เทียบกับพื้นผิว
|
|
58
|
+
|
|
59
|
+
#### 3. Information Architecture & Anti-Slop Heuristics (Soft Heuristic):
|
|
60
|
+
- **Layout Follows Information Relationships:** บังคับให้ AI ระบุ Primary Task, Primary Data, Supporting Context, และ Secondary Actions ก่อนสร้าง Layout
|
|
61
|
+
- **ห้าม Generic Card Uniformity:** ห้ามเปลี่ยนตารางข้อมูลหรือฟังก์ชันที่มีความสำคัญต่างกันให้กลายเป็นการ์ดเรียง 3 ใบที่มีขนาดและ Effect เท่ากันหมด
|
|
62
|
+
- **Surface Effect Budget:** ทุก Drop-shadow, Blur, และ Glow ต้องมีหน้าที่ชัดเจน (แยกชั้นความลึก หรือบอกสถานะ) ไม่ใส่ฟุ้งกระจายจนขาดลำดับขั้น
|
|
63
|
+
|
|
64
|
+
#### 4. Interactive Self-Audit Score:
|
|
65
|
+
ในหน้า Prototype สามารถแสดงแถบ **`🛡️ 4-Tier Audit Score`** เพื่อแสดงผลตรวจ Contrast, Focus Visibility, และ State Contract สดบนหน้าเว็บได้ทันที
|
|
66
|
+
|
|
67
|
+
### 9.5 🎨 Perceptual Color, Motion Profiles & Micro-Craft Standards
|
|
68
|
+
|
|
69
|
+
- **Perceptual Intent Color Engine:**
|
|
70
|
+
- เลือกใช้ `in oklch shorter hue` เมื่อต้องการรักษาความสดฉ่ำของ Hue ข้ามช่วง
|
|
71
|
+
- เลือกใช้ `in oklab` เมื่อต้องการเกลี่ยความสว่างนุ่มนวลหรือไล่สีเข้าหา Neutral/White/Black เพื่อขจัดรอยตัดขอบ
|
|
72
|
+
- ตรวจสอบ Midpoint ที่ตำแหน่ง 25%, 50%, 75% เพื่อป้องกันแถบสีหม่น
|
|
73
|
+
- สร้างสถานะด้วย `color-mix(in oklch, var(--surface-base) 88%, white)` แทนการฮาร์ดโค้ด Hex
|
|
74
|
+
- **Dark Mode Functional Tokens:**
|
|
75
|
+
- บริหารผ่าน `--surface-canvas` (OLED Pure Black `#000000` + Chroma $C \in [0.004, 0.012]$), `--surface-raised`, `--surface-inset`, `--border-subtle`, `--border-focus`
|
|
76
|
+
- **4 Motion Profiles & Timing Math:**
|
|
77
|
+
- สัดส่วนเวลาปิดต่อเวลาเปิด: $T_{\text{exit}} = 0.65 \times T_{\text{entry}}$ (280ms เข้า / 180ms ออก)
|
|
78
|
+
- กำหนด Motion ตามลักษณะงาน: `precision` (0-100ms no overshoot สำหรับงานข้อมูล/แผนที่), `soft-settle` (240-280ms สำหรับ Popover), `spring-settle` (สำหรับ Morphing ข้ามรูปทรง), และ `instant` (0ms)
|
|
79
|
+
- **Typography & Script Calibration:**
|
|
80
|
+
- UI Chrome: `line-height: 1.25` (EN) / `1.38` (TH) + สำรอง Headroom สำหรับสระบน/วรรณยุกต์ไทย 2-4px
|
|
81
|
+
- Reading Prose: `line-height: 1.60` (EN) / `1.70-1.75` (TH)
|
|
82
|
+
- ปรับจูน Fallback Font ด้วย `size-adjust` ภายใน `@font-face` เพื่อป้องกัน Layout Shift (CLS = 0)
|
|
83
|
+
- **Spatial 3D & WebGL Resource Gating:**
|
|
84
|
+
- สถาปัตยกรรม **`frameloop="demand"`**: ตัด Render Loop ทันทีเมื่อความเร็ว $\lvert v \rvert < 0.0001$ (GPU 0W idle)
|
|
85
|
+
- VRAM Footprint $\le 32\text{MB}$ ผ่าน Meshopt Compression และ KTX2 Basis Universal Textures
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 9.6 👁️ Task-Driven Attention Models & Information Saliency
|
|
90
|
+
|
|
91
|
+
ห้ามบังคับใช้ F-Pattern กับทุก Archetype ให้เลือก **Attention Model** ให้ตรงกับภารกิจหลัก:
|
|
92
|
+
|
|
93
|
+
| Attention Model | เหมาะสำหรับ | เกณฑ์การจัดวางและการวัดผล |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| **F-Pattern** | บทความ, Documentation, คู่มือการใช้งาน | ลำดับการอ่านหัวข้อ และตำแหน่งเริ่มต้นอ่านแนวนอนสู่แนวตั้ง |
|
|
96
|
+
| **Z-Pattern** | Marketing Landing Page ความหนาแน่นต่ำ | เส้นทางสายตาจาก Brand สู่ Value Proposition และ Primary CTA |
|
|
97
|
+
| **Task-First** | Dashboard, ซอฟต์แวร์วิศวกรรม, CAD | ผู้ใช้พบปุ่ม Action หลักหรือสถานะปัจจุบันของระบบได้เร็วที่สุด |
|
|
98
|
+
| **Spatial Attention** | GIS, แผนที่, CAD Workbench, 3D Canvas | Canvas คือจุดโฟกัสหลัก โดยมีแผงเครื่องมือและข้อมูลแวดล้อมเกาะขอบ |
|
|
99
|
+
| **Alert-First** | Mission Control HMI, Telemetry Console | ค่าผิดปกติ (Critical Alarm) ต้องถูกแยกออกจากสถานะปกติอย่างเด็ดขาด |
|
|
100
|
+
| **Reading Hierarchy** | ตารางสแกนข้อมูล, รายงานการคำนวณ | สแกนค่าตามแถว คอลัมน์สรุปผล และค่าพิกัดความคลาดเคลื่อนได้อย่างแม่นยำ |
|
|
101
|
+
|
|
102
|
+
#### Gestalt Proximity & Saliency Formulation:
|
|
103
|
+
- **Gestalt Proximity:** องค์ประกอบที่เกี่ยวข้องกันทางตรรกะ ต้องอยู่ใกล้กันทางสายตา:
|
|
104
|
+
$$d_{ij} = \frac{\sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}}{\sqrt{W^2 + H^2}}, \quad P_{ij} = \exp\left(-\frac{d_{ij}^2}{2\sigma^2}\right)$$
|
|
105
|
+
- **Information Saliency Score ($S_i$):**
|
|
106
|
+
$$S_i = 0.30 R_i + 0.18 C_i + 0.16 T_i + 0.12 A_i + 0.10 P_i + 0.08 I_i + 0.06 E_i$$
|
|
107
|
+
โดย $R$ (Task Relevance), $C$ (Contrast), $T$ (Typography Saliency), $A$ (Area), $P$ (Position), $I$ (Isolation), $E$ (Enclosure)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### 9.7 🍱 Bento Allocation & CLS Near-Zero Invariants
|
|
112
|
+
|
|
113
|
+
1. **Task-Weighted Area Allocation:**
|
|
114
|
+
คำนวณขนาดของ Module ตามน้ำหนักภารกิจ ไม่ใช่ความชอบส่วนตัวของนักออกแบบ:
|
|
115
|
+
$$w_i = 0.35 T_i + 0.25 F_i + 0.20 D_i + 0.20 K_i$$
|
|
116
|
+
($T$: ความสำคัญต่อภารกิจ, $F$: ความถี่ในการคลิก/ควบคุม, $D$: ความหนาแน่นของข้อมูล, $K$: ความวิกฤตเมื่อเกิดข้อผิดพลาด)
|
|
117
|
+
2. **Aspect Ratio Starting Constraints:**
|
|
118
|
+
- **GIS Map Canvas:** ประมาณ 16:10 ถึง 4:3 (หรือ 100dvh full-bleed)
|
|
119
|
+
- **Telemetry Timeline:** 2.2:1 ถึง 3:1 (แนวนอนกว้างเพื่อให้เห็นแนวโน้มกาลเวลา)
|
|
120
|
+
- **Data Table:** Flexible height พร้อม Internal Scrolling (`overflow-y: auto`)
|
|
121
|
+
- **Inspector / Controls:** Flexible height พร้อมล็อก `min-width: 20rem` (320px) ป้องกันข้อมูลถูกบีบ
|
|
122
|
+
3. **Grid Dense Warning:**
|
|
123
|
+
- บังคับใช้ `grid-auto-flow: row` ควบคู่กับ **Named Grid Areas** (`grid-template-areas`) เป็นค่าเริ่มต้นเสมอ
|
|
124
|
+
- ห้ามใช้ `grid-auto-flow: dense` กับ Dashboard ข้อมูล เพราะจะทำให้ลำดับ DOM และ Tab Order ของคีย์บอร์ดสลับตำแหน่ง
|
|
125
|
+
4. **CLS Near-Zero Invariants:**
|
|
126
|
+
- **Reserved Geometry:** จองพื้นที่ว่างและ Aspect Ratio ให้กับ Map Canvas, กราฟ และภาพก่อนโหลดข้อมูลเสมอ
|
|
127
|
+
- **Stable Data Regions:** การอัปเดตข้อมูลต้องเกิดขึ้นภายใน Scroll Container ที่กำหนดขอบเขตไว้ ไม่ดันโครงสร้างหลักขยับ
|
|
128
|
+
- **Overlay for Transient Feedback:** แจ้งเตือน Toast และ Popover ต้องอยู่บน Top Layer ไม่แทรกเข้าไปใน DOM Flow
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### 9.8 📊 Automated Heuristic Scoring Pipeline & Release Gate
|
|
133
|
+
|
|
134
|
+
ประเมินคุณภาพของโค้ด UI ผ่านสมการคะแนนรวม:
|
|
135
|
+
$$Q = 0.30 H + 0.25 I + 0.20 G + 0.15 R + 0.10 V$$
|
|
136
|
+
- $H$ (Hierarchy & Task Saliency)
|
|
137
|
+
- $I$ (Information Architecture & State Completeness)
|
|
138
|
+
- $G$ (Geometry, Concentric Radii & Touch Targets)
|
|
139
|
+
- $R$ (Responsive Stability & CLS = 0)
|
|
140
|
+
- $V$ (Visual Craft, OKLCH Gamut & Anti-Slop)
|
|
141
|
+
|
|
142
|
+
#### Zero-Compromise Gating Policy:
|
|
143
|
+
- **90–100:** PASS — พร้อมส่งมอบระดับ Production
|
|
144
|
+
- **75–89:** REVIEW REQUIRED — ใช้งานเป็น Candidate ได้แต่ต้องตรวจสอบคำเตือน
|
|
145
|
+
- **< 75:** REJECT — สถาปัตยกรรมข้อมูลไม่ผ่านเกณฑ์ ต้องปรับแก้ก่อนเรนเดอร์
|
|
146
|
+
- **Hard Invariant Violation:** REJECT ทันที (หากตกเกณฑ์ Contrast AA/AAA, ขาด Focus Ring, หรือไม่มี Reduced-Motion Gate แม้คะแนนรวมจะได้ 95 ก็ถือว่าตกเกณฑ์)
|
|
147
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Anti-AI Design & Redesign Audit Protocol
|
|
2
|
+
|
|
3
|
+
เกณฑ์การตรวจสอบและยกระดับหน้าเว็บเดิมให้สวยงาม พรีเมียม และกำจัดร่องรอย "AI Generated Look" (AI Tells) โดยไม่กระทบฟังก์ชันการทำงานเดิมของระบบ
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. ลำดับขั้นตอนการรีดีไซน์ (3-Step Redesign Sequence)
|
|
8
|
+
|
|
9
|
+
1. **Scan (สำรวจสแต็กเดิม):** อ่านโครงสร้างโปรเจกต์เดิม ตรวจสอบ Framework (Next.js, Vite, React, Astro, Vue), วิธีจัดการสไตล์ (Tailwind CSS, Vanilla CSS, CSS Modules) และ Icon Library ที่ใช้อยู่
|
|
10
|
+
2. **Diagnose (วินิจฉัยจุดบกพร่อง):** เทียบโค้ดปัจจุบันกับ Checklist ข้อห้ามด้านล่าง คัดแยกรูปแบบที่ดูเชย หรือดูโหลแบบ AI
|
|
11
|
+
3. **Targeted Upgrade (ยกระดับเฉพาะจุด):** ปรับปรุงโค้ดบนสแต็กเดิมทันทีโดยไม่ต้องรื้อระบบใหม่ทั้งหมด (Incremental Polish)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. หมวดการตรวจสอบเชิงลึก (Audit Checklist)
|
|
16
|
+
|
|
17
|
+
### ก. การจัดพิมพ์และตัวหนังสือ (Typography)
|
|
18
|
+
- [ ] **แทนที่ฟอนต์โหล (Inter/System Font):** ใช้ฟอนต์ที่มีบุคลิกชัดเจน เช่น `Geist`, `Cabinet Grotesk`, `Outfit`, `Plus Jakarta Sans` หรือคู่ฟอนต์สไตล์ Editorial (Serif สำหรับ Header + Sans สำหรับ Body)
|
|
19
|
+
- [ ] **น้ำหนักหัวข้อ (Headline Presence):** หัวข้อขนาดใหญ่ต้องปรับ Tracking ให้แน่นเสมอ (`letter-spacing: -0.025em` ถึง `-0.03em`) และลด `line-height` เหลือ `1.05 - 1.15`
|
|
20
|
+
- [ ] **ความกว้างบรรทัดข้อความ:** จำกัดความกว้างของย่อหน้าเนื้อหาให้อยู่ที่ `60 - 75ch` (`max-w-prose` หรือ `max-w-xl`) เพื่อให้อ่านสบายตา
|
|
21
|
+
- [ ] **ลำดับน้ำหนักฟอนต์:** เลิกใช้แค่ Regular (400) คู่กับ Bold (700) ให้เสริม Medium (500) และ SemiBold (600) เพื่อความต่อเนื่อง
|
|
22
|
+
- [ ] **ตัวเลขและตารางข้อมูล:** ใช้ฟอนต์ Monospace (`Geist Mono`, `JetBrains Mono`) หรือเปิดใช้งาน `font-variant-numeric: tabular-nums` เสมอ
|
|
23
|
+
- [ ] **ป้องกันคำโดด (Orphaned Words):** ใช้ `text-wrap: balance` สำหรับ Heading และ `text-wrap: pretty` สำหรับ Body Text
|
|
24
|
+
|
|
25
|
+
### ข. พื้นผิว สี และมิติ (Color, Surfaces & Depth)
|
|
26
|
+
- [ ] **ห้ามใช้ Pure Black (`#000000`):** ใน Dark Theme ให้ใช้ Off-Black เช่น `#09090b`, `#0d0d11`, หรือ `#121216` เพื่อความสบายตา
|
|
27
|
+
- [ ] **กำจัด AI Purple Gradient:** เลิกใช้สีเหลือบม่วง-ฟ้าแบบ AI เจนทั่วไป ให้ใช้พื้นสีกลางสะอาดคู่กับ Accent Color เพียง 1 สีที่ผ่านการคัดสรร
|
|
28
|
+
- [ ] **ควบคุมความสดของสี Accent:** คุมค่า Saturation ให้อยู่ต่ำกว่า 85% เพื่อความกลมกลืนระดับพรีเมียม
|
|
29
|
+
- [ ] **มิติเงาที่มีอุณหภูมิ (Tinted Shadows):** หลีกเลี่ยงเงาดำทื่อๆ ให้ผสมโทนสีของพื้นหลังลงในเงา (เช่น เงาสีกรมท่าเข้มบนพื้นหลัง Dark Navy)
|
|
30
|
+
- [ ] **ขอบและแสงตกกระทบ (Border Rim Light):** ใช้ขอบบาง `1px solid rgba(255, 255, 255, 0.08)` และ Top Rim Light (`linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent)`) เพื่อสร้างความคมชัด
|
|
31
|
+
- [ ] **ความสม่ำเสมอของโหมดแสง:** หลีกเลี่ยงการแทรกกล่องสีดำสนิทลงในหน้า Light Mode อย่างไม่มีเหตุผล ให้คุมโทนพื้นหลังให้เป็นหนึ่งเดียว
|
|
32
|
+
|
|
33
|
+
### ค. โครงสร้างและการจัดวาง (Layout & Spacing)
|
|
34
|
+
- [ ] **กำจัด 3-Card Column Cliché:** เลิกวางการ์ดขนาดเท่ากัน 3 ช่องทื่อๆ เปลี่ยนเป็น Bento Grid แบบอสมมาตร, Horizontal Scroll, หรือ Two-Column Asymmetric Grid
|
|
35
|
+
- [ ] **ความสูงหน้าจออุปกรณ์:** ใช้ `min-height: 100dvh` แทน `100vh` เพื่อป้องกันปัญหา Layout กระตุกบนเบราว์เซอร์มือถือ (iOS Safari URL bar bug)
|
|
36
|
+
- [ ] **ขอบเขตความกว้างหน้าจอ:** กำหนด `max-w-[1200px]` ถึง `max-w-[1440px]` พร้อม `mx-auto` เสมอ ป้องกันเนื้อหายืดแผ่ขอบจอ
|
|
37
|
+
- [ ] **การจัดตำแหน่งปุ่ม CTA ในการ์ด:** ใช้ `mt-auto` ใน Flexbox Card เพื่อให้ปุ่ม Action ด้านล่างอยู่ระนาบเดียวกันเสมอ ไม่กระโดดตามความยาวเนื้อหา
|
|
38
|
+
- [ ] **ระยะหายใจ (Whitespace):** เพิ่ม Padding และ Gap ให้กว้างขึ้น ให้หน้าเว็บโปร่ง โล่ง และมีจุดโฟกัสสายตาที่ชัดเจน
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
## 11. REDESIGN PROTOCOL
|
|
2
|
+
|
|
3
|
+
This skill handles **greenfield builds AND redesigns**. Misclassifying the mode is the single biggest source of bad redesign output.
|
|
4
|
+
|
|
5
|
+
### 11.A Detect the Mode (first action)
|
|
6
|
+
* **Greenfield** - no existing site, or full overhaul approved. Dial baseline from Section 1.
|
|
7
|
+
* **Redesign - Preserve** - modernise without breaking the brand. Audit first, extract brand tokens, evolve gradually.
|
|
8
|
+
* **Redesign - Overhaul** - new visual language on top of existing content. Treat as greenfield for visuals; preserve content and IA.
|
|
9
|
+
|
|
10
|
+
If ambiguous, ask **once**: *"Should this redesign preserve the existing brand, or are we starting visually from scratch?"*
|
|
11
|
+
|
|
12
|
+
### 11.B Audit Before Touching
|
|
13
|
+
Document the current state before proposing changes:
|
|
14
|
+
* **Brand tokens** - primary / accent colors, type stack, logo treatment, radii.
|
|
15
|
+
* **Information architecture** - page tree, primary nav, key conversion paths.
|
|
16
|
+
* **Content blocks** - what exists, what's doing work, what's filler.
|
|
17
|
+
* **Patterns to preserve** - signature interactions, recognisable hero, copy voice.
|
|
18
|
+
* **Patterns to retire** - AI-slop tells, broken layouts, dead links, generic stock imagery, perf traps.
|
|
19
|
+
* **Dial reading of the existing site** - infer current `DESIGN_VARIANCE` / `MOTION_INTENSITY` / `VISUAL_DENSITY`. That's your starting point, not the baseline.
|
|
20
|
+
* **SEO baseline** - current ranking pages, meta titles, structured data, OG cards. **SEO migration is the #1 redesign risk.**
|
|
21
|
+
|
|
22
|
+
### 11.C Preservation Rules
|
|
23
|
+
* **Do not change information architecture** unless asked. Keep page slugs, anchor IDs, primary nav labels stable for SEO and muscle memory.
|
|
24
|
+
* **Extract brand colors before applying Section 4.2.** A brand that is already purple stays purple - apply the LILA RULE's override.
|
|
25
|
+
* **Preserve copy voice** unless asked for a rewrite. Visual modernisation ≠ content rewrite.
|
|
26
|
+
* **Honor existing accessibility wins.** Do not regress focus states, alt text, keyboard nav, contrast.
|
|
27
|
+
* **Respect existing analytics events.** Do not rename buttons, form fields, section IDs that downstream tracking depends on.
|
|
28
|
+
|
|
29
|
+
### 11.D Modernisation Levers (priority order)
|
|
30
|
+
Apply in order - stop when the brief is satisfied:
|
|
31
|
+
1. **Typography refresh** - biggest visual lift per unit of risk.
|
|
32
|
+
2. **Spacing & rhythm** - increase section padding, fix vertical rhythm.
|
|
33
|
+
3. **Color recalibration** - desaturate, unify neutrals, keep brand accent.
|
|
34
|
+
4. **Motion layer** - add `MOTION_INTENSITY`-appropriate micro-interactions to existing components.
|
|
35
|
+
5. **Hero & key-section recomposition** - restructure top-of-funnel using Section 10 vocabulary.
|
|
36
|
+
6. **Full block replacement** - only when the existing block is unsalvageable.
|
|
37
|
+
|
|
38
|
+
### 11.E Decision Tree: Targeted Evolution vs Full Redesign
|
|
39
|
+
* IA, content, and SEO sound → **targeted evolution** (Levers 1-4). ~70% of value at ~40% of risk.
|
|
40
|
+
* Visual debt is structural (broken IA, no design system, broken mobile) → **full redesign** with strict content preservation.
|
|
41
|
+
* Brand itself is changing → **greenfield**.
|
|
42
|
+
|
|
43
|
+
### 11.F What Never Changes Silently
|
|
44
|
+
Never modify without explicit user approval:
|
|
45
|
+
* URL structure / route slugs.
|
|
46
|
+
* Primary nav labels.
|
|
47
|
+
* Form field names or order (breaks analytics + autofill).
|
|
48
|
+
* Brand logo or wordmark.
|
|
49
|
+
* Existing legal / consent / cookie copy.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Copywriting Formulas
|
|
2
|
+
|
|
3
|
+
25 formulas for persuasive slide copy.
|
|
4
|
+
|
|
5
|
+
## Core Formulas
|
|
6
|
+
|
|
7
|
+
### PAS (Problem-Agitate-Solution)
|
|
8
|
+
**Use:** Problem slides, pain points
|
|
9
|
+
**Components:** Problem → Agitate → Solution
|
|
10
|
+
**Template:** "[Pain point]? Every [time frame], [consequence]. [Solution] fixes this."
|
|
11
|
+
|
|
12
|
+
### AIDA (Attention-Interest-Desire-Action)
|
|
13
|
+
**Use:** CTAs, closing slides
|
|
14
|
+
**Components:** Attention → Interest → Desire → Action
|
|
15
|
+
**Template:** "[Bold statement]. [Benefit detail]. [Social proof]. [CTA]."
|
|
16
|
+
|
|
17
|
+
### FAB (Features-Advantages-Benefits)
|
|
18
|
+
**Use:** Feature slides, product showcases
|
|
19
|
+
**Components:** Feature → Advantage → Benefit
|
|
20
|
+
**Template:** "[Feature] lets you [advantage], so you can [benefit]."
|
|
21
|
+
|
|
22
|
+
### Cost of Inaction
|
|
23
|
+
**Use:** Agitation slides, urgency
|
|
24
|
+
**Components:** Status Quo → Loss → Time Decay
|
|
25
|
+
**Template:** "Without [solution], you're losing [amount] every [timeframe]."
|
|
26
|
+
|
|
27
|
+
### Before-After-Bridge
|
|
28
|
+
**Use:** Transformation slides, case studies
|
|
29
|
+
**Components:** Before → After → Bridge
|
|
30
|
+
**Template:** "[Pain point before]. [Desired state after]. [Your solution] is the bridge."
|
|
31
|
+
|
|
32
|
+
## Formula-to-Slide Mapping
|
|
33
|
+
|
|
34
|
+
| Slide Type | Primary Formula | Emotion |
|
|
35
|
+
|------------|-----------------|---------|
|
|
36
|
+
| Title/Hook | AIDA, Hook | curiosity |
|
|
37
|
+
| Problem | PAS, Agitate | frustration |
|
|
38
|
+
| Cost/Risk | Cost of Inaction | fear |
|
|
39
|
+
| Solution | FAB, BAB | hope |
|
|
40
|
+
| Features | FAB | confidence |
|
|
41
|
+
| Traction | Proof Stack | trust |
|
|
42
|
+
| Social Proof | Testimonial | trust |
|
|
43
|
+
| Pricing | Value Stack | confidence |
|
|
44
|
+
| CTA | AIDA, Urgency | urgency |
|
|
45
|
+
|
|
46
|
+
## Headline Patterns
|
|
47
|
+
|
|
48
|
+
### Power Words
|
|
49
|
+
- "Stop [bad thing]"
|
|
50
|
+
- "Get [desired result] in [timeframe]"
|
|
51
|
+
- "The [adjective] way to [action]"
|
|
52
|
+
- "Why [audience] choose [product]"
|
|
53
|
+
- "[Number] ways to [achieve goal]"
|
|
54
|
+
|
|
55
|
+
### Contrast Patterns
|
|
56
|
+
- "[Old way] is dead. Meet [new way]."
|
|
57
|
+
- "Don't [bad action]. Instead, [good action]."
|
|
58
|
+
- "From [pain point] to [benefit]."
|
|
59
|
+
|
|
60
|
+
### Social Proof Patterns
|
|
61
|
+
- "[Number]+ [users/companies] trust [product]"
|
|
62
|
+
- "Join [notable company] and [notable company]"
|
|
63
|
+
- "As seen in [publication]"
|
|
64
|
+
|
|
65
|
+
## Search Commands
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Find formula for slide type
|
|
69
|
+
python ../design-system/scripts/search-slides.py "problem agitation" -d copy
|
|
70
|
+
|
|
71
|
+
# Get emotion-appropriate formula
|
|
72
|
+
python ../design-system/scripts/search-slides.py "urgency cta" -d copy
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quick Reference
|
|
76
|
+
|
|
77
|
+
| Need | Use Formula |
|
|
78
|
+
|------|------------|
|
|
79
|
+
| Create urgency | Cost of Inaction, Scarcity |
|
|
80
|
+
| Build trust | Social Proof, Testimonial |
|
|
81
|
+
| Show value | FAB, Value Stack |
|
|
82
|
+
| Drive action | AIDA, CTA |
|
|
83
|
+
| Tell story | BAB, Story Arc |
|
|
84
|
+
| Present data | Proof Stack |
|