@ketecode/loom 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +516 -2
  3. package/agents/accessibility-reviewer/AGENT.md +70 -0
  4. package/agents/accessibility-reviewer/evals/triggers.json +15 -0
  5. package/agents/agent-evaluator/AGENT.md +74 -0
  6. package/agents/agent-evaluator/evals/triggers.json +15 -0
  7. package/agents/architect/AGENT.md +82 -0
  8. package/agents/architect/evals/triggers.json +17 -0
  9. package/agents/billing-reviewer/AGENT.md +68 -0
  10. package/agents/billing-reviewer/evals/triggers.json +16 -0
  11. package/agents/code-reviewer/AGENT.md +51 -0
  12. package/agents/code-reviewer/evals/triggers.json +14 -0
  13. package/agents/code-simplifier/AGENT.md +74 -0
  14. package/agents/code-simplifier/evals/triggers.json +15 -0
  15. package/agents/cpp-build-resolver/AGENT.md +73 -0
  16. package/agents/cpp-build-resolver/evals/triggers.json +16 -0
  17. package/agents/cpp-reviewer/AGENT.md +59 -0
  18. package/agents/cpp-reviewer/evals/triggers.json +16 -0
  19. package/agents/csharp-build-resolver/AGENT.md +84 -0
  20. package/agents/csharp-build-resolver/evals/triggers.json +17 -0
  21. package/agents/csharp-reviewer/AGENT.md +88 -0
  22. package/agents/csharp-reviewer/evals/triggers.json +17 -0
  23. package/agents/dart-build-resolver/AGENT.md +80 -0
  24. package/agents/dart-build-resolver/evals/triggers.json +17 -0
  25. package/agents/dart-reviewer/AGENT.md +66 -0
  26. package/agents/dart-reviewer/evals/triggers.json +17 -0
  27. package/agents/database-reviewer/AGENT.md +72 -0
  28. package/agents/database-reviewer/evals/triggers.json +16 -0
  29. package/agents/django-reviewer/AGENT.md +61 -0
  30. package/agents/django-reviewer/evals/triggers.json +15 -0
  31. package/agents/doc-updater/AGENT.md +92 -0
  32. package/agents/doc-updater/evals/triggers.json +14 -0
  33. package/agents/e2e-runner/AGENT.md +88 -0
  34. package/agents/e2e-runner/evals/triggers.json +16 -0
  35. package/agents/fastapi-reviewer/AGENT.md +63 -0
  36. package/agents/fastapi-reviewer/evals/triggers.json +15 -0
  37. package/agents/flutter-reviewer/AGENT.md +70 -0
  38. package/agents/flutter-reviewer/evals/triggers.json +15 -0
  39. package/agents/fsharp-build-resolver/AGENT.md +81 -0
  40. package/agents/fsharp-build-resolver/evals/triggers.json +15 -0
  41. package/agents/fsharp-reviewer/AGENT.md +77 -0
  42. package/agents/fsharp-reviewer/evals/triggers.json +15 -0
  43. package/agents/go-build-resolver/AGENT.md +85 -0
  44. package/agents/go-build-resolver/evals/triggers.json +16 -0
  45. package/agents/go-reviewer/AGENT.md +66 -0
  46. package/agents/go-reviewer/evals/triggers.json +16 -0
  47. package/agents/healthcare-reviewer/AGENT.md +65 -0
  48. package/agents/healthcare-reviewer/evals/triggers.json +16 -0
  49. package/agents/i18n-reviewer/AGENT.md +64 -0
  50. package/agents/i18n-reviewer/evals/triggers.json +16 -0
  51. package/agents/infra-reviewer/AGENT.md +93 -0
  52. package/agents/infra-reviewer/evals/triggers.json +15 -0
  53. package/agents/java-build-resolver/AGENT.md +82 -0
  54. package/agents/java-build-resolver/evals/triggers.json +16 -0
  55. package/agents/java-reviewer/AGENT.md +64 -0
  56. package/agents/java-reviewer/evals/triggers.json +16 -0
  57. package/agents/kotlin-build-resolver/AGENT.md +89 -0
  58. package/agents/kotlin-build-resolver/evals/triggers.json +16 -0
  59. package/agents/kotlin-reviewer/AGENT.md +75 -0
  60. package/agents/kotlin-reviewer/evals/triggers.json +16 -0
  61. package/agents/mle-reviewer/AGENT.md +68 -0
  62. package/agents/mle-reviewer/evals/triggers.json +16 -0
  63. package/agents/network-config-reviewer/AGENT.md +68 -0
  64. package/agents/network-config-reviewer/evals/triggers.json +17 -0
  65. package/agents/payments-reviewer/AGENT.md +64 -0
  66. package/agents/payments-reviewer/evals/triggers.json +16 -0
  67. package/agents/performance-optimizer/AGENT.md +86 -0
  68. package/agents/performance-optimizer/evals/triggers.json +16 -0
  69. package/agents/perl-build-resolver/AGENT.md +84 -0
  70. package/agents/perl-build-resolver/evals/triggers.json +15 -0
  71. package/agents/perl-reviewer/AGENT.md +77 -0
  72. package/agents/perl-reviewer/evals/triggers.json +15 -0
  73. package/agents/php-build-resolver/AGENT.md +88 -0
  74. package/agents/php-build-resolver/evals/triggers.json +16 -0
  75. package/agents/php-reviewer/AGENT.md +61 -0
  76. package/agents/php-reviewer/evals/triggers.json +15 -0
  77. package/agents/planner/AGENT.md +75 -0
  78. package/agents/planner/evals/triggers.json +17 -0
  79. package/agents/pr-test-analyzer/AGENT.md +82 -0
  80. package/agents/pr-test-analyzer/evals/triggers.json +16 -0
  81. package/agents/python-build-resolver/AGENT.md +87 -0
  82. package/agents/python-build-resolver/evals/triggers.json +16 -0
  83. package/agents/python-reviewer/AGENT.md +63 -0
  84. package/agents/python-reviewer/evals/triggers.json +15 -0
  85. package/agents/rag-reviewer/AGENT.md +71 -0
  86. package/agents/rag-reviewer/evals/triggers.json +16 -0
  87. package/agents/react-reviewer/AGENT.md +70 -0
  88. package/agents/react-reviewer/evals/triggers.json +16 -0
  89. package/agents/refactor-cleaner/AGENT.md +82 -0
  90. package/agents/refactor-cleaner/evals/triggers.json +16 -0
  91. package/agents/ruby-build-resolver/AGENT.md +93 -0
  92. package/agents/ruby-build-resolver/evals/triggers.json +16 -0
  93. package/agents/ruby-reviewer/AGENT.md +62 -0
  94. package/agents/ruby-reviewer/evals/triggers.json +16 -0
  95. package/agents/rust-build-resolver/AGENT.md +98 -0
  96. package/agents/rust-build-resolver/evals/triggers.json +16 -0
  97. package/agents/rust-reviewer/AGENT.md +78 -0
  98. package/agents/rust-reviewer/evals/triggers.json +15 -0
  99. package/agents/security-reviewer/AGENT.md +84 -0
  100. package/agents/security-reviewer/evals/triggers.json +16 -0
  101. package/agents/silent-failure-hunter/AGENT.md +66 -0
  102. package/agents/silent-failure-hunter/evals/triggers.json +16 -0
  103. package/agents/solidity-reviewer/AGENT.md +70 -0
  104. package/agents/solidity-reviewer/evals/triggers.json +16 -0
  105. package/agents/swift-build-resolver/AGENT.md +85 -0
  106. package/agents/swift-build-resolver/evals/triggers.json +15 -0
  107. package/agents/swift-reviewer/AGENT.md +75 -0
  108. package/agents/swift-reviewer/evals/triggers.json +15 -0
  109. package/agents/typescript-build-resolver/AGENT.md +76 -0
  110. package/agents/typescript-build-resolver/evals/triggers.json +15 -0
  111. package/agents/typescript-reviewer/AGENT.md +76 -0
  112. package/agents/typescript-reviewer/evals/triggers.json +15 -0
  113. package/agents/vue-reviewer/AGENT.md +75 -0
  114. package/agents/vue-reviewer/evals/triggers.json +15 -0
  115. package/bin/kete-loom.js +683 -0
  116. package/commands/aside.md +19 -0
  117. package/commands/build-fix.md +26 -0
  118. package/commands/campaign.md +19 -0
  119. package/commands/changelog.md +36 -0
  120. package/commands/checkpoint.md +26 -0
  121. package/commands/codemap.md +25 -0
  122. package/commands/commit.md +26 -0
  123. package/commands/deps-audit.md +32 -0
  124. package/commands/epic-decompose.md +21 -0
  125. package/commands/explain.md +37 -0
  126. package/commands/feature-dev.md +22 -0
  127. package/commands/hookify.md +23 -0
  128. package/commands/i18n-check.md +39 -0
  129. package/commands/issue-sync.md +22 -0
  130. package/commands/jira.md +19 -0
  131. package/commands/learn.md +23 -0
  132. package/commands/loom.md +21 -0
  133. package/commands/loop.md +20 -0
  134. package/commands/model-route.md +27 -0
  135. package/commands/onboard.md +35 -0
  136. package/commands/orchestrate.md +21 -0
  137. package/commands/plan-feature.md +36 -0
  138. package/commands/postmortem.md +42 -0
  139. package/commands/pr-describe.md +39 -0
  140. package/commands/pr.md +22 -0
  141. package/commands/prd.md +41 -0
  142. package/commands/project-init.md +21 -0
  143. package/commands/refactor-clean.md +24 -0
  144. package/commands/resume-session.md +22 -0
  145. package/commands/review.md +35 -0
  146. package/commands/save-session.md +37 -0
  147. package/commands/security-scan.md +32 -0
  148. package/commands/sessions.md +21 -0
  149. package/commands/skill-create.md +21 -0
  150. package/commands/tdd.md +36 -0
  151. package/commands/test-coverage.md +24 -0
  152. package/commands/threat-model.md +36 -0
  153. package/commands/update-docs.md +25 -0
  154. package/commands/verify.md +21 -0
  155. package/hooks/block-dangerous-commands/HOOK.md +30 -0
  156. package/hooks/block-dangerous-commands/cases.json +50 -0
  157. package/hooks/block-dangerous-commands/hook.js +75 -0
  158. package/hooks/block-no-verify/HOOK.md +25 -0
  159. package/hooks/block-no-verify/cases.json +30 -0
  160. package/hooks/block-no-verify/hook.js +43 -0
  161. package/hooks/format-on-edit/HOOK.md +24 -0
  162. package/hooks/format-on-edit/hook.js +89 -0
  163. package/hooks/guard-secrets/HOOK.md +19 -0
  164. package/hooks/guard-secrets/cases.json +110 -0
  165. package/hooks/guard-secrets/hook.js +44 -0
  166. package/hooks/load-session-context/HOOK.md +20 -0
  167. package/hooks/load-session-context/hook.js +56 -0
  168. package/hooks/protect-files/HOOK.md +24 -0
  169. package/hooks/protect-files/cases.json +27 -0
  170. package/hooks/protect-files/hook.js +39 -0
  171. package/hooks/run.js +132 -0
  172. package/mcp/atlassian.json +11 -0
  173. package/mcp/chrome-devtools.json +18 -0
  174. package/mcp/cloudflare.json +11 -0
  175. package/mcp/context7.json +11 -0
  176. package/mcp/fetch.json +17 -0
  177. package/mcp/figma.json +11 -0
  178. package/mcp/git.json +17 -0
  179. package/mcp/github.json +11 -0
  180. package/mcp/linear.json +11 -0
  181. package/mcp/memory.json +18 -0
  182. package/mcp/notion.json +11 -0
  183. package/mcp/playwright.json +18 -0
  184. package/mcp/sentry.json +11 -0
  185. package/mcp/stripe.json +11 -0
  186. package/mcp/supabase.json +11 -0
  187. package/mcp/time.json +17 -0
  188. package/package.json +59 -4
  189. package/profiles.json +165 -0
  190. package/rules/common.md +21 -0
  191. package/rules/cpp.md +29 -0
  192. package/rules/csharp.md +25 -0
  193. package/rules/dart.md +29 -0
  194. package/rules/fsharp.md +28 -0
  195. package/rules/git.md +26 -0
  196. package/rules/go.md +29 -0
  197. package/rules/java.md +29 -0
  198. package/rules/kotlin.md +27 -0
  199. package/rules/perl.md +26 -0
  200. package/rules/php.md +28 -0
  201. package/rules/python.md +30 -0
  202. package/rules/ruby.md +27 -0
  203. package/rules/rust.md +26 -0
  204. package/rules/security.md +29 -0
  205. package/rules/swift.md +28 -0
  206. package/rules/testing.md +25 -0
  207. package/rules/typescript.md +29 -0
  208. package/schemas/skill-frontmatter.schema.json +52 -0
  209. package/scripts/lib/audit.js +96 -0
  210. package/scripts/lib/frontmatter.js +65 -0
  211. package/scripts/lib/hooks-install.js +292 -0
  212. package/scripts/lib/i18n.js +51 -0
  213. package/scripts/lib/inventory.js +85 -0
  214. package/scripts/lib/lint.js +158 -0
  215. package/scripts/lib/mcp-install.js +284 -0
  216. package/scripts/lib/profiles.js +128 -0
  217. package/scripts/lib/render.js +86 -0
  218. package/scripts/lib/rules-install.js +118 -0
  219. package/scripts/lib/skills.js +86 -0
  220. package/scripts/lib/targets.js +113 -0
  221. package/skills/accounting-api-integration/SKILL.md +81 -0
  222. package/skills/accounting-api-integration/evals/triggers.json +17 -0
  223. package/skills/accounting-api-integration/references/quickbooks.md +48 -0
  224. package/skills/accounting-api-integration/references/xero.md +45 -0
  225. package/skills/agent-harness-design/SKILL.md +125 -0
  226. package/skills/agent-harness-design/evals/triggers.json +21 -0
  227. package/skills/ai-media-generation/SKILL.md +89 -0
  228. package/skills/ai-media-generation/evals/triggers.json +16 -0
  229. package/skills/ai-media-generation/references/job-pipeline.md +76 -0
  230. package/skills/angular-patterns/SKILL.md +122 -0
  231. package/skills/angular-patterns/evals/triggers.json +16 -0
  232. package/skills/api-design/SKILL.md +96 -0
  233. package/skills/api-design/evals/triggers.json +18 -0
  234. package/skills/api-design/references/conventions.md +133 -0
  235. package/skills/architecture-decision-records/SKILL.md +98 -0
  236. package/skills/architecture-decision-records/evals/triggers.json +17 -0
  237. package/skills/article-writing/SKILL.md +108 -0
  238. package/skills/article-writing/evals/triggers.json +16 -0
  239. package/skills/aspnet-core-patterns/SKILL.md +149 -0
  240. package/skills/aspnet-core-patterns/evals/triggers.json +16 -0
  241. package/skills/auth-patterns/SKILL.md +104 -0
  242. package/skills/auth-patterns/evals/triggers.json +17 -0
  243. package/skills/auth-patterns/references/oauth-oidc.md +64 -0
  244. package/skills/autonomous-loops/SKILL.md +99 -0
  245. package/skills/autonomous-loops/evals/triggers.json +14 -0
  246. package/skills/aws-patterns/SKILL.md +91 -0
  247. package/skills/aws-patterns/evals/triggers.json +16 -0
  248. package/skills/azure-patterns/SKILL.md +86 -0
  249. package/skills/azure-patterns/evals/triggers.json +16 -0
  250. package/skills/benchmark-methodology/SKILL.md +88 -0
  251. package/skills/benchmark-methodology/evals/triggers.json +16 -0
  252. package/skills/benchmark-methodology/references/language-harnesses.md +130 -0
  253. package/skills/bgp-diagnostics/SKILL.md +84 -0
  254. package/skills/bgp-diagnostics/evals/triggers.json +18 -0
  255. package/skills/bgp-diagnostics/references/bgp-reference.md +81 -0
  256. package/skills/bioinformatics-workflows/SKILL.md +108 -0
  257. package/skills/bioinformatics-workflows/evals/triggers.json +16 -0
  258. package/skills/bioinformatics-workflows/references/commands.md +71 -0
  259. package/skills/bioinformatics-workflows/references/formats.md +24 -0
  260. package/skills/bioinformatics-workflows/references/workflow-managers.md +107 -0
  261. package/skills/brand-voice/SKILL.md +112 -0
  262. package/skills/brand-voice/evals/triggers.json +16 -0
  263. package/skills/browser-qa/SKILL.md +99 -0
  264. package/skills/browser-qa/evals/triggers.json +16 -0
  265. package/skills/bun-runtime/SKILL.md +93 -0
  266. package/skills/bun-runtime/evals/triggers.json +16 -0
  267. package/skills/cisco-ios-config/SKILL.md +101 -0
  268. package/skills/cisco-ios-config/evals/triggers.json +18 -0
  269. package/skills/cisco-ios-config/references/verification.md +63 -0
  270. package/skills/clickhouse-patterns/SKILL.md +101 -0
  271. package/skills/clickhouse-patterns/evals/triggers.json +18 -0
  272. package/skills/clickhouse-patterns/references/engines-and-views.md +138 -0
  273. package/skills/clinical-decision-support/SKILL.md +90 -0
  274. package/skills/clinical-decision-support/evals/triggers.json +16 -0
  275. package/skills/clinical-decision-support/references/cds-hooks.md +76 -0
  276. package/skills/clinical-decision-support/references/regulatory-boundaries.md +37 -0
  277. package/skills/code-tour/SKILL.md +97 -0
  278. package/skills/code-tour/evals/triggers.json +14 -0
  279. package/skills/codebase-onboarding/SKILL.md +112 -0
  280. package/skills/codebase-onboarding/evals/triggers.json +14 -0
  281. package/skills/cold-outreach-sequences/SKILL.md +90 -0
  282. package/skills/cold-outreach-sequences/evals/triggers.json +16 -0
  283. package/skills/content-repurposing/SKILL.md +82 -0
  284. package/skills/content-repurposing/evals/triggers.json +16 -0
  285. package/skills/context-budget/SKILL.md +84 -0
  286. package/skills/context-budget/evals/triggers.json +14 -0
  287. package/skills/conventional-commits/SKILL.md +144 -0
  288. package/skills/conventional-commits/evals/triggers.json +16 -0
  289. package/skills/cpp-patterns/SKILL.md +129 -0
  290. package/skills/cpp-patterns/evals/triggers.json +16 -0
  291. package/skills/cpp-patterns/references/cmake-and-tooling.md +88 -0
  292. package/skills/cpp-patterns/references/undefined-behaviour.md +75 -0
  293. package/skills/cpp-testing/SKILL.md +131 -0
  294. package/skills/cpp-testing/evals/triggers.json +16 -0
  295. package/skills/csharp-patterns/SKILL.md +110 -0
  296. package/skills/csharp-patterns/evals/triggers.json +17 -0
  297. package/skills/csharp-patterns/references/analyzers.md +59 -0
  298. package/skills/csharp-testing/SKILL.md +85 -0
  299. package/skills/csharp-testing/evals/triggers.json +17 -0
  300. package/skills/csharp-testing/references/integration-tests.md +77 -0
  301. package/skills/css-architecture/SKILL.md +143 -0
  302. package/skills/css-architecture/evals/triggers.json +16 -0
  303. package/skills/customs-trade-compliance/SKILL.md +95 -0
  304. package/skills/customs-trade-compliance/evals/triggers.json +16 -0
  305. package/skills/customs-trade-compliance/references/incoterms-2020.md +42 -0
  306. package/skills/dart-patterns/SKILL.md +157 -0
  307. package/skills/dart-patterns/evals/triggers.json +18 -0
  308. package/skills/dart-testing/SKILL.md +164 -0
  309. package/skills/dart-testing/evals/triggers.json +18 -0
  310. package/skills/data-analysis-notebooks/SKILL.md +113 -0
  311. package/skills/data-analysis-notebooks/evals/triggers.json +16 -0
  312. package/skills/data-analysis-notebooks/references/dataframe-pitfalls.md +49 -0
  313. package/skills/data-analysis-notebooks/references/statistics-pitfalls.md +24 -0
  314. package/skills/data-pipelines/SKILL.md +90 -0
  315. package/skills/data-pipelines/evals/triggers.json +16 -0
  316. package/skills/data-pipelines/references/orchestrators.md +64 -0
  317. package/skills/database-migrations/SKILL.md +102 -0
  318. package/skills/database-migrations/evals/triggers.json +16 -0
  319. package/skills/database-migrations/references/recipes.md +98 -0
  320. package/skills/database-migrations/references/tools.md +21 -0
  321. package/skills/dbt-patterns/SKILL.md +96 -0
  322. package/skills/dbt-patterns/evals/triggers.json +16 -0
  323. package/skills/dbt-patterns/references/yaml-examples.md +114 -0
  324. package/skills/deep-research/SKILL.md +107 -0
  325. package/skills/deep-research/evals/triggers.json +14 -0
  326. package/skills/dependency-audit/SKILL.md +103 -0
  327. package/skills/dependency-audit/evals/triggers.json +16 -0
  328. package/skills/dependency-audit/references/tools.md +124 -0
  329. package/skills/deployment-strategies/SKILL.md +108 -0
  330. package/skills/deployment-strategies/evals/triggers.json +16 -0
  331. package/skills/django-patterns/SKILL.md +123 -0
  332. package/skills/django-patterns/evals/triggers.json +16 -0
  333. package/skills/docker-patterns/SKILL.md +132 -0
  334. package/skills/docker-patterns/evals/triggers.json +16 -0
  335. package/skills/docker-patterns/references/dockerfiles.md +105 -0
  336. package/skills/e2e-testing-playwright/SKILL.md +94 -0
  337. package/skills/e2e-testing-playwright/evals/triggers.json +16 -0
  338. package/skills/e2e-testing-playwright/references/config-and-ci.md +129 -0
  339. package/skills/ef-core-patterns/SKILL.md +117 -0
  340. package/skills/ef-core-patterns/evals/triggers.json +16 -0
  341. package/skills/email-deliverability/SKILL.md +99 -0
  342. package/skills/email-deliverability/evals/triggers.json +17 -0
  343. package/skills/email-deliverability/references/dns-records.md +85 -0
  344. package/skills/error-handling-patterns/SKILL.md +112 -0
  345. package/skills/error-handling-patterns/evals/triggers.json +18 -0
  346. package/skills/error-handling-patterns/references/language-idioms.md +49 -0
  347. package/skills/estimation-and-scoping/SKILL.md +97 -0
  348. package/skills/estimation-and-scoping/evals/triggers.json +14 -0
  349. package/skills/evm-dapp-integration/SKILL.md +73 -0
  350. package/skills/evm-dapp-integration/evals/triggers.json +16 -0
  351. package/skills/fastapi-patterns/SKILL.md +127 -0
  352. package/skills/fastapi-patterns/evals/triggers.json +16 -0
  353. package/skills/ffmpeg-media-processing/SKILL.md +94 -0
  354. package/skills/ffmpeg-media-processing/evals/triggers.json +16 -0
  355. package/skills/ffmpeg-media-processing/references/recipes.md +112 -0
  356. package/skills/fhir-integration/SKILL.md +81 -0
  357. package/skills/fhir-integration/evals/triggers.json +16 -0
  358. package/skills/fhir-integration/references/search-and-bundles.md +73 -0
  359. package/skills/fhir-integration/references/smart-on-fhir.md +50 -0
  360. package/skills/flask-patterns/SKILL.md +132 -0
  361. package/skills/flask-patterns/evals/triggers.json +16 -0
  362. package/skills/flutter-patterns/SKILL.md +99 -0
  363. package/skills/flutter-patterns/evals/triggers.json +16 -0
  364. package/skills/flutterwave-integration/SKILL.md +75 -0
  365. package/skills/flutterwave-integration/evals/triggers.json +16 -0
  366. package/skills/flutterwave-integration/references/api.md +73 -0
  367. package/skills/flutterwave-integration/references/webhooks.md +49 -0
  368. package/skills/fsharp-patterns/SKILL.md +133 -0
  369. package/skills/fsharp-patterns/evals/triggers.json +16 -0
  370. package/skills/fsharp-testing/SKILL.md +136 -0
  371. package/skills/fsharp-testing/evals/triggers.json +16 -0
  372. package/skills/gcp-patterns/SKILL.md +86 -0
  373. package/skills/gcp-patterns/evals/triggers.json +16 -0
  374. package/skills/git-workflow/SKILL.md +114 -0
  375. package/skills/git-workflow/evals/triggers.json +16 -0
  376. package/skills/github-actions-ci/SKILL.md +117 -0
  377. package/skills/github-actions-ci/evals/triggers.json +16 -0
  378. package/skills/github-api-automation/SKILL.md +101 -0
  379. package/skills/github-api-automation/evals/triggers.json +17 -0
  380. package/skills/go-patterns/SKILL.md +118 -0
  381. package/skills/go-patterns/evals/triggers.json +17 -0
  382. package/skills/go-patterns/references/concurrency.md +162 -0
  383. package/skills/go-testing/SKILL.md +154 -0
  384. package/skills/go-testing/evals/triggers.json +17 -0
  385. package/skills/hexagonal-architecture/SKILL.md +89 -0
  386. package/skills/hexagonal-architecture/evals/triggers.json +17 -0
  387. package/skills/hipaa-compliance/SKILL.md +91 -0
  388. package/skills/hipaa-compliance/evals/triggers.json +18 -0
  389. package/skills/hipaa-compliance/references/safeguards.md +68 -0
  390. package/skills/hl7v2-integration/SKILL.md +69 -0
  391. package/skills/hl7v2-integration/evals/triggers.json +16 -0
  392. package/skills/hl7v2-integration/references/messages-and-ack.md +78 -0
  393. package/skills/homelab-network-setup/SKILL.md +125 -0
  394. package/skills/homelab-network-setup/evals/triggers.json +18 -0
  395. package/skills/homelab-network-setup/references/firewall-and-dns.md +45 -0
  396. package/skills/homelab-network-setup/references/wireguard.md +72 -0
  397. package/skills/hubtel-integration/SKILL.md +77 -0
  398. package/skills/hubtel-integration/evals/triggers.json +16 -0
  399. package/skills/hubtel-integration/references/api.md +92 -0
  400. package/skills/i18n-localization/SKILL.md +114 -0
  401. package/skills/i18n-localization/evals/triggers.json +16 -0
  402. package/skills/i18n-localization/references/libraries.md +52 -0
  403. package/skills/incident-postmortem/SKILL.md +118 -0
  404. package/skills/incident-postmortem/evals/triggers.json +14 -0
  405. package/skills/inventory-demand-planning/SKILL.md +89 -0
  406. package/skills/inventory-demand-planning/evals/triggers.json +16 -0
  407. package/skills/inventory-demand-planning/references/formulas.md +62 -0
  408. package/skills/investor-materials/SKILL.md +127 -0
  409. package/skills/investor-materials/evals/triggers.json +16 -0
  410. package/skills/investor-materials/references/templates.md +74 -0
  411. package/skills/invoicing-and-tax/SKILL.md +84 -0
  412. package/skills/invoicing-and-tax/evals/triggers.json +17 -0
  413. package/skills/invoicing-and-tax/references/e-invoicing.md +24 -0
  414. package/skills/invoicing-and-tax/references/invoice-fields.md +38 -0
  415. package/skills/invoicing-and-tax/references/rounding.md +26 -0
  416. package/skills/java-patterns/SKILL.md +141 -0
  417. package/skills/java-patterns/evals/triggers.json +17 -0
  418. package/skills/java-testing/SKILL.md +142 -0
  419. package/skills/java-testing/evals/triggers.json +16 -0
  420. package/skills/jetpack-compose-patterns/SKILL.md +88 -0
  421. package/skills/jetpack-compose-patterns/evals/triggers.json +16 -0
  422. package/skills/jira-integration/SKILL.md +92 -0
  423. package/skills/jira-integration/evals/triggers.json +17 -0
  424. package/skills/jpa-hibernate/SKILL.md +92 -0
  425. package/skills/jpa-hibernate/evals/triggers.json +18 -0
  426. package/skills/jpa-hibernate/references/mapping.md +99 -0
  427. package/skills/kotlin-multiplatform/SKILL.md +97 -0
  428. package/skills/kotlin-multiplatform/evals/triggers.json +16 -0
  429. package/skills/kotlin-patterns/SKILL.md +128 -0
  430. package/skills/kotlin-patterns/evals/triggers.json +16 -0
  431. package/skills/kotlin-testing/SKILL.md +117 -0
  432. package/skills/kotlin-testing/evals/triggers.json +16 -0
  433. package/skills/ktor-patterns/SKILL.md +135 -0
  434. package/skills/ktor-patterns/evals/triggers.json +18 -0
  435. package/skills/kubernetes-patterns/SKILL.md +106 -0
  436. package/skills/kubernetes-patterns/evals/triggers.json +16 -0
  437. package/skills/kubernetes-patterns/references/manifests.md +115 -0
  438. package/skills/laravel-patterns/SKILL.md +136 -0
  439. package/skills/laravel-patterns/evals/triggers.json +16 -0
  440. package/skills/linear-integration/SKILL.md +98 -0
  441. package/skills/linear-integration/evals/triggers.json +17 -0
  442. package/skills/literature-review/SKILL.md +109 -0
  443. package/skills/literature-review/evals/triggers.json +16 -0
  444. package/skills/literature-review/references/appraisal.md +41 -0
  445. package/skills/literature-review/references/search-sources.md +39 -0
  446. package/skills/llm-app-patterns/SKILL.md +97 -0
  447. package/skills/llm-app-patterns/evals/triggers.json +17 -0
  448. package/skills/llm-evals/SKILL.md +98 -0
  449. package/skills/llm-evals/evals/triggers.json +16 -0
  450. package/skills/llm-evals/references/graders.md +66 -0
  451. package/skills/logistics-exception-management/SKILL.md +90 -0
  452. package/skills/logistics-exception-management/evals/triggers.json +16 -0
  453. package/skills/manim-animations/SKILL.md +106 -0
  454. package/skills/manim-animations/evals/triggers.json +16 -0
  455. package/skills/market-research/SKILL.md +117 -0
  456. package/skills/market-research/evals/triggers.json +16 -0
  457. package/skills/marketing-campaign/SKILL.md +111 -0
  458. package/skills/marketing-campaign/evals/triggers.json +16 -0
  459. package/skills/mcp-server-patterns/SKILL.md +127 -0
  460. package/skills/mcp-server-patterns/evals/triggers.json +18 -0
  461. package/skills/mcp-server-patterns/references/protocol-notes.md +68 -0
  462. package/skills/metrics-dashboards/SKILL.md +113 -0
  463. package/skills/metrics-dashboards/evals/triggers.json +16 -0
  464. package/skills/ml-experiment-workflow/SKILL.md +125 -0
  465. package/skills/ml-experiment-workflow/evals/triggers.json +16 -0
  466. package/skills/mongodb-patterns/SKILL.md +115 -0
  467. package/skills/mongodb-patterns/evals/triggers.json +18 -0
  468. package/skills/mongodb-patterns/references/indexes-and-aggregation.md +94 -0
  469. package/skills/mpesa-daraja-integration/SKILL.md +70 -0
  470. package/skills/mpesa-daraja-integration/evals/triggers.json +16 -0
  471. package/skills/mpesa-daraja-integration/references/api.md +103 -0
  472. package/skills/mpesa-daraja-integration/references/callbacks.md +74 -0
  473. package/skills/mtn-momo-integration/SKILL.md +66 -0
  474. package/skills/mtn-momo-integration/evals/triggers.json +16 -0
  475. package/skills/mtn-momo-integration/references/api.md +153 -0
  476. package/skills/mtn-momo-integration/references/callbacks.md +92 -0
  477. package/skills/mtn-momo-integration/references/sandbox-and-go-live.md +51 -0
  478. package/skills/mtn-momo-integration/scripts/sandbox-setup.js +79 -0
  479. package/skills/mysql-patterns/SKILL.md +96 -0
  480. package/skills/mysql-patterns/evals/triggers.json +16 -0
  481. package/skills/mysql-patterns/references/explain.md +34 -0
  482. package/skills/mysql-patterns/references/online-ddl.md +41 -0
  483. package/skills/nestjs-patterns/SKILL.md +114 -0
  484. package/skills/nestjs-patterns/evals/triggers.json +16 -0
  485. package/skills/nestjs-patterns/references/testing.md +68 -0
  486. package/skills/network-automation/SKILL.md +107 -0
  487. package/skills/network-automation/evals/triggers.json +18 -0
  488. package/skills/network-automation/references/tool-snippets.md +153 -0
  489. package/skills/network-troubleshooting/SKILL.md +152 -0
  490. package/skills/network-troubleshooting/evals/triggers.json +18 -0
  491. package/skills/network-troubleshooting/references/commands.md +33 -0
  492. package/skills/nextjs-patterns/SKILL.md +150 -0
  493. package/skills/nextjs-patterns/evals/triggers.json +18 -0
  494. package/skills/nextjs-patterns/references/caching.md +87 -0
  495. package/skills/node-backend-patterns/SKILL.md +103 -0
  496. package/skills/node-backend-patterns/evals/triggers.json +16 -0
  497. package/skills/node-backend-patterns/references/templates.md +122 -0
  498. package/skills/nuxt-patterns/SKILL.md +103 -0
  499. package/skills/nuxt-patterns/evals/triggers.json +16 -0
  500. package/skills/parallel-agent-orchestration/SKILL.md +106 -0
  501. package/skills/parallel-agent-orchestration/evals/triggers.json +14 -0
  502. package/skills/paystack-integration/SKILL.md +59 -0
  503. package/skills/paystack-integration/evals/triggers.json +14 -0
  504. package/skills/paystack-integration/references/api.md +73 -0
  505. package/skills/paystack-integration/references/mobile-money.md +50 -0
  506. package/skills/paystack-integration/references/webhooks.md +80 -0
  507. package/skills/pci-dss-scope/SKILL.md +103 -0
  508. package/skills/pci-dss-scope/evals/triggers.json +18 -0
  509. package/skills/pci-dss-scope/references/saq-and-data.md +36 -0
  510. package/skills/perl-patterns/SKILL.md +135 -0
  511. package/skills/perl-patterns/evals/triggers.json +18 -0
  512. package/skills/perl-testing/SKILL.md +126 -0
  513. package/skills/perl-testing/evals/triggers.json +17 -0
  514. package/skills/php-patterns/SKILL.md +116 -0
  515. package/skills/php-patterns/evals/triggers.json +16 -0
  516. package/skills/php-testing/SKILL.md +123 -0
  517. package/skills/php-testing/evals/triggers.json +16 -0
  518. package/skills/postgres-patterns/SKILL.md +103 -0
  519. package/skills/postgres-patterns/evals/triggers.json +17 -0
  520. package/skills/postgres-patterns/references/explain.md +59 -0
  521. package/skills/postgres-patterns/references/locks.md +53 -0
  522. package/skills/prd-writing/SKILL.md +124 -0
  523. package/skills/prd-writing/evals/triggers.json +15 -0
  524. package/skills/prisma-patterns/SKILL.md +83 -0
  525. package/skills/prisma-patterns/evals/triggers.json +18 -0
  526. package/skills/prisma-patterns/references/prisma-8.md +46 -0
  527. package/skills/prisma-patterns/references/workflow.md +50 -0
  528. package/skills/privacy-compliance/SKILL.md +121 -0
  529. package/skills/privacy-compliance/evals/triggers.json +18 -0
  530. package/skills/privacy-compliance/references/jurisdictions.md +51 -0
  531. package/skills/production-scheduling/SKILL.md +98 -0
  532. package/skills/production-scheduling/evals/triggers.json +16 -0
  533. package/skills/prompt-engineering/SKILL.md +92 -0
  534. package/skills/prompt-engineering/evals/triggers.json +16 -0
  535. package/skills/python-patterns/SKILL.md +107 -0
  536. package/skills/python-patterns/evals/triggers.json +16 -0
  537. package/skills/python-patterns/references/tooling.md +101 -0
  538. package/skills/python-testing/SKILL.md +126 -0
  539. package/skills/python-testing/evals/triggers.json +16 -0
  540. package/skills/python-testing/references/mocking.md +71 -0
  541. package/skills/pytorch-patterns/SKILL.md +139 -0
  542. package/skills/pytorch-patterns/evals/triggers.json +16 -0
  543. package/skills/pytorch-patterns/references/debugging.md +39 -0
  544. package/skills/quarkus-patterns/SKILL.md +93 -0
  545. package/skills/quarkus-patterns/evals/triggers.json +18 -0
  546. package/skills/rag-pipeline-patterns/SKILL.md +117 -0
  547. package/skills/rag-pipeline-patterns/evals/triggers.json +18 -0
  548. package/skills/rag-pipeline-patterns/references/evaluation.md +37 -0
  549. package/skills/rag-pipeline-patterns/references/retrieval-recipes.md +78 -0
  550. package/skills/rails-patterns/SKILL.md +132 -0
  551. package/skills/rails-patterns/evals/triggers.json +16 -0
  552. package/skills/react-native-patterns/SKILL.md +101 -0
  553. package/skills/react-native-patterns/evals/triggers.json +16 -0
  554. package/skills/react-patterns/SKILL.md +140 -0
  555. package/skills/react-patterns/evals/triggers.json +18 -0
  556. package/skills/react-performance/SKILL.md +107 -0
  557. package/skills/react-performance/evals/triggers.json +18 -0
  558. package/skills/redis-patterns/SKILL.md +109 -0
  559. package/skills/redis-patterns/evals/triggers.json +18 -0
  560. package/skills/redis-patterns/references/operations.md +61 -0
  561. package/skills/refactoring-safely/SKILL.md +107 -0
  562. package/skills/refactoring-safely/evals/triggers.json +17 -0
  563. package/skills/release-management/SKILL.md +141 -0
  564. package/skills/release-management/evals/triggers.json +16 -0
  565. package/skills/remotion-video/SKILL.md +91 -0
  566. package/skills/remotion-video/evals/triggers.json +16 -0
  567. package/skills/remotion-video/references/lambda.md +66 -0
  568. package/skills/returns-reverse-logistics/SKILL.md +97 -0
  569. package/skills/returns-reverse-logistics/evals/triggers.json +16 -0
  570. package/skills/ruby-patterns/SKILL.md +127 -0
  571. package/skills/ruby-patterns/evals/triggers.json +18 -0
  572. package/skills/ruby-testing/SKILL.md +113 -0
  573. package/skills/ruby-testing/evals/triggers.json +18 -0
  574. package/skills/runbook-writing/SKILL.md +101 -0
  575. package/skills/runbook-writing/evals/triggers.json +14 -0
  576. package/skills/rust-patterns/SKILL.md +118 -0
  577. package/skills/rust-patterns/evals/triggers.json +16 -0
  578. package/skills/rust-patterns/references/cargo-and-clippy.md +105 -0
  579. package/skills/rust-patterns/references/errors-and-traits.md +97 -0
  580. package/skills/rust-testing/SKILL.md +148 -0
  581. package/skills/rust-testing/evals/triggers.json +16 -0
  582. package/skills/rust-testing/references/fakes-proptest-async.md +113 -0
  583. package/skills/search-first/SKILL.md +73 -0
  584. package/skills/search-first/evals/triggers.json +14 -0
  585. package/skills/security-review/SKILL.md +58 -0
  586. package/skills/security-review/evals/triggers.json +14 -0
  587. package/skills/security-review/references/checklist.md +54 -0
  588. package/skills/security-review/scripts/scan-secrets.js +79 -0
  589. package/skills/seo-audit/SKILL.md +111 -0
  590. package/skills/seo-audit/evals/triggers.json +16 -0
  591. package/skills/seo-audit/references/checks.md +65 -0
  592. package/skills/session-handoff/SKILL.md +101 -0
  593. package/skills/session-handoff/evals/triggers.json +14 -0
  594. package/skills/skill-authoring/SKILL.md +87 -0
  595. package/skills/skill-authoring/evals/triggers.json +14 -0
  596. package/skills/skill-authoring/references/frontmatter.md +40 -0
  597. package/skills/slack-app-integration/SKILL.md +108 -0
  598. package/skills/slack-app-integration/evals/triggers.json +17 -0
  599. package/skills/smart-contract-security/SKILL.md +110 -0
  600. package/skills/smart-contract-security/evals/triggers.json +16 -0
  601. package/skills/smart-contract-security/references/vulnerability-checklist.md +79 -0
  602. package/skills/social-media-publishing/SKILL.md +84 -0
  603. package/skills/social-media-publishing/evals/triggers.json +17 -0
  604. package/skills/social-media-publishing/references/platform-apis.md +116 -0
  605. package/skills/solidity-patterns/SKILL.md +95 -0
  606. package/skills/solidity-patterns/evals/triggers.json +16 -0
  607. package/skills/spring-boot-patterns/SKILL.md +128 -0
  608. package/skills/spring-boot-patterns/evals/triggers.json +18 -0
  609. package/skills/spring-boot-patterns/references/testing.md +72 -0
  610. package/skills/stripe-integration/SKILL.md +69 -0
  611. package/skills/stripe-integration/evals/triggers.json +16 -0
  612. package/skills/stripe-integration/references/api.md +71 -0
  613. package/skills/stripe-integration/references/billing.md +58 -0
  614. package/skills/stripe-integration/references/webhooks.md +76 -0
  615. package/skills/subscription-billing-ops/SKILL.md +118 -0
  616. package/skills/subscription-billing-ops/evals/triggers.json +17 -0
  617. package/skills/subscription-billing-ops/references/proration.md +47 -0
  618. package/skills/subscription-billing-ops/references/revenue-metrics.md +38 -0
  619. package/skills/svelte-patterns/SKILL.md +122 -0
  620. package/skills/svelte-patterns/evals/triggers.json +16 -0
  621. package/skills/swift-patterns/SKILL.md +113 -0
  622. package/skills/swift-patterns/evals/triggers.json +16 -0
  623. package/skills/swift-patterns/references/concurrency-migration.md +40 -0
  624. package/skills/swift-testing/SKILL.md +121 -0
  625. package/skills/swift-testing/evals/triggers.json +16 -0
  626. package/skills/swift-testing/references/swift-testing-cheatsheet.md +81 -0
  627. package/skills/swiftui-patterns/SKILL.md +102 -0
  628. package/skills/swiftui-patterns/evals/triggers.json +16 -0
  629. package/skills/tdd-workflow/SKILL.md +67 -0
  630. package/skills/tdd-workflow/evals/triggers.json +14 -0
  631. package/skills/technical-writing/SKILL.md +95 -0
  632. package/skills/technical-writing/evals/triggers.json +14 -0
  633. package/skills/terraform-patterns/SKILL.md +122 -0
  634. package/skills/terraform-patterns/evals/triggers.json +16 -0
  635. package/skills/terraform-patterns/references/backends.md +67 -0
  636. package/skills/test-coverage-improvement/SKILL.md +107 -0
  637. package/skills/test-coverage-improvement/evals/triggers.json +16 -0
  638. package/skills/threat-modeling/SKILL.md +113 -0
  639. package/skills/threat-modeling/evals/triggers.json +16 -0
  640. package/skills/typescript-patterns/SKILL.md +122 -0
  641. package/skills/typescript-patterns/evals/triggers.json +16 -0
  642. package/skills/typescript-testing/SKILL.md +101 -0
  643. package/skills/typescript-testing/evals/triggers.json +16 -0
  644. package/skills/verification-loop/SKILL.md +70 -0
  645. package/skills/verification-loop/evals/triggers.json +14 -0
  646. package/skills/verification-loop/scripts/detect-checks.js +102 -0
  647. package/skills/vite-patterns/SKILL.md +117 -0
  648. package/skills/vite-patterns/evals/triggers.json +16 -0
  649. package/skills/vue-patterns/SKILL.md +104 -0
  650. package/skills/vue-patterns/evals/triggers.json +16 -0
  651. package/skills/web-accessibility/SKILL.md +119 -0
  652. package/skills/web-accessibility/evals/triggers.json +16 -0
  653. package/skills/web-performance/SKILL.md +107 -0
  654. package/skills/web-performance/evals/triggers.json +16 -0
  655. package/skills/web-scraping/SKILL.md +80 -0
  656. package/skills/web-scraping/evals/triggers.json +16 -0
@@ -0,0 +1,74 @@
1
+ # Investor materials: templates
2
+
3
+ Read this when drafting. Replace every `<...>` with the founder's facts; leave a visible `TODO` where a fact is missing instead of guessing.
4
+
5
+ ## Pitch deck slide prompts
6
+
7
+ | Slide | Headline pattern | Body | Check |
8
+ |---|---|---|---|
9
+ | Title | `<Company>: <what it does for whom>` | Logo, contact, round | Understandable without speaking |
10
+ | Problem | `<Customer> loses <cost> because <cause>` | Quote or data point, current workaround | Specific customer, not "everyone" |
11
+ | Solution | `<Product> lets <customer> <outcome>` | Screenshot or 3-step flow | Shows the product |
12
+ | Why now | `<Change> makes this possible now` | 1-3 changes with dates | Real change, not hype |
13
+ | Traction | `<Metric> grew <x> in <period>` | One chart, 2-3 supporting numbers | Dates, definitions, axes |
14
+ | Market | `<N> <customers> x <price> = <size>` | Bottom-up arithmetic, sources | Shows the calculation |
15
+ | Business model | `We earn <price> per <unit>` | Pricing, margin, unit economics | Matches traction numbers |
16
+ | Competition | `Customers choose us because <reason>` | Matrix or table of alternatives | Includes "do nothing" |
17
+ | Go-to-market | `We acquire customers through <channel>` | Current CAC or conversion if known | Evidence, not plans only |
18
+ | Team | `<Team> has done <relevant thing>` | Founders, key hires, advisers | Relevance to this problem |
19
+ | Ask | `Raising <amount> to reach <milestone>` | Instrument, use of funds, runway | Percentages sum to 100 |
20
+
21
+ ## One-pager
22
+
23
+ ```
24
+ # <Company>: <one-line description>
25
+ <Website> | <Founder name, email> | Raising <amount> <instrument>
26
+
27
+ **Problem.** <2 sentences>
28
+ **Solution.** <2 sentences>
29
+ **Traction.** <best metric with date>; <2 supporting numbers>
30
+ **Market.** <bottom-up size, one line of arithmetic>
31
+ **Business model.** <how you charge, price>
32
+ **Competition.** <alternatives and why customers pick you>
33
+ **Team.** <founders, one line each>
34
+ **The ask.** <amount>, <use of funds in 3 buckets>, reaching <milestone> with <n> months runway
35
+ ```
36
+
37
+ ## Investor update (email)
38
+
39
+ ```
40
+ Subject: <Company> update, <Month Year>: <headline>
41
+
42
+ Hi all,
43
+
44
+ TL;DR: <one line>
45
+
46
+ | Metric | This period | Last period | Change |
47
+ |---|---|---|---|
48
+ | <MRR> | | | |
49
+ | <Active customers> | | | |
50
+ | <Burn / month> | | | |
51
+ | Runway (months) | | | |
52
+
53
+ Wins
54
+ - <...>
55
+
56
+ Challenges
57
+ - <problem>, what we are doing: <action>
58
+
59
+ Asks
60
+ - <specific intro: name or profile, why>
61
+
62
+ Thanks,
63
+ <Founder>
64
+ ```
65
+
66
+ ## Review checklist
67
+
68
+ - [ ] Narrative fits in five sentences and every slide supports one.
69
+ - [ ] Each metric is defined and dated, and matches across documents.
70
+ - [ ] The ask has an amount, instrument, use of funds and milestone.
71
+ - [ ] Market size includes a bottom-up calculation.
72
+ - [ ] Competition slide names real alternatives.
73
+ - [ ] Projections are labelled as projections.
74
+ - [ ] No claim without a source the founder can show.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: invoicing-and-tax
3
+ description: Guides software teams through issuing legally usable invoices and charging sales tax, VAT or GST correctly, covering required invoice fields and sequential numbering, choosing a tax calculation service or merchant of record over hand-rolled rate tables, registration thresholds and nexus at a high level, reverse charge for B2B, tax-inclusive versus exclusive pricing, line-level rounding, and national e-invoicing mandates such as Peppol, KSeF and Factur-X, with a firm handoff to a qualified accountant for anything that is a tax position. Use when building or fixing invoice generation, adding VAT or sales tax to checkout, deciding whether to integrate Avalara, Stripe Tax or a merchant of record, or preparing for an e-invoicing deadline in a country you sell into.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Provider-neutral. Tax thresholds, rates and mandate dates change often; the agent must check official sources before quoting them.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: business
9
+ kete-loom/risk: writes-files
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Invoicing and tax
14
+
15
+ Produce invoices that a tax authority would accept and tax amounts a customer can re-add by hand, while keeping every tax *decision* with a qualified person. You build the machinery; an accountant or tax adviser decides where you are registered, what is taxable and at which rate.
16
+
17
+ ## What this skill does not cover
18
+
19
+ - It is not tax or legal advice. It does not decide whether a product is taxable, whether you have nexus or a VAT obligation somewhere, which rate or exemption applies, or how to file returns.
20
+ - It does not cover payroll tax, income or corporate tax, customs duties (see `customs-trade-compliance` if installed), or revenue recognition policy.
21
+ - Thresholds, rates and deadlines in this skill and its references are orientation only and may be out of date. Before relying on one, check the tax authority's own site and say which source and date you used.
22
+
23
+ **Stop and ask for a qualified accountant or tax adviser** before: registering or not registering somewhere, choosing a product tax code or exemption, applying reverse charge or zero rating, issuing invoices in a new country, changing how past invoices were taxed, or answering a customer's tax dispute.
24
+
25
+ ## Ground rules
26
+
27
+ 1. **Never hand-roll rate tables** for more than a single jurisdiction you are registered in. Rates, product taxability and US local jurisdictions change constantly. Use a tax engine (Avalara AvaTax, Stripe Tax, Anrok, TaxJar, Quaderno and similar) or a merchant of record (Paddle, Lemon Squeezy and similar), which becomes the seller and takes on the tax liability.
28
+ 2. **Store the tax decision on the invoice line**, not just the result: jurisdiction, rate, tax code, taxable amount, tax amount, and the engine's transaction or calculation ID. You must be able to explain an old invoice after rates change.
29
+ 3. **Invoices are immutable once issued.** Correct with a credit note that references the original and reverses its tax in proportion. Never edit, renumber or delete.
30
+ 4. **Numbering**: one sequential series per legal entity (and per series type if the jurisdiction allows), assigned at finalisation inside a transaction, no reuse. Many VAT regimes require a unique sequential number; gaps need an explanation.
31
+ 5. **Money is integer minor units plus currency.** Round with the method the jurisdiction specifies, at the level it specifies (line or invoice total). Details in `references/rounding.md`.
32
+ 6. **Customer location evidence** is stored with each sale (billing address, IP country, payment method country, VAT ID validation result) because B2C digital sales in many regimes are taxed where the customer is.
33
+ 7. **Validate B2B tax IDs** before applying reverse charge: EU VAT numbers via the EU [VIES](https://ec.europa.eu/taxation_customs/vies/) service, UK VAT numbers via HMRC's [check a UK VAT number](https://www.gov.uk/check-uk-vat-number) service, and store the check result and timestamp.
34
+
35
+ ## Workflow
36
+
37
+ 1. **Inventory.** Search the codebase for invoice generation, PDF templates, numbering, tax calculation, the checkout price display, and credit notes. List which legal entity issues invoices and where customers are.
38
+ 2. **Ask the user for the tax position** (from their accountant): where they are registered, products' tax codes, whether prices are tax-inclusive per market, B2B vs B2C mix. If unknown, stop; don't guess.
39
+ 3. **Pick the approach** with the table below and confirm with the user.
40
+ 4. **Required fields.** Check the invoice against the jurisdiction's list. EU baseline is in `references/invoice-fields.md`; others vary.
41
+ 5. **Integrate the engine**: calculate at quote/checkout with the full address and tax IDs, commit (record) the transaction when the invoice is finalised, and void or refund it in the engine when you issue a credit note. Calculate-only calls without commits leave the engine's reports empty.
42
+ 6. **Prices display**: show tax-inclusive prices to consumers where that is the norm (EU, UK, Australia) and tax-exclusive plus tax at checkout where that is the norm (US). Decide per market with the user.
43
+ 7. **E-invoicing**: check whether any country you invoice in mandates structured e-invoices for your customer type; see `references/e-invoicing.md`. Usually this means an accredited provider or Peppol access point, not building the transmission yourself.
44
+ 8. **Test** with fixtures: one domestic B2C, one domestic B2B, one cross-border B2B with a valid tax ID (reverse charge), one with an invalid tax ID, one US address in a taxing state, a refund producing a credit note, a multi-line invoice that stresses rounding.
45
+
46
+ ## Choose the approach
47
+
48
+ | Situation | Usually |
49
+ |---|---|
50
+ | One country, registered there, simple products | Engine is optional; a reviewed, tested rate config for that one country is acceptable |
51
+ | Selling to consumers in many countries, small team | Merchant of record, or a tax engine plus registrations your adviser sets up |
52
+ | US sales across states | Tax engine; economic nexus thresholds differ by state |
53
+ | Marketplace or platform paying out to sellers | Stop and ask; marketplace facilitator rules may make you the collector |
54
+ | Large B2B, ERP-driven | Tax engine integrated with the ERP; invoices issued from one system only |
55
+
56
+ ## Thresholds at a high level
57
+
58
+ Registration duty depends on where you are established, what you sell and to whom. Orientation only, all to be verified with the authority before use:
59
+
60
+ - **US sales tax**: since [*South Dakota v. Wayfair*](https://www.supremecourt.gov/opinions/17pdf/17-494_j4el.pdf) (2018), states can require remote sellers to collect once they cross an economic nexus threshold. The South Dakota law upheld there used more than 100,000 USD of sales or 200 transactions a year into the state; each state sets its own figures and tests, so check that state's revenue department. Taxability of SaaS and digital goods differs by state.
61
+ - **EU VAT**: a seller established in only one EU member state has a 10,000 EUR EU-wide annual threshold (current and preceding calendar year) for cross-border B2C telecoms, broadcasting and electronic services and intra-EU distance sales of goods; above it, VAT is due in the customer's country, usually declared via the [One Stop Shop](https://vat-one-stop-shop.ec.europa.eu/one-stop-shop_en) (OSS). Sellers not established in the EU have no threshold for B2C services and use the non-Union OSS.
62
+ - **UK VAT**: [registration threshold](https://www.gov.uk/register-for-vat) 90,000 GBP of taxable turnover over the last 12 months, or expected within the next 30 days, for UK-established businesses; [non-established taxable persons](https://www.gov.uk/government/publications/vat-notice-7001-should-i-be-registered-for-vat/vat-notice-7001-should-i-be-registered-for-vat) must register on their first UK taxable supply, with no threshold.
63
+ - **Others** (Australia, Canada, India, Norway, Switzerland, Singapore, many more) have their own regimes for foreign digital sellers. Look them up per country.
64
+
65
+ ## Never
66
+
67
+ - Never present computed tax as advice, or tell a user they don't need to register somewhere.
68
+ - Never silently apply 0% because a tax ID field is non-empty; validate it.
69
+ - Never recalculate tax on an issued invoice with today's rates.
70
+ - Never compute tax on floats or round the total separately from lines without a defined rule.
71
+ - Never generate invoices from two systems for the same sale (for example, both the payment provider and your app).
72
+
73
+ ## Report format
74
+
75
+ When reviewing or designing, return:
76
+
77
+ ```
78
+ Issuing entity and series: <entity, numbering scheme>
79
+ Approach: <engine | merchant of record | single-country config>
80
+ Markets checked: <country: B2B/B2C, registered?, inclusive/exclusive, e-invoice mandate?, source + date checked>
81
+ Field gaps: <missing required fields per market>
82
+ Rounding rule: <method, level>
83
+ Needs accountant decision: <list>
84
+ ```
@@ -0,0 +1,17 @@
1
+ {
2
+ "should_trigger": [
3
+ "Our generated PDF invoices are missing the customer's VAT number and the reverse charge note for EU business customers",
4
+ "Should we integrate Avalara or Stripe Tax, or switch to a merchant of record like Paddle for selling SaaS worldwide?",
5
+ "Belgium now requires Peppol e-invoices for B2B; what do we need to change in our invoicing system?",
6
+ "Tax on our invoices is off by a cent compared with the total; should VAT be rounded per line or per invoice?",
7
+ "We start selling to US customers in several states. How do we figure out where we need to collect sales tax?",
8
+ "Make our invoice numbers sequential and gap-free per legal entity, they currently use random IDs"
9
+ ],
10
+ "should_not_trigger": [
11
+ "Implement mid-cycle proration when a customer upgrades from the monthly to the annual plan",
12
+ "Classify our product under the right HS code for importing into the EU",
13
+ "Sync invoices from our app into Xero with the right account codes",
14
+ "Check our payroll setup for the right employer tax withholding",
15
+ "Review this pull request that changes how invoice totals are calculated"
16
+ ]
17
+ }
@@ -0,0 +1,24 @@
1
+ # E-invoicing mandates
2
+
3
+ An e-invoice here means a structured, machine-readable invoice (XML such as UBL or CII), often sent through a network or a government platform. A PDF by email is not one.
4
+
5
+ **Dates below were checked against the national authorities' own pages in October 2026 (linked in the table) and change often. Check the authority again before acting, and record the source and date you used.**
6
+
7
+ | Country | Status as reported | Format / channel |
8
+ |---|---|---|
9
+ | Italy ([Agenzia delle Entrate](https://www.agenziaentrate.gov.it/portale/web/guest/schede/comunicazioni/fatture-e-corrispettivi/faq-fe/risposte-alle-domande-piu-frequenti-categoria/emissione-delle-fatture-elettroniche-imprese)) | Domestic B2B and B2C via SDI since 1 Jan 2019 (consumers can get a paper or PDF copy) | FatturaPA XML through Sistema di Interscambio |
10
+ | Germany ([BMF FAQ](https://www.bundesfinanzministerium.de/Content/DE/FAQ/e-rechnung.html)) | Domestic B2B: all businesses must be able to receive e-invoices since 1 Jan 2025. Other invoice types allowed until 31 Dec 2026, or until 31 Dec 2027 for issuers with prior-year turnover up to 800,000 EUR. So issuing is mandatory from 1 Jan 2027 for larger issuers and from 1 Jan 2028 for all | EN 16931 formats such as XRechnung or ZUGFeRD/Factur-X |
11
+ | Belgium ([einvoice.belgium.be](https://einvoice.belgium.be/en/article/structured-electronic-invoices-between-companies-are-compulsory-2026)) | Structured e-invoices mandatory between Belgian VAT-registered businesses since 1 Jan 2026; not for consumers; cross-border out of scope until ViDA | Peppol network, Peppol BIS as the reference format |
12
+ | Poland ([ksef.podatki.gov.pl](https://ksef.podatki.gov.pl/informacje-ogolne-ksef-20/zakres-obowiazkowego-ksef/)) | Receiving via KSeF mandatory for all from 1 Feb 2026; issuing from 1 Feb 2026 for taxpayers with 2024 sales over 200m PLN, from 1 Apr 2026 for others; those invoicing at most 10,000 PLN gross a month have until the end of 2026 | National KSeF platform, structured XML |
13
+ | France ([impots.gouv.fr](https://www.impots.gouv.fr/facturation-electronique-et-plateformes-agreees)) | Receiving for all businesses, and issuing plus e-reporting for large and mid-size (GE, ETI), from 1 Sep 2026; issuing for SMEs and micro-businesses from 1 Sep 2027 | Via approved platforms (plateformes agréées); check DGFiP's specifications for the accepted formats |
14
+ | EU-wide ([ViDA](https://taxation-customs.ec.europa.eu/taxation/vat/vat-digital-age-vida_en)) | VAT in the Digital Age package adopted 11 Mar 2025; mandatory e-invoicing with digital reporting for intra-EU B2B transactions from 1 Jul 2030; national systems to align by 1 Jan 2035 | EN 16931 baseline |
15
+
16
+ Outside the EU, mandates exist in many countries (for example India, Mexico, Saudi Arabia, Malaysia, Türkiye, Brazil) with their own schemas and clearance steps.
17
+
18
+ ## What it means for a software team
19
+
20
+ 1. List where your customers are and which are businesses. Mandates mostly target domestic B2B first.
21
+ 2. Most teams connect to an accredited provider or a Peppol access point rather than implementing the network or government API directly.
22
+ 3. Your invoice data must already contain everything the format needs: buyer tax ID, structured address, per-line tax category codes, unit codes, payment means. Gaps here are the usual blocker.
23
+ 4. Archive the structured invoice as sent, for the retention period the country requires.
24
+ 5. Receiving is also a mandate in some countries; check whether you must accept supplier e-invoices in your accounts payable process.
@@ -0,0 +1,38 @@
1
+ # Invoice fields
2
+
3
+ ## EU VAT invoice baseline
4
+
5
+ The EU VAT Directive ([2006/112/EC](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02006L0112-20250414), Article 226) lists what a full VAT invoice must show. Member states implement it in national law and may add rules, so check the country's guidance too. Summary of the list:
6
+
7
+ 1. Date of issue
8
+ 2. Sequential number that uniquely identifies the invoice
9
+ 3. Supplier's VAT identification number
10
+ 4. Customer's VAT identification number where the customer is liable for the tax (reverse charge) or for intra-EU supplies of goods
11
+ 5. Full name and address of supplier and customer
12
+ 6. Quantity and nature of goods, or extent and nature of services
13
+ 7. Date of supply or payment, if different from the issue date
14
+ 8. Taxable amount per rate or exemption, unit price excluding VAT, and any discounts not included in the unit price
15
+ 9. VAT rate applied
16
+ 10. VAT amount payable
17
+ 11. Where exempt or reverse charged, a reference to the provision or the wording such as "Reverse charge"
18
+ 12. Other mentions where they apply: "Self-billing", "Cash accounting", the margin scheme wording, new means of transport details, a tax representative's VAT number, name and address
19
+
20
+ The invoice may be in any currency, but the VAT payable must also be expressed in the national currency of the member state (Article 230).
21
+
22
+ Simplified invoices with fewer fields (Article 226b) are allowed for low amounts; the limit is set nationally within the Directive's rules.
23
+
24
+ ## Fields that help everywhere
25
+
26
+ - Legal entity name, registered address, company number where local law requires it
27
+ - Payment terms, due date, how to pay
28
+ - Purchase order number when the customer gives one
29
+ - Service period for subscriptions (`1 Apr 2026 – 30 Apr 2026`)
30
+ - For credit notes: "Credit note", own number, and the original invoice number and date
31
+
32
+ ## United States
33
+
34
+ There is no federal invoice format. States set what a sales tax invoice or receipt must show; the tax amount is commonly shown separately. A tax engine's documentation usually lists state requirements.
35
+
36
+ ## Elsewhere
37
+
38
+ Many countries (for example Mexico CFDI, India GST e-invoicing, Brazil NF-e, Saudi Arabia, Türkiye) require government-validated electronic invoices with specific schemas and IDs. Don't generate a PDF and assume it is valid there; use an accredited provider and check the authority's rules.
@@ -0,0 +1,26 @@
1
+ # Tax rounding
2
+
3
+ ## Pick and document
4
+
5
+ - **Level**: per line (compute tax per line, round, sum) or per invoice (sum taxable amounts per rate, compute tax once, round). Some authorities specify one. EN 16931 e-invoices compute VAT per VAT category and rate: the category taxable amount is the sum of line net amounts plus charges minus allowances ([BR-S-08](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-S-08/) for standard rate), and the category tax amount must equal taxable amount × rate, rounded to two decimals ([BR-CO-17](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-CO-17/)). Per-line-rounded tax can fail that check; if you issue e-invoices, use per-invoice-per-rate. Ask the accountant which applies.
6
+ - **Method**: half-up is the usual commercial default; some regimes specify otherwise. Use a decimal type, never binary floats.
7
+ - **Inclusive prices**: tax = gross × rate ÷ (1 + rate). Round tax, then net = gross − tax, so net + tax always equals the advertised gross.
8
+
9
+ ## Example of the difference
10
+
11
+ Three lines of 0.99 (minor units: 99) at 20% VAT, tax-exclusive:
12
+
13
+ ```
14
+ per line: round(99 * 0.20) = round(19.8) = 20 per line → 60 total
15
+ per invoice: round(297 * 0.20) = round(59.4) = 59
16
+ ```
17
+
18
+ A one-unit difference per invoice adds up and makes tax returns disagree with ledgers. Whatever you choose, the tax engine, your invoice PDF and the accounting system must use the same rule.
19
+
20
+ ## Tests worth having
21
+
22
+ - Many small lines at a rate that produces .5 fractions
23
+ - A tax-inclusive price where `gross / (1 + rate)` has a repeating decimal
24
+ - Mixed rates on one invoice (summed per rate)
25
+ - A credit note for one line of a multi-line invoice: its tax must equal the tax originally charged on that line
26
+ - Zero-decimal (JPY) and three-decimal (KWD) currencies
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: java-patterns
3
+ description: Idiomatic modern Java (17 and 21 LTS and later) for writing and restructuring code with records, sealed interfaces, switch pattern matching, Optional, streams, checked versus unchecked exceptions, immutable collections, virtual threads and a standard Maven or Gradle layout. Use when writing new Java classes, modernising pre-17 Java code, choosing between a record, enum or sealed hierarchy, or deciding how to run blocking work concurrently on the JVM.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs a JDK 17 or newer and the project's Maven or Gradle build.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: coding
9
+ kete-loom/risk: writes-files
10
+ kete-loom/requires: "java"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # Modern Java patterns
15
+
16
+ Write Java that the compiler checks for you: model data with types, make illegal states unrepresentable, and keep mutation local.
17
+
18
+ ## 0. Before you write
19
+
20
+ 1. Find the language level the build actually uses: `maven.compiler.release` or `<release>` in `pom.xml`, or `java { toolchain { languageVersion = ... } }` / `options.release` in `build.gradle(.kts)`. Use only features that level allows. Never raise it without asking the user.
21
+ 2. Match the codebase: if it already uses Lombok, Vavr, Guava or a null-annotation library (JSpecify, JetBrains, Checker Framework), follow that convention rather than mixing styles.
22
+ 3. Feature floor, by release: records (16), sealed classes (17), pattern matching for `switch` and record patterns (21), virtual threads (21), unnamed variables `_` (22), scoped values (25). Preview features need `--enable-preview`; don't introduce them unless the project already does.
23
+
24
+ ## 1. Model data
25
+
26
+ | Need | Use |
27
+ |---|---|
28
+ | Immutable value with fields, equality by value | `record` |
29
+ | Fixed set of constants | `enum` |
30
+ | One of several shapes with different data | `sealed interface` + `record` implementations |
31
+ | Mutable entity with identity (JPA entity, builder state) | ordinary class |
32
+
33
+ - Validate in the record's compact constructor and copy mutable inputs: `this.items = List.copyOf(items);`.
34
+ - A record's `equals`, `hashCode` and `toString` are generated. If a record holds an array, they compare by reference; prefer a `List`.
35
+ - Don't use records for JPA entities: they need a no-arg constructor, mutability and proxying.
36
+ - Keep sealed hierarchies in one package (or one module) and list `permits` only when the subtypes live in other files.
37
+
38
+ ```java
39
+ sealed interface Payment permits Card, MobileMoney, Cash {}
40
+ record Card(String last4, Money amount) implements Payment {}
41
+ record MobileMoney(String msisdn, Money amount) implements Payment {}
42
+ record Cash(Money amount) implements Payment {}
43
+
44
+ String describe(Payment p) {
45
+ return switch (p) { // exhaustive: no default needed
46
+ case Card c -> "card ending " + c.last4();
47
+ case MobileMoney(var msisdn, var amt) -> "MoMo " + msisdn;
48
+ case Cash cash -> "cash";
49
+ };
50
+ }
51
+ ```
52
+
53
+ Leave `default` out of a switch over a sealed type, so adding a subtype becomes a compile error at every switch that must handle it.
54
+
55
+ ## 2. Null and Optional
56
+
57
+ 1. Return `Optional<T>` from methods where "no result" is a normal outcome (lookups). Never return `null` from a method declared to return `Optional`.
58
+ 2. Don't use `Optional` for fields, parameters or collection elements. Return an empty collection, never `null`.
59
+ 3. Consume with `map`, `filter`, `orElse`, `orElseGet` (when the default is expensive), `orElseThrow`. Avoid `isPresent()` + `get()`.
60
+ 4. Check arguments at public boundaries: `Objects.requireNonNull(x, "x")`.
61
+ 5. `Map.get` returns `null` for missing keys; use `getOrDefault`, `computeIfAbsent` or `containsKey` deliberately.
62
+
63
+ ## 3. Collections and streams
64
+
65
+ - Prefer `List.of`, `Set.of`, `Map.of` and `List.copyOf` for immutable results. They reject `null` elements and throw on mutation.
66
+ - `stream().toList()` (16+) returns an unmodifiable list; `Collectors.toList()` makes no such promise. Pick deliberately when callers mutate the result.
67
+ - Use a stream when the pipeline reads clearly (filter, map, collect). Use a loop when you need early exit with side effects, checked exceptions, or index arithmetic.
68
+ - Never mutate shared state from inside `map` or `forEach` in a stream. Collect instead.
69
+ - `Collectors.toMap` throws on duplicate keys; pass a merge function when duplicates are possible.
70
+ - Don't add `.parallel()` without measuring; it runs on the common ForkJoinPool and rarely helps I/O-bound work.
71
+
72
+ ## 4. Exceptions
73
+
74
+ 1. Throw unchecked exceptions for programming errors and for failures callers can't reasonably recover from. Use checked exceptions only when the caller must handle the case.
75
+ 2. Never swallow: an empty `catch`, or `catch (Exception e) { log.error(e.getMessage()); }`, hides the stack trace. Log the exception object, or rethrow wrapped with the cause: `throw new OrderException("charge failed for " + id, e);`.
76
+ 3. Catch the narrowest type. Don't catch `Throwable` or `Error`.
77
+ 4. Use try-with-resources for anything `AutoCloseable` (streams, JDBC connections, `ExecutorService` on 19+).
78
+ 5. On `InterruptedException`, restore the flag (`Thread.currentThread().interrupt()`) before rethrowing or returning.
79
+
80
+ ## 5. Immutability and equality
81
+
82
+ - Make fields `final` by default. Expose no setters unless a framework needs them.
83
+ - If you override `equals`, override `hashCode` with the same fields. Never use mutable fields in either for objects stored in a `HashSet` or as `HashMap` keys.
84
+ - Compare strings and boxed numbers with `equals`, never `==`. Compare `BigDecimal` values with `compareTo`, because `equals` also compares scale.
85
+ - Use `BigDecimal` (or integer minor units) for money, never `double`.
86
+
87
+ ## 6. Concurrency
88
+
89
+ Choose by workload:
90
+
91
+ | Workload | Use |
92
+ |---|---|
93
+ | Many blocking tasks (HTTP calls, JDBC, file I/O) on 21+ | virtual threads: `Executors.newVirtualThreadPerTaskExecutor()` |
94
+ | CPU-bound work | a fixed pool sized near `Runtime.getRuntime().availableProcessors()` |
95
+ | Composing async results | `CompletableFuture` with an explicit executor |
96
+ | Shared counters / maps | `AtomicLong`, `LongAdder`, `ConcurrentHashMap` |
97
+
98
+ ```java
99
+ try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
100
+ List<Future<Quote>> futures = suppliers.stream()
101
+ .map(s -> executor.submit(() -> s.fetchQuote(order)))
102
+ .toList();
103
+ // close() waits for all tasks
104
+ }
105
+ ```
106
+
107
+ Virtual thread rules:
108
+
109
+ 1. Create one per task; never pool them.
110
+ 2. Limit access to scarce resources (database connections, rate-limited APIs) with a `Semaphore`, not by shrinking a pool.
111
+ 3. Avoid large `ThreadLocal` caches; with millions of threads they multiply memory.
112
+ 4. On JDK 21 to 23, blocking inside `synchronized` pins the carrier thread; use `ReentrantLock` around blocking calls. JDK 24+ removed most of that pinning (JEP 491).
113
+ 5. Virtual threads don't make CPU-bound code faster.
114
+
115
+ General rules: guard every piece of shared mutable state with one lock or make it immutable; never call `Thread.stop`; never block inside a `CompletableFuture` callback on the common pool; give threads and executors names for diagnostics.
116
+
117
+ ## 7. Build layout
118
+
119
+ - Maven and Gradle share the layout: `src/main/java`, `src/main/resources`, `src/test/java`, `src/test/resources`. Packages follow reversed domain names (`com.example.orders`).
120
+ - Use the wrapper the repo ships (`./mvnw`, `./gradlew`), never a globally installed version.
121
+ - Set the language level with `release` (Maven `maven.compiler.release`, Gradle toolchains) rather than `source`/`target`, so the compiler also checks the JDK API level.
122
+ - Pin dependency versions in one place: Maven `<dependencyManagement>` or a BOM; Gradle version catalogs (`gradle/libs.versions.toml`) or platforms.
123
+ - Common commands: `./mvnw -q verify`, `./gradlew build`, `./mvnw dependency:tree`, `./gradlew dependencies --configuration runtimeClasspath`.
124
+
125
+ ## Never
126
+
127
+ - Return `null` for a collection or an `Optional`.
128
+ - Use raw types (`List` instead of `List<String>`).
129
+ - Catch an exception just to log and continue as if it succeeded.
130
+ - Add a dependency for something the JDK already does (`java.net.http.HttpClient`, `java.time`, `HexFormat`).
131
+ - Use `java.util.Date` or `Calendar` in new code; use `java.time` (`Instant`, `LocalDate`, `ZonedDateTime`).
132
+
133
+ ## Stop and ask the user
134
+
135
+ - Before raising the Java release level, adding Lombok, or enabling preview features.
136
+ - Before changing a public API's signature that other modules or services call.
137
+ - When moving existing thread-pool code to virtual threads in a service that holds locks or `ThreadLocal` state you can't fully trace.
138
+
139
+ ## Finish
140
+
141
+ Compile and run the tests with the project's build command. Report what changed, the Java level you targeted, and anything you left on an older pattern on purpose.
@@ -0,0 +1,17 @@
1
+ {
2
+ "should_trigger": [
3
+ "Convert these Java DTO classes to records and use a sealed interface for the payment types",
4
+ "What's the idiomatic way to handle a lookup that may return nothing in Java 21, Optional or null?",
5
+ "Our Spring service makes 200 blocking HTTP calls per request, should I use virtual threads?",
6
+ "Modernise this Java 8 code to Java 17: switch expressions, streams, immutable collections",
7
+ "Should this Java hierarchy be an enum, a record or a sealed interface?"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Write JUnit 5 tests with Mockito for the OrderService class",
11
+ "Maven fails with 'package javax.annotation does not exist' after upgrading to JDK 21, fix the build",
12
+ "Review my Java pull request for resource leaks and equals/hashCode bugs",
13
+ "Convert this Java data class to an idiomatic Kotlin data class",
14
+ "Set up Spring Boot auto-configuration and a REST controller for orders",
15
+ "Map this JPA entity with a lazy OneToMany and fix the N+1 queries in the order list"
16
+ ]
17
+ }
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: java-testing
3
+ description: Writes and repairs JVM tests in Java with JUnit Jupiter, AssertJ assertions, Mockito mocks, parameterized cases, Testcontainers-backed integration tests and Spring Boot test slices, and tracks down flaky tests. Use when adding unit or integration tests to a Java project, choosing between a mock and a real database container, speeding up a slow Java test suite, or diagnosing a JUnit test that passes locally and fails in CI.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs a JDK and the project's Maven or Gradle build; Testcontainers needs a running Docker-compatible engine.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: testing
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "java"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # Java testing
15
+
16
+ Tests that state behaviour, fail for one reason, and run the same way on every machine.
17
+
18
+ ## 0. Before you start
19
+
20
+ 1. Find the test stack in the build file: `junit-jupiter` (JUnit 5, or JUnit 6 which needs Java 17+), `junit:junit` (JUnit 4), `assertj-core`, `mockito-core` / `mockito-junit-jupiter`, `org.testcontainers`, `spring-boot-starter-test`. Use what is there; don't add a second assertion or mocking library.
21
+ 2. Find how tests run: `./mvnw test` (Surefire, unit), `./mvnw verify` (Failsafe, `*IT` classes), `./gradlew test`. Run one class with `./mvnw test -Dtest=OrderServiceTest` or `./gradlew test --tests 'com.example.OrderServiceTest'`.
22
+ 3. Run the suite once and record the result. If it already fails, stop and tell the user which tests fail before you change anything.
23
+
24
+ ## 1. Pick the test level
25
+
26
+ | What you're testing | Level | Tools |
27
+ |---|---|---|
28
+ | Pure logic, value objects, mappers | unit | JUnit + AssertJ, no mocks |
29
+ | A class with collaborators you own | unit | Mockito for the collaborators at the boundary |
30
+ | SQL, migrations, repository queries | integration | Testcontainers with the real database engine |
31
+ | HTTP layer only (Spring) | slice | `@WebMvcTest` + `MockMvc` |
32
+ | JPA repositories only (Spring) | slice | `@DataJpaTest` + Testcontainers |
33
+ | Whole service wiring | integration | `@SpringBootTest`, used sparingly |
34
+
35
+ Rules: don't mock what you don't own (wrap the third-party client and mock the wrapper, or use a fake server); don't mock value objects or records; don't test a database with H2 when production runs PostgreSQL or MySQL, because dialect differences hide bugs.
36
+
37
+ ## 2. Write the test
38
+
39
+ ```java
40
+ class PriceCalculatorTest {
41
+ private final PriceCalculator calc = new PriceCalculator(new FixedTaxRate("0.15"));
42
+
43
+ @Test
44
+ void appliesTaxToSubtotal() {
45
+ Money total = calc.total(List.of(item("10.00"), item("5.00")));
46
+ assertThat(total).isEqualTo(Money.of("17.25"));
47
+ }
48
+
49
+ @ParameterizedTest
50
+ @CsvSource({"0, 0.00", "1, 1.15", "100, 115.00"})
51
+ void scalesLinearly(int qty, String expected) {
52
+ assertThat(calc.total(List.of(item("1.00", qty)))).isEqualTo(Money.of(expected));
53
+ }
54
+
55
+ @Test
56
+ void rejectsEmptyCart() {
57
+ assertThatThrownBy(() -> calc.total(List.of()))
58
+ .isInstanceOf(IllegalArgumentException.class)
59
+ .hasMessageContaining("empty");
60
+ }
61
+ }
62
+ ```
63
+
64
+ - One behaviour per test; name it for the behaviour (`rejectsEmptyCart`), or use `@DisplayName`.
65
+ - Arrange, act, assert, in that order, with no logic (loops, ifs) in the test.
66
+ - Prefer AssertJ (`assertThat(list).containsExactly(...)`, `extracting`, `satisfies`) over bare `assertTrue`, so failures print the values.
67
+ - Parameterize instead of copy-pasting: `@ValueSource`, `@CsvSource`, `@MethodSource`, `@EnumSource`.
68
+ - Test classes and methods can be package-private in JUnit Jupiter; don't add `public`.
69
+
70
+ ## 3. Mockito
71
+
72
+ ```java
73
+ @ExtendWith(MockitoExtension.class)
74
+ class CheckoutServiceTest {
75
+ @Mock PaymentGateway gateway;
76
+ @InjectMocks CheckoutService service;
77
+
78
+ @Test
79
+ void chargesOnceForOrderTotal() {
80
+ when(gateway.charge(any())).thenReturn(ChargeResult.ok("ref-1"));
81
+ service.checkout(order("25.50"));
82
+ verify(gateway).charge(argThat(c -> c.amount().equals(Money.of("25.50"))));
83
+ verifyNoMoreInteractions(gateway);
84
+ }
85
+ }
86
+ ```
87
+
88
+ - `MockitoExtension` uses strict stubs: an unused `when(...)` fails the test. Remove the stub rather than switching to lenient.
89
+ - Stub return values for queries; `verify` only commands (calls whose side effect is the point).
90
+ - Use `ArgumentCaptor` when you need to assert several fields of an argument.
91
+ - Mockito 5 uses the inline mock maker by default, so final classes and records can be mocked; mock them only when there is no simpler real instance.
92
+ - On JDK 21+, Mockito's self-attaching agent prints a dynamic agent loading warning; the fix is to pass the `mockito-core` jar as `-javaagent` in the Surefire `argLine` or Gradle `jvmArgs`. Check Mockito's current docs for the exact snippet.
93
+
94
+ ## 4. Integration tests with Testcontainers
95
+
96
+ ```java
97
+ @Testcontainers
98
+ class OrderRepositoryIT {
99
+ @Container
100
+ static PostgreSQLContainer db = new PostgreSQLContainer("postgres:16-alpine");
101
+ // connect with db.getJdbcUrl(), db.getUsername(), db.getPassword()
102
+ }
103
+ ```
104
+
105
+ - Testcontainers 2.x renamed module artifacts (`org.testcontainers:testcontainers-postgresql`) and moved classes (`org.testcontainers.postgresql.PostgreSQLContainer`, no type parameter); 1.x uses `org.testcontainers:postgresql` and `org.testcontainers.containers.PostgreSQLContainer<?>`. Match the version in the build file.
106
+ - Pin the image tag to the version production runs; never use `latest`.
107
+ - `static` containers start once per class; instance containers restart per test (slow).
108
+ - In Spring Boot 3.1+, annotate the container field with `@ServiceConnection` instead of wiring `@DynamicPropertySource` by hand.
109
+ - With `@DataJpaTest`, if the test still connects to an embedded database, add `@AutoConfigureTestDatabase(replace = Replace.NONE)`.
110
+ - Run the real migrations (Flyway, Liquibase) against the container so schema and code are tested together.
111
+ - Clean data between tests (truncate tables, or a transaction rolled back per test) so order doesn't matter.
112
+ - If Docker isn't available, stop and tell the user; don't fall back to H2 silently.
113
+
114
+ ## 5. Flaky tests
115
+
116
+ Reproduce first: rerun the single test many times (a `@RepeatedTest(50)` locally, or a loop over the single-test command), then the whole class, then with the CI's JVM flags and parallelism.
117
+
118
+ | Symptom | Usual cause | Fix |
119
+ |---|---|---|
120
+ | Fails only with other tests | shared static state, leftover DB rows, test order | reset state in `@BeforeEach`; isolate data |
121
+ | Fails on slow CI | `Thread.sleep` waits, fixed timeouts | poll with Awaitility (`await().atMost(...).until(...)`) |
122
+ | Fails near midnight or in other zones | `LocalDate.now()`, default time zone | inject a `java.time.Clock`; use `Clock.fixed` in tests |
123
+ | Fails on assertion order | `HashMap`/`HashSet` iteration | `containsExactlyInAnyOrder`, or sort |
124
+ | Port already in use | hard-coded ports | random ports; Testcontainers mapped ports |
125
+
126
+ Never fix flakiness by adding retries, raising timeouts blindly, or `@Disabled`. If you can't find the cause, report what you tried and leave the test enabled.
127
+
128
+ ## 6. Coverage and speed
129
+
130
+ - If the project uses JaCoCo, run its report goal and look at uncovered branches in the code you changed, not the global number.
131
+ - Keep unit tests free of Spring context and containers. Reuse one Spring context across tests by keeping configuration identical; each distinct `@MockBean`/`@MockitoBean` set forces a new context.
132
+
133
+ ## Never
134
+
135
+ - Delete, skip or weaken an existing test to make the suite pass without the user's agreement.
136
+ - Assert on log output or `toString()` when a real return value or state is available.
137
+ - Use `Thread.sleep` to wait for asynchronous work.
138
+ - Leave `System.out.println` debugging in tests.
139
+
140
+ ## Finish
141
+
142
+ Run the test command for the classes you touched, then the full suite. Report the tests added or changed, the command and its result, and any flaky test you could not fix.
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "Write JUnit 5 tests with Mockito for the OrderService class",
4
+ "Replace H2 with Testcontainers PostgreSQL in our Java repository tests",
5
+ "This JUnit test passes on my laptop but fails randomly in the CI pipeline, help me find out why",
6
+ "Turn these five copy-pasted Java test methods into a parameterized test with AssertJ assertions",
7
+ "Mockito says UnnecessaryStubbingException in my CheckoutServiceTest, what's wrong?"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Convert these Java DTO classes to records and use a sealed interface for the payment types",
11
+ "Gradle build fails: Could not resolve org.junit.jupiter:junit-jupiter after bumping versions",
12
+ "Write Playwright end-to-end tests for the checkout page",
13
+ "Add pytest fixtures and parametrize the tests for the billing module",
14
+ "Write Kotest specs with MockK for the Kotlin payment service"
15
+ ]
16
+ }