@c0x12c/ai-toolkit 1.15.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 (255) hide show
  1. package/.claude-plugin/marketplace.json +16 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/README.md +439 -0
  4. package/VERSION +1 -0
  5. package/agents/design-critic.md +127 -0
  6. package/agents/idea-killer.md +72 -0
  7. package/agents/infrastructure-expert.md +49 -0
  8. package/agents/micronaut-backend-expert.md +45 -0
  9. package/agents/phase-reviewer.md +150 -0
  10. package/agents/research-planner.md +70 -0
  11. package/agents/solution-architect-cto.md +49 -0
  12. package/agents/sre-architect.md +49 -0
  13. package/agents/team-coordinator.md +111 -0
  14. package/bin/cli.js +780 -0
  15. package/claude-md/00-header.md +39 -0
  16. package/claude-md/01-core.md +105 -0
  17. package/claude-md/05-database.md +20 -0
  18. package/claude-md/11-backend-micronaut.md +19 -0
  19. package/claude-md/20-frontend-react.md +44 -0
  20. package/claude-md/25-ux-design.md +56 -0
  21. package/claude-md/30-infrastructure.md +24 -0
  22. package/claude-md/30-project-mgmt.md +119 -0
  23. package/claude-md/40-product.md +39 -0
  24. package/claude-md/50-ops.md +34 -0
  25. package/claude-md/60-research.md +27 -0
  26. package/claude-md/90-footer.md +21 -0
  27. package/commands/spartan/brainstorm.md +134 -0
  28. package/commands/spartan/brownfield.md +157 -0
  29. package/commands/spartan/build.md +435 -0
  30. package/commands/spartan/careful.md +94 -0
  31. package/commands/spartan/commit-message.md +112 -0
  32. package/commands/spartan/content.md +17 -0
  33. package/commands/spartan/context-save.md +161 -0
  34. package/commands/spartan/contribute.md +140 -0
  35. package/commands/spartan/daily.md +42 -0
  36. package/commands/spartan/debug.md +308 -0
  37. package/commands/spartan/deep-dive.md +55 -0
  38. package/commands/spartan/deploy.md +207 -0
  39. package/commands/spartan/e2e.md +264 -0
  40. package/commands/spartan/env-setup.md +166 -0
  41. package/commands/spartan/epic.md +199 -0
  42. package/commands/spartan/fe-review.md +181 -0
  43. package/commands/spartan/figma-to-code.md +260 -0
  44. package/commands/spartan/forensics.md +46 -0
  45. package/commands/spartan/freeze.md +84 -0
  46. package/commands/spartan/fundraise.md +53 -0
  47. package/commands/spartan/gate-review.md +229 -0
  48. package/commands/spartan/gsd-upgrade.md +376 -0
  49. package/commands/spartan/guard.md +42 -0
  50. package/commands/spartan/init-project.md +178 -0
  51. package/commands/spartan/init-rules.md +298 -0
  52. package/commands/spartan/interview.md +154 -0
  53. package/commands/spartan/kickoff.md +73 -0
  54. package/commands/spartan/kotlin-service.md +109 -0
  55. package/commands/spartan/lean-canvas.md +222 -0
  56. package/commands/spartan/lint-rules.md +122 -0
  57. package/commands/spartan/map-codebase.md +124 -0
  58. package/commands/spartan/migration.md +82 -0
  59. package/commands/spartan/next-app.md +317 -0
  60. package/commands/spartan/next-feature.md +212 -0
  61. package/commands/spartan/onboard.md +326 -0
  62. package/commands/spartan/outreach.md +16 -0
  63. package/commands/spartan/phase.md +142 -0
  64. package/commands/spartan/pitch.md +18 -0
  65. package/commands/spartan/plan.md +210 -0
  66. package/commands/spartan/pr-ready.md +202 -0
  67. package/commands/spartan/project.md +106 -0
  68. package/commands/spartan/qa.md +222 -0
  69. package/commands/spartan/research.md +254 -0
  70. package/commands/spartan/review.md +132 -0
  71. package/commands/spartan/scan-rules.md +173 -0
  72. package/commands/spartan/sessions.md +143 -0
  73. package/commands/spartan/spec.md +131 -0
  74. package/commands/spartan/startup.md +257 -0
  75. package/commands/spartan/team.md +570 -0
  76. package/commands/spartan/teardown.md +161 -0
  77. package/commands/spartan/testcontainer.md +97 -0
  78. package/commands/spartan/tf-cost.md +123 -0
  79. package/commands/spartan/tf-deploy.md +116 -0
  80. package/commands/spartan/tf-drift.md +100 -0
  81. package/commands/spartan/tf-import.md +107 -0
  82. package/commands/spartan/tf-module.md +121 -0
  83. package/commands/spartan/tf-plan.md +100 -0
  84. package/commands/spartan/tf-review.md +106 -0
  85. package/commands/spartan/tf-scaffold.md +109 -0
  86. package/commands/spartan/tf-security.md +147 -0
  87. package/commands/spartan/think.md +221 -0
  88. package/commands/spartan/unfreeze.md +13 -0
  89. package/commands/spartan/update.md +134 -0
  90. package/commands/spartan/ux.md +1233 -0
  91. package/commands/spartan/validate.md +193 -0
  92. package/commands/spartan/web-to-prd.md +706 -0
  93. package/commands/spartan/workstreams.md +109 -0
  94. package/commands/spartan/write.md +16 -0
  95. package/commands/spartan.md +386 -0
  96. package/frameworks/00-framework-comparison-guide.md +317 -0
  97. package/frameworks/01-lean-canvas.md +196 -0
  98. package/frameworks/02-design-sprint.md +304 -0
  99. package/frameworks/03-foundation-sprint.md +337 -0
  100. package/frameworks/04-business-model-canvas.md +391 -0
  101. package/frameworks/05-customer-development.md +426 -0
  102. package/frameworks/06-jobs-to-be-done.md +358 -0
  103. package/frameworks/07-mom-test.md +392 -0
  104. package/frameworks/08-value-proposition-canvas.md +488 -0
  105. package/frameworks/09-javelin-board.md +428 -0
  106. package/frameworks/10-build-measure-learn.md +467 -0
  107. package/frameworks/11-mvp-approaches.md +533 -0
  108. package/frameworks/think-before-build.md +593 -0
  109. package/lib/assembler.js +197 -0
  110. package/lib/assembler.test.js +159 -0
  111. package/lib/detector.js +166 -0
  112. package/lib/detector.test.js +221 -0
  113. package/lib/packs.js +16 -0
  114. package/lib/resolver.js +272 -0
  115. package/lib/resolver.test.js +298 -0
  116. package/lib/worktree.sh +104 -0
  117. package/package.json +50 -0
  118. package/packs/backend-micronaut.yaml +35 -0
  119. package/packs/backend-nodejs.yaml +15 -0
  120. package/packs/backend-python.yaml +15 -0
  121. package/packs/core.yaml +37 -0
  122. package/packs/database.yaml +21 -0
  123. package/packs/frontend-react.yaml +24 -0
  124. package/packs/infrastructure.yaml +40 -0
  125. package/packs/ops.yaml +16 -0
  126. package/packs/packs.compiled.json +371 -0
  127. package/packs/product.yaml +22 -0
  128. package/packs/project-mgmt.yaml +24 -0
  129. package/packs/research.yaml +39 -0
  130. package/packs/shared-backend.yaml +14 -0
  131. package/packs/ux-design.yaml +21 -0
  132. package/rules/backend-micronaut/API_DESIGN.md +313 -0
  133. package/rules/backend-micronaut/BATCH_PROCESSING.md +92 -0
  134. package/rules/backend-micronaut/CONTROLLERS.md +388 -0
  135. package/rules/backend-micronaut/KOTLIN.md +414 -0
  136. package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +290 -0
  137. package/rules/backend-micronaut/SERVICES_AND_BEANS.md +325 -0
  138. package/rules/core/NAMING_CONVENTIONS.md +208 -0
  139. package/rules/core/SKILL_AUTHORING.md +174 -0
  140. package/rules/core/TIMEZONE.md +316 -0
  141. package/rules/database/ORM_AND_REPO.md +289 -0
  142. package/rules/database/SCHEMA.md +146 -0
  143. package/rules/database/TRANSACTIONS.md +311 -0
  144. package/rules/frontend-react/FRONTEND.md +344 -0
  145. package/rules/infrastructure/MODULES.md +260 -0
  146. package/rules/infrastructure/NAMING.md +196 -0
  147. package/rules/infrastructure/PROVIDERS.md +309 -0
  148. package/rules/infrastructure/SECURITY.md +310 -0
  149. package/rules/infrastructure/STATE_AND_BACKEND.md +237 -0
  150. package/rules/infrastructure/STRUCTURE.md +234 -0
  151. package/rules/infrastructure/VARIABLES.md +285 -0
  152. package/rules/shared-backend/ARCHITECTURE.md +46 -0
  153. package/rules/ux-design/DESIGN_PROCESS.md +176 -0
  154. package/skills/api-endpoint-creator/SKILL.md +455 -0
  155. package/skills/api-endpoint-creator/error-handling-guide.md +244 -0
  156. package/skills/api-endpoint-creator/examples.md +522 -0
  157. package/skills/api-endpoint-creator/testing-patterns.md +302 -0
  158. package/skills/article-writing/SKILL.md +109 -0
  159. package/skills/article-writing/examples.md +59 -0
  160. package/skills/backend-api-design/SKILL.md +84 -0
  161. package/skills/backend-api-design/code-patterns.md +138 -0
  162. package/skills/brainstorm/SKILL.md +95 -0
  163. package/skills/browser-qa/SKILL.md +87 -0
  164. package/skills/browser-qa/playwright-snippets.md +110 -0
  165. package/skills/ci-cd-patterns/SKILL.md +108 -0
  166. package/skills/ci-cd-patterns/workflows.md +149 -0
  167. package/skills/competitive-teardown/SKILL.md +93 -0
  168. package/skills/competitive-teardown/example-analysis.md +50 -0
  169. package/skills/content-engine/SKILL.md +131 -0
  170. package/skills/content-engine/examples.md +72 -0
  171. package/skills/database-patterns/SKILL.md +72 -0
  172. package/skills/database-patterns/code-templates.md +114 -0
  173. package/skills/database-table-creator/SKILL.md +141 -0
  174. package/skills/database-table-creator/examples.md +552 -0
  175. package/skills/database-table-creator/kotlin-templates.md +400 -0
  176. package/skills/database-table-creator/migration-template.sql +68 -0
  177. package/skills/database-table-creator/validation-checklist.md +337 -0
  178. package/skills/deep-research/SKILL.md +80 -0
  179. package/skills/design-intelligence/SKILL.md +268 -0
  180. package/skills/design-workflow/SKILL.md +127 -0
  181. package/skills/design-workflow/checklists.md +45 -0
  182. package/skills/idea-validation/SKILL.md +129 -0
  183. package/skills/idea-validation/example-report.md +50 -0
  184. package/skills/investor-materials/SKILL.md +122 -0
  185. package/skills/investor-materials/example-outline.md +70 -0
  186. package/skills/investor-outreach/SKILL.md +112 -0
  187. package/skills/investor-outreach/examples.md +76 -0
  188. package/skills/kotlin-best-practices/SKILL.md +58 -0
  189. package/skills/kotlin-best-practices/code-patterns.md +132 -0
  190. package/skills/market-research/SKILL.md +99 -0
  191. package/skills/security-checklist/SKILL.md +65 -0
  192. package/skills/security-checklist/audit-reference.md +95 -0
  193. package/skills/service-debugging/SKILL.md +116 -0
  194. package/skills/service-debugging/common-issues.md +65 -0
  195. package/skills/startup-pipeline/SKILL.md +152 -0
  196. package/skills/terraform-best-practices/SKILL.md +244 -0
  197. package/skills/terraform-module-creator/SKILL.md +284 -0
  198. package/skills/terraform-review/SKILL.md +222 -0
  199. package/skills/terraform-security-audit/SKILL.md +280 -0
  200. package/skills/terraform-service-scaffold/SKILL.md +574 -0
  201. package/skills/testing-strategies/SKILL.md +116 -0
  202. package/skills/testing-strategies/examples.md +103 -0
  203. package/skills/testing-strategies/integration-test-setup.md +71 -0
  204. package/skills/ui-ux-pro-max/SKILL.md +238 -0
  205. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  206. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  207. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  208. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  209. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  210. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  211. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  212. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  213. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  214. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  215. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  216. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  217. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  218. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  219. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  220. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  221. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  222. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  223. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  224. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  225. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  226. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  227. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  228. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  229. package/skills/ui-ux-pro-max/python-setup.md +146 -0
  230. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  231. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  232. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  233. package/skills/web-to-prd/SKILL.md +478 -0
  234. package/templates/build-config.yaml +44 -0
  235. package/templates/commands-config.yaml +55 -0
  236. package/templates/competitor-analysis.md +60 -0
  237. package/templates/content/AGENT_TEMPLATE.md +47 -0
  238. package/templates/content/COMMAND_TEMPLATE.md +27 -0
  239. package/templates/content/RULE_TEMPLATE.md +40 -0
  240. package/templates/content/SKILL_TEMPLATE.md +41 -0
  241. package/templates/design-config.md +105 -0
  242. package/templates/design-doc.md +207 -0
  243. package/templates/epic.md +100 -0
  244. package/templates/feature-spec.md +181 -0
  245. package/templates/idea-canvas.md +47 -0
  246. package/templates/implementation-plan.md +159 -0
  247. package/templates/prd-template.md +86 -0
  248. package/templates/preamble.md +89 -0
  249. package/templates/project-readme.md +35 -0
  250. package/templates/quality-gates.md +230 -0
  251. package/templates/spartan-config.yaml +164 -0
  252. package/templates/user-interview.md +69 -0
  253. package/templates/validation-checklist.md +108 -0
  254. package/templates/workflow-backend-micronaut.md +409 -0
  255. package/templates/workflow-frontend-react.md +233 -0
@@ -0,0 +1,337 @@
1
+ # Database Table Creator - Validation Checklist
2
+
3
+ Use this checklist to validate every database table implementation. **ALL items must pass before completion.**
4
+
5
+ ---
6
+
7
+ ## SQL Migration Validation
8
+
9
+ ### Required Columns
10
+ - [ ] Has `id UUID PRIMARY KEY DEFAULT gen_random_uuid()`
11
+ - [ ] Has `created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP`
12
+ - [ ] Has `updated_at TIMESTAMP` (nullable, trigger will set it)
13
+ - [ ] Has `deleted_at TIMESTAMP` (nullable, for soft deletes)
14
+
15
+ ### Data Types
16
+ - [ ] ALL string columns use `TEXT` (NOT VARCHAR)
17
+ - [ ] ALL id columns use `UUID` type
18
+ - [ ] ALL timestamp columns use `TIMESTAMP` type
19
+ - [ ] Boolean columns use `BOOLEAN` type
20
+ - [ ] JSON data uses `JSONB` type
21
+
22
+ ### Constraints
23
+ - [ ] NO `FOREIGN KEY` constraints anywhere
24
+ - [ ] NO `REFERENCES` clauses anywhere
25
+ - [ ] NO `ON DELETE CASCADE` anywhere
26
+ - [ ] Primary key constraint exists on id column only
27
+
28
+ ### Indexes
29
+ - [ ] ALL unique indexes include `WHERE deleted_at IS NULL`
30
+ - [ ] ALL indexes on foreign key columns include `WHERE deleted_at IS NULL`
31
+ - [ ] Soft delete index exists: `CREATE INDEX idx_{table}_deleted_at ON {table}(deleted_at) WHERE deleted_at IS NOT NULL`
32
+ - [ ] Index naming follows pattern: `idx_{table}_{column}`
33
+ - [ ] Unique index naming follows pattern: `idx_{table}_{column}_unique`
34
+
35
+ ### Triggers
36
+ - [ ] Update trigger exists for `updated_at` column
37
+ - [ ] Trigger format: `CREATE TRIGGER update_{table}_updated_at BEFORE UPDATE ON {table} FOR EACH ROW EXECUTE FUNCTION update_updated_at()`
38
+
39
+ ### Migration File
40
+ - [ ] File name follows pattern: `{number}-{description}.sql`
41
+ - [ ] Has descriptive header comment
42
+ - [ ] Migration runs successfully without errors
43
+ - [ ] `./gradlew :app:module-repository:flywayMigrate` succeeds
44
+ - [ ] `./gradlew :app:module-repository:flywayInfo` shows "Success"
45
+
46
+ ---
47
+
48
+ ## Kotlin Table Object Validation
49
+
50
+ ### Inheritance
51
+ - [ ] **CRITICAL**: Extends `UUIDTable` (NOT `Table`)
52
+ - [ ] Table name in constructor matches SQL table name exactly
53
+ - [ ] Object name follows pattern: `{TableName}Table` (e.g., `UserTable`)
54
+
55
+ ### Column Definitions
56
+ - [ ] ALL string columns use `text()` (NOT `varchar()`)
57
+ - [ ] UUID columns use `uuid()`
58
+ - [ ] Timestamp columns use `timestamp()`
59
+ - [ ] Boolean columns use `bool()`
60
+ - [ ] Column names match SQL exactly (snake_case)
61
+
62
+ ### Nullability
63
+ - [ ] Nullable columns have `.nullable()` modifier
64
+ - [ ] Non-null columns do NOT have `.nullable()`
65
+ - [ ] `createdAt` is NOT nullable
66
+ - [ ] `updatedAt` IS nullable
67
+ - [ ] `deletedAt` IS nullable
68
+
69
+ ### Standard Columns
70
+ - [ ] Has `createdAt = timestamp("created_at").clientDefault { Instant.now() }`
71
+ - [ ] Has `updatedAt = timestamp("updated_at").nullable()`
72
+ - [ ] Has `deletedAt = timestamp("deleted_at").nullable()`
73
+
74
+ ### File Location
75
+ - [ ] Located in `app/module-repository/src/main/kotlin/com/yourcompany/postgresql/table/`
76
+ - [ ] File name is `{TableName}Table.kt`
77
+
78
+ ---
79
+
80
+ ## Entity Data Class Validation
81
+
82
+ ### Class Definition
83
+ - [ ] Is a `data class`
84
+ - [ ] **CRITICAL**: Implements `Entity<Instant>` interface
85
+ - [ ] Name follows pattern: `{TableName}Entity` (e.g., `UserEntity`)
86
+
87
+ ### Required Overrides
88
+ - [ ] Overrides `id: UUID` with default `= UUID.randomUUID()`
89
+ - [ ] Overrides `createdAt: Instant` with default `= Instant.now()`
90
+ - [ ] Overrides `updatedAt: Instant?` with default `= null`
91
+ - [ ] Overrides `deletedAt: Instant?` with default `= null`
92
+
93
+ ### Property Types
94
+ - [ ] String columns use `String` or `String?` type
95
+ - [ ] UUID columns use `UUID` type
96
+ - [ ] Timestamp columns use `Instant` or `Instant?` type
97
+ - [ ] Boolean columns use `Boolean` type
98
+ - [ ] Enum columns use appropriate enum type
99
+
100
+ ### Nullability
101
+ - [ ] Nullable database columns have `?` in Kotlin
102
+ - [ ] Nullable properties have `= null` default
103
+ - [ ] Required database columns do NOT have `?` in Kotlin
104
+
105
+ ### File Location
106
+ - [ ] Located in `app/module-repository/src/main/kotlin/com/yourcompany/postgresql/entity/`
107
+ - [ ] File name is `{TableName}Entity.kt`
108
+
109
+ ---
110
+
111
+ ## Repository Interface Validation
112
+
113
+ ### Standard Methods
114
+ - [ ] Has `insert(entity): Entity` method
115
+ - [ ] Has `update(id, ...fields): Entity?` method
116
+ - [ ] Has `byId(id): Entity?` method
117
+ - [ ] Has `deleteById(id): Entity?` method (soft delete)
118
+ - [ ] Has `restoreById(id): Entity?` method (restore soft deleted)
119
+
120
+ ### Method Signatures
121
+ - [ ] Return types use entity or null (NOT Optional)
122
+ - [ ] Update method parameters are nullable for partial updates
123
+ - [ ] Custom query methods follow naming pattern: `by{Column}(value)`
124
+
125
+ ### File Location
126
+ - [ ] Located in `app/module-repository/src/main/kotlin/com/yourcompany/postgresql/repository/`
127
+ - [ ] File name is `{TableName}Repository.kt`
128
+
129
+ ---
130
+
131
+ ## Repository Implementation Validation
132
+
133
+ ### Class Definition
134
+ - [ ] Name follows pattern: `Default{TableName}Repository`
135
+ - [ ] Implements repository interface
136
+ - [ ] Constructor accepts `DatabaseContext` parameter
137
+ - [ ] Constructor uses dependency injection (parameter only)
138
+
139
+ ### Transaction Usage
140
+ - [ ] **CRITICAL**: ALL write operations use `transaction(db.primary)`
141
+ - [ ] **CRITICAL**: ALL read operations use `transaction(db.replica)`
142
+ - [ ] Insert uses `db.primary`
143
+ - [ ] Update uses `db.primary`
144
+ - [ ] Delete (soft) uses `db.primary`
145
+ - [ ] All by* query methods use `db.replica`
146
+
147
+ ### Soft Delete Implementation
148
+ - [ ] **CRITICAL**: ALL queries include `.andWhere { deletedAt.isNull() }`
149
+ - [ ] `deleteById` sets `deletedAt = Instant.now()` (does NOT hard delete)
150
+ - [ ] `deleteById` filters `deletedAt.isNull()` to only delete active records
151
+ - [ ] `restoreById` sets `deletedAt = null`
152
+ - [ ] `restoreById` filters `deletedAt.isNotNull()` to only restore deleted records
153
+
154
+ ### Null Safety
155
+ - [ ] **CRITICAL**: NO `!!` operators anywhere in code
156
+ - [ ] Uses `.singleOrNull()` instead of `.single()`
157
+ - [ ] Uses safe calls `?.` for nullable access
158
+ - [ ] Uses `let` blocks for null-safe operations
159
+ - [ ] Returns null when record not found (doesn't throw)
160
+
161
+ ### Helper Methods
162
+ - [ ] Has private `convert(row: ResultRow): Entity` method
163
+ - [ ] `convert` maps ALL columns from ResultRow to Entity
164
+ - [ ] UUID columns access `.value` property: `row[Table.id].value`
165
+ - [ ] Enum columns use safe `valueOf()` with null handling
166
+
167
+ ### Return Values
168
+ - [ ] Insert returns the inserted entity
169
+ - [ ] Update returns updated entity or null
170
+ - [ ] Queries return entity or null (or list)
171
+ - [ ] Delete/restore return affected entity or null
172
+
173
+ ### File Location
174
+ - [ ] Located in `app/module-repository/src/main/kotlin/com/yourcompany/postgresql/repository/`
175
+ - [ ] File name is `Default{TableName}Repository.kt`
176
+
177
+ ---
178
+
179
+ ## Repository Factory Bean Validation
180
+
181
+ ### Bean Definition
182
+ - [ ] Factory class has `@Factory` annotation
183
+ - [ ] Method has `@Singleton` annotation
184
+ - [ ] Method name: `provide{TableName}Repository`
185
+ - [ ] Returns interface type (not implementation)
186
+ - [ ] Accepts `DatabaseContext` parameter
187
+ - [ ] Returns new instance: `Default{TableName}Repository(db)`
188
+
189
+ ### File Location
190
+ - [ ] Added to `app/module-repository/src/main/kotlin/com/yourcompany/runtime/factory/RepositoryFactory.kt`
191
+
192
+ ---
193
+
194
+ ## Repository Test Validation
195
+
196
+ ### Test Class Setup
197
+ - [ ] Extends `AbstractRepositoryTest`
198
+ - [ ] Has `@MicronautTest(environments = ["test"])` annotation
199
+ - [ ] Name follows pattern: `Default{TableName}RepositoryTest`
200
+ - [ ] Injects repository interface using `@Inject`
201
+
202
+ ### Test Coverage (Minimum 7 Tests)
203
+ - [ ] Has `insert - creates entity successfully` test
204
+ - [ ] Has `update - updates selected fields` test
205
+ - [ ] Has `byId - returns entity when exists` test
206
+ - [ ] Has `byId - returns null when not exists` test
207
+ - [ ] **CRITICAL**: Has `byId - returns null when soft deleted` test
208
+ - [ ] Has `deleteById - soft deletes entity` test
209
+ - [ ] Has `restoreById - restores soft deleted entity` test
210
+
211
+ ### Test Implementation
212
+ - [ ] Uses `@BeforeEach` to truncate tables
213
+ - [ ] Has dummy entity helper method with randomized data
214
+ - [ ] Uses AssertJ assertions (`assertk.assertThat`)
215
+ - [ ] Tests verify soft delete behavior (deletedAt timestamp set)
216
+ - [ ] Tests verify soft deleted records not returned in queries
217
+ - [ ] Tests verify restore clears deletedAt timestamp
218
+
219
+ ### Test Execution
220
+ - [ ] ALL tests pass: `./gradlew :app:module-repository:test --tests "Default{TableName}RepositoryTest"`
221
+ - [ ] No compilation errors
222
+ - [ ] No runtime errors
223
+ - [ ] 100% success rate
224
+
225
+ ### File Location
226
+ - [ ] Located in `app/module-repository/src/test/kotlin/com/yourcompany/postgresql/repository/`
227
+ - [ ] File name is `Default{TableName}RepositoryTest.kt`
228
+
229
+ ---
230
+
231
+ ## Compilation & Build Validation
232
+
233
+ - [ ] `./gradlew clean build -x test` succeeds
234
+ - [ ] `./gradlew :app:module-repository:test` succeeds
235
+ - [ ] `./gradlew ktlintCheck` passes (no style violations)
236
+ - [ ] No `!!` operators detected (would fail pre-commit hook)
237
+ - [ ] No compilation warnings related to new code
238
+ - [ ] Application starts successfully
239
+
240
+ ---
241
+
242
+ ## Common Mistakes Checklist
243
+
244
+ ### SQL Mistakes
245
+ - [ ] ❌ NOT using VARCHAR instead of TEXT
246
+ - [ ] ❌ NOT using foreign key constraints
247
+ - [ ] ❌ NOT forgetting WHERE clause in indexes
248
+ - [ ] ❌ NOT using hard delete instead of soft delete
249
+ - [ ] ❌ NOT forgetting update trigger
250
+
251
+ ### Kotlin Table Mistakes
252
+ - [ ] ❌ NOT extending `Table` instead of `UUIDTable`
253
+ - [ ] ❌ NOT using `varchar()` instead of `text()`
254
+ - [ ] ❌ NOT mismatching column names with SQL
255
+ - [ ] ❌ NOT forgetting `.nullable()` on optional columns
256
+
257
+ ### Entity Mistakes
258
+ - [ ] ❌ NOT forgetting to implement `Entity<Instant>`
259
+ - [ ] ❌ NOT missing override on id/timestamps
260
+ - [ ] ❌ NOT using wrong types (Long instead of UUID, Date instead of Instant)
261
+
262
+ ### Repository Mistakes
263
+ - [ ] ❌ NOT forgetting `deletedAt.isNull()` filter in queries
264
+ - [ ] ❌ NOT using `!!` operator
265
+ - [ ] ❌ NOT hard deleting instead of soft delete
266
+ - [ ] ❌ NOT using wrong transaction type (primary vs replica)
267
+ - [ ] ❌ NOT missing transaction wrapper
268
+ - [ ] ❌ NOT throwing exceptions instead of returning null
269
+
270
+ ### Test Mistakes
271
+ - [ ] ❌ NOT missing soft delete test
272
+ - [ ] ❌ NOT not cleaning database between tests
273
+ - [ ] ❌ NOT using hardcoded test data instead of random
274
+ - [ ] ❌ NOT insufficient assertions
275
+ - [ ] ❌ NOT tests not running or failing
276
+
277
+ ---
278
+
279
+ ## Final Validation Commands
280
+
281
+ Run these commands in order to verify everything works:
282
+
283
+ ```bash
284
+ # 1. Run migration
285
+ ./gradlew :app:module-repository:flywayMigrate
286
+
287
+ # 2. Check migration status
288
+ ./gradlew :app:module-repository:flywayInfo
289
+
290
+ # 3. Run code style check
291
+ ./gradlew ktlintCheck
292
+
293
+ # 4. Build without tests
294
+ ./gradlew clean build -x test
295
+
296
+ # 5. Run repository tests
297
+ ./gradlew :app:module-repository:test --tests "Default{TableName}RepositoryTest"
298
+
299
+ # 6. Run all tests
300
+ ./gradlew test
301
+ ```
302
+
303
+ **All commands must succeed with zero errors.**
304
+
305
+ ---
306
+
307
+ ## Success Criteria
308
+
309
+ ✅ **Implementation is complete when**:
310
+
311
+ 1. All checklist items above are checked ✓
312
+ 2. SQL migration runs successfully
313
+ 3. All Kotlin files compile without errors
314
+ 4. All tests pass (100% success rate)
315
+ 5. No `!!` operators in code
316
+ 6. All queries filter soft deletes
317
+ 7. ktlintCheck passes
318
+ 8. Build succeeds
319
+
320
+ **If ANY item fails, the implementation is NOT complete.**
321
+
322
+ ---
323
+
324
+ ## Quick Reference: Most Critical Validations
325
+
326
+ These are the most commonly missed items that MUST be verified:
327
+
328
+ 1. ✅ Table extends `UUIDTable` (not `Table`)
329
+ 2. ✅ Entity implements `Entity<Instant>`
330
+ 3. ✅ ALL queries include `deletedAt.isNull()` filter
331
+ 4. ✅ NO `!!` operators anywhere
332
+ 5. ✅ SQL uses TEXT (not VARCHAR)
333
+ 6. ✅ SQL has NO foreign key constraints
334
+ 7. ✅ ALL indexes have WHERE clause
335
+ 8. ✅ Soft delete test exists and passes
336
+
337
+ **These 8 items catch 90% of mistakes. Double-check them carefully.**
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: deep-research
3
+ description: Run deep research on a topic. Web searches, data collection, source checking, and a structured report. Use when the user needs more than a quick answer.
4
+ allowed_tools:
5
+ - WebSearch
6
+ - WebFetch
7
+ - Read
8
+ ---
9
+
10
+ # Deep Research
11
+
12
+ Go deep on one topic. Come back with facts, not fluff.
13
+
14
+ ## When to Use
15
+
16
+ - User needs real data on a topic
17
+ - Writing a research report or blog post
18
+ - Need to understand a new space
19
+ - Preparing materials for investors or partners
20
+
21
+ ## Process
22
+
23
+ ### 1. Scope
24
+ Ask or confirm:
25
+ - What's the question?
26
+ - How deep? (quick scan vs full report)
27
+ - Any angle? (tech, business, user behavior, etc.)
28
+ - Who's the audience? (self, team, investors, public)
29
+
30
+ ### 2. Research
31
+ Run multiple web searches. Look for:
32
+ - Industry reports and data
33
+ - Academic papers or studies
34
+ - News articles (last 12 months)
35
+ - Expert opinions and blog posts
36
+ - Reddit/HN/Twitter discussions
37
+ - Company blogs and case studies
38
+
39
+ ### 3. Verify
40
+ - Cross-check numbers across sources
41
+ - Flag conflicting data
42
+ - Note the source quality (press release vs research paper)
43
+ - Check dates. Flag anything older than 2 years.
44
+
45
+ ### 4. Synthesize
46
+ Don't just list what you found. Connect the dots:
47
+ - What do the facts add up to?
48
+ - What's the pattern?
49
+ - What's missing from the data?
50
+ - What surprised you?
51
+
52
+ ### 5. Write Report
53
+
54
+ Structure:
55
+ 1. **TL;DR** - 3 sentences max
56
+ 2. **Background** - Context someone needs to understand
57
+ 3. **Key Findings** - The meat. Numbered, sourced.
58
+ 4. **Analysis** - What it means. Your take.
59
+ 5. **Open Questions** - What we still don't know
60
+ 6. **Sources** - Every link, with date and source name
61
+
62
+ ## Rules
63
+
64
+ - Every claim needs a source
65
+ - Say "I couldn't find data on X" instead of making stuff up
66
+ - Include views that disagree with each other
67
+ - Keep your opinion in the Analysis section, not the Findings
68
+ - If the user asks for quick research, skip steps 3-4
69
+
70
+ ## Gotchas
71
+
72
+ - **Old data kills credibility.** A 2021 market size report is useless in 2026. Always check the publish date. Flag anything older than 18 months.
73
+ - **Press releases aren't research.** Company announcements are marketing. Cross-check with third-party sources, financial filings, or user data.
74
+ - **Conflicting sources are a feature, not a bug.** When two reports disagree, that's where the interesting analysis lives. Don't just pick one.
75
+ - **"I couldn't find data" is a valid finding.** Don't fill gaps with guesses. If the data doesn't exist, say so -- that's useful info for the user.
76
+ - **Synthesis > summary.** Listing 10 findings isn't research. Connect the dots -- what patterns emerge? What's the "so what?"
77
+
78
+ ## Output
79
+
80
+ Save to the project's `02-research/` folder.
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: design-intelligence
3
+ description: "Design system bootstrapping and token generation. Takes project context and outputs ready-to-use design tokens, Tailwind config, and CSS variables."
4
+ allowed_tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Glob
9
+ - Grep
10
+ - Bash
11
+ - WebSearch
12
+ ---
13
+
14
+ # Design Intelligence — Token Generation & Design System Bootstrapping
15
+
16
+ This skill helps set up design systems from scratch. Give it your project context (industry, brand, users) and it generates ready-to-use design tokens with Tailwind config snippets and CSS variable files.
17
+
18
+ ## When to Use
19
+
20
+ - Setting up a new project's design system (`/spartan:ux system`)
21
+ - Choosing color palettes for a specific industry/brand
22
+ - Generating typography scales
23
+ - Creating spacing systems
24
+ - Bootstrapping a component inventory
25
+
26
+ ## What This Skill Does
27
+
28
+ 1. Takes project context (what, who, industry, personality)
29
+ 2. Generates a complete design token set
30
+ 3. Outputs in 3 formats: token reference doc, Tailwind config, CSS variables
31
+ 4. Creates a component inventory based on the project type
32
+
33
+ ## How It Works
34
+
35
+ ### Step 1: Gather Context
36
+
37
+ Ask these questions (skip any the user already answered):
38
+
39
+ 1. **What are you building?** (dashboard, SaaS, marketplace, mobile app, landing page, etc.)
40
+ 2. **Who uses it?** (developers, business users, consumers, admins)
41
+ 3. **What's the personality?** Pick 2-3:
42
+ - Clean / Professional / Corporate
43
+ - Bold / Playful / Creative
44
+ - Minimal / Technical / Developer-focused
45
+ - Warm / Friendly / Approachable
46
+ - Premium / Luxury / Refined
47
+ - Data-heavy / Dense / Information-rich
48
+ 4. **Light, dark, or both?**
49
+ 5. **Any brand colors already decided?** (if yes, use those as the foundation)
50
+ 6. **Reference apps?** (apps that have the quality you want)
51
+
52
+ ### Step 2: Generate Color Palette
53
+
54
+ Based on the context, generate a complete palette:
55
+
56
+ **For dark themes:**
57
+ ```
58
+ Background: #0F172A (slate-900 family)
59
+ Surface: rgba(30, 41, 59, 0.5) (glass effect)
60
+ Primary: [based on personality — blue for professional, green for growth, etc.]
61
+ Primary Hover: [10% darker]
62
+ Accent: [complementary or analogous — use sparingly, max 10-15%]
63
+ Text: #F8FAFC (near white)
64
+ Text Secondary: #94A3B8 (slate-400)
65
+ Text Muted: #64748B (slate-500)
66
+ Border: rgba(148, 163, 184, 0.1)
67
+ Success: #22C55E
68
+ Warning: #F59E0B
69
+ Error: #EF4444
70
+ ```
71
+
72
+ **For light themes:**
73
+ ```
74
+ Background: #FFFFFF or #F8FAFC
75
+ Surface: #FFFFFF
76
+ Primary: [based on personality]
77
+ Primary Hover: [10% darker]
78
+ Accent: [complementary]
79
+ Text: #0F172A (near black)
80
+ Text Secondary: #475569 (slate-600)
81
+ Text Muted: #64748B (slate-500)
82
+ Border: #E2E8F0 (slate-200)
83
+ Success: #16A34A
84
+ Warning: #D97706
85
+ Error: #DC2626
86
+ ```
87
+
88
+ **Color selection by personality:**
89
+
90
+ | Personality | Primary range | Accent range |
91
+ |-------------|--------------|-------------|
92
+ | Professional / Corporate | Blue (#2563EB → #1E40AF) | Slate or Amber |
93
+ | Bold / Creative | Purple (#7C3AED), Pink (#EC4899) | Yellow or Cyan |
94
+ | Minimal / Technical | Gray (#374151), Black (#111827) | One bright accent |
95
+ | Warm / Friendly | Orange (#EA580C), Teal (#0D9488) | Amber or Rose |
96
+ | Premium / Luxury | Deep Blue (#1E3A5F), Gold (#B8860B) | Silver or Champagne |
97
+ | Data-heavy | Neutral blue (#3B82F6) | Green for positive, Red for negative |
98
+
99
+ ### Step 3: Generate Typography Scale
100
+
101
+ Pick a font pairing based on personality:
102
+
103
+ | Personality | Font recommendation | Why |
104
+ |-------------|-------------------|-----|
105
+ | Professional | DM Sans, Plus Jakarta Sans | Clean geometric, good for UI |
106
+ | Technical | JetBrains Mono (code) + Inter (UI) | Developer-friendly |
107
+ | Creative | Outfit, Space Grotesk | Distinctive but readable |
108
+ | Warm | Nunito, Quicksand | Rounded, friendly feel |
109
+ | Premium | Playfair Display (headings) + Lato (body) | Elegant contrast |
110
+ | Data-heavy | Inter, Roboto Mono (numbers) | Tabular nums, high readability |
111
+
112
+ **Type scale (base 16px):**
113
+ ```
114
+ h1: 36px / 700 / 1.2 line-height
115
+ h2: 30px / 700 / 1.25
116
+ h3: 24px / 600 / 1.3
117
+ h4: 20px / 600 / 1.35
118
+ h5: 18px / 600 / 1.4
119
+ h6: 16px / 600 / 1.4
120
+ body: 16px / 400 / 1.6
121
+ body-sm: 14px / 400 / 1.5
122
+ caption: 12px / 500 / 1.4
123
+ ```
124
+
125
+ ### Step 4: Generate Spacing & Radius
126
+
127
+ **Spacing scale (8px base):**
128
+ ```
129
+ xs: 4px (0.25rem)
130
+ sm: 8px (0.5rem)
131
+ md: 16px (1rem)
132
+ lg: 24px (1.5rem)
133
+ xl: 32px (2rem)
134
+ 2xl: 48px (3rem)
135
+ 3xl: 64px (4rem)
136
+ ```
137
+
138
+ **Radius by personality:**
139
+
140
+ | Personality | Card | Button | Badge | Input |
141
+ |-------------|------|--------|-------|-------|
142
+ | Professional | 8px | 6px | 4px | 6px |
143
+ | Minimal | 0-4px | 4px | 2px | 4px |
144
+ | Friendly | 12-16px | 8px | 9999px | 8px |
145
+ | Premium | 12px | 8px | 6px | 8px |
146
+
147
+ **Shadow by personality:**
148
+
149
+ | Personality | Style |
150
+ |-------------|-------|
151
+ | Professional | Subtle: `0 1px 3px rgba(0,0,0,0.1)` |
152
+ | Minimal | None or very subtle borders |
153
+ | Friendly | Soft: `0 4px 12px rgba(0,0,0,0.08)` |
154
+ | Premium | Layered: `0 1px 2px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.08)` |
155
+ | Dark theme | Glow: `0 0 20px rgba(primary, 0.15)` |
156
+
157
+ ### Step 5: Output in 3 Formats
158
+
159
+ #### Format 1: Token Reference Doc (`.planning/design/system/tokens.md`)
160
+
161
+ Human-readable markdown with all tokens, used by designers and all commands.
162
+
163
+ #### Format 2: Tailwind Config Snippet
164
+
165
+ ```typescript
166
+ // Paste into tailwind.config.ts → theme.extend
167
+ {
168
+ colors: {
169
+ primary: '[value]',
170
+ 'primary-hover': '[value]',
171
+ accent: '[value]',
172
+ background: '[value]',
173
+ surface: '[value]',
174
+ // ... all color tokens
175
+ },
176
+ fontFamily: {
177
+ sans: ['[font]', 'sans-serif'],
178
+ },
179
+ borderRadius: {
180
+ card: '[value]',
181
+ button: '[value]',
182
+ },
183
+ boxShadow: {
184
+ card: '[value]',
185
+ },
186
+ }
187
+ ```
188
+
189
+ #### Format 3: CSS Variables
190
+
191
+ ```css
192
+ :root {
193
+ /* Colors */
194
+ --color-primary: [value];
195
+ --color-primary-hover: [value];
196
+ --color-accent: [value];
197
+ --color-bg: [value];
198
+ --color-surface: [value];
199
+ --color-text: [value];
200
+ --color-text-secondary: [value];
201
+ --color-text-muted: [value];
202
+ --color-border: [value];
203
+ --color-success: [value];
204
+ --color-warning: [value];
205
+ --color-error: [value];
206
+
207
+ /* Typography */
208
+ --font-family: '[font]', sans-serif;
209
+ --font-size-h1: 36px;
210
+ /* ... full scale */
211
+
212
+ /* Spacing */
213
+ --space-xs: 4px;
214
+ --space-sm: 8px;
215
+ --space-md: 16px;
216
+ --space-lg: 24px;
217
+ --space-xl: 32px;
218
+
219
+ /* Radius */
220
+ --radius-card: [value];
221
+ --radius-button: [value];
222
+ --radius-badge: [value];
223
+
224
+ /* Shadows */
225
+ --shadow-sm: [value];
226
+ --shadow-md: [value];
227
+ --shadow-lg: [value];
228
+ }
229
+ ```
230
+
231
+ ### Step 6: Generate Component Inventory
232
+
233
+ Based on the project type, list the components needed:
234
+
235
+ **Dashboard / SaaS:**
236
+ - Sidebar navigation, Top bar, Stat cards, Data tables, Charts, Modals, Forms, Toast notifications, Dropdown menus, Badges, Avatars, Breadcrumbs
237
+
238
+ **Marketplace / E-commerce:**
239
+ - Product cards, Search bar, Filters, Cart, Checkout form, Reviews, Ratings, Image galleries, Price displays, Category navigation
240
+
241
+ **Mobile app:**
242
+ - Bottom tab bar, Pull-to-refresh, Swipeable cards, Action sheets, Floating action button, List items, Empty states, Onboarding screens
243
+
244
+ **Landing page:**
245
+ - Hero section, Feature grid, Testimonials, Pricing table, CTA buttons, Footer, Navigation, Social proof
246
+
247
+ Save component inventory to `.planning/design/system/components.md`.
248
+
249
+ ---
250
+
251
+ ## Design System Constraint for Code Generation
252
+
253
+ **When generating UI code and design tokens already exist:**
254
+
255
+ Read `.planning/design/system/tokens.md` or `.planning/design-config.md` FIRST. Your code MUST use these tokens. Do NOT use Tailwind defaults, generic colors, or made-up spacing.
256
+
257
+ Think of it like a jazz musician: the chord progression is set (tokens). Your job is to build beautifully within it. Don't change the key.
258
+
259
+ ---
260
+
261
+ ## Checklist Before Delivering
262
+
263
+ - [ ] All 3 output formats generated (token doc, Tailwind, CSS variables)
264
+ - [ ] Colors have enough contrast (4.5:1 for text)
265
+ - [ ] Typography scale is consistent and readable
266
+ - [ ] Spacing uses the grid (no arbitrary values)
267
+ - [ ] Component inventory matches project type
268
+ - [ ] design-config.md updated (if it existed before)