vibes-plug 1.0.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/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/BLUEPRINT.md +125 -0
- package/CHANGELOG.md +195 -0
- package/CONTRIBUTING.md +199 -0
- package/LICENSE +21 -0
- package/README.md +263 -0
- package/SECURITY.md +21 -0
- package/banner.png +0 -0
- package/package.json +25 -0
- package/plugin.json +8 -0
- package/scripts/update_skills.js +75 -0
- package/skills/ai-llm-integration-expert/SKILL.md +162 -0
- package/skills/api-design-expert/SKILL.md +310 -0
- package/skills/app-analyzer-optimizer/SKILL.md +189 -0
- package/skills/asisten_ramah/SKILL.md +41 -0
- package/skills/authentication-identity-expert/SKILL.md +45 -0
- package/skills/auto-doc-updater/SKILL.md +204 -0
- package/skills/bootstrap-to-modern/SKILL.md +87 -0
- package/skills/brainstorming/SKILL.md +353 -0
- package/skills/bun-runtime-expert/SKILL.md +211 -0
- package/skills/ci-cd-devops-architect/SKILL.md +45 -0
- package/skills/cloud-hosting-expert/SKILL.md +244 -0
- package/skills/coderabbit/SKILL.md +192 -0
- package/skills/data-telemetry-expert/SKILL.md +213 -0
- package/skills/database-orm-expert/SKILL.md +294 -0
- package/skills/design-system-architect/SKILL.md +243 -0
- package/skills/e2e-testing-expert/SKILL.md +315 -0
- package/skills/event-driven-architect/SKILL.md +81 -0
- package/skills/firebase-security-expert/SKILL.md +195 -0
- package/skills/fullstack-expert/SKILL.md +202 -0
- package/skills/fullstack-expert/references/api_design_guide.md +466 -0
- package/skills/fullstack-expert/references/devops_infrastructure.md +477 -0
- package/skills/fullstack-expert/references/multi_language_backend.md +528 -0
- package/skills/fullstack-expert/references/system_design_patterns.md +358 -0
- package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -0
- package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -0
- package/skills/gemini-agent-booster/SKILL.md +135 -0
- package/skills/global-a11y-i18n-expert/SKILL.md +81 -0
- package/skills/go-programming-expert/SKILL.md +295 -0
- package/skills/hig/SKILL.md +188 -0
- package/skills/js-backend-expert/SKILL.md +192 -0
- package/skills/mcp-server-architect/SKILL.md +194 -0
- package/skills/mobile-expo-expert/SKILL.md +186 -0
- package/skills/monday-design-aesthetic/SKILL.md +67 -0
- package/skills/monorepo-architect/SKILL.md +227 -0
- package/skills/mpa-orchestrator/SKILL.md +101 -0
- package/skills/multi-agent-orchestration/SKILL.md +234 -0
- package/skills/multiple-entry-points/SKILL.md +55 -0
- package/skills/mvc-expert/SKILL.md +231 -0
- package/skills/payment-gateway-expert/SKILL.md +45 -0
- package/skills/performance-web-vitals/SKILL.md +332 -0
- package/skills/prd-architect/SKILL.md +191 -0
- package/skills/production-ready-hardener/SKILL.md +469 -0
- package/skills/production-ready-hardener/references/performance_optimization.md +441 -0
- package/skills/production-ready-hardener/references/production_checklist.md +161 -0
- package/skills/production-ready-hardener/references/security_hardening_guide.md +379 -0
- package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +875 -0
- package/skills/python-programming-expert/SKILL.md +271 -0
- package/skills/realtime-collaboration-expert/SKILL.md +45 -0
- package/skills/rust-programming-expert/SKILL.md +235 -0
- package/skills/saas-billing/SKILL.md +377 -0
- package/skills/saas-multi-tenant/SKILL.md +237 -0
- package/skills/saas-mvp-launcher/SKILL.md +231 -0
- package/skills/saas-transformer/SKILL.md +446 -0
- package/skills/saas-transformer/references/billing_integration_guide.md +401 -0
- package/skills/saas-transformer/references/feature_gating_patterns.md +137 -0
- package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -0
- package/skills/saas-transformer/scripts/saas_transformation_scanner.py +254 -0
- package/skills/scalability-clean-code/SKILL.md +229 -0
- package/skills/secure-fuzz-testing/SKILL.md +201 -0
- package/skills/senior-frontend/SKILL.md +161 -0
- package/skills/senior-frontend/references/frontend_best_practices.md +806 -0
- package/skills/senior-frontend/references/nextjs_optimization_guide.md +724 -0
- package/skills/senior-frontend/references/react_patterns.md +746 -0
- package/skills/senior-frontend/scripts/bundle_analyzer.py +407 -0
- package/skills/senior-frontend/scripts/component_generator.py +329 -0
- package/skills/senior-frontend/scripts/frontend_scaffolder.py +1005 -0
- package/skills/senior-fullstack/SKILL.md +167 -0
- package/skills/senior-fullstack/references/architecture_patterns.md +160 -0
- package/skills/senior-fullstack/references/development_workflows.md +222 -0
- package/skills/senior-fullstack/references/tech_stack_guide.md +190 -0
- package/skills/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
- package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
- package/skills/senior-fullstack/scripts/project_scaffolder.py +114 -0
- package/skills/seo/SKILL.md +225 -0
- package/skills/seo/references/cwv-thresholds.md +108 -0
- package/skills/seo/references/eeat-framework.md +214 -0
- package/skills/seo/references/quality-gates.md +155 -0
- package/skills/seo/references/schema-types.md +118 -0
- package/skills/seo-aeo-landing-page-writer/SKILL.md +97 -0
- package/skills/seo-geo/SKILL.md +188 -0
- package/skills/session-handoff-resume/SKILL.md +158 -0
- package/skills/skill_baru/SKILL.md +147 -0
- package/skills/spa-orchestrator/SKILL.md +288 -0
- package/skills/state-management-expert/SKILL.md +272 -0
- package/skills/supabase-migration/SKILL.md +45 -0
- package/skills/supabase-security-expert/SKILL.md +243 -0
- package/skills/tailwind-expert/SKILL.md +188 -0
- package/skills/tanstack-query-expert/SKILL.md +199 -0
- package/skills/tauri-expert/SKILL.md +97 -0
- package/skills/token-saver/SKILL.md +111 -0
- package/skills/typescript-expert/SKILL.md +279 -0
- package/skills/ui-components-expert/SKILL.md +63 -0
- package/skills/ui-ux-pro-max/SKILL.md +201 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/core.py +257 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +493 -0
- package/skills/ui-ux-pro-max/scripts/search.py +81 -0
- package/skills/ui_ux_expert/SKILL.md +114 -0
- package/skills/vibe-code-gardener/SKILL.md +173 -0
- package/skills/web-scraper/SKILL.md +205 -0
- package/skills/web-scraper/references/data-transforms.md +397 -0
- package/skills/web-scraper/references/extraction-patterns.md +475 -0
- package/skills/web-scraper/references/output-templates.md +481 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +180 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-expert
|
|
3
|
+
description: "Expert guide for TypeScript 5.x advanced type system, strict mode, generics, utility types, branded types, and type-safe architectural patterns / Panduan ahli untuk sistem tipe TypeScript 5.x, mode strict, generics, utility types, branded types, dan pola arsitektur type-safe."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TypeScript Expert (TypeScript 5.x Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Expert-level TypeScript development covering the advanced type system, strict mode enforcement, generic programming, utility types, branded types, and type-safe patterns for production applications. Targets **TypeScript 5.4+** features including `NoInfer`, `using` declarations, variadic tuple improvements, and `const` type parameters.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- Writing TypeScript with advanced generic constraints.
|
|
21
|
+
- Enforcing strict type safety in existing codebases.
|
|
22
|
+
- Designing type-safe API contracts (REST, tRPC, Zod schemas).
|
|
23
|
+
- Implementing branded types for domain modeling.
|
|
24
|
+
- Resolving complex type errors or `any` pollution.
|
|
25
|
+
- Setting up `tsconfig.json` for strict projects.
|
|
26
|
+
- Writing TypeScript utility types or type helpers.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### TypeScript 5.x — Key Features
|
|
31
|
+
|
|
32
|
+
#### `using` Declarations (Explicit Resource Management, TS 5.2)
|
|
33
|
+
```typescript
|
|
34
|
+
// Automatically calls [Symbol.dispose] on scope exit
|
|
35
|
+
function processFile(path: string) {
|
|
36
|
+
using handle = openFile(path); // disposed when function exits
|
|
37
|
+
handle.write('data');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Async version with [Symbol.asyncDispose]
|
|
41
|
+
async function processDatabase() {
|
|
42
|
+
await using conn = await getConnection();
|
|
43
|
+
await conn.query('SELECT 1');
|
|
44
|
+
} // conn.close() called automatically
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### `NoInfer<T>` Utility Type (TS 5.4)
|
|
48
|
+
```typescript
|
|
49
|
+
// Prevents unintended type widening in generic inference
|
|
50
|
+
function createState<T>(initial: T, fallback: NoInfer<T>): T {
|
|
51
|
+
return initial ?? fallback;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// TS now errors if fallback type doesn't match initial
|
|
55
|
+
createState('hello', 42); // Error: Argument of type 'number' is not assignable to type 'string'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### `const` Type Parameters (TS 5.0)
|
|
59
|
+
```typescript
|
|
60
|
+
// Infer literal types from generic arguments
|
|
61
|
+
function identity<const T>(value: T): T { return value; }
|
|
62
|
+
|
|
63
|
+
const a = identity(['a', 'b', 'c']); // type: readonly ["a", "b", "c"]
|
|
64
|
+
const b = identity({ x: 10 }); // type: { readonly x: 10 }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Strict Mode Configuration
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
// tsconfig.json — recommended strict config for production
|
|
73
|
+
{
|
|
74
|
+
"compilerOptions": {
|
|
75
|
+
"target": "ES2022",
|
|
76
|
+
"lib": ["ES2022", "DOM"],
|
|
77
|
+
"module": "NodeNext",
|
|
78
|
+
"moduleResolution": "NodeNext",
|
|
79
|
+
"strict": true,
|
|
80
|
+
"noUncheckedIndexedAccess": true,
|
|
81
|
+
"exactOptionalPropertyTypes": true,
|
|
82
|
+
"noImplicitReturns": true,
|
|
83
|
+
"noFallthroughCasesInSwitch": true,
|
|
84
|
+
"noImplicitOverride": true,
|
|
85
|
+
"forceConsistentCasingInFileNames": true,
|
|
86
|
+
"isolatedModules": true,
|
|
87
|
+
"verbatimModuleSyntax": true,
|
|
88
|
+
"skipLibCheck": false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Advanced Type Patterns
|
|
96
|
+
|
|
97
|
+
#### Branded Types for Domain Modeling
|
|
98
|
+
```typescript
|
|
99
|
+
// Prevent mixing semantically different primitives
|
|
100
|
+
type Brand<T, B extends string> = T & { readonly __brand: B };
|
|
101
|
+
|
|
102
|
+
type UserId = Brand<string, 'UserId'>;
|
|
103
|
+
type PostId = Brand<string, 'PostId'>;
|
|
104
|
+
type Email = Brand<string, 'Email'>;
|
|
105
|
+
|
|
106
|
+
// Constructor functions with validation
|
|
107
|
+
function createUserId(id: string): UserId {
|
|
108
|
+
if (!id.startsWith('user_')) throw new Error('Invalid user ID format');
|
|
109
|
+
return id as UserId;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getUser(id: UserId): Promise<User> { /* ... */ }
|
|
113
|
+
|
|
114
|
+
const postId = 'post_abc' as PostId;
|
|
115
|
+
getUser(postId); // Compile error: PostId is not assignable to UserId
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### Discriminated Unions for State Machines
|
|
119
|
+
```typescript
|
|
120
|
+
type ApiState<T> =
|
|
121
|
+
| { status: 'idle' }
|
|
122
|
+
| { status: 'loading' }
|
|
123
|
+
| { status: 'success'; data: T }
|
|
124
|
+
| { status: 'error'; error: Error };
|
|
125
|
+
|
|
126
|
+
function render<T>(state: ApiState<T>) {
|
|
127
|
+
switch (state.status) {
|
|
128
|
+
case 'idle': return 'Idle';
|
|
129
|
+
case 'loading': return 'Loading...';
|
|
130
|
+
case 'success': return `Data: ${JSON.stringify(state.data)}`;
|
|
131
|
+
case 'error': return `Error: ${state.error.message}`;
|
|
132
|
+
// TypeScript enforces exhaustive matching
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Template Literal Types
|
|
138
|
+
```typescript
|
|
139
|
+
type EventName = 'click' | 'focus' | 'blur';
|
|
140
|
+
type HandlerName = `on${Capitalize<EventName>}`;
|
|
141
|
+
// Result: 'onClick' | 'onFocus' | 'onBlur'
|
|
142
|
+
|
|
143
|
+
type DeepReadonly<T> = {
|
|
144
|
+
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
type Paths<T, Prefix extends string = ''> = {
|
|
148
|
+
[K in keyof T & string]: T[K] extends object
|
|
149
|
+
? Paths<T[K], `${Prefix}${K}.`>
|
|
150
|
+
: `${Prefix}${K}`;
|
|
151
|
+
}[keyof T & string];
|
|
152
|
+
|
|
153
|
+
// Paths<{ user: { name: string; age: number } }> = "user.name" | "user.age"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### Conditional Types and `infer`
|
|
157
|
+
```typescript
|
|
158
|
+
type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
|
|
159
|
+
type ArrayElement<T> = T extends (infer U)[] ? U : never;
|
|
160
|
+
type ReturnType<T> = T extends (...args: any[]) => infer R ? R : never;
|
|
161
|
+
|
|
162
|
+
// Extract function parameter types
|
|
163
|
+
type Parameters<T extends (...args: any) => any> =
|
|
164
|
+
T extends (...args: infer P) => any ? P : never;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### Type-Safe Patterns
|
|
170
|
+
|
|
171
|
+
#### Zod Schema + TypeScript Integration
|
|
172
|
+
```typescript
|
|
173
|
+
import { z } from 'zod';
|
|
174
|
+
|
|
175
|
+
const UserSchema = z.object({
|
|
176
|
+
id: z.string().cuid(),
|
|
177
|
+
email: z.string().email(),
|
|
178
|
+
role: z.enum(['USER', 'ADMIN']),
|
|
179
|
+
createdAt: z.coerce.date(),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
type User = z.infer<typeof UserSchema>; // Derive type from schema
|
|
183
|
+
|
|
184
|
+
// Type-safe parsing with error handling
|
|
185
|
+
function parseUser(data: unknown): User {
|
|
186
|
+
return UserSchema.parse(data); // throws ZodError on failure
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const safeResult = UserSchema.safeParse(data);
|
|
190
|
+
if (safeResult.success) {
|
|
191
|
+
console.log(safeResult.data.email); // fully typed
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### Type-Safe Environment Variables
|
|
196
|
+
```typescript
|
|
197
|
+
// env.ts — validate env at startup
|
|
198
|
+
import { z } from 'zod';
|
|
199
|
+
|
|
200
|
+
const envSchema = z.object({
|
|
201
|
+
DATABASE_URL: z.string().url(),
|
|
202
|
+
NEXTAUTH_SECRET: z.string().min(32),
|
|
203
|
+
NODE_ENV: z.enum(['development', 'test', 'production']),
|
|
204
|
+
PORT: z.coerce.number().default(3000),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
export const env = envSchema.parse(process.env);
|
|
208
|
+
// env.PORT is now type `number`, not `string | undefined`
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
#### Generic Repository Pattern
|
|
212
|
+
```typescript
|
|
213
|
+
interface Repository<T, TId> {
|
|
214
|
+
findById(id: TId): Promise<T | null>;
|
|
215
|
+
findMany(filter?: Partial<T>): Promise<T[]>;
|
|
216
|
+
create(data: Omit<T, 'id' | 'createdAt' | 'updatedAt'>): Promise<T>;
|
|
217
|
+
update(id: TId, data: Partial<Omit<T, 'id'>>): Promise<T>;
|
|
218
|
+
delete(id: TId): Promise<void>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
class UserRepository implements Repository<User, UserId> {
|
|
222
|
+
async findById(id: UserId) { /* ... */ }
|
|
223
|
+
// TypeScript enforces all interface methods are implemented
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### Common Pitfalls to Avoid
|
|
230
|
+
|
|
231
|
+
| Anti-Pattern | Problem | Solution |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| `as any` | Disables type checking | Use `unknown` + narrowing or Zod |
|
|
234
|
+
| `as Type` (unsafe cast) | Bypasses structural checking | Use type guards or `satisfies` |
|
|
235
|
+
| `// @ts-ignore` | Silences real errors | Fix the root type issue |
|
|
236
|
+
| `!` non-null assertion | Runtime errors if null | Use optional chaining + nullish coalescing |
|
|
237
|
+
| `Object` / `{}` type | Accepts anything non-null | Use specific types or `Record<string, unknown>` |
|
|
238
|
+
| Implicit `any` in callbacks | Breaks type inference | Always type function parameters |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### The `satisfies` Operator (TS 4.9+)
|
|
243
|
+
```typescript
|
|
244
|
+
// Validates against a type without widening the inferred type
|
|
245
|
+
const config = {
|
|
246
|
+
port: 3000,
|
|
247
|
+
host: 'localhost',
|
|
248
|
+
debug: true,
|
|
249
|
+
} satisfies Record<string, string | number | boolean>;
|
|
250
|
+
|
|
251
|
+
// config.port is still inferred as `3000` (literal), not `number`
|
|
252
|
+
config.port.toFixed(2); // Works! Literal type preserved.
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
<a name="bahasa-indonesia"></a>
|
|
258
|
+
## Bahasa Indonesia
|
|
259
|
+
|
|
260
|
+
### Deskripsi
|
|
261
|
+
Panduan TypeScript level ahli mencakup sistem tipe tingkat lanjut, penerapan strict mode, pemrograman generik, utility types, branded types, dan pola type-safe untuk aplikasi produksi. Menargetkan fitur **TypeScript 5.4+** termasuk `NoInfer`, deklarasi `using`, peningkatan variadic tuple, dan parameter tipe `const`.
|
|
262
|
+
|
|
263
|
+
### Kondisi Pemicu
|
|
264
|
+
- Menulis TypeScript dengan generic constraints tingkat lanjut.
|
|
265
|
+
- Menerapkan type safety ketat di codebase yang ada.
|
|
266
|
+
- Merancang kontrak API type-safe (REST, tRPC, Zod schema).
|
|
267
|
+
- Mengimplementasikan branded types untuk pemodelan domain.
|
|
268
|
+
- Menyelesaikan type error kompleks atau polusi `any`.
|
|
269
|
+
- Menyiapkan `tsconfig.json` untuk proyek strict.
|
|
270
|
+
- Menulis utility types atau type helpers TypeScript.
|
|
271
|
+
|
|
272
|
+
### Panduan Singkat
|
|
273
|
+
|
|
274
|
+
- **Aktifkan strict mode**: Selalu gunakan `"strict": true` ditambah `noUncheckedIndexedAccess` dan `exactOptionalPropertyTypes`.
|
|
275
|
+
- **Branded Types**: Cegah pencampuran primitif yang berbeda secara semantis (UserId vs PostId).
|
|
276
|
+
- **Discriminated Union**: Gunakan untuk state machine dan variant data yang terbatas.
|
|
277
|
+
- **Zod**: Validasi data eksternal dan turunkan tipe TypeScript dari schema Zod.
|
|
278
|
+
- **Hindari `as any`**: Gunakan `unknown` dengan narrowing atau Zod untuk data yang tidak diketahui tipenya.
|
|
279
|
+
- **`satisfies` operator**: Validasi objek terhadap tipe tanpa melebarkan tipe yang diinferensi.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-components-expert
|
|
3
|
+
description: Expert guide for checking and improving the 4 main pillars of UI components: input controls, navigation, information, and containers. / Panduan ahli untuk memeriksa dan meningkatkan 4 pilar utama komponen UI: kontrol input, navigasi, informasi, dan kontainer.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 🎨 UI Components 4 Pillars Expert
|
|
7
|
+
|
|
8
|
+
Skill ini memberikan panduan komprehensif untuk mengevaluasi, mengaudit, dan meningkatkan 4 pilar utama komponen User Interface (UI). Tujuannya adalah memastikan setiap komponen tidak hanya terlihat indah secara visual (Aesthetics), tetapi juga berfungsi secara intuitif (Usability), dapat diakses oleh semua pengguna (Accessibility/a11y), dan konsisten dengan sistem desain.
|
|
9
|
+
|
|
10
|
+
## 🎯 4 Pilar Utama Komponen UI
|
|
11
|
+
|
|
12
|
+
### 1. Kontrol Input (Input Controls)
|
|
13
|
+
Komponen yang memungkinkan pengguna berinteraksi dan memasukkan data.
|
|
14
|
+
*Contoh: Buttons, Checkboxes, Radio Buttons, Text Fields, Toggles/Switches, Dropdowns.*
|
|
15
|
+
|
|
16
|
+
**✅ Checklist & Best Practices:**
|
|
17
|
+
- **State Visual yang Jelas:** Pastikan ada perbedaan visual yang jelas untuk state `Default`, `Hover`, `Active/Pressed`, `Focus` (untuk aksesibilitas keyboard), dan `Disabled`.
|
|
18
|
+
- **Ukuran Target Sentuh (Touch Target):** Minimal 44x44 pixel (berdasarkan standar HIG/Material) untuk kenyamanan pengguna mobile.
|
|
19
|
+
- **Feedback Langsung:** Berikan umpan balik instan saat input berinteraksi (misalnya riak/ripple effect, perubahan warna, animasi transisi).
|
|
20
|
+
- **Validasi & Error Handling:** Tampilkan pesan error yang spesifik dan inline pada form input, gunakan warna merah dan ikon peringatan, jangan hanya mengandalkan warna.
|
|
21
|
+
- **Aksesibilitas (a11y):** Gunakan tag label yang terhubung ke input (misal `htmlFor`), sertakan atribut `aria-invalid` jika ada error.
|
|
22
|
+
|
|
23
|
+
### 2. Navigasi (Navigation)
|
|
24
|
+
Komponen yang membantu pengguna bergerak di dalam struktur aplikasi atau situs web.
|
|
25
|
+
*Contoh: Menus, Tabs, Breadcrumbs, Pagination, Sidebars, Bottom Navigation.*
|
|
26
|
+
|
|
27
|
+
**✅ Checklist & Best Practices:**
|
|
28
|
+
- **Indikasi Lokasi Saat Ini (Active State):** Pengguna harus selalu tahu di mana mereka berada. Highlight menu atau tab yang sedang aktif dengan warna kontras, garis bawah, atau background tebal.
|
|
29
|
+
- **Hierarki yang Logis:** Kelompokkan item navigasi berdasarkan kepentingannya. Jangan tampilkan terlalu banyak opsi (prinsip Hick's Law).
|
|
30
|
+
- **Responsivitas:** Gunakan *Hamburger Menu* atau *Bottom Navigation* di perangkat mobile, pertahankan tab yang bisa digeser (swipeable/scrollable).
|
|
31
|
+
- **Breadcrumbs:** Gunakan breadcrumbs untuk hierarki yang lebih dalam dari 2 level agar pengguna bisa dengan mudah kembali ke halaman induk.
|
|
32
|
+
|
|
33
|
+
### 3. Informasi (Information)
|
|
34
|
+
Komponen yang menyampaikan status, panduan, atau peringatan kepada pengguna.
|
|
35
|
+
*Contoh: Notifications (Toasts), Tooltips, Badges, Alerts, Progress Bars, Spinners.*
|
|
36
|
+
|
|
37
|
+
**✅ Checklist & Best Practices:**
|
|
38
|
+
- **Pewarnaan Kontekstual:** Gunakan warna standar untuk status: Hijau (Sukses), Merah (Error), Kuning/Oranye (Peringatan), Biru (Informasi).
|
|
39
|
+
- **Kemudahan Menutup (Dismissibility):** Berikan opsi (tombol X) untuk menutup notifikasi persisten. Untuk toast notifikasi sukses/info, berikan *auto-dismiss* (misalnya setelah 3-5 detik).
|
|
40
|
+
- **Tooltips:** Hanya muncul saat di-*hover* (desktop) atau ditekan lama (mobile). Jangan gunakan tooltips untuk informasi kritis yang wajib dibaca, gunakan teks bantuan inline.
|
|
41
|
+
- **Animasi Transisi:** Notifikasi harus muncul dan menghilang dengan animasi yang halus (slide in/out, fade in/out) agar tidak mengejutkan pengguna.
|
|
42
|
+
|
|
43
|
+
### 4. Kontainer (Containers)
|
|
44
|
+
Komponen yang mengelompokkan konten terkait menjadi unit visual yang terstruktur.
|
|
45
|
+
*Contoh: Cards, Modals (Dialogs), Accordions, Drawers/Bottom Sheets, Carousels.*
|
|
46
|
+
|
|
47
|
+
**✅ Checklist & Best Practices:**
|
|
48
|
+
- **Visual Hierarchy & Depth:** Gunakan *Drop Shadows* atau batas tipis (borders) untuk membedakan kontainer dari background utama. Bedakan elevasi (z-index) antara Card biasa dan Modal yang melayang.
|
|
49
|
+
- **Fokus Manajemen pada Modal:** Saat modal terbuka, background harus digelapkan (overlay/backdrop), *scroll* halaman di belakang harus dikunci (body `overflow: hidden`), dan fokus keyboard harus "terperangkap" (trap focus) di dalam modal. Bisa ditutup dengan tombol Escape (ESC) atau mengklik di luar area modal (backdrop click).
|
|
50
|
+
- **Padding dan Whitespace:** Berikan ruang bernapas (padding) yang cukup di dalam kontainer. Hindari teks atau elemen yang terlalu menempel pada tepi *Card*.
|
|
51
|
+
- **Clear Call to Action (CTA):** Pada Modal atau Card interaktif, pastikan tombol aksi utama (misal: "Simpan", "Beli") jelas dan ditempatkan secara logis (biasanya di kanan bawah atau bawah tengah).
|
|
52
|
+
|
|
53
|
+
## 🛠 Panduan Penggunaan Skill
|
|
54
|
+
|
|
55
|
+
Ketika Anda diminta untuk memeriksa atau meningkatkan UI aplikasi:
|
|
56
|
+
|
|
57
|
+
1. **Identifikasi Komponen:** Kategorikan setiap komponen yang ada di halaman tersebut ke dalam 4 pilar di atas.
|
|
58
|
+
2. **Audit Berdasarkan Checklist:** Jalankan checklist di atas pada komponen yang sedang direview. Cari kekurangan dalam *state*, aksesibilitas, responsivitas, dan umpan balik (feedback).
|
|
59
|
+
3. **Usulkan Peningkatan Konkret:**
|
|
60
|
+
- **Perbaikan CSS/Tailwind:** Usulkan penambahan class seperti `focus:ring-2 focus:outline-none`, `hover:bg-gray-100`, atau transisi yang mulus `transition-colors duration-200`.
|
|
61
|
+
- **Peningkatan Aksesibilitas (a11y):** Berikan kode ARIA role atau atribut pendukung.
|
|
62
|
+
- **Interaksi JavaScript (opsional):** Jika diperlukan untuk modal atau tab, usulkan struktur state yang menangkap interaksi pengguna dengan benar.
|
|
63
|
+
4. **Fokus pada Detail "Micro-interactions":** Peningkatan kecil pada *hover state* atau animasi *toast* berdampak besar pada impresi kualitas UI.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-ux-pro-max
|
|
3
|
+
description: "Comprehensive design guide & BM25 search engine for web and mobile applications across 11 tech stacks / Panduan desain komprehensif & mesin pencari BM25 untuk aplikasi web dan mobile di 11 tech stack."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UI/UX Pro Max - Design Intelligence System
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
UI/UX Pro Max is a comprehensive design intelligence engine equipped with an offline BM25 search index covering color palettes, typography, responsive patterns, icon sets, chart recommendations, UX guidelines, and stack-specific best practices across **11 technology stacks**.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
Reference these guidelines or run the CLI search engine when:
|
|
21
|
+
- Designing new UI components, landing pages, or dashboards.
|
|
22
|
+
- Choosing color schemes, font pairings, and design tokens.
|
|
23
|
+
- Generating a complete design system recommendation for a project.
|
|
24
|
+
- Auditing code for UX, accessibility (a11y), or performance issues.
|
|
25
|
+
- Needing stack-specific code patterns (React, Next.js, Vue, Nuxt, Svelte, Tailwind, SwiftUI, React Native, Flutter, Shadcn).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### Python BM25 Search CLI Integration
|
|
30
|
+
|
|
31
|
+
The skill includes a fast Python search engine in `scripts/search.py` that queries 12 domain CSV datasets and 11 tech-stack CSV datasets.
|
|
32
|
+
|
|
33
|
+
#### 1. Generate Complete Design System Recommendation
|
|
34
|
+
Run this before starting design/coding to get an aggregated design system spec:
|
|
35
|
+
```bash
|
|
36
|
+
python scripts/search.py "<project/topic query>" --design-system -p "Project Name" -f markdown
|
|
37
|
+
```
|
|
38
|
+
*Example:* `python scripts/search.py "SaaS analytics dashboard" --design-system -p "MetricsApp" -f markdown`
|
|
39
|
+
|
|
40
|
+
#### 2. Domain-Specific Search
|
|
41
|
+
Search specific design domains:
|
|
42
|
+
```bash
|
|
43
|
+
python scripts/search.py "<query>" --domain <domain> --max-results 3
|
|
44
|
+
```
|
|
45
|
+
- **Available Domains (`--domain`)**:
|
|
46
|
+
- `style`: Visual design styles (Minimalism, Glassmorphism, Dark Mode, Aurora, Brutalism, Bento Grid, etc.)
|
|
47
|
+
- `prompt`: Copy-paste ready AI prompts & CSS implementation checklists
|
|
48
|
+
- `color`: Hex color palettes tailored by product type (Primary, Secondary, CTA, Background, Text)
|
|
49
|
+
- `chart`: Chart type recommendations, library suggestions, accessibility & color guidance
|
|
50
|
+
- `landing`: High-converting landing page layouts, section orders & CTA placement
|
|
51
|
+
- `product`: Product-type specific design system blueprints (SaaS, E-commerce, Fintech, Crypto, etc.)
|
|
52
|
+
- `ux`: UX anti-patterns, usability best practices, severity, and good/bad code examples
|
|
53
|
+
- `typography`: Google font pairings, heading/body recommendations, mood keywords & CSS imports
|
|
54
|
+
- `icons`: Icon usage guidance, SVG libraries (Lucide, Heroicons), and code imports
|
|
55
|
+
- `react`: React & Next.js performance optimizations, re-render fixes & dynamic imports
|
|
56
|
+
- `web`: Web interface guidelines (ARIA, focus traps, virtual list, form inputs)
|
|
57
|
+
|
|
58
|
+
*Example:* `python scripts/search.py "fintech dark theme" --domain color`
|
|
59
|
+
|
|
60
|
+
#### 3. Stack-Specific Guidelines Search
|
|
61
|
+
Search guidelines tailored to your exact tech stack:
|
|
62
|
+
```bash
|
|
63
|
+
python scripts/search.py "<query>" --stack <stack> --max-results 3
|
|
64
|
+
```
|
|
65
|
+
- **Supported Stacks (`--stack`)**:
|
|
66
|
+
- `html-tailwind` | `react` | `nextjs` | `vue` | `nuxtjs` | `nuxt-ui` | `svelte` | `swiftui` | `react-native` | `flutter` | `shadcn`
|
|
67
|
+
|
|
68
|
+
*Example:* `python scripts/search.py "virtualized list performance" --stack react`
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Quick Reference for Professional Rules
|
|
73
|
+
|
|
74
|
+
#### 1. Accessibility (WCAG 2.2) - CRITICAL
|
|
75
|
+
- **Color Contrast**: Minimum 4.5:1 ratio for normal text, 3:1 for large text/UI components.
|
|
76
|
+
- **Focus States**: Visible focus rings (`focus-visible:ring-2 focus-visible:ring-offset-2`) during keyboard navigation.
|
|
77
|
+
- **Alt Text & ARIA**: Descriptive alt text for imagery; proper `aria-expanded`, `aria-controls`, and semantic HTML tags.
|
|
78
|
+
|
|
79
|
+
#### 2. Touch & Interaction - CRITICAL
|
|
80
|
+
- **Touch Target Size**: Minimum 44x44px for mobile devices.
|
|
81
|
+
- **Loading & State**: Disable buttons during async requests to prevent duplicate submissions; show subtle spinners or skeleton loaders.
|
|
82
|
+
- **Cursor Pointer**: Always add `cursor-pointer` to clickable/interactive elements.
|
|
83
|
+
|
|
84
|
+
#### 3. Performance & Animation - HIGH / MEDIUM
|
|
85
|
+
- **Image & Assets**: Use WebP/AVIF formats, `srcset`, explicit `width`/`height` attributes, and `loading="lazy"`.
|
|
86
|
+
- **Micro-interactions**: Keep transition durations between 150ms–300ms (`ease-in-out`) for fast and responsive UI feel.
|
|
87
|
+
- **Reduced Motion**: Respect `prefers-reduced-motion: reduce`.
|
|
88
|
+
|
|
89
|
+
#### 4. Light/Dark Mode Contrast
|
|
90
|
+
- **Light Mode**: High-contrast text (e.g. Slate-900 `#0F172A`); avoid pale grays for primary text. Ensure borders (`border-slate-200`) remain visible.
|
|
91
|
+
- **Dark Mode**: High contrast foreground elements over dark slate/gray backgrounds; avoid pure black `#000000` text containers unless requested.
|
|
92
|
+
|
|
93
|
+
#### 5. Dashboard & Information Hierarchy
|
|
94
|
+
- **Layout Flow**: KPI summary cards top -> Trend charts middle -> Detailed data tables bottom.
|
|
95
|
+
- **Visual Grid**: Consistent gaps/padding (16px / 24px). Clean subtle borders instead of heavy black dividers.
|
|
96
|
+
- **Data Viz**: Maximum 3–5 coordinated colors in graphs. Responsive tooltips and legend alignment.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### UI/UX Design Pre-Delivery Checklist
|
|
101
|
+
- [ ] **Visual Quality**: No emojis used as UI icons (use SVG icons from Lucide/Heroicons). Hover states do not cause layout shifts.
|
|
102
|
+
- [ ] **Interaction**: `cursor-pointer` applied to all interactive elements. Smooth 150–300ms transitions.
|
|
103
|
+
- [ ] **Contrast**: Text contrast ratio >= 4.5:1 in light mode. Visible borders in both light and dark modes.
|
|
104
|
+
- [ ] **Layout & Responsive**: Tested across 375px, 768px, 1024px, 1440px breakpoints. No unintentional horizontal scrolling on mobile.
|
|
105
|
+
- [ ] **Accessibility**: All images have meaningful `alt` text. Form inputs have explicitly connected `<label>` elements or `aria-label`.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
<a name="bahasa-indonesia"></a>
|
|
110
|
+
## Bahasa Indonesia
|
|
111
|
+
|
|
112
|
+
### Deskripsi
|
|
113
|
+
UI/UX Pro Max adalah mesin kecerdasan desain komprehensif yang dilengkapi indeks pencarian BM25 offline. Mencakup palet warna, tipografi, pola tata letak responsif, rekomendasi ikon, grafik visualisasi data, pedoman UX, serta praktik terbaik untuk **11 tumpukan teknologi (technology stacks)**.
|
|
114
|
+
|
|
115
|
+
### Kondisi Pemicu
|
|
116
|
+
Gunakan pedoman ini atau jalankan mesin pencari CLI ketika:
|
|
117
|
+
- Mendesain komponen UI baru, landing page, atau dashboard.
|
|
118
|
+
- Memilih skema warna, pasangan font, dan token desain.
|
|
119
|
+
- Menghasilkan rekomendasi sistem desain (design system) lengkap untuk proyek.
|
|
120
|
+
- Mengaudit kode untuk masalah UX, aksesibilitas (a11y), atau kinerja.
|
|
121
|
+
- Membutuhkan pola kode spesifik stack (React, Next.js, Vue, Nuxt, Svelte, Tailwind, SwiftUI, React Native, Flutter, Shadcn).
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Integrasi CLI Pencarian Python BM25
|
|
126
|
+
|
|
127
|
+
Skill ini dilengkapi mesin pencari Python cepat di `scripts/search.py` yang dapat mengueri 12 dataset CSV domain dan 11 dataset CSV tech-stack.
|
|
128
|
+
|
|
129
|
+
#### 1. Generasi Rekomendasi Sistem Desain Lengkap
|
|
130
|
+
Jalankan ini sebelum memulai desain/coding untuk mendapatkan spesifikasi sistem desain terintegrasi:
|
|
131
|
+
```bash
|
|
132
|
+
python scripts/search.py "<kueri proyek/topik>" --design-system -p "Nama Proyek" -f markdown
|
|
133
|
+
```
|
|
134
|
+
*Contoh:* `python scripts/search.py "SaaS analytics dashboard" --design-system -p "MetricsApp" -f markdown`
|
|
135
|
+
|
|
136
|
+
#### 2. Pencarian Berdasarkan Domain
|
|
137
|
+
Cari domain desain tertentu:
|
|
138
|
+
```bash
|
|
139
|
+
python scripts/search.py "<kueri>" --domain <domain> --max-results 3
|
|
140
|
+
```
|
|
141
|
+
- **Domain yang Tersedia (`--domain`)**:
|
|
142
|
+
- `style`: Gaya desain visual (Minimalism, Glassmorphism, Dark Mode, Aurora, Brutalism, Bento Grid, dll.)
|
|
143
|
+
- `prompt`: Prompt AI siap pakai & checklist implementasi CSS
|
|
144
|
+
- `color`: Palet warna Hex sesuai jenis produk (Utama, Sekunder, CTA, Background, Teks)
|
|
145
|
+
- `chart`: Rekomendasi jenis grafik, pustaka grafik, panduan kontras & aksesibilitas
|
|
146
|
+
- `landing`: Tata letak landing page konversi tinggi, urutan seksi & penempatan CTA
|
|
147
|
+
- `product`: Cetak biru sistem desain spesifik jenis produk (SaaS, E-commerce, Fintech, Crypto, dll.)
|
|
148
|
+
- `ux`: Anti-pattern UX, praktik terbaik kegunaan, tingkat keparahan, serta contoh kode baik/buruk
|
|
149
|
+
- `typography`: Pasangan font Google Fonts, rekomendasi font judul/isi, mood & CSS import
|
|
150
|
+
- `icons`: Panduan penggunaan ikon, pustaka SVG (Lucide, Heroicons), & import kode
|
|
151
|
+
- `react`: Optimasi performa React & Next.js, perbaikan re-render & dynamic import
|
|
152
|
+
- `web`: Pedoman antarmuka web (ARIA, focus trap, virtual list, input form)
|
|
153
|
+
|
|
154
|
+
*Contoh:* `python scripts/search.py "fintech dark theme" --domain color`
|
|
155
|
+
|
|
156
|
+
#### 3. Pencarian Pedoman Spesifik Tech Stack
|
|
157
|
+
Cari pedoman yang disesuaikan persis dengan tech stack proyek:
|
|
158
|
+
```bash
|
|
159
|
+
python scripts/search.py "<kueri>" --stack <stack> --max-results 3
|
|
160
|
+
```
|
|
161
|
+
- **Tech Stack yang Didukung (`--stack`)**:
|
|
162
|
+
- `html-tailwind` | `react` | `nextjs` | `vue` | `nuxtjs` | `nuxt-ui` | `svelte` | `swiftui` | `react-native` | `flutter` | `shadcn`
|
|
163
|
+
|
|
164
|
+
*Contoh:* `python scripts/search.py "virtualized list performance" --stack react`
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Acuan Cepat Aturan Profesional
|
|
169
|
+
|
|
170
|
+
#### 1. Aksesibilitas (WCAG 2.2) - KRITIS
|
|
171
|
+
- **Kontras Warna**: Rasio kontras minimal 4.5:1 untuk teks normal, 3:1 untuk teks besar/komponen UI.
|
|
172
|
+
- **Focus States**: Tampilkan cincin fokus yang jelas (`focus-visible:ring-2 focus-visible:ring-offset-2`) saat menggunakan navigasi keyboard.
|
|
173
|
+
- **Alt Text & ARIA**: Sediakan alt text deskriptif pada gambar; gunakan atribut `aria-expanded`, `aria-controls`, serta elemen HTML semantik.
|
|
174
|
+
|
|
175
|
+
#### 2. Sentuhan & Interaksi - KRITIS
|
|
176
|
+
- **Touch Target Size**: Ukuran area sentuh minimal 44x44px untuk perangkat mobile.
|
|
177
|
+
- **Loading & State**: Nonaktifkan tombol selama operasi asinkron agar tidak terjadi submit ganda; tampilkan spinner halus atau skeleton loader.
|
|
178
|
+
- **Cursor Pointer**: Wajib menambahkan `cursor-pointer` pada elemen interaktif yang dapat diklik.
|
|
179
|
+
|
|
180
|
+
#### 3. Performa & Animasi - TINGGI / MENENGAH
|
|
181
|
+
- **Aset Gambar**: Gunakan format WebP/AVIF, atribut `srcset`, dimensi `width`/`height` eksplisit, serta `loading="lazy"`.
|
|
182
|
+
- **Mikro-interaksi**: Durasi transisi antara 150ms–300ms (`ease-in-out`) agar antarmuka terasa cepat dan responsif.
|
|
183
|
+
- **Reduced Motion**: Hormati preferensi `prefers-reduced-motion: reduce`.
|
|
184
|
+
|
|
185
|
+
#### 4. Kontras Mode Terang & Gelap
|
|
186
|
+
- **Mode Terang**: Teks gelap kontras tinggi (misal Slate-900 `#0F172A`); hindari teks abu-abu pudar. Pastikan batas/border (`border-slate-200`) tetap terlihat.
|
|
187
|
+
- **Mode Gelap**: Kontras tinggi antara elemen latar depan dengan latar belakang gelap; hindari kontainer teks serba hitam pekat `#000000` kecuali diminta khusus.
|
|
188
|
+
|
|
189
|
+
#### 5. Dashboard & Hierarki Informasi
|
|
190
|
+
- **Alur Tata Letak**: Kartu ringkasan KPI di atas -> Grafik tren di tengah -> Tabel detail data di bawah.
|
|
191
|
+
- **Grid Visual**: Konsistensi gap/padding (16px / 24px). Gunakan border halus daripada pembatas tebal hitam.
|
|
192
|
+
- **Visualisasi Data**: Maksimal 3–5 warna terkoordinasi dalam grafik. Tooltip responsif & perataan legenda yang rapi.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### Checklist Desain UI/UX Sebelum Delivery
|
|
197
|
+
- [ ] **Visual**: Tidak menggunakan emoji sebagai ikon UI (gunakan ikon SVG seperti Lucide/Heroicons). Efek hover tidak menggeser tata letak.
|
|
198
|
+
- [ ] **Interaksi**: `cursor-pointer` diterapkan pada semua elemen interaktif. Transisi halus 150–300ms.
|
|
199
|
+
- [ ] **Kontras**: Rasio kontras teks minimal 4.5:1 pada mode terang. Border terlihat di kedua mode (terang & gelap).
|
|
200
|
+
- [ ] **Tata Letak & Responsif**: Diuji pada breakpoint 375px, 768px, 1024px, 1440px. Tidak ada scroll horizontal tak disengaja pada perangkat mobile.
|
|
201
|
+
- [ ] **Aksesibilitas**: Semua gambar memiliki `alt` text yang bermakna. Form input memiliki `<label>` terhubung atau `aria-label`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
No,Data Type,Keywords,Best Chart Type,Secondary Options,Color Guidance,Performance Impact,Accessibility Notes,Library Recommendation,Interactive Level
|
|
2
|
+
1,Trend Over Time,"trend, time-series, line, growth, timeline, progress",Line Chart,"Area Chart, Smooth Area",Primary: #0080FF. Multiple series: use distinct colors. Fill: 20% opacity,⚡ Excellent (optimized),✓ Clear line patterns for colorblind users. Add pattern overlays.,"Chart.js, Recharts, ApexCharts",Hover + Zoom
|
|
3
|
+
2,Compare Categories,"compare, categories, bar, comparison, ranking",Bar Chart (Horizontal or Vertical),"Column Chart, Grouped Bar",Each bar: distinct color. Category: grouped same color. Sorted: descending order,⚡ Excellent,✓ Easy to compare. Add value labels on bars for clarity.,"Chart.js, Recharts, D3.js",Hover + Sort
|
|
4
|
+
3,Part-to-Whole,"part-to-whole, pie, donut, percentage, proportion, share",Pie Chart or Donut,"Stacked Bar, Treemap",Colors: 5-6 max. Contrasting palette. Large slices first. Use labels.,⚡ Good (limit 6 slices),⚠ Hard for accessibility. Better: Stacked bar with legend. Avoid pie if >5 items.,"Chart.js, Recharts, D3.js",Hover + Drill
|
|
5
|
+
4,Correlation/Distribution,"correlation, distribution, scatter, relationship, pattern",Scatter Plot or Bubble Chart,"Heat Map, Matrix",Color axis: gradient (blue-red). Size: relative. Opacity: 0.6-0.8 to show density,⚠ Moderate (many points),⚠ Provide data table alternative. Use pattern + color distinction.,"D3.js, Plotly, Recharts",Hover + Brush
|
|
6
|
+
5,Heatmap/Intensity,"heatmap, heat-map, intensity, density, matrix",Heat Map or Choropleth,"Grid Heat Map, Bubble Heat",Gradient: Cool (blue) to Hot (red). Scale: clear legend. Divergent for ±data,⚡ Excellent (color CSS),⚠ Colorblind: Use pattern overlay. Provide numerical legend.,"D3.js, Plotly, ApexCharts",Hover + Zoom
|
|
7
|
+
6,Geographic Data,"geographic, map, location, region, geo, spatial","Choropleth Map, Bubble Map",Geographic Heat Map,Regional: single color gradient or categorized colors. Legend: clear scale,⚠ Moderate (rendering),⚠ Include text labels for regions. Provide data table alternative.,"D3.js, Mapbox, Leaflet",Pan + Zoom + Drill
|
|
8
|
+
7,Funnel/Flow,funnel/flow,"Funnel Chart, Sankey",Waterfall (for flows),Stages: gradient (starting color → ending color). Show conversion %,⚡ Good,✓ Clear stage labels + percentages. Good for accessibility if labeled.,"D3.js, Recharts, Custom SVG",Hover + Drill
|
|
9
|
+
8,Performance vs Target,performance-vs-target,Gauge Chart or Bullet Chart,"Dial, Thermometer",Performance: Red→Yellow→Green gradient. Target: marker line. Threshold colors,⚡ Good,✓ Add numerical value + percentage label beside gauge.,"D3.js, ApexCharts, Custom SVG",Hover
|
|
10
|
+
9,Time-Series Forecast,time-series-forecast,Line with Confidence Band,Ribbon Chart,Actual: solid line #0080FF. Forecast: dashed #FF9500. Band: light shading,⚡ Good,✓ Clearly distinguish actual vs forecast. Add legend.,"Chart.js, ApexCharts, Plotly",Hover + Toggle
|
|
11
|
+
10,Anomaly Detection,anomaly-detection,Line Chart with Highlights,Scatter with Alert,Normal: blue #0080FF. Anomaly: red #FF0000 circle/square marker + alert,⚡ Good,✓ Circle/marker for anomalies. Add text alert annotation.,"D3.js, Plotly, ApexCharts",Hover + Alert
|
|
12
|
+
11,Hierarchical/Nested Data,hierarchical/nested-data,Treemap,"Sunburst, Nested Donut, Icicle",Parent: distinct hues. Children: lighter shades. White borders 2-3px.,⚠ Moderate,⚠ Poor - provide table alternative. Label large areas.,"D3.js, Recharts, ApexCharts",Hover + Drilldown
|
|
13
|
+
12,Flow/Process Data,flow/process-data,Sankey Diagram,"Alluvial, Chord Diagram",Gradient from source to target. Opacity 0.4-0.6 for flows.,⚠ Moderate,⚠ Poor - provide flow table alternative.,"D3.js (d3-sankey), Plotly",Hover + Drilldown
|
|
14
|
+
13,Cumulative Changes,cumulative-changes,Waterfall Chart,"Stacked Bar, Cascade",Increases: #4CAF50. Decreases: #F44336. Start: #2196F3. End: #0D47A1.,⚡ Good,✓ Good - clear directional colors with labels.,"ApexCharts, Highcharts, Plotly",Hover
|
|
15
|
+
14,Multi-Variable Comparison,multi-variable-comparison,Radar/Spider Chart,"Parallel Coordinates, Grouped Bar",Single: #0080FF 20% fill. Multiple: distinct colors per dataset.,⚡ Good,⚠ Moderate - limit 5-8 axes. Add data table.,"Chart.js, Recharts, ApexCharts",Hover + Toggle
|
|
16
|
+
15,Stock/Trading OHLC,stock/trading-ohlc,Candlestick Chart,"OHLC Bar, Heikin-Ashi",Bullish: #26A69A. Bearish: #EF5350. Volume: 40% opacity below.,⚡ Good,⚠ Moderate - provide OHLC data table.,"Lightweight Charts (TradingView), ApexCharts",Real-time + Hover + Zoom
|
|
17
|
+
16,Relationship/Connection Data,relationship/connection-data,Network Graph,"Hierarchical Tree, Adjacency Matrix",Node types: categorical colors. Edges: #90A4AE 60% opacity.,❌ Poor (500+ nodes struggles),❌ Very Poor - provide adjacency list alternative.,"D3.js (d3-force), Vis.js, Cytoscape.js",Drilldown + Hover + Drag
|
|
18
|
+
17,Distribution/Statistical,distribution/statistical,Box Plot,"Violin Plot, Beeswarm",Box: #BBDEFB. Border: #1976D2. Median: #D32F2F. Outliers: #F44336.,⚡ Excellent,"✓ Good - include stats table (min, Q1, median, Q3, max).","Plotly, D3.js, Chart.js (plugin)",Hover
|
|
19
|
+
18,Performance vs Target (Compact),performance-vs-target-(compact),Bullet Chart,"Gauge, Progress Bar","Ranges: #FFCDD2, #FFF9C4, #C8E6C9. Performance: #1976D2. Target: black 3px.",⚡ Excellent,✓ Excellent - compact with clear values.,"D3.js, Plotly, Custom SVG",Hover
|
|
20
|
+
19,Proportional/Percentage,proportional/percentage,Waffle Chart,"Pictogram, Stacked Bar 100%",10x10 grid. 3-5 categories max. 2-3px spacing between squares.,⚡ Good,✓ Good - better than pie for accessibility.,"D3.js, React-Waffle, Custom CSS Grid",Hover
|
|
21
|
+
20,Hierarchical Proportional,hierarchical-proportional,Sunburst Chart,"Treemap, Icicle, Circle Packing",Center to outer: darker to lighter. 15-20% lighter per level.,⚠ Moderate,⚠ Poor - provide hierarchy table alternative.,"D3.js (d3-hierarchy), Recharts, ApexCharts",Drilldown + Hover
|
|
22
|
+
21,Root Cause Analysis,"root cause, decomposition, tree, hierarchy, drill-down, ai-split",Decomposition Tree,"Decision Tree, Flow Chart",Nodes: #2563EB (Primary) vs #EF4444 (Negative impact). Connectors: Neutral grey.,⚠ Moderate (calculation heavy),✓ clear hierarchy. Allow keyboard navigation for nodes.,"Power BI (native), React-Flow, Custom D3.js",Drill + Expand
|
|
23
|
+
22,3D Spatial Data,"3d, spatial, immersive, terrain, molecular, volumetric",3D Scatter/Surface Plot,"Volumetric Rendering, Point Cloud",Depth cues: lighting/shading. Z-axis: color gradient (cool to warm).,❌ Heavy (WebGL required),❌ Poor - requires alternative 2D view or data table.,"Three.js, Deck.gl, Plotly 3D",Rotate + Zoom + VR
|
|
24
|
+
23,Real-Time Streaming,"streaming, real-time, ticker, live, velocity, pulse",Streaming Area Chart,"Ticker Tape, Moving Gauge",Current: Bright Pulse (#00FF00). History: Fading opacity. Grid: Dark.,⚡ Optimized (canvas/webgl),⚠ Flashing elements - provide pause button. High contrast.,Smoothed D3.js, CanvasJS, SciChart,Real-time + Pause
|
|
25
|
+
24,Sentiment/Emotion,"sentiment, emotion, nlp, opinion, feeling",Word Cloud with Sentiment,"Sentiment Arc, Radar Chart",Positive: #22C55E. Negative: #EF4444. Neutral: #94A3B8. Size = Frequency.,⚡ Good,⚠ Word clouds poor for screen readers. Use list view.,"D3-cloud, Highcharts, Nivo",Hover + Filter
|
|
26
|
+
25,Process Mining,"process, mining, variants, path, bottleneck, log",Process Map / Graph,"Directed Acyclic Graph (DAG), Petri Net",Happy path: #10B981 (Thick). Deviations: #F59E0B (Thin). Bottlenecks: #EF4444.,⚠ Moderate to Heavy,⚠ Complex graphs hard to navigate. Provide path summary.,"React-Flow, Cytoscape.js, Recharts",Drag + Node-Click
|