oc-harness-setup 0.3.3 → 0.4.1

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 (136) hide show
  1. package/.docs/unwired-routing.md +16 -15
  2. package/AGENTS.md +105 -68
  3. package/CHANGELOG.md +107 -0
  4. package/GLOSSARY.md +46 -0
  5. package/LICENSE +1 -1
  6. package/README.md +49 -60
  7. package/agents/cleaner.md +86 -0
  8. package/agents/critic.md +79 -0
  9. package/agents/historian.md +92 -0
  10. package/agents/maintainer.md +106 -0
  11. package/agents/ops.md +69 -0
  12. package/agents/orchestrator.md +48 -18
  13. package/agents/researcher.md +72 -0
  14. package/agents/verifier.md +84 -0
  15. package/agents/worker.md +87 -0
  16. package/bin/cli.js +360 -133
  17. package/commands/close.md +11 -0
  18. package/commands/evolve.md +11 -0
  19. package/commands/fast.md +11 -0
  20. package/commands/goal.md +11 -0
  21. package/commands/search.md +11 -0
  22. package/commands/swarm.md +11 -0
  23. package/opencode.jsonc +39 -79
  24. package/package.json +13 -6
  25. package/reference/README.md +12 -14
  26. package/reference/canon.md +71 -0
  27. package/reference/context.md +35 -0
  28. package/reference/enforcement.md +6 -0
  29. package/reference/flow.md +19 -0
  30. package/reference/gates.md +23 -0
  31. package/reference/harness.md +15 -0
  32. package/reference/hygiene.md +13 -0
  33. package/reference/memory.md +13 -0
  34. package/reference/models.md +19 -24
  35. package/reference/phases.md +23 -0
  36. package/reference/repos.md +49 -0
  37. package/reference/tools.md +35 -0
  38. package/scripts/harness-doctor.ps1 +83 -0
  39. package/skills/close/SKILL.md +36 -0
  40. package/skills/evolve/SKILL.md +76 -0
  41. package/skills/fast/SKILL.md +36 -0
  42. package/skills/goal/SKILL.md +65 -0
  43. package/skills/search/SKILL.md +68 -0
  44. package/skills/swarm/SKILL.md +69 -0
  45. package/state-seed/lessons.md +22 -0
  46. package/state-seed/template.md +12 -0
  47. package/agents/build.md +0 -20
  48. package/agents/explore.md +0 -26
  49. package/agents/general.md +0 -19
  50. package/agents/plan.md +0 -29
  51. package/agents/reviewer.md +0 -22
  52. package/agents/vault.md +0 -73
  53. package/commands/build.md +0 -7
  54. package/commands/checkpoint.md +0 -7
  55. package/commands/code-simplify.md +0 -7
  56. package/commands/gauntlet.md +0 -7
  57. package/commands/handoff.md +0 -7
  58. package/commands/keeper.md +0 -7
  59. package/commands/kill.md +0 -11
  60. package/commands/plan.md +0 -7
  61. package/commands/retro.md +0 -15
  62. package/commands/review.md +0 -7
  63. package/commands/ship.md +0 -7
  64. package/commands/spec.md +0 -7
  65. package/commands/test.md +0 -7
  66. package/commands/webperf.md +0 -7
  67. package/reference/auto-mandate.md +0 -11
  68. package/reference/backup-convention.md +0 -9
  69. package/reference/clean-mandate.md +0 -13
  70. package/reference/editor-parity.md +0 -7
  71. package/reference/gc-scripts.md +0 -8
  72. package/reference/intent-routing.md +0 -14
  73. package/reference/lifecycle.md +0 -15
  74. package/reference/model-keeper.md +0 -46
  75. package/reference/model-test.md +0 -176
  76. package/reference/oc-source-map.md +0 -162
  77. package/reference/owner-pin.md +0 -31
  78. package/reference/roster.md +0 -15
  79. package/reference/session-scope.md +0 -9
  80. package/reference/session-state.md +0 -13
  81. package/reference/swarm.md +0 -32
  82. package/scripts/backup-config.ps1 +0 -42
  83. package/scripts/gc-branch.ps1 +0 -196
  84. package/scripts/gc-bump.ps1 +0 -198
  85. package/scripts/gc-clean.ps1 +0 -648
  86. package/scripts/gc-commit.ps1 +0 -143
  87. package/scripts/gc-merge.ps1 +0 -272
  88. package/scripts/gc-pr.ps1 +0 -190
  89. package/scripts/gc-push.ps1 +0 -111
  90. package/scripts/gc-read.ps1 +0 -150
  91. package/scripts/gc-rebase.ps1 +0 -162
  92. package/scripts/gc-release.ps1 +0 -225
  93. package/scripts/gc-stage.ps1 +0 -103
  94. package/scripts/gc-status.ps1 +0 -127
  95. package/scripts/gc-sync.ps1 +0 -65
  96. package/scripts/gc.core.ps1 +0 -715
  97. package/scripts/gc.smoke.ps1 +0 -779
  98. package/scripts/interrupt-session.ps1 +0 -65
  99. package/scripts/logbook/README.md +0 -108
  100. package/scripts/logbook/logbook.test.ts +0 -440
  101. package/scripts/logbook/logbook.ts +0 -797
  102. package/scripts/pirep/README.md +0 -147
  103. package/scripts/pirep/pirep.test.ts +0 -735
  104. package/scripts/pirep/pirep.ts +0 -836
  105. package/scripts/testflight/README.md +0 -112
  106. package/scripts/testflight/testflight.test.ts +0 -512
  107. package/scripts/testflight/testflight.ts +0 -806
  108. package/skills/_shared/SOURCES.md +0 -26
  109. package/skills/_shared/references/accessibility-checklist.md +0 -160
  110. package/skills/_shared/references/definition-of-done.md +0 -67
  111. package/skills/_shared/references/observability-checklist.md +0 -92
  112. package/skills/_shared/references/orchestration-patterns.md +0 -155
  113. package/skills/_shared/references/performance-checklist.md +0 -236
  114. package/skills/_shared/references/security-checklist.md +0 -245
  115. package/skills/_shared/references/testing-patterns.md +0 -235
  116. package/skills/api-and-interface-design/SKILL.md +0 -14
  117. package/skills/browser-testing-with-devtools/SKILL.md +0 -303
  118. package/skills/code-simplification/SKILL.md +0 -14
  119. package/skills/creative-writing/SKILL.md +0 -96
  120. package/skills/debugging-and-error-recovery/SKILL.md +0 -15
  121. package/skills/flight-deck/SKILL.md +0 -17
  122. package/skills/frontend-ui-engineering/SKILL.md +0 -16
  123. package/skills/gauntlet/SKILL.md +0 -21
  124. package/skills/git-ceremony/SKILL.md +0 -27
  125. package/skills/grilling/SKILL.md +0 -18
  126. package/skills/observability-and-instrumentation/SKILL.md +0 -18
  127. package/skills/performance-optimization/SKILL.md +0 -16
  128. package/skills/pilot-report/SKILL.md +0 -18
  129. package/skills/planning-and-task-breakdown/SKILL.md +0 -16
  130. package/skills/security-and-hardening/SKILL.md +0 -18
  131. package/skills/source-driven-development/SKILL.md +0 -16
  132. package/skills/spec-driven-development/SKILL.md +0 -26
  133. package/skills/test-driven-development/SKILL.md +0 -18
  134. package/skills/test-flight/SKILL.md +0 -14
  135. package/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
  136. package/skills/writing-for-agents/SKILL.md +0 -89
@@ -1,26 +0,0 @@
1
- # Local Skill Layer — Sources
2
-
3
- This directory is the local, self-contained skill layer. Upstream material was inspected, adapted to this harness, and is owned locally; runtime does not depend on external checkouts.
4
-
5
- | Source | Revision inspected (pinned) | Used for |
6
- |--------|------------------------------|----------|
7
- | `DietrichGebert/ponytail` (v4.9.0) | `356918eba965ee1eac64bd3a7f0dd02108350de5` | `code-simplification` (explicit behavior-preserving editing workflow) |
8
- | `addyosmani/agent-skills` | `6ca0cd7db39b41b1c37e26d335c507ee92382c6d` | Active local workflow skills listed below |
9
- | `mattpocock/skills` | `3cca18b368ae95cdbdebbff572ccafa662551015` | `grilling`, `writing-for-agents`, and `creative-writing` (modes from `writing-fragments` / `writing-beats` / `writing-shape`) |
10
-
11
- `_shared/references/` mirrors the upstream `references/` checklists from the same addyosmani/agent-skills revision; all skills link to them via `../_shared/references/...` instead of the upstream `../../references/...` paths.
12
-
13
- Transformations applied:
14
-
15
- - Frontmatter normalized to OpenCode V2 (`name`, `description`, optional `metadata`). Low-frequency / collision-prone skills are marked `metadata.opencode.autoinvoke: false` (explicit-only).
16
- - All `../../references/...` links rewritten to `../_shared/references/...`.
17
- - Harness adaptations: `$ARGUMENTS` references are command-template aware; upstream scripts, adapters, plugins, hooks, and repo-specific policy files are not runtime dependencies.
18
- - Ponytail adaptations: no plugin hooks, mode tracker, server code, or benchmark scoreboard. Explicit simplification lives in `code-simplification`.
19
- - Orchestration is owned by `~/.config/opencode/agents/orchestrator.md`; the former orchestration, incremental-build, and review entrypoints were folded into role prompts and removed.
20
- - Mattpocock adaptations use OpenCode's explicit-only marker where appropriate; `CLAUDE.md` references are normalized to `AGENTS.md`. The `SKILL-MECHANICS.md` sibling remains the mechanics reference.
21
-
22
- Active Addy-derived IDs: `api-and-interface-design`, `code-simplification`, `debugging-and-error-recovery`, `frontend-ui-engineering`, `observability-and-instrumentation`, `performance-optimization`, `planning-and-task-breakdown`, `security-and-hardening`, `source-driven-development`, `spec-driven-development`, and `test-driven-development`.
23
-
24
- Active Mattpocock-derived IDs: `grilling`, `writing-for-agents`, and `creative-writing`. Local/adapted without a pinned upstream: `git-ceremony`.
25
-
26
- Runtime boundary: descriptions advertise routing conditions; exact procedures load only when matched. Commands use exact IDs for explicit-only workflows.
@@ -1,160 +0,0 @@
1
- # Accessibility Checklist
2
-
3
- Quick reference for WCAG 2.1 AA compliance. Use alongside the `frontend-ui-engineering` skill.
4
-
5
- ## Table of Contents
6
-
7
- - [Essential Checks](#essential-checks)
8
- - [Common HTML Patterns](#common-html-patterns)
9
- - [Testing Tools](#testing-tools)
10
- - [Quick Reference: ARIA Live Regions](#quick-reference-aria-live-regions)
11
- - [Common Anti-Patterns](#common-anti-patterns)
12
-
13
- ## Essential Checks
14
-
15
- ### Keyboard Navigation
16
- - [ ] All interactive elements focusable via Tab key
17
- - [ ] Focus order follows visual/logical order
18
- - [ ] Focus is visible (outline/ring on focused elements)
19
- - [ ] Custom widgets have keyboard support (Enter to activate, Escape to close)
20
- - [ ] No keyboard traps (user can always Tab away from a component)
21
- - [ ] Skip-to-content link at top of page - visible (at least) on keyboard focus
22
- - [ ] Modals trap focus while open, return focus on close
23
-
24
- ### Screen Readers
25
- - [ ] All images have `alt` text (or `alt=""` for decorative images)
26
- - [ ] All form inputs have associated labels (`<label>` or `aria-label`)
27
- - [ ] Buttons and links have descriptive text (not "Click here")
28
- - [ ] Icon-only buttons have `aria-label`
29
- - [ ] Page has one `<h1>` and headings don't skip levels
30
- - [ ] Dynamic content changes announced (`aria-live` regions)
31
- - [ ] Tables have `<th>` headers with scope
32
-
33
- ### Visual
34
- - [ ] Text contrast ≥ 4.5:1 (normal text) or ≥ 3:1 (large text, 18px+)
35
- - [ ] UI components contrast ≥ 3:1 against background
36
- - [ ] Color is not the only way to convey information
37
- - [ ] Text resizable to 200% without breaking layout
38
- - [ ] No content that flashes more than 3 times per second
39
-
40
- ### Forms
41
- - [ ] Every input has a visible label
42
- - [ ] Required fields indicated (not by color alone)
43
- - [ ] Error messages specific and associated with the field
44
- - [ ] Error state visible by more than color (icon, text, border)
45
- - [ ] Form submission errors summarized and focusable
46
- - [ ] Known fields use autocomplete (for example `type="email" autocomplete="email"`)
47
-
48
- ### Content
49
- - [ ] Language declared (`<html lang="en">`)
50
- - [ ] Page has a descriptive `<title>`
51
- - [ ] Links distinguish from surrounding text (not by color alone)
52
- - [ ] Touch targets ≥ 44x44px on mobile
53
- - [ ] Meaningful empty states (not blank screens)
54
-
55
- ## Common HTML Patterns
56
-
57
- ### Buttons vs. Links
58
-
59
- ```html
60
- <!-- Use <button> for actions -->
61
- <button onClick={handleDelete}>Delete Task</button>
62
-
63
- <!-- Use <a> for navigation -->
64
- <a href="/tasks/123">View Task</a>
65
-
66
- <!-- NEVER use div/span as buttons -->
67
- <div onClick={handleDelete}>Delete</div> <!-- BAD -->
68
- ```
69
-
70
- ### Form Labels
71
-
72
- ```html
73
- <!-- Explicit label association -->
74
- <label htmlFor="email">Email address</label>
75
- <input id="email" type="email" required />
76
-
77
- <!-- Implicit wrapping -->
78
- <label>
79
- Email address
80
- <input type="email" required />
81
- </label>
82
-
83
- <!-- Hidden label (visible label preferred) -->
84
- <input type="search" aria-label="Search tasks" />
85
- ```
86
-
87
- ### ARIA Roles
88
-
89
- ```html
90
- <!-- Navigation -->
91
- <nav aria-label="Main navigation">...</nav>
92
- <nav aria-label="Footer links">...</nav>
93
-
94
- <!-- Status messages -->
95
- <div role="status" aria-live="polite">Task saved</div>
96
-
97
- <!-- Alert messages -->
98
- <div role="alert">Error: Title is required</div>
99
-
100
- <!-- Modal dialogs -->
101
- <dialog aria-modal="true" aria-labelledby="dialog-title">
102
- <h2 id="dialog-title">Confirm Delete</h2>
103
- ...
104
- </dialog>
105
-
106
- <!-- Loading states -->
107
- <div aria-busy="true" aria-label="Loading tasks">
108
- <Spinner />
109
- </div>
110
- ```
111
-
112
- ### Accessible Lists
113
-
114
- ```html
115
- <ul role="list" aria-label="Tasks">
116
- <li>
117
- <input type="checkbox" id="task-1" aria-label="Complete: Buy groceries" />
118
- <label htmlFor="task-1">Buy groceries</label>
119
- </li>
120
- </ul>
121
- ```
122
-
123
- ## Testing Tools
124
-
125
- ```bash
126
- # Automated audit
127
- npx axe-core # Programmatic accessibility testing
128
- npx pa11y # CLI accessibility checker
129
-
130
- # In browser
131
- # Chrome DevTools → Lighthouse → Accessibility
132
- # Chrome DevTools → Elements → Accessibility tree
133
-
134
- # Screen reader testing
135
- # macOS: VoiceOver (Cmd + F5)
136
- # Windows: NVDA (free) or JAWS
137
- # Linux: Orca
138
- ```
139
-
140
- ## Quick Reference: ARIA Live Regions
141
-
142
- | Value | Behavior | Use For |
143
- |-------|----------|---------|
144
- | `aria-live="polite"` | Announced at next pause | Status updates, saved confirmations |
145
- | `aria-live="assertive"` | Announced immediately | Errors, time-sensitive alerts |
146
- | `role="status"` | Same as `polite` | Status messages |
147
- | `role="alert"` | Same as `assertive` | Error messages |
148
-
149
- ## Common Anti-Patterns
150
-
151
- | Anti-Pattern | Problem | Fix |
152
- |---|---|---|
153
- | `div` as button | Not focusable, no keyboard support | Use `<button>` |
154
- | Missing `alt` text | Images invisible to screen readers | Add descriptive `alt` |
155
- | Color-only states | Invisible to color-blind users | Add icons, text, or patterns |
156
- | Autoplaying media | Disorienting, can't be stopped | Add controls, don't autoplay |
157
- | Custom dropdown with no ARIA | Unusable by keyboard/screen reader | Use native `<select>` or proper ARIA listbox |
158
- | Removing focus outlines | Users can't see where they are | Style outlines, don't remove them |
159
- | Empty links/buttons | "Link" announced with no description | Add text or `aria-label` |
160
- | `tabindex > 0` | Breaks natural tab order | Use `tabindex="0"` or `-1` only |
@@ -1,67 +0,0 @@
1
- # Definition of Done
2
-
3
- A standing, project-wide bar that every change must clear before it counts as done. Unlike acceptance criteria, which vary per task and answer "did we build the right thing?", the Definition of Done is the same every time and answers "is this finished to our standard?". Use it as the final gate in `planning-and-task-breakdown`, `test-driven-development`, and the ship review.
4
-
5
- ## Definition of Done vs. Acceptance Criteria
6
-
7
- | | Acceptance Criteria | Definition of Done |
8
- |---|---|---|
9
- | Scope | Specific to one task or spec | Applies to every increment |
10
- | Changes | Different for each item | Fixed and reused |
11
- | Answers | "Did we build *this thing*?" | "Is it *ready*?" |
12
- | Owner | Defined when planning the task | Defined once for the project |
13
- | Example | "User can reset password via email link" | "Tests pass, no regressions, docs updated" |
14
-
15
- The two are complementary. A task is done only when **its** acceptance criteria are met **and** the standing Definition of Done is satisfied. Skipping either leaves work that looks finished but is not.
16
-
17
- ## The Standing Checklist
18
-
19
- Apply this to every change before declaring it done.
20
-
21
- ### Correctness
22
- - [ ] All acceptance criteria for the task are met
23
- - [ ] Code runs and behaves as intended, verified at runtime, not just compiled or typechecked
24
- - [ ] New behavior is covered by tests that fail without the change and pass with it
25
- - [ ] Existing tests still pass; no regressions introduced
26
- - [ ] Edge cases and error paths are handled, not just the happy path
27
-
28
- ### Quality
29
- - [ ] Code reveals intent through naming and structure; no comments needed to explain *what* it does
30
- - [ ] No duplicated business logic
31
- - [ ] No dead code, debug output, or commented-out blocks left behind
32
- - [ ] Changes are scoped to the task; no unrelated refactors snuck in
33
- - [ ] Linting and formatting pass
34
-
35
- The depth behind these items lives in `code-simplification` (reducing complexity without changing behavior).
36
-
37
- ### Integration
38
- - [ ] Change works with the rest of the system, not just in isolation
39
- - [ ] Database migrations, config changes, and feature flags are accounted for
40
- - [ ] Backward compatibility considered for any public interface or API change
41
-
42
- ### Documentation
43
- - [ ] Public interfaces, APIs, and user-facing behavior are documented
44
- - [ ] Architectural decisions worth preserving are recorded in the project's durable documentation
45
- - [ ] Documentation describes the current state in timeless language, not the change history
46
-
47
- ### Ship-readiness
48
- - [ ] Security implications reviewed for any untrusted input, auth, or data handling (see `security-and-hardening`)
49
- - [ ] Observability in place for new critical paths (logs, metrics, traces) (see `observability-and-instrumentation`)
50
- - [ ] Rollback path exists for anything risky and is named in the ship plan
51
- - [ ] The human has reviewed and approved before merge or deploy
52
-
53
- ## How to Apply
54
-
55
- - **Per task**: confirm the Correctness and Quality sections before checking the task off.
56
- - **Per feature**: confirm Integration and Documentation before considering the feature complete.
57
- - **Per release**: the full checklist is the floor; the repository's release runbook adds deploy-specific gates on top.
58
-
59
- Tailor the list to the project once, then reuse it unchanged. A Definition of Done that is renegotiated every sprint is not a Definition of Done.
60
-
61
- ## Red Flags
62
-
63
- - "It's done, I just haven't run it yet": unverified work is not done.
64
- - "Tests pass" used as a synonym for done while docs, regressions, or runtime verification are skipped.
65
- - A different bar applied depending on deadline pressure.
66
- - Acceptance criteria treated as the whole bar, with no standing quality floor.
67
- - "Done" declared before human review on changes that need it.
@@ -1,92 +0,0 @@
1
- # Observability Checklist
2
-
3
- Quick reference for instrumenting production code. Use alongside the `observability-and-instrumentation` skill.
4
-
5
- ## Table of Contents
6
-
7
- - [On-Call Questions (Start Here)](#on-call-questions-start-here)
8
- - [Structured Logging](#structured-logging)
9
- - [Metrics](#metrics)
10
- - [Distributed Tracing](#distributed-tracing)
11
- - [Alerting](#alerting)
12
- - [Dashboards](#dashboards)
13
- - [Verify the Telemetry](#verify-the-telemetry)
14
- - [Pre-Launch Gate](#pre-launch-gate)
15
-
16
- ## On-Call Questions (Start Here)
17
-
18
- Telemetry without a question is noise. Before instrumenting anything:
19
-
20
- - [ ] 2–4 questions an on-call engineer will ask about this feature are written down
21
- - [ ] Every signal below maps to one of those questions
22
- - [ ] Each question is matched to the right signal type: metrics say **that** something is wrong, traces say **where**, logs say **why**
23
-
24
- ## Structured Logging
25
-
26
- - [ ] Logs are structured (JSON) with stable event names — not free-form strings
27
- - [ ] Every log line carries a correlation/request ID, generated or accepted at the system boundary
28
- - [ ] Correlation ID is propagated on every outbound call and async boundary (HTTP headers, queue metadata)
29
- - [ ] Any log stream written by more than one entry point (scheduler, replay endpoint, manual run) carries an entry-point field, set where the run starts and propagated alongside the correlation ID
30
- - [ ] Log levels are consistent: `error` = invariant broken, someone may act; `warn` = degraded but handled; `info` = significant business event; `debug` = off in production
31
- - [ ] No secrets, tokens, passwords, or unredacted PII in any log line (hard rule from `security-and-hardening`)
32
- - [ ] Fields are allowlisted — no whole request/response bodies, no auth headers
33
- - [ ] External service calls logged with metadata only: endpoint, status, latency, attempt count, sanitized identifiers
34
- - [ ] Actual log output spot-checked: structured fields, not `[object Object]`
35
-
36
- ## Metrics
37
-
38
- - [ ] **RED** instrumented for every endpoint and every external dependency: Rate, Errors, Duration
39
- - [ ] **USE** instrumented for every resource (queues, pools, hosts): Utilization, Saturation, Errors
40
- - [ ] Latency is a histogram; p50/p95/p99 queryable — never an average
41
- - [ ] All labels come from small, fixed sets (route template, status class, provider name)
42
- - [ ] No unbounded label values: no user IDs, tenant IDs, emails, raw URLs, request IDs, or error message text
43
- - [ ] Status codes grouped by class (`5xx`, not `503`)
44
- - [ ] Queue depth and processing duration tracked for every worker/queue
45
-
46
- ## Distributed Tracing
47
-
48
- - [ ] OpenTelemetry (or equivalent) initialized at service startup, before other imports
49
- - [ ] Auto-instrumentation enabled for HTTP, gRPC, and DB clients
50
- - [ ] Trace context propagated on every outbound call (W3C `traceparent`/`tracestate`) and extracted from every inbound request
51
- - [ ] Context survives async boundaries — queue messages carry trace metadata
52
- - [ ] Manual spans only around meaningful internal units of work, with the attributes on-call will filter by
53
- - [ ] No secrets or PII as span attributes
54
- - [ ] Head-based sampling at a low default rate; 100% of errors kept if tail sampling is available
55
-
56
- ## Alerting
57
-
58
- - [ ] Every alert is symptom-based (error rate, p99 latency, queue age) — causes (CPU, disk, restarts) go to dashboards, not pagers
59
- - [ ] Every alert is actionable; "ignore it, it self-heals" alerts are deleted
60
- - [ ] Every alert links to a runbook — minimum three lines: what it means, first query to run, escalation path
61
- - [ ] Thresholds and durations justified by an SLO or historical data, not guesses
62
- - [ ] Two severities only: **page** (user-facing, act now) and **ticket** (degradation, act this week)
63
- - [ ] Each new alert test-fired once: it reached the right channel and the runbook link works
64
- - [ ] No alerts that fire daily and get acknowledged without action
65
-
66
- ## Dashboards
67
-
68
- - [ ] Service health dashboard exists: error rate, latency p99, traffic, saturation
69
- - [ ] Dependency health panel shows per-service error rates and latency
70
- - [ ] Dashboard answers the on-call questions from the top of this checklist — not "everything except the answer"
71
- - [ ] Default time range is sensible (1h–6h, not 30d)
72
-
73
- ## Verify the Telemetry
74
-
75
- Instrumentation is code; it can be wrong:
76
-
77
- - [ ] Forced an error in staging → found it in the logs by correlation ID
78
- - [ ] Sent test traffic → metric series appear with expected labels and sane values
79
- - [ ] Followed one request end-to-end in the tracing UI → no broken spans
80
- - [ ] An induced failure was diagnosed from telemetry alone, without reading the source
81
-
82
- ## Pre-Launch Gate
83
-
84
- Before a feature ships to production, all of the following are true:
85
-
86
- - [ ] Structured logs flowing to the log aggregator
87
- - [ ] RED metrics visible in dashboards for every new endpoint and dependency
88
- - [ ] At least one symptom-based alert configured, with runbook, test-fired
89
- - [ ] A request can be traced across every service it touches
90
- - [ ] On-call knows where the runbooks are
91
-
92
- For launch-day monitoring sequence and rollback triggers, use the repository's ship command and release runbook.
@@ -1,155 +0,0 @@
1
- # Orchestration Patterns
2
-
3
- Local reference for this OpenCode V2 harness on Windows, adapted from the
4
- upstream reference. The governing rule is unchanged: **one level deep** —
5
- the lead may spawn helpers; helpers return findings and do not spawn
6
- grandchildren — and the multi-step pipeline stays user-driven: the user (or
7
- a slash command) drives define → plan → build → verify → review → ship and
8
- keeps the human checkpoints between steps. For a single request, the
9
- `master` agent leads and dispatches helpers but does not implement
10
- project code.
11
-
12
- ## Runtime boundaries
13
-
14
- - Global agents are Markdown files under `~/.config/opencode/agents/*.md`.
15
- - Commands are Markdown templates under `~/.config/opencode/commands/`.
16
- - Skills are loaded only when their exact ID is allowed by the config; the
17
- wildcard skill rule is deny, followed by exact allows for local skills.
18
- - There are no plugins, MCP servers, or HTTP skill catalogs in this harness.
19
- - `explore`, `reviewer`, `security-auditor`, `test-engineer`, and
20
- `web-performance-auditor` are read-only report producers (edit and
21
- subagent permissions denied; they report, they don't act). `documenter`
22
- and `keeper` write only their assigned artifacts.
23
- - Anti-patterns B and D below are blocked by construction in this harness:
24
- helpers cannot spawn grandchildren, so depth stays at most 1.
25
- - Parallel fan-out means launching multiple `subagent` calls together in one
26
- turn; sequential turns serialize execution.
27
-
28
- ## Endorsed patterns
29
-
30
- ### 1. Direct invocation (default)
31
-
32
- Use one helper for one perspective on one artifact. This is the default and
33
- the cheapest option.
34
-
35
- ```text
36
- lead → helper → report → lead
37
- ```
38
-
39
- **Use when:** one perspective on one artifact, describable in one sentence.
40
- The baseline to compare everything against — don't orchestrate what one
41
- focused agent can do.
42
-
43
- ### 2. Single-helper command
44
-
45
- Use a slash command when the same focused operation repeats. The command body
46
- should state the task and output contract, not decide which helper to call.
47
-
48
- **Anti-signal:** if the command's body is mostly "decide which helper to
49
- call," delete it and document the intent mapping in `AGENTS.md` instead.
50
-
51
- ### 3. Parallel fan-out with merge
52
-
53
- Use parallel child sessions only when the work is independent, each child has
54
- a distinct lens, and the lead can merge the reports without another routing
55
- layer. Independent helpers run on the same input, each producing its own
56
- report; the lead synthesizes in its own context.
57
-
58
- ```text
59
- ┌─→ reviewer ──────────┐
60
- lead ─ fan out ──┼─→ security-auditor ──┤→ lead merges → decision
61
- └─→ test-engineer ─────┘
62
- ```
63
-
64
- `/ship` uses this composition. Add `web-performance-auditor` when a web
65
- performance question is actually in scope. Each child gets a short brief with
66
- what, where, done, and how to prove it; children edit nothing.
67
-
68
- Before fanning out, check:
69
-
70
- - [ ] Sub-tasks genuinely independent (no shared mutable artifact, no
71
- ordering dependency)?
72
- - [ ] Each child answers a different question — a different *kind* of
73
- finding, not the same finding from another angle?
74
- - [ ] The lead has room to reconcile the reports (merge stays small enough
75
- for the lead's context)?
76
- - [ ] Parallelism saves meaningful wait time (wall-clock saving is
77
- noticeable)?
78
-
79
- If any answer is no, use direct invocation or a single-helper command.
80
-
81
- ### 4. User-driven lifecycle
82
-
83
- Dependent work stays visible and sequential: define → plan → build → verify →
84
- review → ship. The user runs the commands in order and makes the checkpoints;
85
- do not add a coordinator that merely paraphrases each step. No agent automates
86
- this whole pipeline — automating the full sequence loses human checkpoints,
87
- paraphrases away nuance between steps, and roughly doubles token cost.
88
- (A single request may still be led by the `master` agent, which
89
- dispatches helpers and does not implement project code.)
90
-
91
- ### 5. Read-heavy isolation
92
-
93
- When the input is much larger than the required result, spawn `explore` with a
94
- read-only brief. Require a compact digest with file/line or URL pointers, not
95
- large pasted inputs. The lead owns the decision and any follow-up.
96
-
97
- ```text
98
- lead → explore (reads widely) → digest → lead continues
99
- ```
100
-
101
- **Use when:** the result is much smaller than the input it consumes. This
102
- harness's `explore` agent is purpose-built for this: read-only, no spawning,
103
- pointers over pastes.
104
-
105
- ## Anti-patterns
106
-
107
- ### A. Router helper ("meta-orchestrator")
108
-
109
- A helper whose only job is choosing another helper adds two paraphrasing hops
110
- (information loss, ~2× tokens) for zero domain value. Put stable intent
111
- mapping in `AGENTS.md` or a slash command.
112
-
113
- ### B. Helper-to-helper chaining
114
-
115
- A child that launches another child hides cost, multiplies failure modes, and
116
- loses context. Return a recommended follow-up; let the lead or user decide.
117
-
118
- ### C. Automated sequential coordinator
119
-
120
- An agent that silently runs the entire lifecycle removes human checkpoints and
121
- drifts through repeated summaries (roughly double cost). Keep dependent steps
122
- user-driven.
123
-
124
- ### D. Deep trees
125
-
126
- Command → coordinator → coordinator → worker is not allowed here. Every layer
127
- adds latency and tokens with no decision value; leaf helpers lose context to
128
- multiple summarization steps. Keep depth at most 1 (command → helpers); the
129
- merge happens in the lead session.
130
-
131
- ## Decision flow
132
-
133
- ```text
134
- Is the work one perspective on one artifact?
135
- ├── Yes → direct invocation. Stop.
136
- └── No → will the same composition repeat?
137
- ├── No → direct invocation, ad hoc. Stop.
138
- └── Yes → independent sub-tasks with distinct outputs?
139
- ├── No → sequential user-driven commands (Pattern 4).
140
- └── Yes → parallel fan-out with merge (Pattern 3).
141
- Validate against the checklist above; if any check
142
- fails → fall back to a single-helper command.
143
- ```
144
-
145
- ## When to add a new pattern to a local catalog
146
-
147
- Only after: (1) used at least twice in real work, (2) a concrete artifact
148
- demonstrates it, (3) you can say why an existing pattern wouldn't have worked,
149
- (4) you can name its anti-pattern shadow. Premature catalog entries become
150
- aspirational documentation no one follows.
151
-
152
- Every helper report names the evidence it checked, separates fact from
153
- inference, and ends with the smallest next action. No pattern justifies
154
- weakening validation, security, accessibility, reversibility, or explicit
155
- requirements.