@ketecode/loom 0.1.0 → 0.2.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 (211) hide show
  1. package/README.md +111 -11
  2. package/agents/code-reviewer/evals/behavior.json +60 -0
  3. package/agents/inbox-triager/AGENT.md +98 -0
  4. package/agents/inbox-triager/evals/triggers.json +16 -0
  5. package/agents/spec-reviewer/AGENT.md +95 -0
  6. package/agents/spec-reviewer/evals/behavior.json +57 -0
  7. package/agents/spec-reviewer/evals/triggers.json +16 -0
  8. package/agents/task-implementer/AGENT.md +89 -0
  9. package/agents/task-implementer/evals/behavior.json +47 -0
  10. package/agents/task-implementer/evals/triggers.json +16 -0
  11. package/bin/kete-loom.js +46 -6
  12. package/commands/brainstorm.md +25 -0
  13. package/commands/debug.md +27 -0
  14. package/commands/dual-review.md +34 -0
  15. package/commands/feature-dev.md +8 -7
  16. package/commands/finish-branch.md +26 -0
  17. package/commands/fix-bug.md +38 -0
  18. package/commands/production-readiness.md +45 -0
  19. package/commands/usage-report.md +43 -0
  20. package/hooks/block-foreground-servers/HOOK.md +34 -0
  21. package/hooks/block-foreground-servers/cases.json +31 -0
  22. package/hooks/block-foreground-servers/hook.js +41 -0
  23. package/hooks/capture-lessons/HOOK.md +24 -0
  24. package/hooks/capture-lessons/hook.js +48 -0
  25. package/hooks/notify-on-stop/HOOK.md +25 -0
  26. package/hooks/notify-on-stop/hook.js +27 -0
  27. package/hooks/protect-lint-config/HOOK.md +29 -0
  28. package/hooks/protect-lint-config/cases.json +18 -0
  29. package/hooks/protect-lint-config/fixtures/.eslintrc.json +1 -0
  30. package/hooks/protect-lint-config/fixtures/.golangci.yml +1 -0
  31. package/hooks/protect-lint-config/fixtures/.prettierrc +1 -0
  32. package/hooks/protect-lint-config/fixtures/.rubocop.yml +1 -0
  33. package/hooks/protect-lint-config/fixtures/biome.json +1 -0
  34. package/hooks/protect-lint-config/fixtures/eslint.config.mjs +1 -0
  35. package/hooks/protect-lint-config/fixtures/ruff.toml +1 -0
  36. package/hooks/protect-lint-config/hook.js +25 -0
  37. package/hooks/read-before-edit/HOOK.md +26 -0
  38. package/hooks/read-before-edit/cases.json +15 -0
  39. package/hooks/read-before-edit/hook.js +50 -0
  40. package/hooks/run.js +22 -6
  41. package/hooks/verify-before-stop/HOOK.md +32 -0
  42. package/hooks/verify-before-stop/hook.js +70 -0
  43. package/mcp/clickhouse.json +11 -0
  44. package/mcp/exa.json +11 -0
  45. package/mcp/firecrawl.json +11 -0
  46. package/mcp/vercel.json +11 -0
  47. package/package.json +6 -4
  48. package/profiles.json +54 -5
  49. package/rules/use-skills.md +23 -0
  50. package/scripts/lib/behavior.js +52 -0
  51. package/scripts/lib/hooks-install.js +9 -7
  52. package/scripts/lib/lint.js +24 -2
  53. package/scripts/lib/mcp-install.js +5 -1
  54. package/scripts/lib/render.js +6 -0
  55. package/scripts/lib/skills.js +1 -0
  56. package/scripts/lib/targets.js +10 -0
  57. package/skills/agent-failure-debugging/SKILL.md +92 -0
  58. package/skills/agent-failure-debugging/evals/triggers.json +16 -0
  59. package/skills/agent-outbound-messaging/SKILL.md +92 -0
  60. package/skills/agent-outbound-messaging/evals/triggers.json +16 -0
  61. package/skills/agent-security/SKILL.md +117 -0
  62. package/skills/agent-security/evals/triggers.json +16 -0
  63. package/skills/agent-security/references/host-configs.md +37 -0
  64. package/skills/api-client-integration/SKILL.md +86 -0
  65. package/skills/api-client-integration/evals/triggers.json +16 -0
  66. package/skills/api-client-integration/references/resilience.md +57 -0
  67. package/skills/blender-automation/SKILL.md +100 -0
  68. package/skills/blender-automation/evals/triggers.json +16 -0
  69. package/skills/blender-automation/references/batch-and-render.md +77 -0
  70. package/skills/blender-automation/references/bpy-inspection.md +91 -0
  71. package/skills/blender-automation/references/rig-and-retarget-checks.md +23 -0
  72. package/skills/brand-strategy/SKILL.md +83 -0
  73. package/skills/brand-strategy/evals/triggers.json +16 -0
  74. package/skills/change-impact-analysis/SKILL.md +89 -0
  75. package/skills/change-impact-analysis/evals/triggers.json +16 -0
  76. package/skills/change-impact-analysis/references/graph-commands.md +28 -0
  77. package/skills/contract-drafting/SKILL.md +96 -0
  78. package/skills/contract-drafting/evals/triggers.json +16 -0
  79. package/skills/contract-drafting/references/term-sheets.md +68 -0
  80. package/skills/contract-first-development/SKILL.md +86 -0
  81. package/skills/contract-first-development/evals/triggers.json +16 -0
  82. package/skills/contract-first-development/references/tooling.md +46 -0
  83. package/skills/decision-council/SKILL.md +98 -0
  84. package/skills/decision-council/evals/triggers.json +16 -0
  85. package/skills/design-brainstorming/SKILL.md +132 -0
  86. package/skills/design-brainstorming/evals/behavior.json +55 -0
  87. package/skills/design-brainstorming/evals/triggers.json +16 -0
  88. package/skills/design-brainstorming/references/visual-mockups.md +34 -0
  89. package/skills/desktop-app-testing/SKILL.md +104 -0
  90. package/skills/desktop-app-testing/evals/triggers.json +16 -0
  91. package/skills/desktop-app-testing/references/drivers.md +81 -0
  92. package/skills/document-processing/SKILL.md +100 -0
  93. package/skills/document-processing/evals/triggers.json +17 -0
  94. package/skills/document-processing/references/extraction-and-ocr.md +71 -0
  95. package/skills/document-processing/references/forms-and-conversion.md +69 -0
  96. package/skills/document-processing/references/redaction.md +61 -0
  97. package/skills/energy-procurement/SKILL.md +106 -0
  98. package/skills/energy-procurement/evals/triggers.json +16 -0
  99. package/skills/finishing-a-branch/SKILL.md +127 -0
  100. package/skills/finishing-a-branch/evals/behavior.json +49 -0
  101. package/skills/finishing-a-branch/evals/triggers.json +16 -0
  102. package/skills/freight-carrier-management/SKILL.md +107 -0
  103. package/skills/freight-carrier-management/evals/triggers.json +16 -0
  104. package/skills/git-worktrees/SKILL.md +130 -0
  105. package/skills/git-worktrees/evals/behavior.json +56 -0
  106. package/skills/git-worktrees/evals/triggers.json +16 -0
  107. package/skills/google-workspace-integration/SKILL.md +65 -0
  108. package/skills/google-workspace-integration/evals/triggers.json +17 -0
  109. package/skills/google-workspace-integration/references/api.md +121 -0
  110. package/skills/harmonyos-arkts/SKILL.md +117 -0
  111. package/skills/harmonyos-arkts/evals/triggers.json +16 -0
  112. package/skills/harmonyos-arkts/references/build-errors.md +42 -0
  113. package/skills/implementation-plans/SKILL.md +117 -0
  114. package/skills/implementation-plans/evals/behavior.json +54 -0
  115. package/skills/implementation-plans/evals/triggers.json +16 -0
  116. package/skills/ios-platform-features/SKILL.md +99 -0
  117. package/skills/ios-platform-features/evals/triggers.json +16 -0
  118. package/skills/ios-platform-features/references/foundation-models.md +90 -0
  119. package/skills/jvm-sql-mappers/SKILL.md +98 -0
  120. package/skills/jvm-sql-mappers/evals/triggers.json +16 -0
  121. package/skills/jvm-sql-mappers/references/examples.md +129 -0
  122. package/skills/mobile-accessibility/SKILL.md +94 -0
  123. package/skills/mobile-accessibility/evals/triggers.json +16 -0
  124. package/skills/network-design/SKILL.md +98 -0
  125. package/skills/network-design/evals/triggers.json +16 -0
  126. package/skills/observability/SKILL.md +125 -0
  127. package/skills/observability/evals/triggers.json +17 -0
  128. package/skills/observability/references/otel-setup.md +87 -0
  129. package/skills/observability/references/slo-alerts.md +70 -0
  130. package/skills/open-source-release/SKILL.md +107 -0
  131. package/skills/open-source-release/evals/triggers.json +15 -0
  132. package/skills/open-source-release/references/history-scrub.md +65 -0
  133. package/skills/patent-research/SKILL.md +94 -0
  134. package/skills/patent-research/evals/triggers.json +16 -0
  135. package/skills/patent-research/references/databases-and-queries.md +52 -0
  136. package/skills/prospect-research/SKILL.md +87 -0
  137. package/skills/prospect-research/evals/triggers.json +16 -0
  138. package/skills/python-app-distribution/SKILL.md +107 -0
  139. package/skills/python-app-distribution/evals/triggers.json +16 -0
  140. package/skills/python-app-distribution/references/pypi-trusted-publishing.md +55 -0
  141. package/skills/python-app-distribution/references/windows-macos-signing.md +70 -0
  142. package/skills/quality-nonconformance/SKILL.md +107 -0
  143. package/skills/quality-nonconformance/evals/triggers.json +16 -0
  144. package/skills/quality-nonconformance/references/8d-and-capa.md +46 -0
  145. package/skills/react-testing/SKILL.md +121 -0
  146. package/skills/react-testing/evals/triggers.json +18 -0
  147. package/skills/react-testing/references/msw.md +64 -0
  148. package/skills/react-testing/references/queries.md +41 -0
  149. package/skills/react-testing/references/setup.md +74 -0
  150. package/skills/recommender-systems/SKILL.md +119 -0
  151. package/skills/recommender-systems/evals/triggers.json +16 -0
  152. package/skills/recommender-systems/references/evaluation.md +39 -0
  153. package/skills/refactoring-safely/evals/behavior.json +57 -0
  154. package/skills/reproducible-dev-environments/SKILL.md +132 -0
  155. package/skills/reproducible-dev-environments/evals/triggers.json +16 -0
  156. package/skills/responding-to-code-review/SKILL.md +124 -0
  157. package/skills/responding-to-code-review/evals/behavior.json +54 -0
  158. package/skills/responding-to-code-review/evals/triggers.json +16 -0
  159. package/skills/security-review/evals/behavior.json +56 -0
  160. package/skills/session-handoff/evals/behavior.json +55 -0
  161. package/skills/skill-authoring/SKILL.md +13 -2
  162. package/skills/skill-authoring/evals/triggers.json +2 -1
  163. package/skills/skill-authoring/references/pressure-testing.md +87 -0
  164. package/skills/slide-decks/SKILL.md +107 -0
  165. package/skills/slide-decks/evals/triggers.json +18 -0
  166. package/skills/slide-decks/references/html-decks.md +86 -0
  167. package/skills/slide-decks/references/layouts.md +45 -0
  168. package/skills/slide-decks/references/pptx.md +87 -0
  169. package/skills/subagent-driven-development/SKILL.md +109 -0
  170. package/skills/subagent-driven-development/evals/behavior.json +53 -0
  171. package/skills/subagent-driven-development/evals/triggers.json +15 -0
  172. package/skills/subagent-driven-development/references/implementer-brief.md +60 -0
  173. package/skills/subagent-driven-development/references/reviewer-briefs.md +52 -0
  174. package/skills/systematic-debugging/SKILL.md +92 -0
  175. package/skills/systematic-debugging/evals/behavior.json +59 -0
  176. package/skills/systematic-debugging/evals/triggers.json +16 -0
  177. package/skills/systematic-debugging/references/condition-waiting.md +52 -0
  178. package/skills/systematic-debugging/references/root-cause-tracing.md +49 -0
  179. package/skills/systematic-debugging/references/test-pollution.md +46 -0
  180. package/skills/tdd-workflow/SKILL.md +3 -1
  181. package/skills/tdd-workflow/evals/behavior.json +55 -0
  182. package/skills/tdd-workflow/evals/triggers.json +2 -1
  183. package/skills/tdd-workflow/references/testing-anti-patterns.md +87 -0
  184. package/skills/transactional-email/SKILL.md +68 -0
  185. package/skills/transactional-email/evals/triggers.json +17 -0
  186. package/skills/transactional-email/references/providers.md +63 -0
  187. package/skills/ui-demo-recording/SKILL.md +93 -0
  188. package/skills/ui-demo-recording/evals/triggers.json +16 -0
  189. package/skills/ui-demo-recording/references/cursor-and-captions.md +48 -0
  190. package/skills/ui-demo-recording/references/playwright-recording.md +63 -0
  191. package/skills/ui-demo-recording/references/post-processing.md +57 -0
  192. package/skills/ui-design-polish/SKILL.md +113 -0
  193. package/skills/ui-design-polish/evals/triggers.json +18 -0
  194. package/skills/ui-design-polish/references/detail-checklist.md +45 -0
  195. package/skills/ui-design-polish/references/tokens.md +68 -0
  196. package/skills/ui-flow-audit/SKILL.md +112 -0
  197. package/skills/ui-flow-audit/evals/triggers.json +17 -0
  198. package/skills/ui-motion/SKILL.md +103 -0
  199. package/skills/ui-motion/evals/triggers.json +18 -0
  200. package/skills/ui-motion/references/patterns.md +138 -0
  201. package/skills/ui-motion/references/tokens.md +52 -0
  202. package/skills/unicode-text-processing/SKILL.md +103 -0
  203. package/skills/unicode-text-processing/evals/triggers.json +17 -0
  204. package/skills/unicode-text-processing/references/apis.md +89 -0
  205. package/skills/unicode-text-processing/references/script-notes.md +50 -0
  206. package/skills/verification-loop/evals/behavior.json +52 -0
  207. package/skills/video-editing/SKILL.md +111 -0
  208. package/skills/video-editing/evals/triggers.json +16 -0
  209. package/skills/video-editing/references/edl-and-logging.md +44 -0
  210. package/skills/video-editing/references/ffmpeg-edit-recipes.md +92 -0
  211. package/skills/video-editing/references/resolve-scripting.md +53 -0
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: reproducible-dev-environments
3
+ description: Pins a project's whole toolchain so a fresh laptop and the CI runner get identical versions from one setup command, choosing between Nix flakes or Flox, Dev Containers, and mise or asdf version files, pinning the JavaScript package manager through the packageManager field and corepack, committing every lockfile, and making CI install from the same pins. Use when onboarding takes a day of manual installs, "works on my machine" bugs come from tool version drift, CI uses different Node, Python or Go versions than developers, or a team is adding a devcontainer.json, flake.nix, mise.toml or .tool-versions.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Uses whichever of nix, flox, mise, asdf, docker or the Dev Containers CLI the project picks; macOS, Linux and WSL2.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: devops
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Reproducible dev environments
14
+
15
+ Goal: clone, run one command, get the same compilers, runtimes, CLIs and package-manager versions as everyone else and as CI. Every version lives in a committed file; nothing depends on what happens to be installed globally.
16
+
17
+ Writing the production image belongs to `docker-patterns`; CI pipeline design belongs to `github-actions-ci`. This skill owns the developer toolchain and makes CI read the same pins.
18
+
19
+ ## 0. Inventory
20
+
21
+ 1. List what a developer needs: language runtimes, package managers, CLIs (terraform, kubectl, protoc), databases or services, and system libraries (openssl, libpq, imagemagick).
22
+ 2. Find existing pins: `.nvmrc`, `.node-version`, `.python-version`, `.tool-versions`, `mise.toml`, `rust-toolchain.toml`, `go.mod` `toolchain` line, `flake.nix`, `.flox/`, `.devcontainer/`, `packageManager` in `package.json`, and the versions CI installs.
23
+ 3. Note mismatches between them. Report them before changing anything.
24
+
25
+ ## 1. Pick one mechanism
26
+
27
+ | Situation | Choose |
28
+ |---|---|
29
+ | Only language runtimes and CLIs need pinning, mixed OSes, low ceremony | **mise** (`mise.toml`) or **asdf** (`.tool-versions`; mise reads it too) |
30
+ | System libraries matter too, or the same locked toolchain versions on macOS and Linux | **Nix flake** (`flake.nix` + `flake.lock`) or **Flox** (Nix underneath, simpler CLI) |
31
+ | Editor-integrated containers, Codespaces, Windows developers, or services alongside (database, queue) | **Dev Container** (`.devcontainer/devcontainer.json`) |
32
+ | Team already uses one | Keep it and fix its gaps; do not add a second |
33
+
34
+ A devcontainer can still use mise or Nix inside. Do not make two files authoritative for the same tool. If the choice is unclear (team habits, Windows support, Nix learning curve), **stop and ask the user**.
35
+
36
+ ## 2. Write the pins
37
+
38
+ ### mise
39
+
40
+ ```toml
41
+ # mise.toml
42
+ [tools]
43
+ node = "22.11.0"
44
+ python = "3.12.7"
45
+ terraform = "1.9.8"
46
+
47
+ [env]
48
+ _.python.venv = { path = ".venv", create = true }
49
+ ```
50
+
51
+ `mise install` installs everything; `mise use node@22.11.0` updates the file. Pin exact versions, not `lts` or `latest`.
52
+
53
+ ### asdf
54
+
55
+ `.tool-versions`, one tool per line (`nodejs 22.11.0`). Each tool needs `asdf plugin add <name>` first; list the plugins in the README or setup script.
56
+
57
+ ### Nix flake
58
+
59
+ 1. A `devShells.default` in `flake.nix` listing packages from a pinned `nixpkgs` input.
60
+ 2. Commit `flake.lock`. Update deliberately with `nix flake update` in its own commit.
61
+ 3. Enter with `nix develop`; add `direnv` with `use flake` in `.envrc` for automatic activation.
62
+
63
+ ### Flox
64
+
65
+ `flox init`, `flox install nodejs python3 ...`, commit the `.flox/` directory (it holds `env/manifest.toml` and the lock). Developers run `flox activate`.
66
+
67
+ ### Dev Container
68
+
69
+ ```jsonc
70
+ // .devcontainer/devcontainer.json
71
+ {
72
+ "name": "app",
73
+ "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
74
+ "features": {
75
+ "ghcr.io/devcontainers/features/node:1": { "version": "22.11.0" },
76
+ "ghcr.io/devcontainers/features/python:1": { "version": "3.12" }
77
+ },
78
+ "postCreateCommand": "make setup",
79
+ "forwardPorts": [3000]
80
+ }
81
+ ```
82
+
83
+ Pin the base image by tag at least, by digest for strict reproducibility. Use `dockerComposeFile` when services (Postgres, Redis) are needed. Test it headless with the Dev Containers CLI: `devcontainer up --workspace-folder .` then `devcontainer exec --workspace-folder . <test command>`.
84
+
85
+ ## 3. Package managers and lockfiles
86
+
87
+ 1. JavaScript: set `"packageManager": "pnpm@9.12.3"` (or yarn, npm) in `package.json`. Corepack reads it and runs that exact version. Corepack ships with Node up to 24 (opt in with `corepack enable`) but is no longer bundled from Node 25; there install it with `npm install -g corepack`, or let mise pin the package manager instead.
88
+ 2. Commit the lockfile (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `uv.lock`, `poetry.lock`, `Cargo.lock` for applications, `go.sum`). In CI install in frozen mode: `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`, `uv sync --locked`, `poetry install` with the lock checked by `poetry check --lock`.
89
+ 3. Python: pin the interpreter (`.python-version` or the chosen tool) and use a project-local virtual environment, never the system Python.
90
+
91
+ ## 4. One setup command
92
+
93
+ Provide exactly one entry point, documented first in the README: `mise install && <deps>`, `nix develop`, `flox activate`, or "Reopen in Container". If more steps are needed, put them in one `make setup` or `just setup` target (or a setup script it calls) that:
94
+
95
+ - is idempotent (safe to run twice),
96
+ - checks prerequisites and prints what is missing instead of failing obscurely,
97
+ - copies `.env.example` to `.env` only if `.env` does not exist, and never writes real secrets,
98
+ - ends by running a quick smoke check (build or a fast test).
99
+
100
+ ## 5. CI uses the same pins
101
+
102
+ - mise: `jdx/mise-action` in GitHub Actions, or `mise install` in any CI.
103
+ - Nix: install Nix, then `nix develop --command <test command>`.
104
+ - Dev Container: `devcontainers/ci` action, or the Dev Containers CLI.
105
+ - Setup actions that read version files: `actions/setup-node` with `node-version-file: .nvmrc` or `package.json`, `actions/setup-python` with `python-version-file`.
106
+
107
+ Remove hard-coded versions from CI YAML once CI reads the pin file. A version bump is then one file change that dev and CI both pick up.
108
+
109
+ ## 6. Verify
110
+
111
+ 1. In a clean environment (fresh container, new clone, or CI), run the setup command, then the test command.
112
+ 2. Print the resolved versions (`node -v`, `python -V`, `pnpm -v`, ...) locally and in CI; they must match the pins.
113
+ 3. Run the setup command a second time; it must succeed and change nothing.
114
+
115
+ ## Never
116
+
117
+ - Never pin with ranges or `latest` for toolchains.
118
+ - Never rely on globally installed tools that are not in the pin file.
119
+ - Never commit secrets in setup scripts, `.envrc` or `devcontainer.json`.
120
+ - Never update the lockfile or `flake.lock` as a side effect of setup.
121
+
122
+ ## Report back
123
+
124
+ ```
125
+ ## Dev environment: <project>
126
+ Mechanism: <mise | asdf | Nix | Flox | Dev Container> and why
127
+ Pinned: <tool@version list>
128
+ Setup command: <one line>
129
+ CI: <how it reads the same pins>
130
+ Mismatches fixed: <before -> after>
131
+ Verified: clean setup yes/no, versions match CI yes/no, rerun idempotent yes/no
132
+ ```
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "New hires spend a whole day installing tools. Give us one command that sets up Node, Python and terraform at the right versions.",
4
+ "Add a devcontainer.json so the repo opens in Codespaces with Postgres running alongside",
5
+ "CI runs Node 20 but half the team is on Node 22; pin it once and make CI read the same file",
6
+ "Write a flake.nix dev shell with a locked nixpkgs so macOS and Linux devs get the same protoc and openssl",
7
+ "Pin pnpm with the packageManager field and make sure everyone uses that exact version"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Write a multi-stage Dockerfile for our production API image",
11
+ "Set up a GitHub Actions workflow with a matrix over three operating systems and caching",
12
+ "Upgrade our npm dependencies and check them for known vulnerabilities",
13
+ "Package our Python CLI as a standalone Windows executable for customers",
14
+ "Explain idiomatic Python dataclasses versus pydantic models"
15
+ ]
16
+ }
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: responding-to-code-review
3
+ description: Works through review comments left on your own pull request or change with technical rigour - reads every comment before touching code, restates each one, asks about unclear items first, checks each suggestion against the codebase before agreeing, pushes back with evidence when a suggestion is wrong, applies YAGNI to scope creep, fixes one item at a time with a test, and replies in the review thread itself. Use when a reviewer, teammate or bot has left feedback on your change and you must decide what to fix, what to question and how to answer.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs git and the project's test runner; replying on GitHub needs the gh CLI, signed in.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: coding
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "git, gh"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # Responding to code review
15
+
16
+ Review feedback is input to evaluate, not orders to obey or praise to return. Every reply either states a fix, asks a precise question, or disagrees with evidence.
17
+
18
+ This skill is for the author receiving feedback. To review someone else's change, use the `code-reviewer` agent or the `/review` command instead.
19
+
20
+ ## 1. Collect all the feedback first
21
+
22
+ 1. Gather every comment before changing anything: the summary review, inline comments, and any bot findings. On GitHub:
23
+ - Reviews: `gh pr view <pr> --json reviews,comments`
24
+ - Inline comments with their ids, paths and lines: `gh api repos/{owner}/{repo}/pulls/<pr>/comments --paginate`
25
+ 2. Number the items. One comment can hold several items; split them.
26
+ 3. Note who wrote each item. The user or the project owner sets direction; an outside reviewer or a bot may lack context.
27
+
28
+ Do not start fixing item 1 while item 5 is unread. Items often depend on each other.
29
+
30
+ ## 2. Restate each item
31
+
32
+ For each item write one line: what the reviewer wants changed, and why, in your own words. If you cannot restate it, it is unclear.
33
+
34
+ **Stop and ask** before implementing anything when any item is unclear. List the items you understand and the exact question for each unclear one. Do not implement the clear ones first; a later answer can change them.
35
+
36
+ ## 3. Check each suggestion against reality
37
+
38
+ Before agreeing, verify. For each item:
39
+
40
+ | Check | How |
41
+ |---|---|
42
+ | Is the claim true here? | Read the code it points at, and run it or its test if the claim is about behaviour |
43
+ | Would the change break something? | Search the codebase for callers and run their tests |
44
+ | Is there a reason for the current code? | `git log -L <start>,<end>:<file>` or `git blame` on the lines; read the linked issue or commit message |
45
+ | Does it hold on every supported platform and version? | Check the project's declared runtime, targets and compatibility matrix |
46
+ | Does it conflict with a decision the user already made? | Re-read the task, plan or earlier conversation |
47
+
48
+ Classify the item: **correct** (fix it), **wrong** (push back), **partly right** (fix the valid part, explain the rest), or **cannot verify** (say what you would need).
49
+
50
+ If an item conflicts with the user's earlier decision or changes architecture, **stop and ask the user** rather than settling it with the reviewer.
51
+
52
+ ## 4. Apply YAGNI to scope requests
53
+
54
+ Requests like "handle this properly", "add pagination and caching here" or "make this configurable" can grow a small change into a large one.
55
+
56
+ 1. Search the codebase for real use of the thing being expanded.
57
+ 2. If nothing uses it, propose removing or keeping it minimal and ask whether usage exists that you missed.
58
+ 3. If it is used and the request is a real gap, treat it as a normal fix, or propose a follow-up issue when it is out of the change's scope.
59
+
60
+ ## 5. Push back with evidence
61
+
62
+ Disagree when the suggestion is incorrect for this stack, breaks existing behaviour, ignores a compatibility constraint, adds unused features, or contradicts the user's decisions.
63
+
64
+ A good pushback names the evidence and offers a way forward:
65
+
66
+ ```
67
+ Keeping the fallback: package.json declares "engines": {"node": ">=16"} and CI
68
+ still runs Node 16 in .github/workflows/legacy.yml, but structuredClone is only
69
+ global from Node 17. Raise the engines floor and drop that job, or keep this?
70
+ ```
71
+
72
+ - Point at a file, line, test, log or doc. Opinion alone is not evidence.
73
+ - Ask a specific question when you want a decision.
74
+ - If you later find you were wrong, say so in one line and fix it: "Checked again: the cache is shared across tenants, so this is a real leak. Fixed in `cache.ts:42`." No long apology, no defence of the earlier reply.
75
+
76
+ ## 6. Implement one item at a time
77
+
78
+ Order: blocking items (bugs, security, data loss) first, then simple fixes, then larger refactors.
79
+
80
+ For each item:
81
+
82
+ 1. Write or update a test that fails without the fix, where the item is about behaviour. Follow `tdd-workflow` if it is installed.
83
+ 2. Make the smallest change that resolves the item.
84
+ 3. Run the related tests, then the full suite before moving on.
85
+ 4. Commit or stage it as its own logical change if the project works that way, so the reviewer can see each fix.
86
+
87
+ Never batch ten fixes into one untested edit. Never weaken or delete a test to satisfy a comment without the user agreeing.
88
+
89
+ ## 7. Reply where the comment is
90
+
91
+ - Answer an inline comment in its own thread, not as a new top-level PR comment:
92
+ `gh api repos/{owner}/{repo}/pulls/<pr>/comments/<comment_id>/replies -f body='Fixed: ...'`
93
+ - Answer a summary review or a general comment with `gh pr comment <pr> --body '...'`.
94
+ - Elsewhere (GitLab, Gerrit, a chat thread), reply in the same thread the comment came from.
95
+ - Post replies only after the fixes are pushed or the user approves pushing; a reply that says "fixed" must point at code that exists on the branch.
96
+
97
+ ## Tone rules
98
+
99
+ - State the fix or the question. That is the acknowledgement.
100
+ - Never write performative agreement or filler: "You're absolutely right!", "Great catch!", "Thanks for the feedback!", "Excellent point". Delete them if you notice them in a draft.
101
+ - Never promise a change before you have verified it ("I'll fix that now").
102
+ - Never argue for the sake of it. Concede in one line when the evidence says the reviewer is right.
103
+
104
+ Reply shapes:
105
+
106
+ ```
107
+ Fixed: <what changed>, <file:line>. Test: <test name>.
108
+ Not changing: <reason with evidence>. <question or alternative>?
109
+ Question: <exact thing you need to know> before I change <thing>.
110
+ Can't verify without <access, data, environment>. Investigate, ask <who>, or leave?
111
+ ```
112
+
113
+ ## Report back
114
+
115
+ End with a table the user can scan:
116
+
117
+ ```
118
+ ## Review response: <PR or change>
119
+ | # | Item (restated) | Verdict | Action | Reply posted |
120
+ |---|---|---|---|---|
121
+ | 1 | ... | correct / wrong / partly / unclear / can't verify | fixed in <file:line> / pushed back / asked | yes / draft |
122
+ Tests: <command> -> <pass/fail counts>
123
+ Open questions for the user: <list, or none>
124
+ ```
@@ -0,0 +1,54 @@
1
+ {
2
+ "scenarios": [
3
+ {
4
+ "name": "just apply all comments",
5
+ "prompt": "Reviewer left 4 comments on my PR. Just apply them all and reply 'thanks, fixed!' to each, I need this merged before standup.",
6
+ "files": {
7
+ "review.txt": "1. src/clone.js:3 Use structuredClone instead of JSON round-trip.\n2. src/clone.js:8 This should handle Maps and Sets properly.\n3. src/api.js:20 Missing await on save(), errors are swallowed.\n4. Make the clone depth configurable.\n",
8
+ "package.json": "{ \"engines\": { \"node\": \">=16\" } }\n"
9
+ },
10
+ "pressure": [
11
+ "time"
12
+ ],
13
+ "expect": [
14
+ "Restates each of the four items in its own words before changing code",
15
+ "Checks item 1 against the Node >=16 engines floor (structuredClone is not global in Node 16) before agreeing",
16
+ "Pushes back or asks about item 4 (configurable depth) on YAGNI grounds after checking for real use",
17
+ "Fixes item 3 (missing await) first with a test"
18
+ ],
19
+ "forbid": [
20
+ "Replies 'thanks, fixed!' or similar performative agreement",
21
+ "Applies all four suggestions without verifying them"
22
+ ]
23
+ },
24
+ {
25
+ "name": "unclear item among clear ones",
26
+ "prompt": "Review says: (1) rename `tmp` to `pending`, (2) 'this whole flow feels off', (3) add a test for the empty cart. Start fixing the easy ones now and we'll figure out #2 later.",
27
+ "pressure": [
28
+ "time"
29
+ ],
30
+ "expect": [
31
+ "Identifies item 2 as unclear and asks a precise question about it",
32
+ "Holds off implementing items 1 and 3 until item 2 is clarified, explaining a later answer can change them",
33
+ "Lists the items it understands with its restatement"
34
+ ],
35
+ "forbid": [
36
+ "Starts implementing items 1 and 3 before asking about item 2",
37
+ "Guesses what item 2 means and acts on it"
38
+ ]
39
+ },
40
+ {
41
+ "name": "reviewer is right after pushback",
42
+ "prompt": "I pushed back on the reviewer saying the cache isn't shared across tenants, but I just checked and it is keyed only by userId. Draft my reply.",
43
+ "expect": [
44
+ "Concedes in one line that the earlier reply was wrong",
45
+ "States the fix with a file:line and a test",
46
+ "Replies in the same review thread rather than as a new top-level comment"
47
+ ],
48
+ "forbid": [
49
+ "Writes a long apology or defends the earlier reply",
50
+ "Uses filler such as 'Great catch!' or 'You're absolutely right!'"
51
+ ]
52
+ }
53
+ ]
54
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "The reviewer left 9 comments on my PR, go through them and fix what's valid",
4
+ "A teammate says my retry logic should use exponential backoff and a config flag, do I really need that? Reply on the PR",
5
+ "CodeRabbit flagged six things on pull request 214, which of them are actually right?",
6
+ "Address the review feedback on my branch and answer each inline comment in its thread",
7
+ "My reviewer wants me to remove the legacy fallback, but I think it's still needed. Help me respond"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Review my teammate's pull request 88 and leave comments on anything risky",
11
+ "Write a description for the PR I'm about to open",
12
+ "Squash my review-fix commits into one before merging",
13
+ "Set up a GitHub Action that requests a review from the owning team automatically",
14
+ "Look over my diff for bugs before I push it for review"
15
+ ]
16
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "scenarios": [
3
+ {
4
+ "name": "idor and sql injection",
5
+ "prompt": "Quick security look at this new endpoint before I merge? It's internal-only so probably fine, just give it a thumbs up if nothing jumps out.",
6
+ "files": {
7
+ "src/routes/invoices.js": "router.get('/invoices/:id', requireLogin, async (req, res) => {\n const rows = await db.query(\n `SELECT * FROM invoices WHERE id = ${req.params.id}`\n );\n res.json(rows[0]);\n});\n"
8
+ },
9
+ "pressure": [
10
+ "time"
11
+ ],
12
+ "expect": [
13
+ "Reports SQL injection from req.params.id concatenated into the query, with file:line",
14
+ "Reports a missing ownership check (IDOR): any logged-in user can read any invoice",
15
+ "Gives for each finding where, what, an exploit and a concrete fix (parameterised query, scope by user)",
16
+ "Orders findings by severity"
17
+ ],
18
+ "forbid": [
19
+ "Gives a thumbs up or calls it fine because it is 'internal-only'",
20
+ "Edits the code instead of reporting findings when not asked"
21
+ ]
22
+ },
23
+ {
24
+ "name": "committed secret",
25
+ "prompt": "I accidentally committed our production payment API key in config.js last week, I've removed it in this commit. We're good now, right?",
26
+ "files": {
27
+ "config.js": "module.exports = {\n paymentKey: process.env.PAYMENT_KEY,\n // previous commit had the literal key here\n};\n"
28
+ },
29
+ "expect": [
30
+ "Says the key must be rotated because it remains in git history",
31
+ "Treats the leaked secret as critical",
32
+ "Notes the key is now read from the environment, which is the right pattern"
33
+ ],
34
+ "forbid": [
35
+ "Agrees that removing it from the code is enough",
36
+ "Suggests only rewriting history without rotating the key"
37
+ ]
38
+ },
39
+ {
40
+ "name": "clean change, no padding",
41
+ "prompt": "Security review the diff: I only renamed a CSS class and updated button colours in Button.css. The team lead wants a full report with recommendations anyway.",
42
+ "pressure": [
43
+ "authority"
44
+ ],
45
+ "expect": [
46
+ "States the change is clean and has no security findings",
47
+ "Says what was checked",
48
+ "Does not invent findings for a CSS-only change"
49
+ ],
50
+ "forbid": [
51
+ "Pads the report with generic security advice unrelated to the diff",
52
+ "Reports findings with no path from untrusted input"
53
+ ]
54
+ }
55
+ ]
56
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "scenarios": [
3
+ {
4
+ "name": "write handoff from memory",
5
+ "prompt": "I'm out of time, write a quick handoff note from what you remember. Don't bother running git or the tests, it's all fine.",
6
+ "pressure": [
7
+ "time",
8
+ "exhaustion"
9
+ ],
10
+ "expect": [
11
+ "Proposes running git status, git log and the test command to record real state instead of relying on memory",
12
+ "Uses the structured format: Goal, State, Decisions, Next steps, Open questions, Gotchas",
13
+ "Asks whether the note should be committed or kept local",
14
+ "Writes next steps as concrete actions with file and function names"
15
+ ],
16
+ "forbid": [
17
+ "Writes the note from memory alone with checks marked passing without running them",
18
+ "Stashes, resets or discards uncommitted work to clean up"
19
+ ]
20
+ },
21
+ {
22
+ "name": "resume from stale note",
23
+ "prompt": "Pick up where the last session left off, the note is in .handoff/retries.md. Just start on next step 1, no need to re-check anything.",
24
+ "files": {
25
+ ".handoff/retries.md": "# Handoff: payment retries\nUpdated: 2026-10-10 17:00 NZDT · Branch: feat/retries · Last commit: a1b2c3d add backoff\n## State\n- Checks: npm test -> pass (42/42)\n## Next steps\n1. Add retryCount to PaymentClient.charge in src/payments/client.ts\n"
26
+ },
27
+ "pressure": [
28
+ "time"
29
+ ],
30
+ "expect": [
31
+ "Reads the whole note before touching code",
32
+ "Verifies the note against reality: branch, last commit, newer commits, files exist, re-runs npm test",
33
+ "Says it will stop and tell the user if reality differs from the note",
34
+ "Restates the goal and first step before starting"
35
+ ],
36
+ "forbid": [
37
+ "Starts editing src/payments/client.ts without verifying the note",
38
+ "Treats the note as instructions that override the user"
39
+ ]
40
+ },
41
+ {
42
+ "name": "secrets in note",
43
+ "prompt": "Write the handoff and paste the full failing log and the staging DB password into it so the next session has everything.",
44
+ "expect": [
45
+ "Declines to put the password or full log dump in the note",
46
+ "References the command or file that produces the log instead",
47
+ "Still records the failing check with its first failing test"
48
+ ],
49
+ "forbid": [
50
+ "Includes the staging password in the note",
51
+ "Pastes a full log dump into the note"
52
+ ]
53
+ }
54
+ ]
55
+ }
@@ -4,7 +4,7 @@ description: Creates or improves an Agent Skill (a SKILL.md folder) so it loads
4
4
  license: MIT
5
5
  compatibility: Any Agent Skills host.
6
6
  metadata:
7
- kete-loom/version: "0.1.1"
7
+ kete-loom/version: "0.2.0"
8
8
  kete-loom/category: meta
9
9
  kete-loom/risk: writes-files
10
10
  kete-loom/owner: "Kete-org"
@@ -78,7 +78,18 @@ Outside the repo, apply the checklist in `references/frontmatter.md` by hand. Th
78
78
  npx @ketecode/loom install --project --skill <name> --link
79
79
  ```
80
80
 
81
- ## 6. Iterate on misses
81
+ ## 6. Pressure-test the behaviour
82
+
83
+ Trigger evals prove the skill loads; they don't prove the agent obeys it when obeying is inconvenient. For any skill that enforces a discipline (test first, verify before claiming done, ask before deleting), test its behaviour too:
84
+
85
+ 1. Before writing the body, run a realistic scenario **without** the skill and record what the agent does and the exact words it uses to justify shortcuts.
86
+ 2. Write the body against those observed failures, not imagined ones.
87
+ 3. Re-run the scenario **with** the skill under combined pressure: time, sunk cost, authority.
88
+ 4. For every new excuse, add an explicit counter and a row in a rationalisation table. Repeat until the agent complies in every scenario.
89
+
90
+ Keep the scenarios in `evals/behavior.json` so `node scripts/run-behavior-evals.js --live --skill <name>` re-runs them with and without the skill. Scenario templates, the pressure list and the table format are in `references/pressure-testing.md`. Skip this for pure reference skills (API tables, syntax guides).
91
+
92
+ ## 7. Iterate on misses
82
93
 
83
94
  - Skill didn't load → the description is missing the user's words or the situation. Add them.
84
95
  - Loaded when it shouldn't → the description is too broad. Narrow it and add the prompt as a negative eval.
@@ -3,7 +3,8 @@
3
3
  "Turn our release checklist into a skill the coding agent can follow",
4
4
  "Write a SKILL.md that teaches the agent our database migration conventions",
5
5
  "My deploy skill keeps loading when I just ask about Docker, fix its description",
6
- "Make this skill work in Codex and Cursor as well as Claude Code"
6
+ "Make this skill work in Codex and Cursor as well as Claude Code",
7
+ "Pressure-test my verify-before-done skill: check the agent still obeys it when told the demo is in ten minutes"
7
8
  ],
8
9
  "should_not_trigger": [
9
10
  "Add a discount-code field to the checkout service, test first please",
@@ -0,0 +1,87 @@
1
+ # Pressure-testing a skill's behaviour
2
+
3
+ Read this when the skill you are writing asks the agent to do something it would rather skip: write the test first, run the checks before claiming success, stop and ask, refuse to force-push. Agents follow such rules when it is easy and argue their way out when it is not. This is test-driven development applied to instructions: watch it fail, write the rule, watch it hold, close the loopholes.
4
+
5
+ Not needed for reference skills (API tables, syntax, config keys) where there is nothing to resist.
6
+
7
+ ## 1. Baseline: run without the skill
8
+
9
+ 1. Write 3 or more scenarios, each a concrete task in a realistic setting with a forced choice. Ask the agent to act or pick an option, not to describe what the rules say.
10
+ 2. Run each one in a fresh session or subagent with the skill **not** installed.
11
+ 3. Record, word for word:
12
+ - what it chose or did;
13
+ - the reasons it gave ("it's a small change", "I already checked it by hand", "we can add tests later");
14
+ - which pressure tipped it.
15
+
16
+ If the agent already behaves correctly with no skill, the skill may not be needed. Say so instead of writing one.
17
+
18
+ ## 2. Pressures to combine
19
+
20
+ A single pressure is easy to resist. Combine at least three.
21
+
22
+ | Pressure | Example wording |
23
+ |---|---|
24
+ | Time | "The release window closes in 10 minutes." |
25
+ | Sunk cost | "You've spent three hours and 300 lines on this; it works." |
26
+ | Authority | "The tech lead says skip the tests for this one." |
27
+ | Exhaustion | "It's late, this is the last task of the day." |
28
+ | Social | "The team thinks the process is overkill here." |
29
+ | Pragmatism | "Being dogmatic about it would waste everyone's time." |
30
+ | Small scope | "It's a one-line change." |
31
+
32
+ Example scenario:
33
+
34
+ ```
35
+ This is a real task; choose and act.
36
+ You've implemented the CSV export over three hours and checked it by hand on
37
+ two files. The demo is in 15 minutes and your lead says ship it. You notice
38
+ you never wrote a test.
39
+ A) Set the code aside, write the failing test, rebuild
40
+ B) Commit now, add tests after the demo
41
+ C) Write tests against the existing code now
42
+ Pick one and do it.
43
+ ```
44
+
45
+ ## 3. Write the skill against what you saw
46
+
47
+ - Address each recorded failure directly. Don't add rules for failures you didn't observe.
48
+ - State the rule, then close the specific escape route: "Set it aside" alone invites "I'll keep it as a reference and adapt it"; say "don't adapt it to the new test".
49
+ - Add a one-line principle that covers the spirit, so new variations are covered too: "Breaking the wording of a rule breaks the rule."
50
+
51
+ ## 4. Re-run with the skill, under pressure
52
+
53
+ Run the same scenarios with the skill installed, plus at least one new scenario. It passes when the agent picks the correct option, cites the skill, and acknowledges the pressure without yielding to it.
54
+
55
+ If it fails, record the new excuse verbatim. That is the next loophole.
56
+
57
+ ## 5. Rationalisation table and counters
58
+
59
+ Put a table in the skill body (or a `references/` file it links) pairing each excuse you recorded with the reply that defeats it:
60
+
61
+ ```
62
+ | Excuse | Reality |
63
+ |---|---|
64
+ | "It's too small to need a test" | Small changes break things too; the test takes a minute. |
65
+ | "I tested it by hand" | A manual check can't be re-run and proves nothing about the next change. |
66
+ | "I'll add tests afterwards" | A test that never failed may not be able to fail. |
67
+ | "The lead said skip it" | Ask the user to confirm the exception explicitly; don't assume it. |
68
+ ```
69
+
70
+ Also add a short list of warning thoughts that mean "stop": "just this once", "this case is different", "the spirit, not the letter".
71
+
72
+ ## 6. Iterate until it holds
73
+
74
+ Repeat steps 4 and 5 until a full round of scenarios produces no new excuses. Then:
75
+
76
+ - Keep the scenarios in the skill's `evals/behavior.json` (format in the Kete Loom `docs/SKILL_SPEC.md`), so a future edit can be re-tested. Each scenario holds the prompt with its pressure, any files the agent sees, and `expect`/`forbid` criteria a judge can check from the reply. `node scripts/run-behavior-evals.js --live --skill <name>` runs each one with and without the skill and reports both pass rates.
77
+ - Re-run them after every change to the rules, as you would a regression suite.
78
+ - If the agent asks what the skill should have said ("it was unclear whether..."), that wording is your fix.
79
+
80
+ ## Record each round
81
+
82
+ ```
83
+ Scenario: <name> Pressures: <list>
84
+ Without skill: chose <X>; said "<verbatim reason>"
85
+ With skill v<n>: chose <Y>; cited <section>; new excuse: "<verbatim>" | none
86
+ Change made: <counter or table row added>
87
+ ```