@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,102 @@
1
+ ---
2
+ name: swiftui-patterns
3
+ description: SwiftUI view design built on structural identity, with property-wrapper choices (@State, @Binding, @Observable models with @Bindable, @Environment), NavigationStack and value-based navigation paths, one-way data flow, keeping body cheap to avoid excess view updates, #Preview setups with sample data, and UIKit interop through UIViewRepresentable and UIHostingController. Use when building or restructuring SwiftUI screens, deciding which property wrapper owns a piece of state, migrating from ObservableObject to @Observable, fixing views that reset or redraw too often, or embedding UIKit in SwiftUI or the reverse.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs Xcode on macOS for building, previews and tests (xcodebuild). @Observable and @Bindable need iOS 17 / macOS 14 or newer.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: coding
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "xcodebuild"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # SwiftUI patterns
15
+
16
+ Write SwiftUI where each piece of state has one owner, view identity is stable, and `body` is cheap. Swift language features, actors and Swift 6 concurrency belong to `swift-patterns`; XCTest and Swift Testing belong to `swift-testing`.
17
+
18
+ ## 0. Before you write
19
+
20
+ 1. Find the deployment target (project settings or `Package.swift` `platforms:`). It decides the APIs you may use:
21
+ - iOS 16+: `NavigationStack`, `NavigationSplitView`, `navigationDestination`.
22
+ - iOS 17+: `@Observable`, `@Bindable`, `@Environment(Model.self)`.
23
+ - Below that: `ObservableObject`, `@StateObject`, `NavigationView`. Use `if #available` only for small additions.
24
+ 2. See whether the project uses `ObservableObject` or `@Observable` today. Don't mix both styles in one feature.
25
+ 3. Build once (`xcodebuild ... build` or the project's script) and record the result.
26
+
27
+ ## 1. Which property wrapper
28
+
29
+ | The view... | Use |
30
+ |---|---|
31
+ | Owns a simple value (toggle, text, selection) | `@State private var` |
32
+ | Owns a reference-type model it creates | `@State private var model = Model()` with an `@Observable` class (iOS 17+), or `@StateObject` for `ObservableObject` |
33
+ | Edits a value owned by a parent | `@Binding` |
34
+ | Receives an `@Observable` model and needs bindings to its properties | `@Bindable var model` |
35
+ | Receives an `@Observable` model and only reads it | a plain `let` / `var` property |
36
+ | Reads app-wide values or injected models | `@Environment(\.key)` or `@Environment(Model.self)` |
37
+ | Receives an `ObservableObject` it doesn't own | `@ObservedObject` |
38
+
39
+ Rules:
40
+
41
+ - `@State` and `@StateObject` are always `private` and initialised in the view that owns them. Never pass an owned value into a child's `@State`; the child keeps its first copy and ignores later changes.
42
+ - Never create an `ObservableObject` with `@ObservedObject var model = Model()`; it is recreated on every parent update.
43
+ - Keep models `@MainActor` when they drive UI.
44
+ - Migrating to `@Observable`: drop `@Published`, replace `@StateObject` with `@State`, `@EnvironmentObject` with `@Environment(Model.self)` (and `.environmentObject(model)` with `.environment(model)` at the injection site), and use `@Bindable` where you need `$model.property`.
45
+
46
+ ## 2. View identity
47
+
48
+ SwiftUI tracks views by their position in the hierarchy (structural identity) or by explicit `.id` / `ForEach` IDs. When identity changes, state is destroyed and transitions run.
49
+
50
+ - Prefer modifiers over branches: `.opacity(isHidden ? 0 : 1)` keeps identity; `if isHidden { } else { }` swaps two different views and resets their state.
51
+ - `ForEach` needs stable, unique IDs from the data (`Identifiable` with a real ID). Never use `\.self` on non-unique values or array indices on mutable arrays.
52
+ - Use `.id(value)` deliberately to reset a view (for example a form when the edited record changes), never as a "force refresh" hack.
53
+ - Avoid `AnyView` in hot paths; it hides identity and costs diffing. Use `@ViewBuilder` and `some View`.
54
+
55
+ ## 3. Navigation
56
+
57
+ - Use `NavigationStack(path:)` with a `@State` path (`NavigationPath` or `[Route]` of a `Hashable` enum) when the app navigates programmatically or restores state.
58
+ - Register destinations with `.navigationDestination(for: Route.self)` once, near the stack root, not inside lazy containers.
59
+ - Push by appending a value; pop by removing from the path. Pass IDs or small values, and load the model at the destination.
60
+ - Use `NavigationSplitView` for sidebar layouts on iPad and Mac.
61
+ - Present sheets with `.sheet(item:)` bound to optional state so the content gets the right value; avoid `.sheet(isPresented:)` plus a separate selected-item variable.
62
+ - Deep links: handle `.onOpenURL` once and translate the URL into a path.
63
+
64
+ ## 4. Data flow
65
+
66
+ - Data flows down as values or models; events flow up through bindings or closures.
67
+ - Side effects belong in `.task { }` (cancelled automatically when the view disappears) or `.task(id:)` for work tied to a changing value. Don't start work in `init` or in `body`.
68
+ - Long work and networking go in the model or a service, not the view. Update observable state on the main actor.
69
+ - Keep one source of truth. Never copy a model's value into local `@State` "for editing" without a clear commit/cancel step.
70
+
71
+ ## 5. Performance
72
+
73
+ - `body` runs often; keep it pure and cheap. No formatting objects created per call, sorting, filtering big arrays or I/O in `body`. Compute in the model or cache.
74
+ - Split big views into small subviews so a change only re-evaluates the part that reads it. With `@Observable`, a view updates only when properties it reads change.
75
+ - Use `LazyVStack`, `LazyHStack`, `LazyVGrid` or `List` for long content, not `VStack` in a `ScrollView`.
76
+ - Profile with Instruments (the SwiftUI and Time Profiler instruments) on a device in Release. `Self._printChanges()` inside `body` (debug only, remove before committing) shows why a view updated.
77
+ - Load images at display size; use `AsyncImage` only for simple cases and cache elsewhere when lists are long.
78
+
79
+ ## 6. Previews
80
+
81
+ - Give every screen a `#Preview` (Xcode 15+; `PreviewProvider` on older Xcode) with in-memory sample data: no network, no real database.
82
+ - Inject dependencies through initialisers or the environment so previews can pass fakes.
83
+ - Add previews for empty, loading, error and long-text states, plus dark mode and a large Dynamic Type size.
84
+
85
+ ## 7. UIKit interop
86
+
87
+ - UIKit view inside SwiftUI: `UIViewRepresentable` (or `UIViewControllerRepresentable`). Create the view in `makeUIView`, apply state in `updateUIView` (it runs often: compare before mutating), and use a `Coordinator` for delegates and target-action.
88
+ - SwiftUI inside UIKit: `UIHostingController(rootView:)`, added as a child view controller with `addChild` and `didMove(toParent:)`. Pass a model, not a snapshot, so updates flow.
89
+ - Don't keep strong references from the coordinator back to the representable's parent; use the values passed in `updateUIView`.
90
+
91
+ **Stop and ask the user** before raising the deployment target, or before migrating a whole feature from `ObservableObject` to `@Observable` when only a small change was requested.
92
+
93
+ ## Never
94
+
95
+ - Never initialise `@State` from a parent's value expecting it to stay in sync.
96
+ - Never do work in `body` or a view's `init`.
97
+ - Never use array indices as `ForEach` IDs for data that changes.
98
+ - Never leave `Self._printChanges()` in committed code.
99
+
100
+ ## Report back
101
+
102
+ End with: views and models changed, which wrapper owns each new piece of state, the build and test commands with results, and the OS versions or simulators you ran on.
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "Should this SwiftUI child view use @State, @Binding or @Bindable for the user model?",
4
+ "Migrate our view models from ObservableObject and @Published to the @Observable macro",
5
+ "Set up a NavigationStack with a path so I can pop to root after checkout",
6
+ "My SwiftUI form resets its text fields whenever the parent list refreshes",
7
+ "Wrap an MKMapView in UIViewRepresentable with a coordinator for the delegate"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Make this Swift networking layer Sendable for Swift 6 strict concurrency",
11
+ "Write XCTest unit tests for the payment view model",
12
+ "My Jetpack Compose screen recomposes on every keystroke",
13
+ "Fix the swift build error about ambiguous use of init in the package",
14
+ "Share the login logic between Android and iOS with Kotlin Multiplatform"
15
+ ]
16
+ }
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: tdd-workflow
3
+ description: Test-first development loop that writes a failing test, makes it pass with the smallest change, then refactors with the suite green. Use when adding a feature, fixing a reproducible bug, or refactoring code in a project that has (or should have) automated tests.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs the project's test runner and git.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: testing
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "git"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # TDD workflow
15
+
16
+ Drive every behaviour change with a test that fails first. The loop is short on purpose: red, green, refactor, commit.
17
+
18
+ ## 0. Before you start
19
+
20
+ 1. Find how this project runs tests. Check, in order: the README, `AGENTS.md`, `package.json` scripts, `Makefile`, `pyproject.toml`, `go.mod`, `Cargo.toml`, CI config in `.github/workflows/`.
21
+ 2. Run the existing suite once. Record the result.
22
+ - If it already fails, **stop and tell the user** which tests fail before changing anything. Do not "fix" unrelated failures silently.
23
+ 3. Restate the behaviour you are about to build as 1–5 concrete examples (input → expected output). If you cannot, ask the user for the missing detail.
24
+
25
+ ## 1. Red: write one failing test
26
+
27
+ - Pick the **smallest** example that is not yet supported.
28
+ - Put the test next to existing tests for that module, following their naming, fixtures and style.
29
+ - Test behaviour through the public interface, not private helpers.
30
+ - Run only that test. It must fail **for the expected reason** (assertion fails, or the function doesn't exist). A test that fails because of a typo or import error doesn't count; fix the test and rerun.
31
+
32
+ For a bug fix, the first test reproduces the bug exactly as reported.
33
+
34
+ ## 2. Green: make it pass
35
+
36
+ - Write the least code that makes the test pass. Hard-coding is acceptable at this step if the next test will force generalisation.
37
+ - Run the single test, then the whole related test file.
38
+ - Do not add features no test asks for.
39
+
40
+ ## 3. Refactor: clean up with the suite green
41
+
42
+ - Remove duplication, improve names, extract functions.
43
+ - Run the full suite after each refactor. If anything goes red, undo the last refactor rather than debugging forward.
44
+
45
+ ## 4. Repeat or finish
46
+
47
+ Go back to step 1 with the next example until every example from step 0 is covered. Then also cover:
48
+
49
+ - Edge cases: empty input, boundaries, invalid input, and the error path.
50
+ - Anything the user called out as important.
51
+
52
+ Prefer a few meaningful tests over chasing a coverage number. If the project enforces a coverage threshold, meet it.
53
+
54
+ ## 5. Commit
55
+
56
+ When the full suite is green, commit with a message that states the behaviour added or the bug fixed. One logical change per commit. Don't commit if the suite is red.
57
+
58
+ ## Rules
59
+
60
+ - Never delete, skip or weaken an existing test to make the suite pass. If an existing test is wrong, explain why to the user and get agreement first.
61
+ - Never mock the unit under test. Mock only slow or external boundaries (network, clock, filesystem when needed).
62
+ - Keep tests deterministic: no real network calls, fixed seeds, fixed time.
63
+ - If you can't get to green after three focused attempts, stop and report what you tried and what you observed.
64
+
65
+ ## Report back
66
+
67
+ End with: tests added (names), the command you ran, the final pass/fail counts, and anything left uncovered.
@@ -0,0 +1,14 @@
1
+ {
2
+ "should_trigger": [
3
+ "Add a discount-code field to the checkout service, test first please",
4
+ "There's a bug where negative quantities are accepted in the cart. Reproduce it with a failing test and fix it.",
5
+ "Refactor the invoice calculator but keep behaviour identical, write tests before you touch it",
6
+ "Implement the parseDuration helper using red-green-refactor"
7
+ ],
8
+ "should_not_trigger": [
9
+ "Explain what test-driven development is in two sentences",
10
+ "Run all the checks on my branch before I open a pull request",
11
+ "Review my last commit for security vulnerabilities",
12
+ "Write a README section describing how to install the project"
13
+ ]
14
+ }
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: technical-writing
3
+ description: Writes and restructures developer-facing documentation people actually use, such as READMEs, how-to guides, tutorials and API reference, by naming the audience first, organising around the reader's task, shipping copy-paste examples that are run before publishing, and keeping docs beside the code they describe. Use when drafting or rewriting a README, a getting-started or how-to guide, reference docs for a library, CLI or HTTP API, or when docs are confusing, stale or nobody reads them.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Running examples needs the project's own toolchain.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: docs
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Technical writing
14
+
15
+ Docs exist so a reader can finish a task. Every decision below follows from that: know who reads, know what they're trying to do, show them a working path, and keep it true.
16
+
17
+ ## 1. Pin down audience and job
18
+
19
+ Before writing, answer these. Ask the user for any you can't infer from the repo:
20
+
21
+ 1. **Who reads it?** First-time user, integrating developer, operator, contributor. One primary reader per document.
22
+ 2. **What are they trying to do?** Install, try it, solve one specific problem, look up an exact detail, understand a design.
23
+ 3. **What do they already know?** Language, framework, domain terms.
24
+
25
+ The answer to question 2 picks the document type. Don't mix types in one page.
26
+
27
+ | Reader wants to | Write a | Shape |
28
+ |---|---|---|
29
+ | learn by doing, first time | tutorial | one guided path, every step succeeds, no choices |
30
+ | solve a specific problem | how-to guide | goal in the title, prerequisites, numbered steps, result |
31
+ | look up an exact fact | reference | complete, consistent, structured like the code |
32
+ | understand why | explanation | prose, trade-offs, diagrams, links to the rest |
33
+
34
+ This is the Diátaxis split. Use it to decide, not as jargon in the docs.
35
+
36
+ ## 2. Structure task-first
37
+
38
+ - Title says the task or the thing: "Send a webhook test event", not "Webhooks overview".
39
+ - Put the shortest successful path first. Options, edge cases and theory come after.
40
+ - Number steps that must happen in order. One action per step. Put the expected result after the step that produces it.
41
+ - State prerequisites up front (versions, accounts, permissions), never halfway down.
42
+ - Use headings a reader would search for. Keep paragraphs short.
43
+
44
+ ### README order
45
+
46
+ 1. Name and one sentence on what it does and for whom.
47
+ 2. Install (one command where possible).
48
+ 3. Quick start: the smallest example that does something real, with its output.
49
+ 4. Common tasks or a link to guides.
50
+ 5. Configuration (table: key, default, meaning).
51
+ 6. Links: full docs, contributing, license, support.
52
+
53
+ Badges, history and architecture go below this or in other files.
54
+
55
+ ## 3. Examples that run
56
+
57
+ - Every example is complete enough to paste and run: imports, setup, and placeholder values that are obviously placeholders (`YOUR_API_KEY`, `example.com`).
58
+ - Show the expected output or response.
59
+ - Run every example before you publish it, using the project's toolchain. If you can't run one, mark it "not run" in your report and tell the user.
60
+ - Use the project's real names, flags and defaults. Search the code to confirm each one; don't recall them.
61
+ - Label code blocks with their language. Split commands from their output.
62
+ - Never put real secrets, tokens, internal hostnames or customer data in examples.
63
+
64
+ ## 4. Reference docs
65
+
66
+ - Generate from the source where the project already has a generator (docstrings, OpenAPI, typedoc-style tools). Fix the source comments, not the generated output.
67
+ - For each item: signature or endpoint, parameters (name, type, required, default, meaning), return value or response, errors, one example.
68
+ - Keep the same order and wording pattern for every entry so readers can scan.
69
+ - Document behaviour callers depend on: units, limits, side effects, idempotency, thread safety, deprecation and what replaces it.
70
+
71
+ ## 5. Keep docs with the code
72
+
73
+ - Put docs in the repo, next to what they describe (`README.md` at package roots, `docs/` for guides, docstrings for reference).
74
+ - When code and docs disagree, the code is the truth. Fix the docs, or tell the user if the code looks wrong.
75
+ - Prefer links over copies. Duplicate text goes stale in one place first.
76
+ - If the project has docs linting, link checking or doctests, run them.
77
+ - When a code change alters behaviour, update docs in the same change. For that job, delegate to the `doc-updater` agent if it's available.
78
+
79
+ ## 6. Style
80
+
81
+ - Second person, active voice, present tense: "Run `make test`", not "The tests can be run".
82
+ - Plain words. Define a term the first time, then use it the same way every time.
83
+ - Be specific: "takes about 2 minutes", not "may take some time"; "requires Node 18 or later" only after checking the project's engines field or CI.
84
+ - Cut filler: "simply", "just", "easy", "obviously". They insult the reader who's stuck.
85
+ - Follow the project's existing style guide and spelling if it has one.
86
+
87
+ ## Stop and ask
88
+
89
+ - The audience or document type is unclear and changes the outcome.
90
+ - The docs would describe behaviour you can't confirm in the code.
91
+ - You'd delete or restructure existing docs that other pages or external sites may link to.
92
+
93
+ ## Report back
94
+
95
+ Return the files you wrote or changed, the reader and document type each targets, which examples you ran (with the command) and which you didn't, and any doc-versus-code mismatches you found. For a guided walkthrough of code, use `code-tour`; for getting oriented yourself, use `codebase-onboarding`.
@@ -0,0 +1,14 @@
1
+ {
2
+ "should_trigger": [
3
+ "Rewrite our README so someone new can install the CLI and run their first command in five minutes",
4
+ "Write a how-to guide for rotating API keys in our service",
5
+ "Our API reference is a mess, restructure the docs for the REST endpoints with examples for each",
6
+ "Nobody reads our getting-started docs. Can you make them task-first with runnable code samples?"
7
+ ],
8
+ "should_not_trigger": [
9
+ "I renamed the --verbose flag to --debug in this commit, sync the docs and changelog with that change",
10
+ "Walk me through this unfamiliar repo so I know how to build and run it",
11
+ "Create a file-by-file tour of the auth flow for new contributors",
12
+ "Write a blog post announcing our product launch for the marketing site"
13
+ ]
14
+ }
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: terraform-patterns
3
+ description: Terraform and OpenTofu infrastructure-as-code practice, from root and child module layout, pinned providers and remote state with locking, through per-environment variables, reading a plan before apply, detecting drift, adopting existing resources with import blocks, and renaming or moving resources safely with moved and removed blocks instead of destroy and recreate. Use when writing or restructuring .tf code, setting up a state backend, reviewing what terraform plan will replace or destroy, or bringing hand-made cloud resources under Terraform.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs terraform or tofu on PATH and cloud credentials for plan and apply. Commands are the same for both CLIs; substitute tofu for terraform when the project uses OpenTofu.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: devops
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "terraform"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # Terraform patterns
15
+
16
+ Change infrastructure through code that plans cleanly, keeps state safe, and never destroys something by accident. Cloud-specific service choices belong to `aws-patterns`, `gcp-patterns` or `azure-patterns`; this skill covers the Terraform layer itself.
17
+
18
+ ## 0. Orient
19
+
20
+ 1. Detect the CLI: `.terraform.lock.hcl`, `required_version`, a `.terraform-version` / `.opentofu-version` file, or CI steps tell you whether it is `terraform` or `tofu`, and which version. Use that one throughout.
21
+ 2. Find the root modules (directories with a `backend` block or that CI runs `plan` in), the child modules (`modules/`), and how environments are split (separate root directories per env, workspaces, or a wrapper such as Terragrunt).
22
+ 3. Read the backend block. Note where state lives and whether locking is on.
23
+ 4. **Stop and ask the user** before `apply`, `destroy`, `import` on the CLI, any `state` subcommand that writes (`mv`, `rm`, `push`), `force-unlock`, or `init -migrate-state`. `fmt`, `validate`, `init` (without migration) and `plan` are fine.
24
+
25
+ ## 1. Layout
26
+
27
+ ```
28
+ modules/
29
+ network/ main.tf variables.tf outputs.tf versions.tf README.md
30
+ service/
31
+ envs/
32
+ dev/ main.tf backend.tf terraform.tfvars versions.tf
33
+ prod/
34
+ ```
35
+
36
+ - One root module per environment (or per environment and component) with its own state. Keep blast radius small: networking, data stores and apps in separate states when they change at different rates.
37
+ - Child modules take inputs and return outputs; they don't configure providers or backends. Pass providers explicitly (`providers = { aws = aws.eu }`) when a module needs an aliased one.
38
+ - Pin versions: `required_version` in every root, and `required_providers` with a `~>` constraint. Commit `.terraform.lock.hcl` for root modules.
39
+ - Pin module sources: registry modules with `version = "~> x.y"`, git sources with `?ref=<tag>`.
40
+ - Prefer `for_each` over `count` for anything that has identity, so removing one item doesn't shift the indexes of every other.
41
+
42
+ ## 2. Variables and environments
43
+
44
+ - Declare a `type` and `description` for every variable; add `validation` blocks for values with rules (CIDRs, allowed names).
45
+ - Mark secrets `sensitive = true`, and better, don't pass them as variables at all: read them from a secret manager data source or have the service fetch them at runtime. Sensitive values are still stored in state in plain text.
46
+ - Per-environment values in `envs/<env>/terraform.tfvars` or `-var-file`. Never commit a tfvars file containing secrets.
47
+ - Use `locals` for derived names and common tags instead of repeating expressions.
48
+
49
+ ## 3. Remote state and locking
50
+
51
+ - Never keep state for shared infrastructure on a laptop or in git. Use a remote backend with locking and encryption: S3 (with `use_lockfile = true` for S3-native locking on current Terraform; the older `dynamodb_table` locking is deprecated), GCS, `azurerm`, HCP Terraform, or the backend the team already uses. Examples are in `references/backends.md`.
52
+ - Turn on versioning for the state bucket so a bad write can be recovered.
53
+ - Restrict who can read state: it contains every attribute of every resource, including secrets.
54
+ - Read another stack's outputs with `terraform_remote_state` or, better, a data source that looks the resource up, rather than copying IDs by hand.
55
+ - If a lock is stale (a crashed run), confirm with the user that no run is in progress before `force-unlock <LOCK_ID>`.
56
+
57
+ ## 4. The plan is the review
58
+
59
+ Run `terraform plan -out=tfplan` and read it before anything is applied.
60
+
61
+ 1. Read the summary line: `Plan: X to add, Y to change, Z to destroy`.
62
+ 2. Search the plan for `must be replaced`, `forces replacement` and `will be destroyed`. For each, name the attribute that forces it.
63
+ 3. Treat replacement or destruction of a stateful resource (databases, buckets, disks, DNS zones, KMS keys, clusters, IAM roles other systems depend on) as a stop: explain it to the user and propose an alternative (a `moved` block, `ignore_changes` for an attribute managed elsewhere, or an in-place change).
64
+ 4. Check for unexpected changes to resources you didn't touch: that is drift or a provider upgrade, not your change. Report it separately.
65
+ 5. Apply only the saved plan (`terraform apply tfplan`), so what runs is exactly what was reviewed.
66
+
67
+ For machine-readable checks: `terraform show -json tfplan` and look at `resource_changes[].change.actions` for `"delete"`.
68
+
69
+ Protect critical resources with `lifecycle { prevent_destroy = true }`, and use `create_before_destroy = true` where a replacement must not cause downtime.
70
+
71
+ ## 5. Drift
72
+
73
+ - `terraform plan -refresh-only` shows what changed outside Terraform without proposing to revert it.
74
+ - Decide per item with the user: bring the code in line with reality, or let the next apply revert the manual change. Don't silently revert a hotfix someone made in the console.
75
+ - `-detailed-exitcode` (exit 2 means changes) lets CI detect drift on a schedule.
76
+
77
+ ## 6. Safe refactors
78
+
79
+ Renaming or moving a resource address without telling Terraform plans a destroy and a create. Use config-driven blocks, which show up in the plan and get reviewed like any other change:
80
+
81
+ ```hcl
82
+ moved {
83
+ from = aws_s3_bucket.logs
84
+ to = module.logging.aws_s3_bucket.this
85
+ }
86
+
87
+ import {
88
+ to = aws_s3_bucket.assets
89
+ id = "my-existing-assets-bucket"
90
+ }
91
+
92
+ removed {
93
+ from = aws_instance.legacy
94
+ lifecycle { destroy = false } # forget it, keep the real resource
95
+ }
96
+ ```
97
+
98
+ - `moved` for renames, `count` → `for_each`, and moving resources into or out of modules. The plan should then show no destroy for those addresses.
99
+ - `import` blocks to adopt existing resources; `terraform plan -generate-config-out=generated.tf` drafts the matching configuration. Edit the generated code until plan shows no changes for the imported resource.
100
+ - `removed` with `destroy = false` to stop managing something without deleting it.
101
+ - These blocks need a reasonably recent CLI, and Terraform and OpenTofu added them (and options such as `removed`'s `lifecycle { destroy = false }`) in different releases. Check the docs for the CLI and version in `required_version`; if not, stop and ask before falling back to `terraform state mv` / `state rm`, which change state immediately and skip review.
102
+ - Keep `moved` blocks in shared modules for at least one release so every caller's state migrates; remove `import` and `removed` blocks after the apply.
103
+
104
+ ## 7. Verify
105
+
106
+ Run, and report each as pass or fail:
107
+
108
+ 1. `terraform fmt -check -recursive`
109
+ 2. `terraform init -backend=false` then `terraform validate` in each changed root (no credentials needed).
110
+ 3. Linters the project already uses (`tflint`, `checkov`, `trivy config`).
111
+ 4. `terraform plan` in each affected environment if credentials are available; paste the summary line and every replace or destroy.
112
+
113
+ ## Never
114
+
115
+ - Never run `apply -auto-approve` or `destroy` on the user's behalf without explicit approval for that environment.
116
+ - Never edit a state file by hand or commit `*.tfstate`, `.terraform/` or secret-bearing tfvars.
117
+ - Never use `-target` as a routine workflow; it is for recovery, and leaves the rest of the config unreviewed.
118
+ - Never upgrade a provider's major version as a side effect of another change.
119
+
120
+ ## Report back
121
+
122
+ End with: CLI and version, roots changed, the plan summary per environment (add/change/destroy) with every replacement or destroy named and justified, the verification commands with pass or fail, and anything you could not plan because of missing credentials.
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "I renamed a resource in our Terraform and now plan wants to destroy and recreate the database",
4
+ "Set up an S3 remote state backend with locking for our Terraform project",
5
+ "We created a bunch of buckets by hand in the console, how do I bring them under Terraform?",
6
+ "Restructure our tf code into reusable modules with separate dev and prod environments",
7
+ "terraform plan shows changes nobody made, how do I check for drift?"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Should we use Cloud Run or GKE for this service on Google Cloud?",
11
+ "Write a Kubernetes Deployment with resource limits for the API",
12
+ "Review this terraform plan output and the k8s manifests for risky or destructive changes",
13
+ "Add a GitHub Actions job that builds and pushes our Docker image",
14
+ "Containerise the Python worker with a slim base image"
15
+ ]
16
+ }
@@ -0,0 +1,67 @@
1
+ # Remote state backends
2
+
3
+ Check the backend's docs for your CLI version before copying; argument names change between releases.
4
+
5
+ ## AWS S3 (S3-native locking)
6
+
7
+ ```hcl
8
+ terraform {
9
+ backend "s3" {
10
+ bucket = "acme-terraform-state"
11
+ key = "prod/network/terraform.tfstate"
12
+ region = "eu-west-1"
13
+ encrypt = true
14
+ use_lockfile = true # writes a .tflock object next to the state
15
+ }
16
+ }
17
+ ```
18
+
19
+ - The bucket should have versioning on, public access blocked, and default encryption (SSE-S3 or SSE-KMS).
20
+ - With `use_lockfile`, the caller needs `s3:GetObject`, `s3:PutObject` and `s3:DeleteObject` on the lock object as well as the state object.
21
+ - Migrating from `dynamodb_table` locking: the two can be set together during the transition. Add `use_lockfile = true`, run `terraform init -reconfigure`, confirm runs create the `.tflock` object, then remove `dynamodb_table`.
22
+
23
+ ## Google Cloud Storage
24
+
25
+ ```hcl
26
+ terraform {
27
+ backend "gcs" {
28
+ bucket = "acme-terraform-state"
29
+ prefix = "prod/network"
30
+ }
31
+ }
32
+ ```
33
+
34
+ GCS locks natively. Enable object versioning on the bucket.
35
+
36
+ ## Azure Storage
37
+
38
+ ```hcl
39
+ terraform {
40
+ backend "azurerm" {
41
+ resource_group_name = "rg-terraform"
42
+ storage_account_name = "acmetfstate"
43
+ container_name = "tfstate"
44
+ key = "prod/network.tfstate"
45
+ }
46
+ }
47
+ ```
48
+
49
+ Azure locks via blob leases. Enable blob versioning or soft delete on the storage account.
50
+
51
+ ## Partial configuration
52
+
53
+ Keep environment-specific backend values out of shared code:
54
+
55
+ ```hcl
56
+ terraform {
57
+ backend "s3" {}
58
+ }
59
+ ```
60
+
61
+ ```sh
62
+ terraform init -backend-config=backend.prod.hcl
63
+ ```
64
+
65
+ ## Changing backends
66
+
67
+ `terraform init -migrate-state` copies state to the new backend. Before running it: confirm with the user, take a copy with `terraform state pull > backup.tfstate` (store it securely, it contains secrets), and make sure no other run is in progress.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: test-coverage-improvement
3
+ description: Raises meaningful test coverage by measuring line and branch coverage, ranking untested code by risk and churn, adding tests that pin observable behaviour rather than executing lines, and using mutation testing (Stryker, PIT, mutmut, cargo-mutants, Infection) to prove the new tests catch faults. Use when coverage is low or below a CI threshold, when asked where tests are missing in a module, or when a team wants coverage numbers they can trust.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs the project's test runner and its coverage tool; mutation testing tools are optional.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: testing
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Test coverage improvement
14
+
15
+ Coverage tells you what code ran during tests, not what was checked. The goal is fewer escaped bugs, so spend tests where a bug would hurt and make every test assert something a user or caller would notice.
16
+
17
+ ## 1. Measure the baseline
18
+
19
+ 1. Find the existing coverage command in CI, package scripts or the Makefile. Use it if it exists.
20
+ 2. Otherwise run the language default with **branch** coverage on where the tool supports it (Go reports statement coverage only; `cargo llvm-cov --branch` needs a nightly toolchain):
21
+
22
+ | Stack | Command |
23
+ |---|---|
24
+ | Jest | `npx jest --coverage` |
25
+ | Vitest | `npx vitest run --coverage` (needs `@vitest/coverage-v8`) |
26
+ | Python | `pytest --cov=<pkg> --cov-branch --cov-report=term-missing` (pytest-cov) |
27
+ | Go | `go test -coverprofile=cover.out ./...` then `go tool cover -func=cover.out` |
28
+ | Rust | `cargo llvm-cov` (cargo-llvm-cov) or `cargo tarpaulin` |
29
+ | Java | JaCoCo via `mvn verify` or `gradle jacocoTestReport` |
30
+ | .NET | `dotnet test --collect:"XPlat Code Coverage"` |
31
+ | PHP | `vendor/bin/phpunit --coverage-text` (needs Xdebug or PCOV) |
32
+
33
+ 3. Record: total line %, branch %, and the per-file numbers. If the suite fails, **stop and tell the user** first; coverage from a red suite is meaningless.
34
+ 4. If adding a coverage tool would add a dependency the project doesn't have, ask before installing it.
35
+
36
+ ## 2. Find the risky gaps
37
+
38
+ Do not sort by "lowest %". Rank untested code by risk:
39
+
40
+ 1. **Money, auth, permissions, data deletion, migrations** and anything security-sensitive.
41
+ 2. **Branches with no test**: `else` paths, error handlers, early returns, `catch` blocks, default cases. Branch coverage reports show these as partial lines.
42
+ 3. **High churn**: files changed often recently (`git log --since=6.months --name-only --format= | sort | uniq -c | sort -rn | head -20`). Churn plus low coverage is where regressions come from.
43
+ 4. **Recent bugs**: code touched by recent fix commits.
44
+ 5. Public API used by many callers.
45
+
46
+ Skip, and say you skipped: generated code, trivial getters and setters, framework glue with no logic, and code scheduled for deletion. Prefer excluding them in coverage config (with a comment) over writing hollow tests.
47
+
48
+ Write the top 5 to 10 targets as a list with the reason each one is risky, and confirm with the user if the list is long.
49
+
50
+ ## 3. Write behaviour tests
51
+
52
+ For each target:
53
+
54
+ - Name the behaviour: "rejects a refund larger than the original charge", not "test refund function".
55
+ - Drive it through the public interface the callers use.
56
+ - Assert the observable result: return value, raised error and its type or message, state persisted, message sent. One behaviour per test.
57
+ - Cover the branch you found: the error path, the boundary (0, 1, max, empty, null), the permission denied case.
58
+ - Mock only external boundaries (network, clock, randomness, third-party services). Never mock the unit under test or its own collaborators just to reach a line.
59
+ - Follow the existing test style, folders and fixtures.
60
+
61
+ A test that would pass if the code under test returned a wrong value is not a test. Avoid:
62
+
63
+ - No assertion, or `expect(result).toBeDefined()` / `assert result is not None` as the only check.
64
+ - Snapshotting large output nobody reviews.
65
+ - Asserting that a mock was called, without checking the outcome.
66
+ - Calling a function in a loop over inputs just to light up lines.
67
+
68
+ ## 4. Check with mutation testing
69
+
70
+ Mutation testing changes the code (flips `>` to `>=`, removes a call, returns a constant) and reruns the tests. A surviving mutant is a fault your tests don't catch.
71
+
72
+ | Stack | Tool | Run |
73
+ |---|---|---|
74
+ | JS/TS | StrykerJS | `npx stryker run` |
75
+ | Java/Kotlin (JVM) | PIT | `mvn org.pitest:pitest-maven:mutationCoverage` |
76
+ | Python | mutmut | `mutmut run`, then `mutmut results` |
77
+ | Rust | cargo-mutants | `cargo mutants` |
78
+ | PHP | Infection | `vendor/bin/infection` |
79
+ | C# | Stryker.NET | `dotnet stryker` |
80
+
81
+ - Scope it to the files you just tested; a full-repo run can take hours.
82
+ - For each surviving mutant: add or sharpen an assertion that kills it, or note it as equivalent (the change cannot alter behaviour).
83
+ - If no tool exists for the stack, do it by hand for the riskiest function: break one condition, run the tests, confirm one fails, revert.
84
+
85
+ ## 5. Re-measure and lock in
86
+
87
+ 1. Rerun the coverage command. Report before and after for the files you touched, line and branch.
88
+ 2. If CI has a threshold, meet it. If it has none, suggest a ratchet (fail only if coverage drops) rather than an arbitrary target.
89
+ 3. Run the full suite twice to check the new tests are deterministic.
90
+
91
+ ## Rules
92
+
93
+ - Never delete, skip or weaken existing tests to change the number.
94
+ - Never add tests that assert current buggy behaviour without flagging it. If you find a bug, **stop and tell the user**, and write the test for the correct behaviour marked as expected-to-fail only if they agree.
95
+ - Never exclude risky code from coverage to raise the percentage.
96
+ - Don't chase 100 %. Stop when the risky list is covered and mutants are killed.
97
+
98
+ ## Report back
99
+
100
+ ```
101
+ Coverage: <line>% → <line>% lines, <branch>% → <branch>% branches (files touched)
102
+ Tests added: <file>: <test names>
103
+ Mutation: <killed>/<total> killed in <files>; survivors: <list or none>
104
+ Bugs found: <list or none>
105
+ Not covered, on purpose: <items and why>
106
+ Command: <exact commands run>
107
+ ```
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "Our coverage is stuck at 52% and CI wants 70, add tests where they actually matter",
4
+ "Which parts of the billing module have no tests? Fill the important gaps",
5
+ "Run mutation testing on the discount rules and tighten the tests that let mutants survive",
6
+ "We have 90% line coverage but bugs still slip through, make the tests mean something",
7
+ "Find the untested error-handling branches in src/payments and cover them"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Implement the CSV export feature test-first",
11
+ "Look at the tests in this PR and list the cases that are missing for the changed code",
12
+ "Add a Playwright test for the password reset journey",
13
+ "Benchmark the new JSON parser against the old one",
14
+ "Run the build, lint and tests and tell me if my branch is green"
15
+ ]
16
+ }