Investigate a plain-language problem description by deeply exploring the codebase, then create a structured GitHub issue with technical findings. Prequel to build-from-issue — maps vague ideas to concrete, buildable issues. Trigger keywords - spike, investigate, explore, research issue, technical investigation, create spike, new spike, feasibility, codebase exploration.
Investigate a problem, map it to the codebase, and produce a structured GitHub issue ready for build-from-issue.
A spike is an exploratory investigation. The user has a vague idea — a feature they want, a bug they've noticed, a performance concern — but hasn't mapped it to code, assessed feasibility, or structured it as a buildable issue. This skill does that mapping.
gh CLI must be authenticated (gh auth status)User describes a problem
│
├─ Step 1: Gather the problem statement
│ └─ Ask ONE round of clarifying questions if genuinely needed
│
├─ Step 2: Deep codebase investigation via principal-engineer-reviewer
│ └─ Map the problem to code, assess feasibility, identify risks
│
├─ Step 3: Determine labels from the repo
│
├─ Step 4: Create a GitHub issue with structured findings
│
└─ Step 5: Report to user with issue URL and next steps
The user provides a problem description. This could be:
Extract from the user's input:
If the problem is too vague to determine which area of the codebase to investigate, ask ONE round of clarifying questions. Do not over-interrogate. Examples of when to ask:
Examples of when NOT to ask:
This is the core of the skill. Use the Task tool with the principal-engineer-reviewer sub-agent to perform a thorough codebase investigation.
Task tool with subagent_type="principal-engineer-reviewer"
The prompt to the reviewer must instruct it to:
Identify which components/subsystems are involved. Don't just guess from names — read the code to confirm.
Read the relevant source files thoroughly. Not just grep for keywords — actually read and understand the logic. Follow the call chain from entry point through to the relevant behavior.
Map the current architecture for the affected area. How do the components interact? What's the data flow? Where are the boundaries?
Identify the exact code paths that would need to change. Provide file paths and line numbers. Name the functions, structs, and modules.
Assess feasibility and complexity:
Identify risks, edge cases, and design decisions that need human input. What could go wrong? What trade-offs exist? What decisions shouldn't be made by an agent?
Check for existing patterns in the codebase that should be followed. If there's a convention for how similar features are implemented, note it. The implementation should be consistent.
Look at relevant tests to understand test coverage expectations. What test patterns exist? What level of coverage is expected for this area?
Check architecture docs in the architecture/ directory for relevant documentation about the affected subsystems.
Determine the issue type: feat, fix, refactor, chore, perf, or docs.
Include in the prompt to the reviewer:
The reviewer will return a detailed analysis. You'll use this to populate the issue body (Step 4). The issue should contain both the stakeholder-readable summary and the full technical investigation — everything in one place.
Fetch the available labels from the repository:
gh label list --limit 100
Based on the investigation results, select appropriate labels:
area:sandbox, area:proxy, area:policy, area:cli)state:review-ready — the issue is ready for human review upon creationCreate the issue with a structured body containing both the stakeholder-readable summary and the full technical investigation. The title should follow conventional commit format.
gh issue create \
--title "<type>: <concise description of the problem/feature>" \
--label "<area:component>" --label "state:review-ready" \
--body "$(cat <<'EOF'
## Problem Statement
<What and why — refined from the user's description. 2-4 sentences. Written for stakeholders, not just engineers.>
## Technical Context
<What the investigation found about the current architecture in the affected area. How things work today and why a change is needed.>
## Affected Components
| Component | Key Files | Role |
|-----------|-----------|------|
| <component> | `<file1>`, `<file2>` | <what this component does in the context of this change> |
| ... | ... | ... |
## Technical Investigation
### Architecture Overview
<How the affected subsystems work today. Include data flow, component interactions, and relevant design decisions. Reference architecture docs if applicable.>
### Code References
| Location | Description |
|----------|-------------|
| `<file>:<line>` | <what this code does and why it's relevant> |
| `<file>:<line>` | <what this code does and why it's relevant> |
| ... | ... |
### Current Behavior
<What happens today in the code paths that would change. Be specific — name functions, trace the flow.>
### What Would Need to Change
<Detailed breakdown of modifications needed, organized by component. Include specific functions and structs, but stop short of writing an implementation plan — that's `build-from-issue`'s job.>
### Alternative Approaches Considered
<If the investigation surfaced multiple viable approaches, describe them and note trade-offs. Flag which decisions need human input.>
### Patterns to Follow
<Existing patterns in the codebase that the implementation should be consistent with. Reference specific examples.>
## Proposed Approach
<High-level strategy — NOT a full implementation plan. That's `build-from-issue`'s job. Describe the direction, not the steps. 3-6 sentences.>
## Scope Assessment
- **Complexity:** <Low / Medium / High>
- **Confidence:** <High — clear path / Medium — some unknowns / Low — needs discussion>
- **Estimated files to change:** <count>
- **Issue type:** `<feat|fix|refactor|chore|perf|docs>`
## Risks & Open Questions
- <risk or unknown that needs human judgment>
- <design decision that could go either way>
- ...
## Test Considerations
- <what testing strategy makes sense for this change>
- <which test levels are needed: unit, integration, e2e>
- <any test infrastructure that may need to be added>
- <what tests exist for the affected area today, what patterns should be followed, any test infrastructure gaps>
---
*Created by spike investigation. Use `build-from-issue` to plan and implement.*
EOF
)"
Do NOT post a follow-up comment on the issue. All findings must be contained in the issue body itself.
Display the issue URL so it's easily clickable:
Created issue [#<number>](https://github.com/OWNER/REPO/issues/<number>)
After creating the issue, report:
Review the issue. Refine the proposed approach if needed, then use
build-from-issueon the issue to create an implementation plan and build it.
Everything goes in the issue body. Do NOT post follow-up comments. The issue body should contain both the stakeholder-readable summary and the full technical investigation, all in one place.
Do NOT create an implementation plan. The spike identifies the problem space and proposes a direction. The implementation plan is build-from-issue's responsibility, created after human review of the spike.
One round of clarification max. Don't turn this into an interrogation. If the user provides enough to identify the area of the codebase, start investigating.
The issue should save build-from-issue work. When build-from-issue runs, it reads the issue body as input context. The technical investigation section should contain enough detail that its principal-engineer-reviewer can build on the investigation rather than starting from scratch.
Cross-reference build-from-issue. Mention it as the natural next step in the issue body footer.
| Command | Description |
|---|---|
gh issue create --title "..." --body "..." --label "..." | Create a new issue |
gh label list --limit 100 | List available labels in the repo |
gh issue edit <id> --add-label "..." | Add labels to an issue |
gh issue view <id> --json number,title,body,state,labels | Fetch issue metadata |
User says: "Allow sandbox egress to private IP space via networking policy"
principal-engineer-reviewer to investigate:
is_internal_ip() SSRF check in proxy.rs that blocks RFC 1918 addressesopa.rs and crates/openshell-sandbox/data/sandbox-policy.regosandbox.proto for NetworkEndpointarchitecture/security-policy.md and architecture/sandbox.mdarea:sandbox, area:proxy, area:policy, state:review-readyfeat: allow sandbox egress to private IP space via networking policy — body includes both the summary and full investigation (code references, architecture context, alternative approaches)build-from-issue when ready."User says: "The proxy retry logic seems too aggressive — I'm seeing cascading failures under load"
principal-engineer-reviewer:
area:proxy, state:review-readyfix: proxy retry logic causes cascading failures under load — body includes both the summary and full investigation (retry code references, current behavior trace, comparison to standard backoff patterns)build-from-issue when ready."User says: "Policy evaluation is getting slow — can we cache compiled OPA policies?"
principal-engineer-reviewer:
area:policy, state:review-readyperf: cache compiled OPA policies to reduce evaluation latency — body includes both the summary and full investigation (compilation hot path, per-request overhead, cache invalidation strategies with trade-offs)build-from-issue when ready."