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,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: desktop-electron-expert
|
|
3
|
+
description: "Expert guide for Electron 33+ desktop application development — Electron Forge, context isolation, IPC security, native menus, auto-updates, and multi-window management / Panduan ahli pengembangan desktop Electron 33+."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Desktop Electron 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
|
+
- **`tauri-expert`**: Comparing Electron vs. Tauri architectures for desktop targets.
|
|
18
|
+
- **`senior-frontend`**: React/Vue frontend architecture inside Electron renderers.
|
|
19
|
+
- **`ci-cd-devops-architect`**: Multi-platform desktop packaging (Windows MSI/EXE, macOS DMG, Linux AppImage).
|
|
20
|
+
- **`error-resilience-expert`**: Crash reporting and main/renderer crash recovery.
|
|
21
|
+
|
|
22
|
+
### Description
|
|
23
|
+
Production guide for engineering secure, high-performance cross-platform desktop applications using Electron 33+. Covers secure IPC communication via `contextBridge`, mandatory Context Isolation and Sandbox modes, native system integrations (tray, notifications, menus, global shortcuts), auto-updates with `electron-updater`, and build automation with Electron Forge / electron-builder.
|
|
24
|
+
|
|
25
|
+
### Trigger Conditions
|
|
26
|
+
- Building desktop apps with web technologies using Electron.
|
|
27
|
+
- Hardening Electron security (Context Isolation, Preload scripts, CSP, nodeIntegration: false).
|
|
28
|
+
- Implementing typed IPC communication between Main and Renderer processes.
|
|
29
|
+
- Setting up auto-update workflows and multi-OS code signing.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Core Security & Architecture Patterns
|
|
34
|
+
|
|
35
|
+
#### 1. Secure Main Process (`main.ts`)
|
|
36
|
+
```typescript
|
|
37
|
+
import { app, BrowserWindow, ipcMain } from 'electron';
|
|
38
|
+
import path from 'path';
|
|
39
|
+
|
|
40
|
+
let mainWindow: BrowserWindow | null = null;
|
|
41
|
+
|
|
42
|
+
function createWindow() {
|
|
43
|
+
mainWindow = new BrowserWindow({
|
|
44
|
+
width: 1200,
|
|
45
|
+
height: 800,
|
|
46
|
+
webPreferences: {
|
|
47
|
+
preload: path.join(__dirname, 'preload.js'),
|
|
48
|
+
contextIsolation: true, // MANDATORY for security
|
|
49
|
+
nodeIntegration: false, // NEVER enable in renderer
|
|
50
|
+
sandbox: true, // Enable OS-level sandbox
|
|
51
|
+
webSecurity: true,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (process.env.NODE_ENV === 'development') {
|
|
56
|
+
mainWindow.loadURL('http://localhost:5173');
|
|
57
|
+
} else {
|
|
58
|
+
mainWindow.loadFile(path.join(__dirname, '../dist/index.html'));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
app.whenReady().then(() => {
|
|
63
|
+
createWindow();
|
|
64
|
+
|
|
65
|
+
// Typed IPC Handlers
|
|
66
|
+
ipcMain.handle('app:get-version', () => app.getVersion());
|
|
67
|
+
ipcMain.handle('file:read-config', async (_event, configName: string) => {
|
|
68
|
+
// Validate arguments safely
|
|
69
|
+
return { name: configName, loaded: true };
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### 2. Type-Safe Preload Script (`preload.ts`)
|
|
75
|
+
```typescript
|
|
76
|
+
import { contextBridge, ipcRenderer } from 'electron';
|
|
77
|
+
|
|
78
|
+
export interface ElectronAPI {
|
|
79
|
+
getVersion: () => Promise<string>;
|
|
80
|
+
readConfig: (name: string) => Promise<any>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const api: ElectronAPI = {
|
|
84
|
+
getVersion: () => ipcRenderer.invoke('app:get-version'),
|
|
85
|
+
readConfig: (name: string) => ipcRenderer.invoke('file:read-config', name),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
contextBridge.exposeInMainWorld('electronAPI', api);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### 3. Renderer Consumer (`renderer.tsx`)
|
|
92
|
+
```tsx
|
|
93
|
+
declare global {
|
|
94
|
+
interface Window {
|
|
95
|
+
electronAPI: ElectronAPI;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
import React, { useEffect, useState } from 'react';
|
|
100
|
+
|
|
101
|
+
export function AppInfo() {
|
|
102
|
+
const [version, setVersion] = useState<string>('');
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
window.electronAPI.getVersion().then(setVersion);
|
|
106
|
+
}, []);
|
|
107
|
+
|
|
108
|
+
return <div>App Version: {version}</div>;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
<a name="bahasa-indonesia"></a>
|
|
115
|
+
## Bahasa Indonesia
|
|
116
|
+
|
|
117
|
+
### Integrasi Orkestrasi
|
|
118
|
+
- **`tauri-expert`**: Pemilihan dan perbandingan antara Electron dan Tauri untuk aplikasi desktop.
|
|
119
|
+
- **`senior-frontend`**: Integrasi framework frontend (React/Vue) di dalam renderer Electron.
|
|
120
|
+
- **`ci-cd-devops-architect`**: Otomasi build installer cross-platform (.exe, .dmg, .AppImage).
|
|
121
|
+
|
|
122
|
+
### Deskripsi
|
|
123
|
+
Panduan produksi untuk membangun aplikasi desktop cross-platform yang aman dan efisien menggunakan Electron 33+. Mengutamakan keamanan IPC dengan Context Isolation, isolasi proses renderer, integrasi sistem natif (system tray, menu, notifikasi), dan alur auto-update otomatis.
|
|
124
|
+
|
|
125
|
+
### Kondisi Pemicu
|
|
126
|
+
- Membangun aplikasi desktop menggunakan teknologi web berbasis Electron.
|
|
127
|
+
- Memperketat keamanan Electron (Context Isolation, Sandbox, sanitasi IPC).
|
|
128
|
+
- Mengonfigurasi auto-updater dan packaging multi-OS.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-site-expert
|
|
3
|
+
description: "Expert guide for technical documentation sites (Mintlify, Docusaurus, Storybook, VitePress) and component documentation / Panduan ahli situs dokumentasi teknis (Mintlify, Docusaurus, Storybook, VitePress) dan dokumentasi komponen."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Documentation Site 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
|
+
- **`openapi-swagger-codegen-expert`**: Auto-generated API documentation.
|
|
18
|
+
- **`design-system-architect`**: Component documentation with Storybook.
|
|
19
|
+
- **`astro-framework-expert`**: Astro Starlight for docs sites.
|
|
20
|
+
- **`seo`**: Documentation site SEO and discoverability.
|
|
21
|
+
|
|
22
|
+
### Description
|
|
23
|
+
Expert guide for building technical documentation sites and component libraries. Covers Mintlify (AI-native docs), Docusaurus 3 (React-powered), Storybook 8 (component playground), VitePress (Vue-powered), Astro Starlight (Astro-powered), and MDX authoring. Includes API reference generation, versioning, search integration, and interactive code playgrounds.
|
|
24
|
+
|
|
25
|
+
### Trigger Conditions
|
|
26
|
+
- Creating documentation sites for APIs, libraries, or products.
|
|
27
|
+
- Setting up Storybook for component documentation.
|
|
28
|
+
- Choosing a documentation framework.
|
|
29
|
+
- Generating API reference docs from OpenAPI specs.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Framework Selection
|
|
34
|
+
|
|
35
|
+
| Framework | Stack | Search | Versioning | Best For |
|
|
36
|
+
|-----------|-------|--------|------------|----------|
|
|
37
|
+
| Mintlify | React/MDX | ✅ Built-in AI | ✅ | SaaS API docs |
|
|
38
|
+
| Docusaurus 3 | React/MDX | ✅ Algolia | ✅ | OSS project docs |
|
|
39
|
+
| Storybook 8 | Any framework | ❌ | ❌ | Component docs/playground |
|
|
40
|
+
| VitePress | Vue/Markdown | ✅ Built-in | ❌ | Vue ecosystem docs |
|
|
41
|
+
| Starlight | Astro/MDX | ✅ Pagefind | ✅ | Content-heavy docs |
|
|
42
|
+
|
|
43
|
+
**Recommendation:** Use **Mintlify** for SaaS API docs. Use **Docusaurus** for open-source projects. Use **Storybook** for component libraries.
|
|
44
|
+
|
|
45
|
+
## Orchestration & Integration
|
|
46
|
+
- `openapi-swagger-codegen-expert`, `design-system-architect`, `seo`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
<a name="bahasa-indonesia"></a>
|
|
51
|
+
## Bahasa Indonesia
|
|
52
|
+
|
|
53
|
+
### Deskripsi
|
|
54
|
+
Panduan ahli untuk membangun situs dokumentasi teknis dan library komponen. Mencakup Mintlify, Docusaurus 3, Storybook 8, VitePress, dan Astro Starlight.
|
|
55
|
+
|
|
56
|
+
### Kondisi Pemicu
|
|
57
|
+
- Membuat situs dokumentasi untuk API, library, atau produk.
|
|
58
|
+
- Menyiapkan Storybook untuk dokumentasi komponen.
|
|
59
|
+
- Memilih framework dokumentasi.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doku-mcp-server
|
|
3
|
+
description: "Expert guide for DOKU Model Context Protocol (MCP) Server integration. Enables AI Agentic Commerce with tools for payment links, Virtual Accounts, QRIS, transaction status checks, and client configuration (Claude Desktop, Cursor, AGY) / Panduan ahli DOKU MCP Server untuk AI Agentic Commerce."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# DOKU MCP Server / Server Model Context Protocol DOKU
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Orchestration & Integration
|
|
17
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
|
|
18
|
+
|
|
19
|
+
### Description
|
|
20
|
+
Expert guide for integrating and building Model Context Protocol (MCP) servers with DOKU Payment Gateway based on [DOKU Developers Documentation](https://developers.doku.com/). Enables AI Agents (Claude Desktop, Antigravity, Cursor, n8n, LangChain) to execute payment tasks autonomously using Agentic Commerce capabilities (generating payment links, issuing Virtual Account numbers, generating QRIS codes, querying transaction statuses).
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
Activate this skill when the user is:
|
|
24
|
+
- Setting up or configuring DOKU MCP server for Claude Desktop, Antigravity (AGY), Cursor, or LLM agents.
|
|
25
|
+
- Implementing AI Agentic Commerce or autonomous AI-driven checkout workflows using DOKU.
|
|
26
|
+
- Building a custom TypeScript or Python MCP server wrapping DOKU Jokul API.
|
|
27
|
+
- Defining MCP tools and resources for payment generation and status verification.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### Key Capabilities & Tools
|
|
32
|
+
|
|
33
|
+
| MCP Tool Name | Description | Key Input Parameters |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `create_checkout_payment` | Generates a DOKU Checkout URL / Payment Link for host-managed payment page | `amount`, `invoice_number`, `customer_name`, `customer_email` |
|
|
36
|
+
| `create_virtual_account` | Generates a specific bank Virtual Account number (BCA, Mandiri, BRI, BNI, Permata, DOKU) | `bank_code`, `amount`, `invoice_number`, `customer_name` |
|
|
37
|
+
| `create_qris_payment` | Generates a dynamic QRIS string/image for instant wallet payments | `amount`, `invoice_number`, `store_name` |
|
|
38
|
+
| `check_transaction_status` | Queries real-time transaction payment status | `invoice_number` or `transaction_id` |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Client Configuration
|
|
43
|
+
|
|
44
|
+
#### 1. Antigravity & Gemini Configuration (`mcp.json`)
|
|
45
|
+
|
|
46
|
+
**Location:**
|
|
47
|
+
- **Global:** `~/.gemini/config/mcp.json` (Windows: `%USERPROFILE%\.gemini\config\mcp.json`)
|
|
48
|
+
- **Workspace:** `.agents/mcp.json` (in your project root)
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"doku-payment": {
|
|
54
|
+
"command": "node",
|
|
55
|
+
"args": ["/path/to/doku-mcp-server/dist/index.js"],
|
|
56
|
+
"env": {
|
|
57
|
+
"DOKU_CLIENT_ID": "YOUR_SANDBOX_OR_PROD_CLIENT_ID",
|
|
58
|
+
"DOKU_SECRET_KEY": "YOUR_SANDBOX_OR_PROD_SECRET_KEY",
|
|
59
|
+
"DOKU_IS_PRODUCTION": "false"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### 2. Claude Desktop Configuration (`claude_desktop_config.json`)
|
|
67
|
+
|
|
68
|
+
**Location:**
|
|
69
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
70
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"doku-payment": {
|
|
76
|
+
"command": "node",
|
|
77
|
+
"args": ["/path/to/doku-mcp-server/dist/index.js"],
|
|
78
|
+
"env": {
|
|
79
|
+
"DOKU_CLIENT_ID": "YOUR_SANDBOX_OR_PROD_CLIENT_ID",
|
|
80
|
+
"DOKU_SECRET_KEY": "YOUR_SANDBOX_OR_PROD_SECRET_KEY",
|
|
81
|
+
"DOKU_IS_PRODUCTION": "false"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### 3. Environment Variables & Authentication
|
|
89
|
+
DOKU API authentication requires API Key credentials. When using standard HTTP header authentication:
|
|
90
|
+
- API Keys are configured in your environment or encoded as Base64 for the MCP `Authorization` header.
|
|
91
|
+
- Use Sandbox (`https://api-sandbox.doku.com`) during development and testing.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Building a Custom TypeScript MCP Server for DOKU
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
99
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
100
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
101
|
+
import crypto from 'crypto';
|
|
102
|
+
|
|
103
|
+
const CLIENT_ID = process.env.DOKU_CLIENT_ID || '';
|
|
104
|
+
const SECRET_KEY = process.env.DOKU_SECRET_KEY || '';
|
|
105
|
+
const BASE_URL = process.env.DOKU_IS_PRODUCTION === 'true'
|
|
106
|
+
? 'https://api.doku.com'
|
|
107
|
+
: 'https://api-sandbox.doku.com';
|
|
108
|
+
|
|
109
|
+
function generateHeaders(targetPath: string, payload: object) {
|
|
110
|
+
const requestId = crypto.randomUUID();
|
|
111
|
+
const timestamp = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
112
|
+
const jsonBody = JSON.stringify(payload);
|
|
113
|
+
const digest = crypto.createHash('sha256').update(jsonBody, 'utf8').digest('base64');
|
|
114
|
+
|
|
115
|
+
const component = `Client-Id:${CLIENT_ID}\nRequest-Id:${requestId}\nRequest-Timestamp:${timestamp}\nRequest-Target:${targetPath}\nDigest:${digest}`;
|
|
116
|
+
const signature = 'HMACSHA256=' + crypto.createHmac('sha256', SECRET_KEY).update(component).digest('base64');
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
'Client-Id': CLIENT_ID,
|
|
121
|
+
'Request-Id': requestId,
|
|
122
|
+
'Request-Timestamp': timestamp,
|
|
123
|
+
'Request-Target': targetPath,
|
|
124
|
+
'Digest': digest,
|
|
125
|
+
'Signature': signature
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const server = new Server(
|
|
130
|
+
{ name: 'doku-mcp-server', version: '1.0.0' },
|
|
131
|
+
{ capabilities: { tools: {} } }
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
135
|
+
tools: [
|
|
136
|
+
{
|
|
137
|
+
name: 'create_checkout_payment',
|
|
138
|
+
description: 'Generate a DOKU payment checkout URL for customer order',
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: 'object',
|
|
141
|
+
properties: {
|
|
142
|
+
amount: { type: 'number', description: 'Total payment amount in IDR' },
|
|
143
|
+
invoice_number: { type: 'string', description: 'Unique order invoice number' },
|
|
144
|
+
customer_name: { type: 'string', description: 'Customer full name' },
|
|
145
|
+
customer_email: { type: 'string', description: 'Customer email address' }
|
|
146
|
+
},
|
|
147
|
+
required: ['amount', 'invoice_number', 'customer_name', 'customer_email']
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'check_transaction_status',
|
|
152
|
+
description: 'Check payment status of a transaction',
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
properties: {
|
|
156
|
+
invoice_number: { type: 'string', description: 'Invoice number to query' }
|
|
157
|
+
},
|
|
158
|
+
required: ['invoice_number']
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
165
|
+
const { name, arguments: args } = request.params;
|
|
166
|
+
|
|
167
|
+
if (name === 'create_checkout_payment') {
|
|
168
|
+
const targetPath = '/checkout/v1/payment';
|
|
169
|
+
const body = {
|
|
170
|
+
order: { amount: args?.amount, invoice_number: args?.invoice_number },
|
|
171
|
+
customer: { name: args?.customer_name, email: args?.customer_email }
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const response = await fetch(`${BASE_URL}${targetPath}`, {
|
|
175
|
+
method: 'POST',
|
|
176
|
+
headers: generateHeaders(targetPath, body),
|
|
177
|
+
body: JSON.stringify(body)
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const data = await response.json();
|
|
181
|
+
return {
|
|
182
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }]
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
throw new Error(`Tool not found: ${name}`);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
async function main() {
|
|
190
|
+
const transport = new StdioServerTransport();
|
|
191
|
+
await server.connect(transport);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
main().catch(console.error);
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### Common Pitfalls to Avoid
|
|
200
|
+
|
|
201
|
+
| Anti-Pattern | Issue | Solution |
|
|
202
|
+
|---|---|---|
|
|
203
|
+
| Hardcoding Merchant Secrets | Security vulnerability | Always load `DOKU_CLIENT_ID` and `DOKU_SECRET_KEY` from environment variables. |
|
|
204
|
+
| Incomplete Tool Schema Descriptions | AI Agent misinterprets tool usage | Provide clear parameter descriptions and strict `required` fields in JSON schema. |
|
|
205
|
+
| Returning Raw Errors | Unfriendly LLM agent experience | Catch API errors and return structured error JSON response in MCP tool text output. |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
<a name="bahasa-indonesia"></a>
|
|
210
|
+
## Bahasa Indonesia
|
|
211
|
+
|
|
212
|
+
### Integrasi Orkestrasi
|
|
213
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
214
|
+
|
|
215
|
+
### Deskripsi
|
|
216
|
+
Panduan ahli untuk mengintegrasikan dan membuat server Model Context Protocol (MCP) dengan DOKU Payment Gateway berdasarkan dokumentasi resmi [DOKU Developers Documentation](https://developers.doku.com/). Memungkinkan Agen AI (Claude Desktop, Antigravity, Cursor, n8n, LangChain) menjalankan transaksi pembayaran secara otonom dalam alur Agentic Commerce (membuat link pembayaran, membuat nomor Virtual Account, membuat kode QRIS, dan memeriksa status transaksi).
|
|
217
|
+
|
|
218
|
+
### Kondisi Pemicu
|
|
219
|
+
Aktifkan skill ini ketika pengguna sedang:
|
|
220
|
+
- Mengatur atau mengonfigurasi server DOKU MCP untuk Claude Desktop, Antigravity (AGY), Cursor, atau agen LLM.
|
|
221
|
+
- Mengimplementasikan alur kerja checkout otonom berbasis AI (AI Agentic Commerce) menggunakan DOKU.
|
|
222
|
+
- Membangun server MCP TypeScript atau Python kustom yang membungkus DOKU Jokul API.
|
|
223
|
+
- Mendefinisikan tool dan resource MCP untuk pembuatan dan verifikasi status pembayaran.
|
|
224
|
+
|
|
225
|
+
### Konfigurasi Client untuk Antigravity & Gemini
|
|
226
|
+
|
|
227
|
+
**Lokasi File Konfigurasi (`mcp.json`):**
|
|
228
|
+
- **Global:** `~/.gemini/config/mcp.json` (Windows: `%USERPROFILE%\.gemini\config\mcp.json`)
|
|
229
|
+
- **Workspace:** `.agents/mcp.json` (di dalam folder proyek)
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"mcpServers": {
|
|
234
|
+
"doku-payment": {
|
|
235
|
+
"command": "node",
|
|
236
|
+
"args": ["/path/to/doku-mcp-server/dist/index.js"],
|
|
237
|
+
"env": {
|
|
238
|
+
"DOKU_CLIENT_ID": "CLIENT_ID_SANDBOX_ATAU_PROD",
|
|
239
|
+
"DOKU_SECRET_KEY": "SECRET_KEY_SANDBOX_ATAU_PROD",
|
|
240
|
+
"DOKU_IS_PRODUCTION": "false"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Integrasi dengan Skill Lain
|
|
248
|
+
- `mcp-server-architect` — Untuk arsitektur dan pengamanan server MCP tingkat lanjut.
|
|
249
|
+
- `doku-payment-gateway` — Untuk rumus signature HMAC-SHA256 dan API spesifik DOKU.
|
|
250
|
+
- `multi-agent-orchestration` — Untuk mengaitkan DOKU MCP Server dengan swarm agen AI otonom.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
### 🚨 SNAP Integration Mandate (CRITICAL)
|
|
254
|
+
**MANDATORY**: The AI Agent MUST automatically apply the SNAP API v1.0 standard (Standard Nasional Open API Pembayaran) for all DOKU integrations, instead of the legacy Jokul API v2, unless the user explicitly requests otherwise. All generated signatures, headers, and endpoints MUST follow the SNAP BI standard.
|
|
255
|
+
|
|
256
|
+
### 🧪 DOKU Sandbox Simulator
|
|
257
|
+
**MANDATORY**: When testing in Sandbox mode and needing to access the Payment Simulator, the AI Agent MUST use this exact URL: `https://sandbox.doku.com/gtw-config-v2/simulator`.
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doku-payment-gateway
|
|
3
|
+
description: "Expert guide for integrating DOKU Payment Gateway (Jokul API v2). Covers HMAC-SHA256 header signature calculation, Checkout & Direct APIs (VA, QRIS, E-Wallet, Credit Card), webhook notification verification, and sandbox/production setup / Panduan ahli integrasi DOKU Payment Gateway."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# DOKU Payment Gateway Integration / Integrasi Payment Gateway DOKU
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Orchestration & Integration
|
|
17
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
|
|
18
|
+
|
|
19
|
+
### Description
|
|
20
|
+
Expert guide for implementing DOKU Payment Gateway (Jokul API v2) integrations based on official [DOKU Developers Documentation](https://developers.doku.com/). Covers authentication headers, SHA-256 Digest generation, HMAC-SHA256 request signature construction, Webhook notification verification, Checkout Payment Links, Direct Payments (Virtual Account, QRIS, E-Wallet, Credit Card), error handling, and sandbox/production deployment.
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
Activate this skill when the user is:
|
|
24
|
+
- Building or refactoring DOKU Payment Gateway integration in Node.js, TypeScript, Python, Go, PHP, or Java.
|
|
25
|
+
- Implementing HMAC-SHA256 signature calculations or notification signature verification for DOKU API.
|
|
26
|
+
- Setting up DOKU Virtual Account (BCA, Mandiri, BRI, BNI, Permata, DOKU VA), QRIS, E-Wallet (OVO, ShopeePay, DANA, LinkAja), or Credit Card APIs.
|
|
27
|
+
- Debugging DOKU API authorization errors (e.g., `Authorization Failed`, invalid signature, incorrect timestamp format).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### Core Architecture & Credentials
|
|
32
|
+
|
|
33
|
+
#### Environment Gateways
|
|
34
|
+
| Environment | Base URL | Dashboard Portal |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **Sandbox** | `https://api-sandbox.doku.com` | `https://sandbox.doku.com` |
|
|
37
|
+
| **Production** | `https://api.doku.com` | `https://dashboard.doku.com` |
|
|
38
|
+
|
|
39
|
+
#### Mandatory Headers
|
|
40
|
+
Every request sent to DOKU API requires the following headers:
|
|
41
|
+
- `Client-Id`: Merchant Client ID from DOKU Back Office.
|
|
42
|
+
- `Request-Id`: Unique random string generated for each request (e.g., UUID v4).
|
|
43
|
+
- `Request-Timestamp`: UTC ISO8601 timestamp string (e.g., `2026-08-07T13:00:00Z`).
|
|
44
|
+
- `Request-Target`: Target API endpoint path (e.g., `/checkout/v1/payment` or `/doku-virtual-account/v2/payment-code`).
|
|
45
|
+
- `Digest`: Base64 encoded SHA-256 hash of the JSON payload string (Omitted for `GET` requests).
|
|
46
|
+
- `Signature`: Format `HMACSHA256=<base64-signature>`.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### Signature Calculation Formula
|
|
51
|
+
|
|
52
|
+
#### 1. Digest Calculation (POST / PUT / PATCH)
|
|
53
|
+
```text
|
|
54
|
+
Raw Body -> SHA-256 Hash -> Base64 Encode -> Digest String
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### 2. Signature Component String
|
|
58
|
+
The components MUST be concatenated with newline `\n` without extra whitespace:
|
|
59
|
+
```text
|
|
60
|
+
Client-Id:<CLIENT_ID>\nRequest-Id:<REQUEST_ID>\nRequest-Timestamp:<TIMESTAMP>\nRequest-Target:<TARGET_PATH>\nDigest:<DIGEST_STRING>
|
|
61
|
+
```
|
|
62
|
+
*Note: For GET requests, omit `\nDigest:<DIGEST_STRING>`.*
|
|
63
|
+
|
|
64
|
+
#### 3. HMAC-SHA256 Signing
|
|
65
|
+
```text
|
|
66
|
+
Raw String + Secret Key -> HMAC-SHA256 Hash -> Base64 Encode -> Prepend "HMACSHA256="
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### TypeScript / Node.js Implementation Example
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import crypto from 'crypto';
|
|
75
|
+
|
|
76
|
+
interface DokuConfig {
|
|
77
|
+
clientId: string;
|
|
78
|
+
secretKey: string;
|
|
79
|
+
isProduction: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class DokuService {
|
|
83
|
+
private clientId: string;
|
|
84
|
+
private secretKey: string;
|
|
85
|
+
private baseUrl: string;
|
|
86
|
+
|
|
87
|
+
constructor(config: DokuConfig) {
|
|
88
|
+
this.clientId = config.clientId;
|
|
89
|
+
this.secretKey = config.secretKey;
|
|
90
|
+
this.baseUrl = config.isProduction
|
|
91
|
+
? 'https://api.doku.com'
|
|
92
|
+
: 'https://api-sandbox.doku.com';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private generateDigest(body: object): string {
|
|
96
|
+
const jsonBody = JSON.stringify(body);
|
|
97
|
+
return crypto.createHash('sha256').update(jsonBody, 'utf8').digest('base64');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private generateSignature(
|
|
101
|
+
requestId: string,
|
|
102
|
+
timestamp: string,
|
|
103
|
+
targetPath: string,
|
|
104
|
+
digest?: string
|
|
105
|
+
): string {
|
|
106
|
+
let rawComponent = `Client-Id:${this.clientId}\nRequest-Id:${requestId}\nRequest-Timestamp:${timestamp}\nRequest-Target:${targetPath}`;
|
|
107
|
+
|
|
108
|
+
if (digest) {
|
|
109
|
+
rawComponent += `\nDigest:${digest}`;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const hmac = crypto.createHmac('sha256', this.secretKey);
|
|
113
|
+
hmac.update(rawComponent);
|
|
114
|
+
const base64Hmac = hmac.digest('base64');
|
|
115
|
+
|
|
116
|
+
return `HMACSHA256=${base64Hmac}`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public async createCheckoutPayment(payload: {
|
|
120
|
+
order: { amount: number; invoice_number: string };
|
|
121
|
+
payment: { payment_due_date?: number };
|
|
122
|
+
customer: { name: string; email: string };
|
|
123
|
+
}) {
|
|
124
|
+
const targetPath = '/checkout/v1/payment';
|
|
125
|
+
const requestId = crypto.randomUUID();
|
|
126
|
+
const timestamp = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
127
|
+
const digest = this.generateDigest(payload);
|
|
128
|
+
const signature = this.generateSignature(requestId, timestamp, targetPath, digest);
|
|
129
|
+
|
|
130
|
+
const response = await fetch(`${this.baseUrl}${targetPath}`, {
|
|
131
|
+
method: 'POST',
|
|
132
|
+
headers: {
|
|
133
|
+
'Content-Type': 'application/json',
|
|
134
|
+
'Client-Id': this.clientId,
|
|
135
|
+
'Request-Id': requestId,
|
|
136
|
+
'Request-Timestamp': timestamp,
|
|
137
|
+
'Request-Target': targetPath,
|
|
138
|
+
'Digest': digest,
|
|
139
|
+
'Signature': signature,
|
|
140
|
+
},
|
|
141
|
+
body: JSON.stringify(payload),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
return await response.json();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Webhook / Notification Signature Verification
|
|
152
|
+
|
|
153
|
+
When DOKU sends a payment status notification to your webhook URL, you MUST verify its signature before processing.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import crypto from 'crypto';
|
|
157
|
+
import { Request, Response } from 'express';
|
|
158
|
+
|
|
159
|
+
export function verifyDokuWebhook(req: Request, secretKey: string): boolean {
|
|
160
|
+
const clientId = req.headers['client-id'] as string;
|
|
161
|
+
const requestId = req.headers['request-id'] as string;
|
|
162
|
+
const timestamp = req.headers['request-timestamp'] as string;
|
|
163
|
+
const targetPath = req.originalUrl || req.url;
|
|
164
|
+
const receivedSignature = req.headers['signature'] as string;
|
|
165
|
+
|
|
166
|
+
const rawBody = JSON.stringify(req.body);
|
|
167
|
+
const digest = crypto.createHash('sha256').update(rawBody, 'utf8').digest('base64');
|
|
168
|
+
|
|
169
|
+
const component = `Client-Id:${clientId}\nRequest-Id:${requestId}\nRequest-Timestamp:${timestamp}\nRequest-Target:${targetPath}\nDigest:${digest}`;
|
|
170
|
+
|
|
171
|
+
const calculatedHmac = crypto
|
|
172
|
+
.createHmac('sha256', secretKey)
|
|
173
|
+
.update(component)
|
|
174
|
+
.digest('base64');
|
|
175
|
+
|
|
176
|
+
const expectedSignature = `HMACSHA256=${calculatedHmac}`;
|
|
177
|
+
|
|
178
|
+
return crypto.timingSafeEqual(
|
|
179
|
+
Buffer.from(receivedSignature),
|
|
180
|
+
Buffer.from(expectedSignature)
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
### Common Pitfalls to Avoid
|
|
189
|
+
|
|
190
|
+
| Anti-Pattern | Issue | Solution |
|
|
191
|
+
|---|---|---|
|
|
192
|
+
| Extra trailing newline in component string | Signature validation fails (`Authorization Failed`) | Do not add `\n` at the end of the raw component string. |
|
|
193
|
+
| Non-UTC ISO8601 timestamp | Timestamp mismatch error | Always format timestamp with UTC Z timezone (e.g. `2026-08-07T13:00:00Z`). |
|
|
194
|
+
| Including Digest on `GET` requests | Signature mismatch | Omit `Digest` line completely when calculating signature for `GET` endpoints. |
|
|
195
|
+
| Unsorted JSON body in digest calculation | Body hash mismatch | Pass exact raw stringified JSON body used in HTTP POST. |
|
|
196
|
+
| Missing Idempotency Check | Duplicate processing on webhooks | Save `invoice_number` / `transaction_id` status in DB before executing state changes. |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
<a name="bahasa-indonesia"></a>
|
|
201
|
+
## Bahasa Indonesia
|
|
202
|
+
|
|
203
|
+
### Integrasi Orkestrasi
|
|
204
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
205
|
+
|
|
206
|
+
### Deskripsi
|
|
207
|
+
Panduan ahli untuk mengintegrasikan DOKU Payment Gateway (Jokul API v2) sesuai standar dokumentasi resmi [DOKU Developers Portal](https://developers.doku.com/). Mencakup header autentikasi, pembuatan Digest SHA-256, pembuatan Signature HMAC-SHA256, verifikasi Webhook/Notifikasi, Checkout Payment Link, Direct Payment (Virtual Account, QRIS, E-Wallet, Kartu Kredit), penanganan error, dan migrasi Sandbox ke Production.
|
|
208
|
+
|
|
209
|
+
### Kondisi Pemicu
|
|
210
|
+
Aktifkan skill ini ketika pengguna sedang:
|
|
211
|
+
- Membangun atau merefaktor integrasi DOKU Payment Gateway di Node.js, TypeScript, Python, Go, PHP, atau Java.
|
|
212
|
+
- Mengimplementasikan kalkulasi signature HMAC-SHA256 atau verifikasi signature notifikasi webhook DOKU.
|
|
213
|
+
- Mengatur API Virtual Account (BCA, Mandiri, BRI, BNI, Permata, DOKU VA), QRIS, E-Wallet (OVO, ShopeePay, DANA, LinkAja), atau Kartu Kredit.
|
|
214
|
+
- Melakukan debugging error otorisasi DOKU API (`Authorization Failed`, signature tidak valid, timestamp tidak sesuai format).
|
|
215
|
+
|
|
216
|
+
### Ringkasan Langkah Integrasi
|
|
217
|
+
1. **Dapatkan Kredensial**: Buat akun di DOKU Sandbox untuk mendapatkan `Client-Id` dan `Secret-Key`.
|
|
218
|
+
2. **Hitung Digest**: Untuk request `POST`, hash body JSON dengan SHA-256 lalu Base64.
|
|
219
|
+
3. **Format Signature String**: Gabungkan `Client-Id`, `Request-Id`, `Request-Timestamp`, `Request-Target`, dan `Digest` dipisahkan dengan `\n`.
|
|
220
|
+
4. **Sign HMAC-SHA256**: Hash string komponen menggunakan `Secret-Key` dengan algoritma HMAC-SHA256, ubah ke Base64, tambahkan awalan `HMACSHA256=`.
|
|
221
|
+
5. **Verifikasi Webhook**: Gunakan formula yang sama pada header notifikasi masuk untuk memastikan pesan valid berasal dari DOKU.
|
|
222
|
+
|
|
223
|
+
### Integrasi dengan Skill Lain
|
|
224
|
+
- `payment-gateway-expert` — Untuk arsitektur billing SaaS umum dan state machine langganan.
|
|
225
|
+
- `doku-mcp-server` — Untuk mengintegrasikan API DOKU ke Model Context Protocol AI Agent.
|
|
226
|
+
- `database-orm-expert` — Untuk menyimpan transaksi pembayaran dan log webhook secara type-safe.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
### 🚨 SNAP Integration Mandate (CRITICAL)
|
|
230
|
+
**MANDATORY**: The AI Agent MUST automatically apply the SNAP API v1.0 standard (Standard Nasional Open API Pembayaran) for all DOKU integrations, instead of the legacy Jokul API v2, unless the user explicitly requests otherwise. All generated signatures, headers, and endpoints MUST follow the SNAP BI standard.
|
|
231
|
+
|
|
232
|
+
### 🧪 DOKU Sandbox Simulator
|
|
233
|
+
**MANDATORY**: When testing in Sandbox mode and needing to access the Payment Simulator, the AI Agent MUST use this exact URL: `https://sandbox.doku.com/gtw-config-v2/simulator`.
|