oh-my-customcode 0.12.1 → 0.12.2

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 (130) hide show
  1. package/README.md +4 -8
  2. package/dist/cli/index.js +137 -336
  3. package/dist/index.js +99 -260
  4. package/package.json +2 -4
  5. package/templates/.codex/agents/arch-documenter.md +0 -33
  6. package/templates/.codex/agents/arch-speckit-agent.md +0 -47
  7. package/templates/.codex/agents/be-express-expert.md +0 -30
  8. package/templates/.codex/agents/be-fastapi-expert.md +0 -43
  9. package/templates/.codex/agents/be-go-backend-expert.md +0 -43
  10. package/templates/.codex/agents/be-nestjs-expert.md +0 -28
  11. package/templates/.codex/agents/be-springboot-expert.md +0 -40
  12. package/templates/.codex/agents/db-postgres-expert.md +0 -36
  13. package/templates/.codex/agents/db-redis-expert.md +0 -36
  14. package/templates/.codex/agents/db-supabase-expert.md +0 -35
  15. package/templates/.codex/agents/de-airflow-expert.md +0 -34
  16. package/templates/.codex/agents/de-dbt-expert.md +0 -34
  17. package/templates/.codex/agents/de-kafka-expert.md +0 -81
  18. package/templates/.codex/agents/de-pipeline-expert.md +0 -32
  19. package/templates/.codex/agents/de-snowflake-expert.md +0 -36
  20. package/templates/.codex/agents/de-spark-expert.md +0 -36
  21. package/templates/.codex/agents/fe-svelte-agent.md +0 -29
  22. package/templates/.codex/agents/fe-vercel-agent.md +0 -37
  23. package/templates/.codex/agents/fe-vuejs-agent.md +0 -30
  24. package/templates/.codex/agents/infra-aws-expert.md +0 -47
  25. package/templates/.codex/agents/infra-docker-expert.md +0 -47
  26. package/templates/.codex/agents/lang-golang-expert.md +0 -43
  27. package/templates/.codex/agents/lang-java21-expert.md +0 -39
  28. package/templates/.codex/agents/lang-kotlin-expert.md +0 -43
  29. package/templates/.codex/agents/lang-python-expert.md +0 -43
  30. package/templates/.codex/agents/lang-rust-expert.md +0 -43
  31. package/templates/.codex/agents/lang-typescript-expert.md +0 -43
  32. package/templates/.codex/agents/mgr-claude-code-bible.md +0 -58
  33. package/templates/.codex/agents/mgr-creator.md +0 -39
  34. package/templates/.codex/agents/mgr-gitnerd.md +0 -45
  35. package/templates/.codex/agents/mgr-sauron.md +0 -161
  36. package/templates/.codex/agents/mgr-supplier.md +0 -35
  37. package/templates/.codex/agents/mgr-sync-checker.md +0 -38
  38. package/templates/.codex/agents/mgr-updater.md +0 -33
  39. package/templates/.codex/agents/qa-engineer.md +0 -32
  40. package/templates/.codex/agents/qa-planner.md +0 -73
  41. package/templates/.codex/agents/qa-writer.md +0 -27
  42. package/templates/.codex/agents/sys-memory-keeper.md +0 -43
  43. package/templates/.codex/agents/sys-naggy.md +0 -37
  44. package/templates/.codex/agents/tool-bun-expert.md +0 -26
  45. package/templates/.codex/agents/tool-npm-expert.md +0 -30
  46. package/templates/.codex/agents/tool-optimizer.md +0 -34
  47. package/templates/.codex/codex-native-hash.txt +0 -1
  48. package/templates/.codex/contexts/dev.md +0 -20
  49. package/templates/.codex/contexts/ecomode.md +0 -63
  50. package/templates/.codex/contexts/index.yaml +0 -41
  51. package/templates/.codex/contexts/research.md +0 -28
  52. package/templates/.codex/contexts/review.md +0 -23
  53. package/templates/.codex/hooks/hooks.json +0 -150
  54. package/templates/.codex/install-hooks.sh +0 -100
  55. package/templates/.codex/rules/MAY-optimization.md +0 -29
  56. package/templates/.codex/rules/MUST-agent-design.md +0 -57
  57. package/templates/.codex/rules/MUST-agent-identification.md +0 -29
  58. package/templates/.codex/rules/MUST-continuous-improvement.md +0 -25
  59. package/templates/.codex/rules/MUST-intent-transparency.md +0 -42
  60. package/templates/.codex/rules/MUST-language-policy.md +0 -27
  61. package/templates/.codex/rules/MUST-orchestrator-coordination.md +0 -128
  62. package/templates/.codex/rules/MUST-parallel-execution.md +0 -97
  63. package/templates/.codex/rules/MUST-permissions.md +0 -30
  64. package/templates/.codex/rules/MUST-safety.md +0 -23
  65. package/templates/.codex/rules/MUST-sync-verification.md +0 -125
  66. package/templates/.codex/rules/MUST-tool-identification.md +0 -82
  67. package/templates/.codex/rules/SHOULD-agent-teams.md +0 -39
  68. package/templates/.codex/rules/SHOULD-ecomode.md +0 -37
  69. package/templates/.codex/rules/SHOULD-error-handling.md +0 -33
  70. package/templates/.codex/rules/SHOULD-hud-statusline.md +0 -32
  71. package/templates/.codex/rules/SHOULD-interaction.md +0 -34
  72. package/templates/.codex/rules/SHOULD-memory-integration.md +0 -39
  73. package/templates/.codex/rules/index.yaml +0 -141
  74. package/templates/.codex/skills/airflow-best-practices/SKILL.md +0 -56
  75. package/templates/.codex/skills/audit-agents/SKILL.md +0 -116
  76. package/templates/.codex/skills/aws-best-practices/SKILL.md +0 -280
  77. package/templates/.codex/skills/claude-code-bible/SKILL.md +0 -100
  78. package/templates/.codex/skills/claude-code-bible/scripts/fetch-docs.js +0 -272
  79. package/templates/.codex/skills/create-agent/SKILL.md +0 -91
  80. package/templates/.codex/skills/dbt-best-practices/SKILL.md +0 -54
  81. package/templates/.codex/skills/de-lead-routing/SKILL.md +0 -243
  82. package/templates/.codex/skills/dev-lead-routing/SKILL.md +0 -94
  83. package/templates/.codex/skills/dev-refactor/SKILL.md +0 -123
  84. package/templates/.codex/skills/dev-review/SKILL.md +0 -81
  85. package/templates/.codex/skills/docker-best-practices/SKILL.md +0 -275
  86. package/templates/.codex/skills/fastapi-best-practices/SKILL.md +0 -270
  87. package/templates/.codex/skills/fix-refs/SKILL.md +0 -107
  88. package/templates/.codex/skills/go-backend-best-practices/SKILL.md +0 -338
  89. package/templates/.codex/skills/go-best-practices/SKILL.md +0 -203
  90. package/templates/.codex/skills/help/SKILL.md +0 -125
  91. package/templates/.codex/skills/intent-detection/SKILL.md +0 -215
  92. package/templates/.codex/skills/intent-detection/patterns/agent-triggers.yaml +0 -349
  93. package/templates/.codex/skills/kafka-best-practices/SKILL.md +0 -52
  94. package/templates/.codex/skills/kotlin-best-practices/SKILL.md +0 -256
  95. package/templates/.codex/skills/lists/SKILL.md +0 -78
  96. package/templates/.codex/skills/memory-management/SKILL.md +0 -195
  97. package/templates/.codex/skills/memory-recall/SKILL.md +0 -152
  98. package/templates/.codex/skills/memory-save/SKILL.md +0 -126
  99. package/templates/.codex/skills/monitoring-setup/SKILL.md +0 -115
  100. package/templates/.codex/skills/npm-audit/SKILL.md +0 -72
  101. package/templates/.codex/skills/npm-publish/SKILL.md +0 -63
  102. package/templates/.codex/skills/npm-version/SKILL.md +0 -75
  103. package/templates/.codex/skills/optimize-analyze/SKILL.md +0 -55
  104. package/templates/.codex/skills/optimize-bundle/SKILL.md +0 -67
  105. package/templates/.codex/skills/optimize-report/SKILL.md +0 -74
  106. package/templates/.codex/skills/pipeline-architecture-patterns/SKILL.md +0 -83
  107. package/templates/.codex/skills/postgres-best-practices/SKILL.md +0 -66
  108. package/templates/.codex/skills/python-best-practices/SKILL.md +0 -222
  109. package/templates/.codex/skills/qa-lead-routing/SKILL.md +0 -290
  110. package/templates/.codex/skills/react-best-practices/SKILL.md +0 -101
  111. package/templates/.codex/skills/redis-best-practices/SKILL.md +0 -83
  112. package/templates/.codex/skills/result-aggregation/SKILL.md +0 -164
  113. package/templates/.codex/skills/rust-best-practices/SKILL.md +0 -267
  114. package/templates/.codex/skills/sauron-watch/SKILL.md +0 -144
  115. package/templates/.codex/skills/secretary-routing/SKILL.md +0 -203
  116. package/templates/.codex/skills/snowflake-best-practices/SKILL.md +0 -65
  117. package/templates/.codex/skills/spark-best-practices/SKILL.md +0 -52
  118. package/templates/.codex/skills/springboot-best-practices/SKILL.md +0 -218
  119. package/templates/.codex/skills/status/SKILL.md +0 -153
  120. package/templates/.codex/skills/supabase-postgres-best-practices/SKILL.md +0 -99
  121. package/templates/.codex/skills/typescript-best-practices/SKILL.md +0 -321
  122. package/templates/.codex/skills/update-docs/SKILL.md +0 -140
  123. package/templates/.codex/skills/update-external/SKILL.md +0 -149
  124. package/templates/.codex/skills/vercel-deploy/SKILL.md +0 -73
  125. package/templates/.codex/skills/web-design-guidelines/SKILL.md +0 -118
  126. package/templates/.codex/skills/writing-clearly-and-concisely/SKILL.md +0 -64
  127. package/templates/.codex/uninstall-hooks.sh +0 -52
  128. package/templates/AGENTS.md.en +0 -39
  129. package/templates/AGENTS.md.ko +0 -39
  130. package/templates/manifest.codex.json +0 -43
@@ -1,349 +0,0 @@
1
- # Agent Triggers for Intent Detection
2
- # Used by intent-detection skill to match user input to agents
3
-
4
- # Score weights
5
- weights:
6
- keyword: 40
7
- file_pattern: 30
8
- action: 20
9
- context: 10
10
-
11
- # Action verbs (both Korean and English)
12
- action_verbs:
13
- review:
14
- korean: [리뷰, 검토, 확인, 체크]
15
- english: [review, check, analyze, audit]
16
- create:
17
- korean: [생성, 만들어, 추가]
18
- english: [create, make, add, new]
19
- fix:
20
- korean: [수정, 고쳐, 버그, 에러]
21
- english: [fix, repair, debug, solve]
22
- refactor:
23
- korean: [리팩토링, 개선, 정리]
24
- english: [refactor, improve, clean, optimize]
25
- explain:
26
- korean: [설명, 알려줘, 뭐야]
27
- english: [explain, what, how, why]
28
-
29
- # Agent definitions
30
- agents:
31
- # SW Engineers - Language
32
- lang-golang-expert:
33
- keywords:
34
- korean: [고, 고랭, "go 언어"]
35
- english: [go, golang]
36
- file_patterns: ["*.go", "go.mod", "go.sum"]
37
- supported_actions: [review, fix, refactor, explain]
38
- base_confidence: 40
39
-
40
- lang-python-expert:
41
- keywords:
42
- korean: [파이썬, 파이선]
43
- english: [python, py]
44
- file_patterns: ["*.py", "requirements.txt", "pyproject.toml", "setup.py", "Pipfile"]
45
- supported_actions: [review, fix, refactor, explain]
46
- base_confidence: 40
47
-
48
- lang-rust-expert:
49
- keywords:
50
- korean: [러스트]
51
- english: [rust, rs]
52
- file_patterns: ["*.rs", "Cargo.toml", "Cargo.lock"]
53
- supported_actions: [review, fix, refactor, explain]
54
- base_confidence: 40
55
-
56
- lang-kotlin-expert:
57
- keywords:
58
- korean: [코틀린]
59
- english: [kotlin, kt]
60
- file_patterns: ["*.kt", "*.kts", "build.gradle.kts"]
61
- supported_actions: [review, fix, refactor, explain]
62
- base_confidence: 40
63
-
64
- lang-typescript-expert:
65
- keywords:
66
- korean: [타입스크립트]
67
- english: [typescript, ts]
68
- file_patterns: ["*.ts", "*.tsx", "tsconfig.json"]
69
- supported_actions: [review, fix, refactor, explain]
70
- base_confidence: 40
71
-
72
- lang-java21-expert:
73
- keywords:
74
- korean: [자바, 자바21]
75
- english: [java, java21, jdk21, jdk]
76
- file_patterns: ["*.java", "pom.xml", "build.gradle"]
77
- supported_actions: [review, create, fix, refactor]
78
- base_confidence: 35
79
-
80
- # SW Engineers - Frontend
81
- fe-vercel-agent:
82
- keywords:
83
- korean: [리액트, 버셀, 넥스트]
84
- english: [react, vercel, next, nextjs]
85
- file_patterns: ["*.jsx", "*.tsx", "next.config.*", "vercel.json"]
86
- supported_actions: [review, create, fix, refactor]
87
- base_confidence: 40
88
-
89
- fe-vuejs-agent:
90
- keywords:
91
- korean: [뷰, 뷰제이에스, 피니아]
92
- english: [vue, vuejs, "vue.js", vue3, pinia, "vue router"]
93
- file_patterns: ["*.vue", "vite.config.*", "vue.config.*"]
94
- supported_actions: [review, create, fix, refactor]
95
- base_confidence: 40
96
-
97
- fe-svelte-agent:
98
- keywords:
99
- korean: [스벨트, 스벨트킷]
100
- english: [svelte, sveltekit, "svelte kit"]
101
- file_patterns: ["*.svelte", "svelte.config.*"]
102
- supported_actions: [review, create, fix, refactor]
103
- base_confidence: 40
104
-
105
- # SW Engineers - Backend
106
- be-fastapi-expert:
107
- keywords:
108
- korean: [패스트에이피아이, 패스트api]
109
- english: [fastapi, starlette]
110
- file_patterns: ["main.py", "app.py", "routers/*.py"]
111
- supported_actions: [review, create, fix, refactor]
112
- base_confidence: 35
113
-
114
- be-springboot-expert:
115
- keywords:
116
- korean: [스프링, 스프링부트]
117
- english: [spring, springboot, "spring boot", java]
118
- file_patterns: ["*.java", "pom.xml", "build.gradle", "application.yml", "application.properties"]
119
- supported_actions: [review, create, fix, refactor]
120
- base_confidence: 35
121
-
122
- be-go-backend-expert:
123
- keywords:
124
- korean: [고 백엔드, "go 백엔드", "go api"]
125
- english: ["go backend", "go api", gin, echo, fiber]
126
- file_patterns: ["*.go", "go.mod"]
127
- supported_actions: [review, create, fix, refactor]
128
- base_confidence: 35
129
-
130
- # SW Engineers - Backend (continued)
131
- be-express-expert:
132
- keywords:
133
- korean: [익스프레스, 노드]
134
- english: [express, expressjs, "express.js", node]
135
- file_patterns: ["*.js", "*.ts", "package.json", "app.js", "server.js"]
136
- supported_actions: [review, create, fix, refactor]
137
- base_confidence: 35
138
-
139
- be-nestjs-expert:
140
- keywords:
141
- korean: [네스트, 네스트제이에스]
142
- english: [nestjs, nest, "nest.js"]
143
- file_patterns: ["*.ts", "nest-cli.json", "*.module.ts", "*.controller.ts"]
144
- supported_actions: [review, create, fix, refactor]
145
- base_confidence: 35
146
-
147
- # SW Engineers - Tooling
148
- tool-bun-expert:
149
- keywords:
150
- korean: [번, 번런타임]
151
- english: [bun, bunx, "bun.js", bunfig]
152
- file_patterns: ["bunfig.toml", "bun.lockb", "*.bun.ts"]
153
- supported_actions: [build, test, run, migrate, review]
154
- base_confidence: 40
155
-
156
- tool-npm-expert:
157
- keywords:
158
- korean: [npm, 패키지, 배포, 퍼블리시]
159
- english: [npm, publish, package, registry, version]
160
- file_patterns: ["package.json", ".npmrc", ".npmignore"]
161
- supported_actions: [publish, version, audit, pack]
162
- base_confidence: 40
163
-
164
- tool-optimizer:
165
- keywords:
166
- korean: [최적화, 번들, 성능, 트리쉐이킹]
167
- english: [optimize, bundle, performance, "tree-shaking", "dead code"]
168
- file_patterns: []
169
- supported_actions: [analyze, optimize, report, bundle]
170
- base_confidence: 40
171
-
172
- # SW Engineers - Database
173
- db-supabase-expert:
174
- keywords:
175
- korean: [수퍼베이스, 수파베이스]
176
- english: [supabase, postgres, postgresql]
177
- file_patterns: ["*.sql", "supabase/*"]
178
- supported_actions: [review, create, fix, migrate]
179
- base_confidence: 40
180
-
181
- # SW Architects
182
- arch-documenter:
183
- keywords:
184
- korean: [문서, 설명서, 리드미]
185
- english: [document, docs, readme, documentation]
186
- file_patterns: ["*.md", "README*", "CHANGELOG*"]
187
- supported_actions: [create, review]
188
- base_confidence: 35
189
-
190
- arch-speckit-agent:
191
- keywords:
192
- korean: [스펙, 명세, 스펙키트]
193
- english: [spec, specification, speckit, design]
194
- file_patterns: ["*.spec.md", "*.spec.yaml", "specs/*"]
195
- supported_actions: [spec, design, document]
196
- base_confidence: 40
197
-
198
- # Infra Engineers
199
- infra-docker-expert:
200
- keywords:
201
- korean: [도커, 컨테이너]
202
- english: [docker, container, dockerfile]
203
- file_patterns: ["Dockerfile", "docker-compose.yml", "docker-compose.yaml", ".dockerignore"]
204
- supported_actions: [review, create, fix, explain]
205
- base_confidence: 40
206
-
207
- infra-aws-expert:
208
- keywords:
209
- korean: [에이더블유에스, 아마존, 클라우드]
210
- english: [aws, amazon, cloud, s3, ec2, lambda, ecs, eks]
211
- file_patterns: ["*.tf", "serverless.yml", "template.yaml", "cloudformation.*"]
212
- supported_actions: [review, create, fix, explain]
213
- base_confidence: 40
214
-
215
- # Managers
216
- mgr-creator:
217
- keywords:
218
- korean: [에이전트 생성, 에이전트 만들어]
219
- english: ["create agent", "new agent"]
220
- file_patterns: []
221
- supported_actions: [create]
222
- base_confidence: 50
223
-
224
- mgr-updater:
225
- keywords:
226
- korean: [업데이트, 동기화]
227
- english: [update, sync]
228
- file_patterns: []
229
- supported_actions: [review, fix]
230
- base_confidence: 50
231
-
232
- mgr-supplier:
233
- keywords:
234
- korean: [검사, 의존성, 감사]
235
- english: [audit, check, dependency, validate]
236
- file_patterns: []
237
- supported_actions: [review]
238
- base_confidence: 50
239
-
240
- # QA Team
241
- qa-planner:
242
- keywords:
243
- korean: [테스트 계획, QA 계획, 테스트 전략]
244
- english: ["test plan", "qa plan", "test strategy", "test scenarios"]
245
- file_patterns: []
246
- supported_actions: [plan, scenarios, criteria]
247
- base_confidence: 40
248
-
249
- qa-writer:
250
- keywords:
251
- korean: [테스트 케이스, 테스트 문서, 테스트 리포트]
252
- english: ["test case", "test documentation", "test report", "qa documentation"]
253
- file_patterns: []
254
- supported_actions: [write, report, template]
255
- base_confidence: 40
256
-
257
- qa-engineer:
258
- keywords:
259
- korean: [테스트 실행, 테스트 수행, 회귀 테스트, 자동화 테스트]
260
- english: ["run tests", "execute tests", "regression", "automate test", "verify fix"]
261
- file_patterns: ["*_test.*", "*.spec.*", "test_*.*"]
262
- supported_actions: [execute, verify, automate, regress]
263
- base_confidence: 40
264
-
265
- # QA Lead (Orchestrator)
266
- qa-lead:
267
- keywords:
268
- korean: [품질 리드, QA 리드, 테스트 조율]
269
- english: ["qa lead", "quality lead", "test coordination"]
270
- file_patterns: []
271
- supported_actions: [coordinate, review, lead]
272
- base_confidence: 40
273
-
274
- # System Agents
275
- sys-naggy:
276
- keywords:
277
- korean: [할일, 태스크, 리마인드, 알림]
278
- english: [todo, task, remind, reminder]
279
- file_patterns: []
280
- supported_actions: [list, add, done, complete, priority, remind]
281
- base_confidence: 40
282
-
283
- sys-memory-keeper:
284
- keywords:
285
- korean: [메모리, 기억, 저장, 회상]
286
- english: [memory, remember, recall, save]
287
- file_patterns: []
288
- supported_actions: [save, recall, remember]
289
- base_confidence: 40
290
-
291
- # Managers (continued)
292
- mgr-gitnerd:
293
- keywords:
294
- korean: [커밋, 브랜치, 푸시, 풀, 머지, 리베이스]
295
- english: [git, commit, branch, pr, push, pull, merge, rebase]
296
- file_patterns: [".gitignore", ".gitattributes"]
297
- supported_actions: [commit, branch, pr, sync, status, push, pull, merge]
298
- base_confidence: 40
299
-
300
- mgr-sync-checker:
301
- keywords:
302
- korean: [동기화, 싱크, 검증]
303
- english: [sync, synchronization, check, verify]
304
- file_patterns: ["index.yaml", "AGENTS.md", "COMMANDS.md"]
305
- supported_actions: [check, agents, commands, docs, fix]
306
- base_confidence: 40
307
-
308
- mgr-sauron:
309
- keywords:
310
- korean: [검증, 전체검증, 무결성, 사우론]
311
- english: [verify, verification, sauron, "full check", "system integrity", "r017"]
312
- file_patterns: []
313
- supported_actions: [watch, quick, report, verify]
314
- base_confidence: 40
315
-
316
- mgr-claude-code-bible:
317
- keywords:
318
- korean: [공식문서, 바이블, 클로드코드 문서]
319
- english: ["codex docs", "official docs", bible, "developers.openai.com/codex", "native verification"]
320
- file_patterns: []
321
- supported_actions: [fetch, verify, check]
322
- base_confidence: 40
323
-
324
- # Master
325
- planner:
326
- keywords:
327
- korean: [계획, 설계, 전략, 아키텍처]
328
- english: [plan, architect, strategy, design]
329
- file_patterns: []
330
- supported_actions: [plan, design, architect]
331
- base_confidence: 40
332
-
333
- # Orchestrators
334
- dev-lead:
335
- keywords:
336
- korean: [조율, 리뷰, 리드, 개발리드]
337
- english: [lead, coordinate, review, "dev lead"]
338
- file_patterns: []
339
- supported_actions: [coordinate, review, lead]
340
- base_confidence: 40
341
-
342
- secretary:
343
- keywords:
344
- korean: [에이전트, 관리, 오케스트레이션]
345
- english: [manage, agent, orchestrate]
346
- file_patterns: []
347
- supported_actions: [manage, create, coordinate]
348
- base_confidence: 40
349
-
@@ -1,52 +0,0 @@
1
- ---
2
- name: kafka-best-practices
3
- description: Apache Kafka best practices for event streaming, topic design, and producer-consumer patterns
4
- user-invocable: false
5
- ---
6
-
7
- # Apache Kafka Best Practices
8
-
9
- ## Producer Patterns
10
-
11
- ### Idempotent Producer (CRITICAL)
12
- - Enable `enable.idempotence=true`
13
- - Prevents duplicate messages
14
- - Requires `acks=all`, `retries > 0`, `max.in.flight.requests.per.connection <= 5`
15
-
16
- ### Exactly-Once Semantics
17
- - Use transactional API: `initTransactions()`, `beginTransaction()`, `commitTransaction()`
18
- - For exactly-once end-to-end processing
19
-
20
- ### Performance
21
- - Batching: `linger.ms` (wait for batch to fill)
22
- - Compression: `compression.type=snappy` or `lz4`
23
- - `batch.size`: 16KB default, tune based on message size
24
-
25
- ## Consumer Patterns
26
-
27
- ### Offset Management
28
- - Auto-commit: `enable.auto.commit=true` (at-least-once)
29
- - Manual commit: `commitSync()` or `commitAsync()` (better control)
30
-
31
- ### Rebalancing
32
- - Cooperative sticky assignor: minimal rebalancing disruption
33
- - `session.timeout.ms` and `heartbeat.interval.ms` tuning
34
-
35
- ### At-Least-Once vs Exactly-Once
36
- - At-least-once: default, idempotent processing required
37
- - Exactly-once: transactional consumer + producer
38
-
39
- ## Topic Design
40
-
41
- ### Partitioning
42
- - Partition count: based on throughput (MB/s ÷ partition throughput)
43
- - Key-based partitioning for ordering guarantees
44
- - More partitions = higher throughput (but more overhead)
45
-
46
- ### Retention
47
- - Time-based: `retention.ms`
48
- - Size-based: `retention.bytes`
49
- - Log compaction: for changelog topics (`cleanup.policy=compact`)
50
-
51
- ## References
52
- - [Kafka Documentation](https://kafka.apache.org/documentation/)
@@ -1,256 +0,0 @@
1
- ---
2
- name: kotlin-best-practices
3
- description: Idiomatic Kotlin patterns from JetBrains conventions
4
- user-invocable: false
5
- ---
6
-
7
- ## Purpose
8
-
9
- Apply idiomatic Kotlin patterns and best practices from official JetBrains documentation.
10
-
11
- ## Core Principles
12
-
13
- ```
14
- Concise yet readable
15
- Null safety by design
16
- Interoperability with Java
17
- Functional when appropriate
18
- ```
19
-
20
- ## Rules
21
-
22
- ### 1. Naming Conventions
23
-
24
- ```yaml
25
- packages:
26
- style: lowercase, no underscores
27
- example: org.example.project
28
-
29
- classes_objects:
30
- style: UpperCamelCase
31
- example: DeclarationProcessor
32
-
33
- functions_variables:
34
- style: lowerCamelCase
35
- example: processDeclarations, declarationCount
36
-
37
- constants:
38
- style: SCREAMING_SNAKE_CASE
39
- example: const val MAX_COUNT = 8
40
-
41
- backing_properties:
42
- style: underscore prefix
43
- example: private val _elementList
44
-
45
- acronyms:
46
- two_letters: both uppercase (IOStream)
47
- three_plus: capitalize first only (XmlFormatter)
48
- ```
49
-
50
- ### 2. Source File Organization
51
-
52
- ```yaml
53
- file_naming:
54
- single_class: name after the class (MyClass.kt)
55
- multiple_classes: descriptive UpperCamelCase (ProcessDeclarations.kt)
56
- platform_specific: add suffix (Platform.jvm.kt)
57
-
58
- class_layout:
59
- 1: Property declarations and initializer blocks
60
- 2: Secondary constructors
61
- 3: Method declarations
62
- 4: Companion object
63
-
64
- directory_structure:
65
- - Follow package structure with common root omitted
66
- - Example: org.example.kotlin.network → network/
67
- ```
68
-
69
- ### 3. Formatting
70
-
71
- ```yaml
72
- indentation:
73
- - 4 spaces (no tabs)
74
- - Opening brace at end of line
75
- - Closing brace on separate line
76
-
77
- horizontal_whitespace:
78
- around_binary_operators: "a + b"
79
- no_around_range: "0..i"
80
- no_around_unary: "a++"
81
- after_control_keywords: "if (condition)"
82
- no_before_parentheses: "method()"
83
- never_around_dot: "foo.bar()"
84
-
85
- colons:
86
- type_supertype: "class Foo : Bar"
87
- declaration_type: "val x: Int"
88
- always_space_after: true
89
-
90
- trailing_commas:
91
- recommended: true
92
- reason: cleaner diffs, easier reordering
93
- ```
94
-
95
- ### 4. Functions
96
-
97
- ```yaml
98
- expression_bodies:
99
- prefer: "fun foo() = 1"
100
- over: |
101
- fun foo(): Int {
102
- return 1
103
- }
104
-
105
- default_parameters:
106
- prefer: "fun foo(a: String = \"a\")"
107
- over: overloaded functions
108
-
109
- single_line_signatures:
110
- if_fits: "fun foo(a: Int): String = ..."
111
- otherwise: |
112
- fun longMethodName(
113
- argument: ArgumentType = defaultValue,
114
- argument2: AnotherArgumentType,
115
- ): ReturnType { }
116
-
117
- unit_return:
118
- avoid: "fun foo(): Unit { }"
119
- prefer: "fun foo() { }"
120
- ```
121
-
122
- ### 5. Null Safety
123
-
124
- ```yaml
125
- principles:
126
- - Prefer non-null types by default
127
- - Use ? only when nullability is meaningful
128
- - Leverage safe calls (?.) and elvis (?:)
129
-
130
- patterns: |
131
- // Safe call
132
- val length = text?.length
133
-
134
- // Elvis operator
135
- val name = user?.name ?: "Anonymous"
136
-
137
- // Let for null checks
138
- user?.let {
139
- println(it.name)
140
- }
141
-
142
- // Not-null assertion (use sparingly)
143
- val name = user!!.name
144
- ```
145
-
146
- ### 6. Idiomatic Patterns
147
-
148
- ```yaml
149
- immutability:
150
- prefer: "val over var"
151
- collections: "listOf() over arrayListOf()"
152
-
153
- conditionals:
154
- binary: use if
155
- multiple: use when
156
-
157
- patterns: |
158
- // if expression
159
- return if (x) foo() else bar()
160
-
161
- // when expression
162
- return when(x) {
163
- 0 -> "zero"
164
- else -> "nonzero"
165
- }
166
-
167
- functional:
168
- prefer: "list.filter { it > 10 }.map { it * 2 }"
169
- over: manual loops (except forEach)
170
-
171
- ranges:
172
- prefer: "for (i in 0..<n)"
173
- avoid: "for (i in 0..n - 1)"
174
-
175
- type_aliases:
176
- use_for: |
177
- typealias MouseClickHandler = (Any, MouseEvent) -> Unit
178
- typealias PersonIndex = Map<String, Person>
179
- ```
180
-
181
- ### 7. Lambdas
182
-
183
- ```yaml
184
- formatting:
185
- - Spaces around curly braces: "list.filter { it > 10 }"
186
- - Single lambda outside parentheses
187
- - it for single parameter
188
-
189
- patterns: |
190
- // Outside parentheses
191
- list.filter { it > 10 }
192
-
193
- // Multiple parameters
194
- list.fold(0) { acc, item -> acc + item }
195
-
196
- // Destructuring
197
- map.forEach { (key, value) -> println("$key = $value") }
198
- ```
199
-
200
- ### 8. Coroutines
201
-
202
- ```yaml
203
- principles:
204
- - Use suspend functions for async operations
205
- - Structured concurrency with scopes
206
- - Proper exception handling
207
-
208
- patterns: |
209
- // Suspend function
210
- suspend fun fetchData(): Data {
211
- return withContext(Dispatchers.IO) {
212
- api.getData()
213
- }
214
- }
215
-
216
- // Coroutine scope
217
- lifecycleScope.launch {
218
- val data = fetchData()
219
- updateUI(data)
220
- }
221
-
222
- // Exception handling
223
- try {
224
- val result = async { fetchData() }.await()
225
- } catch (e: Exception) {
226
- handleError(e)
227
- }
228
- ```
229
-
230
- ### 9. Documentation
231
-
232
- ```yaml
233
- format: |
234
- /**
235
- * Returns the absolute value of the given [number].
236
- */
237
- fun abs(number: Int): Int { ... }
238
-
239
- best_practices:
240
- - Incorporate parameters into description
241
- - Use brackets for parameter references
242
- - Use @param/@return only for lengthy descriptions
243
- ```
244
-
245
- ## Application
246
-
247
- When writing or reviewing Kotlin code:
248
-
249
- 1. **Always** prefer val over var
250
- 2. **Always** use null-safe types appropriately
251
- 3. **Prefer** expression bodies for simple functions
252
- 4. **Prefer** functional operations over loops
253
- 5. **Use** default parameters over overloads
254
- 6. **Use** when for multiple conditions
255
- 7. **Leverage** extension functions
256
- 8. **Document** public APIs