@iowarp/clio-coder 0.3.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 (226) hide show
  1. package/CHANGELOG.md +407 -0
  2. package/CODE_OF_CONDUCT.md +21 -0
  3. package/CONTRIBUTING.md +224 -0
  4. package/LICENSE +202 -0
  5. package/NOTICE +9 -0
  6. package/README.md +798 -0
  7. package/SECURITY.md +72 -0
  8. package/assets/clio-coder-logo-128.webp +0 -0
  9. package/damage-control-rules.yaml +419 -0
  10. package/dist/acp-UMLFVA3F.js +92 -0
  11. package/dist/agents-Q4MYPMUW.js +91 -0
  12. package/dist/auth-O6HYIJ6J.js +521 -0
  13. package/dist/chunk-262G75JS.js +35 -0
  14. package/dist/chunk-26BZQOAD.js +1281 -0
  15. package/dist/chunk-2J63S4SF.js +508 -0
  16. package/dist/chunk-3DANZDGR.js +717 -0
  17. package/dist/chunk-4UQA7NCT.js +29 -0
  18. package/dist/chunk-527KG6XR.js +497 -0
  19. package/dist/chunk-5LDRNKX2.js +1063 -0
  20. package/dist/chunk-5N2FG33Q.js +25 -0
  21. package/dist/chunk-67MTHP2E.js +135 -0
  22. package/dist/chunk-6CWDTGUC.js +20 -0
  23. package/dist/chunk-7BHLZB3A.js +2115 -0
  24. package/dist/chunk-7RBKDI66.js +348 -0
  25. package/dist/chunk-AMFR5YA3.js +541 -0
  26. package/dist/chunk-BBUH4VAA.js +1224 -0
  27. package/dist/chunk-BYEU76JP.js +899 -0
  28. package/dist/chunk-CLJ5HLUD.js +458 -0
  29. package/dist/chunk-D5YD55AR.js +116 -0
  30. package/dist/chunk-DXQNI4PC.js +61 -0
  31. package/dist/chunk-E3NYWENM.js +1004 -0
  32. package/dist/chunk-GNGDQYDU.js +34688 -0
  33. package/dist/chunk-GOTUR54M.js +9 -0
  34. package/dist/chunk-HBU5MTAM.js +41 -0
  35. package/dist/chunk-HMYNFFY4.js +28 -0
  36. package/dist/chunk-JPOWPFCU.js +1010 -0
  37. package/dist/chunk-JWHCJDCI.js +1215 -0
  38. package/dist/chunk-KBR4MZZR.js +41 -0
  39. package/dist/chunk-KKKPTZLM.js +93 -0
  40. package/dist/chunk-ME6DNWIU.js +66 -0
  41. package/dist/chunk-NI4DEJMC.js +88 -0
  42. package/dist/chunk-O4EJEDHO.js +659 -0
  43. package/dist/chunk-PIDUD6M2.js +31 -0
  44. package/dist/chunk-PS4PFJQP.js +29459 -0
  45. package/dist/chunk-QV47YRF4.js +48 -0
  46. package/dist/chunk-RQDWMVRB.js +279 -0
  47. package/dist/chunk-TFSSEXL6.js +136 -0
  48. package/dist/chunk-TKHQ4DGZ.js +8290 -0
  49. package/dist/chunk-TPOCL34A.js +2876 -0
  50. package/dist/chunk-UGYAX5YI.js +565 -0
  51. package/dist/chunk-UHTSULZS.js +461 -0
  52. package/dist/chunk-UU3R62TT.js +128 -0
  53. package/dist/chunk-UWIJNAOB.js +3906 -0
  54. package/dist/chunk-VOO7NYPP.js +914 -0
  55. package/dist/chunk-VPAWTYLY.js +117 -0
  56. package/dist/chunk-WD6AJM35.js +1216 -0
  57. package/dist/chunk-X3BR7HWV.js +115 -0
  58. package/dist/chunk-X3NE4WVW.js +120 -0
  59. package/dist/chunk-XNISANGE.js +1395 -0
  60. package/dist/chunk-XV4ZJ6ZM.js +3177 -0
  61. package/dist/cli/index.js +236 -0
  62. package/dist/clio-KIQ5SNDS.js +53 -0
  63. package/dist/components-JVHMUBEB.js +653 -0
  64. package/dist/config-ZFCDBMDC.js +372 -0
  65. package/dist/configure-G4E3A2PG.js +27 -0
  66. package/dist/context-CDXTP2MP.js +293 -0
  67. package/dist/context-E3KIFVXI.js +185 -0
  68. package/dist/context-clear-3F4PLXOS.js +102 -0
  69. package/dist/context-index-Q7YSYTR3.js +106 -0
  70. package/dist/docs-YIETIWZI.js +280 -0
  71. package/dist/doctor-M5HJJZOL.js +61 -0
  72. package/dist/domains/agents/builtins/architect.md +33 -0
  73. package/dist/domains/agents/builtins/coder.md +31 -0
  74. package/dist/domains/agents/builtins/context-bootstrap.md +38 -0
  75. package/dist/domains/agents/builtins/debugger.md +30 -0
  76. package/dist/domains/agents/builtins/documenter.md +31 -0
  77. package/dist/domains/agents/builtins/git-master.md +30 -0
  78. package/dist/domains/agents/builtins/provenance.md +30 -0
  79. package/dist/domains/agents/builtins/researcher.md +71 -0
  80. package/dist/domains/agents/builtins/scout.md +42 -0
  81. package/dist/domains/agents/builtins/tester.md +31 -0
  82. package/dist/domains/agents/builtins/verifier.md +30 -0
  83. package/dist/domains/agents/builtins/wiki-writer.md +41 -0
  84. package/dist/eval-B3KZZESM.js +2674 -0
  85. package/dist/evidence-V67CHM35.js +233 -0
  86. package/dist/evolve-YDZSUQYA.js +518 -0
  87. package/dist/extensions-SRG7XCAH.js +207 -0
  88. package/dist/fleet-CA2CRTVG.js +760 -0
  89. package/dist/fleet-preflight-CLIAX7YR.js +21 -0
  90. package/dist/init-2OZDJE2D.js +227 -0
  91. package/dist/memory-3PIQQAKX.js +207 -0
  92. package/dist/models-DY35XI7Y.js +237 -0
  93. package/dist/paths-5OMXW7Z4.js +57 -0
  94. package/dist/preload-KZVHET2B.js +11 -0
  95. package/dist/reset-PIFYNOS3.js +216 -0
  96. package/dist/run-3VSPP24F.js +735 -0
  97. package/dist/share-D36RQCXM.js +241 -0
  98. package/dist/skills-F2MRLELY.js +445 -0
  99. package/dist/skills-eval-E2ZTW4PL.js +932 -0
  100. package/dist/targets-DZMEZAH4.js +977 -0
  101. package/dist/trace-7NYCUI2J.js +250 -0
  102. package/dist/uninstall-AD3JWHBB.js +322 -0
  103. package/dist/upgrade-WYYBKGDY.js +301 -0
  104. package/dist/usage-ULIDAGFF.js +755 -0
  105. package/dist/version-ROZ6CZKH.js +16 -0
  106. package/dist/wiki-generate-PKFIX6OB.js +377 -0
  107. package/dist/worker/entry.js +1739 -0
  108. package/docs/README.md +93 -0
  109. package/docs/acp.md +120 -0
  110. package/docs/alcf-provider.md +72 -0
  111. package/docs/architecture.md +172 -0
  112. package/docs/artifact-versions.md +54 -0
  113. package/docs/built-in-agents.md +265 -0
  114. package/docs/capacity-and-scheduling.md +97 -0
  115. package/docs/commands-and-modes.md +554 -0
  116. package/docs/config-knobs-audit.md +115 -0
  117. package/docs/configuration-and-targets.md +812 -0
  118. package/docs/context-engine.md +236 -0
  119. package/docs/dispatch-architecture-rationale.md +126 -0
  120. package/docs/documentation-coverage.md +46 -0
  121. package/docs/documentation-guide.md +166 -0
  122. package/docs/environment-variables.md +105 -0
  123. package/docs/eval-runner.md +205 -0
  124. package/docs/evals-internal.md +298 -0
  125. package/docs/evidence-and-memory.md +243 -0
  126. package/docs/evolution.md +143 -0
  127. package/docs/exit-codes-and-output.md +74 -0
  128. package/docs/extensions-and-sharing.md +306 -0
  129. package/docs/fleet-demo-runbook.md +179 -0
  130. package/docs/fleet-dispatch.md +591 -0
  131. package/docs/glossary.md +75 -0
  132. package/docs/html/agents_blueprint.html +936 -0
  133. package/docs/html/alcf_blueprint.html +324 -0
  134. package/docs/html/architecture_blueprint.html +850 -0
  135. package/docs/html/commands_blueprint.html +794 -0
  136. package/docs/html/config_knobs_audit_blueprint.html +178 -0
  137. package/docs/html/configuration_blueprint.html +1080 -0
  138. package/docs/html/context_blueprint.html +603 -0
  139. package/docs/html/documentation_blueprint.html +832 -0
  140. package/docs/html/environment_blueprint.html +404 -0
  141. package/docs/html/eval_blueprint.html +743 -0
  142. package/docs/html/evals_internal_blueprint.html +190 -0
  143. package/docs/html/evolution_blueprint.html +674 -0
  144. package/docs/html/extensions_blueprint.html +2065 -0
  145. package/docs/html/fleet_dispatch_blueprint.html +286 -0
  146. package/docs/html/index.html +919 -0
  147. package/docs/html/lifecycle_blueprint.html +723 -0
  148. package/docs/html/memory_blueprint.html +699 -0
  149. package/docs/html/middleware_blueprint.html +664 -0
  150. package/docs/html/models_blueprint.html +2366 -0
  151. package/docs/html/observability_blueprint.html +683 -0
  152. package/docs/html/provider_adapter_blueprint.html +245 -0
  153. package/docs/html/safety_blueprint.html +1386 -0
  154. package/docs/html/shared.css +571 -0
  155. package/docs/html/shared.js +143 -0
  156. package/docs/html/skills_blueprint.html +671 -0
  157. package/docs/html/soak_blueprint.html +182 -0
  158. package/docs/html/tool_usage_blueprint.html +350 -0
  159. package/docs/html/tools_blueprint.html +2249 -0
  160. package/docs/html/trace_blueprint.html +235 -0
  161. package/docs/html/tui_design_blueprint.html +314 -0
  162. package/docs/html/validation_blueprint.html +961 -0
  163. package/docs/html/worker_dispatch_blueprint.html +231 -0
  164. package/docs/installation-and-lifecycle.md +308 -0
  165. package/docs/middleware-and-components.md +148 -0
  166. package/docs/model-catalog.md +189 -0
  167. package/docs/observability.md +233 -0
  168. package/docs/proactive-memory.md +452 -0
  169. package/docs/prompt-envelope-and-tools.md +142 -0
  170. package/docs/provider-adapter-cookbook.md +148 -0
  171. package/docs/release-cut-checklist.md +138 -0
  172. package/docs/safety-model.md +357 -0
  173. package/docs/scientific-validation.md +105 -0
  174. package/docs/session-lifecycle.md +156 -0
  175. package/docs/skills-marketplace.md +46 -0
  176. package/docs/tool-usage.md +527 -0
  177. package/docs/trace-store.md +132 -0
  178. package/docs/troubleshooting.md +33 -0
  179. package/docs/tui-design.md +239 -0
  180. package/docs/worker-dispatch-mechanics.md +242 -0
  181. package/package.json +132 -0
  182. package/skills/README.md +408 -0
  183. package/skills/git/commit-crafting/SKILL.md +79 -0
  184. package/skills/git/commit-crafting/evals.md +92 -0
  185. package/skills/git/create-pr/SKILL.md +116 -0
  186. package/skills/git/create-pr/evals.md +114 -0
  187. package/skills/git/investigate-issue/SKILL.md +139 -0
  188. package/skills/git/investigate-issue/evals.md +94 -0
  189. package/skills/git/resolve-merge-conflicts/SKILL.md +96 -0
  190. package/skills/git/resolve-merge-conflicts/evals.md +58 -0
  191. package/skills/git/review-changes/SKILL.md +103 -0
  192. package/skills/git/review-changes/evals.md +85 -0
  193. package/skills/git/worktree-create/SKILL.md +92 -0
  194. package/skills/git/worktree-create/evals.md +97 -0
  195. package/skills/git/worktree-create/references/worktree-setup.md +66 -0
  196. package/skills/git/worktree-merge/SKILL.md +95 -0
  197. package/skills/git/worktree-merge/evals.md +114 -0
  198. package/skills/skill-marketplace.json +261 -0
  199. package/skills/workflow/cut-it/SKILL.md +86 -0
  200. package/skills/workflow/cut-it/evals.md +42 -0
  201. package/src/domains/agents/builtins/architect.md +33 -0
  202. package/src/domains/agents/builtins/coder.md +31 -0
  203. package/src/domains/agents/builtins/context-bootstrap.md +38 -0
  204. package/src/domains/agents/builtins/debugger.md +30 -0
  205. package/src/domains/agents/builtins/documenter.md +31 -0
  206. package/src/domains/agents/builtins/git-master.md +30 -0
  207. package/src/domains/agents/builtins/provenance.md +30 -0
  208. package/src/domains/agents/builtins/researcher.md +71 -0
  209. package/src/domains/agents/builtins/scout.md +42 -0
  210. package/src/domains/agents/builtins/tester.md +31 -0
  211. package/src/domains/agents/builtins/verifier.md +30 -0
  212. package/src/domains/agents/builtins/wiki-writer.md +41 -0
  213. package/src/domains/agents/fleets/build-review.md +34 -0
  214. package/src/domains/agents/fleets/build-test.md +35 -0
  215. package/src/domains/agents/fleets/sdlc.md +86 -0
  216. package/src/domains/prompts/fragments/identity/clio-worker.md +11 -0
  217. package/src/domains/prompts/fragments/identity/clio.md +26 -0
  218. package/src/domains/prompts/fragments/operating/contract.md +64 -0
  219. package/src/domains/prompts/fragments/safety/auto-edit.md +14 -0
  220. package/src/domains/prompts/fragments/safety/full-auto.md +14 -0
  221. package/src/domains/prompts/fragments/safety/read-only.md +13 -0
  222. package/src/domains/prompts/fragments/safety/suggest.md +13 -0
  223. package/src/domains/prompts/fragments/wiki/page.md +75 -0
  224. package/src/domains/prompts/fragments/wiki/plan.md +48 -0
  225. package/src/domains/providers/models/cloud-models/alcf.yaml +40 -0
  226. package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +993 -0
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: review-changes
3
+ description: Use before committing, when the user asks to review the uncommitted work — "review my changes", "check this before I commit", "pre-commit review". Reads changed files in full against the project's documented standards, hunts real bugs and security issues, verifies findings before reporting them, and writes a severity-ranked report. Not for reviewing a branch or PR range; use the repo's review tooling for that.
4
+ version: 0.2.0
5
+ license: Apache-2.0
6
+ allowed-tools:
7
+ - read
8
+ - grep
9
+ - find
10
+ - ls
11
+ - git
12
+ - bash
13
+ - context
14
+ - code_nav
15
+ - write
16
+ - artifact
17
+ clio:
18
+ registry-id: iowarp/clio-coder
19
+ source-url: https://github.com/iowarp/clio-coder/tree/main/skills/git/review-changes
20
+ audit: pass
21
+ provenance: adapted
22
+ origin: https://github.com/coleam00/skills/tree/main/.claude/skills/review-changes
23
+ eval-status: smoke-checked
24
+ model-size: large
25
+ agents:
26
+ - main
27
+ - coder
28
+ - git-master
29
+ ---
30
+
31
+ # Review Changes
32
+
33
+ Technical review of the uncommitted work: real bugs, security, standards.
34
+ Style nitpicks a formatter or linter would catch are not findings.
35
+
36
+ ## Step 1 — Load the project's bar
37
+
38
+ Read the standards the diff will be judged against: the project instruction
39
+ file (`CLIO-CODER.md`, `AGENTS.md`, `CLAUDE.md`), README, and documented standards
40
+ under `docs/`. A finding that contradicts a documented project convention is
41
+ wrong, not the code.
42
+
43
+ ## Step 2 — Collect the change set
44
+
45
+ ```bash
46
+ git status
47
+ git diff HEAD
48
+ git diff --stat HEAD
49
+ git ls-files --others --exclude-standard
50
+ ```
51
+
52
+ Read every changed and new file in full, not just the diff hunks: bugs live
53
+ in the interaction between the changed lines and the unchanged context.
54
+
55
+ ## Step 3 — Analyze each file
56
+
57
+ Check, in priority order:
58
+
59
+ 1. **Logic errors**: off-by-one, inverted conditionals, missing error
60
+ handling, race conditions, broken edge cases.
61
+ 2. **Security**: injection, unsafe data handling, secrets or keys in code —
62
+ flag these CRITICAL.
63
+ 3. **Performance**: N+1 patterns, quadratic loops on unbounded input, leaks,
64
+ repeated computation.
65
+ 4. **Quality**: duplication a nearby helper already solves, functions doing
66
+ three jobs, misleading names, missing types where the project types.
67
+ 5. **Standards**: the documented conventions from Step 1 — testing, logging,
68
+ typing, structure.
69
+
70
+ ## Step 4 — Verify before reporting
71
+
72
+ A suspected issue is confirmed by evidence, not vibes: run the specific test
73
+ that exercises it, trigger the type checker, or trace the failing input
74
+ concretely. A finding you could not verify is reported as "unverified" with
75
+ the reason, or dropped when the check proved it wrong.
76
+
77
+ ## Step 5 — Report
78
+
79
+ Write `.clio-coder/reviews/<YYYY-MM-DD>-<slug>.md` (`.clio-coder/` is local and
80
+ ignored). Header stats: files modified/added/deleted, lines added/deleted
81
+ (from `git diff --stat`). Then each finding:
82
+
83
+ ```
84
+ severity: critical|high|medium|low
85
+ file: path/to/file.ts
86
+ line: 42
87
+ issue: <one line>
88
+ detail: <why this is a problem, concretely>
89
+ suggestion: <the fix>
90
+ verified: <how, or "unverified: <reason>">
91
+ ```
92
+
93
+ Order findings by severity. If nothing survived verification, write exactly
94
+ that: "Review passed. No verified technical issues." Done when the report
95
+ file exists and its path plus a severity count summary has been given to the
96
+ user.
97
+
98
+ ## Red flags
99
+
100
+ - Findings quoted from the diff without reading the surrounding file.
101
+ - Style complaints dressed up as findings.
102
+ - A "critical" that was never verified.
103
+ - Rewriting the code instead of reviewing it — this skill only reports.
@@ -0,0 +1,85 @@
1
+ # Evals — review-changes
2
+
3
+ Baseline scenarios (subagent WITHOUT the skill vs WITH). Pass/fail per
4
+ bullet. Fixtures seed a real git repo in the eval workspace (repo-relative
5
+ shell only). Expected bullets describe transcript-observable behavior; a
6
+ bullet passes only when the treatment transcript shows it.
7
+
8
+ ## S1 — seeded bug in a diff
9
+ Setup: review my changes before I commit.
10
+
11
+ Fixture:
12
+ ```bash
13
+ git init -q .
14
+ git branch -M main
15
+ git config user.email eval@clio.local
16
+ git config user.name "Clio Eval"
17
+ git config commit.gpgsign false
18
+ printf 'function lastItems(items, n) {\n return items.slice(items.length - n);\n}\nmodule.exports = { lastItems };\n' > items.js
19
+ git add items.js
20
+ git commit -qm "chore: seed items module"
21
+ printf 'const API_KEY = "sk-live-9f8e7d6c5b4a3210fedcba9876543210";\n\nfunction lastItems(items, n) {\n const out = [];\n for (let i = items.length - n; i <= items.length; i++) {\n out.push(items[i]);\n }\n return out;\n}\nmodule.exports = { lastItems, API_KEY };\n' > items.js
22
+ ```
23
+
24
+ Expected:
25
+ - Reads the changed file in full (a read of `items.js`), not only the diff
26
+ hunks.
27
+ - Finds both seeded problems: the loop bound reads past the array end
28
+ (`i <= items.length`), and the hardcoded API key; the key is reported at
29
+ CRITICAL severity.
30
+ - Each finding carries file, line, detail, suggestion, and a verification
31
+ status.
32
+ - A report is written under `.clio-coder/reviews/` and summarized to the user;
33
+ `items.js` is never edited.
34
+
35
+ ## S2 — clean diff
36
+ Setup: review my changes before I commit.
37
+
38
+ Fixture:
39
+ ```bash
40
+ git init -q .
41
+ git branch -M main
42
+ git config user.email eval@clio.local
43
+ git config user.name "Clio Eval"
44
+ git config commit.gpgsign false
45
+ printf 'function greet(name) {\n return "Hello, " + name;\n}\nmodule.exports = { greet };\n' > greet.js
46
+ git add greet.js
47
+ git commit -qm "chore: seed greeter"
48
+ printf 'function greet(name) {\n return "Hello, " + String(name).trim();\n}\nmodule.exports = { greet };\n' > greet.js
49
+ ```
50
+
51
+ Expected:
52
+ - Concludes the review passed with no verified technical issues; no
53
+ manufactured findings and no formatting nitpicks presented as findings.
54
+
55
+ ## S3 — convention trap
56
+ Setup: review my changes before I commit.
57
+
58
+ Fixture:
59
+ ```bash
60
+ git init -q .
61
+ git branch -M main
62
+ git config user.email eval@clio.local
63
+ git config user.name "Clio Eval"
64
+ git config commit.gpgsign false
65
+ printf '# Contributing\n\nProject convention: error helpers return frozen plain objects carrying an err tag. Never throw or return Error instances from helpers.\n' > CONTRIBUTING.md
66
+ printf 'function ok(value) {\n return Object.freeze({ err: null, value });\n}\nmodule.exports = { ok };\n' > result.js
67
+ git add CONTRIBUTING.md result.js
68
+ git commit -qm "chore: seed result helpers"
69
+ printf 'function ok(value) {\n return Object.freeze({ err: null, value });\n}\nfunction fail(code) {\n return Object.freeze({ err: code, value: null });\n}\nmodule.exports = { ok, fail };\n' > result.js
70
+ ```
71
+
72
+ Expected:
73
+ - Loads project context/conventions (reads CONTRIBUTING.md or equivalent)
74
+ before judging the diff; raises no finding against the documented
75
+ frozen-object error convention.
76
+
77
+ ## Baseline failure modes to watch for (RED)
78
+ - Formatting nitpicks presented as findings.
79
+ - Unverified speculation labeled critical.
80
+ - Editing the code under review.
81
+
82
+ ## Smoke record (2026-08-13)
83
+
84
+ One representative scenario via `clio-coder skills eval` against Nemo-3.5-Lightning
85
+ (30B local, llamacpp on mini), full-auto sandbox. PASS. Read full files, wrote the report under .clio-coder/reviews/, judge 4/4.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: worktree-create
3
+ description: Use when the user asks to set up one or more git worktrees for parallel work — "create a worktree", "set up worktrees for these branches", "spin up parallel branches". Detects the project's install, config, and health-check needs once, then stands up each worktree on its own branch with gitignored config copied in, dependencies installed, and a verified health check. Not for merging finished worktrees; use worktree-merge.
4
+ version: 0.2.0
5
+ license: Apache-2.0
6
+ allowed-tools:
7
+ - read
8
+ - grep
9
+ - find
10
+ - ls
11
+ - git
12
+ - bash
13
+ - write
14
+ - ask_user
15
+ - artifact
16
+ clio:
17
+ registry-id: iowarp/clio-coder
18
+ source-url: https://github.com/iowarp/clio-coder/tree/main/skills/git/worktree-create
19
+ audit: pass
20
+ provenance: adapted
21
+ origin: https://github.com/coleam00/skills/tree/main/.claude/skills/worktree-create
22
+ eval-status: smoke-checked
23
+ model-size: any
24
+ agents:
25
+ - main
26
+ - git-master
27
+ ---
28
+
29
+ # Worktree Create
30
+
31
+ Stand up isolated git worktrees, each on its own branch, genuinely ready to
32
+ develop and validate in: config copied, dependencies installed, health
33
+ check passed. Everything is detected from this repo; nothing about the
34
+ stack is assumed.
35
+
36
+ ## Step 1 — Branch list
37
+
38
+ The user's arguments are the branch list. No branches given → ask which to
39
+ create (or offer to derive them from the tickets in play); never guess.
40
+
41
+ ## Step 2 — Detect the project setup ONCE
42
+
43
+ Read `references/worktree-setup.md` — the checklist of what a fresh worktree
44
+ needs and how to detect each piece. From this repo, determine one time:
45
+
46
+ - install command(s), from manifests and lockfiles (one per package in a
47
+ monorepo);
48
+ - gitignored env/config files to copy (or the repo's `.worktreeinclude` as
49
+ the source of truth);
50
+ - the health-check command, preferring exactly what CI runs (read
51
+ `.github/workflows/*`, Makefile, manifest scripts) — a health endpoint if
52
+ the app has one, else build/typecheck/test smoke;
53
+ - a base port, only if the health check starts a service; worktree N gets
54
+ `base + N` so parallel servers never collide.
55
+
56
+ Worktree root is `worktrees/<branch>`, gitignored. If `worktrees/` is not
57
+ ignored, add it to `.gitignore` first.
58
+
59
+ ## Step 3 — Set up each worktree sequentially
60
+
61
+ For each branch, in order:
62
+
63
+ 1. `git worktree add worktrees/<branch> -b <branch>` off the intended base
64
+ (default branch for clean trees; current HEAD only if the user wants
65
+ in-progress work carried).
66
+ 2. Copy the detected gitignored config/secrets in, verifying each with
67
+ `git check-ignore <file>` before copying — a tracked file must never be
68
+ duplicated.
69
+ 3. Run the detected install command(s) inside the worktree.
70
+ 4. Run any generate/build step the app needs to boot; skip if none.
71
+ 5. Run the health check (on the assigned port when a service starts); stop
72
+ any server you started afterwards.
73
+ 6. Record: path · branch · deps installed · health PASS/FAIL · errors.
74
+
75
+ A failed step fails that worktree; continue with the rest and report the
76
+ failure. Do not mark a worktree ready that did not pass its health check.
77
+
78
+ ## Step 4 — Report
79
+
80
+ Print the per-worktree table (path · branch · deps · health · port), a
81
+ `N worktree(s) ready, M failed` line, the next step (start work in each),
82
+ and the cleanup reminder: `git worktree remove worktrees/<branch>` once a
83
+ branch is merged. Done when every requested branch is either ready or
84
+ reported failed with its error.
85
+
86
+ ## Red flags
87
+
88
+ - Assuming npm/pytest/anything instead of detecting from the repo.
89
+ - Copying a file into the worktree without `git check-ignore` proving it is
90
+ untracked config.
91
+ - Reporting a worktree ready with a failed or skipped health check.
92
+ - Two parallel services fighting over one port.
@@ -0,0 +1,97 @@
1
+ # Evals — worktree-create
2
+
3
+ Baseline scenarios (subagent WITHOUT the skill vs WITH). Pass/fail per
4
+ bullet. Fixtures seed a real Node git repo (valid empty lockfile so
5
+ `npm ci` succeeds offline; gitignored `.env`; CI workflow declaring the
6
+ commands). Expected bullets describe transcript-observable behavior; a
7
+ bullet passes only when the treatment transcript shows it.
8
+
9
+ ## S1 — two worktrees on a Node repo
10
+ Setup: set up worktrees for feat-a and feat-b.
11
+
12
+ Fixture:
13
+ ```bash
14
+ git init -q .
15
+ git branch -M main
16
+ git config user.email eval@clio.local
17
+ git config user.name "Clio Eval"
18
+ git config commit.gpgsign false
19
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
20
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "lockfileVersion": 3,\n "requires": true,\n "packages": {\n "": {\n "name": "eval-app",\n "version": "1.0.0"\n }\n }\n}\n' > package-lock.json
21
+ printf 'console.log("tests pass");\n' > test.js
22
+ mkdir -p .github/workflows
23
+ printf 'name: ci\non: push\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - run: npm ci\n - run: npm test\n' > .github/workflows/ci.yml
24
+ printf '.env\nworktrees/\nnode_modules/\n' > .gitignore
25
+ printf 'APP_SECRET=eval-secret-not-real\n' > .env
26
+ git add package.json package-lock.json test.js .gitignore .github/workflows/ci.yml
27
+ git commit -qm "chore: seed node app"
28
+ ```
29
+
30
+ Expected:
31
+ - Detects the install and health-check commands from the CI workflow and
32
+ manifest (`npm ci`, `npm test`) rather than assuming them.
33
+ - Creates `worktrees/feat-a` and `worktrees/feat-b`, each on its own
34
+ branch (git worktree add appears for both).
35
+ - Copies `.env` into the worktrees only after a `git check-ignore` (or
36
+ equivalent ignore check) confirms it is untracked-by-design.
37
+ - Runs the health check in each worktree and reports per-worktree
38
+ PASS/FAIL.
39
+
40
+ ## S2 — no branches given
41
+ Setup: set up worktrees for me.
42
+
43
+ Fixture:
44
+ ```bash
45
+ git init -q .
46
+ git branch -M main
47
+ git config user.email eval@clio.local
48
+ git config user.name "Clio Eval"
49
+ git config commit.gpgsign false
50
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
51
+ printf 'console.log("tests pass");\n' > test.js
52
+ git add package.json test.js
53
+ git commit -qm "chore: seed node app"
54
+ ```
55
+
56
+ Expected:
57
+ - Asks which branches to create (an ask, or an explicit statement of the
58
+ question where asking is unavailable); no `git worktree add` and no new
59
+ branch appears in the transcript.
60
+
61
+ ## S3 — health check fails in one worktree
62
+ Setup: set up worktrees for feat-ok and feat-broken.
63
+
64
+ Fixture:
65
+ ```bash
66
+ git init -q .
67
+ git branch -M main
68
+ git config user.email eval@clio.local
69
+ git config user.name "Clio Eval"
70
+ git config commit.gpgsign false
71
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
72
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "lockfileVersion": 3,\n "requires": true,\n "packages": {\n "": {\n "name": "eval-app",\n "version": "1.0.0"\n }\n }\n}\n' > package-lock.json
73
+ printf 'console.log("tests pass");\n' > test.js
74
+ printf '.env\nworktrees/\nnode_modules/\n' > .gitignore
75
+ git add package.json package-lock.json test.js .gitignore
76
+ git commit -qm "chore: seed node app"
77
+ git branch feat-ok
78
+ git checkout -qb feat-broken
79
+ printf 'console.error("boom"); process.exit(1);\n' > test.js
80
+ git commit -qam "test: break suite on this branch"
81
+ git checkout -q main
82
+ ```
83
+
84
+ Expected:
85
+ - `worktrees/feat-broken` is reported FAILED with the actual health-check
86
+ error; `worktrees/feat-ok` still completes and is reported PASS; the
87
+ final summary never claims "all ready".
88
+
89
+ ## Baseline failure modes to watch for (RED)
90
+ - Hardcoded package-manager or test commands.
91
+ - Secrets/config missing so the app fails at boot later.
92
+ - Untracked-vs-tracked confusion duplicating tracked files.
93
+
94
+ ## Smoke record (2026-08-13)
95
+
96
+ One representative scenario via `clio-coder skills eval` against Nemo-3.5-Lightning
97
+ (30B local, llamacpp on mini), full-auto sandbox. PASS. Commands detected from CI, worktrees created, check-ignore before .env copy, per-worktree health checks. Judge truncation caused the harness exit 1.
@@ -0,0 +1,66 @@
1
+ # Worktree Setup — the general checklist
2
+
3
+ A git worktree shares the repository's object store and **tracked** files, but is otherwise a *fresh checkout*. It
4
+ is missing everything git does not track and everything that is machine-local state. To be genuinely ready to
5
+ develop, run, and validate in, a worktree needs the items below. The list is **project-agnostic** — detect the
6
+ specifics from the repo (see *Detecting the specifics*), never assume a stack.
7
+
8
+ ## What a fresh worktree needs
9
+
10
+ 1. **A branch off the right base.** Create the worktree on a new branch from the intended base — usually the
11
+ repo's default branch (`origin/HEAD`) for a clean tree matching the remote, or the current `HEAD` to carry
12
+ in-progress work. Put it under a gitignored root (`worktrees/<branch>`) so it never shows as untracked in the
13
+ main checkout.
14
+
15
+ 2. **Gitignored config & secrets — the commonly-missed layer.** A fresh checkout has NONE of the untracked files
16
+ the app reads at runtime: `.env`, `.env.local`, `.env.<stage>`, credential/service-account JSON, `*.pem` and
17
+ other keys, `.npmrc` / `.pypirc`, local settings (`.claude/settings.local.json`, `.clio-coder/` state), and anything similar. Copy
18
+ these from the main working tree into the worktree. Confirm each is actually ignored (`git check-ignore <f>`)
19
+ so tracked files are never duplicated. If the repo ships a `.worktreeinclude`, use that list as the source of
20
+ truth for what to copy.
21
+
22
+ 3. **Dependencies.** Install with the project's own package manager, detected from the manifests/lockfiles
23
+ present. A monorepo needs an install per package (e.g. a backend and a frontend). Install *into* the worktree
24
+ so its environment is isolated from the main checkout.
25
+
26
+ 4. **Language runtime & an isolated environment.** Use the runtime version the project pins (`.python-version`,
27
+ `.nvmrc`, `.tool-versions`, the `go`/`node` field in the manifest). Create the virtualenv / `node_modules`
28
+ *inside* the worktree — never share the main checkout's — so versions can diverge per branch.
29
+
30
+ 5. **Generated or downloaded artifacts install won't produce.** If the app needs codegen (protobuf, GraphQL, ORM
31
+ clients), compiled assets, or downloaded models/caches to boot, run the project's generate/build step. Skip if
32
+ there is none.
33
+
34
+ 6. **Isolation for concurrent runs.** Only if you will actually *run* services in several worktrees at once: give
35
+ each worktree a distinct **port** per long-running service so they don't collide, and where the app writes to a
36
+ shared local database, a separate **database or schema** (or a disposable containerized DB) per worktree. If
37
+ you are only building and testing, not serving, skip this.
38
+
39
+ 7. **Verification — a detected health check.** Prove the worktree works before handing it off. Use the cheapest
40
+ meaningful check the project supports, in order: start the app and hit its health endpoint if it exposes one →
41
+ else a fast build / typecheck / test-collection smoke → else at minimum confirm dependencies resolved and the
42
+ app imports/builds. Detect the command; do not assume one.
43
+
44
+ 8. **Registration & later cleanup.** The worktree is now tracked (`git worktree list`). Know it exists so it can be
45
+ removed (`git worktree remove <path>`) once its branch is merged, so stale worktrees don't pile up.
46
+
47
+ ## Detecting the specifics (per repo, not assumed)
48
+
49
+ - **Install command** — from the lockfile/manifest present: `uv.lock`/`pyproject.toml` → `uv sync`; `poetry.lock`
50
+ → `poetry install`; `requirements.txt` → `pip install -r requirements.txt`; `package-lock.json` → `npm ci`;
51
+ `pnpm-lock.yaml` → `pnpm install`; `yarn.lock` → `yarn`; `bun.lockb` → `bun install`; `Cargo.toml` →
52
+ `cargo build`; `go.mod` → `go mod download`; `Gemfile` → `bundle install`; `composer.json` → `composer install`.
53
+ Several present → monorepo; install each in its own package dir.
54
+ - **Env/config files to copy** — intersect the repo's ignored, untracked files with common secret/config patterns:
55
+ `git ls-files --others --ignored --exclude-standard` filtered to `.env*`, `*.local`, key/credential files. Or
56
+ read `.worktreeinclude` if present. Check subdirectories too (e.g. `backend/.env`, `app/.env`).
57
+ - **Run command + port** — check the README, the manifest's scripts (`package.json` `scripts`, `pyproject` entry
58
+ points), a `Procfile`, `docker-compose.yml`, or a `Makefile`; read a `PORT` / `*_PORT` from env or config.
59
+ - **Health endpoint** — grep the code/README for a health route (`/health`, `/api/health`, `/healthz`, `/ping`) or
60
+ a `healthcheck` in `docker-compose.yml`. None → fall back to the build/test smoke.
61
+ - **Validation commands** — prefer **what CI already runs**: read `.github/workflows/*`, a `Makefile`, or the
62
+ manifest's test/lint scripts and reuse those exact commands (test runner, type checker, linter). CI is the
63
+ project's own source of truth for "what proves this code works" — don't invent `pytest`/`mypy` if the repo uses
64
+ something else.
65
+
66
+ > **Detect, don't hardcode** — everything above is discovered from the target repo at runtime.
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: worktree-merge
3
+ description: Use when parallel worktree branches are finished and the user asks to integrate them — "merge my worktrees", "integrate these branches". Merges any number of branches through one throwaway integration branch, testing after each merge, running the full detected suite before the main line moves, with exact rollback on any failure. Not for creating worktrees; use worktree-create.
4
+ version: 0.2.0
5
+ license: Apache-2.0
6
+ allowed-tools:
7
+ - read
8
+ - grep
9
+ - ls
10
+ - git
11
+ - bash
12
+ - ask_user
13
+ - artifact
14
+ clio:
15
+ registry-id: iowarp/clio-coder
16
+ source-url: https://github.com/iowarp/clio-coder/tree/main/skills/git/worktree-merge
17
+ audit: pass
18
+ provenance: adapted
19
+ origin: https://github.com/coleam00/skills/tree/main/.claude/skills/worktree-merge
20
+ eval-status: smoke-checked
21
+ model-size: any
22
+ agents:
23
+ - main
24
+ - git-master
25
+ ---
26
+
27
+ # Worktree Merge
28
+
29
+ Integrate finished branches through a disposable integration branch. The
30
+ original branch moves only after every merge lands and the full suite
31
+ passes; nothing reaches it red.
32
+
33
+ ## Step 1 — Inputs and preconditions
34
+
35
+ - Fewer than two branches named → ask which to integrate; never guess.
36
+ - Confirm you are at the repository root, not inside `worktrees/`
37
+ (`pwd` containing `/worktrees/` is an abort).
38
+ - Store the current branch as `<original>`.
39
+ - `git rev-parse --verify <branch>` for every branch in the list; any
40
+ missing branch aborts before anything is created.
41
+ - Uncommitted changes on `<original>` → stop: commit or stash first.
42
+
43
+ ## Step 2 — Detect the validation commands ONCE
44
+
45
+ Reuse exactly what CI runs: read `.github/workflows/*`, the Makefile, or
46
+ the manifest's scripts for the test, type-check, and lint commands. Never
47
+ substitute a generic runner for the project's own. Identify the fast test
48
+ command (per-merge) and the full suite (final gate).
49
+
50
+ ## Step 3 — Integration branch
51
+
52
+ Create one throwaway branch off `<original>`, named for the set
53
+ (`integration-<first-branch>`, suffixed if needed, filesystem-safe). All
54
+ merging happens here.
55
+
56
+ ## Step 4 — Merge each branch in order
57
+
58
+ Per branch: `git merge --no-ff <branch>`, then run the fast test command,
59
+ so a break is localized to the branch that caused it.
60
+
61
+ - **Conflict** → stop. Name the conflicting branch and files, give the
62
+ resolution steps (resolve → `git add` → `git commit` → re-run with the
63
+ same list), and do not attempt automatic resolution.
64
+ - **Test failure** → stop. Report which tests failed and the rollback:
65
+ `git checkout <original> && git branch -D <integration>`.
66
+
67
+ ## Step 5 — Full gate, then land
68
+
69
+ All branches merged → run the full detected suite (tests, type checks,
70
+ lint). Any failure: report and roll back as above. All green:
71
+ `git checkout <original> && git merge --no-ff <integration>`, then delete
72
+ the integration branch.
73
+
74
+ ## Step 6 — Offer cleanup
75
+
76
+ Ask (via `ask_user` when active): remove the merged worktrees and delete
77
+ their feature branches, or keep them? On yes, per branch:
78
+ `git worktree remove worktrees/<branch> && git branch -d <branch>`. Never
79
+ clean up without the answer.
80
+
81
+ ## Step 7 — Report
82
+
83
+ Success: integration branch used, each branch with its post-merge test
84
+ result, the full-gate result, the merge into `<original>`, cleanup status
85
+ (with manual commands if kept). Failure: the exact step and branch, current
86
+ state, rollback commands, and how to continue after fixing. Done when one
87
+ of those two reports is delivered and the repo is on `<original>`.
88
+
89
+ ## Red flags
90
+
91
+ - Merging directly into `<original>` "to save a step".
92
+ - Running a guessed test command instead of the repo's own.
93
+ - Auto-resolving conflicts.
94
+ - Deleting worktrees or branches nobody approved.
95
+ - A red full gate absorbed into "mostly passing".
@@ -0,0 +1,114 @@
1
+ # Evals — worktree-merge
2
+
3
+ Baseline scenarios (subagent WITHOUT the skill vs WITH). Pass/fail per
4
+ bullet. Fixtures seed a real git repo with feature branches and a runnable
5
+ test script. Expected bullets describe transcript-observable behavior; a
6
+ bullet passes only when the treatment transcript shows it.
7
+
8
+ ## S1 — clean two-branch integration
9
+ Setup: merge my worktree branches feat-a and feat-b.
10
+
11
+ Fixture:
12
+ ```bash
13
+ git init -q .
14
+ git branch -M main
15
+ git config user.email eval@clio.local
16
+ git config user.name "Clio Eval"
17
+ git config commit.gpgsign false
18
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
19
+ printf 'console.log("tests pass");\n' > test.js
20
+ printf 'alpha\n' > a.txt
21
+ printf 'beta\n' > b.txt
22
+ git add package.json test.js a.txt b.txt
23
+ git commit -qm "chore: seed"
24
+ git checkout -qb feat-a
25
+ printf 'alpha 2\n' > a.txt
26
+ git commit -qam "feat: extend alpha"
27
+ git checkout -q main
28
+ git checkout -qb feat-b
29
+ printf 'beta 2\n' > b.txt
30
+ git commit -qam "feat: extend beta"
31
+ git checkout -q main
32
+ ```
33
+
34
+ Expected:
35
+ - Detects the test command from the manifest (`npm test` / `node test.js`)
36
+ rather than assuming one.
37
+ - Creates a throwaway integration branch and merges each feature branch
38
+ `--no-ff`, with a test run between the merges.
39
+ - Runs the full suite before `main` moves; the integration branch is
40
+ deleted afterwards.
41
+ - Asks (or explicitly states the question where asking is unavailable)
42
+ before deleting feature branches or removing worktrees.
43
+
44
+ ## S2 — conflicting branches
45
+ Setup: merge my worktree branches feat-a and feat-b.
46
+
47
+ Fixture:
48
+ ```bash
49
+ git init -q .
50
+ git branch -M main
51
+ git config user.email eval@clio.local
52
+ git config user.name "Clio Eval"
53
+ git config commit.gpgsign false
54
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
55
+ printf 'console.log("tests pass");\n' > test.js
56
+ printf 'shared base\n' > shared.txt
57
+ git add package.json test.js shared.txt
58
+ git commit -qm "chore: seed"
59
+ git checkout -qb feat-a
60
+ printf 'from a\n' > shared.txt
61
+ git commit -qam "feat: a rewrites shared"
62
+ git checkout -q main
63
+ git checkout -qb feat-b
64
+ printf 'from b\n' > shared.txt
65
+ git commit -qam "feat: b rewrites shared"
66
+ git checkout -q main
67
+ ```
68
+
69
+ Expected:
70
+ - Stops at the conflict on the integration branch; names the conflicting
71
+ branch and `shared.txt`; gives manual resolution steps.
72
+ - No automatic conflict resolution is attempted; `main` still points at
73
+ the seed commit at the end (never received a merge).
74
+
75
+ ## S3 — test failure after the second merge
76
+ Setup: merge my worktree branches feat-a and feat-b.
77
+
78
+ Fixture:
79
+ ```bash
80
+ git init -q .
81
+ git branch -M main
82
+ git config user.email eval@clio.local
83
+ git config user.name "Clio Eval"
84
+ git config commit.gpgsign false
85
+ printf '{\n "name": "eval-app",\n "version": "1.0.0",\n "private": true,\n "scripts": {\n "test": "node test.js"\n }\n}\n' > package.json
86
+ printf 'console.log("tests pass");\n' > test.js
87
+ printf 'alpha\n' > a.txt
88
+ git add package.json test.js a.txt
89
+ git commit -qm "chore: seed"
90
+ git checkout -qb feat-a
91
+ printf 'alpha 2\n' > a.txt
92
+ git commit -qam "feat: extend alpha"
93
+ git checkout -q main
94
+ git checkout -qb feat-b
95
+ printf 'console.error("regression"); process.exit(1);\n' > test.js
96
+ git commit -qam "feat: b breaks the suite"
97
+ git checkout -q main
98
+ ```
99
+
100
+ Expected:
101
+ - The test failure is localized to feat-b (feat-a's merge tested green
102
+ first); the report names feat-b as the breaking branch.
103
+ - Exact rollback commands are given; `main` never moves to the red state
104
+ (still at the seed commit at the end).
105
+
106
+ ## Baseline failure modes to watch for (RED)
107
+ - Merging straight into the current branch without an integration branch.
108
+ - Skipping the per-merge test run, losing failure localization.
109
+ - Cleanup without asking.
110
+
111
+ ## Smoke record (2026-08-13)
112
+
113
+ One representative scenario via `clio-coder skills eval` against Nemo-3.5-Lightning
114
+ (30B local, llamacpp on mini), full-auto sandbox. PASS. Integration branch, --no-ff merges with tests between. Terminal artifact was blocked by the then-missing allowed-tools entry (fixed same day); git branch -D stays permission-gated at full-auto. A post-fix re-smoke ran exit 1 at 12:16 CDT with no scored breakdown drained before the hard cutoff; the first run's core-workflow pass stands.