Agent skill

gather-context

Research first SOP before implementing any code change. Use when starting any task that involves modifying an existing codebase features bugs refactors open source contributions. Triggers when I want to work on X help me implement or fix or refactor X gather relevant context for X lets work on this. Launches 4 parallel voyager subagents to map current behavior dependencies blast radius and codebase style then presents 3 ranked approaches minimal diff first for user approval before any code is written.

Stars 5
Forks 3

Install this agent skill to your Project

npx add-skill https://github.com/iamhenry/ai-project-starter-kit/tree/main/.opencode/skills/gather-context

SKILL.md

Gather Context

Research a codebase before touching it. Parallel research -> synthesis -> 3 ranked approaches -> wait for approval.

Primary goal for open source: Changes must look like the maintainer wrote them. Minimal diff. Maximum style alignment.


Phase 0 — Issue Intake

Before research, frame the task from the issue/request itself.

  • Restate the issue in plain language
  • Extract explicit acceptance criteria
  • Mark assumptions and missing product decisions
  • Classify the task: bug | feature | refactor | claim-check

If the issue is underspecified in a way that would materially change the implementation, stop here and ask 1-3 targeted questions instead of forcing options.

Phase 1 — Define Target Scenario, Then Launch 4 Voyager Agents in Parallel

Before launching subagents, generate exactly 1 Gherkin scenario from the original user query. Keep it minimal and targeted. We are defining the smallest user-visible contract for a simple enhancement, not a full spec.

Use this format:

Scenario: [User action and outcome]

Given [user state/precondition] When [user action] Then [user-visible outcome with verifiable condition]

Acceptance Criteria:

  • [Measurable outcome: specific value/threshold/state]

Rules:

  • Generate exactly 1 scenario
  • Base it on the original user query, not on implementation guesses
  • Keep it user-visible, testable, falsifiable, and implementation-agnostic
  • Keep it minimal and targeted to the enhancement being requested
  • This scenario is the target goal for all subagents

Spawn all four simultaneously using the Task tool with subagent_type: voyager.

Pass the scenario to every subagent as part of its task context so research stays anchored to the same target behavior.

Evidence requirement: All agents must cite findings with code snippets, file paths, and line numbers. No assertions without evidence. If results are thin or inconclusive, note gaps explicitly in Phase 2 — do not proceed with assumptions.

Agent 1: Code Archaeology

What does this code do today, and how?

  • Locate entry points, relevant files, core logic
  • Trace the current implementation end-to-end
  • Identify existing tests covering this area
  • Note any TODOs, FIXMEs, or known issues near the target

Agent 2: Dependency Map

What breaks if we touch this?

  • Map callers and callback/event consumers (what depends on this code, including who reacts to emitted/invoked behavior)
  • Map callees and callback/event producers (what this code depends on, including what it emits/invokes)
  • Capture invocation cardinality and order for critical interactions (once vs multiple, before vs after)
  • Identify public API surface vs internal details
  • Assess blast radius: files, modules, tests, and cross-component behavioral side effects at risk
  • Flag any breaking change risks

Agent 3: UX Behavior

What does the user see today, and what will they see after?

Given the feature/change being investigated, trace the user-facing path — not the code path.

  • Current UX — step by step what the user sees and can do today (screens, states, limits, caps, hidden elements)
  • Post-change UX — same walkthrough after the proposed change; explicitly call out anything that stays blocked, hidden, or broken

The main agent must tell this agent what feature is being added/changed so it can focus the trace. Output must be two clearly labelled sections: Current UX and Post-change UX. No prose beyond what is needed to describe user-visible behavior. Flag any gap where the post-change UX does not match user expectations.

Agent 4: Style Fingerprint

How does this codebase write code?

Start with files adjacent to the task. Expand repo-wide when touching shared infrastructure.

Look for:

  • Naming conventions (variables, functions, types, files)
  • Error handling patterns (exceptions vs return values vs Result types)
  • How similar problems are solved elsewhere in the codebase
  • Test structure and naming
  • Code organization within files (imports, grouping, ordering)
  • Linting/formatting config (.eslintrc, pyproject.toml, .editorconfig, etc.)
  • Commit/PR style if relevant (small focused changes vs large PRs)

Output: A concise style cheatsheet — bullet points only, no prose.


Phase 2 — Synthesize

After all 4 agents return, combine findings:

  1. Original scenario — the single target scenario from Phase 1, surfaced verbatim
  2. Current UX — what the user sees and can do today (from Agent 3, surfaced here verbatim)
  3. Post-change UX — what the user will see after the change (from Agent 3, surfaced here verbatim)
  4. Current behavior — what the code does today
  5. Constraints — what must not change (public API, test contracts, style rules)
  6. Style rules — the extracted cheatsheet from Agent 4
  7. Blast radius — scope of impact from Agent 2

Decision Heuristics (Apply to every proposal)

Use these as hard filters before presenting options:

  1. Reuse first (DRY): prefer existing modules/components/patterns over new ones.

  2. KISS: choose the least complex approach that meets requirements.

  3. YAGNI: do not add extensibility/abstractions unless current requirement needs it.

  4. Single source of truth: avoid duplicated state/data paths.

  5. User trust/safety: no risky shortcuts that could create silent bad outcomes.

  6. Original scenario — the single target scenario from Phase 1, surfaced verbatim

  7. Current UX — what the user sees and can do today (from Agent 3, surfaced here verbatim)

  8. Post-change UX — what the user will see after the change (from Agent 3, surfaced here verbatim)

  9. Current behavior — what the code does today

  10. Constraints — what must not change (public API, test contracts, style rules)

  11. Style rules — the extracted cheatsheet from Agent 4

  12. Blast radius — scope of impact from Agent 2


Phase 3 — Present 3 Approaches

Use references/approach-template.md for consistent output format.

Rank by: minimal diff + style alignment first -> more involved last.

Each option must include one regression probe describing how to verify no duplicate trigger/clobber regressions were introduced.

For each option ask: "Would a maintainer approve this PR without asking for changes?"

Reason from first principles: work backwards from the goal — what is the simplest change that satisfies the requirement without introducing concepts the codebase doesn't already use?

After the user selects an option, emit a workflow handoff packet with:

  • Chosen approach
  • Implementation steps
  • Verification steps
  • PR summary bullets
  • Files likely to change
  • Tests to add/update
  • Risks / rollback notes
  • Commit/PR summary draft

Phase 4 — Hard Stop

Present the 3 options and wait for explicit user selection.

Do not begin implementation until the user picks an approach.

Expand your agent's capabilities with these related and highly-rated skills.

iamhenry/ai-project-starter-kit

verification-gate

Reusable verification gate for completed work before commit or merge. Use when implementation is done and Claude must prove the task works, verify the main user flow, choose between browser-flow, browser-static, or non-browser validation, and return a PASS/FAIL/BLOCKED verdict with evidence. When browser verification is needed, rely on the agent-browser skill for browser actions, screenshots, and recordings.

5 3
Explore
iamhenry/ai-project-starter-kit

osgrep

Semantic code search using natural language queries. Use when users ask "where is X implemented", "how does Y work", "find the logic for Z", or need to locate code by concept rather than exact text. Returns file paths with line numbers and code snippets.

5 3
Explore
iamhenry/ai-project-starter-kit

napkin

Maintain a per-repo napkin file that tracks mistakes, corrections, and what works. Activates EVERY session, unconditionally. Read the napkin before doing anything. Write to it continuously as you work — not just at session boundaries. Log your own mistakes, not just user corrections. The napkin lives in the repo at `.opencode/napkin.md`.

5 3
Explore
iamhenry/ai-project-starter-kit

dogfood

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

5 3
Explore
iamhenry/ai-project-starter-kit

tmux

Manage concurrent background processes using tmux. Use when spawning dev servers, running long-running tasks, monitoring multiple processes, or capturing output from background commands without blocking the main session.

5 3
Explore
iamhenry/ai-project-starter-kit

viral-research

Viral content research and DNA extraction for Instagram Reels. Use this skill whenever you need to research what's performing in a niche on Instagram, find viral faceless Reels, download and analyze them frame-by-frame, identify patterns, and produce a structured research brief. Trigger whenever the user mentions viral content research, Instagram research, Reel analysis, content DNA, swipe file building, niche research, competitor analysis for social content, or wants to understand why certain content performs. Also trigger when the user wants to find content formats to adapt, study what's working in a niche, or build a research-backed content strategy. This skill is research-only — it does not generate or publish content.

5 3
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results