vibes-plug 2.14.1 → 3.9.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 +5 -0
- package/.cursor/rules/vibes-plug-core.mdc +7 -2
- package/.cursorrules +8 -2
- package/AGENTS.md +23 -2
- package/CHANGELOG.md +114 -0
- package/CLAUDE.md +10 -3
- package/README.md +216 -611
- package/bin/vibes.mjs +1104 -0
- package/package.json +11 -3
- package/plugin.json +4 -3
- package/scripts/check-anti-slop.mjs +53 -0
- package/scripts/install.js +3 -1
- package/scripts/update_skills.js +1 -1
- package/scripts/update_skills.mjs +86 -0
- package/scripts/validate-skills.mjs +111 -0
- package/skills/accessibility-testing-expert/SKILL.md +117 -116
- package/skills/affective-computing-emotion-ai/SKILL.md +83 -0
- package/skills/agentic-coding-workflow-expert/SKILL.md +297 -0
- package/skills/agentic-memory-architect/SKILL.md +52 -0
- package/skills/agentic-micro-economy-architect/SKILL.md +92 -0
- package/skills/ai-llm-integration-expert/SKILL.md +330 -194
- package/skills/ai-media-generation-expert/SKILL.md +173 -172
- package/skills/ai-prompt-engineering-expert/SKILL.md +204 -134
- package/skills/ai-safety-governance-expert/SKILL.md +223 -0
- package/skills/angular-expert/SKILL.md +149 -148
- package/skills/anti-slop/SKILL.md +134 -133
- package/skills/api-design-expert/SKILL.md +4 -3
- package/skills/api-gateway-proxy-expert/SKILL.md +3 -2
- package/skills/app-analyzer-optimizer/SKILL.md +4 -3
- package/skills/apple-ecosystem-expert/SKILL.md +6 -5
- package/skills/astro-framework-expert/SKILL.md +201 -200
- package/skills/async-queue-temporal-expert/SKILL.md +218 -217
- package/skills/authentication-identity-expert/SKILL.md +174 -173
- package/skills/autonomous-red-teamer/SKILL.md +338 -203
- package/skills/autonomous-tdd-debugger/SKILL.md +6 -5
- package/skills/biome-linter-formatter-expert/SKILL.md +90 -89
- package/skills/blockchain-web3-expert/SKILL.md +116 -115
- package/skills/brainstorming/SKILL.md +392 -377
- package/skills/browser-automation-expert/SKILL.md +260 -222
- package/skills/bun-runtime-expert/SKILL.md +5 -4
- package/skills/chatbot-messaging-expert/SKILL.md +115 -114
- package/skills/ci-cd-devops-architect/SKILL.md +3 -2
- package/skills/cloud-hosting-expert/SKILL.md +5 -4
- package/skills/coderabbit/SKILL.md +5 -4
- package/skills/compliance-gdpr-privacy-expert/SKILL.md +3 -2
- package/skills/composable-mach-architect/SKILL.md +338 -0
- package/skills/cron-scheduler-expert/SKILL.md +5 -4
- package/skills/data-pipeline-etl-expert/SKILL.md +3 -2
- package/skills/data-telemetry-expert/SKILL.md +5 -4
- package/skills/data-visualization-expert/SKILL.md +155 -154
- package/skills/database-orm-expert/SKILL.md +166 -165
- package/skills/deep-research-analyst/SKILL.md +182 -136
- package/skills/dependency-upgrade-migrator/SKILL.md +11 -10
- package/skills/design-system-architect/SKILL.md +4 -3
- package/skills/desktop-electron-expert/SKILL.md +129 -128
- package/skills/documentation-site-expert/SKILL.md +60 -59
- package/skills/doku-mcp-server/SKILL.md +5 -4
- package/skills/doku-payment-gateway/SKILL.md +250 -232
- package/skills/domain-driven-design-expert/SKILL.md +3 -2
- package/skills/e2e-testing-expert/SKILL.md +5 -4
- package/skills/ecommerce-expert/SKILL.md +88 -87
- package/skills/email-notification-expert/SKILL.md +5 -4
- package/skills/ephemeral-generative-ui-architect/SKILL.md +88 -0
- package/skills/error-resilience-expert/SKILL.md +14 -13
- package/skills/event-driven-architect/SKILL.md +5 -4
- package/skills/feature-flag-analytics-expert/SKILL.md +3 -2
- package/skills/file-upload-media-expert/SKILL.md +5 -4
- package/skills/firebase-security-expert/SKILL.md +5 -4
- package/skills/form-validation-expert/SKILL.md +7 -6
- package/skills/frontier-ai-models-expert/SKILL.md +116 -0
- package/skills/fullstack-expert/SKILL.md +185 -184
- package/skills/gemini-agent-booster/SKILL.md +248 -172
- package/skills/geospatial-maps-expert/SKILL.md +81 -80
- package/skills/global-a11y-i18n-expert/SKILL.md +5 -4
- package/skills/glsl-shader-expert/SKILL.md +191 -190
- package/skills/go-programming-expert/SKILL.md +5 -4
- package/skills/graph-rag-knowledge-expert/SKILL.md +201 -200
- package/skills/graphql-apollo-expert/SKILL.md +5 -4
- package/skills/headless-cms-expert/SKILL.md +182 -181
- package/skills/hig/SKILL.md +5 -4
- package/skills/js-backend-expert/SKILL.md +219 -218
- package/skills/legacy-code-translator/SKILL.md +6 -5
- package/skills/llm-finops-router/SKILL.md +52 -0
- package/skills/local-slm-edge-ai-expert/SKILL.md +168 -167
- package/skills/logging-error-tracking-expert/SKILL.md +5 -4
- package/skills/mcp-server-architect/SKILL.md +315 -307
- package/skills/micro-frontend-architect/SKILL.md +5 -4
- package/skills/mobile-expo-expert/SKILL.md +5 -4
- package/skills/modern-css-native-expert/SKILL.md +190 -189
- package/skills/monorepo-architect/SKILL.md +5 -4
- package/skills/mpa-orchestrator/SKILL.md +41 -4
- package/skills/multi-agent-orchestration/SKILL.md +388 -254
- package/skills/mvc-expert/SKILL.md +5 -4
- package/skills/n8n-automation-expert/SKILL.md +90 -89
- package/skills/nextjs-app-router-expert/SKILL.md +3 -2
- package/skills/openapi-swagger-codegen-expert/SKILL.md +4 -3
- package/skills/payment-gateway-expert/SKILL.md +131 -128
- package/skills/pdf-document-generation-expert/SKILL.md +92 -91
- package/skills/performance-web-vitals/SKILL.md +5 -4
- package/skills/post-quantum-crypto-migrator/SKILL.md +3 -2
- package/skills/prd-architect/SKILL.md +183 -182
- package/skills/proactive-background-watcher/SKILL.md +5 -4
- package/skills/production-ready-hardener/SKILL.md +10 -9
- package/skills/pwa-offline-first-expert/SKILL.md +227 -226
- package/skills/pydantic-ai-expert/SKILL.md +162 -161
- package/skills/python-programming-expert/SKILL.md +5 -4
- package/skills/rate-limit-abuse-prevention/SKILL.md +5 -4
- package/skills/realtime-collaboration-expert/SKILL.md +3 -2
- package/skills/rich-text-editor-expert/SKILL.md +178 -177
- package/skills/rust-programming-expert/SKILL.md +5 -4
- package/skills/saas-architect/SKILL.md +155 -154
- package/skills/saas-billing/SKILL.md +394 -382
- package/skills/saas-multi-tenant/SKILL.md +7 -6
- package/skills/scalability-clean-code/SKILL.md +5 -4
- package/skills/search-engine-expert/SKILL.md +90 -89
- package/skills/self-healing-cloud-orchestrator/SKILL.md +3 -2
- package/skills/senior-frontend/SKILL.md +14 -9
- package/skills/seo/SKILL.md +4 -4
- package/skills/session-memory-manager/SKILL.md +129 -128
- package/skills/solidjs-expert/SKILL.md +81 -80
- package/skills/spa-orchestrator/SKILL.md +5 -4
- package/skills/sse-websocket-streaming-expert/SKILL.md +3 -2
- package/skills/state-management-expert/SKILL.md +5 -4
- package/skills/supabase-security-expert/SKILL.md +5 -4
- package/skills/svelte-sveltekit-expert/SKILL.md +92 -91
- package/skills/svg-animation-motion-expert/SKILL.md +3 -2
- package/skills/synthetic-data-finetuning-expert/SKILL.md +156 -155
- package/skills/tailwind-expert/SKILL.md +62 -5
- package/skills/tanstack-query-expert/SKILL.md +5 -4
- package/skills/tauri-expert/SKILL.md +5 -4
- package/skills/typescript-expert/SKILL.md +5 -4
- package/skills/ui-ux-pro-max/SKILL.md +7 -6
- package/skills/vector-db-rag-expert/SKILL.md +209 -208
- package/skills/vercel-ai-sdk-expert/SKILL.md +226 -181
- package/skills/voice-ai-realtime-agent/SKILL.md +243 -242
- package/skills/vue-frontend-expert/SKILL.md +5 -4
- package/skills/wasm-edge-computing-expert/SKILL.md +3 -2
- package/skills/web-3d-graphics-expert/SKILL.md +314 -313
- package/skills/web-game-engine-expert/SKILL.md +330 -329
- package/skills/web-scraper/SKILL.md +158 -157
- package/skills/website-design-cloner/SKILL.md +5 -4
- package/skills/webxr-ar-vr-expert/SKILL.md +163 -162
- package/skills/wordpress-headless-expert/SKILL.md +145 -144
- package/skills/zero-tech-debt-auditor/SKILL.md +115 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +281 -229
- package/skills/zero-trust-secret-vault/SKILL.md +3 -2
- package/BLUEPRINT.md +0 -319
- package/skills/bootstrap-to-modern/SKILL.md +0 -94
- package/skills/multiple-entry-points/SKILL.md +0 -91
- package/skills/secure-fuzz-testing/SKILL.md +0 -207
- package/skills/visual-qa-vision-agent/SKILL.md +0 -71
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mvc-expert
|
|
3
3
|
description: "Expert guidelines to refactor legacy PHP codebases into clean, modern, and scalable MVC-structured projects / Pedoman ahli untuk merefaktor codebase PHP lama menjadi proyek terstruktur MVC yang bersih, modern, dan skalabel."
|
|
4
|
-
author: "Roedy Rustam"
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
version: "3.0.0"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# PHP MVC Expert & Modernization
|
|
@@ -14,7 +15,7 @@ author: "Roedy Rustam"
|
|
|
14
15
|
## English
|
|
15
16
|
|
|
16
17
|
### Orchestration & Integration
|
|
17
|
-
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `
|
|
18
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `session-memory-manager` to ensure cohesive execution.
|
|
18
19
|
|
|
19
20
|
### Description
|
|
20
21
|
This skill provides the agent with structured protocols, coding patterns, and architectural guidelines to audit, refactor, and modernize legacy/obsolete PHP codebases (plain spaghetti PHP) into a clean, modern, secure, and scalable Model-View-Controller (MVC) structure adhering to PSR standards and modern PHP (v8.2+) capabilities.
|
|
@@ -128,7 +129,7 @@ Active whenever the user requests to:
|
|
|
128
129
|
## Bahasa Indonesia
|
|
129
130
|
|
|
130
131
|
### Integrasi Orkestrasi
|
|
131
|
-
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `
|
|
132
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `session-memory-manager` untuk memastikan eksekusi yang kohesif.
|
|
132
133
|
|
|
133
134
|
### Deskripsi
|
|
134
135
|
Skill ini memberikan protokol terstruktur, pola penulisan kode, dan panduan arsitektur bagi agen untuk melakukan audit, refaktorisasi, dan modernisasi terhadap codebase PHP lama yang usang (Plain Spaghetti PHP) menjadi struktur Model-View-Controller (MVC) yang bersih, modern, aman, dan skalabel yang mematuhi standar PSR serta kemampuan PHP modern (v8.2+).
|
|
@@ -234,4 +235,4 @@ Saat mengatur proyek sebagai Multi-Page Application di dalam satu repositori, ik
|
|
|
234
235
|
Aktif setiap kali pengguna meminta untuk:
|
|
235
236
|
- Memodernisasi proyek PHP lama atau script PHP spageti.
|
|
236
237
|
- Merancang arsitektur MVC atau memperkenalkan pola routing yang bersih di plain PHP.
|
|
237
|
-
- Menerapkan pemrograman berorientasi objek (OOP), namespace Composer (PSR-4), atau membersihkan akses database via PDO pada aplikasi PHP.
|
|
238
|
+
- Menerapkan pemrograman berorientasi objek (OOP), namespace Composer (PSR-4), atau membersihkan akses database via PDO pada aplikasi PHP.
|
|
@@ -1,89 +1,90 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: n8n-automation-expert
|
|
3
|
-
description: "Expert guide for workflow automation (n8n, Zapier, Make), custom nodes, webhook triggers, and AI-powered automation chains / Panduan ahli otomasi workflow (n8n, Zapier, Make), custom nodes, webhook triggers, dan rantai otomasi berbasis AI."
|
|
4
|
-
author: "Roedy Rustam"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **`
|
|
19
|
-
- **`
|
|
20
|
-
- **`
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{ displayName: '
|
|
60
|
-
|
|
61
|
-
{ name: '
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: n8n-automation-expert
|
|
3
|
+
description: "Expert guide for workflow automation (n8n, Zapier, Make), custom nodes, webhook triggers, and AI-powered automation chains / Panduan ahli otomasi workflow (n8n, Zapier, Make), custom nodes, webhook triggers, dan rantai otomasi berbasis AI."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
version: "3.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workflow Automation Expert (2026 Edition)
|
|
9
|
+
|
|
10
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<a name="english"></a>
|
|
15
|
+
## English
|
|
16
|
+
|
|
17
|
+
### Orchestration & Integration
|
|
18
|
+
- **`cron-scheduler-expert`**: Scheduled triggers for automation workflows.
|
|
19
|
+
- **`ai-llm-integration-expert`**: AI-powered automation steps and LLM chains.
|
|
20
|
+
- **`email-notification-expert`**: Email triggers and notification actions.
|
|
21
|
+
- **`webhook-receiver`**: Webhook endpoints as automation triggers.
|
|
22
|
+
|
|
23
|
+
### Description
|
|
24
|
+
Expert guide for building automation workflows with n8n (self-hosted, open-source), Zapier, and Make (Integromat). Covers workflow design, custom n8n nodes, webhook triggers, AI chains within workflows, error handling, credential management, and integration patterns with databases, APIs, and messaging platforms.
|
|
25
|
+
|
|
26
|
+
### Trigger Conditions
|
|
27
|
+
- Building automated workflows connecting multiple services.
|
|
28
|
+
- Setting up n8n for self-hosted automation.
|
|
29
|
+
- Creating AI-powered automation pipelines.
|
|
30
|
+
- Integrating no-code/low-code automation with custom applications.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### Platform Selection
|
|
35
|
+
|
|
36
|
+
| Platform | Hosting | Custom Code | AI Support | Pricing | Best For |
|
|
37
|
+
|----------|---------|-------------|------------|---------|----------|
|
|
38
|
+
| n8n | Self-hosted/Cloud | ✅ Full | ✅ AI nodes | Free (self) | Developers, privacy |
|
|
39
|
+
| Zapier | Cloud only | Limited | ✅ AI actions | $29+/mo | Non-technical teams |
|
|
40
|
+
| Make | Cloud only | ✅ Modules | ✅ AI modules | $10+/mo | Visual workflows |
|
|
41
|
+
|
|
42
|
+
**Recommendation:** Use **n8n** for developer teams needing full control and self-hosting. Use **Zapier** for simple integrations by non-technical users.
|
|
43
|
+
|
|
44
|
+
### n8n Core Patterns
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// Custom n8n node — AI Content Processor
|
|
48
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
49
|
+
|
|
50
|
+
export class AiContentProcessor implements INodeType {
|
|
51
|
+
description: INodeTypeDescription = {
|
|
52
|
+
displayName: 'AI Content Processor',
|
|
53
|
+
name: 'aiContentProcessor',
|
|
54
|
+
group: ['transform'],
|
|
55
|
+
version: 1,
|
|
56
|
+
inputs: ['main'],
|
|
57
|
+
outputs: ['main'],
|
|
58
|
+
properties: [
|
|
59
|
+
{ displayName: 'Prompt Template', name: 'prompt', type: 'string', default: '' },
|
|
60
|
+
{ displayName: 'Model', name: 'model', type: 'options', options: [
|
|
61
|
+
{ name: 'GPT-4o', value: 'gpt-4o' },
|
|
62
|
+
{ name: 'Claude 4 Sonnet', value: 'claude-4-sonnet' },
|
|
63
|
+
], default: 'gpt-4o' },
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
68
|
+
const items = this.getInputData();
|
|
69
|
+
const prompt = this.getNodeParameter('prompt', 0) as string;
|
|
70
|
+
// Process each item with AI...
|
|
71
|
+
return [items];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Orchestration & Integration
|
|
77
|
+
- `cron-scheduler-expert`, `ai-llm-integration-expert`, `webhook-receiver`
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
<a name="bahasa-indonesia"></a>
|
|
82
|
+
## Bahasa Indonesia
|
|
83
|
+
|
|
84
|
+
### Deskripsi
|
|
85
|
+
Panduan ahli untuk membangun alur kerja otomatis dengan n8n, Zapier, dan Make. Mencakup desain workflow, custom nodes n8n, webhook triggers, rantai AI, dan integrasi dengan database dan API.
|
|
86
|
+
|
|
87
|
+
### Kondisi Pemicu
|
|
88
|
+
- Membangun alur kerja otomatis yang menghubungkan beberapa layanan.
|
|
89
|
+
- Menyiapkan n8n untuk otomasi self-hosted.
|
|
90
|
+
- Membuat pipeline otomasi berbasis AI.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nextjs-app-router-expert
|
|
3
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"
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
version: "3.0.0"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Next.js 15 App Router Expert
|
|
@@ -145,4 +146,4 @@ Bungkus pengambilan data lambat dengan `<Suspense>` untuk menampilkan UI awal se
|
|
|
145
146
|
- **`senior-frontend`**: Menguatkan UI/UX dengan pemahaman arsitektur RSC dan cache Next 15.
|
|
146
147
|
- **`js-backend-expert`**: Menghubungkan Server Actions dengan arsitektur backend Node.js/Bun.
|
|
147
148
|
- **`tanstack-query-expert`**: Mengelola hidrasi state client-side dari RSC.
|
|
148
|
-
- **`performance-web-vitals`**: Optimalisasi Core Web Vitals menggunakan Streaming dan PPR.
|
|
149
|
+
- **`performance-web-vitals`**: Optimalisasi Core Web Vitals menggunakan Streaming dan PPR.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openapi-swagger-codegen-expert
|
|
3
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"
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
version: "3.0.0"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# OpenAPI & Swagger Codegen Expert
|
|
@@ -39,7 +40,7 @@ Dedicated expert guide for API contract-first development using OpenAPI 3.1, Swa
|
|
|
39
40
|
## Bahasa Indonesia
|
|
40
41
|
|
|
41
42
|
### Integrasi Orkestrasi
|
|
42
|
-
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `
|
|
43
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `session-memory-manager` untuk memastikan eksekusi yang kohesif.
|
|
43
44
|
|
|
44
45
|
### Deskripsi
|
|
45
46
|
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.
|
|
@@ -64,4 +65,4 @@ Panduan ahli khusus untuk pengembangan API dengan pendekatan *contract-first* me
|
|
|
64
65
|
## Orchestration & Integration
|
|
65
66
|
- Connects to `api-design-expert` for the core design rules.
|
|
66
67
|
- Connects to `ci-cd-devops-architect` to implement CI/CD validation.
|
|
67
|
-
- Connects to `senior-frontend` / `tanstack-query-expert` to consume the generated clients.
|
|
68
|
+
- Connects to `senior-frontend` / `tanstack-query-expert` to consume the generated clients.
|
|
@@ -1,129 +1,132 @@
|
|
|
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."
|
|
1
|
+
---
|
|
2
|
+
name: payment-gateway-expert
|
|
3
|
+
description: "Expert guide for integrating payment gateways (Stripe, PayPal, Xendit, Midtrans, DOKU SNAP BI) and secure webhooks into SaaS platforms / Panduan ahli integrasi payment gateway dan webhook aman."
|
|
4
4
|
author: "Roedy Rustam"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- [ ]
|
|
30
|
-
- [ ]
|
|
31
|
-
- [ ]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
5
|
+
version: "4.0.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Payment Gateway Expert / Ahli Payment Gateway
|
|
9
|
+
|
|
10
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<a name="english"></a>
|
|
15
|
+
## English
|
|
16
|
+
|
|
17
|
+
### Description
|
|
18
|
+
Expert guide for integrating major payment gateways (Stripe, PayPal, Xendit, Midtrans, DOKU SNAP BI) into modern SaaS platforms. Covers checkout flows, secure raw-body webhook handling, atomic idempotency to prevent race conditions, subscription state machines, and local database synchronization.
|
|
19
|
+
|
|
20
|
+
### Core Principles
|
|
21
|
+
- **Security First**: Always validate webhook signatures using the raw, unparsed request body before processing any payment event. Never trust client-side data for prices or payment status. For Indonesian gateways (DOKU, Midtrans, Xendit), strictly enforce the **SNAP BI standard (HMAC-SHA512)** and ISO8601 UTC/WIB timestamps.
|
|
22
|
+
- **Idempotency & Race Condition Prevention**: Implement idempotency keys for all payment creation requests. For webhook ingestion, **DO NOT rely solely on `findUnique` checks**, as concurrent webhook retries cause race conditions. Always use **Atomic Updates** (`UPDATE ... WHERE status = 'PENDING'`) or database pessimistic locks (`SELECT ... FOR UPDATE`).
|
|
23
|
+
- **Raw Body Ingestion**: Webhook signature verification fails if JSON is parsed or re-serialized with modified key ordering. Extract the exact raw string buffer (`req.text()` in Fetch API or `express.raw({ type: 'application/json' })` in Express).
|
|
24
|
+
- **Early 200 OK Acknowledgment**: If a webhook event is verified but already processed, immediately return `200 OK` so the payment gateway halts retries.
|
|
25
|
+
- **State Synchronization**: Ensure the local database (e.g., PostgreSQL, Supabase via Drizzle/Prisma) is updated transactionally upon receiving successful webhook events.
|
|
26
|
+
- **Subscription Management**: Map provider subscription statuses (`trialing`, `active`, `past_due`, `canceled`) accurately to internal SaaS state machines.
|
|
27
|
+
|
|
28
|
+
### Implementation Checklist
|
|
29
|
+
- [ ] Create dedicated raw Webhook endpoint (e.g., `/api/webhooks/stripe`, `/api/webhooks/doku`).
|
|
30
|
+
- [ ] Use raw request body string for signature verification (never parsed JSON).
|
|
31
|
+
- [ ] Verify signature using proper algorithm (HMAC-SHA256 for Stripe/PayPal; HMAC-SHA512 for SNAP BI).
|
|
32
|
+
- [ ] Implement Atomic Update idempotency (`WHERE status = 'PENDING'`) to eliminate race conditions.
|
|
33
|
+
- [ ] Acknowledge duplicate webhooks immediately with HTTP `200 OK`.
|
|
34
|
+
- [ ] Offload heavy post-payment operations (invoicing, emails, webhooks) to background job queues (BullMQ/Temporal).
|
|
35
|
+
|
|
36
|
+
### Example: SNAP BI Webhook & Atomic Idempotency (Next.js App Router)
|
|
37
|
+
```typescript
|
|
38
|
+
import { headers } from 'next/headers';
|
|
39
|
+
import crypto from 'crypto';
|
|
40
|
+
import { db } from '@/lib/db';
|
|
41
|
+
|
|
42
|
+
export async function POST(req: Request) {
|
|
43
|
+
const rawBody = await req.text(); // Raw body is mandatory
|
|
44
|
+
const headerList = await headers();
|
|
45
|
+
|
|
46
|
+
const timestamp = headerList.get('x-timestamp') || '';
|
|
47
|
+
const receivedSig = headerList.get('x-signature') || '';
|
|
48
|
+
const authHeader = headerList.get('authorization') || '';
|
|
49
|
+
const token = authHeader.replace(/^Bearer\s+/i, '');
|
|
50
|
+
const path = new URL(req.url).pathname;
|
|
51
|
+
|
|
52
|
+
// 1. SNAP BI Body Hash & Signature Verification (HMAC-SHA512)
|
|
53
|
+
const bodyHash = crypto.createHash('sha256').update(rawBody, 'utf8').digest('hex').toLowerCase();
|
|
54
|
+
const stringToSign = `POST:${path}:${token}:${bodyHash}:${timestamp}`;
|
|
55
|
+
const calculatedSig = crypto
|
|
56
|
+
.createHmac('sha512', process.env.DOKU_SECRET_KEY!)
|
|
57
|
+
.update(stringToSign, 'utf8')
|
|
58
|
+
.digest('base64');
|
|
59
|
+
|
|
60
|
+
const isValid = crypto.timingSafeEqual(Buffer.from(receivedSig), Buffer.from(calculatedSig));
|
|
61
|
+
if (!isValid) {
|
|
62
|
+
return new Response('Invalid Signature', { status: 401 });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const payload = JSON.parse(rawBody);
|
|
66
|
+
const invoiceNumber = payload.order?.invoice_number;
|
|
67
|
+
|
|
68
|
+
// 2. Atomic Update: Eliminates Race Conditions by locking on 'PENDING' status
|
|
69
|
+
const updated = await db.transaction.updateMany({
|
|
70
|
+
where: {
|
|
71
|
+
invoiceNumber: invoiceNumber,
|
|
72
|
+
status: 'PENDING', // Key race condition prevention gate
|
|
73
|
+
},
|
|
74
|
+
data: {
|
|
75
|
+
status: 'PAID',
|
|
76
|
+
paidAt: new Date(),
|
|
77
|
+
externalReference: payload.transaction?.original_reference_no,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// 3. Duplicate Webhook Handling (Idempotency)
|
|
82
|
+
if (updated.count === 0) {
|
|
83
|
+
// Already processed or invalid invoice — return 200 to halt gateway retry spam
|
|
84
|
+
return new Response(JSON.stringify({ status: 'ALREADY_PROCESSED' }), { status: 200 });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 4. Fulfillment (Execute only once)
|
|
88
|
+
await grantUserSubscription(invoiceNumber);
|
|
89
|
+
|
|
90
|
+
return new Response(JSON.stringify({ status: 'SUCCESS' }), { status: 200 });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function grantUserSubscription(invoiceNumber: string) {
|
|
94
|
+
// Safe business logic execution
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Orchestration & Integration
|
|
99
|
+
- Integrates with: `saas-billing`, `doku-payment-gateway`, `doku-mcp-server`, `async-queue-temporal-expert`, `database-orm-expert`.
|
|
100
|
+
|
|
101
|
+
### Trigger Conditions
|
|
102
|
+
Active whenever the user is working on billing integration, payment checkout, webhook handling, or integrating platforms like PayPal, Stripe, Xendit, Midtrans, or DOKU SNAP BI.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
<a name="bahasa-indonesia"></a>
|
|
107
|
+
## Bahasa Indonesia
|
|
108
|
+
|
|
109
|
+
### Deskripsi
|
|
110
|
+
Panduan ahli untuk mengintegrasikan payment gateway utama (Stripe, PayPal, Xendit, Midtrans, DOKU SNAP BI) ke platform SaaS modern. Mencakup alur checkout, penanganan webhook raw-body aman, pencegahan race condition melalui atomic update, state machine langganan, dan sinkronisasi database lokal.
|
|
111
|
+
|
|
112
|
+
### Prinsip Utama
|
|
113
|
+
- **Keamanan Utama**: Selalu validasi signature webhook menggunakan *raw request body* murni sebelum memproses event pembayaran. Jangan pernah mempercayai data dari sisi klien untuk harga atau status pembayaran. Untuk gateway Indonesia (DOKU, Midtrans, Xendit), terapkan **standar SNAP BI (HMAC-SHA512)** dan format timestamp ISO8601.
|
|
114
|
+
- **Idempotensi & Pencegahan Race Condition**: Implementasikan kunci idempotensi untuk semua pembuatan pembayaran. Pada penerimaan webhook, **JANGAN hanya mengandalkan pengecekan `findUnique`**, karena panggilan webhook paralel dari gateway dapat memicu race condition. Selalu gunakan **Atomic Update** (`UPDATE ... WHERE status = 'PENDING'`) atau database lock (`SELECT ... FOR UPDATE`).
|
|
115
|
+
- **Raw Body Webhook**: Verifikasi tanda tangan akan gagal jika JSON di-parse atau di-serialize ulang karena perubahan urutan key atau spasi. Ambil buffer teks mentah (`req.text()` pada Fetch API atau `express.raw({ type: 'application/json' })` di Express).
|
|
116
|
+
- **Balasan Cepat 200 OK**: Jika signature valid namun transaksi sudah berstatus lunas (webhook duplikat/retry), segera kembalikan HTTP `200 OK` agar payment gateway berhenti mengirimkan retry.
|
|
117
|
+
- **Sinkronisasi State**: Pastikan database lokal (PostgreSQL/Supabase via Drizzle/Prisma) diperbarui secara transaksional saat menerima webhook sukses.
|
|
118
|
+
- **Manajemen Langganan**: Petakan status langganan dari provider (`trialing`, `active`, `past_due`, `canceled`) secara akurat ke state machine internal SaaS.
|
|
119
|
+
|
|
120
|
+
### Checklist Implementasi
|
|
121
|
+
- [ ] Buat endpoint Webhook raw khusus (misal: `/api/webhooks/stripe`, `/api/webhooks/doku`).
|
|
122
|
+
- [ ] Gunakan raw request body string untuk verifikasi signature (jangan parse JSON sebelum verifikasi).
|
|
123
|
+
- [ ] Verifikasi signature dengan algoritma yang tepat (HMAC-SHA256 untuk Stripe/PayPal; HMAC-SHA512 untuk SNAP BI).
|
|
124
|
+
- [ ] Terapkan Atomic Update (`WHERE status = 'PENDING'`) untuk mematikan peluang race condition.
|
|
125
|
+
- [ ] Balas webhook duplikat secara instan dengan HTTP `200 OK`.
|
|
126
|
+
- [ ] Lemparkan proses berat pasca-bayar (pembuatan invoice PDF, email, push notification) ke antrean latar belakang (BullMQ/Temporal).
|
|
127
|
+
|
|
128
|
+
## Integrasi Orkestrasi
|
|
129
|
+
- Terintegrasi dengan: `saas-billing`, `doku-payment-gateway`, `doku-mcp-server`, `async-queue-temporal-expert`, `database-orm-expert`.
|
|
130
|
+
|
|
131
|
+
### Kondisi Pemicu
|
|
132
|
+
Aktif setiap kali pengguna sedang mengerjakan integrasi billing, checkout pembayaran, penanganan webhook, atau mengintegrasikan platform seperti PayPal, Stripe, Xendit, Midtrans, atau DOKU SNAP BI.
|