Skip to content

Instantly share code, notes, and snippets.

@mike-ward
Created July 9, 2026 18:41
Show Gist options
  • Select an option

  • Save mike-ward/ffe5c4f32b7db1e4849f7f0c3273d4e5 to your computer and use it in GitHub Desktop.

Select an option

Save mike-ward/ffe5c4f32b7db1e4849f7f0c3273d4e5 to your computer and use it in GitHub Desktop.
opencode config and quality pipeline skills

Working agreements

  • Extremely concise. Passive or imperative voice. No softening, hedging, first-person.
  • Accurate, robust solutions over agreement. Blunt feedback — don't validate a confidently-stated but flawed premise; say so.
  • Comments wrap at 90 columns when practical.
  • End plans with a concise list of unresolved questions, if any.
  • Performance work favors reducing heap allocations.
  • When summarizing, synthesize — explain implications, don't just compress.
  • Test Driven Development should be favored where practical.

CodeGraph

In repositories indexed by CodeGraph (a .codegraph/ directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:

  • MCP tool (when available): codegraph_explore answers most code questions in one call — the relevant symbols' verbatim source plus the call paths between them, including dynamic-dispatch hops grep can't follow. Name a file or symbol in the query to read its current line-numbered source. If it's listed but deferred, load it by name via tool search.
  • Shell (always works): codegraph explore "<symbol names or question>" prints the same output.

If there is no .codegraph/ directory, skip CodeGraph entirely — indexing is the user's decision.

name quality
description One-command quality pipeline over uncommitted changes — code-review, harden, fill test gaps, simplify (changed files only), then verify. Leaves changes uncommitted.
user_invocable true

Run the full quality pass on the current uncommitted diff, in order. Apply findings as you go; do not just report them. Stop and surface anything that can't be safely auto-resolved. Leave the changes uncommitted — do not stage or commit. The user commits separately (e.g. /ship or /commit).

Pipeline

  1. Scope — capture the changed file set: !git diff --name-only HEAD Every later step operates ONLY on these files. Never edit other packages.

  2. Review — run the code-review skill (high effort) for a thorough correctness + cleanup pass. Apply the fixes it surfaces.

  3. Harden — run the harden skill. Apply defenses against bad data / DoS on the changed code.

  4. Test — run the test-gaps skill. Add the missing tests it reports (untested public funcs, edge cases, error paths).

  5. Simplify — run the simplify skill, CONSTRAINED to the step-1 file set only. Reject any change that touches other packages or that broadens scope. Watch for the known failure modes: infinite recursion, layout regressions, removed SetIDFocus/focus wiring.

  6. Verify — rebuild and run the suite; do not proceed on red:

    • go build ./...
    • go test ./...
    • golangci-lint run ./... (Adjust only for a non-Go repo.) Confirm all pass.

Do NOT commit. Leave the changes staged-or-unstaged exactly as the user had them plus the pass's edits, for the user to review and commit.

Guardrails

  • Minimal scoped diffs — no cosmetic churn, no drive-by edits.
  • If any stage introduces a regression caught at step 6, revert that stage's change and report it rather than leaving the tree broken.
  • Report a final summary: what each stage changed and the test outcome.

If $ARGUMENTS is provided, treat it as extra scope/context for the pass.

name test-gaps
description Find test gaps in uncommitted code changes. Reports untested public functions, missing edge cases, and uncovered error paths.
user_invocable true

Analyze all uncommitted changes (staged and unstaged) for test coverage gaps:

Steps:

  • Run git diff and git diff --cached to identify changed/added files and functions
  • For each changed file, find the corresponding _test.go file (if any)
  • Read the changed code and existing tests to understand current coverage
  • Report gaps grouped by severity:

Missing tests (no test exists):

  • New exported functions or methods with no corresponding test
  • New unexported functions with non-trivial logic and no test

Missing edge cases (test exists but incomplete):

  • Error return paths not exercised
  • Boundary values: zero, negative, empty, nil, max-size inputs
  • NaN/Inf float inputs (for numeric code)
  • Single-element and two-element cases for slice/collection code

Missing integration tests:

  • New cross-package interactions without an integration test
  • New I/O paths (file, network) without a test that exercises them

For each gap:

  • State the file:function and what is untested
  • Rate as high (crash/panic risk), medium (silent wrong result), or low (cosmetic)
  • Suggest a one-line test name (e.g., TestExportSVG_EmptySeriesNoPanic)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment