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.
Files changed (151) hide show
  1. package/.claude/rules/vibes-plug-core.md +5 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +7 -2
  3. package/.cursorrules +8 -2
  4. package/AGENTS.md +23 -2
  5. package/CHANGELOG.md +114 -0
  6. package/CLAUDE.md +10 -3
  7. package/README.md +216 -611
  8. package/bin/vibes.mjs +1104 -0
  9. package/package.json +11 -3
  10. package/plugin.json +4 -3
  11. package/scripts/check-anti-slop.mjs +53 -0
  12. package/scripts/install.js +3 -1
  13. package/scripts/update_skills.js +1 -1
  14. package/scripts/update_skills.mjs +86 -0
  15. package/scripts/validate-skills.mjs +111 -0
  16. package/skills/accessibility-testing-expert/SKILL.md +117 -116
  17. package/skills/affective-computing-emotion-ai/SKILL.md +83 -0
  18. package/skills/agentic-coding-workflow-expert/SKILL.md +297 -0
  19. package/skills/agentic-memory-architect/SKILL.md +52 -0
  20. package/skills/agentic-micro-economy-architect/SKILL.md +92 -0
  21. package/skills/ai-llm-integration-expert/SKILL.md +330 -194
  22. package/skills/ai-media-generation-expert/SKILL.md +173 -172
  23. package/skills/ai-prompt-engineering-expert/SKILL.md +204 -134
  24. package/skills/ai-safety-governance-expert/SKILL.md +223 -0
  25. package/skills/angular-expert/SKILL.md +149 -148
  26. package/skills/anti-slop/SKILL.md +134 -133
  27. package/skills/api-design-expert/SKILL.md +4 -3
  28. package/skills/api-gateway-proxy-expert/SKILL.md +3 -2
  29. package/skills/app-analyzer-optimizer/SKILL.md +4 -3
  30. package/skills/apple-ecosystem-expert/SKILL.md +6 -5
  31. package/skills/astro-framework-expert/SKILL.md +201 -200
  32. package/skills/async-queue-temporal-expert/SKILL.md +218 -217
  33. package/skills/authentication-identity-expert/SKILL.md +174 -173
  34. package/skills/autonomous-red-teamer/SKILL.md +338 -203
  35. package/skills/autonomous-tdd-debugger/SKILL.md +6 -5
  36. package/skills/biome-linter-formatter-expert/SKILL.md +90 -89
  37. package/skills/blockchain-web3-expert/SKILL.md +116 -115
  38. package/skills/brainstorming/SKILL.md +392 -377
  39. package/skills/browser-automation-expert/SKILL.md +260 -222
  40. package/skills/bun-runtime-expert/SKILL.md +5 -4
  41. package/skills/chatbot-messaging-expert/SKILL.md +115 -114
  42. package/skills/ci-cd-devops-architect/SKILL.md +3 -2
  43. package/skills/cloud-hosting-expert/SKILL.md +5 -4
  44. package/skills/coderabbit/SKILL.md +5 -4
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +3 -2
  46. package/skills/composable-mach-architect/SKILL.md +338 -0
  47. package/skills/cron-scheduler-expert/SKILL.md +5 -4
  48. package/skills/data-pipeline-etl-expert/SKILL.md +3 -2
  49. package/skills/data-telemetry-expert/SKILL.md +5 -4
  50. package/skills/data-visualization-expert/SKILL.md +155 -154
  51. package/skills/database-orm-expert/SKILL.md +166 -165
  52. package/skills/deep-research-analyst/SKILL.md +182 -136
  53. package/skills/dependency-upgrade-migrator/SKILL.md +11 -10
  54. package/skills/design-system-architect/SKILL.md +4 -3
  55. package/skills/desktop-electron-expert/SKILL.md +129 -128
  56. package/skills/documentation-site-expert/SKILL.md +60 -59
  57. package/skills/doku-mcp-server/SKILL.md +5 -4
  58. package/skills/doku-payment-gateway/SKILL.md +250 -232
  59. package/skills/domain-driven-design-expert/SKILL.md +3 -2
  60. package/skills/e2e-testing-expert/SKILL.md +5 -4
  61. package/skills/ecommerce-expert/SKILL.md +88 -87
  62. package/skills/email-notification-expert/SKILL.md +5 -4
  63. package/skills/ephemeral-generative-ui-architect/SKILL.md +88 -0
  64. package/skills/error-resilience-expert/SKILL.md +14 -13
  65. package/skills/event-driven-architect/SKILL.md +5 -4
  66. package/skills/feature-flag-analytics-expert/SKILL.md +3 -2
  67. package/skills/file-upload-media-expert/SKILL.md +5 -4
  68. package/skills/firebase-security-expert/SKILL.md +5 -4
  69. package/skills/form-validation-expert/SKILL.md +7 -6
  70. package/skills/frontier-ai-models-expert/SKILL.md +116 -0
  71. package/skills/fullstack-expert/SKILL.md +185 -184
  72. package/skills/gemini-agent-booster/SKILL.md +248 -172
  73. package/skills/geospatial-maps-expert/SKILL.md +81 -80
  74. package/skills/global-a11y-i18n-expert/SKILL.md +5 -4
  75. package/skills/glsl-shader-expert/SKILL.md +191 -190
  76. package/skills/go-programming-expert/SKILL.md +5 -4
  77. package/skills/graph-rag-knowledge-expert/SKILL.md +201 -200
  78. package/skills/graphql-apollo-expert/SKILL.md +5 -4
  79. package/skills/headless-cms-expert/SKILL.md +182 -181
  80. package/skills/hig/SKILL.md +5 -4
  81. package/skills/js-backend-expert/SKILL.md +219 -218
  82. package/skills/legacy-code-translator/SKILL.md +6 -5
  83. package/skills/llm-finops-router/SKILL.md +52 -0
  84. package/skills/local-slm-edge-ai-expert/SKILL.md +168 -167
  85. package/skills/logging-error-tracking-expert/SKILL.md +5 -4
  86. package/skills/mcp-server-architect/SKILL.md +315 -307
  87. package/skills/micro-frontend-architect/SKILL.md +5 -4
  88. package/skills/mobile-expo-expert/SKILL.md +5 -4
  89. package/skills/modern-css-native-expert/SKILL.md +190 -189
  90. package/skills/monorepo-architect/SKILL.md +5 -4
  91. package/skills/mpa-orchestrator/SKILL.md +41 -4
  92. package/skills/multi-agent-orchestration/SKILL.md +388 -254
  93. package/skills/mvc-expert/SKILL.md +5 -4
  94. package/skills/n8n-automation-expert/SKILL.md +90 -89
  95. package/skills/nextjs-app-router-expert/SKILL.md +3 -2
  96. package/skills/openapi-swagger-codegen-expert/SKILL.md +4 -3
  97. package/skills/payment-gateway-expert/SKILL.md +131 -128
  98. package/skills/pdf-document-generation-expert/SKILL.md +92 -91
  99. package/skills/performance-web-vitals/SKILL.md +5 -4
  100. package/skills/post-quantum-crypto-migrator/SKILL.md +3 -2
  101. package/skills/prd-architect/SKILL.md +183 -182
  102. package/skills/proactive-background-watcher/SKILL.md +5 -4
  103. package/skills/production-ready-hardener/SKILL.md +10 -9
  104. package/skills/pwa-offline-first-expert/SKILL.md +227 -226
  105. package/skills/pydantic-ai-expert/SKILL.md +162 -161
  106. package/skills/python-programming-expert/SKILL.md +5 -4
  107. package/skills/rate-limit-abuse-prevention/SKILL.md +5 -4
  108. package/skills/realtime-collaboration-expert/SKILL.md +3 -2
  109. package/skills/rich-text-editor-expert/SKILL.md +178 -177
  110. package/skills/rust-programming-expert/SKILL.md +5 -4
  111. package/skills/saas-architect/SKILL.md +155 -154
  112. package/skills/saas-billing/SKILL.md +394 -382
  113. package/skills/saas-multi-tenant/SKILL.md +7 -6
  114. package/skills/scalability-clean-code/SKILL.md +5 -4
  115. package/skills/search-engine-expert/SKILL.md +90 -89
  116. package/skills/self-healing-cloud-orchestrator/SKILL.md +3 -2
  117. package/skills/senior-frontend/SKILL.md +14 -9
  118. package/skills/seo/SKILL.md +4 -4
  119. package/skills/session-memory-manager/SKILL.md +129 -128
  120. package/skills/solidjs-expert/SKILL.md +81 -80
  121. package/skills/spa-orchestrator/SKILL.md +5 -4
  122. package/skills/sse-websocket-streaming-expert/SKILL.md +3 -2
  123. package/skills/state-management-expert/SKILL.md +5 -4
  124. package/skills/supabase-security-expert/SKILL.md +5 -4
  125. package/skills/svelte-sveltekit-expert/SKILL.md +92 -91
  126. package/skills/svg-animation-motion-expert/SKILL.md +3 -2
  127. package/skills/synthetic-data-finetuning-expert/SKILL.md +156 -155
  128. package/skills/tailwind-expert/SKILL.md +62 -5
  129. package/skills/tanstack-query-expert/SKILL.md +5 -4
  130. package/skills/tauri-expert/SKILL.md +5 -4
  131. package/skills/typescript-expert/SKILL.md +5 -4
  132. package/skills/ui-ux-pro-max/SKILL.md +7 -6
  133. package/skills/vector-db-rag-expert/SKILL.md +209 -208
  134. package/skills/vercel-ai-sdk-expert/SKILL.md +226 -181
  135. package/skills/voice-ai-realtime-agent/SKILL.md +243 -242
  136. package/skills/vue-frontend-expert/SKILL.md +5 -4
  137. package/skills/wasm-edge-computing-expert/SKILL.md +3 -2
  138. package/skills/web-3d-graphics-expert/SKILL.md +314 -313
  139. package/skills/web-game-engine-expert/SKILL.md +330 -329
  140. package/skills/web-scraper/SKILL.md +158 -157
  141. package/skills/website-design-cloner/SKILL.md +5 -4
  142. package/skills/webxr-ar-vr-expert/SKILL.md +163 -162
  143. package/skills/wordpress-headless-expert/SKILL.md +145 -144
  144. package/skills/zero-tech-debt-auditor/SKILL.md +115 -0
  145. package/skills/zero-to-prod-orchestrator/SKILL.md +281 -229
  146. package/skills/zero-trust-secret-vault/SKILL.md +3 -2
  147. package/BLUEPRINT.md +0 -319
  148. package/skills/bootstrap-to-modern/SKILL.md +0 -94
  149. package/skills/multiple-entry-points/SKILL.md +0 -91
  150. package/skills/secure-fuzz-testing/SKILL.md +0 -207
  151. package/skills/visual-qa-vision-agent/SKILL.md +0 -71
@@ -1,233 +1,251 @@
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."
1
+ ---
2
+ name: doku-payment-gateway
3
+ description: "Expert guide for integrating DOKU Payment Gateway (SNAP BI Standard). Covers B2B Access Token, HMAC-SHA512 signature calculation, SNAP API integrations (VA, QRIS, E-Wallet, Credit Card), webhook notification verification, and sandbox/production setup / Panduan ahli integrasi DOKU Payment Gateway (Standar SNAP BI)."
4
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`.
5
+ version: "4.0.0"
6
+ ---
7
+
8
+ # DOKU Payment Gateway Integration / Integrasi Payment Gateway DOKU
9
+
10
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
11
+
12
+ ---
13
+
14
+ <a name="english"></a>
15
+ ## English
16
+
17
+ ### Orchestration & Integration
18
+ Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `session-memory-manager` to ensure cohesive execution.
19
+
20
+ ### Description
21
+ Expert guide for implementing DOKU Payment Gateway integrations based on official [DOKU Developers Documentation](https://developers.doku.com/). As of the mandate, all integrations MUST use the SNAP API v1.0 standard (Standard Nasional Open API Pembayaran) instead of the legacy Jokul API v2.
22
+ Covers B2B Access Token generation, SHA-256 Body hashing, HMAC-SHA512 request signature construction, Webhook notification verification, Payment implementations (Virtual Account, QRIS, E-Wallet, Credit Card), error handling, and sandbox/production deployment.
23
+
24
+ ### Trigger Conditions
25
+ Activate this skill when the user is:
26
+ - Building or refactoring DOKU Payment Gateway integration in Node.js, TypeScript, Python, Go, PHP, or Java.
27
+ - Implementing SNAP BI B2B Access Token and HMAC-SHA512 signature calculations (`X-SIGNATURE`).
28
+ - Setting up DOKU SNAP APIs for Virtual Account, QRIS, E-Wallet, or Credit Card.
29
+ - Debugging DOKU API authorization errors (e.g., `Unauthorized`, invalid signature, incorrect timestamp format).
30
+
31
+ ---
32
+
33
+ ### Core Architecture & Credentials
34
+
35
+ #### Environment Gateways
36
+ | Environment | Base URL | Dashboard Portal | Simulator |
37
+ |---|---|---|---|
38
+ | **Sandbox** | `https://api-sandbox.doku.com` | `https://sandbox.doku.com` | `https://sandbox.doku.com/gtw-config-v2/simulator` |
39
+ | **Production** | `https://api.doku.com` | `https://dashboard.doku.com` | N/A |
40
+
41
+ #### Mandatory Headers (SNAP BI Standard)
42
+ For B2B Access Token Generation (`/api/v1.0/access-token/b2b`):
43
+ - `X-CLIENT-KEY`: Merchant Client ID from DOKU Back Office.
44
+ - `X-TIMESTAMP`: ISO8601 timestamp string (e.g., `2026-08-07T13:00:00+07:00`).
45
+ - `X-SIGNATURE`: RSA-SHA256 signature (Base64) - *Note: The token generation uses Asymmetric RSA, but subsequent transactional APIs use Symmetric HMAC-SHA512.*
46
+
47
+ For Transactional Endpoints (e.g., `/bi-snap-va/v1/transfer-va/create-va`):
48
+ - `Authorization`: Format `Bearer <B2B_ACCESS_TOKEN>`.
49
+ - `X-TIMESTAMP`: ISO8601 timestamp string (e.g., `2026-08-07T13:00:00+07:00`).
50
+ - `X-SIGNATURE`: HMAC-SHA512 signature (Base64 encoded string).
51
+ - `X-PARTNER-ID`: Client ID.
52
+ - `X-EXTERNAL-ID`: Unique string (e.g. UUID) for the request.
53
+
54
+ ---
55
+
56
+ ### Signature Calculation Formula (SNAP Transactional API)
57
+
58
+ #### 1. Body Hash (POST / PUT / PATCH)
59
+ ```text
60
+ Minified JSON Body -> SHA-256 Hash -> Hex Encode -> Lowercase
61
+ ```
62
+
63
+ #### 2. String to Sign Component
64
+ The components MUST be concatenated with `:` without extra whitespace:
65
+ ```text
66
+ HTTPMethod:EndpointURL:AccessToken:LowercaseHexBodyHash:Timestamp
67
+ ```
68
+ *Example:* `POST:/bi-snap-va/v1/transfer-va/create-va:eyJhb...:a1b2c3d4...:2026-08-07T13:00:00+07:00`
69
+
70
+ #### 3. HMAC-SHA512 Signing
71
+ ```text
72
+ String to Sign + Client Secret -> HMAC-SHA512 Hash -> Base64 Encode -> X-SIGNATURE
73
+ ```
74
+
75
+ ---
76
+
77
+ ### TypeScript / Node.js Implementation Example
78
+
79
+ ```typescript
80
+ import crypto from 'crypto';
81
+
82
+ interface DokuSnapConfig {
83
+ clientId: string;
84
+ clientSecret: string;
85
+ isProduction: boolean;
86
+ }
87
+
88
+ export class DokuSnapService {
89
+ private clientId: string;
90
+ private clientSecret: string;
91
+ private baseUrl: string;
92
+
93
+ constructor(config: DokuSnapConfig) {
94
+ this.clientId = config.clientId;
95
+ this.clientSecret = config.clientSecret;
96
+ this.baseUrl = config.isProduction
97
+ ? 'https://api.doku.com'
98
+ : 'https://api-sandbox.doku.com';
99
+ }
100
+
101
+ private generateBodyHash(body: object): string {
102
+ const minifiedBody = JSON.stringify(body);
103
+ return crypto.createHash('sha256').update(minifiedBody, 'utf8').digest('hex').toLowerCase();
104
+ }
105
+
106
+ public generateSignature(
107
+ method: string,
108
+ targetPath: string,
109
+ accessToken: string,
110
+ timestamp: string,
111
+ body?: object
112
+ ): string {
113
+ let bodyHash = '';
114
+ if (body && ['POST', 'PUT', 'PATCH'].includes(method.toUpperCase())) {
115
+ bodyHash = this.generateBodyHash(body);
116
+ }
117
+
118
+ const stringToSign = `${method.toUpperCase()}:${targetPath}:${accessToken}:${bodyHash}:${timestamp}`;
119
+
120
+ return crypto
121
+ .createHmac('sha512', this.clientSecret)
122
+ .update(stringToSign, 'utf8')
123
+ .digest('base64');
124
+ }
125
+
126
+ public async createVirtualAccount(accessToken: string, payload: any) {
127
+ const targetPath = '/bi-snap-va/v1/transfer-va/create-va';
128
+ const externalId = crypto.randomUUID();
129
+ // Example format: 2026-09-24T19:30:00+07:00
130
+ const timestamp = new Date().toISOString();
131
+
132
+ const signature = this.generateSignature('POST', targetPath, accessToken, timestamp, payload);
133
+
134
+ const response = await fetch(`${this.baseUrl}${targetPath}`, {
135
+ method: 'POST',
136
+ headers: {
137
+ 'Content-Type': 'application/json',
138
+ 'Authorization': `Bearer ${accessToken}`,
139
+ 'X-TIMESTAMP': timestamp,
140
+ 'X-SIGNATURE': signature,
141
+ 'X-PARTNER-ID': this.clientId,
142
+ 'X-EXTERNAL-ID': externalId,
143
+ 'CHANNEL-ID': 'SDK'
144
+ },
145
+ body: JSON.stringify(payload),
146
+ });
147
+
148
+ return await response.json();
149
+ }
150
+ }
151
+ ```
152
+
153
+ ---
154
+
155
+ ### Webhook / Notification Signature Verification
156
+
157
+ When DOKU sends a webhook/notification in SNAP format, you MUST verify its signature.
158
+ The process is identical to generating the signature: recreate the `stringToSign` using the incoming headers, the minified raw body, and your `Client Secret`, then compare the resulting HMAC-SHA512 Base64 string with the `X-SIGNATURE` header.
159
+
160
+ ```typescript
161
+ import crypto from 'crypto';
162
+ import { Request, Response } from 'express';
163
+
164
+ export function verifyDokuSnapWebhook(req: Request, clientSecret: string): boolean {
165
+ const method = req.method.toUpperCase();
166
+ const targetPath = req.originalUrl || req.url; // e.g., /api/webhook
167
+ const timestamp = req.headers['x-timestamp'] as string;
168
+ const receivedSignature = req.headers['x-signature'] as string;
169
+ // B2B token in Authorization header, remove 'Bearer '
170
+ const authHeader = req.headers['authorization'] as string;
171
+ const accessToken = authHeader ? authHeader.replace(/^Bearer\s+/i, '') : '';
172
+
173
+ // Use raw body for exact minification match
174
+ const rawBody = typeof req.body === 'string' ? req.body : JSON.stringify(req.body);
175
+ const bodyHash = crypto.createHash('sha256').update(rawBody, 'utf8').digest('hex').toLowerCase();
176
+
177
+ const stringToSign = `${method}:${targetPath}:${accessToken}:${bodyHash}:${timestamp}`;
178
+
179
+ const expectedSignature = crypto
180
+ .createHmac('sha512', clientSecret)
181
+ .update(stringToSign, 'utf8')
182
+ .digest('base64');
183
+
184
+ return crypto.timingSafeEqual(
185
+ Buffer.from(receivedSignature),
186
+ Buffer.from(expectedSignature)
187
+ );
188
+ }
189
+ ```
190
+
191
+ ---
192
+
193
+ ### Webhook Idempotency & Race Condition Prevention
194
+
195
+ When processing DOKU webhooks, you MUST implement Idempotency and prevent Race Conditions. DOKU may retry sending the same webhook if your server takes too long to respond.
196
+
197
+ **Best Practices:**
198
+ 1. **Raw Body Parser**: Always use a raw body parser (e.g., `express.raw({ type: 'application/json' })`) for the webhook route. `JSON.stringify(req.body)` can alter spacing/key order, causing signature validation to fail.
199
+ 2. **Atomic Updates**: Use database-level locks or atomic updates to ensure a transaction is only processed once. Update the database record `WHERE invoice_number = 'X' AND status = 'PENDING'`. If the update affects 0 rows, the webhook was already processed.
200
+ 3. **Return 200 OK Early**: If the signature is valid but the transaction is already processed (duplicate), immediately return `200 OK` to DOKU so they stop retrying.
201
+ 4. **B2B Token Caching**: Generating the B2B Access Token requires an RSA signature and network request. Cache this token (e.g., in Redis or Memory) until its expiry to reduce latency on transactional endpoints.
202
+
203
+ ---
204
+
205
+ ### Common Pitfalls to Avoid
206
+
207
+ | Anti-Pattern | Issue | Solution |
208
+ |---|---|---|
209
+ | Non-minified JSON body | Signature validation fails (`Invalid Signature`) | Always stringify JSON without extra spaces before hashing. For webhooks, use the raw unparsed request body. |
210
+ | Using HMAC-SHA256 | Signature validation fails | SNAP BI transactional signature uses **HMAC-SHA512** (Note: B2B Access Token uses RSA-SHA256). |
211
+ | Capitalized Hex Hash | Signature mismatch | Ensure the SHA-256 body hash hex string is converted to lowercase before appending to `stringToSign`. |
212
+ | Missing `Bearer` in Authorization | Unauthorized error | The `Authorization` header must include `Bearer <Token>`, but the `stringToSign` component must **only** be the token. |
213
+ | Processing webhook twice | Double balance top-up (Race Condition) | Use Atomic Updates (`UPDATE ... WHERE status = 'PENDING'`) and return 200 OK for duplicates. |
214
+
215
+ ---
216
+
217
+ <a name="bahasa-indonesia"></a>
218
+ ## Bahasa Indonesia
219
+
220
+ ### Integrasi Orkestrasi
221
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `session-memory-manager` untuk memastikan eksekusi yang kohesif.
222
+
223
+ ### Deskripsi
224
+ Panduan ahli untuk mengintegrasikan DOKU Payment Gateway dengan standar dokumentasi resmi [DOKU Developers Portal](https://developers.doku.com/). Berdasarkan mandat, seluruh integrasi WAJIB menggunakan standar SNAP API v1.0 (Standard Nasional Open API Pembayaran) sebagai pengganti Jokul API v2.
225
+ Mencakup pembuatan B2B Access Token, Hash Body SHA-256, pembuatan Signature HMAC-SHA512, verifikasi Webhook/Notifikasi, dan implementasi API (Virtual Account, QRIS, E-Wallet, Kartu Kredit).
226
+
227
+ ### Kondisi Pemicu
228
+ Aktifkan skill ini ketika pengguna sedang:
229
+ - Membangun atau merefaktor integrasi DOKU Payment Gateway di Node.js, TypeScript, Python, Go, PHP, atau Java.
230
+ - Mengimplementasikan kalkulasi signature HMAC-SHA512 (`X-SIGNATURE`) standar SNAP BI.
231
+ - Mengatur API SNAP untuk Virtual Account, QRIS, E-Wallet, atau Kartu Kredit.
232
+ - Melakukan debugging error otorisasi DOKU API (`Invalid Signature`, token kedaluwarsa).
233
+
234
+ ### Ringkasan Langkah Integrasi (SNAP BI)
235
+ 1. **Dapatkan Kredensial**: Ambil `Client-Id` dan `Secret-Key` dari DOKU Sandbox.
236
+ 2. **Generate B2B Access Token**: Hitung signature Asimetrik RSA-SHA256 dan panggil `/api/v1.0/access-token/b2b`.
237
+ 3. **Hitung Body Hash**: Untuk request transaksional `POST`, minify body JSON lalu hash menggunakan SHA-256, ubah ke Hex, dan format ke huruf kecil (lowercase).
238
+ 4. **Format String to Sign**: Gabungkan `HTTPMethod`, `EndpointURL`, `AccessToken`, `BodyHash`, dan `Timestamp` dipisahkan dengan titik dua `:`.
239
+ 5. **Sign HMAC-SHA512**: Hash string komponen menggunakan `Secret-Key` dengan algoritma HMAC-SHA512, ubah ke Base64, jadikan header `X-SIGNATURE`.
240
+
241
+ ### Integrasi dengan Skill Lain
242
+ - `payment-gateway-expert` — Untuk arsitektur billing SaaS umum dan state machine langganan.
243
+ - `doku-mcp-server` — Untuk mengintegrasikan API DOKU ke Model Context Protocol AI Agent.
244
+ - `database-orm-expert` — Untuk menyimpan transaksi pembayaran dan log webhook secara type-safe.
245
+
246
+ ---
247
+ ### 🚨 SNAP Integration Mandate (CRITICAL)
248
+ **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.
249
+
250
+ ### 🧪 DOKU Sandbox Simulator
251
+ **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`.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: domain-driven-design-expert
3
3
  description: "Expert guide for Domain-Driven Design (DDD). Covers tactical patterns (Aggregates, Value Objects), strategic patterns (Bounded Contexts), event storming, and CQRS / Panduan ahli Desain Berbasis Domain (DDD)."
4
- author: "Roedy Rustam"
4
+ author: "Roedy Rustam"
5
+ version: "3.0.0"
5
6
  ---
6
7
 
7
8
  # Domain-Driven Design (DDD) Expert
@@ -79,4 +80,4 @@ Pisahkan model data untuk operasi *Write* (Command) dan *Read* (Query). Model ba
79
80
  ## Integrasi Orkestrasi
80
81
  - Mengembangkan `scalability-clean-code` dengan pola isolasi domain yang ketat.
81
82
  - Sangat penting bagi `event-driven-architect` untuk menentukan struktur event di message broker.
82
- - Membantu `micro-frontend-architect` menyelaraskan batas-batas frontend dengan Bounded Contexts backend.
83
+ - Membantu `micro-frontend-architect` menyelaraskan batas-batas frontend dengan Bounded Contexts backend.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: e2e-testing-expert
3
3
  description: "Expert guide for End-to-End (E2E) testing with Playwright, unit/integration testing with Vitest, and CI/CD automated testing pipeline setup / Panduan ahli pengujian End-to-End (E2E) dengan Playwright, pengujian unit/integrasi dengan Vitest, dan otomatisasi CI/CD."
4
- author: "Roedy Rustam"
4
+ author: "Roedy Rustam"
5
+ version: "3.0.0"
5
6
  ---
6
7
 
7
8
  # E2E Testing Expert (Playwright 1.49+ / Vitest 3 Edition)
@@ -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 `project-context-mapper` to ensure cohesive execution.
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
  Expert guide for building comprehensive automated test suites using **Playwright 1.49+** (E2E + component testing), **Vitest 3** (unit/integration), and robust CI/CD pipelines. Covers modern testing patterns for Next.js 15, React 19, and API backends.
@@ -283,7 +284,7 @@ jobs:
283
284
  ## Bahasa Indonesia
284
285
 
285
286
  ### Integrasi Orkestrasi
286
- Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
287
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `session-memory-manager` untuk memastikan eksekusi yang kohesif.
287
288
 
288
289
  ### Deskripsi
289
290
  Panduan ahli untuk membangun test suite otomatis yang komprehensif menggunakan **Playwright 1.49+** (E2E + component testing), **Vitest 3** (unit/integrasi), dan pipeline CI/CD yang kuat. Mencakup pola pengujian modern untuk Next.js 15, React 19, dan backend API.
@@ -318,4 +319,4 @@ Gunakan `storageState` untuk menyimpan state sesi setelah login sekali dan mengg
318
319
  Vitest 3 adalah test runner yang cepat berbasis Vite dengan kompatibilitas Jest penuh. Gunakan untuk unit test React component, server action, dan logika bisnis.
319
320
 
320
321
  ### Pipeline CI GitHub Actions
321
- Pisahkan job `unit` dan `e2e` untuk feedback paralel yang lebih cepat. Upload `playwright-report` sebagai artifact saat gagal untuk debugging.
322
+ Pisahkan job `unit` dan `e2e` untuk feedback paralel yang lebih cepat. Upload `playwright-report` sebagai artifact saat gagal untuk debugging.