@leocm/flowcraft 0.0.0-stage → 2.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 (269) hide show
  1. package/README.md +846 -3
  2. package/bin/cli.js +102 -0
  3. package/flowcraft.yaml +30 -0
  4. package/install.sh +24 -0
  5. package/lib/args.js +34 -0
  6. package/lib/config.js +20 -0
  7. package/lib/copy.js +131 -0
  8. package/lib/fix.js +110 -0
  9. package/lib/fsutil.js +104 -0
  10. package/lib/global.js +229 -0
  11. package/lib/init.js +43 -0
  12. package/lib/runtime.js +84 -0
  13. package/lib/version.js +55 -0
  14. package/lib/wizard.js +125 -0
  15. package/package.json +31 -4
  16. package/presets/backend.yaml +20 -0
  17. package/presets/default.yaml +15 -0
  18. package/presets/frontend.yaml +20 -0
  19. package/presets/quick-fix.yaml +15 -0
  20. package/setup/.claude/commands/P0.5.md +1 -0
  21. package/setup/.claude/commands/P0.md +1 -0
  22. package/setup/.claude/commands/P1.md +1 -0
  23. package/setup/.claude/commands/P2.md +1 -0
  24. package/setup/.claude/commands/P3.md +1 -0
  25. package/setup/.claude/commands/P4.md +1 -0
  26. package/setup/.claude/commands/P5.md +1 -0
  27. package/setup/.claude/commands/code-analysis-init.md +1 -0
  28. package/setup/.claude/commands/code-analysis-rebuild.md +1 -0
  29. package/setup/.claude/commands/code-analysis-show-memory.md +1 -0
  30. package/setup/.claude/commands/code-analysis-update.md +1 -0
  31. package/setup/.claude/hooks/check-phase-advancement.py +180 -0
  32. package/setup/.claude/hooks/check-phase-test.py +152 -0
  33. package/setup/.claude/hooks/check-phase-write.py +232 -0
  34. package/setup/.claude/hooks/dispatch.py +64 -0
  35. package/setup/.claude/hooks/file-suggestion.py +45 -0
  36. package/setup/.claude/hooks/flowcraft_env.py +99 -0
  37. package/setup/.claude/hooks/log_session.py +91 -0
  38. package/setup/.claude/hooks/permission-request.py +125 -0
  39. package/setup/.claude/hooks/post-tool-failure.py +34 -0
  40. package/setup/.claude/hooks/pre-compact.py +64 -0
  41. package/setup/.claude/hooks/review-runner.py +844 -0
  42. package/setup/.claude/hooks/session-end.py +182 -0
  43. package/setup/.claude/hooks/session-start.py +188 -0
  44. package/setup/.claude/hooks/settings.json +0 -0
  45. package/setup/.claude/hooks/setup-keys.py +280 -0
  46. package/setup/.claude/hooks/statusline.py +61 -0
  47. package/setup/.claude/hooks/stop-check.py +169 -0
  48. package/setup/.claude/hooks/subagent-start.py +48 -0
  49. package/setup/.claude/hooks/subagent-stop.py +61 -0
  50. package/setup/.claude/hooks/task-completed.py +55 -0
  51. package/setup/.claude/hooks/task_manager.py +592 -0
  52. package/setup/.claude/hooks/user-prompt-submit.py +85 -0
  53. package/setup/.claude/project-state.md +109 -0
  54. package/setup/.claude/settings.json +237 -0
  55. package/setup/.claude/settings.local.json +13 -0
  56. package/setup/.claude/skills/P5report/SKILL.md +77 -0
  57. package/setup/.claude/skills/Pstatus/SKILL.md +68 -0
  58. package/setup/.claude/skills/archive/SKILL.md +196 -0
  59. package/setup/.claude/skills/brainstorming/SKILL.md +155 -0
  60. package/setup/.claude/skills/brainstorming/scripts/frame-template.html +213 -0
  61. package/setup/.claude/skills/brainstorming/scripts/helper.js +167 -0
  62. package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -0
  63. package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -0
  64. package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -0
  65. package/setup/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  66. package/setup/.claude/skills/brainstorming/visual-companion.md +298 -0
  67. package/setup/.claude/skills/checkpoint/SKILL.md +42 -0
  68. package/setup/.claude/skills/chrome-integration/SKILL.md +67 -0
  69. package/setup/.claude/skills/code-analysis/SKILL.md +1243 -0
  70. package/setup/.claude/skills/code-review/SKILL.md +265 -0
  71. package/setup/.claude/skills/cross-review/SKILL.md +41 -0
  72. package/setup/.claude/skills/executing-plans/SKILL.md +64 -0
  73. package/setup/.claude/skills/git-prep/SKILL.md +50 -0
  74. package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  75. package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  76. package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  77. package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  78. package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  79. package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  80. package/setup/.claude/skills/graphify/SKILL.md +49 -0
  81. package/setup/.claude/skills/openspec-apply-change/SKILL.md +185 -0
  82. package/setup/.claude/skills/openspec-archive-change/SKILL.md +182 -0
  83. package/setup/.claude/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  84. package/setup/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  85. package/setup/.claude/skills/openspec-explore/SKILL.md +311 -0
  86. package/setup/.claude/skills/openspec-ff-change/SKILL.md +113 -0
  87. package/setup/.claude/skills/openspec-new-change/SKILL.md +77 -0
  88. package/setup/.claude/skills/openspec-onboard/SKILL.md +573 -0
  89. package/setup/.claude/skills/openspec-propose/SKILL.md +149 -0
  90. package/setup/.claude/skills/openspec-sync-specs/SKILL.md +262 -0
  91. package/setup/.claude/skills/openspec-update-change/SKILL.md +91 -0
  92. package/setup/.claude/skills/openspec-verify-change/SKILL.md +175 -0
  93. package/setup/.claude/skills/oss-version-check/SKILL.md +71 -0
  94. package/setup/.claude/skills/oss-version-check/check_oss_version.py +205 -0
  95. package/setup/.claude/skills/phase/SKILL.md +63 -0
  96. package/setup/.claude/skills/playwright/SKILL.md +86 -0
  97. package/setup/.claude/skills/playwright-cli/SKILL.md +420 -0
  98. package/setup/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
  99. package/setup/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
  100. package/setup/.claude/skills/playwright-cli/references/references/element-attributes.md +23 -0
  101. package/setup/.claude/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  102. package/setup/.claude/skills/playwright-cli/references/references/request-mocking.md +87 -0
  103. package/setup/.claude/skills/playwright-cli/references/references/running-code.md +241 -0
  104. package/setup/.claude/skills/playwright-cli/references/references/session-management.md +225 -0
  105. package/setup/.claude/skills/playwright-cli/references/references/storage-state.md +275 -0
  106. package/setup/.claude/skills/playwright-cli/references/references/test-generation.md +433 -0
  107. package/setup/.claude/skills/playwright-cli/references/references/tracing.md +139 -0
  108. package/setup/.claude/skills/playwright-cli/references/references/video-recording.md +143 -0
  109. package/setup/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
  110. package/setup/.claude/skills/playwright-cli/references/running-code.md +241 -0
  111. package/setup/.claude/skills/playwright-cli/references/session-management.md +225 -0
  112. package/setup/.claude/skills/playwright-cli/references/storage-state.md +275 -0
  113. package/setup/.claude/skills/playwright-cli/references/test-generation.md +433 -0
  114. package/setup/.claude/skills/playwright-cli/references/tracing.md +139 -0
  115. package/setup/.claude/skills/playwright-cli/references/video-recording.md +143 -0
  116. package/setup/.claude/skills/review/SKILL.md +98 -0
  117. package/setup/.claude/skills/review-tools/SKILL.md +76 -0
  118. package/setup/.claude/skills/subagent-driven-development/SKILL.md +94 -0
  119. package/setup/.claude/skills/task/SKILL.md +26 -0
  120. package/setup/.claude/skills/test-driven-development/SKILL.md +320 -0
  121. package/setup/.claude/skills/test-driven-development/writing-good-tests.md +198 -0
  122. package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
  123. package/setup/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
  124. package/setup/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
  125. package/setup/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
  126. package/setup/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
  127. package/setup/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
  128. package/setup/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  129. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  130. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  131. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  132. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  133. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  134. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  135. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  136. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  137. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  138. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  139. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  140. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  141. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  142. package/setup/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
  143. package/setup/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
  144. package/setup/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  145. package/setup/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  146. package/setup/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  147. package/setup/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
  148. package/setup/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  149. package/setup/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
  150. package/setup/.claude/skills/ui-ux-standards/SKILL.md +154 -0
  151. package/setup/.claude/skills/verification-before-completion/SKILL.md +120 -0
  152. package/setup/.claude/skills/wiki-read/SKILL.md +190 -0
  153. package/setup/.claude/skills/writing-plans/SKILL.md +168 -0
  154. package/setup/.claude/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  155. package/setup/.claude/tasks/.last-session +1 -0
  156. package/setup/.codex/.agents/skills/P5report/SKILL.md +77 -0
  157. package/setup/.codex/.agents/skills/Pstatus/SKILL.md +30 -0
  158. package/setup/.codex/.agents/skills/archive/SKILL.md +196 -0
  159. package/setup/.codex/.agents/skills/brainstorming/SKILL.md +155 -0
  160. package/setup/.codex/.agents/skills/brainstorming/scripts/frame-template.html +213 -0
  161. package/setup/.codex/.agents/skills/brainstorming/scripts/helper.js +167 -0
  162. package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -0
  163. package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -0
  164. package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -0
  165. package/setup/.codex/.agents/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  166. package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -0
  167. package/setup/.codex/.agents/skills/checkpoint/SKILL.md +42 -0
  168. package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +67 -0
  169. package/setup/.codex/.agents/skills/code-analysis/SKILL.md +1243 -0
  170. package/setup/.codex/.agents/skills/code-review/SKILL.md +265 -0
  171. package/setup/.codex/.agents/skills/cross-review/SKILL.md +42 -0
  172. package/setup/.codex/.agents/skills/executing-plans/SKILL.md +64 -0
  173. package/setup/.codex/.agents/skills/git-prep/SKILL.md +50 -0
  174. package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  175. package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  176. package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  177. package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  178. package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  179. package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  180. package/setup/.codex/.agents/skills/graphify/SKILL.md +49 -0
  181. package/setup/.codex/.agents/skills/openspec-apply-change/SKILL.md +185 -0
  182. package/setup/.codex/.agents/skills/openspec-archive-change/SKILL.md +182 -0
  183. package/setup/.codex/.agents/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  184. package/setup/.codex/.agents/skills/openspec-continue-change/SKILL.md +118 -0
  185. package/setup/.codex/.agents/skills/openspec-explore/SKILL.md +311 -0
  186. package/setup/.codex/.agents/skills/openspec-ff-change/SKILL.md +113 -0
  187. package/setup/.codex/.agents/skills/openspec-new-change/SKILL.md +77 -0
  188. package/setup/.codex/.agents/skills/openspec-onboard/SKILL.md +573 -0
  189. package/setup/.codex/.agents/skills/openspec-propose/SKILL.md +149 -0
  190. package/setup/.codex/.agents/skills/openspec-sync-specs/SKILL.md +262 -0
  191. package/setup/.codex/.agents/skills/openspec-update-change/SKILL.md +91 -0
  192. package/setup/.codex/.agents/skills/openspec-verify-change/SKILL.md +175 -0
  193. package/setup/.codex/.agents/skills/oss-version-check/SKILL.md +71 -0
  194. package/setup/.codex/.agents/skills/oss-version-check/check_oss_version.py +205 -0
  195. package/setup/.codex/.agents/skills/phase/SKILL.md +63 -0
  196. package/setup/.codex/.agents/skills/playwright/SKILL.md +86 -0
  197. package/setup/.codex/.agents/skills/playwright-cli/SKILL.md +420 -0
  198. package/setup/.codex/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
  199. package/setup/.codex/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
  200. package/setup/.codex/.agents/skills/playwright-cli/references/references/element-attributes.md +23 -0
  201. package/setup/.codex/.agents/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  202. package/setup/.codex/.agents/skills/playwright-cli/references/references/request-mocking.md +87 -0
  203. package/setup/.codex/.agents/skills/playwright-cli/references/references/running-code.md +241 -0
  204. package/setup/.codex/.agents/skills/playwright-cli/references/references/session-management.md +225 -0
  205. package/setup/.codex/.agents/skills/playwright-cli/references/references/storage-state.md +275 -0
  206. package/setup/.codex/.agents/skills/playwright-cli/references/references/test-generation.md +433 -0
  207. package/setup/.codex/.agents/skills/playwright-cli/references/references/tracing.md +139 -0
  208. package/setup/.codex/.agents/skills/playwright-cli/references/references/video-recording.md +143 -0
  209. package/setup/.codex/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
  210. package/setup/.codex/.agents/skills/playwright-cli/references/running-code.md +241 -0
  211. package/setup/.codex/.agents/skills/playwright-cli/references/session-management.md +225 -0
  212. package/setup/.codex/.agents/skills/playwright-cli/references/storage-state.md +275 -0
  213. package/setup/.codex/.agents/skills/playwright-cli/references/test-generation.md +433 -0
  214. package/setup/.codex/.agents/skills/playwright-cli/references/tracing.md +139 -0
  215. package/setup/.codex/.agents/skills/playwright-cli/references/video-recording.md +143 -0
  216. package/setup/.codex/.agents/skills/review/SKILL.md +98 -0
  217. package/setup/.codex/.agents/skills/review-tools/SKILL.md +76 -0
  218. package/setup/.codex/.agents/skills/subagent-driven-development/SKILL.md +94 -0
  219. package/setup/.codex/.agents/skills/task/SKILL.md +27 -0
  220. package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +320 -0
  221. package/setup/.codex/.agents/skills/test-driven-development/writing-good-tests.md +198 -0
  222. package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +377 -0
  223. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
  224. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
  225. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
  226. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
  227. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
  228. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  229. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  230. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  231. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  232. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  233. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  234. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  235. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  236. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  237. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  238. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  239. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  240. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  241. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  242. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
  243. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
  244. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  245. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  246. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  247. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
  248. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  249. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
  250. package/setup/.codex/.agents/skills/ui-ux-standards/SKILL.md +154 -0
  251. package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +120 -0
  252. package/setup/.codex/.agents/skills/wiki-read/SKILL.md +190 -0
  253. package/setup/.codex/.agents/skills/writing-plans/SKILL.md +168 -0
  254. package/setup/.codex/.agents/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  255. package/setup/.codex/config.toml +10 -0
  256. package/setup/.codex/hooks/log_session.py +85 -0
  257. package/setup/.codex/hooks/review-runner.py +844 -0
  258. package/setup/.codex/hooks/sdlc-codex-hook.cjs +1020 -0
  259. package/setup/.codex/hooks/setup-keys.py +280 -0
  260. package/setup/.codex/hooks.json +121 -0
  261. package/setup/.codex/model-catalog.json +154 -0
  262. package/setup/.codex/project-state.md +103 -0
  263. package/setup/AGENTS.md +722 -0
  264. package/setup/CLAUDE.md +717 -0
  265. package/setup/install.sh +24 -0
  266. package/setup/tests/test_decision_timeout.py +241 -0
  267. package/setup/tests/test_hook_guards.py +341 -0
  268. package/setup/tests/test_sdlc_bootstrap.py +167 -0
  269. package/setup/tests/test_task_manager.py +148 -0
@@ -0,0 +1,114 @@
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: python3 search.py "<query>" [--domain <domain>] [--stack <stack>] [--max-results 3]
6
+ python3 search.py "<query>" --design-system [-p "Project Name"]
7
+ python3 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
+ import sys
19
+ import io
20
+ from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
21
+ from design_system import generate_design_system, persist_design_system
22
+
23
+ # Force UTF-8 for stdout/stderr to handle emojis on Windows (cp1252 default)
24
+ if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
25
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
26
+ if sys.stderr.encoding and sys.stderr.encoding.lower() != 'utf-8':
27
+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
28
+
29
+
30
+ def format_output(result):
31
+ """Format results for Claude consumption (token-optimized)"""
32
+ if "error" in result:
33
+ return f"Error: {result['error']}"
34
+
35
+ output = []
36
+ if result.get("stack"):
37
+ output.append(f"## UI Pro Max Stack Guidelines")
38
+ output.append(f"**Stack:** {result['stack']} | **Query:** {result['query']}")
39
+ else:
40
+ output.append(f"## UI Pro Max Search Results")
41
+ output.append(f"**Domain:** {result['domain']} | **Query:** {result['query']}")
42
+ output.append(f"**Source:** {result['file']} | **Found:** {result['count']} results\n")
43
+
44
+ for i, row in enumerate(result['results'], 1):
45
+ output.append(f"### Result {i}")
46
+ for key, value in row.items():
47
+ value_str = str(value)
48
+ if len(value_str) > 300:
49
+ value_str = value_str[:300] + "..."
50
+ output.append(f"- **{key}:** {value_str}")
51
+ output.append("")
52
+
53
+ return "\n".join(output)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ parser = argparse.ArgumentParser(description="UI Pro Max Search")
58
+ parser.add_argument("query", help="Search query")
59
+ parser.add_argument("--domain", "-d", choices=list(CSV_CONFIG.keys()), help="Search domain")
60
+ parser.add_argument("--stack", "-s", choices=AVAILABLE_STACKS, help="Stack-specific search (html-tailwind, react, nextjs)")
61
+ parser.add_argument("--max-results", "-n", type=int, default=MAX_RESULTS, help="Max results (default: 3)")
62
+ parser.add_argument("--json", action="store_true", help="Output as JSON")
63
+ # Design system generation
64
+ parser.add_argument("--design-system", "-ds", action="store_true", help="Generate complete design system recommendation")
65
+ parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name for design system output")
66
+ parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format for design system")
67
+ # Persistence (Master + Overrides pattern)
68
+ parser.add_argument("--persist", action="store_true", help="Save design system to design-system/MASTER.md (creates hierarchical structure)")
69
+ parser.add_argument("--page", type=str, default=None, help="Create page-specific override file in design-system/pages/")
70
+ parser.add_argument("--output-dir", "-o", type=str, default=None, help="Output directory for persisted files (default: current directory)")
71
+
72
+ args = parser.parse_args()
73
+
74
+ # Design system takes priority
75
+ if args.design_system:
76
+ result = generate_design_system(
77
+ args.query,
78
+ args.project_name,
79
+ args.format,
80
+ persist=args.persist,
81
+ page=args.page,
82
+ output_dir=args.output_dir
83
+ )
84
+ print(result)
85
+
86
+ # Print persistence confirmation
87
+ if args.persist:
88
+ project_slug = args.project_name.lower().replace(' ', '-') if args.project_name else "default"
89
+ print("\n" + "=" * 60)
90
+ print(f"✅ Design system persisted to design-system/{project_slug}/")
91
+ print(f" 📄 design-system/{project_slug}/MASTER.md (Global Source of Truth)")
92
+ if args.page:
93
+ page_filename = args.page.lower().replace(' ', '-')
94
+ print(f" 📄 design-system/{project_slug}/pages/{page_filename}.md (Page Overrides)")
95
+ print("")
96
+ print(f"📖 Usage: When building a page, check design-system/{project_slug}/pages/[page].md first.")
97
+ print(f" If exists, its rules override MASTER.md. Otherwise, use MASTER.md.")
98
+ print("=" * 60)
99
+ # Stack search
100
+ elif args.stack:
101
+ result = search_stack(args.query, args.stack, 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))
107
+ # Domain search
108
+ else:
109
+ result = search(args.query, args.domain, args.max_results)
110
+ if args.json:
111
+ import json
112
+ print(json.dumps(result, indent=2, ensure_ascii=False))
113
+ else:
114
+ print(format_output(result))
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: ui-ux-standards
3
+ description: "UI/UX standards: accessibility, Core Web Vitals, Playwright/axe-core/Lighthouse. | 触发词:UI规范/可访问性/设计规范"
4
+ argument-hint: "[p1|p2|p3|p4]"
5
+ allowed-tools:
6
+ - Read
7
+ - Glob
8
+ - Grep
9
+ - Bash
10
+ ---
11
+
12
+ Usage: `/ui-ux-standards [p1|p2|p3|p4]`
13
+
14
+ Arguments: $ARGUMENTS
15
+
16
+ ---
17
+
18
+ ## Core principles (核心原则)
19
+
20
+ | Principle | Description |
21
+ |------|------|
22
+ | **Modern first** | ❌ Bootstrap 3/4, jQuery UI, 90s-style tables ✅ shadcn/ui, Radix, Ant Design 5+ |
23
+ | **Design-system driven** | choose from 67 styles + 96 palettes + 57 fonts (arbitrary colors forbidden) |
24
+ | **Accessibility** | WCAG 2.1 AA (contrast≥4.5:1, keyboard navigation, ARIA) |
25
+ | **Responsive** | mobile-first; test 375px/768px/1440px |
26
+ | **Performance** | Core Web Vitals (LCP<2.5s, CLS<0.1) |
27
+
28
+ ---
29
+
30
+ ## Accessibility standards (可访问性标准, mandatory)
31
+
32
+ - [ ] interactive elements ≥44x44px
33
+ - [ ] contrast ≥4.5:1 (text)
34
+ - [ ] keyboard navigation works (correct Tab order)
35
+ - [ ] forms `<label>` + `for`
36
+ - [ ] images `alt`, icon buttons `aria-label`
37
+ - [ ] support `prefers-reduced-motion`
38
+
39
+ ---
40
+
41
+ ## Core Web Vitals standards (Core Web Vitals 标准)
42
+
43
+ | Metric | Target |
44
+ |------|------|
45
+ | LCP (Largest Contentful Paint) | < 2.5s |
46
+ | FID (First Input Delay) | < 100ms |
47
+ | CLS (Cumulative Layout Shift) | < 0.1 |
48
+
49
+ ---
50
+
51
+ ## P3 test requirements (P3 测试要求)
52
+
53
+ | Test type | Tool | Requirement |
54
+ |---------|------|------|
55
+ | Visual regression | Playwright screenshot | major pages/components |
56
+ | Responsive | 3 breakpoint tests | 375/768/1440px |
57
+ | Accessibility | axe-core/Lighthouse | 0 critical violations |
58
+ | Interaction | Testing Library/Playwright | all user flows |
59
+ | Performance | Lighthouse CI | LCP<2.5s, CLS<0.1 |
60
+
61
+ ---
62
+
63
+ ## P4 review standards (P4 审查标准)
64
+
65
+ ### Accessibility review tools (可访问性审查工具)
66
+
67
+ ```bash
68
+ # Lighthouse
69
+ npx lighthouse http://localhost:3000 --only-categories=accessibility
70
+
71
+ # axe-core
72
+ npx @axe-core/cli http://localhost:3000
73
+ ```
74
+
75
+ **Pass criteria (通过标准)**:
76
+ - Lighthouse accessibility ≥90
77
+ - axe-core 0 critical/serious violations
78
+
79
+ ### Performance review (性能审查)
80
+
81
+ ```bash
82
+ npx lighthouse http://localhost:3000 --only-categories=performance
83
+ ```
84
+
85
+ **Pass criteria (通过标准)**:
86
+ - LCP < 2.5s
87
+ - FID < 100ms
88
+ - CLS < 0.1
89
+
90
+ ### Responsive review (响应式审查)
91
+
92
+ **Required breakpoints (必测断点)**: 375px, 768px, 1440px
93
+
94
+ **Checklist (检查项)**:
95
+ - [ ] no content overflow
96
+ - [ ] touch targets ≥44px
97
+ - [ ] mobile font ≥16px
98
+ - [ ] responsive images (srcset)
99
+
100
+ ---
101
+
102
+ ## Review failure handling (审查失败处理)
103
+
104
+ | Level | Definition | Handling |
105
+ |------|------|------|
106
+ | 🔴 Blocking | accessibility critical, no responsive, performance<50 | back to P2 |
107
+ | 🟡 Serious | style mismatch, wrong colors | fix then re-review |
108
+ | 🟢 Suggestion | animation optimization | record TODO |
109
+
110
+ **Auto-fix**: fix blocking issues first → batch-fix similar ones → re-review (max 3 times)
111
+
112
+ ---
113
+
114
+ ## Required tools (必装工具)
115
+
116
+ ```bash
117
+ npm install -D @axe-core/cli @axe-core/react lighthouse @playwright/test
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Execution checklist (执行检查)
123
+
124
+ ### P1 (design)
125
+ - [ ] research with the ui-ux-pro-max skill
126
+ - [ ] PRD contains the `ui_design` field
127
+ - [ ] prototype shown in Chrome
128
+ - [ ] colors from one of the 96 palettes
129
+
130
+ ### P2 (implementation)
131
+ - [ ] implement strictly per the prototype
132
+ - [ ] use a modern component library
133
+ - [ ] pass the accessibility checklist
134
+ - [ ] no Bootstrap 3/jQuery
135
+
136
+ ### P4 (review)
137
+ - [ ] Lighthouse accessibility ≥90
138
+ - [ ] axe-core 0 violations
139
+ - [ ] responsive tests pass
140
+ - [ ] Core Web Vitals met
141
+ - [ ] design-system consistency
142
+
143
+ ---
144
+
145
+ ## Output format (输出格式)
146
+
147
+ ```
148
+ [UI/UX review (UI/UX 审查)]
149
+ - Phase: P{1|2|3|4}
150
+ - Accessibility: ✅/❌
151
+ - Responsive: ✅/❌
152
+ - Performance: ✅/❌
153
+ - Issues: {n}
154
+ ```
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: "Verify before claiming completion: run commands and confirm output first. | 触发词:完成前验证/确认完成"
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ ## Overview
9
+
10
+ **Core principle:** Evidence before claims, always.
11
+
12
+ **Violating the letter of this rule is violating the spirit of this rule.**
13
+
14
+ ## The Iron Law
15
+
16
+ ```
17
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
18
+ ```
19
+
20
+ If you haven't run the verification command in this message, you cannot claim it passes.
21
+
22
+ ## The Gate Function
23
+
24
+ ```
25
+ BEFORE claiming any status or expressing satisfaction:
26
+
27
+ 1. IDENTIFY: What command proves this claim?
28
+ 2. RUN: Execute the FULL command (fresh, complete)
29
+ 3. READ: Full output, check exit code, count failures
30
+ 4. VERIFY: Does output confirm the claim?
31
+ - If NO: State actual status with evidence
32
+ - If YES: State claim WITH evidence
33
+ 5. ONLY THEN: Make the claim
34
+
35
+ Skip any step = lying, not verifying
36
+ ```
37
+
38
+ ## Common Failures
39
+
40
+ | Claim | Requires | Not Sufficient |
41
+ |-------|----------|----------------|
42
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
43
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
44
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
45
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
46
+ | Regression test works | Red-green cycle verified | Test passes once |
47
+ | Agent completed | VCS diff shows changes | Agent reports "success" |
48
+ | Requirements met | Line-by-line checklist | Tests passing |
49
+
50
+ ## Red Flags - STOP
51
+
52
+ - Using "should", "probably", "seems to"
53
+ - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
54
+ - About to commit/push/PR without verification
55
+ - Trusting agent success reports
56
+ - Relying on partial verification
57
+ - Thinking "just this once"
58
+ - Tired and wanting work over
59
+ - **ANY wording implying success without having run verification**
60
+
61
+ ## Rationalization Prevention
62
+
63
+ | Excuse | Reality |
64
+ |--------|---------|
65
+ | "Should work now" | RUN the verification |
66
+ | "I'm confident" | Confidence ≠ evidence |
67
+ | "Just this once" | No exceptions |
68
+ | "Linter passed" | Linter ≠ compiler |
69
+ | "Agent said success" | Verify independently |
70
+ | "I'm tired" | Exhaustion ≠ excuse |
71
+ | "Partial check is enough" | Partial proves nothing |
72
+ | "Different words so rule doesn't apply" | Spirit over letter |
73
+
74
+ ## Key Patterns
75
+
76
+ **Tests:**
77
+ ```
78
+ ✅ [Run test command] [See: 34/34 pass] "All tests pass"
79
+ ❌ "Should pass now" / "Looks correct"
80
+ ```
81
+
82
+ **Regression tests (TDD Red-Green):**
83
+ ```
84
+ ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
85
+ ❌ "I've written a regression test" (without red-green verification)
86
+ ```
87
+
88
+ **Build:**
89
+ ```
90
+ ✅ [Run build] [See: exit 0] "Build passes"
91
+ ❌ "Linter passed" (linter doesn't check compilation)
92
+ ```
93
+
94
+ **Requirements:**
95
+ ```
96
+ ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
97
+ ❌ "Tests pass, phase complete"
98
+ ```
99
+
100
+ **Agent delegation:**
101
+ ```
102
+ ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
103
+ ❌ Trust agent report
104
+ ```
105
+
106
+ ## When To Apply
107
+
108
+ **ALWAYS before:**
109
+ - ANY variation of success/completion claims
110
+ - ANY expression of satisfaction
111
+ - ANY positive statement about work state
112
+ - Committing, PR creation, task completion
113
+ - Moving to next task
114
+ - Delegating to agents
115
+
116
+ **Rule applies to:**
117
+ - Exact phrases
118
+ - Paraphrases and synonyms
119
+ - Implications of success
120
+ - ANY communication suggesting completion/correctness
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: wiki-read
3
+ description: "Read Wiki to verify requirement consistency (mandatory in P1). | 触发词:读取wiki/验证需求"
4
+ argument-hint: "[task description/keywords]"
5
+ context: fork
6
+ allowed-tools:
7
+ - Read
8
+ - Glob
9
+ - Grep
10
+ - Edit
11
+ ---
12
+
13
+ Usage: `/wiki-read [task description/keywords]`
14
+
15
+ Arguments: $ARGUMENTS
16
+
17
+ ---
18
+
19
+ ## Core principle (核心原则)
20
+
21
+ **Mandatory prerequisite in P1; before the Wiki-read checkpoint is complete, no other action is allowed.**
22
+
23
+ ---
24
+
25
+ ## Execution steps (执行步骤)
26
+
27
+ ### 1. Determine the Wiki directory location
28
+
29
+ Check whether a `wiki/` directory exists at the project root:
30
+
31
+ | Condition | Wiki path |
32
+ |------|-----------|
33
+ | `wiki/` exists | `wiki/` |
34
+ | not exists | `docs/wiki/` |
35
+
36
+ ### 2. Semantic analysis to determine relevant modules
37
+
38
+ **Input handling (输入处理):**
39
+ 1. CLI argument `[task description/keywords]`
40
+ 2. `task_description` in `project-state.md`
41
+ 3. with no input, read main/index.md to get all modules
42
+
43
+ **Semantic matching flow (语义匹配流程):**
44
+
45
+ ```
46
+ 1. read wiki/main/index.md to get the module list
47
+ 2. read wiki/main/架构总览.md (architecture overview) to get module responsibilities
48
+ 3. read each module's index.md to extract keywords (responsibility, core features, keywords)
49
+ 4. match with semantic similarity:
50
+ - task keywords vs module keywords
51
+ - task description vs module responsibility
52
+ 5. sort by match score, take Top 5
53
+ 6. match threshold: below 30% is not returned
54
+ ```
55
+
56
+ **Match scoring (匹配度计算):**
57
+
58
+ | Match method | Weight |
59
+ |----------|------|
60
+ | exact keyword match | 100% |
61
+ | partial keyword match | 70% |
62
+ | responsibility description contains keyword | 50% |
63
+ | core feature contains keyword | 40% |
64
+
65
+ ### 3. Drill down and read module docs
66
+
67
+ **For each matched module, read the following docs (每个匹配模块读取以下文档):**
68
+
69
+ | Doc | Purpose |
70
+ |------|------|
71
+ | `{module}/index.md` | module entry, core feature list |
72
+ | `{module}/01-architecture/架构总览.md` | architecture design, tech stack |
73
+ | `{module}/02-requirements/需求总览.md` | functional requirements, priorities |
74
+ | `{module}/03-processes/*.md` | business processes |
75
+ | `{module}/04-interfaces/*.md` | interface definitions |
76
+
77
+ **Scan rules (扫描规则):**
78
+ - use `Glob` to scan all `.md` files under `{wiki}/{module}/`
79
+ - priority: `index.md` > `架构总览.md` > `需求总览.md` > `流程总览.md` > `索引.md`
80
+ - depth-first by level: read 01-architecture first, then 02-requirements...
81
+
82
+ ### 4. Consolidate information (整合信息)
83
+
84
+ **Consolidated output structure (整合输出结构):**
85
+
86
+ ```markdown
87
+ ## Wiki semantic match result (Wiki 语义匹配结果)
88
+
89
+ ### Matched modules (sorted by relevance) (匹配模块)
90
+
91
+ **Module 1: {module} (match 85%)**
92
+ - Responsibility (职责定位): {extracted from index.md}
93
+ - Core features (核心功能): {extracted from index.md}
94
+ - Key docs (关键文档):
95
+ - Architecture: 01-architecture/架构总览.md ✅
96
+ - Requirements: 02-requirements/需求总览.md ✅
97
+ - Processes: 03-processes/*.md (3 files)
98
+ - Interfaces: 04-interfaces/*.md (5 files)
99
+
100
+ **Module 2: {module} (match 62%)**
101
+ - ...
102
+
103
+ ### Key information extracted (关键信息提取)
104
+
105
+ **Architecture design (架构设计):**
106
+ - Tech stack (技术栈): {extracted tech stack}
107
+ - Module split (模块划分): {extracted module split}
108
+
109
+ **Functional requirements (功能需求):**
110
+ - P0: {core features}
111
+ - P1: {important features}
112
+
113
+ **Business processes (业务流程):**
114
+ - {process name}: {one-line description}
115
+
116
+ **Interface list (接口清单):**
117
+ - {interface name}: {path} - {function}
118
+ ```
119
+
120
+ ### 5. Record the consistency conclusion (记录一致性结论)
121
+
122
+ Write the Wiki-vs-code consistency conclusion into the `key_context` field of `project-state.md`:
123
+
124
+ ```markdown
125
+ ## Wiki verification conclusion (Wiki 验证结论)
126
+
127
+ - **Wiki directory (Wiki 目录)**: `wiki/` (exists / not exists)
128
+ - **Matched modules (匹配模块)**: {module list sorted by relevance}
129
+ - **Consistency with code (与代码一致性)**:
130
+ - Architecture design: consistent / inconsistent / needs update
131
+ - Interface definitions: consistent / inconsistent / needs update
132
+ - Business processes: consistent / inconsistent / needs update
133
+ - **Key differences (关键差异)**: {differences found}
134
+ - **Changes to watch (需要关注的变更)**: {Wiki content relevant to the current task}
135
+ ```
136
+
137
+ ### 6. Update the checkpoint status (更新检查点状态)
138
+
139
+ After execution, update `project-state.md`:
140
+
141
+ ```yaml
142
+ checkpoint_status:
143
+ wiki_read: true
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Hard constraints (强制约束)
149
+
150
+ | Constraint | Description |
151
+ |------|------|
152
+ | **Semantic matching** | modules must be selected by semantic analysis, not by reading all modules |
153
+ | **Max 5** | no more than 5 matched modules, sorted by match score |
154
+ | **Threshold filter** | modules below 30% match are not returned |
155
+ | **Record conclusion** | the consistency conclusion must be written to `key_context` |
156
+ | **Update checkpoint** | `wiki_read = true` must be set |
157
+
158
+ **Violation consequence**: skipping the Wiki read = SDLC violation; the task must be rolled back and the flow redone.
159
+
160
+ ---
161
+
162
+ ## Output format (输出格式)
163
+
164
+ ```
165
+ ┌─────────────────────────────────────────────────────────────────┐
166
+ │ Wiki read complete (Wiki 读取完成) │
167
+ ├─────────────────────────────────────────────────────────────────┤
168
+ │ Wiki directory (Wiki 目录):wiki/ │
169
+ │ Matched modules (匹配模块):sessionlog(85%)、auth(62%)、log-agg(45%)、user(38%)、notify(32%)│
170
+ │ Doc completeness (文档完整性): │
171
+ │ - sessionlog:architecture ✅ requirements ✅ process ✅ interfaces ✅ │
172
+ │ - auth:architecture ✅ requirements ✅ process ✅ interfaces ✅ │
173
+ │ Consistency conclusion (一致性结论): │
174
+ │ - sessionlog consistent with code │
175
+ │ - new interfaces need Wiki update │
176
+ │ Checkpoint (检查点):wiki_read = true │
177
+ └─────────────────────────────────────────────────────────────────┘
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Difference from code-analysis (与 code-analysis 的区别)
183
+
184
+ | Aspect | wiki-read | code-analysis |
185
+ |--------|-----------|---------------|
186
+ | **Purpose (用途)** | read existing Wiki, semantic match + verify consistency | generate/update Wiki docs |
187
+ | **Timing (时机)** | P1 prerequisite | P2/P5 |
188
+ | **Operation (操作)** | read-only, semantic module match | read source + generate docs |
189
+ | **Output (输出)** | update key_context + checkpoint | generate/update .md files |
190
+ | **Scope (范围)** | semantic match (max 5 modules) | full/incremental analysis of specified modules |