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,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: payment-gateway-expert
|
|
3
|
+
description: "Expert guide for integrating payment gateways (Stripe, PayPal, Xendit, Midtrans, DOKU) and secure webhooks into SaaS platforms / Panduan ahli integrasi payment gateway dan webhook aman."
|
|
4
|
+
author: "Antigravity"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Payment Gateway Expert / Ahli Payment Gateway
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Expert guide for integrating major payment gateways (Stripe, PayPal, Xendit, Midtrans, DOKU) into modern SaaS platforms. Covers checkout flows, secure webhook handling, subscription management, and synchronization with local databases.
|
|
18
|
+
|
|
19
|
+
### Instructions
|
|
20
|
+
- **Security First**: Always validate webhook signatures before processing any payment event. Never trust client-side data for prices or payment status. For DOKU, ensure signature components (like request target) are arranged strictly according to documentation.
|
|
21
|
+
- **Idempotency**: Implement idempotency keys for all payment creation requests to avoid duplicate charges. Webhook handlers must also be idempotent. For DOKU, include a unique `Request-Id` header.
|
|
22
|
+
- **State Synchronization**: Ensure the local database (e.g., PostgreSQL, Supabase) is updated immediately and transactionally upon receiving successful webhook events.
|
|
23
|
+
- **Subscription Management**: Map the provider's subscription statuses (e.g., `active`, `past_due`, `canceled`) accurately to the SaaS platform's internal state machine.
|
|
24
|
+
- **Testing**: Use sandbox/test environments provided by the gateways and simulate webhooks using CLI tools (like Stripe CLI) during development.
|
|
25
|
+
|
|
26
|
+
### Trigger Conditions
|
|
27
|
+
Active whenever the user is working on billing integration, payment checkout, webhook handling, or integrating platforms like PayPal, Stripe, Xendit, Midtrans, or DOKU.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<a name="bahasa-indonesia"></a>
|
|
32
|
+
## Bahasa Indonesia
|
|
33
|
+
|
|
34
|
+
### Deskripsi
|
|
35
|
+
Panduan ahli untuk mengintegrasikan payment gateway utama (Stripe, PayPal, Xendit, Midtrans, DOKU) ke platform SaaS modern. Mencakup alur checkout, penanganan webhook yang aman, manajemen langganan, dan sinkronisasi dengan database lokal.
|
|
36
|
+
|
|
37
|
+
### Instruksi
|
|
38
|
+
- **Keamanan Utama**: Selalu validasi signature webhook sebelum memproses event pembayaran apa pun. Jangan pernah mempercayai data dari sisi klien untuk harga atau status pembayaran. Untuk DOKU, pastikan komponen signature (seperti request target) disusun secara ketat sesuai dokumentasi.
|
|
39
|
+
- **Idempotensi**: Implementasikan kunci idempotensi (idempotency keys) untuk semua permintaan pembuatan pembayaran untuk menghindari tagihan ganda. Handler webhook juga harus idempoten. Untuk DOKU, sertakan header `Request-Id` unik.
|
|
40
|
+
- **Sinkronisasi State**: Pastikan database lokal (misal: PostgreSQL, Supabase) diperbarui secara langsung dan transaksional saat menerima event webhook yang berhasil.
|
|
41
|
+
- **Manajemen Langganan**: Petakan status langganan dari provider (misal: `active`, `past_due`, `canceled`) secara akurat ke state machine internal platform SaaS.
|
|
42
|
+
- **Pengujian**: Gunakan lingkungan sandbox/test yang disediakan oleh gateway dan simulasikan webhook menggunakan tool CLI (seperti Stripe CLI) selama pengembangan.
|
|
43
|
+
|
|
44
|
+
### Kondisi Pemicu
|
|
45
|
+
Aktif setiap kali pengguna sedang mengerjakan integrasi billing, checkout pembayaran, penanganan webhook, atau mengintegrasikan platform seperti PayPal, Stripe, Xendit, Midtrans, atau DOKU.
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-web-vitals
|
|
3
|
+
description: "Expert guide for Web Performance optimization: Core Web Vitals (LCP, INP, CLS), bundle analysis, image optimization, rendering strategies, and Lighthouse score improvement / Panduan ahli untuk optimasi performa web: Core Web Vitals (LCP, INP, CLS), analisis bundle, optimasi gambar, strategi rendering, dan peningkatan skor Lighthouse."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Web Performance & Core Web Vitals Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Expert guide for measuring, diagnosing, and optimizing web application performance with a focus on **Core Web Vitals** (LCP, INP, CLS), JavaScript bundle optimization, image and font loading strategies, rendering performance, and achieving high Lighthouse scores. Covers Next.js 15, React 19, and modern browser APIs.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- Improving Lighthouse performance score below 90.
|
|
21
|
+
- Diagnosing poor LCP, INP, or CLS metrics.
|
|
22
|
+
- Reducing JavaScript bundle size or eliminating render-blocking resources.
|
|
23
|
+
- Optimizing image loading, lazy loading, or font delivery.
|
|
24
|
+
- Implementing React performance patterns (memo, useDeferredValue, Suspense).
|
|
25
|
+
- Setting up Real User Monitoring (RUM) for Core Web Vitals.
|
|
26
|
+
- Optimizing server response times (TTFB).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### Core Web Vitals Targets (2024+)
|
|
31
|
+
|
|
32
|
+
| Metric | Good | Needs Improvement | Poor | Measures |
|
|
33
|
+
|---|---|---|---|---|
|
|
34
|
+
| **LCP** (Largest Contentful Paint) | ≤ 2.5s | 2.5–4.0s | > 4.0s | Loading performance |
|
|
35
|
+
| **INP** (Interaction to Next Paint) | ≤ 200ms | 200–500ms | > 500ms | Interactivity (replaced FID) |
|
|
36
|
+
| **CLS** (Cumulative Layout Shift) | ≤ 0.1 | 0.1–0.25 | > 0.25 | Visual stability |
|
|
37
|
+
| **FCP** (First Contentful Paint) | ≤ 1.8s | 1.8–3.0s | > 3.0s | Perceived loading |
|
|
38
|
+
| **TTFB** (Time to First Byte) | ≤ 800ms | 800–1800ms | > 1800ms | Server responsiveness |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### LCP Optimization Strategies
|
|
43
|
+
|
|
44
|
+
#### 1. Identify and Optimize the LCP Element
|
|
45
|
+
```typescript
|
|
46
|
+
// Measure LCP with web-vitals library
|
|
47
|
+
import { onLCP, onINP, onCLS } from 'web-vitals';
|
|
48
|
+
|
|
49
|
+
onLCP((metric) => {
|
|
50
|
+
console.log('LCP:', metric.value, 'element:', metric.attribution.lcpEntry?.element);
|
|
51
|
+
// Send to analytics
|
|
52
|
+
sendToAnalytics({ name: metric.name, value: metric.value });
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### 2. Preload LCP Image (Hero Image)
|
|
57
|
+
```html
|
|
58
|
+
<!-- In <head> — preload the hero image before CSS blocks it -->
|
|
59
|
+
<link rel="preload" as="image" href="/hero.webp"
|
|
60
|
+
imagesrcset="/hero-480.webp 480w, /hero-800.webp 800w"
|
|
61
|
+
imagesizes="(max-width: 600px) 480px, 800px"
|
|
62
|
+
fetchpriority="high">
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 3. Next.js Image Component (LCP Hero)
|
|
66
|
+
```tsx
|
|
67
|
+
import Image from 'next/image';
|
|
68
|
+
|
|
69
|
+
// LCP image: priority=true + fill or explicit size
|
|
70
|
+
<Image
|
|
71
|
+
src="/hero.webp"
|
|
72
|
+
alt="Hero banner"
|
|
73
|
+
width={1200}
|
|
74
|
+
height={600}
|
|
75
|
+
priority // disables lazy loading, adds preload link
|
|
76
|
+
fetchPriority="high"
|
|
77
|
+
quality={85}
|
|
78
|
+
sizes="(max-width: 768px) 100vw, 1200px"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
// Below-the-fold images: lazy load (default)
|
|
82
|
+
<Image
|
|
83
|
+
src="/product.webp"
|
|
84
|
+
alt="Product"
|
|
85
|
+
width={400}
|
|
86
|
+
height={300}
|
|
87
|
+
// loading="lazy" is the default — no need to specify
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### INP Optimization Strategies
|
|
94
|
+
|
|
95
|
+
#### 1. Break Up Long Tasks
|
|
96
|
+
```typescript
|
|
97
|
+
// BAD: Long synchronous task blocks the main thread
|
|
98
|
+
function processLargeList(items: Item[]) {
|
|
99
|
+
return items.map(expensiveTransform); // blocks for 500ms
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// GOOD: Yield control back to browser between chunks
|
|
103
|
+
async function processLargeListAsync(items: Item[]) {
|
|
104
|
+
const results: Result[] = [];
|
|
105
|
+
for (let i = 0; i < items.length; i++) {
|
|
106
|
+
results.push(expensiveTransform(items[i]));
|
|
107
|
+
if (i % 50 === 0) await scheduler.yield(); // yield every 50 items
|
|
108
|
+
}
|
|
109
|
+
return results;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### 2. React 19 — Concurrent Features for INP
|
|
114
|
+
```tsx
|
|
115
|
+
import { useTransition, useDeferredValue, startTransition } from 'react';
|
|
116
|
+
|
|
117
|
+
// Non-urgent state updates — mark as transitions
|
|
118
|
+
function SearchResults() {
|
|
119
|
+
const [query, setQuery] = useState('');
|
|
120
|
+
const [isPending, startTransition] = useTransition();
|
|
121
|
+
const deferredQuery = useDeferredValue(query);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<>
|
|
125
|
+
<input
|
|
126
|
+
value={query}
|
|
127
|
+
onChange={(e) => {
|
|
128
|
+
setQuery(e.target.value); // urgent: update input immediately
|
|
129
|
+
startTransition(() => {
|
|
130
|
+
// non-urgent: defer expensive filtering
|
|
131
|
+
});
|
|
132
|
+
}}
|
|
133
|
+
/>
|
|
134
|
+
{isPending && <Spinner />}
|
|
135
|
+
{/* deferredQuery triggers re-render without blocking input */}
|
|
136
|
+
<ResultsList query={deferredQuery} />
|
|
137
|
+
</>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### 3. Virtualize Long Lists
|
|
143
|
+
```tsx
|
|
144
|
+
// Use TanStack Virtual for large lists (1000+ items)
|
|
145
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
146
|
+
|
|
147
|
+
function VirtualList({ items }: { items: Item[] }) {
|
|
148
|
+
const parentRef = useRef<HTMLDivElement>(null);
|
|
149
|
+
const virtualizer = useVirtualizer({
|
|
150
|
+
count: items.length,
|
|
151
|
+
getScrollElement: () => parentRef.current,
|
|
152
|
+
estimateSize: () => 60, // estimated row height in px
|
|
153
|
+
overscan: 5,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<div ref={parentRef} style={{ height: '600px', overflow: 'auto' }}>
|
|
158
|
+
<div style={{ height: virtualizer.getTotalSize() }}>
|
|
159
|
+
{virtualizer.getVirtualItems().map((vItem) => (
|
|
160
|
+
<div
|
|
161
|
+
key={vItem.key}
|
|
162
|
+
style={{ position: 'absolute', top: vItem.start, height: vItem.size }}
|
|
163
|
+
>
|
|
164
|
+
<ItemRow item={items[vItem.index]} />
|
|
165
|
+
</div>
|
|
166
|
+
))}
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### CLS Optimization Strategies
|
|
176
|
+
|
|
177
|
+
```css
|
|
178
|
+
/* 1. Reserve space for images with aspect-ratio */
|
|
179
|
+
img, video {
|
|
180
|
+
width: 100%;
|
|
181
|
+
height: auto;
|
|
182
|
+
aspect-ratio: 16 / 9; /* prevents layout shift before load */
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* 2. Reserve space for dynamic content */
|
|
186
|
+
.ad-container {
|
|
187
|
+
min-height: 250px; /* reserve ad slot height */
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* 3. Use font-display: optional or swap */
|
|
191
|
+
@font-face {
|
|
192
|
+
font-family: 'Inter';
|
|
193
|
+
src: url('/fonts/inter.woff2') format('woff2');
|
|
194
|
+
font-display: optional; /* no invisible text, no layout shift */
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
// 4. Avoid inserting content above existing content
|
|
200
|
+
// BAD: inserting notification banner at top pushes content down
|
|
201
|
+
setShowBanner(true); // causes CLS
|
|
202
|
+
|
|
203
|
+
// GOOD: use position:fixed or reserve space at the top
|
|
204
|
+
<div className="h-12">{showBanner && <Banner />}</div>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### Bundle Optimization
|
|
210
|
+
|
|
211
|
+
#### Next.js Bundle Analysis
|
|
212
|
+
```bash
|
|
213
|
+
# Analyze bundle composition
|
|
214
|
+
ANALYZE=true npm run build
|
|
215
|
+
# Or use @next/bundle-analyzer
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### Code Splitting Patterns
|
|
219
|
+
```tsx
|
|
220
|
+
import dynamic from 'next/dynamic';
|
|
221
|
+
|
|
222
|
+
// Dynamic import — code splits automatically
|
|
223
|
+
const HeavyChart = dynamic(() => import('@/components/HeavyChart'), {
|
|
224
|
+
loading: () => <ChartSkeleton />,
|
|
225
|
+
ssr: false, // disable SSR for client-only components
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// Lazy load with React.lazy (non-Next.js)
|
|
229
|
+
const Modal = React.lazy(() => import('./Modal'));
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### Tree-shaking Checklist
|
|
233
|
+
- Use named imports: `import { debounce } from 'lodash-es'` (not `import _ from 'lodash'`)
|
|
234
|
+
- Set `"sideEffects": false` in `package.json` for libraries.
|
|
235
|
+
- Avoid `import *` from large libraries.
|
|
236
|
+
- Replace `moment.js` with `date-fns` or `dayjs`.
|
|
237
|
+
- Use `sharp` for server-side image processing.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### React Performance Patterns
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
// memo — skip re-render if props didn't change
|
|
245
|
+
const ExpensiveList = memo(({ items }: { items: Item[] }) => (
|
|
246
|
+
<ul>{items.map((i) => <li key={i.id}>{i.name}</li>)}</ul>
|
|
247
|
+
));
|
|
248
|
+
|
|
249
|
+
// useCallback — stable function reference for memo children
|
|
250
|
+
const handleDelete = useCallback((id: string) => {
|
|
251
|
+
setItems((prev) => prev.filter((i) => i.id !== id));
|
|
252
|
+
}, []); // empty deps = stable reference
|
|
253
|
+
|
|
254
|
+
// useMemo — memoize expensive calculations
|
|
255
|
+
const sortedItems = useMemo(
|
|
256
|
+
() => [...items].sort((a, b) => a.name.localeCompare(b.name)),
|
|
257
|
+
[items]
|
|
258
|
+
);
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
### Performance Monitoring Setup
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
// report-vitals.ts — send Core Web Vitals to analytics
|
|
267
|
+
import { onCLS, onINP, onLCP, onFCP, onTTFB } from 'web-vitals';
|
|
268
|
+
|
|
269
|
+
function sendToAnalytics({ name, value, id, navigationType }: Metric) {
|
|
270
|
+
// Send to PostHog, Google Analytics, or your own endpoint
|
|
271
|
+
fetch('/api/analytics/vitals', {
|
|
272
|
+
method: 'POST',
|
|
273
|
+
body: JSON.stringify({ name, value: Math.round(value), id, navigationType }),
|
|
274
|
+
keepalive: true, // ensures request completes even if page unloads
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
onCLS(sendToAnalytics);
|
|
279
|
+
onINP(sendToAnalytics);
|
|
280
|
+
onLCP(sendToAnalytics);
|
|
281
|
+
onFCP(sendToAnalytics);
|
|
282
|
+
onTTFB(sendToAnalytics);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
### Lighthouse Score Improvement Checklist
|
|
288
|
+
|
|
289
|
+
- [ ] LCP image has `priority` or `fetchpriority="high"` + preload link.
|
|
290
|
+
- [ ] All non-LCP images use `loading="lazy"`.
|
|
291
|
+
- [ ] Fonts loaded with `font-display: optional` or preloaded with `rel="preload"`.
|
|
292
|
+
- [ ] No render-blocking `<script>` tags without `defer` or `async`.
|
|
293
|
+
- [ ] Bundle size < 200KB gzipped for initial JS.
|
|
294
|
+
- [ ] Images served in WebP/AVIF format with `srcset`.
|
|
295
|
+
- [ ] Server response time (TTFB) < 600ms — use CDN edge caching.
|
|
296
|
+
- [ ] Long tasks (> 50ms) are broken up or deferred.
|
|
297
|
+
- [ ] Virtual lists used for > 100 items.
|
|
298
|
+
- [ ] Unused CSS removed (PurgeCSS / Tailwind purge).
|
|
299
|
+
- [ ] HTTP/2 or HTTP/3 enabled on server.
|
|
300
|
+
- [ ] Resource hints: `dns-prefetch`, `preconnect` for third-party origins.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
<a name="bahasa-indonesia"></a>
|
|
305
|
+
## Bahasa Indonesia
|
|
306
|
+
|
|
307
|
+
### Deskripsi
|
|
308
|
+
Panduan ahli untuk mengukur, mendiagnosis, dan mengoptimalkan performa aplikasi web dengan fokus pada **Core Web Vitals** (LCP, INP, CLS), optimasi JavaScript bundle, strategi loading gambar dan font, performa rendering, dan mencapai skor Lighthouse yang tinggi.
|
|
309
|
+
|
|
310
|
+
### Kondisi Pemicu
|
|
311
|
+
- Meningkatkan skor Lighthouse di bawah 90.
|
|
312
|
+
- Mendiagnosis metrik LCP, INP, atau CLS yang buruk.
|
|
313
|
+
- Mengurangi ukuran JavaScript bundle atau menghilangkan resource yang memblokir render.
|
|
314
|
+
- Mengoptimalkan loading gambar, lazy loading, atau pengiriman font.
|
|
315
|
+
- Mengimplementasikan pola performa React (memo, useDeferredValue, Suspense).
|
|
316
|
+
- Menyiapkan Real User Monitoring (RUM) untuk Core Web Vitals.
|
|
317
|
+
|
|
318
|
+
### Target Core Web Vitals
|
|
319
|
+
|
|
320
|
+
| Metrik | Baik | Perlu Perbaikan | Buruk |
|
|
321
|
+
|---|---|---|---|
|
|
322
|
+
| **LCP** | ≤ 2,5 detik | 2,5–4,0 detik | > 4,0 detik |
|
|
323
|
+
| **INP** | ≤ 200ms | 200–500ms | > 500ms |
|
|
324
|
+
| **CLS** | ≤ 0,1 | 0,1–0,25 | > 0,25 |
|
|
325
|
+
|
|
326
|
+
### Ringkasan Strategi Optimasi
|
|
327
|
+
|
|
328
|
+
- **LCP**: Preload hero image, gunakan `priority` di Next.js Image, optimalkan TTFB dengan CDN.
|
|
329
|
+
- **INP**: Pecah long task dengan `scheduler.yield()`, gunakan `useTransition` React 19, virtualisasi list panjang.
|
|
330
|
+
- **CLS**: Reservasi ruang untuk gambar dengan `aspect-ratio`, hindari penyisipan konten di atas konten yang sudah ada.
|
|
331
|
+
- **Bundle**: Analisis bundle, gunakan dynamic import, tree-shaking, dan named imports.
|
|
332
|
+
- **Monitoring**: Implementasikan `web-vitals` library untuk melaporkan metrik ke analytics secara real-time.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-architect
|
|
3
|
+
description: "Mandatory guardrail skill that enforces creating a comprehensive Product Requirements Document (PRD) before generating code for new projects / Skill khusus untuk memaksa pembuatan Product Requirements Document (PRD) sebelum mulai coding pada setiap proyek baru."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PRD Architect (2026 — PRD-as-Code Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Mandatory guardrail that enforces creating a comprehensive Product Requirements Document (PRD) before generating code for any new project. Introduces **PRD-as-Code** — a structured Markdown format designed to be machine-readable by AI agents and version-controlled alongside code.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- A user requests building a new application, SaaS, or major feature from scratch.
|
|
21
|
+
- There is no existing PRD, BLUEPRINT.md, or product specification.
|
|
22
|
+
- The project scope is unclear or ambiguous.
|
|
23
|
+
- The user says "build me...", "create a...", "I want to make..." for a new project.
|
|
24
|
+
|
|
25
|
+
### Why PRD Before Code
|
|
26
|
+
1. **Prevents scope creep**: Defines boundaries before any line of code is written.
|
|
27
|
+
2. **Aligns AI output**: AI agents generate significantly better code when given a structured spec.
|
|
28
|
+
3. **Enables traceability**: Each implemented feature can be traced back to a PRD requirement.
|
|
29
|
+
4. **Reduces rework**: Catches architectural decisions early (DB choice, auth flow, integrations).
|
|
30
|
+
5. **Version-controlled spec**: PRD lives in the repo — changes are tracked and reviewable.
|
|
31
|
+
|
|
32
|
+
### PRD-as-Code Template
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# Product Requirements Document (PRD)
|
|
36
|
+
**Project**: [Project Name]
|
|
37
|
+
**Version**: 1.0.0
|
|
38
|
+
**Status**: Draft | In Review | Approved
|
|
39
|
+
**Created**: YYYY-MM-DD
|
|
40
|
+
**Last Updated**: YYYY-MM-DD
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 1. Executive Summary
|
|
45
|
+
[2-3 sentences: What is this product? Who is it for? What problem does it solve?]
|
|
46
|
+
|
|
47
|
+
## 2. Problem Statement
|
|
48
|
+
**Problem**: [Clear description of the problem being solved]
|
|
49
|
+
**Target Users**: [Specific user segments]
|
|
50
|
+
**Current Pain Points**:
|
|
51
|
+
- Pain point 1
|
|
52
|
+
- Pain point 2
|
|
53
|
+
|
|
54
|
+
## 3. Goals & Success Metrics
|
|
55
|
+
| Goal | Metric | Target |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| Reduce churn | Monthly churn rate | < 5% |
|
|
58
|
+
| Improve activation | D7 retention | > 40% |
|
|
59
|
+
|
|
60
|
+
## 4. User Personas
|
|
61
|
+
### Persona 1: [Name]
|
|
62
|
+
- **Role**: [Job title / context]
|
|
63
|
+
- **Goals**: [What they want to achieve]
|
|
64
|
+
- **Frustrations**: [What currently doesn't work]
|
|
65
|
+
- **Key Behaviors**: [How they'll use this product]
|
|
66
|
+
|
|
67
|
+
## 5. Feature Requirements
|
|
68
|
+
|
|
69
|
+
### MVP Features (Must Have — v1.0)
|
|
70
|
+
- [ ] **[Feature Name]**: [Description. Acceptance criteria: ...]
|
|
71
|
+
- [ ] **Authentication**: Email/password + Google OAuth. PKCE flow. Session-based.
|
|
72
|
+
- [ ] **Dashboard**: Overview of [key metrics]. Real-time updates via SSE.
|
|
73
|
+
|
|
74
|
+
### Phase 2 Features (Should Have — v1.x)
|
|
75
|
+
- [ ] **[Feature Name]**: [Description]
|
|
76
|
+
|
|
77
|
+
### Future Features (Nice to Have — v2.0+)
|
|
78
|
+
- [ ] **[Feature Name]**: [Description]
|
|
79
|
+
|
|
80
|
+
## 6. Technical Architecture
|
|
81
|
+
|
|
82
|
+
### Stack Decision
|
|
83
|
+
| Layer | Technology | Rationale |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Frontend | Next.js 15 + React 19 | SSR, App Router, RSC |
|
|
86
|
+
| Backend | Hono + Bun | Type-safe RPC, edge-ready |
|
|
87
|
+
| Database | PostgreSQL + Drizzle ORM | ACID, RLS multi-tenant |
|
|
88
|
+
| Auth | Supabase Auth v3 | PKCE, OAuth, MFA |
|
|
89
|
+
| Payments | Stripe / Polar.sh | [Reason for choice] |
|
|
90
|
+
| Deployment | Vercel + Railway | [Reason for choice] |
|
|
91
|
+
|
|
92
|
+
### Architecture Decisions (ADRs)
|
|
93
|
+
- **ADR-001**: [Decision title] — [Decision made and why]
|
|
94
|
+
- **ADR-002**: Multi-tenancy via RLS — Shared schema with Supabase RLS for isolation
|
|
95
|
+
|
|
96
|
+
### Multi-Entry Points (if SaaS)
|
|
97
|
+
| Entry Point | Domain | Purpose |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| Landing Page | `myapp.com` | Marketing, conversion |
|
|
100
|
+
| SaaS App | `app.myapp.com` | Core product |
|
|
101
|
+
| Super Admin | `admin.myapp.com` | Cross-tenant management |
|
|
102
|
+
| API | `api.myapp.com` | Backend (internal + public) |
|
|
103
|
+
|
|
104
|
+
## 7. Data Model (High-Level)
|
|
105
|
+
```
|
|
106
|
+
users ──belongs_to──> workspaces (via workspace_members)
|
|
107
|
+
workspaces ──has_many──> projects
|
|
108
|
+
projects ──has_many──> tasks
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 8. User Flows
|
|
112
|
+
### Primary Flow: [Name]
|
|
113
|
+
1. User [action 1]
|
|
114
|
+
2. System [response 1]
|
|
115
|
+
3. User [action 2]
|
|
116
|
+
4. System [response 2] → Success state
|
|
117
|
+
|
|
118
|
+
## 9. Non-Functional Requirements
|
|
119
|
+
| Requirement | Target |
|
|
120
|
+
|---|---|
|
|
121
|
+
| Performance | LCP < 2.5s, INP < 200ms |
|
|
122
|
+
| Availability | 99.9% uptime |
|
|
123
|
+
| Security | SOC 2 Type II compliant |
|
|
124
|
+
| Scalability | Support 10K concurrent users |
|
|
125
|
+
|
|
126
|
+
## 10. Out of Scope
|
|
127
|
+
- [Explicitly excluded feature or integration]
|
|
128
|
+
- [Another explicitly excluded item]
|
|
129
|
+
|
|
130
|
+
## 11. Open Questions
|
|
131
|
+
- [ ] [Question that needs a decision before development]
|
|
132
|
+
- [ ] Should we support SSO (SAML) in v1 or defer to v2?
|
|
133
|
+
|
|
134
|
+
## 12. Approval & Sign-off
|
|
135
|
+
| Stakeholder | Role | Status |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| [Name] | Product | ✅ Approved |
|
|
138
|
+
| [Name] | Engineering | ⏳ Pending |
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Enforcement Protocol
|
|
142
|
+
1. **Detect**: When user requests a new project build.
|
|
143
|
+
2. **Pause**: Do NOT generate any code.
|
|
144
|
+
3. **Generate PRD**: Create a pre-filled PRD draft based on the user's description.
|
|
145
|
+
4. **Review**: Present to user for approval/edits.
|
|
146
|
+
5. **Confirm**: Once PRD is approved, proceed to `zero-to-prod-orchestrator` Phase 1.
|
|
147
|
+
6. **Reference**: Cite the PRD in all subsequent code generation decisions.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
<a name="bahasa-indonesia"></a>
|
|
152
|
+
## Bahasa Indonesia
|
|
153
|
+
|
|
154
|
+
### Deskripsi
|
|
155
|
+
Guardrail wajib yang memaksa pembuatan Product Requirements Document (PRD) komprehensif sebelum membuat kode untuk proyek baru apapun. Memperkenalkan **PRD-as-Code** — format Markdown terstruktur yang dirancang agar dapat dibaca mesin oleh agen AI dan dikontrol versi bersama kode.
|
|
156
|
+
|
|
157
|
+
### Kondisi Pemicu
|
|
158
|
+
- Pengguna meminta membangun aplikasi, SaaS, atau fitur besar baru dari awal.
|
|
159
|
+
- Tidak ada PRD, BLUEPRINT.md, atau spesifikasi produk yang ada.
|
|
160
|
+
- Ruang lingkup proyek tidak jelas atau ambigu.
|
|
161
|
+
- Pengguna berkata "buatkan saya...", "buat sebuah...", "saya ingin membuat..." untuk proyek baru.
|
|
162
|
+
|
|
163
|
+
### Mengapa PRD Sebelum Kode
|
|
164
|
+
1. **Mencegah scope creep**: Mendefinisikan batas sebelum satu baris kode pun ditulis.
|
|
165
|
+
2. **Menyelaraskan output AI**: Agen AI menghasilkan kode yang jauh lebih baik saat diberi spesifikasi terstruktur.
|
|
166
|
+
3. **Memungkinkan keterlacakan**: Setiap fitur yang diimplementasikan dapat ditelusuri kembali ke persyaratan PRD.
|
|
167
|
+
4. **Mengurangi pengerjaan ulang**: Menangkap keputusan arsitektur lebih awal (pilihan DB, alur auth, integrasi).
|
|
168
|
+
5. **Spesifikasi dengan kontrol versi**: PRD hidup di repo — perubahan dilacak dan dapat ditinjau.
|
|
169
|
+
|
|
170
|
+
### Template PRD-as-Code
|
|
171
|
+
Template PRD mencakup 12 bagian:
|
|
172
|
+
1. **Ringkasan Eksekutif**: Apa produk ini, untuk siapa, masalah apa yang diselesaikan.
|
|
173
|
+
2. **Pernyataan Masalah**: Deskripsi masalah yang jelas dengan persona pengguna target.
|
|
174
|
+
3. **Tujuan & Metrik Keberhasilan**: Target terukur yang terkait dengan tujuan bisnis.
|
|
175
|
+
4. **Persona Pengguna**: Peran, tujuan, frustrasi, dan perilaku kunci.
|
|
176
|
+
5. **Persyaratan Fitur**: MVP (Harus Ada), Fase 2 (Sebaiknya Ada), Masa Depan (Bagus Dimiliki).
|
|
177
|
+
6. **Arsitektur Teknis**: Keputusan stack dengan justifikasi, ADR, multi-entry points.
|
|
178
|
+
7. **Model Data**: Hubungan antar entitas tingkat tinggi.
|
|
179
|
+
8. **Alur Pengguna**: Alur langkah-demi-langkah untuk interaksi utama.
|
|
180
|
+
9. **Persyaratan Non-Fungsional**: Performa, ketersediaan, keamanan, skalabilitas.
|
|
181
|
+
10. **Di Luar Ruang Lingkup**: Apa yang secara eksplisit dikecualikan.
|
|
182
|
+
11. **Pertanyaan Terbuka**: Keputusan yang perlu dibuat sebelum pengembangan.
|
|
183
|
+
12. **Persetujuan**: Pemangku kepentingan dan status tanda tangan.
|
|
184
|
+
|
|
185
|
+
### Protokol Penegakan
|
|
186
|
+
1. **Deteksi**: Saat pengguna meminta pembangunan proyek baru.
|
|
187
|
+
2. **Jeda**: JANGAN hasilkan kode apapun.
|
|
188
|
+
3. **Buat PRD**: Buat draf PRD yang sudah diisi berdasarkan deskripsi pengguna.
|
|
189
|
+
4. **Tinjau**: Sajikan kepada pengguna untuk persetujuan/edit.
|
|
190
|
+
5. **Konfirmasi**: Setelah PRD disetujui, lanjut ke `zero-to-prod-orchestrator` Fase 1.
|
|
191
|
+
6. **Referensi**: Kutip PRD dalam semua keputusan pembuatan kode selanjutnya.
|