vibes-plug 1.0.0 → 2.11.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/.claude/rules/vibes-plug-core.md +32 -0
- package/.cursor/rules/vibes-plug-core.mdc +51 -0
- package/.cursorrules +42 -0
- package/AGENTS.md +96 -0
- package/BLUEPRINT.md +309 -125
- package/CHANGELOG.md +183 -1
- package/CLAUDE.md +70 -0
- package/LICENSE +1 -1
- package/README.md +641 -263
- package/index.js +19 -0
- package/package.json +61 -25
- package/plugin.json +24 -7
- package/scripts/generate_swarm_gif.py +295 -0
- package/scripts/install.js +201 -0
- package/skills/accessibility-testing-expert/SKILL.md +116 -0
- package/skills/ai-cost-token-optimizer/SKILL.md +82 -0
- package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
- package/skills/ai-llm-integration-expert/SKILL.md +147 -122
- package/skills/ai-media-generation-expert/SKILL.md +172 -0
- package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
- package/skills/angular-expert/SKILL.md +148 -0
- package/skills/api-design-expert/SKILL.md +316 -309
- package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
- package/skills/app-analyzer-optimizer/SKILL.md +195 -188
- package/skills/apple-ecosystem-expert/SKILL.md +145 -0
- package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
- package/skills/astro-framework-expert/SKILL.md +200 -0
- package/skills/async-queue-temporal-expert/SKILL.md +240 -0
- package/skills/authentication-identity-expert/SKILL.md +279 -45
- package/skills/auto-doc-updater/SKILL.md +219 -203
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
- package/skills/autonomous-red-teamer/SKILL.md +203 -0
- package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
- package/skills/background-jobs-queue-expert/SKILL.md +235 -0
- package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
- package/skills/blockchain-web3-expert/SKILL.md +115 -0
- package/skills/bootstrap-to-modern/SKILL.md +93 -86
- package/skills/brainstorming/SKILL.md +381 -353
- package/skills/browser-automation-expert/SKILL.md +222 -0
- package/skills/bun-runtime-expert/SKILL.md +7 -1
- package/skills/chatbot-messaging-expert/SKILL.md +114 -0
- package/skills/ci-cd-devops-architect/SKILL.md +81 -45
- package/skills/cloud-hosting-expert/SKILL.md +249 -243
- package/skills/coderabbit/SKILL.md +197 -191
- package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
- package/skills/cron-scheduler-expert/SKILL.md +304 -0
- package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
- package/skills/data-telemetry-expert/SKILL.md +218 -212
- package/skills/data-visualization-expert/SKILL.md +154 -0
- package/skills/database-migration-versioning-expert/SKILL.md +90 -0
- package/skills/database-orm-expert/SKILL.md +303 -293
- package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
- package/skills/design-system-architect/SKILL.md +278 -242
- package/skills/desktop-electron-expert/SKILL.md +128 -0
- package/skills/documentation-site-expert/SKILL.md +59 -0
- package/skills/doku-mcp-server/SKILL.md +257 -0
- package/skills/doku-payment-gateway/SKILL.md +233 -0
- package/skills/domain-driven-design-expert/SKILL.md +82 -0
- package/skills/e2e-testing-expert/SKILL.md +320 -314
- package/skills/ecommerce-expert/SKILL.md +87 -0
- package/skills/edge-serverless-db-expert/SKILL.md +99 -0
- package/skills/email-notification-expert/SKILL.md +368 -0
- package/skills/error-resilience-expert/SKILL.md +486 -0
- package/skills/event-driven-architect/SKILL.md +86 -80
- package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
- package/skills/file-upload-media-expert/SKILL.md +437 -0
- package/skills/firebase-security-expert/SKILL.md +7 -1
- package/skills/form-validation-expert/SKILL.md +407 -0
- package/skills/fullstack-expert/SKILL.md +260 -201
- package/skills/fullstack-expert/references/api_design_guide.md +466 -466
- package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
- package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
- package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
- package/skills/gemini-agent-booster/SKILL.md +142 -104
- package/skills/geospatial-maps-expert/SKILL.md +80 -0
- package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
- package/skills/glsl-shader-expert/SKILL.md +107 -0
- package/skills/go-programming-expert/SKILL.md +300 -294
- package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
- package/skills/graphql-apollo-expert/SKILL.md +114 -0
- package/skills/headless-cms-expert/SKILL.md +181 -0
- package/skills/hig/SKILL.md +193 -187
- package/skills/js-backend-expert/SKILL.md +218 -191
- package/skills/legacy-code-translator/SKILL.md +71 -0
- package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
- package/skills/logging-error-tracking-expert/SKILL.md +344 -0
- package/skills/mcp-client-orchestrator/SKILL.md +76 -0
- package/skills/mcp-server-architect/SKILL.md +226 -126
- package/skills/micro-frontend-architect/SKILL.md +112 -0
- package/skills/mobile-expo-expert/SKILL.md +191 -185
- package/skills/mobile-push-notification-expert/SKILL.md +71 -0
- package/skills/modern-css-native-expert/SKILL.md +189 -0
- package/skills/monday-design-aesthetic/SKILL.md +72 -66
- package/skills/monorepo-architect/SKILL.md +232 -226
- package/skills/mpa-orchestrator/SKILL.md +120 -101
- package/skills/multi-agent-orchestration/SKILL.md +173 -153
- package/skills/multiple-entry-points/SKILL.md +91 -55
- package/skills/mvc-expert/SKILL.md +237 -231
- package/skills/n8n-automation-expert/SKILL.md +89 -0
- package/skills/nextjs-app-router-expert/SKILL.md +148 -0
- package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
- package/skills/payment-gateway-expert/SKILL.md +129 -45
- package/skills/pdf-document-generation-expert/SKILL.md +91 -0
- package/skills/performance-web-vitals/SKILL.md +337 -331
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
- package/skills/prd-architect/SKILL.md +206 -190
- package/skills/proactive-background-watcher/SKILL.md +68 -0
- package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
- package/skills/production-ready-hardener/SKILL.md +461 -468
- package/skills/production-ready-hardener/references/production_checklist.md +161 -161
- package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
- package/skills/project-context-mapper/SKILL.md +85 -0
- package/skills/pwa-offline-first-expert/SKILL.md +185 -0
- package/skills/python-programming-expert/SKILL.md +407 -270
- package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
- package/skills/realtime-collaboration-expert/SKILL.md +99 -45
- package/skills/rich-text-editor-expert/SKILL.md +177 -0
- package/skills/rust-programming-expert/SKILL.md +240 -234
- package/skills/saas-billing/SKILL.md +382 -376
- package/skills/saas-multi-tenant/SKILL.md +256 -236
- package/skills/saas-mvp-launcher/SKILL.md +30 -1
- package/skills/saas-transformer/SKILL.md +499 -445
- package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
- package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
- package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
- package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
- package/skills/scalability-clean-code/SKILL.md +234 -228
- package/skills/search-engine-expert/SKILL.md +89 -0
- package/skills/secure-fuzz-testing/SKILL.md +7 -1
- package/skills/self-evolving-memory-graph/SKILL.md +91 -0
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
- package/skills/senior-frontend/SKILL.md +85 -105
- package/skills/seo/SKILL.md +258 -224
- package/skills/session-context-loader/SKILL.md +83 -0
- package/skills/session-handoff-resume/SKILL.md +163 -157
- package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
- package/skills/solidjs-expert/SKILL.md +80 -0
- package/skills/spa-orchestrator/SKILL.md +306 -287
- package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
- package/skills/state-management-expert/SKILL.md +277 -271
- package/skills/supabase-migration/SKILL.md +47 -1
- package/skills/supabase-security-expert/SKILL.md +248 -242
- package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
- package/skills/svg-animation-motion-expert/SKILL.md +115 -0
- package/skills/tailwind-expert/SKILL.md +139 -187
- package/skills/tanstack-query-expert/SKILL.md +204 -198
- package/skills/tauri-expert/SKILL.md +7 -1
- package/skills/token-saver/SKILL.md +118 -110
- package/skills/typescript-expert/SKILL.md +329 -278
- package/skills/ui-components-expert/SKILL.md +166 -63
- package/skills/ui-ux-pro-max/SKILL.md +221 -200
- package/skills/vector-db-rag-expert/SKILL.md +208 -0
- package/skills/vibe-code-gardener/SKILL.md +180 -172
- package/skills/visual-qa-vision-agent/SKILL.md +71 -0
- package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
- package/skills/vue-frontend-expert/SKILL.md +132 -0
- package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
- package/skills/web-3d-graphics-expert/SKILL.md +137 -0
- package/skills/web-game-engine-expert/SKILL.md +102 -0
- package/skills/web-scraper/SKILL.md +98 -146
- package/skills/website-design-cloner/SKILL.md +180 -0
- package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
- package/skills/wordpress-headless-expert/SKILL.md +144 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
- package/skills/zero-trust-secret-vault/SKILL.md +88 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/CONTRIBUTING.md +0 -199
- package/SECURITY.md +0 -21
- package/banner.png +0 -0
- package/skills/senior-fullstack/SKILL.md +0 -167
- package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
- package/skills/senior-fullstack/references/development_workflows.md +0 -222
- package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
- package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
- package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
- package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
- package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
- package/skills/seo-geo/SKILL.md +0 -188
- 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_expert/SKILL.md +0 -114
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nextjs-app-router-expert
|
|
3
|
+
description: "Expert guide for Next.js 15 App Router: RSC, Server Actions, Middleware, Parallel/Intercepting Routes, Streaming, and Caching strategies / Panduan ahli untuk Next.js 15 App Router."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Next.js 15 App Router Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Execute advanced Next.js 15 App Router architectural patterns: React Server Components (RSC), React 19 Server Actions, Middleware routing, Parallel/Intercepting Routes, Streaming/Suspense, Partial Prerendering (PPR), and explicit cache invalidation.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- Architecting new Next.js 15 `app/` directory applications.
|
|
21
|
+
- Migrating `pages/` directory to App Router.
|
|
22
|
+
- Implementing complex UI patterns (modals via Intercepting Routes).
|
|
23
|
+
- Debugging caching (`force-cache`, `revalidatePath`, tags).
|
|
24
|
+
- Building interfaces requiring Partial Prerendering (PPR) or Streaming.
|
|
25
|
+
|
|
26
|
+
### Core Architectural Patterns
|
|
27
|
+
|
|
28
|
+
#### 1. React Server Components (RSC) vs Client Components
|
|
29
|
+
- **Default to Server**: All `app/` components are Server Components. No hooks (`useState`) or browser APIs.
|
|
30
|
+
- **Client Boundaries**: Add `"use client"` only for interactivity/browser APIs. Push client boundaries down the component tree.
|
|
31
|
+
- **Interleaving**: Pass Server Components as `children` to Client Components; do not import Server Components into Client Components directly.
|
|
32
|
+
|
|
33
|
+
#### 2. React 19 Server Actions
|
|
34
|
+
Use Server Actions (`useActionState`) for all mutations. Avoid separate API routes.
|
|
35
|
+
```typescript
|
|
36
|
+
'use server'
|
|
37
|
+
|
|
38
|
+
import { revalidateTag } from 'next/cache';
|
|
39
|
+
import { z } from 'zod';
|
|
40
|
+
import { db } from '@/lib/db';
|
|
41
|
+
|
|
42
|
+
const schema = z.object({ email: z.string().email() });
|
|
43
|
+
|
|
44
|
+
export async function subscribeUser(prevState: any, formData: FormData) {
|
|
45
|
+
const parsed = schema.safeParse({ email: formData.get('email') });
|
|
46
|
+
|
|
47
|
+
if (!parsed.success) return { error: 'Invalid email' };
|
|
48
|
+
|
|
49
|
+
await db.subscribers.insert({ email: parsed.data.email });
|
|
50
|
+
revalidateTag('subscribers');
|
|
51
|
+
return { success: true };
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 3. Parallel & Intercepting Routes (Modals)
|
|
56
|
+
Render modals preserving background page context and URL shareability.
|
|
57
|
+
- **Intercepting (`(.)[segment]`)**: Matches route on client-side navigation.
|
|
58
|
+
- **Parallel (`@modal`)**: Renders simultaneously with `layout.tsx` children.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
app/
|
|
62
|
+
├── @modal/
|
|
63
|
+
│ ├── (.)photos/[id]/page.tsx
|
|
64
|
+
│ └── default.tsx
|
|
65
|
+
├── photos/
|
|
66
|
+
│ └── [id]/page.tsx
|
|
67
|
+
├── layout.tsx
|
|
68
|
+
└── page.tsx
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 4. Caching & Data Fetching (Next.js 15)
|
|
72
|
+
Fetch requests are **not cached by default**. Opt-in explicitly:
|
|
73
|
+
```typescript
|
|
74
|
+
// Indefinite cache
|
|
75
|
+
const res = await fetch('https://api.example.com/data', { cache: 'force-cache' });
|
|
76
|
+
|
|
77
|
+
// Time-Based Revalidation (ISR)
|
|
78
|
+
const res = await fetch('https://api.example.com/data', { next: { revalidate: 3600 } });
|
|
79
|
+
|
|
80
|
+
// On-Demand Revalidation
|
|
81
|
+
const res = await fetch('https://api.example.com/data', { next: { tags: ['collection'] } });
|
|
82
|
+
// In server action: revalidateTag('collection')
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### 5. Streaming & Partial Prerendering (PPR)
|
|
86
|
+
Wrap slow fetches in `<Suspense>` to stream UI instantly:
|
|
87
|
+
```tsx
|
|
88
|
+
import { Suspense } from 'react';
|
|
89
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
90
|
+
|
|
91
|
+
export default function DashboardPage() {
|
|
92
|
+
return (
|
|
93
|
+
<main>
|
|
94
|
+
<h1>Dashboard</h1>
|
|
95
|
+
<Suspense fallback={<Skeleton className="h-64 w-full" />}>
|
|
96
|
+
<SlowRevenueChart />
|
|
97
|
+
</Suspense>
|
|
98
|
+
</main>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Orchestration & Integration
|
|
104
|
+
- **`senior-frontend`**: Enhances UI/UX with Next.js App Router RSC and Next 15 caching.
|
|
105
|
+
- **`js-backend-expert`**: Bridges frontend Server Actions with backend Node.js/Bun architectures.
|
|
106
|
+
- **`tanstack-query-expert`**: Manages client-side state hydration from RSC.
|
|
107
|
+
- **`performance-web-vitals`**: Optimizes Core Web Vitals using Streaming and PPR.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
<a name="bahasa-indonesia"></a>
|
|
112
|
+
## Bahasa Indonesia
|
|
113
|
+
|
|
114
|
+
### Deskripsi
|
|
115
|
+
Terapkan pola arsitektur lanjutan Next.js 15 App Router: React Server Components (RSC), React 19 Server Actions, Middleware, Parallel/Intercepting Routes, Streaming/Suspense, Partial Prerendering (PPR), dan invalidasi cache eksplisit.
|
|
116
|
+
|
|
117
|
+
### Kondisi Pemicu
|
|
118
|
+
- Merancang aplikasi Next.js 15 `app/` direktori baru.
|
|
119
|
+
- Migrasi direktori `pages/` ke App Router.
|
|
120
|
+
- Implementasi pola UI kompleks (modal via Intercepting Routes).
|
|
121
|
+
- Debugging cache (`force-cache`, `revalidatePath`, tags).
|
|
122
|
+
- Membangun antarmuka dengan Partial Prerendering (PPR) atau Streaming.
|
|
123
|
+
|
|
124
|
+
### Pola Arsitektur Inti
|
|
125
|
+
|
|
126
|
+
#### 1. RSC vs Client Components
|
|
127
|
+
- **Default Server**: Semua komponen `app/` adalah Server Components. Tanpa hooks/API browser.
|
|
128
|
+
- **Batas Klien**: Tambahkan `"use client"` hanya untuk interaktivitas. Dorong batas klien ke bawah struktur komponen.
|
|
129
|
+
- **Interleaving**: Berikan Server Components sebagai `children` ke Client Components; jangan impor langsung.
|
|
130
|
+
|
|
131
|
+
#### 2. React 19 Server Actions
|
|
132
|
+
Gunakan Server Actions (`useActionState`) untuk mutasi. Hindari pembuatan API routes terpisah.
|
|
133
|
+
Validasi input di server dengan Zod dan gunakan `revalidateTag` untuk perbarui UI.
|
|
134
|
+
|
|
135
|
+
#### 3. Parallel & Intercepting Routes
|
|
136
|
+
Gunakan untuk modal. Mencegat rute navigasi client-side (URL berubah, modal di atas halaman saat ini). Refresh langsung memuat halaman penuh.
|
|
137
|
+
|
|
138
|
+
#### 4. Caching di Next.js 15
|
|
139
|
+
Fungsi `fetch` **tidak di-cache default**. Aktifkan eksplisit via `{ cache: 'force-cache' }` atau `{ next: { revalidate: 3600 } }`. Gunakan cache tags untuk invalidasi spesifik.
|
|
140
|
+
|
|
141
|
+
#### 5. Streaming & Partial Prerendering (PPR)
|
|
142
|
+
Bungkus pengambilan data lambat dengan `<Suspense>` untuk menampilkan UI awal seketika sambil menunggu data (streaming).
|
|
143
|
+
|
|
144
|
+
## Integrasi Orkestrasi
|
|
145
|
+
- **`senior-frontend`**: Menguatkan UI/UX dengan pemahaman arsitektur RSC dan cache Next 15.
|
|
146
|
+
- **`js-backend-expert`**: Menghubungkan Server Actions dengan arsitektur backend Node.js/Bun.
|
|
147
|
+
- **`tanstack-query-expert`**: Mengelola hidrasi state client-side dari RSC.
|
|
148
|
+
- **`performance-web-vitals`**: Optimalisasi Core Web Vitals menggunakan Streaming dan PPR.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openapi-swagger-codegen-expert
|
|
3
|
+
description: "OpenAPI 3.1 spec authoring, Swagger UI, automatic client/server code generation (openapi-typescript, Orval, Kiota), contract testing / Penulisan spesifikasi OpenAPI 3.1, Swagger UI, pembuatan kode klien/server otomatis, dan pengujian kontrak."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenAPI & Swagger Codegen Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Dedicated expert guide for API contract-first development using OpenAPI 3.1, Swagger UI, and automated code generation. Covers generating strictly typed API clients (using `openapi-typescript`, `Orval`, or Microsoft `Kiota`), scaffolding server stubs, and implementing contract testing to ensure backend APIs always match their documentation.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- Setting up API documentation (Swagger UI, Redoc, Scalar).
|
|
21
|
+
- Generating API client code for frontend/mobile apps.
|
|
22
|
+
- Authoring OpenAPI 3.x specifications (`openapi.yaml` or JSON).
|
|
23
|
+
- Implementing contract testing (e.g., using Dredd or Prism).
|
|
24
|
+
- Migrating from manual fetch wrappers to auto-generated typed API clients.
|
|
25
|
+
|
|
26
|
+
### Best Practices & Workflow
|
|
27
|
+
|
|
28
|
+
1. **Contract-First Approach**: Always write or define the OpenAPI specification before writing any backend code. This serves as the single source of truth for both frontend and backend teams.
|
|
29
|
+
2. **Strict Type Generation**:
|
|
30
|
+
- Use `openapi-typescript` for generating raw TS definitions.
|
|
31
|
+
- Use `Orval` for generating React Query (TanStack Query) hooks directly from the OpenAPI spec.
|
|
32
|
+
- Use Microsoft `Kiota` for multi-language SDK generation.
|
|
33
|
+
3. **Automated Validation**: Integrate API schema validation in the CI/CD pipeline using tools like `Spectral` to enforce API design standards.
|
|
34
|
+
4. **Mocking**: Use tools like `Prism` to spin up mock servers from the OpenAPI spec, allowing frontend teams to start development immediately.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<a name="bahasa-indonesia"></a>
|
|
39
|
+
## Bahasa Indonesia
|
|
40
|
+
|
|
41
|
+
### Integrasi Orkestrasi
|
|
42
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
43
|
+
|
|
44
|
+
### Deskripsi
|
|
45
|
+
Panduan ahli khusus untuk pengembangan API dengan pendekatan *contract-first* menggunakan OpenAPI 3.1, Swagger UI, dan otomatisasi pembuatan kode (codegen). Mencakup pembuatan klien API yang *strictly typed* (menggunakan `openapi-typescript`, `Orval`, atau Microsoft `Kiota`), *scaffolding* untuk server, dan implementasi *contract testing* untuk memastikan backend selalu sesuai dengan dokumentasinya.
|
|
46
|
+
|
|
47
|
+
### Kondisi Pemicu
|
|
48
|
+
- Mengatur dokumentasi API (Swagger UI, Redoc, Scalar).
|
|
49
|
+
- Men-generate kode klien API untuk aplikasi frontend/mobile.
|
|
50
|
+
- Menulis spesifikasi OpenAPI 3.x (`openapi.yaml` atau JSON).
|
|
51
|
+
- Mengimplementasikan *contract testing* (misalnya menggunakan Dredd atau Prism).
|
|
52
|
+
- Migrasi dari wrapper `fetch` manual ke klien API yang otomatis ter-generate dan *typed*.
|
|
53
|
+
|
|
54
|
+
### Panduan Implementasi
|
|
55
|
+
|
|
56
|
+
1. **Pendekatan Contract-First**: Selalu tulis/definisikan spesifikasi OpenAPI sebelum menulis kode backend. Ini menjadi sumber kebenaran tunggal (*single source of truth*) untuk tim frontend dan backend.
|
|
57
|
+
2. **Pembuatan Tipe yang Ketat (Strict Type Generation)**:
|
|
58
|
+
- Gunakan `openapi-typescript` untuk menghasilkan definisi TypeScript murni.
|
|
59
|
+
- Gunakan `Orval` untuk men-generate React Query (TanStack Query) hooks secara otomatis dari spek OpenAPI.
|
|
60
|
+
- Gunakan Microsoft `Kiota` untuk pembuatan SDK multi-bahasa.
|
|
61
|
+
3. **Validasi Otomatis**: Integrasikan validasi skema API di pipeline CI/CD menggunakan tool seperti `Spectral` untuk memastikan standar desain API terpenuhi.
|
|
62
|
+
4. **Mocking**: Gunakan tool seperti `Prism` untuk menjalankan mock server dari spesifikasi OpenAPI, memungkinkan tim frontend memulai pengembangan tanpa harus menunggu backend selesai.
|
|
63
|
+
|
|
64
|
+
## Orchestration & Integration
|
|
65
|
+
- Connects to `api-design-expert` for the core design rules.
|
|
66
|
+
- Connects to `ci-cd-devops-architect` to implement CI/CD validation.
|
|
67
|
+
- Connects to `senior-frontend` / `tanstack-query-expert` to consume the generated clients.
|
|
@@ -1,45 +1,129 @@
|
|
|
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: "
|
|
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
|
-
###
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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: "Roedy Rustam"
|
|
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
|
+
### Implementation Checklist
|
|
27
|
+
- [ ] Create a dedicated Webhook endpoint (e.g., `/api/webhooks/stripe`).
|
|
28
|
+
- [ ] Use raw request body for signature verification (do not parse JSON before verification).
|
|
29
|
+
- [ ] Ensure idempotency by tracking processed event IDs in the database.
|
|
30
|
+
- [ ] Update local user/subscription state transactionally upon success.
|
|
31
|
+
- [ ] Handle asynchronous failures with a dead-letter queue or retry mechanism.
|
|
32
|
+
|
|
33
|
+
### Example: Stripe Webhook Signature Verification (Next.js App Router)
|
|
34
|
+
```typescript
|
|
35
|
+
import Stripe from 'stripe';
|
|
36
|
+
import { headers } from 'next/headers';
|
|
37
|
+
|
|
38
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
|
|
39
|
+
|
|
40
|
+
export async function POST(req: Request) {
|
|
41
|
+
const body = await req.text(); // Raw body required for signature
|
|
42
|
+
const signature = headers().get('Stripe-Signature') as string;
|
|
43
|
+
|
|
44
|
+
let event: Stripe.Event;
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
event = stripe.webhooks.constructEvent(
|
|
48
|
+
body,
|
|
49
|
+
signature,
|
|
50
|
+
process.env.STRIPE_WEBHOOK_SECRET!
|
|
51
|
+
);
|
|
52
|
+
} catch (err: any) {
|
|
53
|
+
return new Response(`Webhook Error: ${err.message}`, { status: 400 });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Handle the event
|
|
57
|
+
if (event.type === 'checkout.session.completed') {
|
|
58
|
+
// Process successful payment, check idempotency, update DB
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return new Response(JSON.stringify({ received: true }), { status: 200 });
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Orchestration & Integration
|
|
66
|
+
- Integrates with: `saas-billing`, `doku-payment-gateway`, `saas-mvp-launcher`.
|
|
67
|
+
|
|
68
|
+
### Trigger Conditions
|
|
69
|
+
Active whenever the user is working on billing integration, payment checkout, webhook handling, or integrating platforms like PayPal, Stripe, Xendit, Midtrans, or DOKU.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
<a name="bahasa-indonesia"></a>
|
|
74
|
+
## Bahasa Indonesia
|
|
75
|
+
|
|
76
|
+
### Deskripsi
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
### Instruksi
|
|
80
|
+
- **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.
|
|
81
|
+
- **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.
|
|
82
|
+
- **Sinkronisasi State**: Pastikan database lokal (misal: PostgreSQL, Supabase) diperbarui secara langsung dan transaksional saat menerima event webhook yang berhasil.
|
|
83
|
+
- **Manajemen Langganan**: Petakan status langganan dari provider (misal: `active`, `past_due`, `canceled`) secara akurat ke state machine internal platform SaaS.
|
|
84
|
+
- **Pengujian**: Gunakan lingkungan sandbox/test yang disediakan oleh gateway dan simulasikan webhook menggunakan tool CLI (seperti Stripe CLI) selama pengembangan.
|
|
85
|
+
|
|
86
|
+
### Checklist Implementasi
|
|
87
|
+
- [ ] Buat endpoint Webhook khusus (misal: `/api/webhooks/stripe`).
|
|
88
|
+
- [ ] Gunakan raw request body untuk verifikasi signature (jangan parse JSON sebelum verifikasi).
|
|
89
|
+
- [ ] Pastikan idempotensi dengan melacak ID event yang sudah diproses di database.
|
|
90
|
+
- [ ] Perbarui state langganan/pengguna lokal secara transaksional saat sukses.
|
|
91
|
+
- [ ] Tangani kegagalan asinkron dengan dead-letter queue atau mekanisme retry.
|
|
92
|
+
|
|
93
|
+
### Contoh: Verifikasi Signature Webhook Stripe (Next.js App Router)
|
|
94
|
+
```typescript
|
|
95
|
+
import Stripe from 'stripe';
|
|
96
|
+
import { headers } from 'next/headers';
|
|
97
|
+
|
|
98
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
|
|
99
|
+
|
|
100
|
+
export async function POST(req: Request) {
|
|
101
|
+
const body = await req.text(); // Raw body dibutuhkan untuk signature
|
|
102
|
+
const signature = headers().get('Stripe-Signature') as string;
|
|
103
|
+
|
|
104
|
+
let event: Stripe.Event;
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
event = stripe.webhooks.constructEvent(
|
|
108
|
+
body,
|
|
109
|
+
signature,
|
|
110
|
+
process.env.STRIPE_WEBHOOK_SECRET!
|
|
111
|
+
);
|
|
112
|
+
} catch (err: any) {
|
|
113
|
+
return new Response(`Webhook Error: ${err.message}`, { status: 400 });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Tangani event
|
|
117
|
+
if (event.type === 'checkout.session.completed') {
|
|
118
|
+
// Proses pembayaran sukses, cek idempotensi, update DB
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return new Response(JSON.stringify({ received: true }), { status: 200 });
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Integrasi Orkestrasi
|
|
126
|
+
- Terintegrasi dengan: `saas-billing`, `doku-payment-gateway`, `saas-mvp-launcher`.
|
|
127
|
+
|
|
128
|
+
### Kondisi Pemicu
|
|
129
|
+
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,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pdf-document-generation-expert
|
|
3
|
+
description: "Expert guide for PDF generation and document processing (React PDF, Puppeteer, jsPDF, pdf-lib) / Panduan ahli generasi PDF dan pemrosesan dokumen (React PDF, Puppeteer, jsPDF, pdf-lib)."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PDF & Document Generation Expert (2026 Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Orchestration & Integration
|
|
17
|
+
- **`email-notification-expert`**: PDF attachments in transactional emails.
|
|
18
|
+
- **`saas-billing`**: Invoice and receipt PDF generation.
|
|
19
|
+
- **`file-upload-media-expert`**: PDF storage and CDN delivery.
|
|
20
|
+
|
|
21
|
+
### Description
|
|
22
|
+
Expert guide for generating PDFs and processing documents in web applications. Covers React PDF (@react-pdf/renderer), Puppeteer HTML-to-PDF, jsPDF, pdf-lib, invoice generation, report templates, digital signatures, and document parsing.
|
|
23
|
+
|
|
24
|
+
### Trigger Conditions
|
|
25
|
+
- Generating invoices, receipts, or reports as PDFs.
|
|
26
|
+
- Converting HTML pages to downloadable PDFs.
|
|
27
|
+
- Building document templates with dynamic data.
|
|
28
|
+
- Implementing digital signatures on PDF documents.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### Library Selection
|
|
33
|
+
|
|
34
|
+
| Library | Approach | Server/Client | Best For |
|
|
35
|
+
|---------|----------|---------------|----------|
|
|
36
|
+
| @react-pdf/renderer | React components → PDF | Both | Complex layouts |
|
|
37
|
+
| Puppeteer | HTML → PDF (headless Chrome) | Server | Pixel-perfect from HTML |
|
|
38
|
+
| jsPDF | Programmatic canvas | Client | Simple client-side PDFs |
|
|
39
|
+
| pdf-lib | Low-level PDF manipulation | Both | Modify existing PDFs |
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
// React PDF — Invoice generation
|
|
43
|
+
import { Document, Page, Text, View, StyleSheet, renderToBuffer } from '@react-pdf/renderer';
|
|
44
|
+
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
page: { padding: 40, fontSize: 12 },
|
|
47
|
+
header: { fontSize: 24, marginBottom: 20, color: '#8B5CF6' },
|
|
48
|
+
row: { flexDirection: 'row', justifyContent: 'space-between', marginBottom: 8 },
|
|
49
|
+
total: { fontSize: 16, fontWeight: 'bold', borderTopWidth: 1, paddingTop: 8, marginTop: 16 },
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
function InvoicePDF({ invoice }) {
|
|
53
|
+
return (
|
|
54
|
+
<Document>
|
|
55
|
+
<Page size="A4" style={styles.page}>
|
|
56
|
+
<Text style={styles.header}>Invoice #{invoice.number}</Text>
|
|
57
|
+
{invoice.items.map((item, i) => (
|
|
58
|
+
<View key={i} style={styles.row}>
|
|
59
|
+
<Text>{item.description}</Text>
|
|
60
|
+
<Text>${item.amount.toFixed(2)}</Text>
|
|
61
|
+
</View>
|
|
62
|
+
))}
|
|
63
|
+
<View style={styles.total}>
|
|
64
|
+
<Text>Total: ${invoice.total.toFixed(2)}</Text>
|
|
65
|
+
</View>
|
|
66
|
+
</Page>
|
|
67
|
+
</Document>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Server-side render to buffer
|
|
72
|
+
export async function generateInvoicePDF(invoice) {
|
|
73
|
+
return await renderToBuffer(<InvoicePDF invoice={invoice} />);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Orchestration & Integration
|
|
78
|
+
- `email-notification-expert`, `saas-billing`, `file-upload-media-expert`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
<a name="bahasa-indonesia"></a>
|
|
83
|
+
## Bahasa Indonesia
|
|
84
|
+
|
|
85
|
+
### Deskripsi
|
|
86
|
+
Panduan ahli untuk menghasilkan PDF dan memproses dokumen di aplikasi web. Mencakup React PDF, Puppeteer HTML-to-PDF, jsPDF, dan pdf-lib.
|
|
87
|
+
|
|
88
|
+
### Kondisi Pemicu
|
|
89
|
+
- Menghasilkan invoice, struk, atau laporan sebagai PDF.
|
|
90
|
+
- Mengkonversi halaman HTML ke PDF yang bisa diunduh.
|
|
91
|
+
- Membangun template dokumen dengan data dinamis.
|