@uzysjung/agent-harness 26.83.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 (212) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +279 -0
  3. package/README.md +306 -0
  4. package/dist/chunk-SDVAM5JZ.js +775 -0
  5. package/dist/chunk-SDVAM5JZ.js.map +1 -0
  6. package/dist/index.js +5412 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/trust-tier-drift.js +67 -0
  9. package/dist/trust-tier-drift.js.map +1 -0
  10. package/package.json +53 -0
  11. package/scripts/prune-ecc.sh +310 -0
  12. package/templates/CLAUDE.md +86 -0
  13. package/templates/agents/build-error-resolver.md +114 -0
  14. package/templates/agents/code-reviewer.md +237 -0
  15. package/templates/agents/data-analyst.md +69 -0
  16. package/templates/agents/plan-checker.md +118 -0
  17. package/templates/agents/reviewer.md +128 -0
  18. package/templates/agents/security-reviewer.md +108 -0
  19. package/templates/agents/silent-failure-hunter.md +50 -0
  20. package/templates/agents/strategist.md +86 -0
  21. package/templates/antigravity/AGENTS.md.template +58 -0
  22. package/templates/codex/AGENTS.md.template +94 -0
  23. package/templates/codex/README.md +69 -0
  24. package/templates/codex/config.toml.template +108 -0
  25. package/templates/codex/hooks/README.md +40 -0
  26. package/templates/codex/hooks/gate-check.sh +7 -0
  27. package/templates/codex/hooks/hito-counter.sh +7 -0
  28. package/templates/codex/hooks/session-start.sh +7 -0
  29. package/templates/codex/hooks/uncommitted-check.sh +7 -0
  30. package/templates/codex/skills/uzys-build/SKILL.md +24 -0
  31. package/templates/codex/skills/uzys-plan/SKILL.md +24 -0
  32. package/templates/codex/skills/uzys-review/SKILL.md +24 -0
  33. package/templates/codex/skills/uzys-ship/SKILL.md +24 -0
  34. package/templates/codex/skills/uzys-spec/SKILL.md +28 -0
  35. package/templates/codex/skills/uzys-test/SKILL.md +24 -0
  36. package/templates/commands/ecc/checkpoint.md +32 -0
  37. package/templates/commands/ecc/e2e.md +105 -0
  38. package/templates/commands/ecc/eval.md +88 -0
  39. package/templates/commands/ecc/evolve.md +7 -0
  40. package/templates/commands/ecc/harness-audit.md +73 -0
  41. package/templates/commands/ecc/instinct-status.md +8 -0
  42. package/templates/commands/ecc/promote.md +10 -0
  43. package/templates/commands/ecc/security-scan.md +10 -0
  44. package/templates/commands/uzys/auto.md +190 -0
  45. package/templates/commands/uzys/build.md +42 -0
  46. package/templates/commands/uzys/plan.md +55 -0
  47. package/templates/commands/uzys/review.md +44 -0
  48. package/templates/commands/uzys/ship.md +49 -0
  49. package/templates/commands/uzys/spec.md +93 -0
  50. package/templates/commands/uzys/test.md +58 -0
  51. package/templates/docs/PLAN.template.md +102 -0
  52. package/templates/hooks/agentshield-gate.sh +101 -0
  53. package/templates/hooks/checkpoint-snapshot.sh +115 -0
  54. package/templates/hooks/gate-check.sh +138 -0
  55. package/templates/hooks/hito-counter.sh +26 -0
  56. package/templates/hooks/karpathy-gate.sh +59 -0
  57. package/templates/hooks/mcp-pre-exec.sh +104 -0
  58. package/templates/hooks/protect-files.sh +41 -0
  59. package/templates/hooks/session-start.sh +40 -0
  60. package/templates/hooks/spec-drift-check.sh +86 -0
  61. package/templates/mcp-allowlist.example +24 -0
  62. package/templates/mcp.json +20 -0
  63. package/templates/opencode/.opencode/commands/uzys-build.md +22 -0
  64. package/templates/opencode/.opencode/commands/uzys-plan.md +22 -0
  65. package/templates/opencode/.opencode/commands/uzys-review.md +22 -0
  66. package/templates/opencode/.opencode/commands/uzys-ship.md +22 -0
  67. package/templates/opencode/.opencode/commands/uzys-spec.md +28 -0
  68. package/templates/opencode/.opencode/commands/uzys-test.md +22 -0
  69. package/templates/opencode/.opencode/plugins/uzys-harness.ts +146 -0
  70. package/templates/opencode/AGENTS.md.template +98 -0
  71. package/templates/opencode/README.md +34 -0
  72. package/templates/opencode/opencode.json.template +42 -0
  73. package/templates/project-claude/_base.md +23 -0
  74. package/templates/project-claude/fragments/csr-fastapi/active-rules.md +13 -0
  75. package/templates/project-claude/fragments/csr-fastapi/agents.md +5 -0
  76. package/templates/project-claude/fragments/csr-fastapi/boundaries.md +18 -0
  77. package/templates/project-claude/fragments/csr-fastapi/commands.md +6 -0
  78. package/templates/project-claude/fragments/csr-fastapi/plugins.md +2 -0
  79. package/templates/project-claude/fragments/csr-fastapi/skills.md +5 -0
  80. package/templates/project-claude/fragments/csr-fastapi/stack.md +6 -0
  81. package/templates/project-claude/fragments/csr-fastapi/tagline.md +1 -0
  82. package/templates/project-claude/fragments/csr-fastapi/workflow.md +8 -0
  83. package/templates/project-claude/fragments/csr-fastify/active-rules.md +13 -0
  84. package/templates/project-claude/fragments/csr-fastify/agents.md +5 -0
  85. package/templates/project-claude/fragments/csr-fastify/boundaries.md +18 -0
  86. package/templates/project-claude/fragments/csr-fastify/commands.md +6 -0
  87. package/templates/project-claude/fragments/csr-fastify/plugins.md +2 -0
  88. package/templates/project-claude/fragments/csr-fastify/skills.md +5 -0
  89. package/templates/project-claude/fragments/csr-fastify/stack.md +6 -0
  90. package/templates/project-claude/fragments/csr-fastify/tagline.md +1 -0
  91. package/templates/project-claude/fragments/csr-fastify/workflow.md +8 -0
  92. package/templates/project-claude/fragments/csr-supabase/active-rules.md +12 -0
  93. package/templates/project-claude/fragments/csr-supabase/agents.md +5 -0
  94. package/templates/project-claude/fragments/csr-supabase/boundaries.md +19 -0
  95. package/templates/project-claude/fragments/csr-supabase/commands.md +6 -0
  96. package/templates/project-claude/fragments/csr-supabase/plugins.md +4 -0
  97. package/templates/project-claude/fragments/csr-supabase/skills.md +7 -0
  98. package/templates/project-claude/fragments/csr-supabase/stack.md +6 -0
  99. package/templates/project-claude/fragments/csr-supabase/supabase-auth.md +21 -0
  100. package/templates/project-claude/fragments/csr-supabase/tagline.md +1 -0
  101. package/templates/project-claude/fragments/csr-supabase/workflow.md +8 -0
  102. package/templates/project-claude/fragments/data/active-rules.md +10 -0
  103. package/templates/project-claude/fragments/data/agents.md +6 -0
  104. package/templates/project-claude/fragments/data/boundaries.md +20 -0
  105. package/templates/project-claude/fragments/data/commands.md +6 -0
  106. package/templates/project-claude/fragments/data/plugins.md +2 -0
  107. package/templates/project-claude/fragments/data/skills.md +3 -0
  108. package/templates/project-claude/fragments/data/stack.md +7 -0
  109. package/templates/project-claude/fragments/data/tagline.md +1 -0
  110. package/templates/project-claude/fragments/data/workflow.md +9 -0
  111. package/templates/project-claude/fragments/executive/active-rules.md +6 -0
  112. package/templates/project-claude/fragments/executive/agents.md +6 -0
  113. package/templates/project-claude/fragments/executive/boundaries.md +17 -0
  114. package/templates/project-claude/fragments/executive/commands.md +11 -0
  115. package/templates/project-claude/fragments/executive/plugins.md +1 -0
  116. package/templates/project-claude/fragments/executive/skills.md +7 -0
  117. package/templates/project-claude/fragments/executive/stack.md +4 -0
  118. package/templates/project-claude/fragments/executive/tagline.md +1 -0
  119. package/templates/project-claude/fragments/executive/workflow.md +10 -0
  120. package/templates/project-claude/fragments/growth-marketing/active-rules.md +7 -0
  121. package/templates/project-claude/fragments/growth-marketing/agents.md +6 -0
  122. package/templates/project-claude/fragments/growth-marketing/boundaries.md +17 -0
  123. package/templates/project-claude/fragments/growth-marketing/commands.md +11 -0
  124. package/templates/project-claude/fragments/growth-marketing/plugins.md +9 -0
  125. package/templates/project-claude/fragments/growth-marketing/skills.md +8 -0
  126. package/templates/project-claude/fragments/growth-marketing/stack.md +7 -0
  127. package/templates/project-claude/fragments/growth-marketing/tagline.md +1 -0
  128. package/templates/project-claude/fragments/growth-marketing/workflow.md +11 -0
  129. package/templates/project-claude/fragments/project-management/active-rules.md +7 -0
  130. package/templates/project-claude/fragments/project-management/agents.md +6 -0
  131. package/templates/project-claude/fragments/project-management/boundaries.md +16 -0
  132. package/templates/project-claude/fragments/project-management/commands.md +10 -0
  133. package/templates/project-claude/fragments/project-management/plugins.md +6 -0
  134. package/templates/project-claude/fragments/project-management/skills.md +5 -0
  135. package/templates/project-claude/fragments/project-management/stack.md +4 -0
  136. package/templates/project-claude/fragments/project-management/tagline.md +1 -0
  137. package/templates/project-claude/fragments/project-management/workflow.md +12 -0
  138. package/templates/project-claude/fragments/ssr-htmx/active-rules.md +11 -0
  139. package/templates/project-claude/fragments/ssr-htmx/agents.md +5 -0
  140. package/templates/project-claude/fragments/ssr-htmx/boundaries.md +20 -0
  141. package/templates/project-claude/fragments/ssr-htmx/commands.md +6 -0
  142. package/templates/project-claude/fragments/ssr-htmx/plugins.md +2 -0
  143. package/templates/project-claude/fragments/ssr-htmx/skills.md +3 -0
  144. package/templates/project-claude/fragments/ssr-htmx/stack.md +6 -0
  145. package/templates/project-claude/fragments/ssr-htmx/tagline.md +1 -0
  146. package/templates/project-claude/fragments/ssr-htmx/workflow.md +8 -0
  147. package/templates/project-claude/fragments/ssr-nextjs/active-rules.md +12 -0
  148. package/templates/project-claude/fragments/ssr-nextjs/agents.md +5 -0
  149. package/templates/project-claude/fragments/ssr-nextjs/boundaries.md +20 -0
  150. package/templates/project-claude/fragments/ssr-nextjs/commands.md +6 -0
  151. package/templates/project-claude/fragments/ssr-nextjs/plugins.md +2 -0
  152. package/templates/project-claude/fragments/ssr-nextjs/skills.md +5 -0
  153. package/templates/project-claude/fragments/ssr-nextjs/stack.md +5 -0
  154. package/templates/project-claude/fragments/ssr-nextjs/tagline.md +1 -0
  155. package/templates/project-claude/fragments/ssr-nextjs/workflow.md +8 -0
  156. package/templates/project-claude/fragments/tooling/active-rules.md +11 -0
  157. package/templates/project-claude/fragments/tooling/agents.md +5 -0
  158. package/templates/project-claude/fragments/tooling/boundaries.md +17 -0
  159. package/templates/project-claude/fragments/tooling/commands.md +4 -0
  160. package/templates/project-claude/fragments/tooling/skills.md +4 -0
  161. package/templates/project-claude/fragments/tooling/stack.md +5 -0
  162. package/templates/project-claude/fragments/tooling/tagline.md +1 -0
  163. package/templates/project-claude/fragments/tooling/workflow.md +5 -0
  164. package/templates/rules/api-contract.md +33 -0
  165. package/templates/rules/change-management.md +80 -0
  166. package/templates/rules/cli-development.md +39 -0
  167. package/templates/rules/code-style.md +23 -0
  168. package/templates/rules/data-analysis.md +61 -0
  169. package/templates/rules/database.md +29 -0
  170. package/templates/rules/design-workflow.md +17 -0
  171. package/templates/rules/error-handling.md +23 -0
  172. package/templates/rules/gates-taxonomy.md +21 -0
  173. package/templates/rules/git-policy.md +102 -0
  174. package/templates/rules/htmx.md +42 -0
  175. package/templates/rules/nextjs.md +35 -0
  176. package/templates/rules/playwright-launch.md +66 -0
  177. package/templates/rules/pyside6.md +59 -0
  178. package/templates/rules/shadcn.md +33 -0
  179. package/templates/rules/ship-checklist.md +24 -0
  180. package/templates/rules/tauri.md +40 -0
  181. package/templates/rules/test-policy.md +62 -0
  182. package/templates/settings.json +71 -0
  183. package/templates/skills/agent-introspection-debugging/SKILL.md +153 -0
  184. package/templates/skills/continuous-learning-v2/SKILL.md +365 -0
  185. package/templates/skills/continuous-learning-v2/config.json +8 -0
  186. package/templates/skills/continuous-learning-v2/hooks/observe.sh +428 -0
  187. package/templates/skills/continuous-learning-v2/scripts/detect-project.sh +228 -0
  188. package/templates/skills/continuous-learning-v2/scripts/instinct-cli.py +1426 -0
  189. package/templates/skills/deep-research/SKILL.md +155 -0
  190. package/templates/skills/deep-research/agents/openai.yaml +7 -0
  191. package/templates/skills/e2e-testing/SKILL.md +326 -0
  192. package/templates/skills/e2e-testing/agents/openai.yaml +7 -0
  193. package/templates/skills/eval-harness/SKILL.md +279 -0
  194. package/templates/skills/eval-harness/agents/openai.yaml +7 -0
  195. package/templates/skills/gh-issue-workflow/ISSUE.template.md +58 -0
  196. package/templates/skills/gh-issue-workflow/SKILL.md +184 -0
  197. package/templates/skills/investor-materials/SKILL.md +96 -0
  198. package/templates/skills/investor-outreach/SKILL.md +91 -0
  199. package/templates/skills/market-research/SKILL.md +75 -0
  200. package/templates/skills/market-research/agents/openai.yaml +7 -0
  201. package/templates/skills/nextjs-turbopack/SKILL.md +44 -0
  202. package/templates/skills/north-star/NORTH_STAR.template.md +114 -0
  203. package/templates/skills/north-star/SKILL.md +103 -0
  204. package/templates/skills/python-patterns/SKILL.md +750 -0
  205. package/templates/skills/python-testing/SKILL.md +816 -0
  206. package/templates/skills/spec-scaling/SKILL.md +89 -0
  207. package/templates/skills/strategic-compact/SKILL.md +131 -0
  208. package/templates/skills/strategic-compact/suggest-compact.sh +54 -0
  209. package/templates/skills/ui-visual-review/SKILL.md +154 -0
  210. package/templates/skills/verification-loop/SKILL.md +126 -0
  211. package/templates/skills/verification-loop/agents/openai.yaml +7 -0
  212. package/templates/track-mcp-map.tsv +15 -0
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ CATEGORIES,
4
+ EXTERNAL_ASSETS,
5
+ TRUST_TIER,
6
+ init_esm_shims
7
+ } from "./chunk-SDVAM5JZ.js";
8
+
9
+ // src/trust-tier-drift.ts
10
+ init_esm_shims();
11
+ var STAR_THRESHOLD = 1e3;
12
+ var REPO_OVERRIDE = {
13
+ "vercel-cli": "vercel/vercel",
14
+ // npm
15
+ "netlify-cli": "netlify/cli",
16
+ // npm
17
+ "supabase-cli": "supabase/cli",
18
+ // npm
19
+ "agent-browser": "vercel-labs/agent-browser",
20
+ // npm
21
+ "gsd-orchestrator": "gsd-build/get-shit-done",
22
+ // npx-run
23
+ openspec: "Fission-AI/OpenSpec",
24
+ // npm (v26.75.0)
25
+ "bmad-method": "bmad-code-org/BMAD-METHOD"
26
+ // npx-run (v26.75.0)
27
+ };
28
+ function normalizeRepo(source) {
29
+ const stripped = source.replace(/^https?:\/\/github\.com\//i, "");
30
+ const m = stripped.match(/^([^/\s]+\/[^/\s]+)/);
31
+ return m?.[1] ?? null;
32
+ }
33
+ function repoForAsset(asset) {
34
+ const override = REPO_OVERRIDE[asset.id];
35
+ if (override) return override;
36
+ const m = asset.method;
37
+ if (m.kind === "skill") return normalizeRepo(m.source);
38
+ if (m.kind === "plugin") return normalizeRepo(m.marketplace);
39
+ return null;
40
+ }
41
+ function driftTargets(assets = EXTERNAL_ASSETS) {
42
+ const out = [];
43
+ for (const a of assets) {
44
+ const tier = TRUST_TIER[a.id];
45
+ if (tier !== "vetted" && tier !== "experimental") continue;
46
+ const repo = repoForAsset(a);
47
+ if (!repo) continue;
48
+ out.push({ id: a.id, tier, repo });
49
+ }
50
+ return out;
51
+ }
52
+ function classifyDrift(tier, stars) {
53
+ if (tier === "vetted" && stars < STAR_THRESHOLD) return "demote";
54
+ if (tier === "experimental" && stars >= STAR_THRESHOLD) return "promote";
55
+ return "ok";
56
+ }
57
+ export {
58
+ CATEGORIES,
59
+ EXTERNAL_ASSETS,
60
+ STAR_THRESHOLD,
61
+ TRUST_TIER,
62
+ classifyDrift,
63
+ driftTargets,
64
+ normalizeRepo,
65
+ repoForAsset
66
+ };
67
+ //# sourceMappingURL=trust-tier-drift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/trust-tier-drift.ts"],"sourcesContent":["/**\n * A1 — Trust Tier star-drift 검출 데이터 + 순수 로직.\n *\n * TRUST_TIER 의 star 기반 라벨(vetted ≥ 1000★ / experimental < 1000★)이 실제 GitHub\n * star 와 어긋났는지(drift) 판정한다. `official` 은 star 무관(Anthropic 공식·하네스 자체)\n * 이라 검사 제외.\n *\n * repo 출처 = 각 자산 method (in-code authoritative — 주석이 아니라 실제 설치 source):\n * skill → method.source (\"owner/repo\" 또는 github URL)\n * plugin → method.marketplace (\"owner/repo\")\n * npm → NPM_REPO_OVERRIDE[id] (pkg 는 npm 명이므로 GitHub repo 를 별도 명시)\n *\n * fetch/네트워크는 본 모듈에 없음 — 순수 로직만(테스트 가능). 실 fetch 는\n * `scripts/trust-tier-drift.mjs` 가 담당.\n */\nimport { EXTERNAL_ASSETS, type ExternalAsset, TRUST_TIER } from \"./external-assets.js\";\n\n// v26.79.0 — gen-compatibility 의 카테고리 exhaustiveness 가드용 SSOT (하드코딩 drift 차단).\nexport { CATEGORIES } from \"./categories.js\";\n// v26.76.0 — gen-compatibility.mjs 가 dist 에서 자산 카탈로그+tier 를 읽도록 re-export.\nexport { EXTERNAL_ASSETS, TRUST_TIER } from \"./external-assets.js\";\n\n/** vetted 경계 (NORTH_STAR / PRD v26-71 D2). */\nexport const STAR_THRESHOLD = 1000;\n\nexport type StarTier = \"vetted\" | \"experimental\";\nexport type DriftVerdict = \"ok\" | \"promote\" | \"demote\";\n\n/**\n * method 가 GitHub repo 를 안 담는 자산(npm.pkg / npx-run.cmd 는 npm 명) → 트러스트 근거가\n * 된 GitHub repo 를 명시 매핑. override 가 method 도출보다 우선.\n */\nconst REPO_OVERRIDE: Record<string, string> = {\n \"vercel-cli\": \"vercel/vercel\", // npm\n \"netlify-cli\": \"netlify/cli\", // npm\n \"supabase-cli\": \"supabase/cli\", // npm\n \"agent-browser\": \"vercel-labs/agent-browser\", // npm\n \"gsd-orchestrator\": \"gsd-build/get-shit-done\", // npx-run\n openspec: \"Fission-AI/OpenSpec\", // npm (v26.75.0)\n \"bmad-method\": \"bmad-code-org/BMAD-METHOD\", // npx-run (v26.75.0)\n};\n\n/** \"https://github.com/owner/repo\" 또는 \"owner/repo[/...]\" → \"owner/repo\". 실패 시 null. */\nexport function normalizeRepo(source: string): string | null {\n const stripped = source.replace(/^https?:\\/\\/github\\.com\\//i, \"\");\n const m = stripped.match(/^([^/\\s]+\\/[^/\\s]+)/);\n return m?.[1] ?? null;\n}\n\n/** 자산의 GitHub owner/repo 도출. override 우선 → skill/plugin method. 도출 불가 시 null. */\nexport function repoForAsset(asset: ExternalAsset): string | null {\n const override = REPO_OVERRIDE[asset.id];\n if (override) return override;\n const m = asset.method;\n if (m.kind === \"skill\") return normalizeRepo(m.source);\n if (m.kind === \"plugin\") return normalizeRepo(m.marketplace);\n return null;\n}\n\nexport interface DriftTarget {\n id: string;\n tier: StarTier;\n repo: string;\n}\n\n/** star 기반(vetted/experimental) 자산만 + repo 도출 가능한 것만 검사 대상. */\nexport function driftTargets(\n assets: ReadonlyArray<ExternalAsset> = EXTERNAL_ASSETS,\n): DriftTarget[] {\n const out: DriftTarget[] = [];\n for (const a of assets) {\n const tier = TRUST_TIER[a.id];\n if (tier !== \"vetted\" && tier !== \"experimental\") continue;\n const repo = repoForAsset(a);\n if (!repo) continue; // 도출 불가 — 테스트가 0건을 강제하므로 정상 경로에선 발생 안 함\n out.push({ id: a.id, tier, repo });\n }\n return out;\n}\n\n/** 정적 tier 가 실제 star 와 어긋났는지 판정. */\nexport function classifyDrift(tier: StarTier, stars: number): DriftVerdict {\n if (tier === \"vetted\" && stars < STAR_THRESHOLD) return \"demote\";\n if (tier === \"experimental\" && stars >= STAR_THRESHOLD) return \"promote\";\n return \"ok\";\n}\n"],"mappings":";;;;;;;;;AAAA;AAuBO,IAAM,iBAAiB;AAS9B,IAAM,gBAAwC;AAAA,EAC5C,cAAc;AAAA;AAAA,EACd,eAAe;AAAA;AAAA,EACf,gBAAgB;AAAA;AAAA,EAChB,iBAAiB;AAAA;AAAA,EACjB,oBAAoB;AAAA;AAAA,EACpB,UAAU;AAAA;AAAA,EACV,eAAe;AAAA;AACjB;AAGO,SAAS,cAAc,QAA+B;AAC3D,QAAM,WAAW,OAAO,QAAQ,8BAA8B,EAAE;AAChE,QAAM,IAAI,SAAS,MAAM,qBAAqB;AAC9C,SAAO,IAAI,CAAC,KAAK;AACnB;AAGO,SAAS,aAAa,OAAqC;AAChE,QAAM,WAAW,cAAc,MAAM,EAAE;AACvC,MAAI,SAAU,QAAO;AACrB,QAAM,IAAI,MAAM;AAChB,MAAI,EAAE,SAAS,QAAS,QAAO,cAAc,EAAE,MAAM;AACrD,MAAI,EAAE,SAAS,SAAU,QAAO,cAAc,EAAE,WAAW;AAC3D,SAAO;AACT;AASO,SAAS,aACd,SAAuC,iBACxB;AACf,QAAM,MAAqB,CAAC;AAC5B,aAAW,KAAK,QAAQ;AACtB,UAAM,OAAO,WAAW,EAAE,EAAE;AAC5B,QAAI,SAAS,YAAY,SAAS,eAAgB;AAClD,UAAM,OAAO,aAAa,CAAC;AAC3B,QAAI,CAAC,KAAM;AACX,QAAI,KAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,CAAC;AAAA,EACnC;AACA,SAAO;AACT;AAGO,SAAS,cAAc,MAAgB,OAA6B;AACzE,MAAI,SAAS,YAAY,QAAQ,eAAgB,QAAO;AACxD,MAAI,SAAS,kBAAkB,SAAS,eAAgB,QAAO;AAC/D,SAAO;AACT;","names":[]}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@uzysjung/agent-harness",
3
+ "version": "26.83.0",
4
+ "description": "One-command installer & curator of vetted, Docker-verified AI-coding workflows across Claude Code, Codex, OpenCode & Antigravity",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "engines": {
10
+ "node": ">=20.0.0"
11
+ },
12
+ "bin": {
13
+ "agent-harness": "./dist/index.js"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "templates",
18
+ "scripts/prune-ecc.sh",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsup",
24
+ "dev": "tsup --watch",
25
+ "gen:compat": "npm run build && node scripts/gen-compatibility.mjs",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "test:coverage": "vitest run --coverage",
29
+ "typecheck": "tsc --noEmit",
30
+ "lint": "biome check src tests",
31
+ "lint:fix": "biome check --write src tests",
32
+ "format": "biome format --write src tests",
33
+ "ci": "npm run typecheck && npm run lint && npm run test:coverage && npm run build",
34
+ "prepare": "[ -d dist ] || npm run build"
35
+ },
36
+ "dependencies": {
37
+ "@clack/prompts": "^1.3.0",
38
+ "cac": "^7.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@biomejs/biome": "^2.4.13",
42
+ "@types/node": "^25.6.0",
43
+ "@vitest/coverage-v8": "^2.1.0",
44
+ "tsup": "^8.3.0",
45
+ "typescript": "^5.6.0",
46
+ "vitest": "^2.1.0"
47
+ },
48
+ "license": "MIT",
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/uzysjung/uzys-agent-harness.git"
52
+ }
53
+ }
@@ -0,0 +1,310 @@
1
+ #!/bin/bash
2
+ # ============================================================
3
+ # prune-ecc.sh
4
+ # ECC plugin을 project local로 복사하고 KEEP 외 항목을 prune.
5
+ # 글로벌 ~/.claude/는 read-only로만 사용 (D16 안전).
6
+ #
7
+ # 사용:
8
+ # 1. (선행 1회) claude plugin install everything-claude-code@everything-claude-code
9
+ # 2. bash prune-ecc.sh # dry-run (기본). 변경 없음.
10
+ # 3. bash prune-ecc.sh --apply # 실제 복사 + prune (확인 prompt)
11
+ # 4. bash prune-ecc.sh --apply --force # 확인 없이 즉시 진행
12
+ # 5. claude --plugin-dir .claude/local-plugins/ecc # 사용
13
+ #
14
+ # 옵션:
15
+ # --apply 실제 복사 + prune. 기본은 dry-run.
16
+ # --force 확인 prompt 생략.
17
+ # --dest <path> 복사 대상 경로 (기본: .claude/local-plugins/ecc)
18
+ # --keep-existing dest가 이미 있으면 덮어쓰기 안 함 (기본은 재복사)
19
+ # --copy-only prune 단계 skip. 전체 ECC를 project local로 복사만.
20
+ #
21
+ # 안전성:
22
+ # - 글로벌 ~/.claude/plugins/cache/ : read-only (cp 소스로만 사용)
23
+ # - dest 위치 (.claude/local-plugins/ecc) : .gitignore 자동 추가
24
+ # - 다른 프로젝트 영향 없음 (이 프로젝트 local만)
25
+ # ============================================================
26
+ set -u
27
+
28
+ RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; CYAN='\033[0;36m'; BOLD='\033[1m'; NC='\033[0m'
29
+
30
+ # --- Args ---
31
+ APPLY=false
32
+ FORCE=false
33
+ KEEP_EXISTING=false
34
+ COPY_ONLY=false
35
+ DEST=".claude/local-plugins/ecc"
36
+ while [ $# -gt 0 ]; do
37
+ case "$1" in
38
+ --apply) APPLY=true; shift ;;
39
+ --force) FORCE=true; shift ;;
40
+ --keep-existing) KEEP_EXISTING=true; shift ;;
41
+ --copy-only) COPY_ONLY=true; shift ;;
42
+ --dest)
43
+ [ -z "${2:-}" ] || [[ "$2" == --* ]] && { echo "ERROR: --dest requires a value" >&2; exit 1; }
44
+ DEST="$2"; shift 2 ;;
45
+ -h|--help) sed -n '2,24p' "$0"; exit 0 ;;
46
+ *) echo "Unknown arg: $1" >&2; exit 1 ;;
47
+ esac
48
+ done
49
+
50
+ # v26.11.1 — DEST 경계 검증: 글로벌 ~/.claude/ 또는 시스템 경로 차단 (path traversal 방어)
51
+ # v0.6.6 — dirname 디렉토리 미존재 시 pwd 기준으로 fallback (이전엔 상대경로 그대로 잔존 → pwd 검증 실패)
52
+ DEST_PARENT="$(cd "$(dirname "$DEST")" 2>/dev/null && pwd)" || DEST_PARENT=""
53
+ if [ -n "$DEST_PARENT" ]; then
54
+ DEST_ABS="$DEST_PARENT/$(basename "$DEST")"
55
+ elif [[ "$DEST" = /* ]]; then
56
+ DEST_ABS="$DEST"
57
+ else
58
+ DEST_ABS="$(pwd)/$DEST"
59
+ fi
60
+ case "$DEST_ABS" in
61
+ "$HOME/.claude"|"$HOME/.claude/"*)
62
+ echo "ERROR: --dest는 글로벌 ~/.claude/ 영역 불가 (D16)" >&2
63
+ echo " 입력: $DEST (절대: $DEST_ABS)" >&2
64
+ exit 1 ;;
65
+ "/"|"/etc"|"/etc/"*|"/usr/bin"|"/usr/sbin"|"/usr/local/bin"|"/bin"|"/sbin"|"/System"|"/System/"*)
66
+ echo "ERROR: --dest는 시스템 디렉토리 불가" >&2
67
+ echo " 입력: $DEST (절대: $DEST_ABS)" >&2
68
+ exit 1 ;;
69
+ esac
70
+ # 추가 안전: 현재 pwd 하위만 허용 (project-local 보장)
71
+ case "$DEST_ABS" in
72
+ "$(pwd)"|"$(pwd)/"*) ;;
73
+ *)
74
+ echo "ERROR: --dest는 현재 프로젝트 디렉토리 하위만 허용" >&2
75
+ echo " 입력: $DEST (절대: $DEST_ABS)" >&2
76
+ echo " 현재 pwd: $(pwd)" >&2
77
+ exit 1 ;;
78
+ esac
79
+
80
+ info() { echo -e " ${GREEN}✓${NC} $1"; }
81
+ warn() { echo -e " ${YELLOW}!${NC} $1"; }
82
+ fail() { echo -e " ${RED}✗${NC} $1" >&2; }
83
+ section() { echo ""; echo -e "${CYAN}${BOLD}$1${NC}"; }
84
+
85
+ # --- KEEP list (총 98건, v26.58.0 +6) ---
86
+ # v26.58.0 (ADR-019): cherrypicks.lock 의 C2 6개 KEEP 추가 (plugin ON 시 prune 으로 사라지는 구멍 차단):
87
+ # security-reviewer, silent-failure-hunter, build-error-resolver,
88
+ # e2e-testing, agent-introspection-debugging, nextjs-turbopack.
89
+ # 직전 baseline 92건 (이전 코멘트 "89건" 은 오기 — 실제 단어 count 검증 시 92).
90
+ KEEP_ITEMS="
91
+ agent-harness-construction agent-introspection-debugging agentic-engineering
92
+ ai-first-engineering api-design aside autonomous-loops backend-patterns
93
+ blueprint build-error-resolver build-fix checkpoint claude-api claw
94
+ code-review code-reviewer coding-standards configure-ecc content-engine
95
+ content-hash-cache-pattern continuous-agent-loop continuous-learning continuous-learning-v2
96
+ cost-aware-llm-pipeline crosspost database-migrations database-reviewer deep-research
97
+ deployment-patterns dmux-workflows docker-patterns e2e e2e-runner e2e-testing
98
+ eval eval-harness evolve exa-search frontend-patterns frontend-slides
99
+ harness-audit harness-optimizer instinct-export instinct-import instinct-status
100
+ investor-materials investor-outreach iterative-retrieval learn learn-eval
101
+ loop-operator loop-start loop-status market-research model-route multi-backend
102
+ multi-execute multi-frontend multi-plan multi-workflow nextjs-turbopack orchestrate
103
+ plan plankton-code-quality planner postgres-patterns projects promote
104
+ prompt-optimize prompt-optimizer python-patterns python-review python-reviewer
105
+ python-testing quality-gate refactor-clean regex-vs-llm-structured-text
106
+ resume-session save-session search-first security-review security-reviewer
107
+ security-scan sessions setup-pm silent-failure-hunter skill-create skill-stocktake
108
+ strategic-compact tdd tdd-guide tdd-workflow test-coverage update-codemaps
109
+ update-docs verification-loop verify x-api
110
+ "
111
+
112
+ is_keep() {
113
+ # v26.11.1 — grep -F (fixed string)로 정규식 메타문자 안전. 공백으로 단어 경계 강제.
114
+ echo " $KEEP_ITEMS " | tr -s ' \n' ' ' | grep -qF " $1 "
115
+ }
116
+
117
+ # --- Step 1: 글로벌 ECC cache 발견 ---
118
+ section "[1/5] Discover global ECC plugin cache (read-only)"
119
+ ECC_CACHE_BASE="$HOME/.claude/plugins/cache/everything-claude-code/everything-claude-code"
120
+ if [ ! -d "$ECC_CACHE_BASE" ]; then
121
+ fail "ECC plugin 미설치 — 다음 명령으로 먼저 설치:"
122
+ echo " claude plugin marketplace add affaan-m/everything-claude-code"
123
+ echo " claude plugin install everything-claude-code@everything-claude-code"
124
+ exit 1
125
+ fi
126
+ ECC_VERSION=$(ls -1 "$ECC_CACHE_BASE" 2>/dev/null | sort -V | tail -1)
127
+ # ECC v1.10.0 구조: 1.10.0/ 자체가 root (skills/, agents/, commands/ top-level).
128
+ # everything-claude-code/ 는 빈 디렉토리, ecc2/는 별개 Rust 프로젝트.
129
+ ECC_SOURCE="$ECC_CACHE_BASE/$ECC_VERSION"
130
+ if [ ! -d "$ECC_SOURCE/skills" ] || [ ! -d "$ECC_SOURCE/agents" ]; then
131
+ fail "ECC plugin source 디렉토리 미발견 (skills/ + agents/): $ECC_SOURCE"
132
+ exit 1
133
+ fi
134
+ info "Source: $ECC_SOURCE (v$ECC_VERSION)"
135
+
136
+ # --- Step 2: 복사 (또는 기존 사용) ---
137
+ section "[2/5] Copy to project local"
138
+ if [ -d "$DEST" ] && [ "$KEEP_EXISTING" = true ]; then
139
+ info "기존 $DEST 유지 (--keep-existing)"
140
+ elif [ "$APPLY" = false ]; then
141
+ warn "[DRY-RUN] would copy: $ECC_SOURCE → $DEST"
142
+ else
143
+ if [ -d "$DEST" ]; then
144
+ warn "기존 $DEST 제거 후 재복사"
145
+ rm -rf "$DEST"
146
+ fi
147
+ mkdir -p "$(dirname "$DEST")"
148
+ cp -R "$ECC_SOURCE" "$DEST"
149
+ info "Copied to: $DEST"
150
+ fi
151
+
152
+ # --- Step 3: prune 분석 ---
153
+ section "[3/5] Prune analysis"
154
+ SCAN_DIR="$DEST"
155
+ [ ! -d "$SCAN_DIR" ] && SCAN_DIR="$ECC_SOURCE" # dry-run 시 source로 분석
156
+
157
+ declare -a PRUNE_TARGETS=()
158
+ KEEP_COUNT=0
159
+ PRUNE_COUNT=0
160
+
161
+ analyze_dir() {
162
+ local kind="$1" dir="$2"
163
+ [ ! -d "$dir" ] && return
164
+ local kept=0 pruned=0
165
+ if [ "$kind" = "directory" ]; then
166
+ for d in "$dir"/*/; do
167
+ [ -d "$d" ] || continue
168
+ local name; name=$(basename "$d")
169
+ if is_keep "$name"; then
170
+ kept=$((kept+1))
171
+ else
172
+ PRUNE_TARGETS+=("$d")
173
+ pruned=$((pruned+1))
174
+ fi
175
+ done
176
+ else
177
+ for f in "$dir"/*.md; do
178
+ [ -f "$f" ] || continue
179
+ local name; name=$(basename "$f" .md)
180
+ if is_keep "$name"; then
181
+ kept=$((kept+1))
182
+ else
183
+ PRUNE_TARGETS+=("$f")
184
+ pruned=$((pruned+1))
185
+ fi
186
+ done
187
+ fi
188
+ KEEP_COUNT=$((KEEP_COUNT+kept))
189
+ PRUNE_COUNT=$((PRUNE_COUNT+pruned))
190
+ printf " %-50s keep=%3d prune=%3d\n" "${dir#$SCAN_DIR/}" "$kept" "$pruned"
191
+ }
192
+
193
+ analyze_dir "directory" "$SCAN_DIR/skills"
194
+ analyze_dir "file" "$SCAN_DIR/agents"
195
+ analyze_dir "file" "$SCAN_DIR/commands"
196
+ [ -d "$SCAN_DIR/.opencode/commands" ] && analyze_dir "file" "$SCAN_DIR/.opencode/commands"
197
+ [ -d "$SCAN_DIR/.claude/commands" ] && analyze_dir "file" "$SCAN_DIR/.claude/commands"
198
+
199
+ echo ""
200
+ echo -e " ${BOLD}Total keep: ${GREEN}$KEEP_COUNT${NC}${BOLD} prune: ${RED}$PRUNE_COUNT${NC}"
201
+
202
+ # KEEP 누락 검증
203
+ section "KEEP missing check (사용자 리스트 중 plugin에 없는 것)"
204
+ NOT_FOUND=()
205
+ for k in $KEEP_ITEMS; do
206
+ if ! find "$SCAN_DIR/skills" "$SCAN_DIR/agents" "$SCAN_DIR/commands" \
207
+ "$SCAN_DIR/.opencode/commands" "$SCAN_DIR/.claude/commands" \
208
+ -maxdepth 1 \( -type d -name "$k" -o -type f -name "$k.md" \) 2>/dev/null \
209
+ | grep -q .; then
210
+ NOT_FOUND+=("$k")
211
+ fi
212
+ done
213
+ if [ "${#NOT_FOUND[@]}" -eq 0 ]; then
214
+ # 카운트는 KEEP_ITEMS 에서 동적 산출 (하드코딩 시 89→92→98 처럼 drift 누적).
215
+ info "모든 KEEP $(echo "$KEEP_ITEMS" | wc -w | tr -d ' ')건 plugin에 존재"
216
+ else
217
+ warn "KEEP 누락 ${#NOT_FOUND[@]}건 (이름 변경/제거됐을 수 있음):"
218
+ printf ' - %s\n' "${NOT_FOUND[@]}"
219
+ fi
220
+
221
+ # --- Step 4: apply ---
222
+ section "[4/5] Apply prune"
223
+ if [ "$APPLY" = false ]; then
224
+ warn "DRY-RUN — 변경 없음. 실제 복사+prune은 --apply 추가."
225
+ echo " bash prune-ecc.sh --apply"
226
+ exit 0
227
+ fi
228
+
229
+ # v26.15.0 — --copy-only: prune 단계 skip
230
+ if [ "$COPY_ONLY" = true ]; then
231
+ info "copy-only 모드 — prune 단계 skip (전체 ECC 유지)"
232
+ DELETED=0
233
+ FAILED=0
234
+ else
235
+ if [ "$FORCE" = false ]; then
236
+ echo ""
237
+ echo -e " ${YELLOW}경고:${NC} ${PRUNE_COUNT}건을 ${DEST} 하위에서 영구 삭제합니다."
238
+ echo " 글로벌 cache는 영향 없음. 다른 프로젝트도 영향 없음."
239
+ read -rp " 진행? [y/N]: " ANSWER < /dev/tty 2>/dev/null || ANSWER=""
240
+ [[ ! "$ANSWER" =~ ^[Yy]$ ]] && { warn "취소됨"; exit 0; }
241
+ fi
242
+ DELETED=0
243
+ FAILED=0
244
+ for target in "${PRUNE_TARGETS[@]}"; do
245
+ if rm -rf "$target" 2>/dev/null; then
246
+ DELETED=$((DELETED+1))
247
+ else
248
+ FAILED=$((FAILED+1))
249
+ fail "삭제 실패: $target"
250
+ fi
251
+ done
252
+ fi
253
+
254
+ # --- Step 5: .gitignore + 사용 안내 ---
255
+ section "[5/5] Post-actions"
256
+ if ! grep -q "^.claude/local-plugins/" .gitignore 2>/dev/null; then
257
+ echo ".claude/local-plugins/" >> .gitignore
258
+ info ".gitignore에 .claude/local-plugins/ 추가"
259
+ else
260
+ info ".gitignore 이미 등록됨"
261
+ fi
262
+
263
+ # v26.15.0 — DELETED / KEPT 상세 목록 출력
264
+ if [ "$COPY_ONLY" = false ] && [ "$DELETED" -gt 0 ]; then
265
+ echo ""
266
+ echo -e "${BOLD}========== DELETED ($DELETED) ==========${NC}"
267
+ for category in skills agents commands; do
268
+ local_deleted=()
269
+ for target in "${PRUNE_TARGETS[@]}"; do
270
+ case "$target" in
271
+ *"/$category/"*)
272
+ local_deleted+=("$(basename "$target")") ;;
273
+ esac
274
+ done
275
+ if [ "${#local_deleted[@]}" -gt 0 ]; then
276
+ echo -e " ${RED}$category/${NC} (${#local_deleted[@]}):"
277
+ printf ' - %s\n' "${local_deleted[@]}" | sort
278
+ fi
279
+ done
280
+ fi
281
+
282
+ echo ""
283
+ echo -e "${BOLD}========== KEPT ($KEEP_COUNT) ==========${NC}"
284
+ for category in skills agents commands; do
285
+ dir="$DEST/$category"
286
+ [ ! -d "$dir" ] && continue
287
+ kept_items=()
288
+ for item in "$dir"/*; do
289
+ [ -e "$item" ] || continue
290
+ kept_items+=("$(basename "$item" | sed 's/\.md$//')")
291
+ done
292
+ if [ "${#kept_items[@]}" -gt 0 ]; then
293
+ echo -e " ${GREEN}$category/${NC} (${#kept_items[@]}):"
294
+ printf ' - %s\n' "${kept_items[@]}" | sort
295
+ fi
296
+ done
297
+
298
+ echo ""
299
+ echo -e "${BOLD}========== Summary ==========${NC}"
300
+ echo -e " ${GREEN}Deleted: $DELETED${NC}"
301
+ [ "$FAILED" -gt 0 ] && echo -e " ${RED}Failed: $FAILED${NC}"
302
+ echo -e " ${BOLD}Remaining (KEEP): $KEEP_COUNT${NC}"
303
+ echo -e " ${BOLD}Location: $DEST${NC}"
304
+ echo ""
305
+ echo -e "${BOLD}사용법:${NC}"
306
+ echo " claude --plugin-dir $DEST"
307
+ echo ""
308
+ echo -e "${BOLD}재실행 필요 시점:${NC}"
309
+ echo " - ECC plugin 업데이트 후 (claude plugin update)"
310
+ echo " - 글로벌 cache 갱신 후"
@@ -0,0 +1,86 @@
1
+ # Uzys-agent-harness CLAUDE.md
2
+ These rules apply to every task in this project unless explicitly overridden.
3
+ Bias: caution over speed on non-trivial work. Use judgment on trivial tasks.
4
+
5
+ ## Rule 1 — Think Before Coding
6
+ State assumptions explicitly. If uncertain, ask rather than guess.
7
+ Present multiple interpretations when ambiguity exists.
8
+ Push back when a simpler approach exists.
9
+ Stop when confused. Name what's unclear.
10
+
11
+ ## Rule 2 — Simplicity First
12
+ Minimum code that solves the problem. Nothing speculative.
13
+ No features beyond what was asked. No abstractions for single-use code.
14
+ Test: would a senior engineer say this is overcomplicated? If yes, simplify.
15
+
16
+ ## Rule 3 — Surgical Changes
17
+ Touch only what you must. Clean up only your own mess.
18
+ Don't "improve" adjacent code, comments, or formatting.
19
+ Don't refactor what isn't broken. Match existing style.
20
+
21
+ ## Rule 4 — Goal-Driven Execution
22
+ Define success criteria. Loop until verified.
23
+ Don't follow steps. Define success and iterate.
24
+ Strong success criteria let you loop independently.
25
+
26
+ ## Rule 5 — Use the model only for judgment calls
27
+ Use me for: classification, drafting, summarization, extraction.
28
+ Do NOT use me for: routing, retries, deterministic transforms.
29
+ If code can answer, code answers.
30
+
31
+ ## Rule 6 — Token budgets are not advisory
32
+ Per-task: 4,000 tokens. Per-session: 30,000 tokens.
33
+ If approaching budget, summarize and start fresh.
34
+ Surface the breach. Do not silently overrun.
35
+
36
+ ## Rule 7 — Surface conflicts, don't average them
37
+ If two patterns contradict, pick one (more recent / more tested).
38
+ Explain why. Flag the other for cleanup.
39
+ Don't blend conflicting patterns.
40
+
41
+ ## Rule 8 — Read before you write
42
+ Before adding code, read exports, immediate callers, shared utilities.
43
+ "Looks orthogonal" is dangerous. If unsure why code is structured a way, ask.
44
+
45
+ ## Rule 9 — Tests verify intent, not just behavior
46
+ Tests must encode WHY behavior matters, not just WHAT it does.
47
+ A test that can't fail when business logic changes is wrong.
48
+
49
+ ## Rule 10 — Checkpoint after every significant step
50
+ Summarize what was done, what's verified, what's left.
51
+ Don't continue from a state you can't describe back.
52
+ If you lose track, stop and restate.
53
+
54
+ ## Rule 11 — Match the codebase's conventions, even if you disagree
55
+ Conformance > taste inside the codebase.
56
+ If you genuinely think a convention is harmful, surface it. Don't fork silently.
57
+
58
+ ## Rule 12 — Fail loud
59
+ "Completed" is wrong if anything was skipped silently.
60
+ "Tests pass" is wrong if any were skipped.
61
+ Default to surfacing uncertainty, not hiding it.
62
+
63
+ ## Anti-Patterns (Forbidden)
64
+ "feels kind of weak intuitively" / "probably won't be used" → speculation
65
+ "it's an advanced feature, so low value" → assertion with no criteria
66
+ "generally needed" → unverifiable
67
+ "in my experience" → unsourced generalization
68
+
69
+ ## When Requesting Decisions or Confirmation
70
+ Explain in detail, with the surrounding before/after context, so it's easy to understand.
71
+ State the recommended option and the reason for it.
72
+ Explain it in a way that can be understood as UI/UX.
73
+ Explain it in AS-IS / TO-BE form.
74
+ Frame every choice from the user's perspective — the benefit gained vs. the cost incurred — and visualize the trade-off (e.g., a comparison table) instead of leaving it in prose.
75
+
76
+ ## Run Self-Audit on Phase/Task Completion
77
+ Acceptance Criteria met [Pass/Fail per item]
78
+ Confirm DO NOT CHANGE areas were not modified
79
+ Confirm no Non-Goals were violated
80
+ Any changes not traceable to the request
81
+ Open decisions / follow-up work
82
+
83
+ ## Context Management
84
+ autocompact enabled. Consider manual /compact when reaching 50%.
85
+ Re-reference SPEC/PRD at the start of every session (Persistent Anchor).
86
+ On phase transitions, do a structured state handoff. Keep SPEC/PRD/TODO current.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: build-error-resolver
3
+ description: Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.
4
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
5
+ model: sonnet
6
+ ---
7
+
8
+ # Build Error Resolver
9
+
10
+ You are an expert build error resolution specialist. Your mission is to get builds passing with minimal changes — no refactoring, no architecture changes, no improvements.
11
+
12
+ ## Core Responsibilities
13
+
14
+ 1. **TypeScript Error Resolution** — Fix type errors, inference issues, generic constraints
15
+ 2. **Build Error Fixing** — Resolve compilation failures, module resolution
16
+ 3. **Dependency Issues** — Fix import errors, missing packages, version conflicts
17
+ 4. **Configuration Errors** — Resolve tsconfig, webpack, Next.js config issues
18
+ 5. **Minimal Diffs** — Make smallest possible changes to fix errors
19
+ 6. **No Architecture Changes** — Only fix errors, don't redesign
20
+
21
+ ## Diagnostic Commands
22
+
23
+ ```bash
24
+ npx tsc --noEmit --pretty
25
+ npx tsc --noEmit --pretty --incremental false # Show all errors
26
+ npm run build
27
+ npx eslint . --ext .ts,.tsx,.js,.jsx
28
+ ```
29
+
30
+ ## Workflow
31
+
32
+ ### 1. Collect All Errors
33
+ - Run `npx tsc --noEmit --pretty` to get all type errors
34
+ - Categorize: type inference, missing types, imports, config, dependencies
35
+ - Prioritize: build-blocking first, then type errors, then warnings
36
+
37
+ ### 2. Fix Strategy (MINIMAL CHANGES)
38
+ For each error:
39
+ 1. Read the error message carefully — understand expected vs actual
40
+ 2. Find the minimal fix (type annotation, null check, import fix)
41
+ 3. Verify fix doesn't break other code — rerun tsc
42
+ 4. Iterate until build passes
43
+
44
+ ### 3. Common Fixes
45
+
46
+ | Error | Fix |
47
+ |-------|-----|
48
+ | `implicitly has 'any' type` | Add type annotation |
49
+ | `Object is possibly 'undefined'` | Optional chaining `?.` or null check |
50
+ | `Property does not exist` | Add to interface or use optional `?` |
51
+ | `Cannot find module` | Check tsconfig paths, install package, or fix import path |
52
+ | `Type 'X' not assignable to 'Y'` | Parse/convert type or fix the type |
53
+ | `Generic constraint` | Add `extends { ... }` |
54
+ | `Hook called conditionally` | Move hooks to top level |
55
+ | `'await' outside async` | Add `async` keyword |
56
+
57
+ ## DO and DON'T
58
+
59
+ **DO:**
60
+ - Add type annotations where missing
61
+ - Add null checks where needed
62
+ - Fix imports/exports
63
+ - Add missing dependencies
64
+ - Update type definitions
65
+ - Fix configuration files
66
+
67
+ **DON'T:**
68
+ - Refactor unrelated code
69
+ - Change architecture
70
+ - Rename variables (unless causing error)
71
+ - Add new features
72
+ - Change logic flow (unless fixing error)
73
+ - Optimize performance or style
74
+
75
+ ## Priority Levels
76
+
77
+ | Level | Symptoms | Action |
78
+ |-------|----------|--------|
79
+ | CRITICAL | Build completely broken, no dev server | Fix immediately |
80
+ | HIGH | Single file failing, new code type errors | Fix soon |
81
+ | MEDIUM | Linter warnings, deprecated APIs | Fix when possible |
82
+
83
+ ## Quick Recovery
84
+
85
+ ```bash
86
+ # Nuclear option: clear all caches
87
+ rm -rf .next node_modules/.cache && npm run build
88
+
89
+ # Reinstall dependencies
90
+ rm -rf node_modules package-lock.json && npm install
91
+
92
+ # Fix ESLint auto-fixable
93
+ npx eslint . --fix
94
+ ```
95
+
96
+ ## Success Metrics
97
+
98
+ - `npx tsc --noEmit` exits with code 0
99
+ - `npm run build` completes successfully
100
+ - No new errors introduced
101
+ - Minimal lines changed (< 5% of affected file)
102
+ - Tests still passing
103
+
104
+ ## When NOT to Use
105
+
106
+ - Code needs refactoring → use `refactor-cleaner`
107
+ - Architecture changes needed → use `architect`
108
+ - New features required → use `planner`
109
+ - Tests failing → use `tdd-guide`
110
+ - Security issues → use `security-reviewer`
111
+
112
+ ---
113
+
114
+ **Remember**: Fix the error, verify the build passes, move on. Speed and precision over perfection.