@coralai/sps-cli 0.55.13 → 0.56.1

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 (437) hide show
  1. package/dist/commands/cardMarkComplete.d.ts.map +1 -1
  2. package/dist/commands/cardMarkComplete.js +6 -3
  3. package/dist/commands/cardMarkComplete.js.map +1 -1
  4. package/dist/commands/projectInit.d.ts +18 -16
  5. package/dist/commands/projectInit.d.ts.map +1 -1
  6. package/dist/commands/projectInit.js +59 -186
  7. package/dist/commands/projectInit.js.map +1 -1
  8. package/dist/commands/skillCommand.js +7 -4
  9. package/dist/commands/skillCommand.js.map +1 -1
  10. package/dist/commands/tick.d.ts +2 -20
  11. package/dist/commands/tick.d.ts.map +1 -1
  12. package/dist/commands/tick.js +58 -1
  13. package/dist/commands/tick.js.map +1 -1
  14. package/dist/console/index.d.ts.map +1 -1
  15. package/dist/console/index.js +4 -0
  16. package/dist/console/index.js.map +1 -1
  17. package/dist/console/routes/chat.d.ts.map +1 -1
  18. package/dist/console/routes/chat.js +211 -6
  19. package/dist/console/routes/chat.js.map +1 -1
  20. package/dist/console/routes/projects.d.ts +0 -6
  21. package/dist/console/routes/projects.d.ts.map +1 -1
  22. package/dist/console/routes/projects.js +11 -2
  23. package/dist/console/routes/projects.js.map +1 -1
  24. package/dist/console/routes/providers.d.ts +10 -0
  25. package/dist/console/routes/providers.d.ts.map +1 -0
  26. package/dist/console/routes/providers.js +63 -0
  27. package/dist/console/routes/providers.js.map +1 -0
  28. package/dist/console/routes/smartarrange.d.ts +4 -0
  29. package/dist/console/routes/smartarrange.d.ts.map +1 -0
  30. package/dist/console/routes/smartarrange.js +107 -0
  31. package/dist/console/routes/smartarrange.js.map +1 -0
  32. package/dist/console/routes/system.d.ts.map +1 -1
  33. package/dist/console/routes/system.js +28 -0
  34. package/dist/console/routes/system.js.map +1 -1
  35. package/dist/console/routes/workers.d.ts.map +1 -1
  36. package/dist/console/routes/workers.js +36 -4
  37. package/dist/console/routes/workers.js.map +1 -1
  38. package/dist/console-assets/assets/index-CWkYVI5d.js +600 -0
  39. package/dist/console-assets/assets/index-CnUBHNsN.css +10 -0
  40. package/dist/console-assets/index.html +2 -2
  41. package/dist/core/agents/AcpBackend.d.ts +24 -0
  42. package/dist/core/agents/AcpBackend.d.ts.map +1 -0
  43. package/dist/core/agents/AcpBackend.js +86 -0
  44. package/dist/core/agents/AcpBackend.js.map +1 -0
  45. package/dist/core/agents/AgentBackend.d.ts +53 -0
  46. package/dist/core/agents/AgentBackend.d.ts.map +1 -0
  47. package/dist/core/agents/AgentBackend.js +18 -0
  48. package/dist/core/agents/AgentBackend.js.map +1 -0
  49. package/dist/core/agents/ClaudeAcpBackend.d.ts +13 -0
  50. package/dist/core/agents/ClaudeAcpBackend.d.ts.map +1 -0
  51. package/dist/core/agents/ClaudeAcpBackend.js +14 -0
  52. package/dist/core/agents/ClaudeAcpBackend.js.map +1 -0
  53. package/dist/core/agents/ClaudeSdkBackend.d.ts +26 -0
  54. package/dist/core/agents/ClaudeSdkBackend.d.ts.map +1 -0
  55. package/dist/core/agents/ClaudeSdkBackend.js +102 -0
  56. package/dist/core/agents/ClaudeSdkBackend.js.map +1 -0
  57. package/dist/core/agents/CodexAppServerBackend.d.ts +33 -0
  58. package/dist/core/agents/CodexAppServerBackend.d.ts.map +1 -0
  59. package/dist/core/agents/CodexAppServerBackend.js +168 -0
  60. package/dist/core/agents/CodexAppServerBackend.js.map +1 -0
  61. package/dist/core/agents/OpenAiAgentBackend.d.ts +39 -0
  62. package/dist/core/agents/OpenAiAgentBackend.d.ts.map +1 -0
  63. package/dist/core/agents/OpenAiAgentBackend.js +132 -0
  64. package/dist/core/agents/OpenAiAgentBackend.js.map +1 -0
  65. package/dist/core/agents/agentsMd.d.ts +2 -0
  66. package/dist/core/agents/agentsMd.d.ts.map +1 -0
  67. package/dist/core/agents/agentsMd.js +22 -0
  68. package/dist/core/agents/agentsMd.js.map +1 -0
  69. package/dist/core/agents/localTracing.d.ts +3 -0
  70. package/dist/core/agents/localTracing.d.ts.map +1 -0
  71. package/dist/core/agents/localTracing.js +42 -0
  72. package/dist/core/agents/localTracing.js.map +1 -0
  73. package/dist/core/agents/resolveBackend.d.ts +26 -0
  74. package/dist/core/agents/resolveBackend.d.ts.map +1 -0
  75. package/dist/core/agents/resolveBackend.js +27 -0
  76. package/dist/core/agents/resolveBackend.js.map +1 -0
  77. package/dist/core/agents/workerOutputSink.d.ts +4 -0
  78. package/dist/core/agents/workerOutputSink.d.ts.map +1 -0
  79. package/dist/core/agents/workerOutputSink.js +39 -0
  80. package/dist/core/agents/workerOutputSink.js.map +1 -0
  81. package/dist/core/config.d.ts +6 -0
  82. package/dist/core/config.d.ts.map +1 -1
  83. package/dist/core/config.js +4 -0
  84. package/dist/core/config.js.map +1 -1
  85. package/dist/core/intel/RuntimeSession.d.ts +16 -0
  86. package/dist/core/intel/RuntimeSession.d.ts.map +1 -0
  87. package/dist/core/intel/RuntimeSession.js +89 -0
  88. package/dist/core/intel/RuntimeSession.js.map +1 -0
  89. package/dist/core/intel/agentsConfig.d.ts +20 -0
  90. package/dist/core/intel/agentsConfig.d.ts.map +1 -0
  91. package/dist/core/intel/agentsConfig.js +68 -0
  92. package/dist/core/intel/agentsConfig.js.map +1 -0
  93. package/dist/core/intel/planStore.d.ts +23 -0
  94. package/dist/core/intel/planStore.d.ts.map +1 -0
  95. package/dist/core/intel/planStore.js +67 -0
  96. package/dist/core/intel/planStore.js.map +1 -0
  97. package/dist/core/intel/types.d.ts +86 -0
  98. package/dist/core/intel/types.d.ts.map +1 -0
  99. package/dist/core/intel/types.js +8 -0
  100. package/dist/core/intel/types.js.map +1 -0
  101. package/dist/core/memoryIngest.d.ts +18 -0
  102. package/dist/core/memoryIngest.d.ts.map +1 -0
  103. package/dist/core/memoryIngest.js +56 -0
  104. package/dist/core/memoryIngest.js.map +1 -0
  105. package/dist/core/memoryProvider.d.ts +63 -0
  106. package/dist/core/memoryProvider.d.ts.map +1 -0
  107. package/dist/core/memoryProvider.js +205 -0
  108. package/dist/core/memoryProvider.js.map +1 -0
  109. package/dist/core/skillStore.d.ts.map +1 -1
  110. package/dist/core/skillStore.js +2 -1
  111. package/dist/core/skillStore.js.map +1 -1
  112. package/dist/core/skills/SkillsManager.d.ts +38 -0
  113. package/dist/core/skills/SkillsManager.d.ts.map +1 -0
  114. package/dist/core/skills/SkillsManager.js +231 -0
  115. package/dist/core/skills/SkillsManager.js.map +1 -0
  116. package/dist/core/skills/distribution.d.ts +64 -0
  117. package/dist/core/skills/distribution.d.ts.map +1 -0
  118. package/dist/core/skills/distribution.js +269 -0
  119. package/dist/core/skills/distribution.js.map +1 -0
  120. package/dist/core/skills/index.d.ts +13 -0
  121. package/dist/core/skills/index.d.ts.map +1 -0
  122. package/dist/core/skills/index.js +13 -0
  123. package/dist/core/skills/index.js.map +1 -0
  124. package/dist/core/skills/types.d.ts +44 -0
  125. package/dist/core/skills/types.d.ts.map +1 -0
  126. package/dist/core/skills/types.js +9 -0
  127. package/dist/core/skills/types.js.map +1 -0
  128. package/dist/core/taskPrompts.d.ts +0 -12
  129. package/dist/core/taskPrompts.d.ts.map +1 -1
  130. package/dist/core/taskPrompts.js +0 -14
  131. package/dist/core/taskPrompts.js.map +1 -1
  132. package/dist/core/transcriptIngest.d.ts +37 -0
  133. package/dist/core/transcriptIngest.d.ts.map +1 -0
  134. package/dist/core/transcriptIngest.js +137 -0
  135. package/dist/core/transcriptIngest.js.map +1 -0
  136. package/dist/core/wiki/types.d.ts +282 -745
  137. package/dist/core/wiki/types.d.ts.map +1 -1
  138. package/dist/core/wiki/types.js +1 -1
  139. package/dist/core/wiki/types.js.map +1 -1
  140. package/dist/daemon/daemonClient.d.ts +6 -0
  141. package/dist/daemon/daemonClient.d.ts.map +1 -1
  142. package/dist/daemon/daemonClient.js.map +1 -1
  143. package/dist/daemon/sessionDaemon.d.ts.map +1 -1
  144. package/dist/daemon/sessionDaemon.js.map +1 -1
  145. package/dist/engines/SmartArrangeEngine.d.ts +75 -0
  146. package/dist/engines/SmartArrangeEngine.d.ts.map +1 -0
  147. package/dist/engines/SmartArrangeEngine.js +112 -0
  148. package/dist/engines/SmartArrangeEngine.js.map +1 -0
  149. package/dist/engines/StageEngine.d.ts +3 -17
  150. package/dist/engines/StageEngine.d.ts.map +1 -1
  151. package/dist/engines/StageEngine.js +13 -91
  152. package/dist/engines/StageEngine.js.map +1 -1
  153. package/dist/engines/smartarrange/AcpWorkerExec.d.ts +35 -0
  154. package/dist/engines/smartarrange/AcpWorkerExec.d.ts.map +1 -0
  155. package/dist/engines/smartarrange/AcpWorkerExec.js +71 -0
  156. package/dist/engines/smartarrange/AcpWorkerExec.js.map +1 -0
  157. package/dist/engines/smartarrange/cardSink.d.ts +29 -0
  158. package/dist/engines/smartarrange/cardSink.d.ts.map +1 -0
  159. package/dist/engines/smartarrange/cardSink.js +43 -0
  160. package/dist/engines/smartarrange/cardSink.js.map +1 -0
  161. package/dist/engines/smartarrange/runner.d.ts +24 -0
  162. package/dist/engines/smartarrange/runner.d.ts.map +1 -0
  163. package/dist/engines/smartarrange/runner.js +116 -0
  164. package/dist/engines/smartarrange/runner.js.map +1 -0
  165. package/dist/engines/smartarrange/screenshot.d.ts +5 -0
  166. package/dist/engines/smartarrange/screenshot.d.ts.map +1 -0
  167. package/dist/engines/smartarrange/screenshot.js +117 -0
  168. package/dist/engines/smartarrange/screenshot.js.map +1 -0
  169. package/dist/main.js +127 -92
  170. package/dist/main.js.map +1 -1
  171. package/dist/manager/worker-manager-impl.d.ts.map +1 -1
  172. package/dist/manager/worker-manager-impl.js +7 -0
  173. package/dist/manager/worker-manager-impl.js.map +1 -1
  174. package/dist/providers/ACPWorkerRuntime.d.ts +2 -0
  175. package/dist/providers/ACPWorkerRuntime.d.ts.map +1 -1
  176. package/dist/providers/ACPWorkerRuntime.js +1 -0
  177. package/dist/providers/ACPWorkerRuntime.js.map +1 -1
  178. package/dist/providers/LLMClient.d.ts +32 -0
  179. package/dist/providers/LLMClient.d.ts.map +1 -0
  180. package/dist/providers/LLMClient.js +108 -0
  181. package/dist/providers/LLMClient.js.map +1 -0
  182. package/dist/providers/MarkdownTaskBackend.d.ts.map +1 -1
  183. package/dist/providers/MarkdownTaskBackend.js +3 -2
  184. package/dist/providers/MarkdownTaskBackend.js.map +1 -1
  185. package/dist/providers/llm/chatTools.d.ts +11 -0
  186. package/dist/providers/llm/chatTools.d.ts.map +1 -0
  187. package/dist/providers/llm/chatTools.js +57 -0
  188. package/dist/providers/llm/chatTools.js.map +1 -0
  189. package/dist/providers/llm/codexAuth.d.ts +8 -0
  190. package/dist/providers/llm/codexAuth.d.ts.map +1 -0
  191. package/dist/providers/llm/codexAuth.js +57 -0
  192. package/dist/providers/llm/codexAuth.js.map +1 -0
  193. package/dist/providers/llm/codexModel.d.ts +14 -0
  194. package/dist/providers/llm/codexModel.d.ts.map +1 -0
  195. package/dist/providers/llm/codexModel.js +96 -0
  196. package/dist/providers/llm/codexModel.js.map +1 -0
  197. package/dist/providers/llm/localSubscription.d.ts +15 -0
  198. package/dist/providers/llm/localSubscription.d.ts.map +1 -0
  199. package/dist/providers/llm/localSubscription.js +66 -0
  200. package/dist/providers/llm/localSubscription.js.map +1 -0
  201. package/dist/providers/llm/modelFactory.d.ts +14 -0
  202. package/dist/providers/llm/modelFactory.d.ts.map +1 -0
  203. package/dist/providers/llm/modelFactory.js +22 -0
  204. package/dist/providers/llm/modelFactory.js.map +1 -0
  205. package/dist/providers/llm/monitorSkills.d.ts +6 -0
  206. package/dist/providers/llm/monitorSkills.d.ts.map +1 -0
  207. package/dist/providers/llm/monitorSkills.js +37 -0
  208. package/dist/providers/llm/monitorSkills.js.map +1 -0
  209. package/dist/providers/llm/probeTools.d.ts +7 -0
  210. package/dist/providers/llm/probeTools.d.ts.map +1 -0
  211. package/dist/providers/llm/probeTools.js +84 -0
  212. package/dist/providers/llm/probeTools.js.map +1 -0
  213. package/dist/providers/llm/providers.d.ts +26 -0
  214. package/dist/providers/llm/providers.d.ts.map +1 -0
  215. package/dist/providers/llm/providers.js +68 -0
  216. package/dist/providers/llm/providers.js.map +1 -0
  217. package/dist/providers/llm/skillTools.d.ts +4 -0
  218. package/dist/providers/llm/skillTools.d.ts.map +1 -0
  219. package/dist/providers/llm/skillTools.js +42 -0
  220. package/dist/providers/llm/skillTools.js.map +1 -0
  221. package/dist/providers/llm/workerTools.d.ts +9 -0
  222. package/dist/providers/llm/workerTools.d.ts.map +1 -0
  223. package/dist/providers/llm/workerTools.js +111 -0
  224. package/dist/providers/llm/workerTools.js.map +1 -0
  225. package/dist/providers/mcp/spsMcpServer.d.ts +15 -0
  226. package/dist/providers/mcp/spsMcpServer.d.ts.map +1 -0
  227. package/dist/providers/mcp/spsMcpServer.js +67 -0
  228. package/dist/providers/mcp/spsMcpServer.js.map +1 -0
  229. package/dist/providers/mcp/spsMcpStdio.d.ts +2 -0
  230. package/dist/providers/mcp/spsMcpStdio.d.ts.map +1 -0
  231. package/dist/providers/mcp/spsMcpStdio.js +32 -0
  232. package/dist/providers/mcp/spsMcpStdio.js.map +1 -0
  233. package/dist/providers/mcp/spsMcpStdioConfig.d.ts +11 -0
  234. package/dist/providers/mcp/spsMcpStdioConfig.d.ts.map +1 -0
  235. package/dist/providers/mcp/spsMcpStdioConfig.js +19 -0
  236. package/dist/providers/mcp/spsMcpStdioConfig.js.map +1 -0
  237. package/dist/server.d.ts +23 -0
  238. package/dist/server.d.ts.map +1 -1
  239. package/dist/server.js +23 -0
  240. package/dist/server.js.map +1 -1
  241. package/dist/services/ChatService.d.ts +10 -0
  242. package/dist/services/ChatService.d.ts.map +1 -1
  243. package/dist/services/ChatService.js +2 -0
  244. package/dist/services/ChatService.js.map +1 -1
  245. package/dist/services/LogService.d.ts +1 -1
  246. package/dist/services/LogService.d.ts.map +1 -1
  247. package/dist/services/LogService.js +3 -2
  248. package/dist/services/LogService.js.map +1 -1
  249. package/dist/services/ProjectService.d.ts +12 -2
  250. package/dist/services/ProjectService.d.ts.map +1 -1
  251. package/dist/services/ProjectService.js +1 -0
  252. package/dist/services/ProjectService.js.map +1 -1
  253. package/dist/services/SkillService.js +11 -13
  254. package/dist/services/SkillService.js.map +1 -1
  255. package/dist/services/SmartArrangeService.d.ts +12 -0
  256. package/dist/services/SmartArrangeService.d.ts.map +1 -0
  257. package/dist/services/SmartArrangeService.js +37 -0
  258. package/dist/services/SmartArrangeService.js.map +1 -0
  259. package/dist/services/SystemService.d.ts +20 -0
  260. package/dist/services/SystemService.d.ts.map +1 -1
  261. package/dist/services/SystemService.js +93 -0
  262. package/dist/services/SystemService.js.map +1 -1
  263. package/dist/services/WorkerService.d.ts +8 -0
  264. package/dist/services/WorkerService.d.ts.map +1 -1
  265. package/dist/services/WorkerService.js +73 -3
  266. package/dist/services/WorkerService.js.map +1 -1
  267. package/dist/services/container.d.ts +2 -0
  268. package/dist/services/container.d.ts.map +1 -1
  269. package/dist/services/container.js +2 -0
  270. package/dist/services/container.js.map +1 -1
  271. package/dist/shared/localTime.d.ts +8 -0
  272. package/dist/shared/localTime.d.ts.map +1 -0
  273. package/dist/shared/localTime.js +11 -0
  274. package/dist/shared/localTime.js.map +1 -0
  275. package/dist/shared/runtimePaths.d.ts +1 -1
  276. package/dist/shared/runtimePaths.d.ts.map +1 -1
  277. package/dist/shared/runtimePaths.js +2 -2
  278. package/dist/shared/runtimePaths.js.map +1 -1
  279. package/dist/shared/runtimeSchemas.d.ts +74 -245
  280. package/dist/shared/runtimeSchemas.d.ts.map +1 -1
  281. package/dist/shared/runtimeSchemas.js +2 -2
  282. package/dist/shared/runtimeSchemas.js.map +1 -1
  283. package/monitor-skills/probe-playbook/SKILL.md +32 -0
  284. package/monitor-skills/visual-rubric/SKILL.md +34 -0
  285. package/package.json +8 -8
  286. package/project-template/.claude/hooks/stop.sh +3 -1
  287. package/dist/console-assets/assets/index-BvWWj69G.js +0 -557
  288. package/dist/console-assets/assets/index-Eo4PuNPl.css +0 -10
  289. package/dist/interfaces/ACPClient.d.ts +0 -107
  290. package/dist/interfaces/ACPClient.d.ts.map +0 -1
  291. package/dist/interfaces/ACPClient.js +0 -17
  292. package/dist/interfaces/ACPClient.js.map +0 -1
  293. package/dist/interfaces/AgentRuntime.d.ts +0 -40
  294. package/dist/interfaces/AgentRuntime.d.ts.map +0 -1
  295. package/dist/interfaces/AgentRuntime.js +0 -17
  296. package/dist/interfaces/AgentRuntime.js.map +0 -1
  297. package/dist/manager/agentmemory.d.ts +0 -6
  298. package/dist/manager/agentmemory.d.ts.map +0 -1
  299. package/dist/manager/agentmemory.js +0 -73
  300. package/dist/manager/agentmemory.js.map +0 -1
  301. package/dist/models/acp.d.ts +0 -64
  302. package/dist/models/acp.d.ts.map +0 -1
  303. package/dist/models/acp.js +0 -17
  304. package/dist/models/acp.js.map +0 -1
  305. package/dist/providers/LocalACPClient.d.ts +0 -27
  306. package/dist/providers/LocalACPClient.d.ts.map +0 -1
  307. package/dist/providers/LocalACPClient.js +0 -26
  308. package/dist/providers/LocalACPClient.js.map +0 -1
  309. package/dist/providers/adapters/AcpSdkAdapter.d.ts +0 -24
  310. package/dist/providers/adapters/AcpSdkAdapter.d.ts.map +0 -1
  311. package/dist/providers/adapters/AcpSdkAdapter.js +0 -439
  312. package/dist/providers/adapters/AcpSdkAdapter.js.map +0 -1
  313. package/dist/providers/adapters/acp-fs-handlers.d.ts +0 -26
  314. package/dist/providers/adapters/acp-fs-handlers.d.ts.map +0 -1
  315. package/dist/providers/adapters/acp-fs-handlers.js +0 -61
  316. package/dist/providers/adapters/acp-fs-handlers.js.map +0 -1
  317. package/dist/providers/adapters/acp-permissions.d.ts +0 -42
  318. package/dist/providers/adapters/acp-permissions.d.ts.map +0 -1
  319. package/dist/providers/adapters/acp-permissions.js +0 -76
  320. package/dist/providers/adapters/acp-permissions.js.map +0 -1
  321. package/dist/providers/adapters/acp-session-accumulator.d.ts +0 -55
  322. package/dist/providers/adapters/acp-session-accumulator.d.ts.map +0 -1
  323. package/dist/providers/adapters/acp-session-accumulator.js +0 -133
  324. package/dist/providers/adapters/acp-session-accumulator.js.map +0 -1
  325. package/dist/providers/adapters/acp-terminal-manager.d.ts +0 -56
  326. package/dist/providers/adapters/acp-terminal-manager.d.ts.map +0 -1
  327. package/dist/providers/adapters/acp-terminal-manager.js +0 -127
  328. package/dist/providers/adapters/acp-terminal-manager.js.map +0 -1
  329. package/project-template/logs/.gitkeep +0 -0
  330. package/skills/architecture-decision-records/SKILL.md +0 -207
  331. package/skills/backend/SKILL.md +0 -62
  332. package/skills/backend/references/api-design.md +0 -168
  333. package/skills/backend/references/caching.md +0 -181
  334. package/skills/backend/references/data-access.md +0 -173
  335. package/skills/backend/references/layering.md +0 -181
  336. package/skills/backend/references/observability.md +0 -190
  337. package/skills/backend/references/resilience.md +0 -201
  338. package/skills/backend/references/security.md +0 -186
  339. package/skills/backend-architect/SKILL.md +0 -119
  340. package/skills/code-reviewer/SKILL.md +0 -143
  341. package/skills/coding-standards/SKILL.md +0 -60
  342. package/skills/coding-standards/references/clean-code.md +0 -258
  343. package/skills/coding-standards/references/code-review.md +0 -192
  344. package/skills/coding-standards/references/commits-and-prs.md +0 -226
  345. package/skills/coding-standards/references/error-strategy.md +0 -193
  346. package/skills/coding-standards/references/naming.md +0 -185
  347. package/skills/coding-standards/references/tdd.md +0 -171
  348. package/skills/database/SKILL.md +0 -53
  349. package/skills/database/references/indexing.md +0 -190
  350. package/skills/database/references/migrations.md +0 -199
  351. package/skills/database/references/nosql.md +0 -185
  352. package/skills/database/references/queries.md +0 -295
  353. package/skills/database/references/scaling.md +0 -203
  354. package/skills/database/references/schema.md +0 -191
  355. package/skills/database-optimizer/SKILL.md +0 -168
  356. package/skills/debugging-workflow/SKILL.md +0 -244
  357. package/skills/dev-worker/SKILL.md +0 -40
  358. package/skills/dev-worker/references/architect.md +0 -139
  359. package/skills/dev-worker/references/backend.md +0 -163
  360. package/skills/dev-worker/references/frontend.md +0 -122
  361. package/skills/dev-worker/references/fullstack.md +0 -179
  362. package/skills/dev-worker/references/optimizer.md +0 -151
  363. package/skills/dev-worker/references/phaser.md +0 -109
  364. package/skills/dev-worker/references/prototyper.md +0 -171
  365. package/skills/dev-worker/references/reviewer.md +0 -122
  366. package/skills/dev-worker/references/security.md +0 -154
  367. package/skills/dev-worker/references/senior.md +0 -155
  368. package/skills/dev-worker/references/typescript.md +0 -65
  369. package/skills/dev-worker/references/writer.md +0 -201
  370. package/skills/devops/SKILL.md +0 -55
  371. package/skills/devops/references/ci-cd.md +0 -204
  372. package/skills/devops/references/containers.md +0 -272
  373. package/skills/devops/references/deploy.md +0 -201
  374. package/skills/devops/references/iac.md +0 -252
  375. package/skills/devops/references/observability.md +0 -228
  376. package/skills/devops/references/secrets.md +0 -178
  377. package/skills/devops-automator/SKILL.md +0 -164
  378. package/skills/frontend/SKILL.md +0 -52
  379. package/skills/frontend/references/accessibility.md +0 -222
  380. package/skills/frontend/references/components.md +0 -206
  381. package/skills/frontend/references/performance.md +0 -219
  382. package/skills/frontend/references/routing.md +0 -209
  383. package/skills/frontend/references/state.md +0 -190
  384. package/skills/frontend/references/testing.md +0 -216
  385. package/skills/frontend-developer/SKILL.md +0 -115
  386. package/skills/git-workflow/SKILL.md +0 -355
  387. package/skills/golang/SKILL.md +0 -49
  388. package/skills/golang/references/concurrency.md +0 -284
  389. package/skills/golang/references/errors.md +0 -241
  390. package/skills/golang/references/idioms.md +0 -285
  391. package/skills/golang/references/testing.md +0 -238
  392. package/skills/java/SKILL.md +0 -50
  393. package/skills/java/references/concurrency.md +0 -194
  394. package/skills/java/references/idioms.md +0 -283
  395. package/skills/java/references/testing.md +0 -228
  396. package/skills/kotlin/SKILL.md +0 -47
  397. package/skills/kotlin/references/coroutines.md +0 -240
  398. package/skills/kotlin/references/idioms.md +0 -268
  399. package/skills/kotlin/references/testing.md +0 -219
  400. package/skills/mobile/SKILL.md +0 -50
  401. package/skills/mobile/references/architecture.md +0 -204
  402. package/skills/mobile/references/navigation.md +0 -158
  403. package/skills/mobile/references/performance.md +0 -152
  404. package/skills/mobile/references/platform.md +0 -166
  405. package/skills/mobile/references/state-and-data.md +0 -174
  406. package/skills/python/SKILL.md +0 -51
  407. package/skills/python/THIRD_PARTY.md +0 -14
  408. package/skills/python/references/async.md +0 -218
  409. package/skills/python/references/error-handling.md +0 -254
  410. package/skills/python/references/idioms.md +0 -279
  411. package/skills/python/references/packaging.md +0 -233
  412. package/skills/python/references/testing.md +0 -269
  413. package/skills/python/references/typing.md +0 -292
  414. package/skills/qa-tester/SKILL.md +0 -186
  415. package/skills/rust/SKILL.md +0 -50
  416. package/skills/rust/references/async.md +0 -224
  417. package/skills/rust/references/errors.md +0 -240
  418. package/skills/rust/references/ownership.md +0 -263
  419. package/skills/rust/references/testing.md +0 -274
  420. package/skills/rust/references/traits.md +0 -250
  421. package/skills/security-engineer/SKILL.md +0 -157
  422. package/skills/sps-memory/SKILL.md +0 -213
  423. package/skills/sps-pipeline/SKILL.md +0 -476
  424. package/skills/swift/SKILL.md +0 -48
  425. package/skills/swift/references/concurrency.md +0 -280
  426. package/skills/swift/references/idioms.md +0 -334
  427. package/skills/swift/references/testing.md +0 -229
  428. package/skills/tax-worker/SKILL.md +0 -150
  429. package/skills/tax-worker/references/account-codes.md +0 -165
  430. package/skills/typescript/SKILL.md +0 -51
  431. package/skills/typescript/references/async.md +0 -241
  432. package/skills/typescript/references/errors.md +0 -208
  433. package/skills/typescript/references/idioms.md +0 -246
  434. package/skills/typescript/references/testing.md +0 -225
  435. package/skills/typescript/references/tooling.md +0 -208
  436. package/skills/typescript/references/types.md +0 -259
  437. package/skills/wiki-update/SKILL.md +0 -300
@@ -1,191 +0,0 @@
1
- # Schema
2
-
3
- Normalization, keys, constraints, types.
4
-
5
- ## Start normalized
6
-
7
- 3rd Normal Form (3NF) is the sweet spot for most OLTP apps:
8
- - Each table represents one concept.
9
- - Every non-key column depends on the key, the whole key, and nothing but the key.
10
- - No repeating groups (prefer child tables over `phone1 / phone2 / phone3`).
11
-
12
- Denormalize later, with measurement, for reporting / read-heavy paths. Denormalized by default breeds data-consistency bugs.
13
-
14
- ## Primary keys
15
-
16
- Every table has one. Options:
17
-
18
- | Type | Pros | Cons |
19
- |---|---|---|
20
- | Auto-increment integer | Compact, fast, ordered | Leaks count; awkward in distributed systems |
21
- | UUID v4 | Globally unique, generated anywhere | 16 bytes, random → index fragmentation |
22
- | UUID v7 / ULID / KSUID | Time-ordered, unique, generated anywhere | Slightly newer; check lib support |
23
- | Composite key | Natural uniqueness (e.g., `(order_id, line_no)`) | Join and FK complexity |
24
-
25
- Recommendation: **UUID v7 / ULID** for new systems. Still sortable by time, no central generator needed, no count leakage. Store as `UUID` (Postgres) or `BINARY(16)` (MySQL) — don't use `VARCHAR(36)` (3× the storage).
26
-
27
- ## Foreign keys
28
-
29
- Declare them:
30
-
31
- ```sql
32
- CREATE TABLE orders (
33
- id UUID PRIMARY KEY,
34
- user_id UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
35
- created_at TIMESTAMPTZ NOT NULL DEFAULT now()
36
- );
37
- ```
38
-
39
- `ON DELETE`:
40
- - `RESTRICT` / `NO ACTION` — safe default; forces explicit cleanup.
41
- - `CASCADE` — dangerous; one delete can wipe large subgraphs. Use carefully.
42
- - `SET NULL` — when the relationship is optional.
43
-
44
- Don't skip FKs "for performance". The integrity guarantee is worth a lot more than the microseconds.
45
-
46
- ## Constraints over application logic
47
-
48
- Let the DB enforce invariants that must always hold.
49
-
50
- ```sql
51
- -- Invariants
52
- email TEXT NOT NULL UNIQUE,
53
- age INT CHECK (age >= 0 AND age <= 150),
54
- status TEXT NOT NULL CHECK (status IN ('pending','active','banned')),
55
- balance NUMERIC NOT NULL CHECK (balance >= 0),
56
-
57
- -- Uniqueness across multiple columns
58
- CONSTRAINT uq_org_email UNIQUE (org_id, email)
59
- ```
60
-
61
- Application validation is belt; DB constraints are suspenders. You want both.
62
-
63
- ## Column types
64
-
65
- ### Text
66
-
67
- - `TEXT` in Postgres — no length limit, same storage as `VARCHAR`.
68
- - `VARCHAR(n)` when the limit is a real business rule (e.g., phone max 20). `VARCHAR(255)` by habit is noise.
69
- - `CHAR(n)` — almost never the right answer (pads with spaces).
70
-
71
- ### Numbers
72
-
73
- - Integers: `INTEGER` (32-bit) or `BIGINT` (64-bit). Pick based on range.
74
- - **Money**: `NUMERIC(12, 2)` or **cents as integer** — never `FLOAT` / `DOUBLE` (binary floats lose pennies).
75
- - `REAL` / `DOUBLE PRECISION` only for scientific / measurement data where precision loss is OK.
76
-
77
- ### Time
78
-
79
- - `TIMESTAMPTZ` (Postgres with timezone) or UTC `TIMESTAMP` — always store in UTC. Convert in the app.
80
- - `DATE` for dates without time-of-day.
81
- - Never store time as `TEXT` or milliseconds-since-epoch as `BIGINT` unless you genuinely need it for external APIs.
82
-
83
- ### Boolean
84
-
85
- - `BOOLEAN` where supported.
86
- - MySQL older versions: `TINYINT(1)` as a workaround.
87
-
88
- ### Enum-like
89
-
90
- Three options:
91
-
92
- | Approach | Pros | Cons |
93
- |---|---|---|
94
- | Native ENUM (Postgres, MySQL) | Type-checked at DB level | Hard to add values without ALTER |
95
- | CHECK constraint with string | Easy to extend | String fragility |
96
- | Lookup table + FK | Flexible, self-documenting | Join on common queries |
97
-
98
- For small fixed sets (status = active / pending / banned), CHECK on a TEXT column is the pragmatic default.
99
-
100
- ### JSON
101
-
102
- - `JSONB` (Postgres) — indexable, queryable.
103
- - Use for schemaless attributes, user-defined fields, optional metadata.
104
- - **Don't** use as the primary way to represent structured data. If you're going to query `raw->>'email'` everywhere, promote `email` to a column.
105
-
106
- ## Naming
107
-
108
- Pick a convention, stay consistent.
109
-
110
- - **Tables**: plural (`users`, `orders`) or singular (`user`, `order`). Most teams pick plural.
111
- - **Columns**: `snake_case`. Match the language's ORM convention.
112
- - **Primary key**: `id`.
113
- - **Foreign keys**: `<table_singular>_id`. `user_id` references `users.id`.
114
- - **Timestamps**: `created_at`, `updated_at`, `deleted_at`.
115
- - **Booleans**: `is_active`, `has_verified_email`.
116
- - **Indexes**: `ix_<table>_<columns>`. Unique: `uq_<table>_<columns>`.
117
-
118
- ## Timestamps on every table
119
-
120
- ```sql
121
- created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
122
- updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
123
- ```
124
-
125
- `updated_at` via trigger OR app responsibility. Auditing, debugging, backfills — all need these.
126
-
127
- ## Soft delete vs. hard delete
128
-
129
- Default: **hard delete**. Reclaims space, simplifies queries, respects privacy requests.
130
-
131
- Soft delete (`deleted_at TIMESTAMP NULL`) when:
132
- - You need a recovery window.
133
- - Historical referencing matters (keep the row for audit but hide from listings).
134
-
135
- Trade-off: every query now filters `WHERE deleted_at IS NULL`. Forgetting is a bug class. Consider a `users_active` view for day-to-day use.
136
-
137
- If you need audit history, an `events` / `audit_log` table is usually cleaner than soft-delete everywhere.
138
-
139
- ## Partitioning
140
-
141
- For very large tables (hundreds of millions of rows), partition by time, tenant, or region. Postgres declarative partitioning:
142
-
143
- ```sql
144
- CREATE TABLE events (
145
- id UUID PRIMARY KEY,
146
- tenant_id UUID NOT NULL,
147
- created_at TIMESTAMPTZ NOT NULL,
148
- payload JSONB
149
- ) PARTITION BY RANGE (created_at);
150
-
151
- CREATE TABLE events_2026_04 PARTITION OF events
152
- FOR VALUES FROM ('2026-04-01') TO ('2026-05-01');
153
- ```
154
-
155
- Benefits: small indexes per partition, easy to drop old data (`DROP PARTITION`), parallel queries.
156
-
157
- Don't partition speculatively. The operational overhead is real.
158
-
159
- ## Multi-tenancy
160
-
161
- Three shapes:
162
-
163
- | Shape | Pros | Cons |
164
- |---|---|---|
165
- | Separate DBs per tenant | Full isolation, easy backup per tenant | Operational overhead at scale |
166
- | Shared DB, separate schemas | Middle ground | Connection per schema can be clunky |
167
- | Shared DB, shared schema + tenant_id column | Simplest, scales to many tenants | Every query MUST filter tenant_id |
168
-
169
- Shared schema + `tenant_id`: enforce via row-level security (Postgres RLS) if available, or framework middleware that injects the filter. Forgetting is a catastrophic data leak.
170
-
171
- ## Referential design patterns
172
-
173
- - **Associations**: join table `order_items (order_id, line_no, product_id, qty, price_cents)` with composite PK.
174
- - **Hierarchies**: `parent_id` + recursive CTE, or `ltree` (Postgres), or nested sets (read-heavy).
175
- - **Tags / many-to-many**: `post_tags (post_id, tag_id)`.
176
- - **Audit**: separate `audit_logs` table with immutable rows.
177
-
178
- ## Anti-patterns
179
-
180
- | Anti-pattern | Fix |
181
- |---|---|
182
- | Primary key = `VARCHAR(36)` UUID | Use native `UUID` / `BINARY(16)` |
183
- | `VARCHAR(255)` reflex | Use `TEXT` or a justified length |
184
- | One table "users_and_admins" with a role column and many nullable fields | Normalize or use type-specific tables |
185
- | Store JSON with the same shape in every row | Promote to columns |
186
- | Mutable history columns (`last_email_change_at`) spread across user table | Consider an audit log |
187
- | Money as `FLOAT` | Never |
188
- | `bool` stored as `Y/N` strings | Native `BOOLEAN` |
189
- | Different timestamps in different timezones | UTC everywhere |
190
- | `NULL` for "unknown" AND "not applicable" | Two different columns, or a CHECK'd enum |
191
- | Massive tables with no partitioning plan | Partition or archive when they get big |
@@ -1,168 +0,0 @@
1
- ---
2
- name: database-optimizer
3
- description: Persona skill — debug and tune SQL / DB performance like a specialist. Read plans, spot missing indexes, size pools. Overlay on top of `database`. For patterns, load `database`.
4
- origin: original
5
- ---
6
-
7
- # Database Optimizer
8
-
9
- Diagnose slow queries. Design indexes that earn their keep. Keep the DB quietly fast.
10
-
11
- ## When to load
12
-
13
- - A query is slow
14
- - A hot table keeps timing out
15
- - Planning a schema change with performance implications
16
- - Reviewing an ORM-generated query
17
- - Sizing a connection pool, memory, autovacuum
18
-
19
- ## The posture
20
-
21
- 1. **Numbers, not hunches.** `EXPLAIN (ANALYZE, BUFFERS)` beats "this should be fast."
22
- 2. **The right index > three wrong ones.** Over-indexing is its own perf bug (writes, storage).
23
- 3. **Most "DB problems" are query problems.** Bad SQL, N+1, unnecessary ORDER BY. Fix the query before scaling hardware.
24
- 4. **The plan is the truth.** If it says seq scan and you expected index scan, figure out why.
25
- 5. **Stats are often stale.** `ANALYZE` / `ANALYZE TABLE` before believing the plan.
26
- 6. **Think in rows scanned, not rows returned.** Scanning 1M rows to return 10 is the bug.
27
-
28
- ## The diagnostic flow
29
-
30
- When "the query is slow":
31
-
32
- 1. **Get the query.** Exact SQL as executed, with real parameters.
33
- 2. **Run `EXPLAIN (ANALYZE, BUFFERS)`** (Postgres) / `EXPLAIN ANALYZE` (MySQL). Read the actual cost and row counts.
34
- 3. **Look for the big number.** One node dominates. Start there.
35
- 4. **Compare actual vs. estimated rows.** Orders of magnitude off → stats are stale or skewed.
36
- 5. **Look for seq scan with a selective filter.** Missing / unused index.
37
- 6. **Look for sort spilling to disk.** Under-sized work_mem or wrong index order.
38
- 7. **Look for nested loop on a large inner.** Missing join index or bad cardinality estimate.
39
- 8. **Propose the fix.** Add index / rewrite query / update stats / partition / cache.
40
- 9. **Measure.** Run again with the change. Quote before/after timings.
41
-
42
- Don't propose fixes blind. Every fix you ship without a measured before/after is a guess.
43
-
44
- ## Questions you always ask
45
-
46
- - **Is this the exact SQL production runs?** (ORMs lie; check with pg_stat_statements or query log.)
47
- - **What's the selectivity?** How many rows does the filter return out of the total?
48
- - **Is there an index that covers this?** Check `pg_stat_user_indexes` for usage.
49
- - **What's the cardinality estimate vs. actual?**
50
- - **Is the query sargable?** (`WHERE lower(email) = ?` without an expression index isn't.)
51
- - **Are statistics fresh?** When was the last `ANALYZE`?
52
- - **Is this part of an N+1?** Small query run N times is bigger than one large query.
53
- - **How does this scale?** At 10× data, what happens?
54
-
55
- ## Common patterns you recognize
56
-
57
- ### Missing index
58
-
59
- ```
60
- Seq Scan on orders (cost=0.00..25000.00 rows=1000 width=48)
61
- Filter: (status = 'pending')
62
- Rows Removed by Filter: 499000
63
- Actual Rows: 1000
64
- ```
65
-
66
- Scanned 500K, kept 1K. Index on `status` (partial index if 'pending' is rare) fixes it.
67
-
68
- ### Wrong composite order
69
-
70
- ```
71
- -- Index: (user_id, created_at)
72
- EXPLAIN SELECT * FROM orders WHERE created_at > now() - '1 day' AND user_id = ?;
73
- ```
74
-
75
- If the plan is a seq scan, the index order may be wrong for the planner's needs. Reorder or add a second index.
76
-
77
- ### Stale stats
78
-
79
- ```
80
- Estimated Rows: 50
81
- Actual Rows: 500000
82
- ```
83
-
84
- 10 000× off. The planner used the wrong join strategy. `ANALYZE` the table.
85
-
86
- ### N+1
87
-
88
- ```python
89
- for order in orders: # 1 query
90
- user = User.get(order.user_id) # N queries
91
- ```
92
-
93
- Fix: batch (`User.get_by_ids([...])`) or eager-load in the ORM (`select_related`, `with_eager` etc.).
94
-
95
- ### Unneeded ORDER BY
96
-
97
- ```sql
98
- SELECT * FROM events WHERE tenant_id = ? ORDER BY created_at DESC LIMIT 10;
99
- -- No index on (tenant_id, created_at) → sorts everything first
100
- ```
101
-
102
- Composite index matching filter + sort makes this an index scan + early termination.
103
-
104
- ### Bloat / dead tuples
105
-
106
- Postgres UPDATE / DELETE leaves dead tuples. Autovacuum cleans up. If it's not keeping up:
107
-
108
- ```sql
109
- SELECT relname, n_dead_tup, last_vacuum, last_autovacuum
110
- FROM pg_stat_user_tables WHERE n_dead_tup > 10000
111
- ORDER BY n_dead_tup DESC;
112
- ```
113
-
114
- Tune autovacuum thresholds on hot tables.
115
-
116
- ## Index recommendations
117
-
118
- - **First index on a hot table**: the one that serves the dominant query.
119
- - **Composite**: columns in order of `WHERE = ?` first, then `WHERE > ?` (range), then `ORDER BY`.
120
- - **Partial**: when the query filters on a rare value.
121
- - **Expression**: when `WHERE lower(col) = ?` / `WHERE date_trunc('day', col) = ?`.
122
- - **Covering (INCLUDE)**: when the query reads a few extra columns on top of the indexed ones.
123
-
124
- Prune: drop indexes with zero scans in the last 30 days (after verifying usage across envs).
125
-
126
- ## Pool / memory sizing
127
-
128
- When the DB is healthy but the app times out:
129
-
130
- - **Connection saturation**: check pool wait times in the app. Likely `max_size` too small.
131
- - **DB max_connections**: Postgres default ~100. Total app replicas × pool size must leave headroom for admin.
132
- - **work_mem** (Postgres): per-operation; if queries spill to disk, consider raising (but test — memory multiplies per connection).
133
- - **shared_buffers**: typically 25% of available RAM for a dedicated DB host.
134
-
135
- ## Anti-patterns you always flag
136
-
137
- - `SELECT *` in production app code.
138
- - Adding an index on every column "just in case".
139
- - `WHERE function(col) = ?` without a matching expression index.
140
- - `LIKE '%x%'` on a big table (non-indexable wildcard).
141
- - `ORDER BY RANDOM()` on large tables.
142
- - Business logic implemented in triggers without ADR.
143
- - Read-then-update for an upsert (race condition).
144
- - One giant transaction wrapping a batch import.
145
- - UUID v4 primary keys on tables heavily sorted/paginated by PK (use UUID v7 / ULID).
146
- - Migration that takes a long lock during peak traffic.
147
-
148
- ## Tradeoffs you name
149
-
150
- - **Index count vs. write speed.** Every index is a write tax.
151
- - **Normalization vs. read speed.** Denormalize only where measured.
152
- - **Consistency vs. throughput.** RR / SI / SR per workload.
153
- - **Read from replica vs. primary.** Staleness vs. primary load.
154
-
155
- ## Forbidden patterns
156
-
157
- - Proposing performance fixes without an EXPLAIN
158
- - "Let's just scale up" before diagnosing
159
- - Adding an index without naming the query it serves
160
- - Ignoring migration lock impact ("it's a small change")
161
- - Running heavy analytical queries against the primary
162
- - Changing indexes without measuring before/after
163
-
164
- ## Pair with
165
-
166
- - [`database`](../database/SKILL.md) — the patterns and the vocabulary.
167
- - [`backend/references/data-access.md`](../backend/references/data-access.md) — where SQL meets app code.
168
- - [`devops/references/observability.md`](../devops/references/observability.md) — DB dashboards and alerts.
@@ -1,244 +0,0 @@
1
- ---
2
- name: debugging-workflow
3
- description: Workflow skill — systematic debugging. Reproduce, isolate, hypothesize, verify. Works for bugs, performance issues, and live incidents.
4
- origin: original
5
- ---
6
-
7
- # Debugging Workflow
8
-
9
- A method, not a ritual. Works for "user says it's broken" bugs, performance regressions, and live incidents.
10
-
11
- ## When to load
12
-
13
- - Something is broken and you don't yet know why
14
- - A test started failing and you don't know which change broke it
15
- - A performance regression appeared
16
- - You're on-call and an alert fired
17
- - Reviewing someone's debug session to teach or coach
18
-
19
- ## The posture
20
-
21
- 1. **Change one variable at a time.** If you flip three things and it works, you don't know which one fixed it.
22
- 2. **Reproduce first, diagnose second, fix third.** Fixing without reproducing is guessing.
23
- 3. **Trust the data over the story.** Bug reports are leads, not proofs.
24
- 4. **Read the error, all of it.** Stack trace, message, timestamp, request id.
25
- 5. **When stuck, lower the abstraction.** Go one layer down until the mechanism is visible.
26
- 6. **Stop when stumped. Sleep. Reset.** Fresh eyes find bugs that tired eyes write bugs for.
27
-
28
- ## The flow
29
-
30
- ```
31
- Reproduce ──▶ Isolate ──▶ Hypothesize ──▶ Test ──▶ Fix ──▶ Verify
32
- ▲ │
33
- └──────────── disconfirm? back up ──────┘
34
- ```
35
-
36
- ### 1. Reproduce
37
-
38
- You cannot debug what you can't reproduce. Turn the bug into a command.
39
-
40
- - From a user report: collect the steps, the exact time, the user id, the device.
41
- - From logs / metrics: narrow to the failing request or batch; get a request id.
42
- - From a test: `cargo test --test my_test`, `pytest -k my_test`.
43
-
44
- Goal: the smallest reproducible case. A 20-step manual reproduction is a lead; a 3-line test is evidence.
45
-
46
- If you cannot reproduce:
47
- - Add logging around the suspected area, ship a canary, wait for recurrence.
48
- - Check if it's environment-specific (timezone, locale, OS, version).
49
- - Check if it's data-specific (a particular record triggers it).
50
- - Consider whether the bug is the bug report (user confused, different issue).
51
-
52
- ### 2. Isolate
53
-
54
- Shrink the reproduction. Remove pieces one at a time. The last piece you remove is the bug's home.
55
-
56
- Techniques:
57
- - **Binary search** the codebase: comment out half; reproduce; comment out the remaining half; repeat. `git bisect` if the bug is recent.
58
- - **Minimize the input**: shorter string, fewer rows, simpler config.
59
- - **Swap in fakes**: if the bug reproduces with a fake DB, the bug isn't in the real DB.
60
-
61
- ### 3. Hypothesize
62
-
63
- State, out loud or in writing, what you think is happening. One sentence.
64
-
65
- > "When the cart is empty, checkout is calling `items[0]` and crashing."
66
-
67
- A good hypothesis:
68
- - Is specific (names a function, a condition).
69
- - Is disprovable (there's an experiment that would show it's wrong).
70
- - Explains the observed symptom AND the variations you've seen.
71
-
72
- ### 4. Test the hypothesis
73
-
74
- Design the test that would disprove it.
75
-
76
- - Add a print/log at the suspected line.
77
- - Run with the minimal reproduction.
78
- - Observe: does reality match the hypothesis?
79
-
80
- If yes → proceed to fix.
81
- If no → the hypothesis is wrong. Go back to step 3.
82
-
83
- Don't let a wrong hypothesis linger. "It almost fits" is how debug sessions become five-hour goose chases.
84
-
85
- ### 5. Fix
86
-
87
- Smallest correct change that fixes the bug and doesn't break other things.
88
-
89
- - Add a test that would have caught this.
90
- - Make the test fail.
91
- - Apply the fix.
92
- - Test passes.
93
- - Other tests still pass.
94
-
95
- Commit fix + test together.
96
-
97
- ### 6. Verify
98
-
99
- - Run the test.
100
- - Run the minimal reproduction.
101
- - Run the original user scenario (if different).
102
- - For production bugs: deploy to staging and verify there before prod.
103
-
104
- Don't close the ticket until you've verified on the system where the bug was reported.
105
-
106
- ## Tools by abstraction level
107
-
108
- When the bug hides, drop a layer.
109
-
110
- | Level | Tools |
111
- |---|---|
112
- | **Logs** | grep, structured-log viewer, APM log search |
113
- | **Metrics / dashboards** | Grafana, Datadog, CloudWatch |
114
- | **Traces** | Jaeger, Tempo, DD APM |
115
- | **Debugger** | `pdb`, IDE debuggers, `dlv`, `lldb` |
116
- | **Profiler** | `pprof`, py-spy, perf, Instruments |
117
- | **Network** | `tcpdump`, Wireshark, browser DevTools Network, `curl -v` |
118
- | **System calls** | `strace` (Linux), `dtruss` (macOS) |
119
- | **Kernel / hardware** | `perf`, eBPF, `iostat`, `top` |
120
-
121
- You usually won't go below "traces". When you do, the bug was worth the depth.
122
-
123
- ## The log reading discipline
124
-
125
- Read the entire trace, not just the top line.
126
-
127
- ```
128
- ValidationError: email required
129
- at validate (validate.py:23)
130
- at create (service.py:41)
131
- at handler (app.py:15) ← where the request started
132
- ```
133
-
134
- - **Top**: the immediate cause.
135
- - **Middle**: the path that got there.
136
- - **Bottom**: the entry point.
137
-
138
- For multi-service requests, trace by **request id** across services. If you can't — fix that first.
139
-
140
- ## Debugging performance
141
-
142
- Different but structurally similar:
143
-
144
- 1. **Measure**. Don't optimize without a number. `ab`, `k6`, `wrk` for throughput; APM for p95/p99.
145
- 2. **Profile**. Flame graph reveals the hot function. Guessing reveals nothing.
146
- 3. **Hypothesize the bottleneck**. "The SQL is slow" vs. "JSON serialization is slow" vs. "We're blocking on the main thread."
147
- 4. **Test with EXPLAIN / flame graph / profiler output**.
148
- 5. **Fix the highest-yield bottleneck**. Ignore the rest until you've re-measured.
149
-
150
- Rule: **never optimize the 2% case while the 60% case is still on the table**.
151
-
152
- ## Debugging flaky tests
153
-
154
- A flaky test is a bug. Treat it.
155
-
156
- - **Shared mutable state** between tests — reset in setup / use fresh fixtures.
157
- - **Order dependency** — tests depend on other tests' side effects.
158
- - **Timing** — tests that wait for "done" via sleep; flip to deterministic waits.
159
- - **Randomness** — uncontrolled random input; seed it.
160
- - **External dependencies** — real network / time / env; mock or inject.
161
-
162
- If you can't fix the flake in a week, DELETE the test. A flake that lies about whether the code works is worse than no test.
163
-
164
- ## Live incident
165
-
166
- Debugging with a fire lit:
167
-
168
- 1. **Stop the bleeding first.** Roll back, disable a feature flag, scale up, divert traffic. Diagnose later.
169
- 2. **Preserve evidence** — snapshot logs, heap, DB state before you mitigate; you'll need them for the postmortem.
170
- 3. **One driver, many helpers**. One person coordinating; others investigate. Avoid overlapping operations.
171
- 4. **Communicate every 15 min** even if nothing new: "still investigating DB side; rollback started at 14:03".
172
- 5. **Fix the immediate symptom. Plan the durable fix.** Different timescales.
173
- 6. **Write the postmortem.** Always. Blameless. Drive action items to completion.
174
-
175
- ## Rubber-ducking
176
-
177
- Explaining the problem, in full, in plain words, to anyone or anything:
178
- - A colleague.
179
- - A rubber duck on your desk.
180
- - A paragraph in a doc.
181
-
182
- Making the explanation forces you to sequence the facts; the sequence often exposes the missing step.
183
-
184
- Most "aha!" moments during rubber-ducking come at "okay so X happens, then Y, then — wait, does Y actually happen?"
185
-
186
- ## Pair debugging
187
-
188
- Two people, one keyboard. One describes their mental model, the other asks questions. Costly in time; often pays for itself on nasty bugs.
189
-
190
- ## Warning signs in your own process
191
-
192
- - You've tried four fixes. None landed.
193
- - You're re-running the test hoping it passes.
194
- - You're editing code to "see what happens" without a hypothesis.
195
- - You've been on the same bug for 3+ hours with no progress.
196
-
197
- All of these say: **stop, step away, reset**. Take a walk. Explain the bug to someone. Sleep on it. You'll come back cheaper and more effective.
198
-
199
- ## Bugs that turn out to be "not bugs"
200
-
201
- Always worth checking:
202
- - **Timezone / DST** — off-by-one-hour bugs.
203
- - **Locale** — decimal separators, date order, sort order.
204
- - **Unicode** — grapheme cluster length vs. byte length; RTL order.
205
- - **Float precision** — 0.1 + 0.2 ≠ 0.3.
206
- - **Integer overflow** — counters that wrap.
207
- - **Caches** — serving a stale copy.
208
- - **Config drift** — dev has flag X on, prod doesn't.
209
- - **Env variables** — typos, unset, accidentally committed.
210
-
211
- When the bug is "it only happens in prod", it's usually one of these.
212
-
213
- ## Fixing responsibly
214
-
215
- - Write a regression test BEFORE merging the fix.
216
- - Describe what the test proves in the commit message.
217
- - Link the original bug report / ticket.
218
- - If the fix has broader implications, write an ADR.
219
-
220
- ## Forbidden patterns
221
-
222
- - "Just add a try/except around it so it doesn't crash"
223
- - Closing a ticket without a reproduction-proving test
224
- - Rolling out a fix to prod before verifying on staging
225
- - Shipping a fix and "hoping" it works
226
- - Saying "it works on my machine" as a closing line
227
- - Removing a test that's failing "to unblock CI"
228
- - Blaming a user without reproducing the bug first
229
- - Fixing the symptom when you know where the root cause is
230
-
231
- ## The two-question close
232
-
233
- Before declaring "fixed":
234
-
235
- 1. **Do I have a test that would have failed before this change?**
236
- 2. **Do I know what caused the bug, not just what suppresses it?**
237
-
238
- If either is "no", you haven't finished.
239
-
240
- ## Pair with
241
-
242
- - [`coding-standards/references/tdd.md`](../coding-standards/references/tdd.md) — for the test-first fix discipline.
243
- - [`qa-tester`](../qa-tester/SKILL.md) — for edge-case intuition.
244
- - [`devops/references/observability.md`](../devops/references/observability.md) — tools for finding what you can't guess.
@@ -1,40 +0,0 @@
1
- ---
2
- name: dev-worker
3
- description: |
4
- Development worker skill profiles for SPS pipeline tasks. Activated when working on
5
- coding tasks with skill labels (skill:frontend, skill:backend, skill:phaser, etc).
6
- Provides role-specific coding standards, architecture patterns, and best practices. (🪸 Coral SPS)
7
- ---
8
-
9
- # SPS Development Worker Skills
10
-
11
- This skill provides role-specific coding expertise for SPS pipeline workers. Each reference file defines standards and patterns for a specific technology or role.
12
-
13
- ## Usage
14
-
15
- When a task has a `skill:xxx` label, load the corresponding reference file and follow its rules strictly.
16
-
17
- Available profiles:
18
-
19
- | Label | Reference | Description |
20
- |-------|-----------|-------------|
21
- | `skill:frontend` | `references/frontend.md` | React/TypeScript UI development |
22
- | `skill:backend` | `references/backend.md` | API, database, server-side logic |
23
- | `skill:fullstack` | `references/fullstack.md` | End-to-end feature development |
24
- | `skill:phaser` | `references/phaser.md` | Phaser 3 game development |
25
- | `skill:typescript` | `references/typescript.md` | TypeScript-specific patterns |
26
- | `skill:architect` | `references/architect.md` | System architecture and design |
27
- | `skill:security` | `references/security.md` | Security audit and hardening |
28
- | `skill:reviewer` | `references/reviewer.md` | Code review and quality audit |
29
- | `skill:optimizer` | `references/optimizer.md` | Performance optimization |
30
- | `skill:prototyper` | `references/prototyper.md` | Rapid prototyping |
31
- | `skill:senior` | `references/senior.md` | Senior engineering practices |
32
- | `skill:writer` | `references/writer.md` | Technical writing and documentation |
33
-
34
- ## Rules
35
-
36
- 1. Read the task prompt first to understand the requirement
37
- 2. If the task has skill labels, read the corresponding reference files from `references/`
38
- 3. Follow the coding standards and patterns defined in the reference
39
- 4. If multiple skills are specified, combine their rules (no conflicts — each covers different aspects)
40
- 5. If no skill label is present, use your best judgment for the technology stack