opencode-agent-orchestration-kit 1.0.27

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 (236) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.yml +65 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +11 -0
  4. package/.github/ISSUE_TEMPLATE/documentation.yml +22 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.yml +43 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +25 -0
  7. package/.github/workflows/check.yml +47 -0
  8. package/CODE_OF_CONDUCT.md +24 -0
  9. package/CONTRIBUTING.md +52 -0
  10. package/LICENSE +201 -0
  11. package/NOTICE.md +23 -0
  12. package/README.md +806 -0
  13. package/SECURITY.md +17 -0
  14. package/docker/open-design/.env.example +6 -0
  15. package/docker/open-design/Dockerfile +50 -0
  16. package/docker/open-design/docker-compose.yml +18 -0
  17. package/docker/open-design/opencode-od/agents/od-worker.md +22 -0
  18. package/docker/open-design/opencode-od/opencode.json +24 -0
  19. package/docs/agents.md +21 -0
  20. package/docs/commands.md +16 -0
  21. package/docs/configuration.md +30 -0
  22. package/docs/docker-open-design.md +42 -0
  23. package/docs/impeccable.md +18 -0
  24. package/docs/installation.md +176 -0
  25. package/docs/models.md +17 -0
  26. package/docs/open-design.md +25 -0
  27. package/docs/quickstart.md +74 -0
  28. package/docs/releases/v1.0.10.md +46 -0
  29. package/docs/releases/v1.0.14.md +39 -0
  30. package/docs/releases/v1.0.27.md +66 -0
  31. package/docs/security.md +8 -0
  32. package/docs/superpowers/plans/2026-07-20-safe-installation-lifecycle.md +779 -0
  33. package/docs/superpowers/plans/2026-07-20-version-identity-and-releases.md +590 -0
  34. package/docs/superpowers/specs/2026-07-20-safe-installation-lifecycle-design.md +1350 -0
  35. package/docs/superpowers/specs/2026-07-20-version-identity-and-releases-design.md +557 -0
  36. package/docs/superpowers.md +34 -0
  37. package/docs/synology.md +30 -0
  38. package/docs/troubleshooting.md +54 -0
  39. package/docs/workflows.md +44 -0
  40. package/doctor.sh +5 -0
  41. package/env.example +15 -0
  42. package/install.sh +5 -0
  43. package/opencode/AGENTS.md +104 -0
  44. package/opencode/agents/debugger.md +41 -0
  45. package/opencode/agents/designer.md +93 -0
  46. package/opencode/agents/developer.md +180 -0
  47. package/opencode/agents/evaluator.md +35 -0
  48. package/opencode/agents/evolver.md +31 -0
  49. package/opencode/agents/lead.md +251 -0
  50. package/opencode/agents/researcher.md +76 -0
  51. package/opencode/agents/review_api.md +34 -0
  52. package/opencode/agents/review_coordinator.md +111 -0
  53. package/opencode/agents/review_quality.md +35 -0
  54. package/opencode/agents/review_security.md +35 -0
  55. package/opencode/agents/review_tests.md +37 -0
  56. package/opencode/agents/reviewer.md +116 -0
  57. package/opencode/agents/scoper.md +75 -0
  58. package/opencode/agents/specifier.md +116 -0
  59. package/opencode/commands/code-simplify.md +36 -0
  60. package/opencode/commands/design.md +27 -0
  61. package/opencode/commands/evolve.md +165 -0
  62. package/opencode/commands/feature.md +67 -0
  63. package/opencode/commands/implement.md +11 -0
  64. package/opencode/commands/init.md +34 -0
  65. package/opencode/commands/loop.md +145 -0
  66. package/opencode/commands/mvp-spec.md +20 -0
  67. package/opencode/commands/plan.md +74 -0
  68. package/opencode/commands/research.md +12 -0
  69. package/opencode/commands/review-orchestrated.md +47 -0
  70. package/opencode/commands/review-preflight.md +26 -0
  71. package/opencode/commands/review.md +18 -0
  72. package/opencode/commands/scope.md +36 -0
  73. package/opencode/commands/spec.md +12 -0
  74. package/opencode/commands/test.md +40 -0
  75. package/opencode/docs/ai/evolution/README.md +135 -0
  76. package/opencode/docs/ai/evolution/benchmarks/manual-scenarios.md +123 -0
  77. package/opencode/docs/ai/evolution/benchmarks/router-scenarios.jsonl +8 -0
  78. package/opencode/docs/ai/evolution/evolution_history.md +83 -0
  79. package/opencode/docs/ai/evolution/mechanisms.jsonl +7 -0
  80. package/opencode/docs/ai/evolution/rejected_mechanisms.jsonl +2 -0
  81. package/opencode/docs/ai/evolution/runs/README.md +15 -0
  82. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/analysis/overview.md +12 -0
  83. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/change_evaluation.json +108 -0
  84. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/change_manifest.json +52 -0
  85. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/evaluation.md +19 -0
  86. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/post_evaluation.md +12 -0
  87. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/analysis/overview.md +7 -0
  88. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/change_evaluation.json +31 -0
  89. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/evaluation.md +19 -0
  90. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/analysis/overview.md +13 -0
  91. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/change_evaluation.json +66 -0
  92. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/change_manifest.json +82 -0
  93. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/evaluation.md +20 -0
  94. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/ahe-run-lifecycle-validator.md +40 -0
  95. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/evolve-evaluation-only-contract.md +15 -0
  96. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/open-design-tool-contract.md +14 -0
  97. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/slash-command-contract-coverage.md +40 -0
  98. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/overview.md +17 -0
  99. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/pre_apply_approval.md +15 -0
  100. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/change_evaluation.json +252 -0
  101. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/change_manifest.json +210 -0
  102. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/evaluation.md +25 -0
  103. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/post_apply_evaluation.md +15 -0
  104. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/post_manifest_evaluation.md +14 -0
  105. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/pre_apply_evaluation.md +15 -0
  106. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/analysis/overview.md +13 -0
  107. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/change_evaluation.json +14 -0
  108. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/change_manifest.json +30 -0
  109. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/evaluation.md +25 -0
  110. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/analysis/overview.md +13 -0
  111. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/change_evaluation.json +14 -0
  112. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/change_manifest.json +29 -0
  113. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/evaluation.md +18 -0
  114. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/analysis/overview.md +13 -0
  115. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/change_evaluation.json +14 -0
  116. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/change_manifest.json +34 -0
  117. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/evaluation.md +17 -0
  118. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/analysis/overview.md +13 -0
  119. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/change_evaluation.json +12 -0
  120. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/change_manifest.json +28 -0
  121. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/evaluation.md +17 -0
  122. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/analysis/overview.md +9 -0
  123. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/change_evaluation.json +14 -0
  124. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/change_manifest.json +31 -0
  125. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/evaluation.md +18 -0
  126. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/analysis/overview.md +12 -0
  127. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/change_evaluation.json +14 -0
  128. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/change_manifest.json +31 -0
  129. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/evaluation.md +17 -0
  130. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/analysis/overview.md +10 -0
  131. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/change_evaluation.json +14 -0
  132. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/change_manifest.json +30 -0
  133. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/evaluation.md +17 -0
  134. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/analysis/overview.md +25 -0
  135. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/change_evaluation.json +28 -0
  136. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/change_manifest.json +31 -0
  137. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/evaluation.md +22 -0
  138. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/analysis/overview.md +27 -0
  139. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/change_evaluation.json +32 -0
  140. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/change_manifest.json +49 -0
  141. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/evaluation.md +92 -0
  142. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/analysis/detail/token-vs-semantic.md +31 -0
  143. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/analysis/overview.md +14 -0
  144. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/evaluation.md +36 -0
  145. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/analysis/overview.md +13 -0
  146. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/change_evaluation.json +31 -0
  147. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/change_manifest.json +47 -0
  148. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/evaluation.md +27 -0
  149. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/analysis/overview.md +32 -0
  150. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/change_evaluation.json +31 -0
  151. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/change_manifest.json +35 -0
  152. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/evaluation.md +31 -0
  153. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/detail/pattern-1-feature-sidecar-false-positive.md +51 -0
  154. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/detail/pattern-2-checker-time-budget.md +52 -0
  155. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/overview.md +99 -0
  156. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/change_evaluation.json +61 -0
  157. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/change_manifest.json +61 -0
  158. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/evaluation.md +448 -0
  159. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/analysis/detail/intake-gray-zone.md +65 -0
  160. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/analysis/overview.md +172 -0
  161. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/evaluation.md +226 -0
  162. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/analysis/detail/plan-only-gray-zone.md +62 -0
  163. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/analysis/overview.md +167 -0
  164. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/evaluation.md +163 -0
  165. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/analysis/overview.md +42 -0
  166. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/change_evaluation.json +46 -0
  167. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/change_manifest.json +57 -0
  168. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/evaluation.md +48 -0
  169. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/detail/contract-vs-runtime-gap.md +163 -0
  170. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/detail/evidence-collection-blocker.md +134 -0
  171. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/overview.md +111 -0
  172. package/opencode/docs/ai/evolution/runs/iteration-021/change_evaluation.json +52 -0
  173. package/opencode/docs/ai/evolution/runs/iteration-021/change_manifest.json +50 -0
  174. package/opencode/docs/ai/evolution/runs/iteration-021/evaluation.md +46 -0
  175. package/opencode/docs/ai/evolution/runs/iteration-021/manifest-justification.md +48 -0
  176. package/opencode/docs/ai/evolution/session-sources.md +91 -0
  177. package/opencode/docs/ai/harness/README.md +32 -0
  178. package/opencode/docs/ai/harness/agents.md +148 -0
  179. package/opencode/docs/ai/harness/checks.md +119 -0
  180. package/opencode/docs/ai/harness/commands.md +391 -0
  181. package/opencode/docs/ai/harness/evidence.md +85 -0
  182. package/opencode/docs/ai/harness/init-detection-rules.md +160 -0
  183. package/opencode/docs/ai/harness/orchestrated-review.md +131 -0
  184. package/opencode/docs/ai/harness/skill-metadata-schema.md +198 -0
  185. package/opencode/docs/ai/harness/skill-resolution.md +202 -0
  186. package/opencode/docs/ai/harness/skill_registry.json +443 -0
  187. package/opencode/docs/ai/harness/skill_registry.md +43 -0
  188. package/opencode/docs/ai/project-context-template.md +53 -0
  189. package/opencode/opencode.json +38 -0
  190. package/opencode/package-lock.json +1717 -0
  191. package/opencode/package.json +11 -0
  192. package/opencode/plugins/token-tree-usage.tsx +206 -0
  193. package/opencode/references/performance-checklist.md +153 -0
  194. package/opencode/references/security-checklist.md +134 -0
  195. package/opencode/references/testing-patterns.md +236 -0
  196. package/opencode/scripts/check-harness.mjs +1572 -0
  197. package/opencode/scripts/check-harness.test.mjs +820 -0
  198. package/opencode/scripts/collect-session-evidence.mjs +612 -0
  199. package/opencode/scripts/collect-session-evidence.test.mjs +443 -0
  200. package/opencode/scripts/preflight-audit.mjs +497 -0
  201. package/opencode/scripts/preflight-audit.test.mjs +363 -0
  202. package/opencode/scripts/project-capability-snapshot.mjs +407 -0
  203. package/opencode/scripts/project-capability-snapshot.test.mjs +382 -0
  204. package/opencode/scripts/review-orchestrated-prepare.mjs +547 -0
  205. package/opencode/scripts/review-orchestrated-prepare.test.mjs +516 -0
  206. package/opencode/scripts/skill-resolver.mjs +585 -0
  207. package/opencode/scripts/skill-resolver.test.mjs +781 -0
  208. package/opencode/scripts/update-skill-registry.mjs +380 -0
  209. package/opencode/skills/api-and-interface-design/SKILL.md +315 -0
  210. package/opencode/skills/autonomous-loops/SKILL.md +312 -0
  211. package/opencode/skills/code-review-and-quality/SKILL.md +365 -0
  212. package/opencode/skills/code-simplification/SKILL.md +345 -0
  213. package/opencode/skills/context-engineering/SKILL.md +252 -0
  214. package/opencode/skills/debugging-and-error-recovery/SKILL.md +316 -0
  215. package/opencode/skills/documentation-and-adrs/SKILL.md +298 -0
  216. package/opencode/skills/doubt-driven-development/SKILL.md +168 -0
  217. package/opencode/skills/iterative-retrieval/SKILL.md +232 -0
  218. package/opencode/skills/open-design/SKILL.md +123 -0
  219. package/opencode/skills/performance-optimization/SKILL.md +365 -0
  220. package/opencode/skills/security-and-hardening/SKILL.md +369 -0
  221. package/opencode/skills/source-driven-development/SKILL.md +210 -0
  222. package/opencode/skills/test-driven-development/SKILL.md +406 -0
  223. package/opencode/skills/using-agent-skills/SKILL.md +194 -0
  224. package/opencode/skills/verification-loop/SKILL.md +162 -0
  225. package/opencode/tools/open_design.ts +361 -0
  226. package/opencode/tui.json +5 -0
  227. package/package.json +20 -0
  228. package/rollback.sh +5 -0
  229. package/scripts/check.sh +184 -0
  230. package/scripts/install-smoke.sh +111 -0
  231. package/scripts/manage-installation.mjs +1498 -0
  232. package/scripts/manage-installation.test.mjs +1936 -0
  233. package/scripts/version.mjs +197 -0
  234. package/scripts/version.test.mjs +195 -0
  235. package/uninstall.sh +5 -0
  236. package/upgrade.sh +5 -0
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: doubt-driven-development
3
+ description: Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.
4
+ phase: review
5
+ domains:
6
+ - review
7
+ - debugging
8
+ - security
9
+ stacks:
10
+ - any
11
+ allowed_agents:
12
+ - lead
13
+ - developer
14
+ - reviewer
15
+ surfaces:
16
+ - code-implementation
17
+ - adversarial-review
18
+ skill_source: external
19
+ origin: addyosmani/agent-skills
20
+ status: active
21
+ ---
22
+
23
+ # Doubt-Driven Development
24
+
25
+ ## Overview
26
+
27
+ A confident answer is not a correct one. Long sessions accumulate context that quietly turns assumptions into "facts" without anyone noticing. Doubt-driven development is the discipline of materializing a fresh-context reviewer — biased to **disprove**, not approve — before any non-trivial output stands.
28
+
29
+ This is not `/review`. `/review` is a verdict on a finished artifact. This is an in-flight posture: non-trivial decisions get cross-examined while course-correction is still cheap.
30
+
31
+ ## When to Use
32
+
33
+ A decision is **non-trivial** when at least one of these is true:
34
+
35
+ - It introduces or modifies branching logic
36
+ - It crosses a module or service boundary
37
+ - It asserts a property the type system or compiler cannot verify (thread safety, idempotence, ordering, invariants)
38
+ - Its correctness depends on context the future reader cannot see
39
+ - Its blast radius is irreversible (production deploy, data migration, public API change)
40
+
41
+ Apply the skill when:
42
+
43
+ - About to make an architectural decision under uncertainty
44
+ - About to commit non-trivial code
45
+ - About to claim a non-obvious fact ("this is safe", "this scales", "this matches the spec")
46
+ - Working in code you don't fully understand
47
+
48
+ **When NOT to use:**
49
+
50
+ - Mechanical operations (renaming, formatting, file moves)
51
+ - Following a clear, unambiguous user instruction
52
+ - Reading or summarizing existing code
53
+ - One-line changes with obvious correctness
54
+ - Pure tooling operations (running tests, listing files)
55
+ - The user has explicitly asked for speed over verification
56
+
57
+ If you doubt every keystroke, you ship nothing. The skill applies only to non-trivial decisions as defined above.
58
+
59
+ ## The Process
60
+
61
+ ### Step 1: CLAIM — Surface what stands
62
+
63
+ Name the decision in two or three lines:
64
+
65
+ ```
66
+ CLAIM: "The new caching layer is thread-safe under the
67
+ read-heavy workload described in the spec."
68
+ WHY THIS MATTERS: a race here corrupts user data and is
69
+ hard to detect in QA.
70
+ ```
71
+
72
+ If you can't write the claim that compactly, you have a vibe, not a decision. Surface it before scrutinizing it.
73
+
74
+ ### Step 2: EXTRACT — Smallest reviewable unit
75
+
76
+ A fresh-context reviewer needs the **artifact** and the **contract**, not the journey.
77
+
78
+ - Code: the diff or the function — not the whole file
79
+ - Decision: the proposal in 3–5 sentences plus the constraints it has to satisfy
80
+ - Assertion: the claim plus the evidence that supposedly supports it (kept distinct from the Step 1 CLAIM block)
81
+
82
+ Strip your reasoning. If you hand over conclusions, you'll get back validation of your conclusions. The unit must be small enough that a reviewer can hold it in mind in one read — if it's a 500-line PR, decompose first.
83
+
84
+ ### Step 3: DOUBT — Invoke the fresh-context reviewer
85
+
86
+ The reviewer's prompt **must be adversarial**. Framing decides the answer.
87
+
88
+ ```
89
+ Adversarial review. Find what is wrong with this artifact.
90
+ Assume the author is overconfident. Look for:
91
+ - Unstated assumptions
92
+ - Edge cases not handled
93
+ - Hidden coupling or shared state
94
+ - Ways the contract could be violated
95
+ - Existing conventions this might break
96
+ - Failure modes under unexpected input
97
+
98
+ Do NOT validate. Do NOT summarize. Find issues, or state
99
+ explicitly that you cannot find any after thorough examination.
100
+
101
+ ARTIFACT: <paste artifact>
102
+ CONTRACT: <paste contract>
103
+ ```
104
+
105
+ **Pass ARTIFACT + CONTRACT only. Do NOT pass the CLAIM.** Handing the reviewer your conclusion biases it toward agreement. The reviewer must independently determine whether the artifact satisfies the contract.
106
+
107
+ ### Step 4: RECONCILE — Fold findings back
108
+
109
+ The reviewer's output is data, not verdict. **You are still the orchestrator.** Re-read the artifact text against each finding before classifying — rubber-stamping the reviewer is the same failure mode as ignoring it.
110
+
111
+ For each finding, classify in this **precedence order** (first matching class wins):
112
+
113
+ 1. **Contract misread** — reviewer flagged something specifically because the CONTRACT you provided was unclear or incomplete. Fix the contract first, re-classify on the next cycle.
114
+ 2. **Valid + actionable** — real issue requiring a change to the artifact. Change it, re-loop.
115
+ 3. **Valid trade-off** — issue is real but cost of fixing exceeds cost of accepting. Document the trade-off explicitly so the user sees it.
116
+ 4. **Noise** — reviewer flagged something that's actually correct under context the reviewer didn't have. Note it, move on, and ask: would adding that context to the contract have prevented the false flag?
117
+
118
+ A fresh reviewer can be wrong because it lacks context. Don't defer just because it's "fresh."
119
+
120
+ ### Step 5: STOP — Bounded loop, not recursion
121
+
122
+ Stop when:
123
+
124
+ - Next iteration returns only trivial or already-considered findings, **or**
125
+ - 3 cycles completed (escalate to user, don't grind a fourth alone), **or**
126
+ - User explicitly says "ship it"
127
+
128
+ If after 3 cycles the reviewer still surfaces substantive issues, the artifact may not be ready. Surface this to the user — three unresolved cycles is information about the artifact, not a reason to keep looping.
129
+
130
+ If 3 cycles is "obviously insufficient" because the artifact is large: the artifact is too big — return to Step 2 and decompose. Do not lift the bound.
131
+
132
+ ## Common Rationalizations
133
+
134
+ | Rationalization | Reality |
135
+ |---|---|
136
+ | "I'm confident, skip the doubt step" | Confidence correlates poorly with correctness on novel problems. |
137
+ | "Spawning a reviewer is expensive" | Debugging a wrong commit in production is more expensive. |
138
+ | "The reviewer will just nitpick" | Only if unscoped. Constrain the prompt to issues that would make this fail under the contract. |
139
+ | "I'll do doubt at the end with `/review`" | `/review` is a final gate. Doubt-driven catches wrong directions early. |
140
+ | "If I doubt every step I'll never ship" | The skill applies to non-trivial decisions, not every keystroke. |
141
+
142
+ ## Red Flags
143
+
144
+ - Spawning a fresh-context reviewer for a one-line rename or formatting change
145
+ - Treating reviewer output as authoritative without re-reading the artifact text
146
+ - Looping >3 cycles without escalating to the user
147
+ - Prompting the reviewer with "is this good?" instead of "find issues"
148
+ - Skipping doubt under time pressure on a high-stakes decision
149
+ - Passing the CLAIM to the reviewer (biases toward agreement)
150
+ - Stripping the contract from the reviewer's input
151
+
152
+ ## Interaction with Other Skills
153
+
154
+ - **`/review`**: complementary. `/review` is post-hoc PR verdict; doubt-driven is in-flight per-decision. Use both.
155
+ - **`source-driven-development`**: SDD verifies *facts about frameworks* against official docs. Doubt-driven verifies *your reasoning about the artifact*.
156
+ - **`test-driven-development`**: TDD's RED step is doubt made concrete — a failing test is a disproof attempt. When TDD applies, that failing test *is* the doubt step for behavioral claims.
157
+ - **`debugging-and-error-recovery`**: when the reviewer surfaces a real failure mode, drop into the debugging skill to localize and fix.
158
+
159
+ ## Verification
160
+
161
+ After applying doubt-driven development:
162
+
163
+ - [ ] Every non-trivial decision was named explicitly as a CLAIM before standing
164
+ - [ ] At least one fresh-context review per non-trivial artifact
165
+ - [ ] The reviewer received ARTIFACT + CONTRACT — NOT the CLAIM, NOT your reasoning
166
+ - [ ] The reviewer's prompt was adversarial ("find issues"), not validating ("is it good")
167
+ - [ ] Findings were classified against the artifact text using the precedence: contract misread / actionable / trade-off / noise
168
+ - [ ] A stop condition was met (trivial findings, 3 cycles, or user override)
@@ -0,0 +1,232 @@
1
+ ---
2
+ name: iterative-retrieval
3
+ description: Pattern for progressively refining context retrieval to solve the subagent context problem. Use when spawning subagents that need codebase context they cannot predict upfront, or when building multi-agent workflows where context is progressively refined.
4
+ phase: operate
5
+ domains:
6
+ - orchestration
7
+ - context-management
8
+ - research
9
+ stacks:
10
+ - any
11
+ - harness
12
+ allowed_agents:
13
+ - lead
14
+ - researcher
15
+ - developer
16
+ surfaces:
17
+ - context-loading
18
+ - multi-agent-orchestration
19
+ skill_source: external
20
+ origin: affaan-m/ecc
21
+ status: active
22
+ ---
23
+
24
+ # Iterative Retrieval Pattern
25
+
26
+ Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
27
+
28
+ ## When to Use
29
+
30
+ - Spawning subagents that need codebase context they cannot predict upfront
31
+ - Building multi-agent workflows where context is progressively refined
32
+ - Encountering "context too large" or "missing context" failures in agent tasks
33
+ - Designing RAG-like retrieval pipelines for code exploration
34
+ - Optimizing token usage in agent orchestration
35
+
36
+ ## The Problem
37
+
38
+ Subagents are spawned with limited context. They don't know:
39
+ - Which files contain relevant code
40
+ - What patterns exist in the codebase
41
+ - What terminology the project uses
42
+
43
+ Standard approaches fail:
44
+ - **Send everything**: Exceeds context limits
45
+ - **Send nothing**: Agent lacks critical information
46
+ - **Guess what's needed**: Often wrong
47
+
48
+ ## The Solution: Iterative Retrieval
49
+
50
+ A 4-phase loop that progressively refines context:
51
+
52
+ ```
53
+ ┌─────────────────────────────────────────────┐
54
+ │ │
55
+ │ ┌──────────┐ ┌──────────┐ │
56
+ │ │ DISPATCH │─────│ EVALUATE │ │
57
+ │ └──────────┘ └──────────┘ │
58
+ │ ▲ │ │
59
+ │ │ ▼ │
60
+ │ ┌──────────┐ ┌──────────┐ │
61
+ │ │ LOOP │─────│ REFINE │ │
62
+ │ └──────────┘ └──────────┘ │
63
+ │ │
64
+ │ Max 3 cycles, then proceed │
65
+ └─────────────────────────────────────────────┘
66
+ ```
67
+
68
+ ### Phase 1: DISPATCH
69
+
70
+ Initial broad query to gather candidate files:
71
+
72
+ ```javascript
73
+ // Start with high-level intent
74
+ const initialQuery = {
75
+ patterns: ['src/**/*.ts', 'lib/**/*.ts'],
76
+ keywords: ['authentication', 'user', 'session'],
77
+ excludes: ['*.test.ts', '*.spec.ts']
78
+ };
79
+
80
+ // Dispatch to retrieval agent
81
+ const candidates = await retrieveFiles(initialQuery);
82
+ ```
83
+
84
+ ### Phase 2: EVALUATE
85
+
86
+ Assess retrieved content for relevance:
87
+
88
+ ```javascript
89
+ function evaluateRelevance(files, task) {
90
+ return files.map(file => ({
91
+ path: file.path,
92
+ relevance: scoreRelevance(file.content, task),
93
+ reason: explainRelevance(file.content, task),
94
+ missingContext: identifyGaps(file.content, task)
95
+ }));
96
+ }
97
+ ```
98
+
99
+ Scoring criteria:
100
+ - **High (0.8-1.0)**: Directly implements target functionality
101
+ - **Medium (0.5-0.7)**: Contains related patterns or types
102
+ - **Low (0.2-0.4)**: Tangentially related
103
+ - **None (0-0.2)**: Not relevant, exclude
104
+
105
+ ### Phase 3: REFINE
106
+
107
+ Update search criteria based on evaluation:
108
+
109
+ ```javascript
110
+ function refineQuery(evaluation, previousQuery) {
111
+ return {
112
+ // Add new patterns discovered in high-relevance files
113
+ patterns: [...previousQuery.patterns, ...extractPatterns(evaluation)],
114
+
115
+ // Add terminology found in codebase
116
+ keywords: [...previousQuery.keywords, ...extractKeywords(evaluation)],
117
+
118
+ // Exclude confirmed irrelevant paths
119
+ excludes: [...previousQuery.excludes, ...evaluation
120
+ .filter(e => e.relevance < 0.2)
121
+ .map(e => e.path)
122
+ ],
123
+
124
+ // Target specific gaps
125
+ focusAreas: evaluation
126
+ .flatMap(e => e.missingContext)
127
+ .filter(unique)
128
+ };
129
+ }
130
+ ```
131
+
132
+ ### Phase 4: LOOP
133
+
134
+ Repeat with refined criteria (max 3 cycles):
135
+
136
+ ```javascript
137
+ async function iterativeRetrieve(task, maxCycles = 3) {
138
+ let query = createInitialQuery(task);
139
+ let bestContext = [];
140
+
141
+ for (let cycle = 0; cycle < maxCycles; cycle++) {
142
+ const candidates = await retrieveFiles(query);
143
+ const evaluation = evaluateRelevance(candidates, task);
144
+
145
+ // Check if we have sufficient context
146
+ const highRelevance = evaluation.filter(e => e.relevance >= 0.7);
147
+ if (highRelevance.length >= 3 && !hasCriticalGaps(evaluation)) {
148
+ return highRelevance;
149
+ }
150
+
151
+ // Refine and continue
152
+ query = refineQuery(evaluation, query);
153
+ bestContext = mergeContext(bestContext, highRelevance);
154
+ }
155
+
156
+ return bestContext;
157
+ }
158
+ ```
159
+
160
+ ## Practical Examples
161
+
162
+ ### Example 1: Bug Fix Context
163
+
164
+ ```
165
+ Task: "Fix the authentication token expiry bug"
166
+
167
+ Cycle 1:
168
+ DISPATCH: Search for "token", "auth", "expiry" in src/**
169
+ EVALUATE: Found auth.ts (0.9), tokens.ts (0.8), user.ts (0.3)
170
+ REFINE: Add "refresh", "jwt" keywords; exclude user.ts
171
+
172
+ Cycle 2:
173
+ DISPATCH: Search refined terms
174
+ EVALUATE: Found session-manager.ts (0.95), jwt-utils.ts (0.85)
175
+ REFINE: Sufficient context (2 high-relevance files)
176
+
177
+ Result: auth.ts, tokens.ts, session-manager.ts, jwt-utils.ts
178
+ ```
179
+
180
+ ### Example 2: Feature Implementation
181
+
182
+ ```
183
+ Task: "Add rate limiting to API endpoints"
184
+
185
+ Cycle 1:
186
+ DISPATCH: Search "rate", "limit", "api" in routes/**
187
+ EVALUATE: No matches - codebase uses "throttle" terminology
188
+ REFINE: Add "throttle", "middleware" keywords
189
+
190
+ Cycle 2:
191
+ DISPATCH: Search refined terms
192
+ EVALUATE: Found throttle.ts (0.9), middleware/index.ts (0.7)
193
+ REFINE: Need router patterns
194
+
195
+ Cycle 3:
196
+ DISPATCH: Search "router", "express" patterns
197
+ EVALUATE: Found router-setup.ts (0.8)
198
+ REFINE: Sufficient context
199
+
200
+ Result: throttle.ts, middleware/index.ts, router-setup.ts
201
+ ```
202
+
203
+ ## Integration with OpenCode Agents
204
+
205
+ Use in agent handoffs:
206
+
207
+ ```markdown
208
+ When retrieving context for this task:
209
+ 1. Start with broad keyword search
210
+ 2. Evaluate each file's relevance (0-1 scale)
211
+ 3. Identify what context is still missing
212
+ 4. Refine search criteria and repeat (max 3 cycles)
213
+ 5. Return files with relevance >= 0.7
214
+ ```
215
+
216
+ ## Best Practices
217
+
218
+ 1. **Start broad, narrow progressively** - Don't over-specify initial queries
219
+ 2. **Learn codebase terminology** - First cycle often reveals naming conventions
220
+ 3. **Track what's missing** - Explicit gap identification drives refinement
221
+ 4. **Stop at "good enough"** - 3 high-relevance files beats 10 mediocre ones
222
+ 5. **Exclude confidently** - Low-relevance files won't become relevant
223
+
224
+ ## Verification
225
+
226
+ After applying iterative retrieval:
227
+
228
+ - [ ] Initial broad query was dispatched before narrowing
229
+ - [ ] Each cycle scored relevance and identified gaps
230
+ - [ ] Search criteria were refined based on findings (not repeated)
231
+ - [ ] Maximum 3 cycles were used before proceeding
232
+ - [ ] Returned context includes files with relevance >= 0.7
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: open-design
3
+ description: Use the Open Design workbench to create editable visual projects, prototypes, landing pages, dashboards, mobile screens, decks, and implementation handoffs.
4
+ compatibility: opencode
5
+ metadata:
6
+ surface: visual-design
7
+ backend: open-design
8
+ phase: build
9
+ domains:
10
+ - ui-ux
11
+ stacks:
12
+ - open-design
13
+ allowed_agents:
14
+ - designer
15
+ - lead
16
+ - developer
17
+ surfaces:
18
+ - visual-design
19
+ - prototyping
20
+ skill_source: built-in
21
+ origin: null
22
+ status: active
23
+ ---
24
+
25
+ # Open Design Skill
26
+
27
+ Use this skill for visual design, UX/UI, prototypes, product visuals, landing pages, dashboards, pricing pages, docs pages, mobile screens, onboarding, decks, and design handoff.
28
+
29
+ ## OPEN_DESIGN_URL
30
+
31
+ The workbench URL is configured with `OPEN_DESIGN_URL`.
32
+
33
+ Valid examples:
34
+
35
+ - `https://open-design.example.com`
36
+ - `http://192.168.1.50:7456`
37
+
38
+ Invalid examples:
39
+
40
+ - `https://open-design.example.com/projects/my-project`
41
+ - `https://open-design.example.com/projects/my-project/files/index.html`
42
+
43
+ Resolve the tool `baseUrl` from approved configuration or explicit user/lead-provided context before calling Open Design tools. Do not invent, guess, or hardcode a URL. If no approved `baseUrl` is available, stop and ask for the missing configuration/context instead of trying a fallback.
44
+
45
+ ## PRODUCT.md and DESIGN.md
46
+
47
+ Before using Open Design, inspect the repository for `PRODUCT.md` and `DESIGN.md` or equivalent docs.
48
+
49
+ If present, they are authoritative. If one or both are missing, the designer should use the optional `impeccable` skill first to create or propose missing context.
50
+
51
+ ## Tools
52
+
53
+ Use only the Open Design tools:
54
+
55
+ - `open_design_health`
56
+ - `open_design_list_agents`
57
+ - `open_design_list_skills`
58
+ - `open_design_list_design_systems`
59
+ - `open_design_create_project`
60
+ - `open_design_run_design`
61
+
62
+ Pass the resolved `baseUrl` to every Open Design tool call, including health,
63
+ list, create, and run calls.
64
+
65
+ ## Modes
66
+
67
+ ### Workbench
68
+
69
+ Default mode. Use `open_design_create_project` to create an editable project and return its URL.
70
+
71
+ ### Direct generation
72
+
73
+ Use only when the user explicitly asks to generate the design. Call `open_design_run_design` and return generated files when available.
74
+
75
+ ### Handoff
76
+
77
+ When no project is needed, return a design brief, Open Design prompt, implementation notes, risks, assumptions, and visual acceptance criteria.
78
+
79
+ ## Skill mapping
80
+
81
+ - SaaS landing: `saas-landing`
82
+ - Generic web prototype: `web-prototype`
83
+ - Dashboard: `dashboard`
84
+ - Pricing: `pricing-page`
85
+ - Docs page: `docs-page`
86
+ - Blog/editorial: `blog-post`
87
+ - Mobile app: `mobile-app`
88
+ - Mobile onboarding: `mobile-onboarding`
89
+ - Deck: `simple-deck` or `guizang-ppt`
90
+ - Product spec: `pm-spec`
91
+ - Motion frames: `motion-frames`
92
+ - Email marketing: `email-marketing`
93
+ - Social carousel: `social-carousel`
94
+
95
+ ## Suggested design systems
96
+
97
+ Use the system named by `DESIGN.md` when possible. Otherwise choose intentionally:
98
+
99
+ - Developer/SaaS: `linear`, `vercel`, `stripe`, `cursor`, `supabase`, `resend`, `raycast`
100
+ - Consumer/productivity: `apple`, `notion`, `airbnb`, `figma`
101
+ - Neutral baseline: `neutral-modern` or `default`
102
+
103
+ ## Anti-slop rules
104
+
105
+ Avoid generic gradients, fake metrics, fake testimonials, unsupported brand colors, meaningless glassmorphism, nested cards without hierarchy, weak hero sections, inconsistent spacing, and vague startup copy.
106
+
107
+ Prefer strong hierarchy, credible content, restrained palettes, responsive behavior, implementable components, accessible contrast, realistic states, deliberate typography, and product-specific interactions.
108
+
109
+ ## Required output
110
+
111
+ Always return:
112
+
113
+ 1. Design goal.
114
+ 2. Repository documents used.
115
+ 3. Whether Impeccable was needed.
116
+ 4. Selected Open Design skill.
117
+ 5. Selected design system.
118
+ 6. Visual direction.
119
+ 7. Open Design project URL when created.
120
+ 8. Generated files when available.
121
+ 9. Prompt used or proposed.
122
+ 10. Developer handoff.
123
+ 11. Assumptions, risks, and deviations.