achira-wf 3.1.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 (229) hide show
  1. package/.achira/ARCHITECTURE.md +296 -0
  2. package/.achira/core/agents/backend-specialist.md +263 -0
  3. package/.achira/core/agents/code-archaeologist.md +106 -0
  4. package/.achira/core/agents/database-architect.md +226 -0
  5. package/.achira/core/agents/debugger.md +225 -0
  6. package/.achira/core/agents/devops-engineer.md +242 -0
  7. package/.achira/core/agents/documentation-writer.md +104 -0
  8. package/.achira/core/agents/explorer-agent.md +73 -0
  9. package/.achira/core/agents/frontend-specialist.md +593 -0
  10. package/.achira/core/agents/game-developer.md +162 -0
  11. package/.achira/core/agents/mobile-developer.md +377 -0
  12. package/.achira/core/agents/orchestrator.md +416 -0
  13. package/.achira/core/agents/penetration-tester.md +188 -0
  14. package/.achira/core/agents/performance-optimizer.md +187 -0
  15. package/.achira/core/agents/product-manager.md +112 -0
  16. package/.achira/core/agents/product-owner.md +95 -0
  17. package/.achira/core/agents/project-planner.md +413 -0
  18. package/.achira/core/agents/qa-automation-engineer.md +103 -0
  19. package/.achira/core/agents/security-auditor.md +170 -0
  20. package/.achira/core/agents/seo-specialist.md +111 -0
  21. package/.achira/core/agents/test-engineer.md +158 -0
  22. package/.achira/core/mcp_config.json +24 -0
  23. package/.achira/core/shared/ui-ux-pro-max/data/charts.csv +26 -0
  24. package/.achira/core/shared/ui-ux-pro-max/data/colors.csv +97 -0
  25. package/.achira/core/shared/ui-ux-pro-max/data/icons.csv +101 -0
  26. package/.achira/core/shared/ui-ux-pro-max/data/landing.csv +31 -0
  27. package/.achira/core/shared/ui-ux-pro-max/data/products.csv +97 -0
  28. package/.achira/core/shared/ui-ux-pro-max/data/prompts.csv +24 -0
  29. package/.achira/core/shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  30. package/.achira/core/shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  31. package/.achira/core/shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  32. package/.achira/core/shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  33. package/.achira/core/shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  34. package/.achira/core/shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  35. package/.achira/core/shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  36. package/.achira/core/shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  37. package/.achira/core/shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  38. package/.achira/core/shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  39. package/.achira/core/shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  40. package/.achira/core/shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  41. package/.achira/core/shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  42. package/.achira/core/shared/ui-ux-pro-max/data/styles.csv +59 -0
  43. package/.achira/core/shared/ui-ux-pro-max/data/typography.csv +58 -0
  44. package/.achira/core/shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  45. package/.achira/core/shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  46. package/.achira/core/shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  47. package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  48. package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  49. package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/generate_theme.cpython-314.pyc +0 -0
  50. package/.achira/core/shared/ui-ux-pro-max/scripts/core.py +258 -0
  51. package/.achira/core/shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  52. package/.achira/core/shared/ui-ux-pro-max/scripts/generate_theme.py +99 -0
  53. package/.achira/core/shared/ui-ux-pro-max/scripts/search.py +106 -0
  54. package/.achira/core/skills/api-patterns/SKILL.md +81 -0
  55. package/.achira/core/skills/api-patterns/api-style.md +42 -0
  56. package/.achira/core/skills/api-patterns/auth.md +24 -0
  57. package/.achira/core/skills/api-patterns/documentation.md +26 -0
  58. package/.achira/core/skills/api-patterns/graphql.md +41 -0
  59. package/.achira/core/skills/api-patterns/rate-limiting.md +31 -0
  60. package/.achira/core/skills/api-patterns/response.md +37 -0
  61. package/.achira/core/skills/api-patterns/rest.md +40 -0
  62. package/.achira/core/skills/api-patterns/scripts/api_validator.py +211 -0
  63. package/.achira/core/skills/api-patterns/security-testing.md +122 -0
  64. package/.achira/core/skills/api-patterns/trpc.md +41 -0
  65. package/.achira/core/skills/api-patterns/versioning.md +22 -0
  66. package/.achira/core/skills/app-builder/SKILL.md +98 -0
  67. package/.achira/core/skills/app-builder/agent-coordination.md +71 -0
  68. package/.achira/core/skills/app-builder/feature-building.md +53 -0
  69. package/.achira/core/skills/app-builder/project-detection.md +34 -0
  70. package/.achira/core/skills/app-builder/scaffolding.md +118 -0
  71. package/.achira/core/skills/app-builder/tech-stack.md +40 -0
  72. package/.achira/core/skills/app-builder/templates/SKILL.md +39 -0
  73. package/.achira/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  74. package/.achira/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  75. package/.achira/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  76. package/.achira/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  77. package/.achira/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  78. package/.achira/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  79. package/.achira/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  80. package/.achira/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  81. package/.achira/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  82. package/.achira/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  83. package/.achira/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  84. package/.achira/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  85. package/.achira/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  86. package/.achira/core/skills/architecture/SKILL.md +55 -0
  87. package/.achira/core/skills/architecture/context-discovery.md +43 -0
  88. package/.achira/core/skills/architecture/examples.md +94 -0
  89. package/.achira/core/skills/architecture/pattern-selection.md +68 -0
  90. package/.achira/core/skills/architecture/patterns-reference.md +50 -0
  91. package/.achira/core/skills/architecture/trade-off-analysis.md +77 -0
  92. package/.achira/core/skills/bash-linux/SKILL.md +199 -0
  93. package/.achira/core/skills/behavioral-modes/SKILL.md +242 -0
  94. package/.achira/core/skills/brainstorming/SKILL.md +163 -0
  95. package/.achira/core/skills/brainstorming/dynamic-questioning.md +350 -0
  96. package/.achira/core/skills/clean-code/SKILL.md +201 -0
  97. package/.achira/core/skills/code-review-checklist/SKILL.md +109 -0
  98. package/.achira/core/skills/database-design/SKILL.md +52 -0
  99. package/.achira/core/skills/database-design/database-selection.md +43 -0
  100. package/.achira/core/skills/database-design/indexing.md +39 -0
  101. package/.achira/core/skills/database-design/migrations.md +48 -0
  102. package/.achira/core/skills/database-design/optimization.md +36 -0
  103. package/.achira/core/skills/database-design/orm-selection.md +30 -0
  104. package/.achira/core/skills/database-design/schema-design.md +56 -0
  105. package/.achira/core/skills/database-design/scripts/schema_validator.py +172 -0
  106. package/.achira/core/skills/deployment-procedures/SKILL.md +241 -0
  107. package/.achira/core/skills/doc.md +177 -0
  108. package/.achira/core/skills/documentation-templates/SKILL.md +194 -0
  109. package/.achira/core/skills/frontend-design/SKILL.md +418 -0
  110. package/.achira/core/skills/frontend-design/animation-guide.md +331 -0
  111. package/.achira/core/skills/frontend-design/color-system.md +311 -0
  112. package/.achira/core/skills/frontend-design/decision-trees.md +418 -0
  113. package/.achira/core/skills/frontend-design/motion-graphics.md +306 -0
  114. package/.achira/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  115. package/.achira/core/skills/frontend-design/scripts/ux_audit.py +722 -0
  116. package/.achira/core/skills/frontend-design/typography-system.md +345 -0
  117. package/.achira/core/skills/frontend-design/ux-psychology.md +1116 -0
  118. package/.achira/core/skills/frontend-design/visual-effects.md +383 -0
  119. package/.achira/core/skills/game-development/2d-games/SKILL.md +119 -0
  120. package/.achira/core/skills/game-development/3d-games/SKILL.md +135 -0
  121. package/.achira/core/skills/game-development/SKILL.md +167 -0
  122. package/.achira/core/skills/game-development/game-art/SKILL.md +185 -0
  123. package/.achira/core/skills/game-development/game-audio/SKILL.md +190 -0
  124. package/.achira/core/skills/game-development/game-design/SKILL.md +129 -0
  125. package/.achira/core/skills/game-development/mobile-games/SKILL.md +108 -0
  126. package/.achira/core/skills/game-development/multiplayer/SKILL.md +132 -0
  127. package/.achira/core/skills/game-development/pc-games/SKILL.md +144 -0
  128. package/.achira/core/skills/game-development/vr-ar/SKILL.md +123 -0
  129. package/.achira/core/skills/game-development/web-games/SKILL.md +150 -0
  130. package/.achira/core/skills/geo-fundamentals/SKILL.md +156 -0
  131. package/.achira/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  132. package/.achira/core/skills/i18n-localization/SKILL.md +154 -0
  133. package/.achira/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  134. package/.achira/core/skills/intelligent-routing/SKILL.md +335 -0
  135. package/.achira/core/skills/lint-and-validate/SKILL.md +45 -0
  136. package/.achira/core/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  137. package/.achira/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  138. package/.achira/core/skills/mcp-builder/SKILL.md +176 -0
  139. package/.achira/core/skills/mobile-design/SKILL.md +394 -0
  140. package/.achira/core/skills/mobile-design/decision-trees.md +516 -0
  141. package/.achira/core/skills/mobile-design/mobile-backend.md +491 -0
  142. package/.achira/core/skills/mobile-design/mobile-color-system.md +420 -0
  143. package/.achira/core/skills/mobile-design/mobile-debugging.md +122 -0
  144. package/.achira/core/skills/mobile-design/mobile-design-thinking.md +357 -0
  145. package/.achira/core/skills/mobile-design/mobile-navigation.md +458 -0
  146. package/.achira/core/skills/mobile-design/mobile-performance.md +767 -0
  147. package/.achira/core/skills/mobile-design/mobile-testing.md +356 -0
  148. package/.achira/core/skills/mobile-design/mobile-typography.md +433 -0
  149. package/.achira/core/skills/mobile-design/platform-android.md +666 -0
  150. package/.achira/core/skills/mobile-design/platform-ios.md +561 -0
  151. package/.achira/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
  152. package/.achira/core/skills/mobile-design/touch-psychology.md +537 -0
  153. package/.achira/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
  154. package/.achira/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  155. package/.achira/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  156. package/.achira/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  157. package/.achira/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  158. package/.achira/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  159. package/.achira/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  160. package/.achira/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  161. package/.achira/core/skills/nextjs-react-expert/SKILL.md +286 -0
  162. package/.achira/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  163. package/.achira/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  164. package/.achira/core/skills/nodejs-best-practices/SKILL.md +333 -0
  165. package/.achira/core/skills/parallel-agents/SKILL.md +175 -0
  166. package/.achira/core/skills/performance-profiling/SKILL.md +143 -0
  167. package/.achira/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  168. package/.achira/core/skills/plan-writing/SKILL.md +152 -0
  169. package/.achira/core/skills/powershell-windows/SKILL.md +167 -0
  170. package/.achira/core/skills/project-setup/SKILL.md +291 -0
  171. package/.achira/core/skills/python-patterns/SKILL.md +441 -0
  172. package/.achira/core/skills/red-team-tactics/SKILL.md +199 -0
  173. package/.achira/core/skills/rust-pro/SKILL.md +176 -0
  174. package/.achira/core/skills/seo-fundamentals/SKILL.md +129 -0
  175. package/.achira/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  176. package/.achira/core/skills/server-management/SKILL.md +161 -0
  177. package/.achira/core/skills/systematic-debugging/SKILL.md +109 -0
  178. package/.achira/core/skills/tailwind-patterns/SKILL.md +269 -0
  179. package/.achira/core/skills/tdd-workflow/SKILL.md +149 -0
  180. package/.achira/core/skills/testing-patterns/SKILL.md +178 -0
  181. package/.achira/core/skills/testing-patterns/scripts/test_runner.py +219 -0
  182. package/.achira/core/skills/vulnerability-scanner/SKILL.md +276 -0
  183. package/.achira/core/skills/vulnerability-scanner/checklists.md +121 -0
  184. package/.achira/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  185. package/.achira/core/skills/web-design-guidelines/SKILL.md +57 -0
  186. package/.achira/core/skills/webapp-testing/SKILL.md +187 -0
  187. package/.achira/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  188. package/.achira/rules/GEMINI.md +273 -0
  189. package/.achira/scripts/__pycache__/checklist.cpython-314.pyc +0 -0
  190. package/.achira/scripts/__pycache__/shared_utils.cpython-314.pyc +0 -0
  191. package/.achira/scripts/__pycache__/verify_all.cpython-314.pyc +0 -0
  192. package/.achira/scripts/auto_preview.py +148 -0
  193. package/.achira/scripts/checklist.py +193 -0
  194. package/.achira/scripts/session_manager.py +120 -0
  195. package/.achira/scripts/shared_utils.py +64 -0
  196. package/.achira/scripts/verify_all.py +304 -0
  197. package/.achira/workflows/brainstorm.md +113 -0
  198. package/.achira/workflows/create.md +59 -0
  199. package/.achira/workflows/debug.md +103 -0
  200. package/.achira/workflows/deploy.md +176 -0
  201. package/.achira/workflows/enhance.md +63 -0
  202. package/.achira/workflows/html+js+css.md +363 -0
  203. package/.achira/workflows/next.js.md +316 -0
  204. package/.achira/workflows/orchestrate.md +237 -0
  205. package/.achira/workflows/plan.md +89 -0
  206. package/.achira/workflows/preview.md +81 -0
  207. package/.achira/workflows/react+vite.md +280 -0
  208. package/.achira/workflows/registry.json +35 -0
  209. package/.achira/workflows/status.md +86 -0
  210. package/.achira/workflows/test.md +144 -0
  211. package/.achira/workflows/ui-ux-pro-max.md +296 -0
  212. package/.agent/workflows/brainstorm.md +113 -0
  213. package/.agent/workflows/create.md +59 -0
  214. package/.agent/workflows/debug.md +103 -0
  215. package/.agent/workflows/deploy.md +176 -0
  216. package/.agent/workflows/enhance.md +63 -0
  217. package/.agent/workflows/html+js+css.md +363 -0
  218. package/.agent/workflows/next.js.md +316 -0
  219. package/.agent/workflows/orchestrate.md +237 -0
  220. package/.agent/workflows/plan.md +89 -0
  221. package/.agent/workflows/preview.md +81 -0
  222. package/.agent/workflows/react+vite.md +280 -0
  223. package/.agent/workflows/status.md +86 -0
  224. package/.agent/workflows/test.md +144 -0
  225. package/.agent/workflows/ui-ux-pro-max.md +296 -0
  226. package/LICENSE +21 -0
  227. package/README.md +110 -0
  228. package/cli.js +293 -0
  229. package/package.json +48 -0
@@ -0,0 +1,99 @@
1
+ import csv
2
+ import sys
3
+ import argparse
4
+ from pathlib import Path
5
+ from typing import Optional, Dict, List, Any
6
+
7
+ # Add parent path for shared_utils
8
+ sys.path.append(str(Path(__file__).parent.parent.parent.parent / "scripts"))
9
+ try:
10
+ from shared_utils import Colors, print_header, print_success, print_error, print_warning # type: ignore
11
+ except ImportError:
12
+ # Fallback if scripts folder structure is different
13
+ class Colors:
14
+ GREEN = '\033[92m'
15
+ RED = '\033[91m'
16
+ YELLOW = '\033[93m'
17
+ ENDC = '\033[0m'
18
+ BOLD = '\033[1m'
19
+ def print_header(t): print(f"\n{Colors.BOLD}{t}{Colors.ENDC}\n")
20
+ def print_success(t): print(f"{Colors.GREEN}✅ {t}{Colors.ENDC}")
21
+ def print_error(t): print(f"{Colors.RED}❌ {t}{Colors.ENDC}")
22
+ def print_warning(t): print(f"{Colors.YELLOW}⚠️ {t}{Colors.ENDC}")
23
+
24
+ DATA_DIR = Path(__file__).parent.parent / "data"
25
+
26
+ def find_row_by_keyword(filepath: Path, keyword: str) -> Optional[Dict[str, str]]:
27
+ """Search CSV for a row matching keyword in Product Type or Keywords column."""
28
+ if not filepath.exists():
29
+ return None
30
+
31
+ with open(filepath, mode='r', encoding='utf-8') as f:
32
+ reader = csv.DictReader(f)
33
+ for row in reader:
34
+ # Check keywords/product type
35
+ searchable = f"{row.get('Product Type', '')} {row.get('Keywords', '')} {row.get('Font Pairing Name', '')} {row.get('Mood/Style Keywords', '')}".lower()
36
+ if keyword.lower() in searchable:
37
+ return row
38
+ return None
39
+
40
+ def generate_css(color_row: Optional[Dict[str, str]], typo_row: Optional[Dict[str, str]]) -> str:
41
+ """Generate CSS variables based on design data."""
42
+ css = [
43
+ "/* Generated by Achira Workflow OS - design-tokens.css */",
44
+ ":root {"
45
+ ]
46
+
47
+ # Colors
48
+ if color_row:
49
+ css.append(f" /* Palette: {color_row.get('Product Type', 'Custom')} */")
50
+ css.append(f" --primary: {color_row.get('Primary (Hex)', '#3b82f6')};")
51
+ css.append(f" --secondary: {color_row.get('Secondary (Hex)', '#64748b')};")
52
+ css.append(f" --cta: {color_row.get('CTA (Hex)', '#f97316')};")
53
+ css.append(f" --background: {color_row.get('Background (Hex)', '#ffffff')};")
54
+ css.append(f" --foreground: {color_row.get('Text (Hex)', '#0f172a')};")
55
+ css.append(f" --border: {color_row.get('Border (Hex)', '#e2e8f0')};")
56
+ css.append("")
57
+
58
+ # Typography
59
+ if typo_row:
60
+ css.append(f" /* Typography: {typo_row.get('Font Pairing Name', 'Custom')} */")
61
+ css.append(f" --font-heading: '{typo_row.get('Heading Font', 'Inter')}', sans-serif;")
62
+ css.append(f" --font-body: '{typo_row.get('Body Font', 'Inter')}', sans-serif;")
63
+ # Extract CSS Import if present
64
+ import_stmt = typo_row.get('CSS Import', '')
65
+ if import_stmt:
66
+ css.insert(1, f" {import_stmt}")
67
+
68
+ css.append("}")
69
+ return "\n".join(css)
70
+
71
+ def main():
72
+ parser = argparse.ArgumentParser(description="Generate design tokens from Achira design data.")
73
+ parser.add_argument("query", help="Keyword to search (e.g. 'saas', 'luxury', 'e-commerce')")
74
+ parser.add_argument("--out", default="design-tokens.css", help="Output file path")
75
+
76
+ args = parser.parse_args()
77
+
78
+ print_header(f"✨ Generating Theme for: '{args.query}'")
79
+
80
+ color_row = find_row_by_keyword(DATA_DIR / "colors.csv", args.query)
81
+ typo_row = find_row_by_keyword(DATA_DIR / "typography.csv", args.query)
82
+
83
+ if not color_row and not typo_row:
84
+ print_error(f"No design data found for '{args.query}'")
85
+ sys.exit(1)
86
+
87
+ css_content = generate_css(color_row, typo_row)
88
+
89
+ with open(args.out, 'w', encoding='utf-8') as f:
90
+ f.write(css_content)
91
+
92
+ print_success(f"Theme tokens generated at: {args.out}")
93
+ if color_row:
94
+ print(f" 🎨 Color Palette: {color_row['Product Type']}")
95
+ if typo_row:
96
+ print(f" 🔡 Typography: {typo_row['Font Pairing Name']}")
97
+
98
+ if __name__ == "__main__":
99
+ main()
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ UI/UX Pro Max Search - BM25 search engine for UI/UX style guides
5
+ Usage: python search.py "<query>" [--domain <domain>] [--stack <stack>] [--max-results 3]
6
+ python search.py "<query>" --design-system [-p "Project Name"]
7
+ python search.py "<query>" --design-system --persist [-p "Project Name"] [--page "dashboard"]
8
+
9
+ Domains: style, prompt, color, chart, landing, product, ux, typography
10
+ Stacks: html-tailwind, react, nextjs
11
+
12
+ Persistence (Master + Overrides pattern):
13
+ --persist Save design system to design-system/MASTER.md
14
+ --page Also create a page-specific override file in design-system/pages/
15
+ """
16
+
17
+ import argparse
18
+ from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
19
+ from design_system import generate_design_system, persist_design_system
20
+
21
+
22
+ def format_output(result):
23
+ """Format results for Claude consumption (token-optimized)"""
24
+ if "error" in result:
25
+ return f"Error: {result['error']}"
26
+
27
+ output = []
28
+ if result.get("stack"):
29
+ output.append(f"## UI Pro Max Stack Guidelines")
30
+ output.append(f"**Stack:** {result['stack']} | **Query:** {result['query']}")
31
+ else:
32
+ output.append(f"## UI Pro Max Search Results")
33
+ output.append(f"**Domain:** {result['domain']} | **Query:** {result['query']}")
34
+ output.append(f"**Source:** {result['file']} | **Found:** {result['count']} results\n")
35
+
36
+ for i, row in enumerate(result['results'], 1):
37
+ output.append(f"### Result {i}")
38
+ for key, value in row.items():
39
+ value_str = str(value)
40
+ if len(value_str) > 300:
41
+ value_str = value_str[:300] + "..."
42
+ output.append(f"- **{key}:** {value_str}")
43
+ output.append("")
44
+
45
+ return "\n".join(output)
46
+
47
+
48
+ if __name__ == "__main__":
49
+ parser = argparse.ArgumentParser(description="UI Pro Max Search")
50
+ parser.add_argument("query", help="Search query")
51
+ parser.add_argument("--domain", "-d", choices=list(CSV_CONFIG.keys()), help="Search domain")
52
+ parser.add_argument("--stack", "-s", choices=AVAILABLE_STACKS, help="Stack-specific search (html-tailwind, react, nextjs)")
53
+ parser.add_argument("--max-results", "-n", type=int, default=MAX_RESULTS, help="Max results (default: 3)")
54
+ parser.add_argument("--json", action="store_true", help="Output as JSON")
55
+ # Design system generation
56
+ parser.add_argument("--design-system", "-ds", action="store_true", help="Generate complete design system recommendation")
57
+ parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name for design system output")
58
+ parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format for design system")
59
+ # Persistence (Master + Overrides pattern)
60
+ parser.add_argument("--persist", action="store_true", help="Save design system to design-system/MASTER.md (creates hierarchical structure)")
61
+ parser.add_argument("--page", type=str, default=None, help="Create page-specific override file in design-system/pages/")
62
+ parser.add_argument("--output-dir", "-o", type=str, default=None, help="Output directory for persisted files (default: current directory)")
63
+
64
+ args = parser.parse_args()
65
+
66
+ # Design system takes priority
67
+ if args.design_system:
68
+ result = generate_design_system(
69
+ args.query,
70
+ args.project_name,
71
+ args.format,
72
+ persist=args.persist,
73
+ page=args.page,
74
+ output_dir=args.output_dir
75
+ )
76
+ print(result)
77
+
78
+ # Print persistence confirmation
79
+ if args.persist:
80
+ project_slug = args.project_name.lower().replace(' ', '-') if args.project_name else "default"
81
+ print("\n" + "=" * 60)
82
+ print(f"✅ Design system persisted to design-system/{project_slug}/")
83
+ print(f" 📄 design-system/{project_slug}/MASTER.md (Global Source of Truth)")
84
+ if args.page:
85
+ page_filename = args.page.lower().replace(' ', '-')
86
+ print(f" 📄 design-system/{project_slug}/pages/{page_filename}.md (Page Overrides)")
87
+ print("")
88
+ print(f"📖 Usage: When building a page, check design-system/{project_slug}/pages/[page].md first.")
89
+ print(f" If exists, its rules override MASTER.md. Otherwise, use MASTER.md.")
90
+ print("=" * 60)
91
+ # Stack search
92
+ elif args.stack:
93
+ result = search_stack(args.query, args.stack, args.max_results)
94
+ if args.json:
95
+ import json
96
+ print(json.dumps(result, indent=2, ensure_ascii=False))
97
+ else:
98
+ print(format_output(result))
99
+ # Domain search
100
+ else:
101
+ result = search(args.query, args.domain, args.max_results)
102
+ if args.json:
103
+ import json
104
+ print(json.dumps(result, indent=2, ensure_ascii=False))
105
+ else:
106
+ print(format_output(result))
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: api-patterns
3
+ description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ ---
6
+
7
+ # API Patterns
8
+
9
+ > API design principles and decision-making for 2025.
10
+ > **Learn to THINK, not copy fixed patterns.**
11
+
12
+ ## 🎯 Selective Reading Rule
13
+
14
+ **Read ONLY files relevant to the request!** Check the content map, find what you need.
15
+
16
+ ---
17
+
18
+ ## 📑 Content Map
19
+
20
+ | File | Description | When to Read |
21
+ |------|-------------|--------------|
22
+ | `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
23
+ | `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
24
+ | `response.md` | Envelope pattern, error format, pagination | Response structure |
25
+ | `graphql.md` | Schema design, when to use, security | Considering GraphQL |
26
+ | `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
27
+ | `versioning.md` | URI/Header/Query versioning | API evolution planning |
28
+ | `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
29
+ | `rate-limiting.md` | Token bucket, sliding window | API protection |
30
+ | `documentation.md` | OpenAPI/Swagger best practices | Documentation |
31
+ | `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
32
+
33
+ ---
34
+
35
+ ## 🔗 Related Skills
36
+
37
+ | Need | Skill |
38
+ |------|-------|
39
+ | API implementation | `@[skills/backend-development]` |
40
+ | Data structure | `@[skills/database-design]` |
41
+ | Security details | `@[skills/security-hardening]` |
42
+
43
+ ---
44
+
45
+ ## ✅ Decision Checklist
46
+
47
+ Before designing an API:
48
+
49
+ - [ ] **Asked user about API consumers?**
50
+ - [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
51
+ - [ ] **Defined consistent response format?**
52
+ - [ ] **Planned versioning strategy?**
53
+ - [ ] **Considered authentication needs?**
54
+ - [ ] **Planned rate limiting?**
55
+ - [ ] **Documentation approach defined?**
56
+
57
+ ---
58
+
59
+ ## ❌ Anti-Patterns
60
+
61
+ **DON'T:**
62
+ - Default to REST for everything
63
+ - Use verbs in REST endpoints (/getUsers)
64
+ - Return inconsistent response formats
65
+ - Expose internal errors to clients
66
+ - Skip rate limiting
67
+
68
+ **DO:**
69
+ - Choose API style based on context
70
+ - Ask about client requirements
71
+ - Document thoroughly
72
+ - Use appropriate status codes
73
+
74
+ ---
75
+
76
+ ## Script
77
+
78
+ | Script | Purpose | Command |
79
+ |--------|---------|---------|
80
+ | `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
81
+
@@ -0,0 +1,42 @@
1
+ # API Style Selection (2025)
2
+
3
+ > REST vs GraphQL vs tRPC - Hangi durumda hangisi?
4
+
5
+ ## Decision Tree
6
+
7
+ ```
8
+ Who are the API consumers?
9
+
10
+ ├── Public API / Multiple platforms
11
+ │ └── REST + OpenAPI (widest compatibility)
12
+
13
+ ├── Complex data needs / Multiple frontends
14
+ │ └── GraphQL (flexible queries)
15
+
16
+ ├── TypeScript frontend + backend (monorepo)
17
+ │ └── tRPC (end-to-end type safety)
18
+
19
+ ├── Real-time / Event-driven
20
+ │ └── WebSocket + AsyncAPI
21
+
22
+ └── Internal microservices
23
+ └── gRPC (performance) or REST (simplicity)
24
+ ```
25
+
26
+ ## Comparison
27
+
28
+ | Factor | REST | GraphQL | tRPC |
29
+ |--------|------|---------|------|
30
+ | **Best for** | Public APIs | Complex apps | TS monorepos |
31
+ | **Learning curve** | Low | Medium | Low (if TS) |
32
+ | **Over/under fetching** | Common | Solved | Solved |
33
+ | **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
34
+ | **Caching** | HTTP native | Complex | Client-based |
35
+
36
+ ## Selection Questions
37
+
38
+ 1. Who are the API consumers?
39
+ 2. Is the frontend TypeScript?
40
+ 3. How complex are the data relationships?
41
+ 4. Is caching critical?
42
+ 5. Public or internal API?
@@ -0,0 +1,24 @@
1
+ # Authentication Patterns
2
+
3
+ > Choose auth pattern based on use case.
4
+
5
+ ## Selection Guide
6
+
7
+ | Pattern | Best For |
8
+ |---------|----------|
9
+ | **JWT** | Stateless, microservices |
10
+ | **Session** | Traditional web, simple |
11
+ | **OAuth 2.0** | Third-party integration |
12
+ | **API Keys** | Server-to-server, public APIs |
13
+ | **Passkey** | Modern passwordless (2025+) |
14
+
15
+ ## JWT Principles
16
+
17
+ ```
18
+ Important:
19
+ ├── Always verify signature
20
+ ├── Check expiration
21
+ ├── Include minimal claims
22
+ ├── Use short expiry + refresh tokens
23
+ └── Never store sensitive data in JWT
24
+ ```
@@ -0,0 +1,26 @@
1
+ # API Documentation Principles
2
+
3
+ > Good docs = happy developers = API adoption.
4
+
5
+ ## OpenAPI/Swagger Essentials
6
+
7
+ ```
8
+ Include:
9
+ ├── All endpoints with examples
10
+ ├── Request/response schemas
11
+ ├── Authentication requirements
12
+ ├── Error response formats
13
+ └── Rate limiting info
14
+ ```
15
+
16
+ ## Good Documentation Has
17
+
18
+ ```
19
+ Essentials:
20
+ ├── Quick start / Getting started
21
+ ├── Authentication guide
22
+ ├── Complete API reference
23
+ ├── Error handling guide
24
+ ├── Code examples (multiple languages)
25
+ └── Changelog
26
+ ```
@@ -0,0 +1,41 @@
1
+ # GraphQL Principles
2
+
3
+ > Flexible queries for complex, interconnected data.
4
+
5
+ ## When to Use
6
+
7
+ ```
8
+ ✅ Good fit:
9
+ ├── Complex, interconnected data
10
+ ├── Multiple frontend platforms
11
+ ├── Clients need flexible queries
12
+ ├── Evolving data requirements
13
+ └── Reducing over-fetching matters
14
+
15
+ ❌ Poor fit:
16
+ ├── Simple CRUD operations
17
+ ├── File upload heavy
18
+ ├── HTTP caching important
19
+ └── Team unfamiliar with GraphQL
20
+ ```
21
+
22
+ ## Schema Design Principles
23
+
24
+ ```
25
+ Principles:
26
+ ├── Think in graphs, not endpoints
27
+ ├── Design for evolvability (no versions)
28
+ ├── Use connections for pagination
29
+ ├── Be specific with types (not generic "data")
30
+ └── Handle nullability thoughtfully
31
+ ```
32
+
33
+ ## Security Considerations
34
+
35
+ ```
36
+ Protect against:
37
+ ├── Query depth attacks → Set max depth
38
+ ├── Query complexity → Calculate cost
39
+ ├── Batching abuse → Limit batch size
40
+ ├── Introspection → Disable in production
41
+ ```
@@ -0,0 +1,31 @@
1
+ # Rate Limiting Principles
2
+
3
+ > Protect your API from abuse and overload.
4
+
5
+ ## Why Rate Limit
6
+
7
+ ```
8
+ Protect against:
9
+ ├── Brute force attacks
10
+ ├── Resource exhaustion
11
+ ├── Cost overruns (if pay-per-use)
12
+ └── Unfair usage
13
+ ```
14
+
15
+ ## Strategy Selection
16
+
17
+ | Type | How | When |
18
+ |------|-----|------|
19
+ | **Token bucket** | Burst allowed, refills over time | Most APIs |
20
+ | **Sliding window** | Smooth distribution | Strict limits |
21
+ | **Fixed window** | Simple counters per window | Basic needs |
22
+
23
+ ## Response Headers
24
+
25
+ ```
26
+ Include in headers:
27
+ ├── X-RateLimit-Limit (max requests)
28
+ ├── X-RateLimit-Remaining (requests left)
29
+ ├── X-RateLimit-Reset (when limit resets)
30
+ └── Return 429 when exceeded
31
+ ```
@@ -0,0 +1,37 @@
1
+ # Response Format Principles
2
+
3
+ > Consistency is key - choose a format and stick to it.
4
+
5
+ ## Common Patterns
6
+
7
+ ```
8
+ Choose one:
9
+ ├── Envelope pattern ({ success, data, error })
10
+ ├── Direct data (just return the resource)
11
+ └── HAL/JSON:API (hypermedia)
12
+ ```
13
+
14
+ ## Error Response
15
+
16
+ ```
17
+ Include:
18
+ ├── Error code (for programmatic handling)
19
+ ├── User message (for display)
20
+ ├── Details (for debugging, field-level errors)
21
+ ├── Request ID (for support)
22
+ └── NOT internal details (security!)
23
+ ```
24
+
25
+ ## Pagination Types
26
+
27
+ | Type | Best For | Trade-offs |
28
+ |------|----------|------------|
29
+ | **Offset** | Simple, jumpable | Performance on large datasets |
30
+ | **Cursor** | Large datasets | Can't jump to page |
31
+ | **Keyset** | Performance critical | Requires sortable key |
32
+
33
+ ### Selection Questions
34
+
35
+ 1. How large is the dataset?
36
+ 2. Do users need to jump to specific pages?
37
+ 3. Is data frequently changing?
@@ -0,0 +1,40 @@
1
+ # REST Principles
2
+
3
+ > Resource-based API design - nouns not verbs.
4
+
5
+ ## Resource Naming Rules
6
+
7
+ ```
8
+ Principles:
9
+ ├── Use NOUNS, not verbs (resources, not actions)
10
+ ├── Use PLURAL forms (/users not /user)
11
+ ├── Use lowercase with hyphens (/user-profiles)
12
+ ├── Nest for relationships (/users/123/posts)
13
+ └── Keep shallow (max 3 levels deep)
14
+ ```
15
+
16
+ ## HTTP Method Selection
17
+
18
+ | Method | Purpose | Idempotent? | Body? |
19
+ |--------|---------|-------------|-------|
20
+ | **GET** | Read resource(s) | Yes | No |
21
+ | **POST** | Create new resource | No | Yes |
22
+ | **PUT** | Replace entire resource | Yes | Yes |
23
+ | **PATCH** | Partial update | No | Yes |
24
+ | **DELETE** | Remove resource | Yes | No |
25
+
26
+ ## Status Code Selection
27
+
28
+ | Situation | Code | Why |
29
+ |-----------|------|-----|
30
+ | Success (read) | 200 | Standard success |
31
+ | Created | 201 | New resource created |
32
+ | No content | 204 | Success, nothing to return |
33
+ | Bad request | 400 | Malformed request |
34
+ | Unauthorized | 401 | Missing/invalid auth |
35
+ | Forbidden | 403 | Valid auth, no permission |
36
+ | Not found | 404 | Resource doesn't exist |
37
+ | Conflict | 409 | State conflict (duplicate) |
38
+ | Validation error | 422 | Valid syntax, invalid data |
39
+ | Rate limited | 429 | Too many requests |
40
+ | Server error | 500 | Our fault |