oc-harness-setup 0.3.2 → 0.4.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.
- package/.docs/unwired-routing.md +16 -15
- package/AGENTS.md +105 -68
- package/CHANGELOG.md +91 -0
- package/GLOSSARY.md +46 -0
- package/LICENSE +1 -1
- package/README.md +48 -61
- package/agents/cleaner.md +86 -0
- package/agents/critic.md +79 -0
- package/agents/historian.md +92 -0
- package/agents/maintainer.md +106 -0
- package/agents/ops.md +69 -0
- package/agents/orchestrator.md +48 -18
- package/agents/researcher.md +72 -0
- package/agents/verifier.md +84 -0
- package/agents/worker.md +87 -0
- package/bin/cli.js +349 -133
- package/commands/close.md +11 -0
- package/commands/evolve.md +11 -0
- package/commands/fast.md +11 -0
- package/commands/goal.md +11 -0
- package/commands/search.md +11 -0
- package/commands/swarm.md +11 -0
- package/opencode.jsonc +42 -80
- package/package.json +13 -6
- package/reference/README.md +12 -14
- package/reference/canon.md +71 -0
- package/reference/context.md +35 -0
- package/reference/enforcement.md +6 -0
- package/reference/flow.md +19 -0
- package/reference/gates.md +23 -0
- package/reference/harness.md +15 -0
- package/reference/hygiene.md +13 -0
- package/reference/memory.md +13 -0
- package/reference/models.md +19 -24
- package/reference/phases.md +23 -0
- package/reference/repos.md +49 -0
- package/reference/tools.md +35 -0
- package/scripts/harness-doctor.ps1 +83 -0
- package/skills/close/SKILL.md +36 -0
- package/skills/evolve/SKILL.md +76 -0
- package/skills/fast/SKILL.md +36 -0
- package/skills/goal/SKILL.md +65 -0
- package/skills/search/SKILL.md +68 -0
- package/skills/swarm/SKILL.md +69 -0
- package/state-seed/lessons.md +22 -0
- package/state-seed/template.md +12 -0
- package/agents/build.md +0 -20
- package/agents/explore.md +0 -26
- package/agents/general.md +0 -19
- package/agents/plan.md +0 -29
- package/agents/reviewer.md +0 -22
- package/agents/vault.md +0 -73
- package/commands/build.md +0 -7
- package/commands/checkpoint.md +0 -7
- package/commands/code-simplify.md +0 -7
- package/commands/gauntlet.md +0 -7
- package/commands/handoff.md +0 -7
- package/commands/keeper.md +0 -7
- package/commands/kill.md +0 -11
- package/commands/plan.md +0 -7
- package/commands/retro.md +0 -15
- package/commands/review.md +0 -7
- package/commands/ship.md +0 -7
- package/commands/spec.md +0 -7
- package/commands/test.md +0 -7
- package/commands/webperf.md +0 -7
- package/reference/auto-mandate.md +0 -11
- package/reference/backup-convention.md +0 -9
- package/reference/clean-mandate.md +0 -13
- package/reference/editor-parity.md +0 -7
- package/reference/gc-scripts.md +0 -8
- package/reference/intent-routing.md +0 -14
- package/reference/lifecycle.md +0 -15
- package/reference/model-keeper.md +0 -46
- package/reference/model-test.md +0 -176
- package/reference/oc-source-map.md +0 -162
- package/reference/owner-pin.md +0 -31
- package/reference/roster.md +0 -15
- package/reference/session-scope.md +0 -9
- package/reference/session-state.md +0 -13
- package/reference/swarm.md +0 -32
- package/scripts/backup-config.ps1 +0 -42
- package/scripts/gc-branch.ps1 +0 -196
- package/scripts/gc-bump.ps1 +0 -198
- package/scripts/gc-clean.ps1 +0 -648
- package/scripts/gc-commit.ps1 +0 -143
- package/scripts/gc-merge.ps1 +0 -272
- package/scripts/gc-pr.ps1 +0 -190
- package/scripts/gc-push.ps1 +0 -111
- package/scripts/gc-read.ps1 +0 -150
- package/scripts/gc-rebase.ps1 +0 -162
- package/scripts/gc-release.ps1 +0 -225
- package/scripts/gc-stage.ps1 +0 -103
- package/scripts/gc-status.ps1 +0 -127
- package/scripts/gc-sync.ps1 +0 -65
- package/scripts/gc.core.ps1 +0 -715
- package/scripts/gc.smoke.ps1 +0 -779
- package/scripts/interrupt-session.ps1 +0 -65
- package/scripts/logbook/README.md +0 -108
- package/scripts/logbook/logbook.test.ts +0 -440
- package/scripts/logbook/logbook.ts +0 -797
- package/scripts/pirep/README.md +0 -147
- package/scripts/pirep/pirep.test.ts +0 -735
- package/scripts/pirep/pirep.ts +0 -836
- package/scripts/testflight/README.md +0 -112
- package/scripts/testflight/testflight.test.ts +0 -512
- package/scripts/testflight/testflight.ts +0 -806
- package/skills/_shared/SOURCES.md +0 -26
- package/skills/_shared/references/accessibility-checklist.md +0 -160
- package/skills/_shared/references/definition-of-done.md +0 -67
- package/skills/_shared/references/observability-checklist.md +0 -92
- package/skills/_shared/references/orchestration-patterns.md +0 -155
- package/skills/_shared/references/performance-checklist.md +0 -236
- package/skills/_shared/references/security-checklist.md +0 -245
- package/skills/_shared/references/testing-patterns.md +0 -235
- package/skills/api-and-interface-design/SKILL.md +0 -14
- package/skills/browser-testing-with-devtools/SKILL.md +0 -303
- package/skills/code-simplification/SKILL.md +0 -14
- package/skills/creative-writing/SKILL.md +0 -96
- package/skills/debugging-and-error-recovery/SKILL.md +0 -15
- package/skills/flight-deck/SKILL.md +0 -17
- package/skills/frontend-ui-engineering/SKILL.md +0 -16
- package/skills/gauntlet/SKILL.md +0 -21
- package/skills/git-ceremony/SKILL.md +0 -27
- package/skills/grilling/SKILL.md +0 -18
- package/skills/observability-and-instrumentation/SKILL.md +0 -18
- package/skills/performance-optimization/SKILL.md +0 -16
- package/skills/pilot-report/SKILL.md +0 -18
- package/skills/planning-and-task-breakdown/SKILL.md +0 -16
- package/skills/security-and-hardening/SKILL.md +0 -18
- package/skills/source-driven-development/SKILL.md +0 -16
- package/skills/spec-driven-development/SKILL.md +0 -26
- package/skills/test-driven-development/SKILL.md +0 -18
- package/skills/test-flight/SKILL.md +0 -14
- package/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/skills/writing-for-agents/SKILL.md +0 -89
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: debugging-and-error-recovery
|
|
3
|
-
description: "Systematic root-cause debugging for reproducible errors, failing tests/builds, regressions, and behavior that contradicts expectations."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Debugging and Error Recovery
|
|
7
|
-
|
|
8
|
-
1. Capture the exact symptom, environment, last known good behavior, and smallest reproduction. Preserve logs and failing output.
|
|
9
|
-
2. Reproduce before changing code. If reproduction is intermittent, quantify frequency and isolate variables.
|
|
10
|
-
3. Trace from the failing boundary toward the first incorrect state. Form one falsifiable hypothesis at a time and run the cheapest discriminating check.
|
|
11
|
-
4. Reduce the reproducer until unrelated layers disappear. Separate root cause from downstream noise.
|
|
12
|
-
5. Apply the smallest root-cause fix. Avoid fallback branches, retries, or broad refactors unless evidence shows they are required.
|
|
13
|
-
6. Verify the original reproduction, the nearest regression suite, and one relevant edge case. Confirm temporary diagnostics are removed.
|
|
14
|
-
|
|
15
|
-
If blocked, return the exact missing signal, what was ruled out, and the smallest next experiment. Do not invent history tools, perform opportunistic cleanup, commit, publish, or widen the brief.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: flight-deck
|
|
3
|
-
description: "Configures the global oc-flight-deck sidebar JSONC: rows, ordering, visibility, glyphs, and caution thresholds."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Flight Deck Configuration
|
|
7
|
-
|
|
8
|
-
The plugin reads one global file: `$XDG_CONFIG_HOME/opencode/flight-deck.jsonc` when set, otherwise `~/.config/opencode/flight-deck.jsonc`. Project-local copies are ignored.
|
|
9
|
-
|
|
10
|
-
1. Route the edit through `vault` because it changes the global harness.
|
|
11
|
-
2. Locate the installed `oc-flight-deck` package, then read its shipped `flight-deck.schema.json` and `flight-deck.example.jsonc`. Search the active OpenCode/plugin cache if the package path is not known; never guess keys from memory.
|
|
12
|
-
3. If no config exists, copy the shipped example. Otherwise preserve comments and edit only requested differences from defaults.
|
|
13
|
-
4. Validate JSONC against the shipped schema and reload OpenCode to verify the panel.
|
|
14
|
-
|
|
15
|
-
`sidebar.rows` controls ordered visible fields; `caution` controls stalled-work thresholds and exemptions. Prefer removing low-value rows to adding noise. Do not invent styling keys or duplicate the same setting in both plugin options and the global file.
|
|
16
|
-
|
|
17
|
-
Return the config path, keys changed, schema source, validation result, and reload requirement.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: frontend-ui-engineering
|
|
3
|
-
description: "Implements or reviews user-facing UI components, pages, layouts, interaction states, responsive behavior, and accessibility against an existing product/design system."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Frontend UI Engineering
|
|
7
|
-
|
|
8
|
-
1. Inspect the existing design system, component patterns, tokens, routing, state, and tests before adding UI.
|
|
9
|
-
2. Define the interaction states: loading, empty, success, validation, error, disabled, and recovery as applicable.
|
|
10
|
-
3. Use semantic HTML, keyboard-complete interaction, visible focus, correct labels, and sufficient contrast. Reuse existing primitives and tokens.
|
|
11
|
-
4. Keep state local to the smallest owner and separate server, URL, form, and presentation state.
|
|
12
|
-
5. Verify at representative narrow and wide viewports, with keyboard navigation and the repository's UI checks. Use real-browser tooling when runtime behavior or visual output matters.
|
|
13
|
-
|
|
14
|
-
Read `../_shared/references/accessibility-checklist.md` only when the scoped change needs the detailed checklist.
|
|
15
|
-
|
|
16
|
-
Return changed surfaces, states verified, accessibility evidence, and responsive evidence; add remaining visual risk only when it has real content, omit otherwise. Do not redesign adjacent UI or create a new component system without a request.
|
package/skills/gauntlet/SKILL.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gauntlet
|
|
3
|
-
description: "Explicit-only bounded challenge-and-repair loop for /gauntlet or a direct 'gauntlet this' request."
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Gauntlet
|
|
9
|
-
|
|
10
|
-
Use only when deliberately invoked. The orchestrator owns dispatch and reporting.
|
|
11
|
-
|
|
12
|
-
1. Freeze the artifact, constraints, acceptance evidence, round ceiling, and revert pointer before the first challenge. Changing the bar restarts the loop.
|
|
13
|
-
2. Dispatch one or more independent read-only reviewers with non-overlapping lenses. Findings need executed evidence or an `UNVERIFIED` label.
|
|
14
|
-
3. Merge duplicate findings and reject anything outside the frozen scope.
|
|
15
|
-
4. Dispatch one writer with only the accepted findings. No finding means no edit.
|
|
16
|
-
5. Rerun the original acceptance evidence and a fresh review. Track opened, closed, and regressed findings.
|
|
17
|
-
6. Stop on green, a hard blocker, or the round ceiling. At the ceiling, report options and recommend one; do not continue silently.
|
|
18
|
-
|
|
19
|
-
Keep independent challenges parallel, repair dependent on findings, and one writer per artifact. In verdict-only mode, edit nothing.
|
|
20
|
-
|
|
21
|
-
Return the terminal state, rounds used, findings opened/closed/regressed, and exact acceptance results; add remaining risk and the revert pointer only when they have real content, omit otherwise.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: git-ceremony
|
|
3
|
-
description: "Explicit-only Git workflow activated by --gc or a direct request for branch, commit, PR, merge, tag, version, release, or worktree ceremony."
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Git Ceremony
|
|
9
|
-
|
|
10
|
-
The repository's own instructions win. This skill is the fallback when the user explicitly activates Git work.
|
|
11
|
-
|
|
12
|
-
## Sequence
|
|
13
|
-
|
|
14
|
-
1. Inspect repository rules, status, branch, remotes, default branch, and staged/unstaged/untracked work. Preserve unrelated user changes.
|
|
15
|
-
2. Classify the requested mutation and confirm any destructive, public, production, or history-rewriting step that lacks explicit authorization.
|
|
16
|
-
3. Sync with fast-forward-only behavior only when requested or required for the named endpoint.
|
|
17
|
-
4. Use a short typed branch when review isolation is appropriate: `feat/`, `fix/`, `docs/`, `refactor/`, `test/`, or `chore/` plus a lowercase slug.
|
|
18
|
-
5. Stage only intended files. Review the staged diff and scan for secrets, generated noise, and line-ending churn.
|
|
19
|
-
6. When a commit is requested or required for the named endpoint, commit one logical change with `<type>(<scope>): <imperative summary>`; omit scope when it adds no value.
|
|
20
|
-
7. Push, open a PR, merge, tag, version, or release only when the request includes that step. Never infer publication from a build or test request.
|
|
21
|
-
8. Verify the resulting status and remote state; report exact evidence and anything still local.
|
|
22
|
-
|
|
23
|
-
Use only the deterministic wrappers named in `~/.config/opencode/reference/gc-scripts.md`. If a wrapper cannot express an authorized operation, report that boundary before using a native command. `gc-release -MovingLatest` is valid only when repository policy explicitly declares that nonstandard scheme.
|
|
24
|
-
|
|
25
|
-
For worktrees, first verify the destination is outside tracked content or ignored, create from an explicit base, and never move uncommitted changes between worktrees. Version bumps and releases must follow the repository's format and policy; otherwise use SemVer and keep a bump isolated from unrelated code.
|
|
26
|
-
|
|
27
|
-
Never commit secrets, debug residue, or unrelated files. Do not clean, reset, rebase, force-push, merge, tag, or publish beyond the requested scope.
|
package/skills/grilling/SKILL.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: grilling
|
|
3
|
-
description: "Explicit-only decision interview for 'grill me' or when the user deliberately requests a bounded design-question round before a costly choice."
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Grilling
|
|
9
|
-
|
|
10
|
-
Turn unresolved design choices into a bounded decision frontier.
|
|
11
|
-
|
|
12
|
-
1. Extract settled facts from the conversation and available evidence. Do not re-ask answered or discoverable questions.
|
|
13
|
-
2. Identify only decisions that materially change outcome, cost, risk, compatibility, or irreversible structure.
|
|
14
|
-
3. Ask one numbered round containing the currently independent decisions. Offer two or three mutually exclusive options, put the recommended option first, and explain the tradeoff in one sentence.
|
|
15
|
-
4. Wait for answers. Then either close with the settled decisions and remaining unknowns, or ask one dependent follow-up round.
|
|
16
|
-
5. Stop when the next action is safe and unambiguous. Return decisions to the orchestrator; do not build, dispatch, or write project files.
|
|
17
|
-
|
|
18
|
-
Prefer a stated assumption over a question when the choice is cheap and reversible. Never use interviewing as generic preflight or confirmation theater.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: observability-and-instrumentation
|
|
3
|
-
description: "Designs or audits logs, metrics, traces, and alerts when the user explicitly requests telemetry/operability work or a diagnosed gap blocks production evidence."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Observability and Instrumentation
|
|
7
|
-
|
|
8
|
-
Start from the operational question that must be answerable, not from a desire to add more telemetry.
|
|
9
|
-
|
|
10
|
-
1. Name the event or failure, consumer, decision, and acceptable detection delay.
|
|
11
|
-
2. Choose the smallest signal: structured log for discrete context, metric for aggregation/trends, trace for causal latency, alert for actionable thresholds.
|
|
12
|
-
3. Use stable names and low-cardinality dimensions. Preserve correlation IDs across boundaries.
|
|
13
|
-
4. Exclude secrets and sensitive payloads; define retention and sampling where relevant.
|
|
14
|
-
5. Exercise the path and prove the signal appears with the expected fields and failure semantics.
|
|
15
|
-
|
|
16
|
-
Read only the matching section of `../_shared/references/observability-checklist.md` when deeper guidance is needed.
|
|
17
|
-
|
|
18
|
-
Return the operational question, signal added or inspected, verification query, noise/cardinality risk, and remaining blind spot. Do not add dashboards, alerts, or publication steps outside the brief.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: performance-optimization
|
|
3
|
-
description: "Measurement-led performance work for a stated latency/throughput goal, observed regression, Core Web Vitals issue, hot path, or identified resource bottleneck."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Performance Optimization
|
|
7
|
-
|
|
8
|
-
1. Define the user-visible metric, representative workload, baseline, and target.
|
|
9
|
-
2. Measure with the narrowest profiler or trace that can locate the bottleneck. Distinguish CPU, I/O, network, memory, rendering, and database time.
|
|
10
|
-
3. Rank causes by measured contribution. Change the largest proven cause with the smallest complexity cost.
|
|
11
|
-
4. Repeat the same measurement under the same conditions. Check correctness and a nearby regression path.
|
|
12
|
-
5. Stop when the target is met or the next gain is not worth its complexity; report the tradeoff.
|
|
13
|
-
|
|
14
|
-
For a relevant detailed pass, read only the matching section of `../_shared/references/performance-checklist.md`.
|
|
15
|
-
|
|
16
|
-
Return before/after numbers, method, variance or caveats, change made, and residual bottleneck. Never claim an improvement without comparable measurements or add caching, concurrency, or dependencies on intuition alone.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pilot-report
|
|
3
|
-
description: "Explicit-only analysis of real OpenCode history for a direct model/agent performance, speed, cost, throughput, or failure-rate comparison."
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Pilot Report
|
|
9
|
-
|
|
10
|
-
Use `pirep` to answer the named performance question from recorded OpenCode history.
|
|
11
|
-
|
|
12
|
-
1. Define the compared models/agents, time window, workload class, and metric before querying.
|
|
13
|
-
2. Use bounded reads and disclose sample size, missing fields, retries, and obvious workload imbalance.
|
|
14
|
-
3. Compare like with like. Separate observed measurements from causal claims and avoid ranking tiny samples.
|
|
15
|
-
4. Report median and tail latency where available, token/cost totals, success/failure rate, and uncertainty relevant to the question.
|
|
16
|
-
5. Recommend a routing change only when evidence supports it; do not edit model pins or routing automatically.
|
|
17
|
-
|
|
18
|
-
This skill is never triggered merely because the orchestrator dispatched a worker or discussed routing.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: planning-and-task-breakdown
|
|
3
|
-
description: "Creates an executable plan when the user asks for planning, task breakdown, sequencing, ownership, or acceptance criteria without requesting implementation."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Planning and Task Breakdown
|
|
7
|
-
|
|
8
|
-
Convert a known outcome into the smallest ordered plan that another worker can execute without rediscovering intent.
|
|
9
|
-
|
|
10
|
-
1. State the outcome, in-scope surfaces, exclusions, and acceptance evidence.
|
|
11
|
-
2. Identify dependencies and the critical path. Keep independent tasks parallel and dependent tasks ordered.
|
|
12
|
-
3. Split by artifact, question, or verifiable phase. Each task gets one owner, a bounded change surface, a done condition, and a narrow proof.
|
|
13
|
-
4. Surface only material risks and open decisions. Recommend a path when evidence supports one.
|
|
14
|
-
5. Check that no task performs opportunistic cleanup, hidden publication, commits, or unrelated hardening.
|
|
15
|
-
|
|
16
|
-
Return the plan in chat unless the user names a destination. Do not write state files, create project folders, dispatch workers, or implement the plan.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: security-and-hardening
|
|
3
|
-
description: "Security-focused implementation or audit for authentication/authorization, secret handling, untrusted-input boundaries, sensitive data, dependencies, or an explicit threat-model request."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Security and Hardening
|
|
7
|
-
|
|
8
|
-
Start with the changed trust boundary, assets at risk, attacker capability, and required invariant. Do not broaden a routine change into a full security program.
|
|
9
|
-
|
|
10
|
-
1. Map input, identity, authorization, data flow, storage, and external calls across the scoped boundary.
|
|
11
|
-
2. Check fail-closed validation, object-level authorization, injection resistance, safe error disclosure, and secret handling where applicable.
|
|
12
|
-
3. Inspect dependency or supply-chain risk only when dependencies changed or the brief requests it.
|
|
13
|
-
4. Prefer platform security primitives and centralized policy over bespoke sanitizers or scattered checks.
|
|
14
|
-
5. Prove the control with a negative test or concrete exploit attempt, then rerun the normal behavior path.
|
|
15
|
-
|
|
16
|
-
Read `../_shared/references/security-checklist.md` only for the matching topic; do not load it wholesale. Route credential-bearing files through the permitted privileged worker and report secrets only by path and key name.
|
|
17
|
-
|
|
18
|
-
Return threat, evidence, severity, smallest remediation, and verification; add residual risk only when it has real content, omit otherwise. Do not commit, rotate credentials, contact services, or expand scope without authorization.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: source-driven-development
|
|
3
|
-
description: "Verifies implementation choices from primary sources when an API/version may have changed, official documentation is requested, or a reusable public pattern needs authoritative support."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Source-Driven Development
|
|
7
|
-
|
|
8
|
-
Use primary sources only: official documentation, specifications, source repositories, release notes, or research papers.
|
|
9
|
-
|
|
10
|
-
1. Pin the relevant product/library version and the decision that needs verification.
|
|
11
|
-
2. Find the narrow authoritative section. Prefer current versioned docs over blogs and snippets.
|
|
12
|
-
3. Check deprecations, defaults, platform constraints, and migration notes that could invalidate the approach.
|
|
13
|
-
4. Translate the source into the smallest repository-compatible implementation. Cite the exact page near the decision it supports.
|
|
14
|
-
5. Verify behavior locally; documentation establishes the contract, not that this code satisfies it.
|
|
15
|
-
|
|
16
|
-
Separate sourced fact from inference. If sources conflict, name the versions and choose the one matching the project. Do not research every ordinary language or standard-library choice, and do not turn citations into a side quest.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: spec-driven-development
|
|
3
|
-
description: "Explicit-only specification workflow for /spec or a direct request to define a feature/change before implementation."
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Spec-Driven Development
|
|
9
|
-
|
|
10
|
-
Produce a decision-ready specification, then stop. Planning, implementation, commits, and publication are separate actions.
|
|
11
|
-
|
|
12
|
-
## Spec
|
|
13
|
-
|
|
14
|
-
- **Outcome:** observable behavior and who benefits.
|
|
15
|
-
- **Scope:** included surfaces and explicit non-goals.
|
|
16
|
-
- **Current evidence:** relevant existing behavior, constraints, and interfaces.
|
|
17
|
-
- **Requirements:** uniquely identified, testable statements.
|
|
18
|
-
- **Failure behavior:** validation, error states, recovery, and reversibility.
|
|
19
|
-
- **Acceptance evidence:** one runnable or inspectable proof per requirement.
|
|
20
|
-
- **Risks and decisions:** unresolved items that materially affect the result.
|
|
21
|
-
|
|
22
|
-
Use `grilling` only when the user deliberately requests it. Otherwise ask the smallest blocking question or state a reversible assumption.
|
|
23
|
-
|
|
24
|
-
Keep the spec in chat by default. Write it only when the user or repository names a destination. Never create `tasks/`, session files, commits, or implementation work as a side effect.
|
|
25
|
-
|
|
26
|
-
Before returning, check that every requirement maps to evidence, non-goals prevent obvious scope expansion, and no acceptance criterion depends on subjective language such as “good,” “fast,” or “clean” without a measurable bound.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: test-driven-development
|
|
3
|
-
description: "Uses RED-GREEN-REFACTOR for behavior changes and reproducible bug fixes when a testable seam exists."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Test-Driven Development
|
|
7
|
-
|
|
8
|
-
Use this inside an implementation brief, not as a reason to widen it.
|
|
9
|
-
|
|
10
|
-
1. **RED:** Write the smallest test that expresses the requested behavior or reproduces the reported bug. Run it and confirm it fails for the expected reason; a syntax or setup failure is not red.
|
|
11
|
-
2. **GREEN:** Make the smallest production change that passes the new test. Run the focused test, then the nearest relevant suite.
|
|
12
|
-
3. **REFACTOR:** Improve names or structure only where the passing change made complexity visible. Keep behavior fixed and rerun the tests.
|
|
13
|
-
|
|
14
|
-
Prefer public behavior over implementation details. Cover the meaningful boundary or failure case, not every line. Reuse the repository's framework and conventions; do not introduce a new test stack without explicit approval.
|
|
15
|
-
|
|
16
|
-
If no practical automated seam exists, state why and use the narrowest deterministic verification available. Never weaken assertions, skip a failure, or rewrite a test merely to make the implementation pass.
|
|
17
|
-
|
|
18
|
-
Return tests added or changed and exact commands and outcomes; add remaining untested risk only when it has real content, omit otherwise. Delegation, commits, browser automation, and publication remain outside this skill.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: test-flight
|
|
3
|
-
description: "Verifies an npm package from its packed artifact when exports, files, peer dependencies, install behavior, or release readiness must match what consumers receive."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Test Flight
|
|
7
|
-
|
|
8
|
-
1. Identify the package manager, workspace root, package, supported runtimes, and consumer contract.
|
|
9
|
-
2. Run the repository's build and tests, then create or inspect the packed artifact with the native dry-run/pack command.
|
|
10
|
-
3. Verify included files, `exports`, types, entry points, peer/runtime dependencies, licenses, and absence of secrets or local-only paths.
|
|
11
|
-
4. Install the artifact into a temporary clean consumer and exercise the smallest real import/usage path under each required module mode or runtime.
|
|
12
|
-
5. Fix only authorized package defects, repack, and rerun until clean; then report. Publishing and tagging are separate explicit actions.
|
|
13
|
-
|
|
14
|
-
Return artifact identity, packed contents summary, clean-install commands, consumer results, and remaining compatibility risk.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Skill mechanics
|
|
2
|
-
|
|
3
|
-
The skill-specific branch of [`writing-for-agents`](SKILL.md): what changes when the document is a skill (frontmatter, the invocation choice, and router skills). Everything else about writing it is the universal reference in `SKILL.md`.
|
|
4
|
-
|
|
5
|
-
## Invocation
|
|
6
|
-
|
|
7
|
-
Two choices, trading the two loads:
|
|
8
|
-
|
|
9
|
-
- A **model-invoked** skill keeps a `description`, so the agent can fire it autonomously, and other skills can reach it. You can still type its name: model-invocation always _includes_ user reach; a description only ever adds agent discovery, never removes the human's. The description is the skill's top-level context pointer, forced to stay loaded at all times: permanent context load in exchange for discoverability. A model-invoked skill whose content is all reference is also one home for shared reference: another skill can invoke it, so reference needed by several skills lives in one place. Mechanics: omit the `opencode/autoinvoke: false` marker, and write a model-facing description carrying the trigger branches (the pointer-writing rules in `SKILL.md` apply in full).
|
|
10
|
-
- An **explicit-only** skill is hidden from the model's advertised skill list, but remains registered and loadable by exact ID from a command or deliberate instruction. It removes the always-advertised description cost while preserving explicit reach. Set `metadata: {"opencode/autoinvoke": false}` and keep the description as a short human-facing summary.
|
|
11
|
-
|
|
12
|
-
Pick model-invocation only when the agent must reach the skill on its own, or another skill must. If it only ever fires by hand, make it explicit-only and pay no context load.
|
|
13
|
-
|
|
14
|
-
Shared reference that two skills need can live in a plain reference file and be loaded only from the matching branch.
|
|
15
|
-
|
|
16
|
-
## Splitting by invocation
|
|
17
|
-
|
|
18
|
-
The invocation cut of splitting (the sequence cut lives in `SKILL.md`): split off a model-invoked skill when you have a distinct leading word that should trigger it on its own (a trigger word you actually use in your prompts), or another skill must reach it. You pay context load for the new always-loaded description, so that independent reach has to be worth it.
|
|
19
|
-
|
|
20
|
-
## Router skills
|
|
21
|
-
|
|
22
|
-
When explicit skills multiply, route them through commands or the compact lookup at `~/.config/opencode/reference/intent-routing.md`. Exact-ID loading remains available even when a skill is not advertised.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: writing-for-agents
|
|
3
|
-
description: 'Reference for writing agent-facing documents — skills, commands, agents, AGENTS.md, harness references. Use when creating or editing any agent-facing doc, sharpening a skill description or pointer, or pruning bloated instructions'
|
|
4
|
-
metadata:
|
|
5
|
-
"opencode/autoinvoke": false
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Writing for Agents
|
|
9
|
-
|
|
10
|
-
Reference for writing any document an agent consumes: a skill, a command, an agent definition, an `AGENTS.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable, since the agent takes the same _process_ every run rather than producing the same output.
|
|
11
|
-
|
|
12
|
-
When the document you are writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
|
|
13
|
-
|
|
14
|
-
## Context pointers
|
|
15
|
-
|
|
16
|
-
A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material, and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
|
|
17
|
-
|
|
18
|
-
A pointer does two jobs: state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
|
|
19
|
-
|
|
20
|
-
- **Front-load the leading word**: the pointer is where it does its triggering work.
|
|
21
|
-
- **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches.
|
|
22
|
-
- **Cut identity the body already carries.**
|
|
23
|
-
|
|
24
|
-
## The two loads
|
|
25
|
-
|
|
26
|
-
Every document and pointer you add spends one of two budgets:
|
|
27
|
-
|
|
28
|
-
- **Context load** is the cost of always-loaded material on the agent's window: an `AGENTS.md` line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires.
|
|
29
|
-
- **Cognitive load** is the cost on the human: which documents exist and when to reach for each. The human is the index. Not a cost to minimise: it is the price of human agency; spend it where human judgement matters, remove it where it does not.
|
|
30
|
-
|
|
31
|
-
Material reached only through a pointer escapes context load at the price of the pointer's own line; material with no pointer at all rides entirely on cognitive load.
|
|
32
|
-
|
|
33
|
-
## Information hierarchy
|
|
34
|
-
|
|
35
|
-
A document is built from two content types: **steps** (the ordered actions the agent performs) and **reference** (definitions, rules, facts consulted on demand). The two mix freely: all steps (a recipe), all reference (a review's rules, this skill), or both. The core decision is where each piece sits on the **information hierarchy**, a ladder ranked by how immediately the agent needs the material:
|
|
36
|
-
|
|
37
|
-
1. **In-file step** is the primary tier: what the agent does, in order.
|
|
38
|
-
2. **In-file reference** is consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung), which is a fine arrangement, not a smell.
|
|
39
|
-
3. **Disclosed reference** is pushed out into a separate file, reached by a context pointer, loaded only when the pointer fires. Spans a sibling file in the same folder through fully external reference that lives anywhere and any document can point at.
|
|
40
|
-
|
|
41
|
-
Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
|
|
42
|
-
|
|
43
|
-
**Progressive disclosure** is the move down the ladder (out of the main file and behind a pointer) so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip: a variance lever, not just a legibility one.
|
|
44
|
-
|
|
45
|
-
**Co-location** is the within-file companion: where the ladder decides _how far down_ a piece sits, co-location decides _what sits beside it_ once there. Keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it. The test: the document should read like documentation written for the agent. Grouped material reads that way; scattered material does not. (Distinct from duplication: that repeats one meaning in two places; scattering fragments one meaning across many.)
|
|
46
|
-
|
|
47
|
-
**Sprawl** is the failure mode here: a document simply too long, even when every line is live and unique. Attention thins across the excess, and every extra line is one more to keep relevant. The cure is the ladder: disclose reference behind pointers, and split by branch or sequence so each path carries only what it needs.
|
|
48
|
-
|
|
49
|
-
## Steps and completion criteria
|
|
50
|
-
|
|
51
|
-
Every step ends on a **completion criterion**, the condition that tells the agent the work is done. Two properties make it a lever:
|
|
52
|
-
|
|
53
|
-
- **Clarity**: can the agent tell done from not-done? A vague bound ("understanding reached") invites **premature completion**: ending the step before it is genuinely done, attention slipping to _being done_. The visible steps still ahead (the **post-completion steps**) supply the pull; the criterion's clarity is the resistance. Defend in order: **sharpen the bound first** (local and cheap); only if it is irreducibly fuzzy _and_ you observe the rush, hide the later steps by splitting the sequence. Hiding only works across a real context boundary (a hand-off or a subagent dispatch; an inline call leaves the later steps in context and clears nothing).
|
|
54
|
-
- **Demand**: how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** (the digging the agent does within the work, latent in the wording rather than written as its own step), and it is not step-bound: "every rule applied" binds a body of flat reference just as "every step done" binds a sequence, which is how an all-reference document still carries an exhaustiveness bar.
|
|
55
|
-
|
|
56
|
-
The strongest criteria are both checkable and exhaustive.
|
|
57
|
-
|
|
58
|
-
## Earns its place
|
|
59
|
-
|
|
60
|
-
A skill is justified only for a non-obvious, cross-project, broadly-applicable technique. Project-specific conventions belong in the instructions file (usually `AGENTS.md`); standard practice needs nothing; mechanical constraints should be **automated, not documented** — a linter, schema, or test enforces them better than prose. If a proposed skill fails this gate, delete it or fold it into an existing one.
|
|
61
|
-
|
|
62
|
-
## When to split
|
|
63
|
-
|
|
64
|
-
Splitting one document into two spends one of the two loads, so split only when the cut earns it:
|
|
65
|
-
|
|
66
|
-
- **By sequence**: split a run of steps where the post-completion steps tempt the agent to rush the one in front of it. Keeping them out of view drives more legwork on the current task. Beware the reverse: merging sequences exposes each step's later steps to what follows, inviting premature completion.
|
|
67
|
-
- **By invocation**, skill-specific: see [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md).
|
|
68
|
-
|
|
69
|
-
## Leading words
|
|
70
|
-
|
|
71
|
-
A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the document (_lesson_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors: you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
|
|
72
|
-
|
|
73
|
-
It anchors twice. In the body, _execution_: the agent reaches for the same behaviour every time the word appears, and inside flat reference it focuses attention on a class of thing to look for. In a pointer, _invocation_: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the material and reaches it more reliably.
|
|
74
|
-
|
|
75
|
-
Hunt for opportunities to refactor with leading words. A triad spelled out at three sites, a pointer spending a sentence to gesture at one idea. Each is a passage begging to collapse into a single token:
|
|
76
|
-
|
|
77
|
-
- "fast, deterministic, low-overhead" → _tight_ (a _tight_ loop).
|
|
78
|
-
- "a loop you believe in" → _red_, turning a fuzzy gate into a binary observable state (the loop goes _red_ on the bug, or it doesn't).
|
|
79
|
-
|
|
80
|
-
You win twice: fewer tokens, and a sharper hook for the agent to hang its thinking on. Assume every document is carrying restatements that leading words retire. Go find them.
|
|
81
|
-
|
|
82
|
-
**Negation** is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the **positive**: state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
|
|
83
|
-
|
|
84
|
-
## Pruning
|
|
85
|
-
|
|
86
|
-
- Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit. **Duplication** (the same meaning in more than one place) costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank. (The accidental inverse of a leading word, which repeats a token on purpose, never the meaning.)
|
|
87
|
-
- The **environment** is a source of truth too (`package.json` scripts, config files, the directory layout, `--help` output), and a document that restates it is a **cache**: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.
|
|
88
|
-
- Check every line for **relevance**: does it still bear on what the document does? A line loses relevance by never bearing on the task (mere exposition, or a branch that should be disclosed) or by going stale as the behaviour or world it describes changes. Shorter documents are easier to keep relevant. Without a pruning discipline the default fate is **sediment**: stale layers that settle because adding feels safe and removing feels risky, until you must core down through them to find what is still live.
|
|
89
|
-
- Hunt **no-ops** sentence by sentence: an instruction the model already obeys by default pays load to say nothing. The test (does it change behaviour versus the default?) is model-relative, not reader-relative: two people disagreeing about a no-op disagree about the default, and settle it by running the document, not by debate. When a sentence fails, delete the whole sentence rather than trim words from it. The test also grades leading words: a word too weak to beat the default (_be thorough_ when the agent is already thorough-ish) is a no-op, and the fix is a stronger word (_relentless_), not a different technique.
|