codehava-agent-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +56 -0
  2. package/bin/cli.js +56 -0
  3. package/package.json +26 -0
  4. package/templates/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  5. package/templates/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  6. package/templates/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  7. package/templates/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  8. package/templates/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
  9. package/templates/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  10. package/templates/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  11. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  12. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  13. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  14. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  15. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  16. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  17. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  18. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  19. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  20. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  21. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  22. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  23. package/templates/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  24. package/templates/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  25. package/templates/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  26. package/templates/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  27. package/templates/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  28. package/templates/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  29. package/templates/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  30. package/templates/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  31. package/templates/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  32. package/templates/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
  33. package/templates/.agent/agents/backend-specialist.md +263 -0
  34. package/templates/.agent/agents/code-archaeologist.md +106 -0
  35. package/templates/.agent/agents/database-architect.md +226 -0
  36. package/templates/.agent/agents/debugger.md +225 -0
  37. package/templates/.agent/agents/devops-engineer.md +242 -0
  38. package/templates/.agent/agents/documentation-writer.md +104 -0
  39. package/templates/.agent/agents/explorer-agent.md +73 -0
  40. package/templates/.agent/agents/frontend-specialist.md +593 -0
  41. package/templates/.agent/agents/game-developer.md +162 -0
  42. package/templates/.agent/agents/mobile-developer.md +377 -0
  43. package/templates/.agent/agents/orchestrator.md +416 -0
  44. package/templates/.agent/agents/penetration-tester.md +188 -0
  45. package/templates/.agent/agents/performance-optimizer.md +187 -0
  46. package/templates/.agent/agents/product-manager.md +112 -0
  47. package/templates/.agent/agents/product-owner.md +95 -0
  48. package/templates/.agent/agents/project-planner.md +406 -0
  49. package/templates/.agent/agents/qa-automation-engineer.md +103 -0
  50. package/templates/.agent/agents/security-auditor.md +170 -0
  51. package/templates/.agent/agents/seo-specialist.md +111 -0
  52. package/templates/.agent/agents/test-engineer.md +158 -0
  53. package/templates/.agent/mcp_config.json +129 -0
  54. package/templates/.agent/rules/GEMINI.md +273 -0
  55. package/templates/.agent/scripts/auto_preview.py +148 -0
  56. package/templates/.agent/scripts/checklist.py +217 -0
  57. package/templates/.agent/scripts/session_manager.py +120 -0
  58. package/templates/.agent/scripts/verify_all.py +327 -0
  59. package/templates/.agent/skills/api-patterns/SKILL.md +81 -0
  60. package/templates/.agent/skills/api-patterns/api-style.md +42 -0
  61. package/templates/.agent/skills/api-patterns/auth.md +24 -0
  62. package/templates/.agent/skills/api-patterns/documentation.md +26 -0
  63. package/templates/.agent/skills/api-patterns/graphql.md +41 -0
  64. package/templates/.agent/skills/api-patterns/rate-limiting.md +31 -0
  65. package/templates/.agent/skills/api-patterns/response.md +37 -0
  66. package/templates/.agent/skills/api-patterns/rest.md +40 -0
  67. package/templates/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  68. package/templates/.agent/skills/api-patterns/security-testing.md +122 -0
  69. package/templates/.agent/skills/api-patterns/trpc.md +41 -0
  70. package/templates/.agent/skills/api-patterns/versioning.md +22 -0
  71. package/templates/.agent/skills/app-builder/SKILL.md +75 -0
  72. package/templates/.agent/skills/app-builder/agent-coordination.md +71 -0
  73. package/templates/.agent/skills/app-builder/feature-building.md +53 -0
  74. package/templates/.agent/skills/app-builder/project-detection.md +34 -0
  75. package/templates/.agent/skills/app-builder/scaffolding.md +118 -0
  76. package/templates/.agent/skills/app-builder/tech-stack.md +41 -0
  77. package/templates/.agent/skills/app-builder/templates/SKILL.md +39 -0
  78. package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  79. package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  80. package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  81. package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  82. package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  83. package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  84. package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  85. package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  86. package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  87. package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  88. package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  89. package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  90. package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  91. package/templates/.agent/skills/architecture/SKILL.md +55 -0
  92. package/templates/.agent/skills/architecture/context-discovery.md +43 -0
  93. package/templates/.agent/skills/architecture/examples.md +94 -0
  94. package/templates/.agent/skills/architecture/pattern-selection.md +68 -0
  95. package/templates/.agent/skills/architecture/patterns-reference.md +50 -0
  96. package/templates/.agent/skills/architecture/trade-off-analysis.md +77 -0
  97. package/templates/.agent/skills/bash-linux/SKILL.md +199 -0
  98. package/templates/.agent/skills/behavioral-modes/SKILL.md +242 -0
  99. package/templates/.agent/skills/better-auth-patterns/SKILL.md +121 -0
  100. package/templates/.agent/skills/brainstorming/SKILL.md +163 -0
  101. package/templates/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  102. package/templates/.agent/skills/bullmq-worker/SKILL.md +124 -0
  103. package/templates/.agent/skills/clean-code/SKILL.md +201 -0
  104. package/templates/.agent/skills/code-review-checklist/SKILL.md +109 -0
  105. package/templates/.agent/skills/database-design/SKILL.md +52 -0
  106. package/templates/.agent/skills/database-design/database-selection.md +43 -0
  107. package/templates/.agent/skills/database-design/indexing.md +39 -0
  108. package/templates/.agent/skills/database-design/migrations.md +48 -0
  109. package/templates/.agent/skills/database-design/optimization.md +36 -0
  110. package/templates/.agent/skills/database-design/orm-selection.md +30 -0
  111. package/templates/.agent/skills/database-design/schema-design.md +56 -0
  112. package/templates/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  113. package/templates/.agent/skills/deployment-procedures/SKILL.md +241 -0
  114. package/templates/.agent/skills/doc.md +177 -0
  115. package/templates/.agent/skills/documentation-templates/SKILL.md +194 -0
  116. package/templates/.agent/skills/feature-spec-writer/SKILL.md +76 -0
  117. package/templates/.agent/skills/frontend-design/SKILL.md +452 -0
  118. package/templates/.agent/skills/frontend-design/animation-guide.md +331 -0
  119. package/templates/.agent/skills/frontend-design/color-system.md +311 -0
  120. package/templates/.agent/skills/frontend-design/decision-trees.md +418 -0
  121. package/templates/.agent/skills/frontend-design/motion-graphics.md +306 -0
  122. package/templates/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  123. package/templates/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  124. package/templates/.agent/skills/frontend-design/typography-system.md +345 -0
  125. package/templates/.agent/skills/frontend-design/ux-psychology.md +1116 -0
  126. package/templates/.agent/skills/frontend-design/visual-effects.md +383 -0
  127. package/templates/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  128. package/templates/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  129. package/templates/.agent/skills/game-development/SKILL.md +167 -0
  130. package/templates/.agent/skills/game-development/game-art/SKILL.md +185 -0
  131. package/templates/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  132. package/templates/.agent/skills/game-development/game-design/SKILL.md +129 -0
  133. package/templates/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  134. package/templates/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  135. package/templates/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  136. package/templates/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  137. package/templates/.agent/skills/game-development/web-games/SKILL.md +150 -0
  138. package/templates/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  139. package/templates/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  140. package/templates/.agent/skills/i18n-localization/SKILL.md +154 -0
  141. package/templates/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  142. package/templates/.agent/skills/intelligent-routing/SKILL.md +335 -0
  143. package/templates/.agent/skills/lint-and-validate/SKILL.md +45 -0
  144. package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  145. package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  146. package/templates/.agent/skills/mcp-builder/SKILL.md +176 -0
  147. package/templates/.agent/skills/mobile-design/SKILL.md +394 -0
  148. package/templates/.agent/skills/mobile-design/decision-trees.md +516 -0
  149. package/templates/.agent/skills/mobile-design/mobile-backend.md +491 -0
  150. package/templates/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  151. package/templates/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  152. package/templates/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  153. package/templates/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  154. package/templates/.agent/skills/mobile-design/mobile-performance.md +767 -0
  155. package/templates/.agent/skills/mobile-design/mobile-testing.md +356 -0
  156. package/templates/.agent/skills/mobile-design/mobile-typography.md +433 -0
  157. package/templates/.agent/skills/mobile-design/platform-android.md +666 -0
  158. package/templates/.agent/skills/mobile-design/platform-ios.md +561 -0
  159. package/templates/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  160. package/templates/.agent/skills/mobile-design/touch-psychology.md +537 -0
  161. package/templates/.agent/skills/neo-storage/SKILL.md +115 -0
  162. package/templates/.agent/skills/nextjs-api-route/SKILL.md +134 -0
  163. package/templates/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
  164. package/templates/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  165. package/templates/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  166. package/templates/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  167. package/templates/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  168. package/templates/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  169. package/templates/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  170. package/templates/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  171. package/templates/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
  172. package/templates/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
  173. package/templates/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  174. package/templates/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  175. package/templates/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  176. package/templates/.agent/skills/parallel-agents/SKILL.md +175 -0
  177. package/templates/.agent/skills/performance-profiling/SKILL.md +143 -0
  178. package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  179. package/templates/.agent/skills/plan-writing/SKILL.md +152 -0
  180. package/templates/.agent/skills/powershell-windows/SKILL.md +167 -0
  181. package/templates/.agent/skills/prisma-7-patterns/SKILL.md +91 -0
  182. package/templates/.agent/skills/python-patterns/SKILL.md +441 -0
  183. package/templates/.agent/skills/red-team-tactics/SKILL.md +199 -0
  184. package/templates/.agent/skills/rust-pro/SKILL.md +176 -0
  185. package/templates/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  186. package/templates/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  187. package/templates/.agent/skills/server-management/SKILL.md +161 -0
  188. package/templates/.agent/skills/systematic-debugging/SKILL.md +109 -0
  189. package/templates/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  190. package/templates/.agent/skills/tdd-workflow/SKILL.md +149 -0
  191. package/templates/.agent/skills/testing-patterns/SKILL.md +178 -0
  192. package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  193. package/templates/.agent/skills/uu-pdp-feature-check/SKILL.md +116 -0
  194. package/templates/.agent/skills/vibe-buildplan/SKILL.md +232 -0
  195. package/templates/.agent/skills/vibe-prd/SKILL.md +226 -0
  196. package/templates/.agent/skills/vibe-research/SKILL.md +162 -0
  197. package/templates/.agent/skills/vibe-techdesign/SKILL.md +195 -0
  198. package/templates/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  199. package/templates/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  200. package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  201. package/templates/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  202. package/templates/.agent/skills/webapp-testing/SKILL.md +187 -0
  203. package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  204. package/templates/.agent/skills/xendit-integration/SKILL.md +100 -0
  205. package/templates/.agent/snippets/@react-component-template.tsx +29 -0
  206. package/templates/.agent/workflows/brainstorm.md +113 -0
  207. package/templates/.agent/workflows/create.md +59 -0
  208. package/templates/.agent/workflows/db-migrate.md +26 -0
  209. package/templates/.agent/workflows/debug.md +103 -0
  210. package/templates/.agent/workflows/deploy.md +35 -0
  211. package/templates/.agent/workflows/dev-reset.md +40 -0
  212. package/templates/.agent/workflows/enhance.md +63 -0
  213. package/templates/.agent/workflows/git-commit.md +24 -0
  214. package/templates/.agent/workflows/health-check.md +34 -0
  215. package/templates/.agent/workflows/new-feature.md +32 -0
  216. package/templates/.agent/workflows/orchestrate.md +237 -0
  217. package/templates/.agent/workflows/plan.md +89 -0
  218. package/templates/.agent/workflows/preview.md +81 -0
  219. package/templates/.agent/workflows/status.md +86 -0
  220. package/templates/.agent/workflows/test.md +144 -0
  221. package/templates/.agent/workflows/ui-ux-pro-max.md +296 -0
  222. package/templates/.agent/workflows/vibe-plan.md +133 -0
  223. package/templates/.agent/workflows/vibe-recap.md +17 -0
  224. package/templates/.antigravity/rules.md +64 -0
  225. package/templates/AGENTS.md +268 -0
  226. package/templates/docs/00A-PROJECT-CHARTER.md +33 -0
  227. package/templates/docs/00B-BRD.md +25 -0
  228. package/templates/docs/01-PRD.md +122 -0
  229. package/templates/docs/01B-SRS-LENGKAP.md +60 -0
  230. package/templates/docs/02-TECH-DESIGN.md +491 -0
  231. package/templates/docs/03-UI-GUIDELINES.md +301 -0
  232. package/templates/docs/04-BACKLOG.md +127 -0
  233. package/templates/docs/05-DEPLOYMENT.md +363 -0
  234. package/templates/docs/06-DEVELOPMENT-LOG.md +78 -0
  235. package/templates/specs/README.md +54 -0
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill: webapp-testing
4
+ Script: playwright_runner.py
5
+ Purpose: Run basic Playwright browser tests
6
+ Usage: python playwright_runner.py <url> [--screenshot]
7
+ Output: JSON with page info, health status, and optional screenshot path
8
+ Note: Requires playwright (pip install playwright && playwright install chromium)
9
+ Screenshots: Saved to system temp directory (auto-cleaned by OS)
10
+ """
11
+ import sys
12
+ import json
13
+ import os
14
+ import tempfile
15
+ from datetime import datetime
16
+
17
+ # Fix Windows console encoding for Unicode output
18
+ try:
19
+ sys.stdout.reconfigure(encoding='utf-8', errors='replace')
20
+ sys.stderr.reconfigure(encoding='utf-8', errors='replace')
21
+ except AttributeError:
22
+ pass # Python < 3.7
23
+
24
+ try:
25
+ from playwright.sync_api import sync_playwright
26
+ PLAYWRIGHT_AVAILABLE = True
27
+ except ImportError:
28
+ PLAYWRIGHT_AVAILABLE = False
29
+
30
+
31
+ def run_basic_test(url: str, take_screenshot: bool = False) -> dict:
32
+ """Run basic browser test on URL."""
33
+ if not PLAYWRIGHT_AVAILABLE:
34
+ return {
35
+ "error": "Playwright not installed",
36
+ "fix": "pip install playwright && playwright install chromium"
37
+ }
38
+
39
+ result = {
40
+ "url": url,
41
+ "timestamp": datetime.now().isoformat(),
42
+ "status": "pending"
43
+ }
44
+
45
+ try:
46
+ with sync_playwright() as p:
47
+ browser = p.chromium.launch(headless=True)
48
+ context = browser.new_context(
49
+ viewport={"width": 1280, "height": 720},
50
+ user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
51
+ )
52
+ page = context.new_page()
53
+
54
+ # Navigate
55
+ response = page.goto(url, wait_until="networkidle", timeout=30000)
56
+
57
+ # Basic info
58
+ result["page"] = {
59
+ "title": page.title(),
60
+ "url": page.url,
61
+ "status_code": response.status if response else None
62
+ }
63
+
64
+ # Health checks
65
+ result["health"] = {
66
+ "loaded": response.ok if response else False,
67
+ "has_title": bool(page.title()),
68
+ "has_h1": page.locator("h1").count() > 0,
69
+ "has_links": page.locator("a").count() > 0,
70
+ "has_images": page.locator("img").count() > 0
71
+ }
72
+
73
+ # Console errors
74
+ console_errors = []
75
+ page.on("console", lambda msg: console_errors.append(msg.text) if msg.type == "error" else None)
76
+
77
+ # Performance metrics
78
+ result["performance"] = {
79
+ "dom_content_loaded": page.evaluate("window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart"),
80
+ "load_complete": page.evaluate("window.performance.timing.loadEventEnd - window.performance.timing.navigationStart")
81
+ }
82
+
83
+ # Screenshot - uses system temp directory (cross-platform, auto-cleaned)
84
+ if take_screenshot:
85
+ # Cross-platform: Windows=%TEMP%, Linux/macOS=/tmp
86
+ screenshot_dir = os.path.join(tempfile.gettempdir(), "maestro_screenshots")
87
+ os.makedirs(screenshot_dir, exist_ok=True)
88
+ screenshot_path = os.path.join(screenshot_dir, f"screenshot_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png")
89
+ page.screenshot(path=screenshot_path, full_page=True)
90
+ result["screenshot"] = screenshot_path
91
+ result["screenshot_note"] = "Saved to temp directory (auto-cleaned by OS)"
92
+
93
+ # Element counts
94
+ result["elements"] = {
95
+ "links": page.locator("a").count(),
96
+ "buttons": page.locator("button").count(),
97
+ "inputs": page.locator("input").count(),
98
+ "images": page.locator("img").count(),
99
+ "forms": page.locator("form").count()
100
+ }
101
+
102
+ browser.close()
103
+
104
+ result["status"] = "success" if result["health"]["loaded"] else "failed"
105
+ result["summary"] = "[OK] Page loaded successfully" if result["status"] == "success" else "[X] Page failed to load"
106
+
107
+ except Exception as e:
108
+ result["status"] = "error"
109
+ result["error"] = str(e)
110
+ result["summary"] = f"[X] Error: {str(e)[:100]}"
111
+
112
+ return result
113
+
114
+
115
+ def run_accessibility_check(url: str) -> dict:
116
+ """Run basic accessibility check."""
117
+ if not PLAYWRIGHT_AVAILABLE:
118
+ return {"error": "Playwright not installed"}
119
+
120
+ result = {"url": url, "accessibility": {}}
121
+
122
+ try:
123
+ with sync_playwright() as p:
124
+ browser = p.chromium.launch(headless=True)
125
+ page = browser.new_page()
126
+ page.goto(url, wait_until="networkidle", timeout=30000)
127
+
128
+ # Basic a11y checks
129
+ result["accessibility"] = {
130
+ "images_with_alt": page.locator("img[alt]").count(),
131
+ "images_without_alt": page.locator("img:not([alt])").count(),
132
+ "buttons_with_label": page.locator("button[aria-label], button:has-text('')").count(),
133
+ "links_with_text": page.locator("a:has-text('')").count(),
134
+ "form_labels": page.locator("label").count(),
135
+ "headings": {
136
+ "h1": page.locator("h1").count(),
137
+ "h2": page.locator("h2").count(),
138
+ "h3": page.locator("h3").count()
139
+ }
140
+ }
141
+
142
+ browser.close()
143
+ result["status"] = "success"
144
+
145
+ except Exception as e:
146
+ result["status"] = "error"
147
+ result["error"] = str(e)
148
+
149
+ return result
150
+
151
+
152
+ if __name__ == "__main__":
153
+ if len(sys.argv) < 2:
154
+ print(json.dumps({
155
+ "error": "Usage: python playwright_runner.py <url> [--screenshot] [--a11y]",
156
+ "examples": [
157
+ "python playwright_runner.py https://example.com",
158
+ "python playwright_runner.py https://example.com --screenshot",
159
+ "python playwright_runner.py https://example.com --a11y"
160
+ ]
161
+ }, indent=2))
162
+ sys.exit(1)
163
+
164
+ url = sys.argv[1]
165
+ take_screenshot = "--screenshot" in sys.argv
166
+ check_a11y = "--a11y" in sys.argv
167
+
168
+ if check_a11y:
169
+ result = run_accessibility_check(url)
170
+ else:
171
+ result = run_basic_test(url, take_screenshot)
172
+
173
+ print(json.dumps(result, indent=2))
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: xendit-integration
3
+ description: |
4
+ Use when working with Xendit payment integration: creating payment links,
5
+ handling webhooks, implementing split payment, or managing disbursements.
6
+ Triggers on "xendit", "payment", "invoice", "webhook", "split payment",
7
+ "disbursement", or "VA/QRIS/e-wallet". Do NOT use for non-payment features.
8
+ ---
9
+
10
+ # Xendit Integration — Pola Wajib Project Ini
11
+
12
+ ## Client Setup (`lib/payment/xendit.ts`)
13
+
14
+ ```typescript
15
+ import Xendit from 'xendit-node'
16
+ export const xendit = new Xendit({ secretKey: process.env.XENDIT_SECRET_KEY! })
17
+ ```
18
+
19
+ ## Buat Payment Link dengan Split
20
+
21
+ ```typescript
22
+ export async function createPayment(params: {
23
+ orderId: string
24
+ amount: number
25
+ email: string
26
+ description: string
27
+ subMerchantId?: string
28
+ }) {
29
+ return xendit.Invoice.create({
30
+ externalID: params.orderId,
31
+ amount: params.amount,
32
+ payerEmail: params.email,
33
+ description: params.description,
34
+ // Split payment — hanya jika subMerchantId ada
35
+ ...(params.subMerchantId && {
36
+ forUserID: params.subMerchantId,
37
+ withFeeRule: process.env.XENDIT_FEE_RULE_ID,
38
+ }),
39
+ successRedirectURL: `${process.env.NEXT_PUBLIC_APP_URL}/payment/success`,
40
+ failureRedirectURL: `${process.env.NEXT_PUBLIC_APP_URL}/payment/failed`,
41
+ })
42
+ }
43
+ ```
44
+
45
+ ## Webhook Handler (`app/api/payment/webhook/route.ts`)
46
+
47
+ ```typescript
48
+ import { headers } from 'next/headers'
49
+ import { paymentQueue } from '@/lib/queue'
50
+
51
+ export async function POST(req: Request) {
52
+ // STEP 1: Verifikasi callback token — WAJIB, jangan skip
53
+ const callbackToken = (await headers()).get('x-callback-token')
54
+ if (callbackToken !== process.env.XENDIT_CALLBACK_TOKEN) {
55
+ return Response.json({ error: 'Unauthorized' }, { status: 403 })
56
+ }
57
+
58
+ const payload = await req.json()
59
+
60
+ // STEP 2: Enqueue ke BullMQ — JANGAN proses langsung (bisa timeout 30s)
61
+ await paymentQueue.add('process-webhook', payload, {
62
+ attempts: 3,
63
+ backoff: { type: 'exponential', delay: 1000 },
64
+ })
65
+
66
+ // STEP 3: Return 200 segera ke Xendit (mereka retry jika tidak dapat 200)
67
+ return Response.json({ received: true })
68
+ }
69
+ ```
70
+
71
+ ## Status Payment
72
+
73
+ ```typescript
74
+ // Status standar Xendit yang harus ditangani:
75
+ type XenditStatus = 'PENDING' | 'PAID' | 'EXPIRED' | 'FAILED'
76
+
77
+ // Di database, simpan:
78
+ // - xendit_id (Invoice ID dari Xendit)
79
+ // - xendit_external_id (externalID yang kita set)
80
+ // - status (map dari XenditStatus)
81
+ ```
82
+
83
+ ## Aturan Wajib
84
+
85
+ - SELALU verifikasi `x-callback-token` sebelum proses webhook apapun
86
+ - SELALU simpan `xendit_id` dan `external_id` di database
87
+ - JANGAN trust status dari client — always verify dari webhook
88
+ - JANGAN proses webhook langsung di handler — gunakan BullMQ queue
89
+ - Xendit retry webhook jika tidak dapat HTTP 200 dalam 30 detik
90
+
91
+ ## Testing di Sandbox
92
+
93
+ ```bash
94
+ # Set di .env.local untuk development
95
+ XENDIT_SECRET_KEY=xnd_development_...
96
+ XENDIT_CALLBACK_TOKEN=test_callback_token_123
97
+
98
+ # Test webhook via Xendit Dashboard:
99
+ # Settings → Webhooks → Test → pilih event → send
100
+ ```
@@ -0,0 +1,29 @@
1
+ // @ts-nocheck
2
+ import React from 'react';
3
+
4
+ interface ComponentProps {
5
+ /**
6
+ * Title text for the component.
7
+ */
8
+ title: string;
9
+ }
10
+
11
+ /**
12
+ * Standard Codehava React Component Template
13
+ * AI MUST ADHERE TO THIS RULE:
14
+ * 1. Dilarang melakukan fetch data langsung di komponen UI (presentational component). Fetch harus di parent atau via state-manager.
15
+ * 2. Wajib menggunakan struktur class Tailwind yang rapi dan konsisten.
16
+ */
17
+ export default function StandardComponent({ title }: ComponentProps) {
18
+ return (
19
+ <div className="flex flex-col gap-4 p-4 rounded-xl shadow-sm border border-gray-100 bg-white">
20
+ <h2 className="text-xl font-bold text-gray-800 tracking-tight">
21
+ {title}
22
+ </h2>
23
+ <div className="text-gray-600 font-medium">
24
+ {/* Konten komponen di sini */}
25
+ Isi komponen
26
+ </div>
27
+ </div>
28
+ );
29
+ }
@@ -0,0 +1,113 @@
1
+ ---
2
+ description: Structured brainstorming for projects and features. Explores multiple options before implementation.
3
+ ---
4
+
5
+ # /brainstorm - Structured Idea Exploration
6
+
7
+ $ARGUMENTS
8
+
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ This command activates BRAINSTORM mode for structured idea exploration. Use when you need to explore options before committing to an implementation.
14
+
15
+ ---
16
+
17
+ ## Behavior
18
+
19
+ When `/brainstorm` is triggered:
20
+
21
+ 1. **Understand the goal**
22
+ - What problem are we solving?
23
+ - Who is the user?
24
+ - What constraints exist?
25
+
26
+ 2. **Generate options**
27
+ - Provide at least 3 different approaches
28
+ - Each with pros and cons
29
+ - Consider unconventional solutions
30
+
31
+ 3. **Compare and recommend**
32
+ - Summarize tradeoffs
33
+ - Give a recommendation with reasoning
34
+
35
+ ---
36
+
37
+ ## Output Format
38
+
39
+ ```markdown
40
+ ## 🧠 Brainstorm: [Topic]
41
+
42
+ ### Context
43
+ [Brief problem statement]
44
+
45
+ ---
46
+
47
+ ### Option A: [Name]
48
+ [Description]
49
+
50
+ ✅ **Pros:**
51
+ - [benefit 1]
52
+ - [benefit 2]
53
+
54
+ ❌ **Cons:**
55
+ - [drawback 1]
56
+
57
+ 📊 **Effort:** Low | Medium | High
58
+
59
+ ---
60
+
61
+ ### Option B: [Name]
62
+ [Description]
63
+
64
+ ✅ **Pros:**
65
+ - [benefit 1]
66
+
67
+ ❌ **Cons:**
68
+ - [drawback 1]
69
+ - [drawback 2]
70
+
71
+ 📊 **Effort:** Low | Medium | High
72
+
73
+ ---
74
+
75
+ ### Option C: [Name]
76
+ [Description]
77
+
78
+ ✅ **Pros:**
79
+ - [benefit 1]
80
+
81
+ ❌ **Cons:**
82
+ - [drawback 1]
83
+
84
+ 📊 **Effort:** Low | Medium | High
85
+
86
+ ---
87
+
88
+ ## 💡 Recommendation
89
+
90
+ **Option [X]** because [reasoning].
91
+
92
+ What direction would you like to explore?
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Examples
98
+
99
+ ```
100
+ /brainstorm authentication system
101
+ /brainstorm state management for complex form
102
+ /brainstorm database schema for social app
103
+ /brainstorm caching strategy
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Key Principles
109
+
110
+ - **No code** - this is about ideas, not implementation
111
+ - **Visual when helpful** - use diagrams for architecture
112
+ - **Honest tradeoffs** - don't hide complexity
113
+ - **Defer to user** - present options, let them decide
@@ -0,0 +1,59 @@
1
+ ---
2
+ description: Create new application command. Triggers App Builder skill and starts interactive dialogue with user.
3
+ ---
4
+
5
+ # /create - Create Application
6
+
7
+ $ARGUMENTS
8
+
9
+ ---
10
+
11
+ ## Task
12
+
13
+ This command starts a new application creation process.
14
+
15
+ ### Steps:
16
+
17
+ 1. **Request Analysis**
18
+ - Understand what the user wants
19
+ - If information is missing, use `conversation-manager` skill to ask
20
+
21
+ 2. **Project Planning**
22
+ - Use `project-planner` agent for task breakdown
23
+ - Determine tech stack
24
+ - Plan file structure
25
+ - Create plan file and proceed to building
26
+
27
+ 3. **Application Building (After Approval)**
28
+ - Orchestrate with `app-builder` skill
29
+ - Coordinate expert agents:
30
+ - `database-architect` → Schema
31
+ - `backend-specialist` → API
32
+ - `frontend-specialist` → UI
33
+
34
+ 4. **Preview**
35
+ - Start with `auto_preview.py` when complete
36
+ - Present URL to user
37
+
38
+ ---
39
+
40
+ ## Usage Examples
41
+
42
+ ```
43
+ /create blog site
44
+ /create e-commerce app with product listing and cart
45
+ /create todo app
46
+ /create Instagram clone
47
+ /create crm system with customer management
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Before Starting
53
+
54
+ If request is unclear, ask these questions:
55
+ - What type of application?
56
+ - What are the basic features?
57
+ - Who will use it?
58
+
59
+ Use defaults, add details later.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Jalankan database migration Prisma di production via Coolify. Gunakan sebelum setiap deploy yang ada perubahan schema.
3
+ ---
4
+
5
+ 1. Pastikan kamu sudah commit dan push semua perubahan schema.prisma ke Git.
6
+
7
+ 2. Buat backup database production sebelum migration.
8
+ // turbo
9
+ 3. Run `git status` untuk konfirmasi tidak ada perubahan yang belum di-commit.
10
+
11
+ 4. Tampilkan migration yang pending dengan menjalankan:
12
+ `npx prisma migrate status`
13
+ Tunggu hasilnya dan tunjukkan ke user.
14
+
15
+ 5. Minta konfirmasi user sebelum lanjut: "Migration di atas akan dijalankan. Lanjutkan? (yes/no)"
16
+
17
+ 6. Jika user konfirmasi yes, jalankan migration:
18
+ `npx prisma migrate deploy`
19
+ Jangan gunakan `prisma migrate dev` — itu hanya untuk development.
20
+
21
+ 7. Verifikasi migration berhasil dengan menjalankan:
22
+ `npx prisma migrate status`
23
+ Pastikan tidak ada migration yang pending.
24
+
25
+ 8. Update Development Log di `docs/06-DEVELOPMENT-LOG.md` dengan entry baru:
26
+ `[DEPLOY] Migration [nama migration] dijalankan di production - [tanggal]`
@@ -0,0 +1,103 @@
1
+ ---
2
+ description: Debugging command. Activates DEBUG mode for systematic problem investigation.
3
+ ---
4
+
5
+ # /debug - Systematic Problem Investigation
6
+
7
+ $ARGUMENTS
8
+
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ This command activates DEBUG mode for systematic investigation of issues, errors, or unexpected behavior.
14
+
15
+ ---
16
+
17
+ ## Behavior
18
+
19
+ When `/debug` is triggered:
20
+
21
+ 1. **Gather information**
22
+ - Error message
23
+ - Reproduction steps
24
+ - Expected vs actual behavior
25
+ - Recent changes
26
+
27
+ 2. **Form hypotheses**
28
+ - List possible causes
29
+ - Order by likelihood
30
+
31
+ 3. **Investigate systematically**
32
+ - Test each hypothesis
33
+ - Check logs, data flow
34
+ - Use elimination method
35
+
36
+ 4. **Fix and prevent**
37
+ - Apply fix
38
+ - Explain root cause
39
+ - Add prevention measures
40
+
41
+ ---
42
+
43
+ ## Output Format
44
+
45
+ ```markdown
46
+ ## 🔍 Debug: [Issue]
47
+
48
+ ### 1. Symptom
49
+ [What's happening]
50
+
51
+ ### 2. Information Gathered
52
+ - Error: `[error message]`
53
+ - File: `[filepath]`
54
+ - Line: [line number]
55
+
56
+ ### 3. Hypotheses
57
+ 1. ❓ [Most likely cause]
58
+ 2. ❓ [Second possibility]
59
+ 3. ❓ [Less likely cause]
60
+
61
+ ### 4. Investigation
62
+
63
+ **Testing hypothesis 1:**
64
+ [What I checked] → [Result]
65
+
66
+ **Testing hypothesis 2:**
67
+ [What I checked] → [Result]
68
+
69
+ ### 5. Root Cause
70
+ 🎯 **[Explanation of why this happened]**
71
+
72
+ ### 6. Fix
73
+ ```[language]
74
+ // Before
75
+ [broken code]
76
+
77
+ // After
78
+ [fixed code]
79
+ ```
80
+
81
+ ### 7. Prevention
82
+ 🛡️ [How to prevent this in the future]
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Examples
88
+
89
+ ```
90
+ /debug login not working
91
+ /debug API returns 500
92
+ /debug form doesn't submit
93
+ /debug data not saving
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Key Principles
99
+
100
+ - **Ask before assuming** - get full error context
101
+ - **Test hypotheses** - don't guess randomly
102
+ - **Explain why** - not just what to fix
103
+ - **Prevent recurrence** - add tests, validation
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Deploy ke production via Coolify webhook. Jalankan setelah semua tests pass dan PR merged ke main.
3
+ ---
4
+
5
+ 1. Pastikan kamu di branch `main` dan sudah pull latest:
6
+ // turbo
7
+ `git checkout main && git pull origin main`
8
+
9
+ 2. Jalankan type check dan lint:
10
+ // turbo
11
+ `npm run type-check && npm run lint`
12
+ Jika ada error, STOP dan fix dulu sebelum lanjut.
13
+
14
+ 3. Cek apakah ada migration database yang perlu dijalankan.
15
+ Jika ada perubahan schema, jalankan workflow `/db-migrate` dulu.
16
+
17
+ 4. Tampilkan ringkasan commit sejak deploy terakhir:
18
+ // turbo
19
+ `git log --oneline $(git describe --tags --abbrev=0)..HEAD`
20
+
21
+ 5. Minta konfirmasi user: "Commit di atas akan di-deploy ke production. Lanjutkan? (yes/no)"
22
+
23
+ 6. Jika user konfirmasi yes, trigger Coolify deploy via webhook:
24
+ // turbo
25
+ `curl -X POST -H "Authorization: Bearer $COOLIFY_TOKEN" "https://[IP-VPS]:8000/api/v1/deploy?uuid=$COOLIFY_APP_UUID"`
26
+
27
+ 7. Buka Coolify dashboard dan pantau proses deploy. URL: https://[IP-VPS]:8000
28
+
29
+ 8. Setelah deploy selesai, cek health endpoint:
30
+ // turbo
31
+ `curl https://[domain].com/api/health`
32
+ Response harus: `{"status":"ok","db":"ok","redis":"ok"}`
33
+
34
+ 9. Update Development Log di `docs/06-DEVELOPMENT-LOG.md`:
35
+ `[DEPLOY] Deploy production [tanggal] - [ringkasan fitur yang di-deploy]`
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Reset environment development — bersihkan node_modules, restart containers, reset database dev. Gunakan saat ada dependency issue atau mau mulai dari awal.
3
+ ---
4
+
5
+ 1. Tanya user: "Reset database juga? Data dev akan hilang. (yes/no)"
6
+
7
+ 2. Stop dan bersihkan containers:
8
+ // turbo
9
+ `docker compose down -v`
10
+
11
+ 3. Bersihkan node_modules dan cache:
12
+ // turbo
13
+ `rm -rf apps/web/node_modules apps/web/.next && npm cache clean --force`
14
+
15
+ 4. Reinstall dependencies:
16
+ // turbo
17
+ `npm install`
18
+
19
+ 5. Start containers baru:
20
+ // turbo
21
+ `docker compose up -d`
22
+ Tunggu sampai postgres dan redis healthy (sekitar 10 detik).
23
+
24
+ 6. Jalankan Prisma migration:
25
+ // turbo
26
+ `npx prisma migrate dev`
27
+
28
+ 7. Jika user tadi menjawab "yes" untuk reset database, jalankan seed:
29
+ // turbo
30
+ `npx prisma db seed`
31
+
32
+ 8. Generate Prisma client:
33
+ // turbo
34
+ `npx prisma generate`
35
+
36
+ 9. Jalankan type check untuk pastikan semua baik:
37
+ // turbo
38
+ `npm run type-check`
39
+
40
+ 10. Tampilkan ringkasan: "Environment reset selesai. Siap development."