@hivehub/rulebook 5.5.2 → 5.7.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 (325) hide show
  1. package/.claude/commands/rulebook-learn-capture.md +41 -48
  2. package/.claude/commands/rulebook-learn-list.md +13 -13
  3. package/README.md +332 -394
  4. package/dist/cli/commands/context-intelligence.d.ts +0 -1
  5. package/dist/cli/commands/context-intelligence.d.ts.map +1 -1
  6. package/dist/cli/commands/context-intelligence.js +12 -33
  7. package/dist/cli/commands/context-intelligence.js.map +1 -1
  8. package/dist/cli/commands/index.d.ts +4 -7
  9. package/dist/cli/commands/index.d.ts.map +1 -1
  10. package/dist/cli/commands/index.js +4 -7
  11. package/dist/cli/commands/index.js.map +1 -1
  12. package/dist/cli/commands/init.d.ts.map +1 -1
  13. package/dist/cli/commands/init.js +40 -81
  14. package/dist/cli/commands/init.js.map +1 -1
  15. package/dist/cli/commands/mcp.d.ts +0 -1
  16. package/dist/cli/commands/mcp.d.ts.map +1 -1
  17. package/dist/cli/commands/mcp.js +1 -7
  18. package/dist/cli/commands/mcp.js.map +1 -1
  19. package/dist/cli/commands/memory.d.ts +7 -1
  20. package/dist/cli/commands/memory.d.ts.map +1 -1
  21. package/dist/cli/commands/memory.js +51 -57
  22. package/dist/cli/commands/memory.js.map +1 -1
  23. package/dist/cli/commands/misc.d.ts +1 -15
  24. package/dist/cli/commands/misc.d.ts.map +1 -1
  25. package/dist/cli/commands/misc.js +36 -215
  26. package/dist/cli/commands/misc.js.map +1 -1
  27. package/dist/cli/commands/plans.d.ts +0 -6
  28. package/dist/cli/commands/plans.d.ts.map +1 -1
  29. package/dist/cli/commands/plans.js +9 -77
  30. package/dist/cli/commands/plans.js.map +1 -1
  31. package/dist/cli/commands/skills.js +6 -6
  32. package/dist/cli/commands/skills.js.map +1 -1
  33. package/dist/cli/commands/task.js +4 -4
  34. package/dist/cli/commands/task.js.map +1 -1
  35. package/dist/cli/commands/update.d.ts.map +1 -1
  36. package/dist/cli/commands/update.js +122 -52
  37. package/dist/cli/commands/update.js.map +1 -1
  38. package/dist/cli/prompts.d.ts.map +1 -1
  39. package/dist/cli/prompts.js +1 -78
  40. package/dist/cli/prompts.js.map +1 -1
  41. package/dist/core/claude/claude-mcp.d.ts +59 -0
  42. package/dist/core/claude/claude-mcp.d.ts.map +1 -0
  43. package/dist/core/claude/claude-mcp.js +220 -0
  44. package/dist/core/claude/claude-mcp.js.map +1 -0
  45. package/dist/core/claude/claude-md-generator.d.ts +52 -0
  46. package/dist/core/claude/claude-md-generator.d.ts.map +1 -0
  47. package/dist/core/claude/claude-md-generator.js +104 -0
  48. package/dist/core/claude/claude-md-generator.js.map +1 -0
  49. package/dist/core/claude/claude-settings-manager.d.ts +44 -0
  50. package/dist/core/claude/claude-settings-manager.d.ts.map +1 -0
  51. package/dist/core/claude/claude-settings-manager.js +194 -0
  52. package/dist/core/claude/claude-settings-manager.js.map +1 -0
  53. package/dist/core/console/cli-bridge.d.ts +113 -0
  54. package/dist/core/console/cli-bridge.d.ts.map +1 -0
  55. package/dist/core/console/cli-bridge.js +1094 -0
  56. package/dist/core/console/cli-bridge.js.map +1 -0
  57. package/dist/core/detect/detector.d.ts +35 -0
  58. package/dist/core/detect/detector.d.ts.map +1 -0
  59. package/dist/core/detect/detector.js +541 -0
  60. package/dist/core/detect/detector.js.map +1 -0
  61. package/dist/core/docs/docs-generator.d.ts +9 -0
  62. package/dist/core/docs/docs-generator.d.ts.map +1 -0
  63. package/dist/core/docs/docs-generator.js +531 -0
  64. package/dist/core/docs/docs-generator.js.map +1 -0
  65. package/dist/core/docs/mcp-reference-generator.d.ts +13 -0
  66. package/dist/core/docs/mcp-reference-generator.d.ts.map +1 -0
  67. package/dist/core/docs/mcp-reference-generator.js +66 -0
  68. package/dist/core/docs/mcp-reference-generator.js.map +1 -0
  69. package/dist/core/generators/generator.d.ts +54 -0
  70. package/dist/core/generators/generator.d.ts.map +1 -0
  71. package/dist/core/generators/generator.js +1041 -0
  72. package/dist/core/generators/generator.js.map +1 -0
  73. package/dist/core/generators/gitignore-generator.d.ts +13 -0
  74. package/dist/core/generators/gitignore-generator.d.ts.map +1 -0
  75. package/dist/core/generators/gitignore-generator.js +307 -0
  76. package/dist/core/generators/gitignore-generator.js.map +1 -0
  77. package/dist/core/generators/minimal-scaffolder.d.ts +8 -0
  78. package/dist/core/generators/minimal-scaffolder.d.ts.map +1 -0
  79. package/dist/core/generators/minimal-scaffolder.js +51 -0
  80. package/dist/core/generators/minimal-scaffolder.js.map +1 -0
  81. package/dist/core/generators/rules-generator.d.ts +73 -0
  82. package/dist/core/generators/rules-generator.d.ts.map +1 -0
  83. package/dist/core/generators/rules-generator.js +202 -0
  84. package/dist/core/generators/rules-generator.js.map +1 -0
  85. package/dist/core/generators/workflow-generator.d.ts +15 -0
  86. package/dist/core/generators/workflow-generator.d.ts.map +1 -0
  87. package/dist/core/generators/workflow-generator.js +390 -0
  88. package/dist/core/generators/workflow-generator.js.map +1 -0
  89. package/dist/core/ide/multi-tool-generator.d.ts +59 -0
  90. package/dist/core/ide/multi-tool-generator.d.ts.map +1 -0
  91. package/dist/core/ide/multi-tool-generator.js +157 -0
  92. package/dist/core/ide/multi-tool-generator.js.map +1 -0
  93. package/dist/core/ide/opencode-generator.d.ts +72 -0
  94. package/dist/core/ide/opencode-generator.d.ts.map +1 -0
  95. package/dist/core/ide/opencode-generator.js +450 -0
  96. package/dist/core/ide/opencode-generator.js.map +1 -0
  97. package/dist/core/merger.d.ts +1 -1
  98. package/dist/core/merger.d.ts.map +1 -1
  99. package/dist/core/merger.js +5 -5
  100. package/dist/core/merger.js.map +1 -1
  101. package/dist/core/migrator.d.ts +0 -1
  102. package/dist/core/migrator.d.ts.map +1 -1
  103. package/dist/core/migrator.js +4 -29
  104. package/dist/core/migrator.js.map +1 -1
  105. package/dist/core/quality/coverage-checker.d.ts +14 -0
  106. package/dist/core/quality/coverage-checker.d.ts.map +1 -0
  107. package/dist/core/quality/coverage-checker.js +176 -0
  108. package/dist/core/quality/coverage-checker.js.map +1 -0
  109. package/dist/core/quality/dependency-checker.d.ts +21 -0
  110. package/dist/core/quality/dependency-checker.d.ts.map +1 -0
  111. package/dist/core/quality/dependency-checker.js +247 -0
  112. package/dist/core/quality/dependency-checker.js.map +1 -0
  113. package/dist/core/quality/doctor.d.ts +19 -0
  114. package/dist/core/quality/doctor.d.ts.map +1 -0
  115. package/dist/core/quality/doctor.js +163 -0
  116. package/dist/core/quality/doctor.js.map +1 -0
  117. package/dist/core/quality/validator.d.ts +21 -0
  118. package/dist/core/quality/validator.d.ts.map +1 -0
  119. package/dist/core/quality/validator.js +177 -0
  120. package/dist/core/quality/validator.js.map +1 -0
  121. package/dist/core/skills/skills-manager.d.ts +126 -0
  122. package/dist/core/skills/skills-manager.d.ts.map +1 -0
  123. package/dist/core/skills/skills-manager.js +630 -0
  124. package/dist/core/skills/skills-manager.js.map +1 -0
  125. package/dist/core/state/config-manager.d.ts +86 -0
  126. package/dist/core/state/config-manager.d.ts.map +1 -0
  127. package/dist/core/state/config-manager.js +562 -0
  128. package/dist/core/state/config-manager.js.map +1 -0
  129. package/dist/core/state/override-manager.d.ts +23 -0
  130. package/dist/core/state/override-manager.d.ts.map +1 -0
  131. package/dist/core/state/override-manager.js +82 -0
  132. package/dist/core/state/override-manager.js.map +1 -0
  133. package/dist/core/state/state-writer.d.ts +34 -0
  134. package/dist/core/state/state-writer.d.ts.map +1 -0
  135. package/dist/core/state/state-writer.js +78 -0
  136. package/dist/core/state/state-writer.js.map +1 -0
  137. package/dist/core/state/version-bumper.d.ts +19 -0
  138. package/dist/core/state/version-bumper.d.ts.map +1 -0
  139. package/dist/core/state/version-bumper.js +180 -0
  140. package/dist/core/state/version-bumper.js.map +1 -0
  141. package/dist/core/tasks/decision-manager.d.ts +25 -0
  142. package/dist/core/tasks/decision-manager.d.ts.map +1 -0
  143. package/dist/core/tasks/decision-manager.js +183 -0
  144. package/dist/core/tasks/decision-manager.js.map +1 -0
  145. package/dist/core/tasks/knowledge-manager.d.ts +24 -0
  146. package/dist/core/tasks/knowledge-manager.d.ts.map +1 -0
  147. package/dist/core/tasks/knowledge-manager.js +173 -0
  148. package/dist/core/tasks/knowledge-manager.js.map +1 -0
  149. package/dist/core/tasks/learn-manager.d.ts +27 -0
  150. package/dist/core/tasks/learn-manager.d.ts.map +1 -0
  151. package/dist/core/tasks/learn-manager.js +121 -0
  152. package/dist/core/tasks/learn-manager.js.map +1 -0
  153. package/dist/core/tasks/plans-manager.d.ts +46 -0
  154. package/dist/core/tasks/plans-manager.d.ts.map +1 -0
  155. package/dist/core/tasks/plans-manager.js +158 -0
  156. package/dist/core/tasks/plans-manager.js.map +1 -0
  157. package/dist/core/tasks/task-manager.d.ts +127 -0
  158. package/dist/core/tasks/task-manager.d.ts.map +1 -0
  159. package/dist/core/tasks/task-manager.js +607 -0
  160. package/dist/core/tasks/task-manager.js.map +1 -0
  161. package/dist/core/workspace/project-worker.d.ts +6 -6
  162. package/dist/core/workspace/project-worker.d.ts.map +1 -1
  163. package/dist/core/workspace/project-worker.js +6 -6
  164. package/dist/core/workspace/project-worker.js.map +1 -1
  165. package/dist/index.d.ts +1 -1
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js +19 -176
  168. package/dist/index.js.map +1 -1
  169. package/dist/mcp/rulebook-server.d.ts.map +1 -1
  170. package/dist/mcp/rulebook-server.js +16 -960
  171. package/dist/mcp/rulebook-server.js.map +1 -1
  172. package/dist/memory/file-search.d.ts +43 -0
  173. package/dist/memory/file-search.d.ts.map +1 -0
  174. package/dist/memory/file-search.js +228 -0
  175. package/dist/memory/file-search.js.map +1 -0
  176. package/dist/memory/file-store.d.ts +99 -0
  177. package/dist/memory/file-store.d.ts.map +1 -0
  178. package/dist/memory/file-store.js +615 -0
  179. package/dist/memory/file-store.js.map +1 -0
  180. package/dist/memory/legacy-migrator.d.ts +27 -0
  181. package/dist/memory/legacy-migrator.d.ts.map +1 -0
  182. package/dist/memory/legacy-migrator.js +185 -0
  183. package/dist/memory/legacy-migrator.js.map +1 -0
  184. package/dist/memory/memory-manager.d.ts +25 -24
  185. package/dist/memory/memory-manager.d.ts.map +1 -1
  186. package/dist/memory/memory-manager.js +97 -140
  187. package/dist/memory/memory-manager.js.map +1 -1
  188. package/dist/memory/memory-types.d.ts +1 -1
  189. package/dist/memory/memory-types.d.ts.map +1 -1
  190. package/dist/types.d.ts +8 -119
  191. package/dist/types.d.ts.map +1 -1
  192. package/package.json +1 -6
  193. package/templates/agents/context-intelligence.md +50 -52
  194. package/templates/cli/OPENCODE.md +85 -18
  195. package/templates/commands/rulebook-learn-capture.md +41 -48
  196. package/templates/commands/rulebook-learn-list.md +13 -13
  197. package/templates/core/AGENTS_LEAN.md +0 -14
  198. package/templates/hooks/check-context-and-handoff.sh +8 -10
  199. package/templates/hooks/enforce-pre-tool.sh +70 -0
  200. package/templates/hooks/terse-mode-tracker.sh +146 -143
  201. package/templates/ides/OPENCODE.md +63 -0
  202. package/templates/skills/cli/opencode/SKILL.md +82 -28
  203. package/.claude/commands/ralph-config.md +0 -112
  204. package/.claude/commands/ralph-history.md +0 -110
  205. package/.claude/commands/ralph-init.md +0 -72
  206. package/.claude/commands/ralph-pause-resume.md +0 -105
  207. package/.claude/commands/ralph-run.md +0 -101
  208. package/.claude/commands/ralph-status.md +0 -76
  209. package/templates/core/RALPH.md +0 -471
  210. package/templates/frameworks/ANGULAR.md +0 -36
  211. package/templates/frameworks/DJANGO.md +0 -83
  212. package/templates/frameworks/ELECTRON.md +0 -147
  213. package/templates/frameworks/FLASK.md +0 -38
  214. package/templates/frameworks/FLUTTER.md +0 -55
  215. package/templates/frameworks/JQUERY.md +0 -32
  216. package/templates/frameworks/LARAVEL.md +0 -38
  217. package/templates/frameworks/NESTJS.md +0 -43
  218. package/templates/frameworks/NEXTJS.md +0 -127
  219. package/templates/frameworks/NUXT.md +0 -40
  220. package/templates/frameworks/RAILS.md +0 -66
  221. package/templates/frameworks/REACT.md +0 -38
  222. package/templates/frameworks/REACT_NATIVE.md +0 -47
  223. package/templates/frameworks/SPRING.md +0 -39
  224. package/templates/frameworks/SYMFONY.md +0 -36
  225. package/templates/frameworks/VUE.md +0 -36
  226. package/templates/frameworks/ZEND.md +0 -35
  227. package/templates/hooks/enforce-mcp-for-tasks.sh +0 -31
  228. package/templates/hooks/enforce-no-deferred.sh +0 -21
  229. package/templates/hooks/enforce-no-shortcuts.sh +0 -31
  230. package/templates/ides/COPILOT.md +0 -37
  231. package/templates/ides/CURSOR.md +0 -43
  232. package/templates/ides/JETBRAINS_AI.md +0 -35
  233. package/templates/ides/REPLIT.md +0 -36
  234. package/templates/ides/TABNINE.md +0 -29
  235. package/templates/ides/VSCODE.md +0 -40
  236. package/templates/ides/WINDSURF.md +0 -36
  237. package/templates/ides/ZED.md +0 -32
  238. package/templates/ides/cursor-mdc/go.mdc +0 -24
  239. package/templates/ides/cursor-mdc/python.mdc +0 -24
  240. package/templates/ides/cursor-mdc/quality.mdc +0 -25
  241. package/templates/ides/cursor-mdc/ralph.mdc +0 -39
  242. package/templates/ides/cursor-mdc/rulebook.mdc +0 -38
  243. package/templates/ides/cursor-mdc/rust.mdc +0 -24
  244. package/templates/ides/cursor-mdc/typescript.mdc +0 -25
  245. package/templates/ralph/ralph-history.bat +0 -4
  246. package/templates/ralph/ralph-history.sh +0 -5
  247. package/templates/ralph/ralph-init.bat +0 -5
  248. package/templates/ralph/ralph-init.sh +0 -5
  249. package/templates/ralph/ralph-pause.bat +0 -5
  250. package/templates/ralph/ralph-pause.sh +0 -5
  251. package/templates/ralph/ralph-run.bat +0 -5
  252. package/templates/ralph/ralph-run.sh +0 -5
  253. package/templates/ralph/ralph-status.bat +0 -4
  254. package/templates/ralph/ralph-status.sh +0 -5
  255. package/templates/services/AZURE_BLOB.md +0 -184
  256. package/templates/services/CASSANDRA.md +0 -239
  257. package/templates/services/DATADOG.md +0 -26
  258. package/templates/services/DOCKER.md +0 -124
  259. package/templates/services/DOCKER_COMPOSE.md +0 -168
  260. package/templates/services/DYNAMODB.md +0 -308
  261. package/templates/services/ELASTICSEARCH.md +0 -347
  262. package/templates/services/GCS.md +0 -178
  263. package/templates/services/HELM.md +0 -194
  264. package/templates/services/INFLUXDB.md +0 -265
  265. package/templates/services/KAFKA.md +0 -341
  266. package/templates/services/KUBERNETES.md +0 -208
  267. package/templates/services/MARIADB.md +0 -183
  268. package/templates/services/MEMCACHED.md +0 -242
  269. package/templates/services/MINIO.md +0 -201
  270. package/templates/services/MONGODB.md +0 -268
  271. package/templates/services/MYSQL.md +0 -358
  272. package/templates/services/NEO4J.md +0 -247
  273. package/templates/services/OPENTELEMETRY.md +0 -25
  274. package/templates/services/ORACLE.md +0 -290
  275. package/templates/services/PINO.md +0 -24
  276. package/templates/services/POSTGRESQL.md +0 -326
  277. package/templates/services/PROMETHEUS.md +0 -33
  278. package/templates/services/RABBITMQ.md +0 -286
  279. package/templates/services/REDIS.md +0 -292
  280. package/templates/services/S3.md +0 -298
  281. package/templates/services/SENTRY.md +0 -23
  282. package/templates/services/SQLITE.md +0 -294
  283. package/templates/services/SQLSERVER.md +0 -294
  284. package/templates/services/WINSTON.md +0 -30
  285. package/templates/skills/frameworks/angular/SKILL.md +0 -46
  286. package/templates/skills/frameworks/django/SKILL.md +0 -93
  287. package/templates/skills/frameworks/electron/SKILL.md +0 -157
  288. package/templates/skills/frameworks/flask/SKILL.md +0 -48
  289. package/templates/skills/frameworks/flutter/SKILL.md +0 -65
  290. package/templates/skills/frameworks/jquery/SKILL.md +0 -42
  291. package/templates/skills/frameworks/laravel/SKILL.md +0 -48
  292. package/templates/skills/frameworks/nestjs/SKILL.md +0 -53
  293. package/templates/skills/frameworks/nextjs/SKILL.md +0 -137
  294. package/templates/skills/frameworks/nuxt/SKILL.md +0 -50
  295. package/templates/skills/frameworks/rails/SKILL.md +0 -76
  296. package/templates/skills/frameworks/react/SKILL.md +0 -48
  297. package/templates/skills/frameworks/react-native/SKILL.md +0 -57
  298. package/templates/skills/frameworks/spring/SKILL.md +0 -49
  299. package/templates/skills/frameworks/symfony/SKILL.md +0 -46
  300. package/templates/skills/frameworks/vue/SKILL.md +0 -46
  301. package/templates/skills/frameworks/zend/SKILL.md +0 -45
  302. package/templates/skills/services/azure-blob/SKILL.md +0 -194
  303. package/templates/skills/services/cassandra/SKILL.md +0 -249
  304. package/templates/skills/services/dynamodb/SKILL.md +0 -318
  305. package/templates/skills/services/elasticsearch/SKILL.md +0 -357
  306. package/templates/skills/services/gcs/SKILL.md +0 -188
  307. package/templates/skills/services/influxdb/SKILL.md +0 -275
  308. package/templates/skills/services/kafka/SKILL.md +0 -351
  309. package/templates/skills/services/mariadb/SKILL.md +0 -193
  310. package/templates/skills/services/memcached/SKILL.md +0 -252
  311. package/templates/skills/services/minio/SKILL.md +0 -211
  312. package/templates/skills/services/mongodb/SKILL.md +0 -278
  313. package/templates/skills/services/mysql/SKILL.md +0 -368
  314. package/templates/skills/services/neo4j/SKILL.md +0 -257
  315. package/templates/skills/services/oracle/SKILL.md +0 -300
  316. package/templates/skills/services/postgresql/SKILL.md +0 -336
  317. package/templates/skills/services/rabbitmq/SKILL.md +0 -296
  318. package/templates/skills/services/redis/SKILL.md +0 -302
  319. package/templates/skills/services/s3/SKILL.md +0 -308
  320. package/templates/skills/services/sqlite/SKILL.md +0 -304
  321. package/templates/skills/services/sqlserver/SKILL.md +0 -304
  322. package/templates/skills/workflows/ralph/SETUP.md +0 -228
  323. package/templates/skills/workflows/ralph/SKILL.md +0 -309
  324. package/templates/skills/workflows/ralph/install.sh +0 -87
  325. package/templates/skills/workflows/ralph/manifest.json +0 -158
@@ -1,147 +0,0 @@
1
- <!-- ELECTRON:START -->
2
- # Electron Framework Rules
3
-
4
- **Language**: TypeScript, JavaScript
5
- **Version**: Electron 28+
6
-
7
- ## Setup & Configuration
8
-
9
- ```typescript
10
- // main.ts (Main Process)
11
- import { app, BrowserWindow } from 'electron'
12
- import path from 'path'
13
-
14
- function createWindow() {
15
- const win = new BrowserWindow({
16
- width: 1200,
17
- height: 800,
18
- webPreferences: {
19
- preload: path.join(__dirname, 'preload.js'),
20
- contextIsolation: true,
21
- nodeIntegration: false,
22
- },
23
- })
24
-
25
- win.loadFile('index.html')
26
- }
27
-
28
- app.whenReady().then(createWindow)
29
- ```
30
-
31
- ## Quality Gates
32
-
33
- ```bash
34
- # Type check
35
- npm run type-check
36
-
37
- # Lint
38
- npm run lint
39
-
40
- # Tests
41
- npm test
42
-
43
- # Build
44
- npm run build # Compile TypeScript
45
- npm run package # Package app
46
- npm run make # Create distributables
47
- ```
48
-
49
- ## Best Practices
50
-
51
- ✅ **DO:**
52
- - Use contextIsolation: true
53
- - Disable nodeIntegration
54
- - Use preload scripts for IPC
55
- - Implement auto-updates (electron-updater)
56
- - Sign and notarize apps (production)
57
- - Use Content Security Policy
58
- - Implement proper error handling
59
- - Separate main and renderer processes
60
-
61
- ❌ **DON'T:**
62
- - Enable nodeIntegration in renderer
63
- - Skip contextIsolation
64
- - Use remote module (deprecated)
65
- - Ignore security warnings
66
- - Skip code signing
67
- - Load remote content without CSP
68
- - Use synchronous IPC
69
- - Hardcode credentials
70
-
71
- ## Project Structure
72
-
73
- ```
74
- src/
75
- ├── main/
76
- │ ├── main.ts # Main process
77
- │ ├── preload.ts # Preload script
78
- │ └── ipc/ # IPC handlers
79
- ├── renderer/
80
- │ ├── index.html
81
- │ ├── renderer.ts
82
- │ └── components/
83
- └── shared/
84
- └── types.ts
85
- ```
86
-
87
- ## IPC Communication
88
-
89
- ```typescript
90
- // preload.ts
91
- import { contextBridge, ipcRenderer } from 'electron'
92
-
93
- contextBridge.exposeInMainWorld('electronAPI', {
94
- sendMessage: (message: string) => ipcRenderer.send('message', message),
95
- onReply: (callback: (reply: string) => void) =>
96
- ipcRenderer.on('reply', (_event, reply) => callback(reply)),
97
- })
98
-
99
- // main.ts
100
- import { ipcMain } from 'electron'
101
-
102
- ipcMain.on('message', (event, message) => {
103
- console.log(message)
104
- event.reply('reply', 'Message received')
105
- })
106
-
107
- // renderer.ts
108
- declare global {
109
- interface Window {
110
- electronAPI: {
111
- sendMessage: (message: string) => void
112
- onReply: (callback: (reply: string) => void) => void
113
- }
114
- }
115
- }
116
-
117
- window.electronAPI.sendMessage('Hello from renderer')
118
- window.electronAPI.onReply((reply) => console.log(reply))
119
- ```
120
-
121
- ## Security Checklist
122
-
123
- ```typescript
124
- // ✅ Good security configuration
125
- const win = new BrowserWindow({
126
- webPreferences: {
127
- contextIsolation: true, // ✅ MUST enable
128
- nodeIntegration: false, // ✅ MUST disable
129
- sandbox: true, // ✅ Enable sandbox
130
- webSecurity: true, // ✅ Enable web security
131
- allowRunningInsecureContent: false, // ✅ Block insecure content
132
- },
133
- })
134
-
135
- // Content Security Policy
136
- session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
137
- callback({
138
- responseHeaders: {
139
- ...details.responseHeaders,
140
- 'Content-Security-Policy': ["default-src 'self'"]
141
- }
142
- })
143
- })
144
- ```
145
-
146
- <!-- ELECTRON:END -->
147
-
@@ -1,38 +0,0 @@
1
- <!-- FLASK:START -->
2
- # Flask Framework Rules
3
-
4
- **Language**: Python
5
- **Version**: Flask 3.0+
6
-
7
- ## Setup
8
-
9
- ```python
10
- from flask import Flask
11
- app = Flask(__name__)
12
- app.config.from_object('config.ProductionConfig')
13
-
14
- # Use Flask-SQLAlchemy for ORM
15
- # Use Flask-Migrate for migrations
16
- # Use Flask-Login for auth
17
- ```
18
-
19
- ## Quality Gates
20
-
21
- ```bash
22
- black .
23
- ruff check .
24
- pytest --cov=app
25
- ```
26
-
27
- ## Best Practices
28
-
29
- ✅ Use application factory pattern
30
- ✅ Enable CORS properly
31
- ✅ Use blueprints for organization
32
- ✅ Implement error handlers
33
-
34
- ❌ Don't use `debug=True` in production
35
- ❌ Don't store secrets in code
36
-
37
- <!-- FLASK:END -->
38
-
@@ -1,55 +0,0 @@
1
- <!-- FLUTTER:START -->
2
- # Flutter Framework Rules
3
-
4
- **Language**: Dart
5
- **Version**: Flutter 3.10+
6
-
7
- ## Setup
8
-
9
- ```yaml
10
- # pubspec.yaml
11
- dependencies:
12
- flutter:
13
- sdk: flutter
14
- cupertino_icons: ^1.0.2
15
-
16
- dev_dependencies:
17
- flutter_test:
18
- sdk: flutter
19
- flutter_lints: ^2.0.0
20
- ```
21
-
22
- ## Quality Gates
23
-
24
- ```bash
25
- dart format --set-exit-if-changed .
26
- dart analyze --fatal-infos
27
- flutter test
28
- flutter build apk --release # Test build
29
- ```
30
-
31
- ## Best Practices
32
-
33
- ✅ Use StatelessWidget when possible
34
- ✅ Implement proper state management (Provider, Riverpod, Bloc)
35
- ✅ Use const constructors
36
- ✅ Optimize widget rebuilds
37
- ✅ Test on multiple devices
38
-
39
- ❌ Don't use `print()` in production
40
- ❌ Don't skip null safety
41
- ❌ Don't ignore platform differences
42
-
43
- ## Project Structure
44
-
45
- ```
46
- lib/
47
- ├── main.dart
48
- ├── models/
49
- ├── screens/
50
- ├── widgets/
51
- └── services/
52
- ```
53
-
54
- <!-- FLUTTER:END -->
55
-
@@ -1,32 +0,0 @@
1
- <!-- JQUERY:START -->
2
- # jQuery Framework Rules
3
-
4
- **Language**: JavaScript
5
- **Version**: jQuery 3.x+
6
-
7
- ## Setup
8
-
9
- ```html
10
- <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
11
- ```
12
-
13
- ## Best Practices
14
-
15
- ✅ Use modern JS alongside jQuery
16
- ✅ Minimize DOM manipulation
17
- ✅ Cache jQuery selectors
18
- ✅ Use event delegation
19
-
20
- ❌ Don't use jQuery for everything
21
- ❌ Don't pollute global scope
22
- ❌ Don't skip CSP headers
23
-
24
- ## Quality Gates
25
-
26
- ```bash
27
- eslint src/**/*.js
28
- jest
29
- ```
30
-
31
- <!-- JQUERY:END -->
32
-
@@ -1,38 +0,0 @@
1
- <!-- LARAVEL:START -->
2
- # Laravel Framework Rules
3
-
4
- **CRITICAL**: Laravel services must respect these conventions and quality checks.
5
-
6
- ## Quality Commands
7
- - Static analysis: `./vendor/bin/pint --test`
8
- - Lint style: `./vendor/bin/phpcs --standard=PSR12 app/`
9
- - Unit tests: `php artisan test`
10
- - Feature tests: `php artisan test --testsuite=Feature`
11
- - Coverage: ensure `php artisan test --coverage` ≥ 80%
12
-
13
- ## Project Structure
14
- - Keep HTTP controllers in `app/Http/Controllers`
15
- - Use form requests for validation in `app/Http/Requests`
16
- - Organize business logic in `app/Services`
17
- - Leverage repositories for data persistence where appropriate
18
- - Store queued jobs in `app/Jobs`
19
-
20
- ## Implementation Guidelines
21
- - Use migrations for every schema change (`php artisan make:migration`)
22
- - Keep Eloquent models lean; move heavy logic into services
23
- - Cache configuration after deployment (`php artisan config:cache`)
24
- - Register scheduled tasks in `app/Console/Kernel.php`
25
- - Ensure `app/Providers` registers new bindings/events
26
-
27
- ## Composer Hygiene
28
- ```bash
29
- composer install --no-dev --prefer-dist
30
- composer dump-autoload
31
- ```
32
-
33
- ## Additional Checks
34
- - Sync `.env.example` whenever new variables are introduced
35
- - Document API changes in `/docs/laravel-api.md`
36
- - Generate API resources via `php artisan make:resource`
37
-
38
- <!-- LARAVEL:END -->
@@ -1,43 +0,0 @@
1
- <!-- NESTJS:START -->
2
- # NestJS Framework Rules
3
-
4
- **CRITICAL**: Align all NestJS services, modules, and controllers with these conventions.
5
-
6
- ## Project Structure
7
- - Maintain feature-first modules under `src/<feature>/`
8
- - Keep global providers in `src/common/`
9
- - Register new modules in `AppModule` and ensure dependency injection consistency
10
- - Prefer `@nestjs/config` for environment configuration
11
-
12
- ## Quality Gates
13
- - Lint: `npm run lint`
14
- - Unit tests: `npm run test`
15
- - e2e tests: `npm run test:e2e`
16
- - Build validation: `npm run build`
17
- - Coverage threshold: **80%+** for service and controller layers
18
-
19
- ## Implementation Guidelines
20
- - Use DTOs with `class-validator` and `class-transformer`
21
- - Encapsulate database access in providers (avoid direct repository use in controllers)
22
- - Document routes with `@nestjs/swagger` when OpenAPI is enabled
23
- - Keep asynchronous logic wrapped with `try/catch` and map errors to HTTP exceptions
24
-
25
- ## Scripts to Run Before Commit
26
- ```bash
27
- npm run lint
28
- npm run test
29
- npm run test:e2e
30
- npm run build
31
- ```
32
-
33
- ## Additional Checks
34
- - Ensure Circular Dependency detection is clean (`npm run lint -- --max-warnings=0`)
35
- - Synchronize `.env.example` with actual required variables
36
- - Maintain aligned versions for Nest core packages (`@nestjs/*`)
37
-
38
- ## Documentation
39
- - Update `/docs/architecture.md` with new modules and providers
40
- - Keep OpenAPI spec regenerated via `npm run swagger:generate`
41
- - Log breaking changes in `CHANGELOG.md`
42
-
43
- <!-- NESTJS:END -->
@@ -1,127 +0,0 @@
1
- <!-- NEXTJS:START -->
2
- # Next.js Framework Rules
3
-
4
- **Language**: TypeScript, JavaScript
5
- **Version**: Next.js 14+ (App Router)
6
-
7
- ## Setup & Configuration
8
-
9
- ```typescript
10
- // next.config.ts
11
- import type { NextConfig } from 'next'
12
-
13
- const nextConfig: NextConfig = {
14
- reactStrictMode: true,
15
- images: {
16
- domains: ['your-domain.com'],
17
- },
18
- env: {
19
- CUSTOM_KEY: process.env.CUSTOM_KEY,
20
- },
21
- }
22
-
23
- export default nextConfig
24
- ```
25
-
26
- ## Quality Gates
27
-
28
- ```bash
29
- # Type check
30
- npm run type-check # or: tsc --noEmit
31
-
32
- # Lint
33
- npm run lint # Next.js ESLint
34
-
35
- # Format
36
- npx prettier --check "**/*.{ts,tsx}"
37
-
38
- # Tests
39
- npm test # Vitest or Jest
40
-
41
- # Build
42
- npm run build # Must succeed
43
-
44
- # Check bundle size
45
- npm run build && npx @next/bundle-analyzer
46
- ```
47
-
48
- ## Best Practices
49
-
50
- ✅ **DO:**
51
- - Use App Router (app/) for new projects
52
- - Implement Server Components by default
53
- - Use Client Components ('use client') only when needed
54
- - Optimize images with next/image
55
- - Use dynamic imports for code splitting
56
- - Implement proper metadata/SEO
57
- - Use Server Actions for mutations
58
- - Enable React Strict Mode
59
-
60
- ❌ **DON'T:**
61
- - Use getServerSideProps/getStaticProps in App Router
62
- - Fetch on client when server fetch is better
63
- - Skip image optimization
64
- - Ignore bundle size
65
- - Use 'use client' everywhere
66
- - Hardcode API URLs
67
- - Skip error boundaries
68
-
69
- ## Project Structure (App Router)
70
-
71
- ```
72
- app/
73
- ├── layout.tsx # Root layout
74
- ├── page.tsx # Home page
75
- ├── (routes)/
76
- │ ├── dashboard/
77
- │ │ ├── layout.tsx
78
- │ │ └── page.tsx
79
- │ └── api/
80
- │ └── users/
81
- │ └── route.ts
82
- ├── components/
83
- ├── lib/
84
- └── types/
85
- ```
86
-
87
- ## Server vs Client Components
88
-
89
- ```typescript
90
- // Server Component (default)
91
- async function ServerComponent() {
92
- const data = await fetch('https://api.example.com/data')
93
- return <div>{data}</div>
94
- }
95
-
96
- // Client Component
97
- 'use client'
98
- import { useState } from 'react'
99
-
100
- function ClientComponent() {
101
- const [count, setCount] = useState(0)
102
- return <button onClick={() => setCount(count + 1)}>{count}</button>
103
- }
104
- ```
105
-
106
- ## Route Handlers (API Routes)
107
-
108
- ```typescript
109
- // app/api/users/route.ts
110
- import { NextRequest, NextResponse } from 'next/server'
111
-
112
- export async function GET(request: NextRequest) {
113
- const searchParams = request.nextUrl.searchParams
114
- const id = searchParams.get('id')
115
-
116
- return NextResponse.json({ id })
117
- }
118
-
119
- export async function POST(request: NextRequest) {
120
- const body = await request.json()
121
- // Handle POST
122
- return NextResponse.json({ success: true })
123
- }
124
- ```
125
-
126
- <!-- NEXTJS:END -->
127
-
@@ -1,40 +0,0 @@
1
- <!-- NUXT:START -->
2
- # Nuxt Framework Rules
3
-
4
- **CRITICAL**: Nuxt 3 applications must keep these standards to ensure SSR quality.
5
-
6
- ## Quality Commands
7
- - Lint: `npm run lint`
8
- - Type check: `npm run type-check`
9
- - Unit tests: `npm run test`
10
- - Build for production: `npm run build`
11
- - Generate static output (if applicable): `npm run generate`
12
-
13
- ## Project Structure
14
- - Define routes with file-based routing under `pages/`
15
- - Keep server API handlers within `server/api/`
16
- - Organize composables in `composables/`
17
- - Place reusable UI components in `components/`
18
- - Store state via Pinia modules in `stores/`
19
-
20
- ## Implementation Guidelines
21
- - Use runtime config via `useRuntimeConfig()` for secrets
22
- - SSR-safe operations only inside `onServerPrefetch`/server routes
23
- - Prefer `definePageMeta` to control page-level features
24
- - Maintain i18n messages in `/locales`
25
- - Cache heavy computations with Nitro storage if needed
26
-
27
- ## Pre-Commit Commands
28
- ```bash
29
- npm run lint
30
- npm run type-check
31
- npm run test
32
- npm run build
33
- ```
34
-
35
- ## Documentation
36
- - Keep `/docs/nuxt-architecture.md` current with route layout and middleware
37
- - Document server API contracts in `/docs/api.md`
38
- - Capture deployment steps (SSR vs static) in `/docs/deployment.md`
39
-
40
- <!-- NUXT:END -->
@@ -1,66 +0,0 @@
1
- <!-- RAILS:START -->
2
- # Ruby on Rails Framework Rules
3
-
4
- **Language**: Ruby
5
- **Version**: Rails 7.0+
6
-
7
- ## Setup & Configuration
8
-
9
- ```ruby
10
- # config/database.yml
11
- production:
12
- url: <%= ENV['DATABASE_URL'] %>
13
-
14
- # config/environments/production.rb
15
- config.force_ssl = true
16
- config.log_level = :info
17
- ```
18
-
19
- ## Quality Gates
20
-
21
- ```bash
22
- # Code quality
23
- bundle exec rubocop # Lint
24
- bundle exec brakeman # Security scan
25
-
26
- # Tests
27
- bundle exec rspec # Run tests
28
- bundle exec rspec --format documentation # Verbose
29
-
30
- # Type check (optional)
31
- bundle exec steep check # Static typing
32
- ```
33
-
34
- ## Best Practices
35
-
36
- ✅ **DO:**
37
- - Use strong parameters
38
- - Implement authentication (Devise/custom)
39
- - Use ActiveRecord callbacks sparingly
40
- - Write RSpec/Minitest tests
41
- - Use database migrations
42
- - Enable CSRF protection
43
-
44
- ❌ **DON'T:**
45
- - Skip validations in models
46
- - Use `params` without permit
47
- - Store secrets in code
48
- - Skip database indexes
49
- - Ignore N+1 queries
50
-
51
- ## Project Structure
52
-
53
- ```
54
- app/
55
- ├── controllers/
56
- ├── models/
57
- ├── views/
58
- ├── jobs/
59
- └── mailers/
60
- config/
61
- db/
62
- spec/
63
- ```
64
-
65
- <!-- RAILS:END -->
66
-
@@ -1,38 +0,0 @@
1
- <!-- REACT:START -->
2
- # React Framework Rules
3
-
4
- **CRITICAL**: React applications must comply with these quality bars.
5
-
6
- ## Quality Commands
7
- - Lint & type check: `npm run lint` + `npm run type-check`
8
- - Unit/integration tests: `npm run test -- --watch=false`
9
- - Build: `npm run build`
10
- - Bundle analysis (optional): `npm run analyze`
11
-
12
- ## Project Structure
13
- - Group features under `src/features/<name>/`
14
- - Maintain shared UI primitives in `src/components`
15
- - Keep hooks in `src/hooks`
16
- - Centralize state management in `src/state` (Redux/Zustand/Recoil)
17
-
18
- ## Implementation Guidelines
19
- - Use TypeScript everywhere (no implicit `any`)
20
- - Prefer functional components with hooks
21
- - Co-locate component tests as `<Component>.test.tsx`
22
- - Use React Query/SWR for server state, keep caches invalidated on mutations
23
- - Wrap new pages with error boundaries and suspense where needed
24
-
25
- ## Pre-Commit Checklist
26
- ```bash
27
- npm run lint
28
- npm run type-check
29
- npm run test -- --watch=false
30
- npm run build
31
- ```
32
-
33
- ## Documentation
34
- - Update `/docs/react-architecture.md` when routes or global providers change
35
- - Record reusable components in Storybook or `/docs/ui-components.md`
36
- - Capture performance regressions in `/docs/performance.md`
37
-
38
- <!-- REACT:END -->
@@ -1,47 +0,0 @@
1
- <!-- REACT_NATIVE:START -->
2
- # React Native Framework Rules
3
-
4
- **Language**: JavaScript, TypeScript
5
- **Version**: React Native 0.72+
6
-
7
- ## Setup
8
-
9
- ```bash
10
- npx react-native init MyApp --template react-native-template-typescript
11
- ```
12
-
13
- ## Quality Gates
14
-
15
- ```bash
16
- npm run lint
17
- npm run type-check
18
- npm test
19
- npm run android # Test build
20
- npm run ios # Test build
21
- ```
22
-
23
- ## Best Practices
24
-
25
- ✅ Use TypeScript
26
- ✅ Implement proper navigation (React Navigation)
27
- ✅ Use platform-specific code when needed
28
- ✅ Optimize images and assets
29
- ✅ Test on both iOS and Android
30
-
31
- ❌ Don't hardcode dimensions
32
- ❌ Don't skip accessibility
33
- ❌ Don't ignore memory leaks
34
-
35
- ## Project Structure
36
-
37
- ```
38
- src/
39
- ├── components/
40
- ├── screens/
41
- ├── navigation/
42
- ├── services/
43
- └── utils/
44
- ```
45
-
46
- <!-- REACT_NATIVE:END -->
47
-