ワンクリックで
understand-issue
Collaboratively investigate a GitHub issue or bug — trace history, understand architecture, diagnose root cause
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Collaboratively investigate a GitHub issue or bug — trace history, understand architecture, diagnose root cause
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Orchestrate parallel Mastra Code headless instances to debug and fix multiple GitHub issues simultaneously
Guided interactive PR review — understand the history and context before forming opinions
React performance optimization guidelines from Mastra Engineering. This skill should be used when writing, reviewing, or refactoring React code to ensure optimal performance patterns. Triggers on tasks involving React components, data fetching, bundle optimization, or performance improvements.
REQUIRED and PRIMARY testing approach for packages/playground and packages/playground-ui. Triggers on: adding or modifying hooks, pages, route components, data-fetching code, React Query interactions, or any test work in these packages. Generates Vitest tests that drive the real @mastra/client-js + React Query stack through MSW handlers and typed fixtures derived from @mastra/client-js response types. This is the #1 way to test the playground packages — ABOVE Playwright E2E. Use Playwright only for cross-page user journeys that MSW cannot model.
Interactive documentation quality review for Mastra docs. Use when auditing, reviewing, or critiquing Mastra documentation; checking docs against source code; validating code examples, API accuracy, or property completeness; checking whether docs follow the styleguide and deterministic linters; or evaluating whether a beginner or agent can follow a doc to complete a job. This skill keeps humans in the loop with ask_user and submit_plan, then always runs an agent-build eval after approved fixes.
How to build Mastra frontend interfaces with the @mastra/playground-ui design system. This skill should be used when creating or modifying any application UI — pages, components, styling, or tokens — in this repo or in an external consumer of the design system. The docs site has its own styling and is out of scope.
| name | understand-issue |
| description | Collaboratively investigate a GitHub issue or bug — trace history, understand architecture, diagnose root cause |
| goal | true |
Collaboratively investigate a GitHub issue or reported bug — trace the history of related code, understand the architecture involved, and work with the user to diagnose whether the issue is valid and what's actually causing it. Both you and the user should walk away with genuine understanding, not just a guess.
Do not produce walls of text. Responses should be short, dense, and information-dense. Minimize fluff. Be direct.
Pacing: Phases 1–3 are research — do them all proactively without stopping for user input. The first pause is Phase 4 (Diagnosis), where you present your findings and opinion for collaborative validation. Don't pause before that.
Shell note: gh output often contains ANSI color codes that break jq. Use gh's built-in --jq flag instead of piping to jq, or prefix commands with NO_COLOR=1.
Figure out what we're investigating.
--working-file <path> from $ARGUMENTS.--working-file is present, verify the file exists and read it first. Treat it as caller-provided context, follow its handoff instructions, and update that same file with findings before returning to the caller. Do not treat the working file as the final user-facing output. If the file does not exist, tell the user and end.The user may provide:
gh issue view <number> --json title,body,labels,comments,assignees,state,authorgit branch --show-current). If it contains what looks like an issue number (e.g. fix/1234, issue-567, bug/gh-890, feat/add-thing-1234), extract it and use gh issue view <number> to confirm it exists. If it resolves, use it. If not, move on.If it's unclear which issue or what the bug is, ask the user to clarify. Don't guess.
Identify everyone involved and gauge their context depth:
gh pr list --author <user> --state merged --limit 100 --json number --jq length) and issue count (gh issue list --author <user> --state all --limit 100 --json number --jq length). A first-time reporter vs a core contributor frames how you read the issue — a contributor likely knows the internals, a new user may be describing symptoms of a different root cause.Note (internally, don't pause here):
If the issue is too vague to investigate meaningfully, stop and say so — offer to investigate anyway, draft a comment asking for more info, or stop. Otherwise, move straight to Phase 2 without pausing.
Before diving into code, check whether this has been seen before.
gh issue list --search "<keywords>" --json number,title,state,labels --limit 20gh issue list --search "<keywords>" --state closed --json number,title,state,labels --limit 20gh pr list --search "<keywords>" --state all --json number,title,state --limit 20Note what you find — you'll present it alongside Phase 3 results. If something looks like a clear regression or duplicate, note it prominently. Don't stop here — move straight to Phase 3.
Now trace from the symptom into the codebase. Start from what the issue describes (error messages, unexpected behavior, specific features) and search for related code.
For each contributing area you identify, build real understanding now — don't defer it to Phase 4. You need to answer three questions per area before presenting it:
1. Why does this code exist? What problem was it originally written to solve? What was the codebase like before it was added?
git log --oneline -20 -- <file> — recent commit historygit log --oneline --all -20 -- <file> — cross-branch activitygit blame on the specific relevant lines — who wrote this, when, and what commit message explains why2. How does it fit architecturally? What are its relationships with other code?
3. How do the areas relate to each other? The contributing areas aren't isolated — understand how they interact:
You should understand the full story before presenting it. The user needs to see not just "this code exists" but "this code was written N months ago to solve X, was last changed by Y to fix Z, the current design assumes W, and it connects to area 2 because they share the same config instance."
Present the contributing areas you've found, with history, architecture, and how they interrelate. Then move straight to Phase 4 — don't pause here.
This is the critical phase. You've done the research — now form an opinion and present it for collaborative validation. The goal is to jointly determine: is this issue what it appears to be, and what's actually causing it?
Before diagnosing the technical cause, assess whether the issue is correctly framed. Consider:
State your assessment clearly. If you think the issue is misframed, say so with evidence.
If the cause is clear (one obvious chain of causality), say so directly:
Based on the investigation, I think this is [genuine bug / config issue / docs gap / XY problem].
Here's what's happening: [concise explanation of the causal chain, grounded in the code and history you traced].
[areas with history context, showing how they connect]
Do you agree?
A) Yes, that matches what I'm seeing
B) I'm not fully convinced — I think [specific part] might be different
C) I don't agree — I think the cause is more in the direction of [X]
D) I need to see more evidence before I can form an opinion
If there's genuine ambiguity (multiple plausible causes, or you're not sure), present the candidates and let the user help narrow it down:
I see [N] possible explanations for this:
1. **[area/explanation]** — [history + architecture context]. This would mean [implication].
2. **[area/explanation]** — [history + architecture context]. This would mean [implication].
I'm leaning toward [N] because [reason], but I'm not confident. What's your read?
A) I think it's [1] — let's dig deeper there
B) I think it's [2] — let's dig deeper there
C) I think it's something else — [user explains]
D) I need to see more code before I can tell
Form your own opinion first, but ask the user for theirs before asserting. "I've formed my opinion but I'd like to hear yours first" is fine. Don't be a pushover — if the user disagrees with your assessment and you have evidence, push back respectfully.
If Phase 4 didn't resolve the diagnosis — either because there's genuine ambiguity, the user disagrees, or more evidence is needed — explore specific areas interactively.
For each area:
This area was last changed in [commit] to fix [issue]. The current code assumes [X] but the reported bug suggests [Y] is happening instead.
A) That sounds like the cause — dig deeper here
B) Show me the test coverage for this path
C) What changed recently that could have broken this assumption?
D) I don't think this is it — let's try a different direction
E) I want to look at something specific — let me tell you where
Tailor options to what's actually relevant. If multiple areas are interacting to cause the issue, say so.
Repeat until the cause is clear and agreed upon.
Before wrapping up, check that the investigation actually produced understanding — not just a surface-level guess.
Present a concise summary of what you've learned:
Then check:
A) That matches my understanding — write it up
B) I'm not convinced about [specific part] — let's revisit
C) I think the cause is actually different — let me explain
D) I don't have enough understanding yet — keep exploring
Only move to the write-up after the user confirms they genuinely understand the issue.
If a working file was provided, update that same file with the full investigation and any requested outputs from its handoff instructions, then return to the caller so it can handle the lifecycle output. Otherwise, write .issue-review/UNDERSTANDING.md.
Capture:
Present the key findings to the user interactively before finalizing the file.
If --working-file is present, skip this phase by default and return to the caller.
Otherwise, offer to post the analysis to the GitHub issue:
A) Post a summary of this analysis as an issue comment
B) I'll handle it myself
C) This issue needs more info first — help me draft a comment asking for clarification
If the user chooses to post, draft the comment and present it for review before posting. Use gh issue comment <number> --body "<comment>". Keep it concise and useful — other contributors will read this. Focus on the root cause analysis and evidence, not the full investigation narrative.
If the GitHub API rate limit is low (gh api rate_limit --jq '.rate'), use the REST API fallback: gh api repos/{owner}/{repo}/issues/{number}/comments -f body="<comment>".