bps-kit 1.0.2 → 1.0.4

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.
Files changed (85) hide show
  1. package/bin/cli.js +4 -4
  2. package/package.json +1 -1
  3. package/templates/{.agents → agents-template}/rules/GEMINI.md +5 -5
  4. package/templates/skills_extra/nodejs-best-practices/SKILL.md +8 -2
  5. package/templates/skills_normal/api-patterns/SKILL.md +7 -2
  6. package/templates/skills_normal/app-builder/SKILL.md +8 -3
  7. package/templates/skills_normal/app-builder/tech-stack.md +2 -2
  8. package/templates/skills_normal/app-builder/templates/SKILL.md +7 -2
  9. package/templates/skills_normal/app-builder/templates/nextjs-fullstack/TEMPLATE.md +39 -79
  10. package/templates/skills_normal/app-builder/templates/nextjs-saas/TEMPLATE.md +53 -75
  11. package/templates/skills_normal/app-builder/templates/nextjs-static/TEMPLATE.md +56 -119
  12. package/templates/skills_normal/app-builder/templates/nuxt-app/TEMPLATE.md +61 -94
  13. package/templates/skills_normal/app-builder/templates/react-native-app/TEMPLATE.md +56 -82
  14. package/templates/skills_normal/behavioral-modes/SKILL.md +7 -2
  15. package/templates/skills_normal/brainstorming/SKILL.md +173 -104
  16. package/templates/skills_normal/clean-code/SKILL.md +90 -197
  17. package/templates/skills_normal/database-design/SKILL.md +7 -2
  18. package/templates/skills_normal/frontend-design/LICENSE.txt +177 -0
  19. package/templates/skills_normal/frontend-design/SKILL.md +172 -313
  20. package/templates/skills_normal/lint-and-validate/SKILL.md +7 -2
  21. package/templates/skills_normal/lint-and-validate/scripts/lint_runner.py +2 -14
  22. package/templates/skills_normal/performance-profiling/SKILL.md +7 -2
  23. package/templates/skills_normal/plan-writing/SKILL.md +4 -2
  24. package/templates/skills_normal/seo-fundamentals/SKILL.md +125 -79
  25. package/templates/skills_normal/systematic-debugging/CREATION-LOG.md +119 -0
  26. package/templates/skills_normal/systematic-debugging/SKILL.md +275 -85
  27. package/templates/skills_normal/systematic-debugging/condition-based-waiting-example.ts +158 -0
  28. package/templates/skills_normal/systematic-debugging/condition-based-waiting.md +115 -0
  29. package/templates/skills_normal/systematic-debugging/defense-in-depth.md +122 -0
  30. package/templates/skills_normal/systematic-debugging/find-polluter.sh +63 -0
  31. package/templates/skills_normal/systematic-debugging/root-cause-tracing.md +169 -0
  32. package/templates/skills_normal/systematic-debugging/test-academic.md +14 -0
  33. package/templates/skills_normal/systematic-debugging/test-pressure-1.md +58 -0
  34. package/templates/skills_normal/systematic-debugging/test-pressure-2.md +68 -0
  35. package/templates/skills_normal/systematic-debugging/test-pressure-3.md +69 -0
  36. package/templates/skills_normal/tailwind-patterns/SKILL.md +8 -2
  37. package/templates/skills_normal/testing-patterns/SKILL.md +212 -125
  38. package/templates/skills_normal/vulnerability-scanner/SKILL.md +7 -2
  39. package/templates/.agents/agents/backend-specialist.md +0 -263
  40. package/templates/.agents/agents/code-archaeologist.md +0 -106
  41. package/templates/.agents/agents/database-architect.md +0 -226
  42. package/templates/.agents/agents/debugger.md +0 -225
  43. package/templates/.agents/agents/devops-engineer.md +0 -242
  44. package/templates/.agents/agents/documentation-writer.md +0 -104
  45. package/templates/.agents/agents/explorer-agent.md +0 -73
  46. package/templates/.agents/agents/frontend-specialist.md +0 -593
  47. package/templates/.agents/agents/game-developer.md +0 -162
  48. package/templates/.agents/agents/mobile-developer.md +0 -377
  49. package/templates/.agents/agents/orchestrator.md +0 -416
  50. package/templates/.agents/agents/penetration-tester.md +0 -188
  51. package/templates/.agents/agents/performance-optimizer.md +0 -187
  52. package/templates/.agents/agents/product-manager.md +0 -112
  53. package/templates/.agents/agents/product-owner.md +0 -95
  54. package/templates/.agents/agents/project-planner.md +0 -406
  55. package/templates/.agents/agents/qa-automation-engineer.md +0 -103
  56. package/templates/.agents/agents/security-auditor.md +0 -170
  57. package/templates/.agents/agents/seo-specialist.md +0 -111
  58. package/templates/.agents/agents/test-engineer.md +0 -158
  59. package/templates/.agents/scripts/auto_preview.py +0 -148
  60. package/templates/.agents/scripts/checklist.py +0 -217
  61. package/templates/.agents/scripts/session_manager.py +0 -120
  62. package/templates/.agents/scripts/verify_all.py +0 -327
  63. package/templates/.agents/workflows/brainstorm.md +0 -113
  64. package/templates/.agents/workflows/create.md +0 -59
  65. package/templates/.agents/workflows/debug.md +0 -103
  66. package/templates/.agents/workflows/deploy.md +0 -176
  67. package/templates/.agents/workflows/enhance.md +0 -63
  68. package/templates/.agents/workflows/orchestrate.md +0 -237
  69. package/templates/.agents/workflows/plan.md +0 -89
  70. package/templates/.agents/workflows/preview.md +0 -81
  71. package/templates/.agents/workflows/status.md +0 -86
  72. package/templates/.agents/workflows/test.md +0 -144
  73. package/templates/.agents/workflows/ui-ux-pro-max.md +0 -296
  74. package/templates/skills_normal/brainstorming/dynamic-questioning.md +0 -350
  75. package/templates/skills_normal/frontend-design/animation-guide.md +0 -331
  76. package/templates/skills_normal/frontend-design/color-system.md +0 -311
  77. package/templates/skills_normal/frontend-design/decision-trees.md +0 -418
  78. package/templates/skills_normal/frontend-design/motion-graphics.md +0 -306
  79. package/templates/skills_normal/frontend-design/scripts/accessibility_checker.py +0 -183
  80. package/templates/skills_normal/frontend-design/scripts/ux_audit.py +0 -722
  81. package/templates/skills_normal/frontend-design/typography-system.md +0 -345
  82. package/templates/skills_normal/frontend-design/ux-psychology.md +0 -1116
  83. package/templates/skills_normal/frontend-design/visual-effects.md +0 -383
  84. package/templates/skills_normal/testing-patterns/scripts/test_runner.py +0 -219
  85. /package/templates/{.agents → agents-template}/workflows/setup-brain.md +0 -0
@@ -1,350 +0,0 @@
1
- # Dynamic Question Generation
2
-
3
- > **PRINCIPLE:** Questions are not about gathering data—they are about **revealing architectural consequences**.
4
- >
5
- > Every question must connect to a concrete implementation decision that affects cost, complexity, or timeline.
6
-
7
- ---
8
-
9
- ## 🧠 Core Principles
10
-
11
- ### 1. Questions Reveal Consequences
12
-
13
- A good question is not "What color do you want?" but:
14
-
15
- ```markdown
16
- ❌ BAD: "What authentication method?"
17
- ✅ GOOD: "Should users sign up with email/password or social login?
18
-
19
- Impact:
20
- - Email/Pass → Need password reset, hashing, 2FA infrastructure
21
- - Social → OAuth providers, user profile mapping, less control
22
-
23
- Trade-off: Security vs. Development time vs. User friction"
24
- ```
25
-
26
- ### 2. Context Before Content
27
-
28
- First understand **where** this request fits:
29
-
30
- | Context | Question Focus |
31
- |---------|----------------|
32
- | **Greenfield** (new project) | Foundation decisions: stack, hosting, scale |
33
- | **Feature Addition** | Integration points, existing patterns, breaking changes |
34
- | **Refactor** | Why refactor? Performance? Maintainability? What's broken? |
35
- | **Debug** | Symptoms → Root cause → Reproduction path |
36
-
37
- ### 3. Minimum Viable Questions
38
-
39
- **PRINCIPLE:** Each question must eliminate a fork in the implementation road.
40
-
41
- ```
42
- Before Question:
43
- ├── Path A: Do X (5 min)
44
- ├── Path B: Do Y (15 min)
45
- └── Path C: Do Z (1 hour)
46
-
47
- After Question:
48
- └── Path Confirmed: Do X (5 min)
49
- ```
50
-
51
- If a question doesn't reduce implementation paths → **DELETE IT**.
52
-
53
- ### 4. Questions Generate Data, Not Assumptions
54
-
55
- ```markdown
56
- ❌ ASSUMPTION: "User probably wants Stripe for payments"
57
- ✅ QUESTION: "Which payment provider fits your needs?
58
-
59
- Stripe → Best documentation, 2.9% + $0.30, US-centric
60
- LemonSqueezy → Merchant of Record, 5% + $0.50, global taxes
61
- Paddle → Complex pricing, handles EU VAT, enterprise focus"
62
- ```
63
-
64
- ---
65
-
66
- ## 📋 Question Generation Algorithm
67
-
68
- ```
69
- INPUT: User request + Context (greenfield/feature/refactor/debug)
70
-
71
- ├── STEP 1: Parse Request
72
- │ ├── Extract domain (ecommerce, auth, realtime, cms, etc.)
73
- │ ├── Extract features (explicit and implied)
74
- │ └── Extract scale indicators (users, data volume, frequency)
75
-
76
- ├── STEP 2: Identify Decision Points
77
- │ ├── What MUST be decided before coding? (blocking)
78
- │ ├── What COULD be decided later? (deferable)
79
- │ └── What has ARCHITECTURAL impact? (high-leverage)
80
-
81
- ├── STEP 3: Generate Questions (Priority Order)
82
- │ ├── P0: Blocking decisions (cannot proceed without answer)
83
- │ ├── P1: High-leverage (affects >30% of implementation)
84
- │ ├── P2: Medium-leverage (affects specific features)
85
- │ └── P3: Nice-to-have (edge cases, optimization)
86
-
87
- └── STEP 4: Format Each Question
88
- ├── What: Clear question
89
- ├── Why: Impact on implementation
90
- ├── Options: Trade-offs (not just A vs B)
91
- └── Default: What happens if user doesn't answer
92
- ```
93
-
94
- ---
95
-
96
- ## 🎯 Domain-Specific Question Banks
97
-
98
- ### E-Commerce
99
-
100
- | Question | Why It Matters | Trade-offs |
101
- |----------|----------------|------------|
102
- | **Single or Multi-vendor?** | Multi-vendor → Commission logic, vendor dashboards, split payments | +Revenue, -Complexity |
103
- | **Inventory Tracking?** | Needs stock tables, reservation logic, low-stock alerts | +Accuracy, -Development time |
104
- | **Digital or Physical Products?** | Digital → Download links, no shipping | Physical → Shipping APIs, tracking |
105
- | **Subscription or One-time?** | Subscription → Recurring billing, dunning, proration | +Revenue, -Complexity |
106
-
107
- ### Authentication
108
-
109
- | Question | Why It Matters | Trade-offs |
110
- |----------|----------------|------------|
111
- | **Social Login Needed?** | OAuth providers vs. password reset infrastructure | +UX, -Control |
112
- | **Role-Based Permissions?** | RBAC tables, policy enforcement, admin UI | +Security, -Development time |
113
- | **2FA Required?** | TOTP/SMI infrastructure, backup codes, recovery flow | +Security, -UX friction |
114
- | **Email Verification?** | Verification tokens, email service, resend logic | +Security, -Sign-up friction |
115
-
116
- ### Real-time
117
-
118
- | Question | Why It Matters | Trade-offs |
119
- |----------|----------------|------------|
120
- | **WebSocket or Polling?** | WS → Server scaling, connection management | Polling → Simpler, higher latency |
121
- | **Expected Concurrent Users?** | <100 → Single server, >1000 → Redis pub/sub, >10k → specialized infra | +Scale, -Complexity |
122
- | **Message Persistence?** | History tables, storage costs, pagination | +UX, -Storage |
123
- | **Ephemeral or Durable?** | Ephemeral → In-memory, Durable → Database write before emit | +Reliability, -Latency |
124
-
125
- ### Content/CMS
126
-
127
- | Question | Why It Matters | Trade-offs |
128
- |----------|----------------|------------|
129
- | **Rich Text or Markdown?** | Rich Text → Sanitization, XSS risks | Markdown → Simple, no WYSIWYG |
130
- | **Draft/Publish Workflow?** | Status field, scheduled jobs, versioning | +Control, -Complexity |
131
- | **Media Handling?** | Upload endpoints, storage, optimization | +Features, -Development time |
132
- | **Multi-language?** | i18n tables, translation UI, fallback logic | +Reach, -Complexity |
133
-
134
- ---
135
-
136
- ## 📐 Dynamic Question Template
137
-
138
- ```markdown
139
- Based on your request for [DOMAIN] [FEATURE]:
140
-
141
- ## 🔴 CRITICAL (Blocking Decisions)
142
-
143
- ### 1. **[DECISION POINT]**
144
-
145
- **Question:** [Clear, specific question]
146
-
147
- **Why This Matters:**
148
- - [Explain architectural consequence]
149
- - [Affects: cost / complexity / timeline / scale]
150
-
151
- **Options:**
152
- | Option | Pros | Cons | Best For |
153
- |--------|------|------|----------|
154
- | A | [Advantage] | [Disadvantage] | [Use case] |
155
- | B | [Advantage] | [Disadvantage] | [Use case] |
156
-
157
- **If Not Specified:** [Default choice + rationale]
158
-
159
- ---
160
-
161
- ## 🟡 HIGH-LEVERAGE (Affects Implementation)
162
-
163
- ### 2. **[DECISION POINT]**
164
- [Same format]
165
-
166
- ---
167
-
168
- ## 🟢 NICE-TO-HAVE (Edge Cases)
169
-
170
- ### 3. **[DECISION POINT]**
171
- [Same format]
172
- ```
173
-
174
- ---
175
-
176
- ## 🔄 Iterative Questioning
177
-
178
- ### First Pass (3-5 Questions)
179
- Focus on **blocking decisions**. Don't proceed without answers.
180
-
181
- ### Second Pass (After Initial Implementation)
182
- As patterns emerge, ask:
183
- - "This feature implies [X]. Should we handle [edge case] now or defer?"
184
- - "We're using [Pattern A]. Should [Feature B] follow the same pattern?"
185
-
186
- ### Third Pass (Optimization)
187
- When functionality works:
188
- - "Performance bottleneck at [X]. Optimize now or acceptable for now?"
189
- - "Refactor [Y] for maintainability or ship as-is?"
190
-
191
- ---
192
-
193
- ## 🎭 Example: Full Question Generation
194
-
195
- ```
196
- USER REQUEST: "Build an Instagram clone"
197
-
198
- STEP 1: Parse
199
- ├── Domain: Social Media
200
- ├── Features: Photo sharing, engagement (likes/comments), user profiles
201
- ├── Implied: Feed, following, authentication
202
- └── Scale: Potentially high (social apps go viral)
203
-
204
- STEP 2: Decision Points
205
- ├── Blocking: Storage strategy, authentication method, feed type
206
- ├── High-leverage: Real-time notifications, data model complexity
207
- └── Deferable: Analytics, advanced search, reels/video
208
-
209
- STEP 3: Generate Questions (Priority)
210
-
211
- P0 (Blocking):
212
- 1. Storage Strategy → Affects architecture, cost, speed
213
- 2. Feed Algorithm → Affects database queries, complexity
214
- 3. Auth Method → Affects dev time, UX, security
215
-
216
- P1 (High-leverage):
217
- 4. Real-time Notifications → WebSocket vs polling
218
- 5. Media Processing → Client-side vs server-side optimization
219
-
220
- P2 (Deferable):
221
- 6. Story/Reels → Major feature creep, defer to v2
222
- 7. DM/Chat → Separate subsystem, defer to v2
223
-
224
- STEP 4: Format Output
225
- ```
226
-
227
- ---
228
-
229
- ## 📊 Generated Output (Example)
230
-
231
- ```
232
- Based on your Instagram clone request:
233
-
234
- ## 🔴 CRITICAL DECISIONS (Cannot Proceed Without Answers)
235
-
236
- ### 1. **Photo Storage Strategy**
237
-
238
- **Question:** Where will user photos be stored and served?
239
-
240
- **Why This Matters:**
241
- - Affects: Monthly hosting costs, page load speed, CDN complexity
242
- - High-volume social apps: 1000 users × 10 photos × 2MB = 20GB storage
243
-
244
- **Options:**
245
- | Option | Cost | Speed | Complexity | Best For |
246
- |--------|------|-------|------------|----------|
247
- | **Cloudinary** | $89/mo (25GB) | Fast (CDN) | Low | MVP, rapid launch |
248
- | **AWS S3 + CloudFront** | $0.023/GB | Fast (CDN) | Medium | Production, cost-optimized |
249
- | **Supabase Storage** | Free tier 1GB | Medium | Low | Small scale, simple |
250
- | **Local Storage** | Server cost | Slow | Low | Development only |
251
-
252
- **If Not Specified:** Cloudinary (balanced for MVP)
253
-
254
- ---
255
-
256
- ### 2. **Feed Algorithm Choice**
257
-
258
- **Question:** How should the main feed work?
259
-
260
- **Why This Matters:**
261
- - Affects: Database query complexity, caching strategy, development time
262
- - Algorithmic feeds require ML infrastructure, ranking signals
263
-
264
- **Options:**
265
- | Option | Complexity | Database Impact | Best For |
266
- |--------|------------|-----------------|----------|
267
- | **Chronological** | Low | Simple query | Early stage, transparency |
268
- | **Follow-Only** | Medium | JOIN with pagination | Most social apps |
269
- | **Algorithmic** | High | Pre-computed feed tables | Instagram competitor |
270
-
271
- **If Not Specified:** Follow-Only (balanced for social app)
272
-
273
- ---
274
-
275
- ### 3. **Authentication Approach**
276
-
277
- **Question:** How do users sign up and login?
278
-
279
- **Why This Matters:**
280
- - Affects: Development time (2-5 hours), security posture, UX friction
281
-
282
- **Options:**
283
- | Option | Dev Time | Security | UX | Best For |
284
- |--------|----------|----------|-----|----------|
285
- | **Email/Password** | 4-5 hrs | High (if 2FA) | Medium | Full control needed |
286
- | **Social Only** | 1-2 hrs | Provider-dependent | Smooth | B2C, rapid launch |
287
- | **Magic Link** | 2-3 hrs | Medium | Very smooth | Security-focused |
288
- | **Clerk/Auth0** | 1 hr | High | Smooth | Fastest to market |
289
-
290
- **If Not Specified:** Clerk (fastest for MVP)
291
-
292
- ---
293
-
294
- ## 🟡 HIGH-LEVERAGE (Affects Architecture)
295
-
296
- ### 4. **Real-time Notifications**
297
-
298
- **Question:** Do users need instant notifications for likes/comments?
299
-
300
- **Why This Matters:**
301
- - WebSocket adds infrastructure complexity (Redis pub/sub for scaling)
302
- - Polling is simpler but higher latency
303
-
304
- **Options:**
305
- | Option | Complexity | Scale Cost | Best For |
306
- |--------|------------|------------|----------|
307
- | **WebSocket + Redis** | High | $10+/mo | >1000 concurrent users |
308
- | **Polling (30s)** | Low | DB queries | <1000 users |
309
- | **No Real-time** | None | None | MVP, validate first |
310
-
311
- **If Not Specified:** Polling for MVP (defer WebSocket until validated)
312
-
313
- ---
314
-
315
- ## 🟢 NICE-TO-HAVE (Defer to v2)
316
-
317
- ### 5. **Video/Reels Support**
318
- - Major complexity (video processing, streaming infrastructure)
319
- - Recommendation: Launch with photos only, add video after validation
320
-
321
- ### 6. **Direct Messaging**
322
- - Separate subsystem (chat infrastructure different from feed)
323
- - Recommendation: Use Pusher/Stream for real-time or defer entirely
324
-
325
- ---
326
-
327
- ## 📋 Summary
328
-
329
- | Decision | Recommendation | If Changed |
330
- |----------|----------------|------------|
331
- | Storage | Cloudinary | +3 hrs setup |
332
- | Feed | Follow-only | +2 hrs query optimization |
333
- | Auth | Clerk | -3 hrs dev time |
334
- | Real-time | Polling | +5 hrs WebSocket setup |
335
- | Video | Defer to v2 | N/A |
336
- | DM | Defer to v2 | N/A |
337
-
338
- **Total Estimated MVP Time:** 15-20 hours with recommendations above
339
- ```
340
-
341
- ---
342
-
343
- ## 🎯 Principles Recap
344
-
345
- 1. **Every question = Architectural decision** → Not data gathering
346
- 2. **Show trade-offs** → User understands consequences
347
- 3. **Prioritize blocking decisions** → Cannot proceed without
348
- 4. **Provide defaults** → If user doesn't answer, we proceed anyway
349
- 5. **Domain-aware** → Ecommerce questions ≠ Auth questions ≠ Real-time questions
350
- 6. **Iterative** → More questions as patterns emerge during implementation
@@ -1,331 +0,0 @@
1
- # Animation Guidelines Reference
2
-
3
- > Animation principles and timing psychology - learn to decide, not copy.
4
- > **No fixed durations to memorize - understand what affects timing.**
5
-
6
- ---
7
-
8
- ## 1. Duration Principles
9
-
10
- ### What Affects Timing
11
-
12
- ```
13
- Factors that determine animation speed:
14
- ├── DISTANCE: Further travel = longer duration
15
- ├── SIZE: Larger elements = slower animations
16
- ├── COMPLEXITY: Complex = slower to process
17
- ├── IMPORTANCE: Critical actions = clear feedback
18
- └── CONTEXT: Urgent = fast, luxurious = slow
19
- ```
20
-
21
- ### Duration Ranges by Purpose
22
-
23
- | Purpose | Range | Why |
24
- |---------|-------|-----|
25
- | Instant feedback | 50-100ms | Below perception threshold |
26
- | Micro-interactions | 100-200ms | Quick but noticeable |
27
- | Standard transitions | 200-300ms | Comfortable pace |
28
- | Complex animations | 300-500ms | Time to follow |
29
- | Page transitions | 400-600ms | Smooth handoff |
30
- | **Wow/Premium Effects** | 800ms+ | Dramatic, organic spring-based, layered |
31
-
32
- ### Choosing Duration
33
-
34
- Ask yourself:
35
- 1. How far is the element moving?
36
- 2. How important is it to notice this change?
37
- 3. Is the user waiting, or is this background?
38
-
39
- ---
40
-
41
- ## 2. Easing Principles
42
-
43
- ### What Easing Does
44
-
45
- ```
46
- Easing = how speed changes over time
47
- ├── Linear: constant speed (mechanical, robotic)
48
- ├── Ease-out: fast start, slow end (natural entry)
49
- ├── Ease-in: slow start, fast end (natural exit)
50
- └── Ease-in-out: slow both ends (smooth, deliberate)
51
- ```
52
-
53
- ### When to Use Each
54
-
55
- | Easing | Best For | Feels Like |
56
- |--------|----------|------------|
57
- | **Ease-out** | Elements entering | Arriving, settling |
58
- | **Ease-in** | Elements leaving | Departing, exiting |
59
- | **Ease-in-out** | Emphasis, loops | Deliberate, smooth |
60
- | **Linear** | Continuous motion | Mechanical, constant |
61
- | **Bounce/Elastic** | Playful UI | Fun, energetic |
62
-
63
- ### The Pattern
64
-
65
- ```css
66
- /* Entering view = ease-out (decelerate) */
67
- .enter {
68
- animation-timing-function: ease-out;
69
- }
70
-
71
- /* Leaving view = ease-in (accelerate) */
72
- .exit {
73
- animation-timing-function: ease-in;
74
- }
75
-
76
- /* Continuous = ease-in-out */
77
- .continuous {
78
- animation-timing-function: ease-in-out;
79
- }
80
- ```
81
-
82
- ---
83
-
84
- ## 3. Micro-Interaction Principles
85
-
86
- ### What Makes Good Micro-Interactions
87
-
88
- ```
89
- Purpose of micro-interactions:
90
- ├── FEEDBACK: Confirm the action happened
91
- ├── GUIDANCE: Show what's possible
92
- ├── STATUS: Indicate current state
93
- └── DELIGHT: Small moments of joy
94
- ```
95
-
96
- ### Button States
97
-
98
- ```
99
- Hover → slight visual change (lift, color, scale)
100
- Active → pressed feeling (scale down, shadow change)
101
- Focus → clear indicator (outline, ring)
102
- Loading → progress indicator (spinner, skeleton)
103
- Success → confirmation (check, color)
104
- ```
105
-
106
- ### Principles
107
-
108
- 1. **Respond immediately** (under 100ms perception)
109
- 2. **Match the action** (press = `scale(0.95)`, hover = `translateY(-4px) + glow`)
110
- 3. **Be bold but smooth** (Usta işi hissettir)
111
- 4. **Be consistent** (same actions = same feedback)
112
-
113
- ---
114
-
115
- ## 4. Loading States Principles
116
-
117
- ### Types by Context
118
-
119
- | Situation | Approach |
120
- |-----------|----------|
121
- | Quick load (<1s) | No indicator needed |
122
- | Medium (1-3s) | Spinner or simple animation |
123
- | Long (3s+) | Progress bar or skeleton |
124
- | Unknown duration | Indeterminate indicator |
125
-
126
- ### Skeleton Screens
127
-
128
- ```
129
- Purpose: Reduce perceived wait time
130
- ├── Show layout shape immediately
131
- ├── Animate subtly (shimmer, pulse)
132
- ├── Replace with content when ready
133
- └── Feels faster than spinner
134
- ```
135
-
136
- ### Progress Indicators
137
-
138
- ```
139
- When to show progress:
140
- ├── User-initiated action
141
- ├── File uploads/downloads
142
- ├── Multi-step processes
143
- └── Long operations
144
-
145
- When NOT needed:
146
- ├── Very quick operations
147
- ├── Background tasks
148
- └── Initial page loads (skeleton better)
149
- ```
150
-
151
- ---
152
-
153
- ## 5. Page Transitions Principles
154
-
155
- ### Transition Strategy
156
-
157
- ```
158
- Simple rule: exit fast, enter slower
159
- ├── Outgoing content fades quickly
160
- ├── Incoming content animates in
161
- └── Avoids "everything moving at once"
162
- ```
163
-
164
- ### Common Patterns
165
-
166
- | Pattern | When to Use |
167
- |---------|-------------|
168
- | **Fade** | Safe default, works everywhere |
169
- | **Slide** | Sequential navigation (prev/next) |
170
- | **Scale** | Opening/closing modals |
171
- | **Shared element** | Maintaining visual continuity |
172
-
173
- ### Direction Matching
174
-
175
- ```
176
- Navigation direction = animation direction
177
- ├── Forward → slide from right
178
- ├── Backward → slide from left
179
- ├── Deeper → scale up from center
180
- ├── Back up → scale down
181
- ```
182
-
183
- ---
184
-
185
- ## 6. Scroll Animation Principles
186
-
187
- ### Progressive Reveal
188
-
189
- ```
190
- Content appears as user scrolls:
191
- ├── Reduces initial cognitive load
192
- ├── Rewards exploration
193
- ├── Must not feel sluggish
194
- └── Option to disable (accessibility)
195
- ```
196
-
197
- ### Trigger Points
198
-
199
- | When to Trigger | Effect |
200
- |-----------------|--------|
201
- | Just entering viewport | Standard reveal |
202
- | Centered in viewport | For emphasis |
203
- | Partially visible | Earlier reveal |
204
- | Fully visible | Late trigger |
205
-
206
- ### Animation Properties
207
-
208
- - Fade in (opacity)
209
- - Slide up (transform)
210
- - Scale (transform)
211
- - Combination of above
212
-
213
- ### Performance
214
-
215
- - Use Intersection Observer
216
- - Animate only transform/opacity
217
- - Reduce on mobile if needed
218
-
219
- ---
220
-
221
- ## 7. Hover Effects Principles
222
-
223
- ### Matching Effect to Action
224
-
225
- | Element | Effect | Intent |
226
- |---------|--------|--------|
227
- | **Clickable card** | Lift + shadow | "This is interactive" |
228
- | **Button** | Color/brightness change | "Press me" |
229
- | **Image** | Zoom/scale | "View closer" |
230
- | **Link** | Underline/color | "Navigate here" |
231
-
232
- ### Principles
233
-
234
- 1. **Signal interactivity** - hover shows it's clickable
235
- 2. **Don't overdo it** - subtle changes work
236
- 3. **Match importance** - bigger change = more important
237
- 4. **Touch alternatives** - hover doesn't work on mobile
238
-
239
- ---
240
-
241
- ## 8. Feedback Animation Principles
242
-
243
- ### Success States
244
-
245
- ```
246
- Celebrate appropriately:
247
- ├── Minor action → subtle check/color
248
- ├── Major action → more pronounced animation
249
- ├── Completion → satisfying animation
250
- └── Match brand personality
251
- ```
252
-
253
- ### Error States
254
-
255
- ```
256
- Draw attention without panic:
257
- ├── Color change (semantic red)
258
- ├── Shake animation (brief!)
259
- ├── Focus on error field
260
- └── Clear messaging
261
- ```
262
-
263
- ### Timing
264
-
265
- - Success: slightly longer (enjoy the moment)
266
- - Error: quick (don't delay action)
267
- - Loading: continuous until complete
268
-
269
- ---
270
-
271
- ## 9. Performance Principles
272
-
273
- ### What's Cheap to Animate
274
-
275
- ```
276
- GPU-accelerated (FAST):
277
- ├── transform: translate, scale, rotate
278
- └── opacity: 0 to 1
279
-
280
- CPU-intensive (SLOW):
281
- ├── width, height
282
- ├── top, left, right, bottom
283
- ├── margin, padding
284
- ├── border-radius changes
285
- └── box-shadow changes
286
- ```
287
-
288
- ### Optimization Strategies
289
-
290
- 1. **Animate transform/opacity** whenever possible
291
- 2. **Avoid layout triggers** (size/position changes)
292
- 3. **Use will-change sparingly** (hints to browser)
293
- 4. **Test on low-end devices** (not just dev machine)
294
-
295
- ### Respecting User Preferences
296
-
297
- ```css
298
- @media (prefers-reduced-motion: reduce) {
299
- /* Honor this preference */
300
- /* Essential animations only */
301
- /* Reduce or remove decorative motion */
302
- }
303
- ```
304
-
305
- ---
306
-
307
- ## 10. Animation Decision Checklist
308
-
309
- Before adding animation:
310
-
311
- - [ ] **Is there a purpose?** (feedback/guidance/delight)
312
- - [ ] **Is timing appropriate?** (not too fast/slow)
313
- - [ ] **Did you pick correct easing?** (enter/exit/emphasis)
314
- - [ ] **Is it performant?** (transform/opacity only)
315
- - [ ] **Tested reduced motion?** (accessibility)
316
- - [ ] **Consistent with other animations?** (same timing feel)
317
- - [ ] **Not your default settings?** (variety check)
318
- - [ ] **Asked user about style if unclear?**
319
-
320
- ### Anti-Patterns
321
-
322
- - ❌ Same timing values every project
323
- - ❌ Animation for animation's sake
324
- - ❌ Ignoring reduced-motion preference
325
- - ❌ Animating expensive properties
326
- - ❌ Too many things animating at once
327
- - ❌ Delays that frustrate users
328
-
329
- ---
330
-
331
- > **Remember**: Animation is communication. Every motion should have meaning and serve the user experience.