oh-my-codex-cli 0.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 (292) hide show
  1. package/.agent/skills/agent-kb/HOW_TO_USE.md +428 -0
  2. package/.agent/skills/agent-kb/README.md +46 -0
  3. package/.agent/skills/agent-kb/SKILL.md +128 -0
  4. package/.agent/skills/agent-kb/references/intelligent-analysis-explained.md +333 -0
  5. package/.agent/skills/agent-kb/references/query-optimization.md +225 -0
  6. package/.agent/skills/aireview/SKILL.md +704 -0
  7. package/.agent/skills/analyze/SKILL.md +81 -0
  8. package/.agent/skills/architect-planner/HOW_TO_USE.md +238 -0
  9. package/.agent/skills/architect-planner/README.md +41 -0
  10. package/.agent/skills/architect-planner/SKILL.md +539 -0
  11. package/.agent/skills/auto-mbti/SKILL.md +291 -0
  12. package/.agent/skills/autopilot/SKILL.md +222 -0
  13. package/.agent/skills/backend-patterns/SKILL.md +602 -0
  14. package/.agent/skills/bdd-generator/README.md +78 -0
  15. package/.agent/skills/bdd-generator/SKILL.md +436 -0
  16. package/.agent/skills/brainstorming/HOW_TO_USE.md +289 -0
  17. package/.agent/skills/brainstorming/README.md +41 -0
  18. package/.agent/skills/brainstorming/SKILL.md +165 -0
  19. package/.agent/skills/build-fix/SKILL.md +190 -0
  20. package/.agent/skills/cancel/SKILL.md +658 -0
  21. package/.agent/skills/checkpoint/SKILL.md +94 -0
  22. package/.agent/skills/code-review/SKILL.md +273 -0
  23. package/.agent/skills/coding-standards/SKILL.md +535 -0
  24. package/.agent/skills/conductor/SKILL.md +128 -0
  25. package/.agent/skills/conductor/commands/conductor/implement.toml +358 -0
  26. package/.agent/skills/conductor/commands/conductor/newTrack.toml +142 -0
  27. package/.agent/skills/conductor/commands/conductor/revert.toml +123 -0
  28. package/.agent/skills/conductor/commands/conductor/setup.toml +429 -0
  29. package/.agent/skills/conductor/commands/conductor/status.toml +57 -0
  30. package/.agent/skills/conductor/scripts/install.sh +89 -0
  31. package/.agent/skills/conductor/templates/code_styleguides/csharp.md +115 -0
  32. package/.agent/skills/conductor/templates/code_styleguides/dart.md +238 -0
  33. package/.agent/skills/conductor/templates/code_styleguides/general.md +23 -0
  34. package/.agent/skills/conductor/templates/code_styleguides/go.md +48 -0
  35. package/.agent/skills/conductor/templates/code_styleguides/html-css.md +49 -0
  36. package/.agent/skills/conductor/templates/code_styleguides/javascript.md +51 -0
  37. package/.agent/skills/conductor/templates/code_styleguides/python.md +37 -0
  38. package/.agent/skills/conductor/templates/code_styleguides/typescript.md +43 -0
  39. package/.agent/skills/conductor/templates/rules/README.md +23 -0
  40. package/.agent/skills/conductor/templates/rules/agents.md +49 -0
  41. package/.agent/skills/conductor/templates/rules/coding-style.md +70 -0
  42. package/.agent/skills/conductor/templates/rules/dev.md +20 -0
  43. package/.agent/skills/conductor/templates/rules/git-workflow.md +45 -0
  44. package/.agent/skills/conductor/templates/rules/hooks.md +6 -0
  45. package/.agent/skills/conductor/templates/rules/patterns.md +55 -0
  46. package/.agent/skills/conductor/templates/rules/performance.md +47 -0
  47. package/.agent/skills/conductor/templates/rules/research.md +26 -0
  48. package/.agent/skills/conductor/templates/rules/review.md +22 -0
  49. package/.agent/skills/conductor/templates/rules/security.md +36 -0
  50. package/.agent/skills/conductor/templates/rules/testing.md +30 -0
  51. package/.agent/skills/conductor/templates/workflow.md +333 -0
  52. package/.agent/skills/consensus/HOW_TO_USE.md +191 -0
  53. package/.agent/skills/consensus/README.md +41 -0
  54. package/.agent/skills/consensus/SKILL.md +317 -0
  55. package/.agent/skills/content-research-writer/SKILL.md +537 -0
  56. package/.agent/skills/debug-analysis/SKILL.md +331 -0
  57. package/.agent/skills/deepinit/SKILL.md +347 -0
  58. package/.agent/skills/deepsearch/SKILL.md +56 -0
  59. package/.agent/skills/doctor/SKILL.md +158 -0
  60. package/.agent/skills/drawio/EXAMPLES.md +382 -0
  61. package/.agent/skills/drawio/QUICK_START.md +237 -0
  62. package/.agent/skills/drawio/README.md +315 -0
  63. package/.agent/skills/drawio/SETUP_GUIDE.md +254 -0
  64. package/.agent/skills/drawio/SKILL.md +1176 -0
  65. package/.agent/skills/e2e/SKILL.md +396 -0
  66. package/.agent/skills/ecomode/SKILL.md +160 -0
  67. package/.agent/skills/electron-driver/SKILL.md +144 -0
  68. package/.agent/skills/electron-driver/scripts/driver-template.js +71 -0
  69. package/.agent/skills/eval/SKILL.md +140 -0
  70. package/.agent/skills/eval-harness/SKILL.md +242 -0
  71. package/.agent/skills/evolve/SKILL.md +213 -0
  72. package/.agent/skills/frontend-design/SKILL.md +42 -0
  73. package/.agent/skills/frontend-patterns/SKILL.md +646 -0
  74. package/.agent/skills/frontend-ui-ux/SKILL.md +70 -0
  75. package/.agent/skills/git-master/SKILL.md +75 -0
  76. package/.agent/skills/help/SKILL.md +89 -0
  77. package/.agent/skills/iterative-retrieval/SKILL.md +217 -0
  78. package/.agent/skills/local-skills-setup/SKILL.md +483 -0
  79. package/.agent/skills/log-analyzer/SKILL.md +187 -0
  80. package/.agent/skills/mcp-setup/SKILL.md +226 -0
  81. package/.agent/skills/multi-model-research/HOW_TO_USE.md +614 -0
  82. package/.agent/skills/multi-model-research/README.md +233 -0
  83. package/.agent/skills/multi-model-research/SKILL.md +541 -0
  84. package/.agent/skills/multi-model-research/references/troubleshooting.md +415 -0
  85. package/.agent/skills/note/SKILL.md +80 -0
  86. package/.agent/skills/omc-setup/SKILL.md +219 -0
  87. package/.agent/skills/orchestrate/SKILL.md +620 -0
  88. package/.agent/skills/patent-workflow/IMPLEMENTATION_SUMMARY.md +500 -0
  89. package/.agent/skills/patent-workflow/README.md +455 -0
  90. package/.agent/skills/patent-workflow/SKILL.md +1036 -0
  91. package/.agent/skills/patent-workflow/tools/irr_checker.py +260 -0
  92. package/.agent/skills/patent-workflow/tools/sample_terminology.json +49 -0
  93. package/.agent/skills/patent-workflow/tools/term_checker.py +355 -0
  94. package/.agent/skills/pattern-recognition/SKILL.md +792 -0
  95. package/.agent/skills/pipeline/SKILL.md +448 -0
  96. package/.agent/skills/plan/SKILL.md +309 -0
  97. package/.agent/skills/planning-methodology/SKILL.md +370 -0
  98. package/.agent/skills/planning-with-files/SKILL.md +210 -0
  99. package/.agent/skills/planning-with-files/examples.md +202 -0
  100. package/.agent/skills/planning-with-files/reference.md +218 -0
  101. package/.agent/skills/planning-with-files/scripts/check-complete.ps1 +42 -0
  102. package/.agent/skills/planning-with-files/scripts/check-complete.sh +44 -0
  103. package/.agent/skills/planning-with-files/scripts/init-session.ps1 +120 -0
  104. package/.agent/skills/planning-with-files/scripts/init-session.sh +120 -0
  105. package/.agent/skills/planning-with-files/scripts/session-catchup.py +208 -0
  106. package/.agent/skills/planning-with-files/templates/findings.md +95 -0
  107. package/.agent/skills/planning-with-files/templates/progress.md +114 -0
  108. package/.agent/skills/planning-with-files/templates/task_plan.md +132 -0
  109. package/.agent/skills/project-analyze/CLAUDE.md +18 -0
  110. package/.agent/skills/project-analyze/HOW_TO_USE.md +145 -0
  111. package/.agent/skills/project-analyze/README.md +42 -0
  112. package/.agent/skills/project-analyze/SKILL.md +289 -0
  113. package/.agent/skills/project-analyze/SKILL.md.backup +287 -0
  114. package/.agent/skills/project-analyze/SKILL.md.backup_20260105_093646 +287 -0
  115. package/.agent/skills/project-analyze/assets/analysis-report-template.md +433 -0
  116. package/.agent/skills/project-analyze/references/analysis-patterns.md +422 -0
  117. package/.agent/skills/project-analyze/references/projectmind-explained.md +535 -0
  118. package/.agent/skills/project-session-manager/SKILL.md +428 -0
  119. package/.agent/skills/project-session-manager/lib/config.sh +86 -0
  120. package/.agent/skills/project-session-manager/lib/parse.sh +121 -0
  121. package/.agent/skills/project-session-manager/lib/session.sh +132 -0
  122. package/.agent/skills/project-session-manager/lib/tmux.sh +103 -0
  123. package/.agent/skills/project-session-manager/lib/worktree.sh +171 -0
  124. package/.agent/skills/project-session-manager/psm.sh +629 -0
  125. package/.agent/skills/project-session-manager/templates/feature.md +56 -0
  126. package/.agent/skills/project-session-manager/templates/issue-fix.md +57 -0
  127. package/.agent/skills/project-session-manager/templates/pr-review.md +65 -0
  128. package/.agent/skills/project-session-manager/templates/projects.json +19 -0
  129. package/.agent/skills/quality-check/HOW_TO_USE.md +171 -0
  130. package/.agent/skills/quality-check/README.md +50 -0
  131. package/.agent/skills/quality-check/SKILL.md +240 -0
  132. package/.agent/skills/quality-check/SKILL.md.backup +238 -0
  133. package/.agent/skills/quality-check/SKILL.md.backup_20260105_093646 +238 -0
  134. package/.agent/skills/quality-check/assets/quality-report-template.md +437 -0
  135. package/.agent/skills/quality-check/references/refactoring-patterns.md +550 -0
  136. package/.agent/skills/quality-check/references/scoring-criteria.md +454 -0
  137. package/.agent/skills/quality-validation/SKILL.md +519 -0
  138. package/.agent/skills/quality-validation/SKILL.md.backup +573 -0
  139. package/.agent/skills/quality-validation/SKILL.md.backup_20260105_093646 +573 -0
  140. package/.agent/skills/ralph/SKILL.md +236 -0
  141. package/.agent/skills/ralph-init/SKILL.md +78 -0
  142. package/.agent/skills/ralplan/SKILL.md +58 -0
  143. package/.agent/skills/refactor-clean/SKILL.md +49 -0
  144. package/.agent/skills/release/SKILL.md +84 -0
  145. package/.agent/skills/research/SKILL.md +526 -0
  146. package/.agent/skills/research-methodology/SKILL.md +268 -0
  147. package/.agent/skills/review/SKILL.md +53 -0
  148. package/.agent/skills/security-review/SKILL.md +509 -0
  149. package/.agent/skills/security-review/cloud-infrastructure-security.md +361 -0
  150. package/.agent/skills/setup-pm/SKILL.md +102 -0
  151. package/.agent/skills/skill/SKILL.md +424 -0
  152. package/.agent/skills/skill-create/SKILL.md +209 -0
  153. package/.agent/skills/skill-debugger/HOW_TO_USE.md +244 -0
  154. package/.agent/skills/skill-debugger/README.md +44 -0
  155. package/.agent/skills/skill-debugger/SKILL.md +326 -0
  156. package/.agent/skills/skill-debugger/diagnostic_checklist.md +115 -0
  157. package/.agent/skills/skill-development/SKILL.md +661 -0
  158. package/.agent/skills/skill-development/references/skill-creator-original.md +209 -0
  159. package/.agent/skills/skill-doc-generator/README.md +37 -0
  160. package/.agent/skills/skill-doc-generator/SKILL.md +331 -0
  161. package/.agent/skills/skill-quality-analyzer/HOW_TO_USE.md +243 -0
  162. package/.agent/skills/skill-quality-analyzer/README.md +61 -0
  163. package/.agent/skills/skill-quality-analyzer/SKILL.md +247 -0
  164. package/.agent/skills/skill-quality-analyzer/analyzer.py +209 -0
  165. package/.agent/skills/skill-quality-analyzer/expected_output.json +81 -0
  166. package/.agent/skills/skill-quality-analyzer/sample_input.json +9 -0
  167. package/.agent/skills/skill-tester/README.md +46 -0
  168. package/.agent/skills/skill-tester/SKILL.md +345 -0
  169. package/.agent/skills/start-dev/SKILL.md +701 -0
  170. package/.agent/skills/swarm/SKILL.md +691 -0
  171. package/.agent/skills/task-kb-lookup/SKILL.md +211 -0
  172. package/.agent/skills/task-kb-record/SKILL.md +417 -0
  173. package/.agent/skills/tdd/SKILL.md +446 -0
  174. package/.agent/skills/tdd-generator/DEMO.md +516 -0
  175. package/.agent/skills/tdd-generator/README.md +89 -0
  176. package/.agent/skills/tdd-generator/SKILL.md +278 -0
  177. package/.agent/skills/tdd-workflow/SKILL.md +424 -0
  178. package/.agent/skills/test-coverage/SKILL.md +48 -0
  179. package/.agent/skills/thinkdeep/HOW_TO_USE.md +183 -0
  180. package/.agent/skills/thinkdeep/README.md +41 -0
  181. package/.agent/skills/thinkdeep/SKILL.md +343 -0
  182. package/.agent/skills/ui-ux-pro-max/SKILL.md +228 -0
  183. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  184. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  185. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  186. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  187. package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  188. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  189. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  190. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  191. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  192. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  193. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  194. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  195. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  196. package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  197. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  198. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  199. package/.agent/skills/ui-ux-pro-max/scripts/core.py +236 -0
  200. package/.agent/skills/ui-ux-pro-max/scripts/search.py +61 -0
  201. package/.agent/skills/ultrapilot/SKILL.md +647 -0
  202. package/.agent/skills/ultraqa/SKILL.md +152 -0
  203. package/.agent/skills/ultrawork/SKILL.md +123 -0
  204. package/.agent/skills/update-codemaps/SKILL.md +38 -0
  205. package/.agent/skills/update-docs/SKILL.md +52 -0
  206. package/.agent/skills/verification-loop/SKILL.md +140 -0
  207. package/.agent/skills/verify/SKILL.md +80 -0
  208. package/.agent/skills/writer-memory/SKILL.md +459 -0
  209. package/.agent/skills/writer-memory/lib/character-tracker.ts +338 -0
  210. package/.agent/skills/writer-memory/lib/memory-manager.ts +804 -0
  211. package/.agent/skills/writer-memory/lib/relationship-graph.ts +400 -0
  212. package/.agent/skills/writer-memory/lib/scene-organizer.ts +544 -0
  213. package/.agent/skills/writer-memory/lib/synopsis-builder.ts +339 -0
  214. package/.agent/skills/writer-memory/templates/synopsis-template.md +46 -0
  215. package/.governance/skill-lint.allowlist +4 -0
  216. package/.governance/skill-llm.allowlist +4 -0
  217. package/AGENTS.md +59 -0
  218. package/LICENSE +21 -0
  219. package/README.md +169 -0
  220. package/README.zh.md +145 -0
  221. package/bin/omcodex.js +8 -0
  222. package/commands/conductor/implement.toml +358 -0
  223. package/commands/conductor/newTrack.toml +142 -0
  224. package/commands/conductor/revert.toml +123 -0
  225. package/commands/conductor/setup.toml +429 -0
  226. package/commands/conductor/status.toml +57 -0
  227. package/docs/ALIGNMENT.md +40 -0
  228. package/docs/CODEX.md +133 -0
  229. package/docs/NOTIFY.md +81 -0
  230. package/docs/SKILL_GOVERNANCE.md +72 -0
  231. package/docs/SKILL_GOVERNANCE_FRAMEWORK.md +182 -0
  232. package/docs/SKILL_GOVERNANCE_FRAMEWORK.zh.md +170 -0
  233. package/package.json +50 -0
  234. package/prompts/architect.md +105 -0
  235. package/prompts/executor.md +134 -0
  236. package/prompts/planner.md +113 -0
  237. package/scripts/check-skill-governance.sh +84 -0
  238. package/scripts/check-skill-llm-governance.js +302 -0
  239. package/scripts/eval-skills.js +217 -0
  240. package/scripts/generate-catalog-docs.js +95 -0
  241. package/scripts/generate-codex-mcp-config.sh +22 -0
  242. package/scripts/install-codex-force.sh +5 -0
  243. package/scripts/install-codex-incremental.sh +5 -0
  244. package/scripts/install-codex.sh +79 -0
  245. package/scripts/notify-dispatch.js +15 -0
  246. package/scripts/setup-package-manager.js +137 -0
  247. package/src/catalog/generated/public-catalog.json +547 -0
  248. package/src/catalog/manifest.json +542 -0
  249. package/src/catalog/reader.js +43 -0
  250. package/src/catalog/schema.js +79 -0
  251. package/src/cli/doctor.js +62 -0
  252. package/src/cli/index.js +85 -0
  253. package/src/cli/notify.js +127 -0
  254. package/src/cli/route.js +43 -0
  255. package/src/cli/setup.js +155 -0
  256. package/src/cli/team.js +125 -0
  257. package/src/config/generator.js +119 -0
  258. package/src/mcp/memory-server.js +241 -0
  259. package/src/mcp/state-server.js +112 -0
  260. package/src/mcp/trace-server.js +168 -0
  261. package/src/notify/dispatch.js +74 -0
  262. package/src/notify/extensibility/dispatcher.js +113 -0
  263. package/src/notify/extensibility/events.js +15 -0
  264. package/src/notify/extensibility/loader.js +54 -0
  265. package/src/router/skill-router.js +90 -0
  266. package/src/team/auto-advance.js +72 -0
  267. package/src/team/orchestrator.js +82 -0
  268. package/src/team/state-store.js +33 -0
  269. package/src/utils/paths.js +33 -0
  270. package/templates/AGENTS.md +15 -0
  271. package/templates/catalog-manifest.json +542 -0
  272. package/templates/code_styleguides/csharp.md +115 -0
  273. package/templates/code_styleguides/dart.md +238 -0
  274. package/templates/code_styleguides/general.md +23 -0
  275. package/templates/code_styleguides/go.md +48 -0
  276. package/templates/code_styleguides/html-css.md +49 -0
  277. package/templates/code_styleguides/javascript.md +51 -0
  278. package/templates/code_styleguides/python.md +37 -0
  279. package/templates/code_styleguides/typescript.md +43 -0
  280. package/templates/rules/README.md +23 -0
  281. package/templates/rules/agents.md +49 -0
  282. package/templates/rules/coding-style.md +70 -0
  283. package/templates/rules/dev.md +20 -0
  284. package/templates/rules/git-workflow.md +45 -0
  285. package/templates/rules/notify.md +6 -0
  286. package/templates/rules/patterns.md +55 -0
  287. package/templates/rules/performance.md +47 -0
  288. package/templates/rules/research.md +26 -0
  289. package/templates/rules/review.md +22 -0
  290. package/templates/rules/security.md +36 -0
  291. package/templates/rules/testing.md +30 -0
  292. package/templates/workflow.md +333 -0
@@ -0,0 +1,436 @@
1
+ ---
2
+ name: BDD Generator
3
+ description: Behavior-Driven Development assistant using playwright-bdd. Generates Gherkin features and step definitions with full TDD Guard integration.
4
+ ---
5
+
6
+ # BDD Generator Skill
7
+
8
+ ## When to Use This Skill
9
+
10
+ Automatically invoke when user mentions:
11
+ - "BDD", "behavior driven", "行为驱动"
12
+ - "Gherkin", "Given-When-Then"
13
+ - "Feature file", "Scenario", "场景测试"
14
+ - "playwright-bdd", "cucumber"
15
+ - Keywords: BDD, feature, scenario, gherkin
16
+
17
+ ## What This Skill Does
18
+
19
+ **BDD Generator** provides:
20
+ 1. **Gherkin Feature Generation**: Auto-generate .feature files with proper BDD syntax
21
+ 2. **Step Definition Scaffolding**: Create TypeScript step definitions following TDD Guard rules
22
+ 3. **playwright-bdd Integration**: Zero-config setup with Playwright Test Runner
23
+ 4. **TDD Guard Enforcement**: One scenario, one step at a time
24
+ 5. **Business Language**: Translate requirements into readable test scenarios
25
+
26
+ ## Core Advantages Over Cucumber.js
27
+
28
+ ### Why playwright-bdd?
29
+
30
+ ```yaml
31
+ playwright-bdd:
32
+ ✅ No extra runner (direct Playwright)
33
+ ✅ 30-50% faster execution
34
+ ✅ Native Playwright features
35
+ ✅ Better debugging experience
36
+ ✅ Active maintenance (8.4.2, 5 days ago)
37
+
38
+ Cucumber.js:
39
+ ❌ Requires extra Cucumber runner
40
+ ❌ Two-layer abstraction
41
+ ❌ Slower execution
42
+ ❌ More complex configuration
43
+ ```
44
+
45
+ ## Project Structure
46
+
47
+ ```
48
+ project/
49
+ ├── features/ # BDD Feature files
50
+ │ ├── login.feature # Gherkin scenarios
51
+ │ ├── checkout.feature
52
+ │ └── steps/ # Step Definitions
53
+ │ ├── login.steps.ts
54
+ │ └── common.steps.ts
55
+ ├── playwright.config.ts # Playwright + BDD config
56
+ └── package.json
57
+ ```
58
+
59
+ ## Instructions
60
+
61
+ ### Scenario 1: Generate Feature File
62
+
63
+ **User**: "Create BDD test for user login"
64
+
65
+ **Your Actions**:
66
+ 1. **Understand Business Requirement**
67
+ 2. **Write ONE Scenario** (TDD Guard enforced)
68
+ 3. **Use Business Language** (avoid technical details)
69
+
70
+ **Output**:
71
+ ```gherkin
72
+ Feature: User Authentication
73
+ As a user
74
+ I want to log in to the application
75
+ So that I can access my account
76
+
77
+ Scenario: Successful login with valid credentials
78
+ Given I am on the login page
79
+ When I enter username "john@example.com"
80
+ And I enter password "SecurePass123"
81
+ And I click the login button
82
+ Then I should see the dashboard
83
+ ```
84
+
85
+ ⚠️ **TDD Guard Rule**: Only ONE scenario at a time!
86
+
87
+ ### Scenario 2: Generate Step Definitions
88
+
89
+ **User**: "Implement the steps"
90
+
91
+ **Your Actions**:
92
+ 1. Run `npx bddgen` to see missing steps
93
+ 2. Implement ONLY the FIRST failing step
94
+ 3. Run test to see next failure
95
+ 4. Repeat
96
+
97
+ **Output**:
98
+ ```typescript
99
+ // features/steps/login.steps.ts
100
+ import { createBdd } from 'playwright-bdd';
101
+ const { Given } = createBdd();
102
+
103
+ // Only implement the first failing step
104
+ Given('I am on the login page', async ({ page }) => {
105
+ await page.goto('/login');
106
+ });
107
+
108
+ // Wait for test to fail on next step before implementing
109
+ ```
110
+
111
+ ⚠️ **TDD Guard Rule**: One step implementation at a time!
112
+
113
+ ### Scenario 3: Project Setup
114
+
115
+ **User**: "Setup BDD in my project"
116
+
117
+ **Your Actions**:
118
+
119
+ **Step 1: Install Dependencies**
120
+ ```bash
121
+ npm install --save-dev playwright-bdd @playwright/test
122
+ npx playwright install
123
+ ```
124
+
125
+ **Step 2: Configure Playwright**
126
+ ```typescript
127
+ // playwright.config.ts
128
+ import { defineConfig } from '@playwright/test';
129
+ import { defineBddConfig } from 'playwright-bdd';
130
+
131
+ const testDir = defineBddConfig({
132
+ features: 'features/**/*.feature',
133
+ steps: 'features/steps/**/*.ts',
134
+ });
135
+
136
+ export default defineConfig({
137
+ testDir,
138
+ use: {
139
+ baseURL: 'http://localhost:3000',
140
+ trace: 'on-first-retry',
141
+ },
142
+ });
143
+ ```
144
+
145
+ **Step 3: Create Directory Structure**
146
+ ```bash
147
+ mkdir -p features/steps
148
+ ```
149
+
150
+ **Step 4: Add Scripts to package.json**
151
+ ```json
152
+ {
153
+ "scripts": {
154
+ "bdd:generate": "bddgen",
155
+ "test": "playwright test",
156
+ "test:ui": "playwright test --ui"
157
+ }
158
+ }
159
+ ```
160
+
161
+ ## BDD Workflow with TDD Guard
162
+
163
+ ### RED-GREEN-REFACTOR Cycle
164
+
165
+ ```yaml
166
+ 🔴 RED Phase:
167
+ 1. Write ONE Feature Scenario
168
+ 2. Run: npm run bdd:generate
169
+ 3. Implement FIRST missing step
170
+ 4. Run: npm test
171
+ 5. See failure → Good!
172
+
173
+ 🟢 GREEN Phase:
174
+ 6. Implement step correctly
175
+ 7. Run: npm test
176
+ 8. Step passes → Move to next
177
+
178
+ 🔄 REPEAT:
179
+ 9. Next step fails
180
+ 10. Implement only that step
181
+ 11. Repeat until scenario passes
182
+
183
+ 🔵 REFACTOR Phase:
184
+ 12. All steps green
185
+ 13. Refactor step definitions
186
+ 14. Tests still pass
187
+ 15. Add next scenario
188
+ ```
189
+
190
+ ## Gherkin Best Practices
191
+
192
+ ### DO: Business Language
193
+ ```gherkin
194
+ ✅ Given I am logged in as admin
195
+ ✅ When I create a new product
196
+ ✅ Then I should see success message
197
+ ```
198
+
199
+ ### DON'T: Technical Details
200
+ ```gherkin
201
+ ❌ Given I call POST /api/login with admin credentials
202
+ ❌ When I execute createProduct() function
203
+ ❌ Then status code should be 200
204
+ ```
205
+
206
+ ### Use Background for Common Steps
207
+ ```gherkin
208
+ Feature: Product Management
209
+
210
+ Background:
211
+ Given I am logged in as admin
212
+ And I am on the products page
213
+
214
+ Scenario: Create product
215
+ When I click "New Product"
216
+ # ...
217
+
218
+ Scenario: Delete product
219
+ When I select a product
220
+ # ...
221
+ ```
222
+
223
+ ### Use Scenario Outline for Data-Driven Tests
224
+ ```gherkin
225
+ Scenario Outline: Login validation
226
+ Given I am on the login page
227
+ When I enter username "<username>"
228
+ And I enter password "<password>"
229
+ Then I should see "<result>"
230
+
231
+ Examples:
232
+ | username | password | result |
233
+ | valid@test.com| Valid123 | dashboard |
234
+ | invalid@test | wrong | Invalid credentials |
235
+ ```
236
+
237
+ ## Step Definition Patterns
238
+
239
+ ### Parameterized Steps
240
+ ```typescript
241
+ When('I enter username {string}', async ({ page }, username: string) => {
242
+ await page.fill('#username', username);
243
+ });
244
+
245
+ When('I enter {int} items', async ({ page }, count: number) => {
246
+ // count is a number
247
+ });
248
+ ```
249
+
250
+ ### Custom Parameter Types
251
+ ```typescript
252
+ import { defineParameterType } from 'playwright-bdd';
253
+
254
+ defineParameterType({
255
+ name: 'user',
256
+ regexp: /admin|customer|guest/,
257
+ transformer: (s) => s,
258
+ });
259
+
260
+ Given('I am logged in as {user}', async ({ page }, userType) => {
261
+ // userType is 'admin' | 'customer' | 'guest'
262
+ });
263
+ ```
264
+
265
+ ### Page Object Integration
266
+ ```typescript
267
+ // features/steps/login.steps.ts
268
+ import { createBdd } from 'playwright-bdd';
269
+ import { LoginPage } from '../pages/LoginPage';
270
+
271
+ const { Given, When } = createBdd();
272
+
273
+ Given('I am on the login page', async ({ page }) => {
274
+ const loginPage = new LoginPage(page);
275
+ await loginPage.goto();
276
+ });
277
+
278
+ When('I login as {string}', async ({ page }, username) => {
279
+ const loginPage = new LoginPage(page);
280
+ await loginPage.login(username, 'password123');
281
+ });
282
+ ```
283
+
284
+ ## Integration with TDD Guard
285
+
286
+ ### TDD Guard Hooks
287
+ The BDD Generator respects all TDD Guard rules:
288
+
289
+ 1. **Feature File Writing**
290
+ - ✅ One scenario at a time
291
+ - ❌ Multiple scenarios blocked
292
+
293
+ 2. **Step Definition Writing**
294
+ - ✅ One step at a time
295
+ - ❌ Multiple steps blocked
296
+ - ❌ Implementation without failing test blocked
297
+
298
+ 3. **RED-GREEN-REFACTOR**
299
+ - Enforces test-first workflow
300
+ - Prevents premature implementation
301
+
302
+ ## Commands Reference
303
+
304
+ ```bash
305
+ # Generate test code from .feature files
306
+ npm run bdd:generate
307
+ # or: npx bddgen
308
+
309
+ # Run all BDD tests
310
+ npm test
311
+
312
+ # Run specific feature
313
+ npx playwright test --grep "User login"
314
+
315
+ # Run with UI mode (recommended for debugging)
316
+ npm run test:ui
317
+
318
+ # Run headed (see browser)
319
+ npm run test:headed
320
+
321
+ # View test report
322
+ npx playwright show-report
323
+ ```
324
+
325
+ ## Troubleshooting
326
+
327
+ ### Issue 1: "Missing step definitions"
328
+ **Solution**: Run `npx bddgen` to see which steps need implementation
329
+
330
+ ### Issue 2: TDD Guard blocks multi-step creation
331
+ **This is correct!** Implement one step at a time:
332
+ 1. Run test to see first failure
333
+ 2. Implement only that step
334
+ 3. Repeat
335
+
336
+ ### Issue 3: Steps not found
337
+ **Check**:
338
+ - Steps directory in playwright.config.ts
339
+ - Import `createBdd` from 'playwright-bdd'
340
+ - File naming: `*.steps.ts`
341
+
342
+ ## Example Workflow
343
+
344
+ **User Request**: "Create BDD test for checkout flow"
345
+
346
+ **Step-by-Step**:
347
+
348
+ ```markdown
349
+ ## 🎯 BDD Test for Checkout Flow
350
+
351
+ ### Step 1: Create Feature (ONE scenario)
352
+ \`\`\`gherkin
353
+ # features/checkout.feature
354
+ Feature: Shopping Cart Checkout
355
+
356
+ Scenario: Complete purchase with valid payment
357
+ Given I have items in my cart
358
+ When I proceed to checkout
359
+ And I enter valid payment details
360
+ Then I should see order confirmation
361
+ \`\`\`
362
+
363
+ ### Step 2: Generate Test Code
364
+ \`\`\`bash
365
+ npx bddgen
366
+ \`\`\`
367
+
368
+ Output shows 4 missing steps.
369
+
370
+ ### Step 3: Run Test (RED)
371
+ \`\`\`bash
372
+ npm test
373
+ \`\`\`
374
+
375
+ Fails on: "Given I have items in my cart"
376
+
377
+ ### Step 4: Implement First Step (GREEN)
378
+ \`\`\`typescript
379
+ Given('I have items in my cart', async ({ page }) => {
380
+ await page.goto('/products');
381
+ await page.click('[data-testid="add-to-cart"]');
382
+ await expect(page.locator('.cart-count')).toContainText('1');
383
+ });
384
+ \`\`\`
385
+
386
+ ### Step 5: Run Test Again
387
+ \`\`\`bash
388
+ npm test
389
+ \`\`\`
390
+
391
+ Now fails on: "When I proceed to checkout"
392
+
393
+ ### Step 6: Repeat
394
+ Implement only the failing step, run test, repeat.
395
+ \`\`\`
396
+
397
+ ## Integration with Other Skills
398
+
399
+ - **TDD-Generator**: BDD for behavior, TDD for units
400
+ - **Agent-KB**: Query BDD best practices
401
+ - **Quality-Check**: Analyze feature coverage
402
+ - **Project-Analyze**: Identify critical user flows for BDD
403
+
404
+ ## Important Notes
405
+
406
+ - **BDD = User Perspective**: Write from user's view, not code's view
407
+ - **Gherkin = Documentation**: Features are living documentation
408
+ - **playwright-bdd > Cucumber**: Simpler, faster, better integrated
409
+ - **TDD Guard Ally**: BDD works perfectly with TDD Guard enforcement
410
+ - **One Scenario Rule**: Build test suite incrementally, not all at once
411
+
412
+ ## Quick Reference
413
+
414
+ ### Gherkin Keywords
415
+ - **Feature**: High-level functionality
416
+ - **Scenario**: Specific test case
417
+ - **Given**: Setup/precondition
418
+ - **When**: Action/trigger
419
+ - **Then**: Expected outcome
420
+ - **And/But**: Additional steps
421
+ - **Background**: Common setup for all scenarios
422
+ - **Scenario Outline**: Data-driven template
423
+ - **Examples**: Test data table
424
+
425
+ ### playwright-bdd Exports
426
+ ```typescript
427
+ import { createBdd } from 'playwright-bdd';
428
+ const { Given, When, Then, Before, After } = createBdd();
429
+ ```
430
+
431
+ ### Fixtures Available
432
+ All Playwright fixtures available in steps:
433
+ - `{ page }` - Browser page
434
+ - `{ context }` - Browser context
435
+ - `{ browser }` - Browser instance
436
+ - `{ request }` - API request context
@@ -0,0 +1,289 @@
1
+ # Brainstorming - Detailed Usage Guide
2
+
3
+ ## Overview
4
+
5
+ Refine rough ideas into fully-formed designs through structured Socratic questioning, alternative exploration, and incremental validation.
6
+
7
+ ## When to Use
8
+
9
+ **Before writing code or implementation plans**:
10
+ - Exploring solution space
11
+ - Validating assumptions
12
+ - Design decisions
13
+ - Problem decomposition
14
+ - Alternative generation
15
+
16
+ ## Structured Questioning Framework
17
+
18
+ ### Phase 1: Problem Understanding
19
+
20
+ **Questions**:
21
+ - What problem are we really solving?
22
+ - What are the constraints?
23
+ - What would success look like?
24
+ - What are we NOT trying to solve?
25
+
26
+ **Example**:
27
+ ```
28
+ User: "Need to implement real-time sync"
29
+
30
+ Claude questions:
31
+ - What data needs syncing?
32
+ - How real-time (100ms, 1s, 10s)?
33
+ - How many clients?
34
+ - Offline support needed?
35
+ - Conflict resolution strategy?
36
+ ```
37
+
38
+ ### Phase 2: Alternative Exploration
39
+
40
+ **Generate 3-5 alternatives**:
41
+ 1. Simple approach (MVP)
42
+ 2. Standard approach (industry best practice)
43
+ 3. Innovative approach (novel solution)
44
+ 4. Hybrid approach (combining strengths)
45
+
46
+ **Example**:
47
+ ```
48
+ Sync approaches:
49
+ 1. Polling (simple, higher latency)
50
+ 2. WebSocket (real-time, complex)
51
+ 3. Server-Sent Events (one-way, simpler than WebSocket)
52
+ 4. Hybrid (SSE for updates + REST for mutations)
53
+ ```
54
+
55
+ ### Phase 3: Incremental Validation
56
+
57
+ **Validate each alternative**:
58
+ - Pros/cons analysis
59
+ - Complexity assessment
60
+ - Cost/benefit evaluation
61
+ - Risk identification
62
+
63
+ **Example**:
64
+ ```
65
+ WebSocket approach:
66
+ ✅ Pros: True bi-directional, low latency
67
+ ❌ Cons: Complex scaling, connection management
68
+ 📊 Complexity: High (need sticky sessions, clustering)
69
+ 💰 Cost/Benefit: High cost for read-heavy workloads
70
+ ⚠️ Risks: Connection limits, debugging difficulty
71
+ ```
72
+
73
+ ### Phase 4: Decision Refinement
74
+
75
+ **Converge to recommended approach**:
76
+ - Eliminate clearly inferior options
77
+ - Combine strengths of remaining options
78
+ - Define decision criteria
79
+ - Make recommendation with confidence level
80
+
81
+ ## Output Format
82
+
83
+ ```markdown
84
+ ## 💡 Brainstorming Session
85
+
86
+ **Topic**: [Your question/problem]
87
+
88
+ ---
89
+
90
+ ### Problem Understanding
91
+
92
+ **Core Problem**: Need real-time data sync for collaborative editor
93
+
94
+ **Constraints**:
95
+ - 100 concurrent users per document
96
+ - <200ms update latency
97
+ - Offline editing support required
98
+ - Conflict resolution needed
99
+
100
+ **Success Criteria**:
101
+ - All users see changes within 200ms
102
+ - No data loss on conflicts
103
+ - Works offline with sync on reconnect
104
+
105
+ ---
106
+
107
+ ### Alternative Solutions
108
+
109
+ #### Option 1: Simple Polling
110
+ **Approach**: Clients poll every 1 second for updates
111
+
112
+ **Pros**:
113
+ - Very simple implementation
114
+ - No special server infrastructure
115
+
116
+ **Cons**:
117
+ - High server load (100 requests/sec per document)
118
+ - 1-second latency (doesn't meet requirement)
119
+
120
+ **Verdict**: ❌ Doesn't meet latency requirement
121
+
122
+ ---
123
+
124
+ #### Option 2: WebSocket + Operational Transform
125
+ **Approach**: WebSocket for real-time, OT for conflict resolution
126
+
127
+ **Pros**:
128
+ - Meets latency requirement
129
+ - Battle-tested OT libraries exist
130
+ - True real-time collaboration
131
+
132
+ **Cons**:
133
+ - Complex OT implementation
134
+ - Difficult debugging
135
+ - Server complexity (sticky sessions, clustering)
136
+
137
+ **Verdict**: ⚠️ Meets requirements but high complexity
138
+
139
+ ---
140
+
141
+ #### Option 3: Server-Sent Events + CRDT
142
+ **Approach**: SSE for server-to-client updates, REST for client mutations, CRDT for conflicts
143
+
144
+ **Pros**:
145
+ - Simpler than WebSocket (one-way)
146
+ - CRDT eliminates conflict resolution complexity
147
+ - Offline support built-in with CRDT
148
+
149
+ **Cons**:
150
+ - CRDT library learning curve
151
+ - Larger payload size
152
+ - Not true bi-directional
153
+
154
+ **Verdict**: ✅ Good balance of simplicity and features
155
+
156
+ ---
157
+
158
+ #### Option 4: Firebase/Supabase (Managed Service)
159
+ **Approach**: Use managed real-time database
160
+
161
+ **Pros**:
162
+ - Zero infrastructure complexity
163
+ - Built-in offline support
164
+ - Proven scalability
165
+
166
+ **Cons**:
167
+ - Vendor lock-in
168
+ - Cost at scale
169
+ - Limited customization
170
+
171
+ **Verdict**: ✅ Good for MVP, consider migration path
172
+
173
+ ---
174
+
175
+ ### Decision Matrix
176
+
177
+ | Criteria | Polling | WebSocket+OT | SSE+CRDT | Firebase | Weight |
178
+ |----------|---------|--------------|----------|----------|--------|
179
+ | Latency | ❌ | ✅ | ✅ | ✅ | High |
180
+ | Complexity | ✅ | ❌ | ⚠️ | ✅ | High |
181
+ | Offline Support | ❌ | ⚠️ | ✅ | ✅ | Medium |
182
+ | Scalability | ❌ | ⚠️ | ✅ | ✅ | Medium |
183
+ | Cost | ✅ | ✅ | ✅ | ❌ | Low |
184
+
185
+ ---
186
+
187
+ ### Recommended Approach
188
+
189
+ **Phase 1 (MVP)**: Firebase
190
+ - Fastest time to market
191
+ - Validate product hypothesis
192
+ - Defer infrastructure complexity
193
+
194
+ **Phase 2 (Growth)**: SSE + CRDT (YJS library)
195
+ - Migrate when Firebase costs exceed $X/month
196
+ - Own infrastructure and data
197
+ - Keep offline support and conflict resolution
198
+
199
+ **Confidence**: High (80%)
200
+
201
+ **Rationale**:
202
+ - Firebase reduces MVP risk
203
+ - SSE+CRDT provides clear migration path
204
+ - CRDT solves conflict resolution elegantly
205
+ - SSE simpler than WebSocket for primarily server-push workload
206
+
207
+ ---
208
+
209
+ ### Next Steps
210
+
211
+ 1. **Prototype with Firebase** (1 week)
212
+ 2. **Set migration triggers** (cost > $500/mo OR features limited)
213
+ 3. **Research YJS library** (understand CRDT implementation)
214
+ 4. **Design migration strategy** (gradual rollout, feature parity checklist)
215
+ ```
216
+
217
+ ## Question Patterns
218
+
219
+ ### Assumption Challenging
220
+
221
+ ```
222
+ "What if we DON'T need real-time?"
223
+ "What if offline support isn't actually required?"
224
+ "What if 100 users is actually 1000?"
225
+ ```
226
+
227
+ ### Constraint Relaxation
228
+
229
+ ```
230
+ "What if we had unlimited budget?"
231
+ "What if we had 6 months instead of 6 weeks?"
232
+ "What if we could use any technology?"
233
+ ```
234
+
235
+ ### Simplification
236
+
237
+ ```
238
+ "What's the absolute simplest version?"
239
+ "What if we only supported Chrome?"
240
+ "What if we limited to 10 users first?"
241
+ ```
242
+
243
+ ## Real-World Examples
244
+
245
+ ### Example 1: State Management Decision
246
+
247
+ **Question**: "How to manage state in React app?"
248
+
249
+ **Brainstorming generates**:
250
+ - useState + Context (simple)
251
+ - Redux (battle-tested)
252
+ - Zustand (modern, minimal)
253
+ - React Query (server state)
254
+ - Jotai/Recoil (atomic)
255
+
256
+ **Converges to**: Zustand for client state + React Query for server state
257
+
258
+ ### Example 2: Authentication Strategy
259
+
260
+ **Question**: "Auth approach for SaaS app?"
261
+
262
+ **Brainstorming generates**:
263
+ - JWT (stateless, simple)
264
+ - Session cookies (server state, revocable)
265
+ - OAuth only (delegated auth)
266
+ - Hybrid (JWT + refresh token)
267
+
268
+ **Converges to**: Hybrid with short-lived JWT + HTTP-only refresh cookies
269
+
270
+ ## Tips for Effective Brainstorming
271
+
272
+ **DO** ✅:
273
+ - Explore 3-5 alternatives minimum
274
+ - Challenge assumptions explicitly
275
+ - Consider simple + complex options
276
+ - Define decision criteria upfront
277
+
278
+ **DON'T** ❌:
279
+ - Jump to first solution
280
+ - Ignore constraints
281
+ - Skip validation step
282
+ - Over-engineer from start
283
+
284
+ ## Related Skills
285
+
286
+ - **thinkdeep**: Deep analysis of chosen option
287
+ - **consensus**: Multi-model validation
288
+ - **architect-planner**: Detailed planning after brainstorming
289
+ - **multi-model-research**: Research specific approaches