con un clic
investigate-issue
// Investigate a GitHub issue - fetch info, update labels, analyze code/reproduce, report findings, and optionally fix. Usage: /investigate-issue <issue-url-or-number>
// Investigate a GitHub issue - fetch info, update labels, analyze code/reproduce, report findings, and optionally fix. Usage: /investigate-issue <issue-url-or-number>
| name | investigate-issue |
| description | Investigate a GitHub issue - fetch info, update labels, analyze code/reproduce, report findings, and optionally fix. Usage: /investigate-issue <issue-url-or-number> |
Investigate a GROWI GitHub issue end-to-end: fetch details, label it, analyze or reproduce the problem, report findings, and proceed to fix if approved.
This skill supports two execution modes:
--auto or when invoked from a routine): stop gates are crossed automatically when confidence is HIGH; only stop when confidence is MEDIUM or LOW$ARGUMENTS is either:
https://github.com/growilabs/growi/issues/9999999999--auto appended to enable autonomous modeParse the issue number from whichever form is provided. Detect --auto flag to set mode = autonomous; otherwise mode = interactive.
At each decision gate, assess confidence before deciding whether to ask the user.
CONFIDENCE levels:
| Level | Meaning | Action in autonomous mode | Action in interactive mode |
|---|---|---|---|
| HIGH | Evidence is clear, risk is low, path forward is unambiguous | Proceed autonomously — state the evidence and the decision made | Ask user (present recommendation clearly) |
| MEDIUM | Some evidence exists but ambiguity remains, or blast radius is larger than expected | Stop and ask — present findings and your recommendation | Ask user |
| LOW | Evidence is thin, multiple theories, or the change is risky | Stop and ask — present what is known and what is missing | Ask user |
When stopping in autonomous mode (MEDIUM or LOW), present:
Run the following to get full issue details:
gh issue view {ISSUE_NUMBER} --repo growilabs/growi --json number,title,body,labels,comments,createdAt,author,url
Extract and display:
Before applying any labels, fetch the exact label names from the repository:
gh label list --repo growilabs/growi --json name --limit 100
Use these exact names when calling --remove-label or --add-label. Label names in this repo include emoji prefixes (e.g. "0️⃣ phase/new", "1️⃣ phase/under-investigation"), so always look them up rather than guessing.
Remove the phase/new label (if present) and add phase/under-investigation, using the exact names returned above:
# Remove phase/new (use exact name from label list, e.g. "0️⃣ phase/new")
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --remove-label "{EXACT_PHASE_NEW_LABEL}"
# Add phase/under-investigation (use exact name from label list, e.g. "1️⃣ phase/under-investigation")
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --add-label "{EXACT_PHASE_UNDER_INVESTIGATION_LABEL}"
If phase/new is not present, skip the removal step and only add phase/under-investigation.
Determine the reported GROWI version from the issue body or comments.
Get the current master major version:
cat apps/app/package.json | grep '"version"'
If the reported major version matches master's major version → proceed directly to Step 3-B.
If the reported major version is older than master's major version:
Autonomous confidence assessment — before asking, gather evidence:
Spawn a subagent to do a targeted search in the current codebase for any code paths, symptoms, or identifiers mentioned in the issue (error messages, function names, UI element names, API endpoints). Instruct the subagent to determine whether the issue is likely still present in master.
Then assess confidence:
Reported version is v{X}.x, master is v{Y}.x. Related code has changed significantly (see evidence below). Recommendation: Continue on master to check if the behavior persists. Would you like me to: 1) Continue on master, 2) Check out v{X}.x tag, 3) Close as outdated?
Reported version is v{X}.x, master is v{Y}.x. Could not locate relevant code in master. Would you like me to: 1) Check out v{X}.x tag, 2) Continue on master anyway, 3) Close as outdated?
In interactive mode, always ask regardless of confidence. Present the evidence gathered and your recommendation.
Search the codebase for relevant code related to the reported symptoms:
git log --oneline -20 -- {relevant-file}
If code analysis alone is insufficient to confirm the root cause, attempt reproduction:
turbo run dev
If the problem is confirmed (root cause found in code OR reproduction succeeded):
# Use exact label names from the label list fetched in Step 2
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --remove-label "{EXACT_PHASE_UNDER_INVESTIGATION_LABEL}"
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --add-label "{EXACT_PHASE_CONFIRMED_LABEL}"
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --add-label "type/bug"
CRITICAL: Do NOT modify any source files in this step. Step 4 is analysis and planning only. Implementing code changes before the gate in Step 4-C is strictly forbidden.
Present a clear summary:
## Investigation Results for #{ISSUE_NUMBER}: {TITLE}
**Status**: Confirmed / Unconfirmed / Needs reproduction
### Root Cause
{Describe what was found — file paths, line numbers, logic errors, etc.}
### Evidence
{Code snippets, git log entries, or reproduction steps that confirm the finding}
### Fix Plan (not yet implemented)
{High-level description of the fix approach, if a cause was found.
List specific files and changes needed, but do NOT apply them yet.}
CRITICAL — Language rule: Detect the language of the issue body (from Step 1) and write the comment strictly in that language, regardless of the language used in this conversation. The issue body language takes absolute priority over the conversation language.
Post the findings as a GitHub issue comment:
gh issue comment {ISSUE_NUMBER} --repo growilabs/growi --body "$(cat <<'EOF'
## Investigation Results
**Status**: [Confirmed / Under investigation]
### Root Cause
{root cause description}
### Evidence
{relevant code locations, snippets, or reproduction steps}
### Fix Plan
{fix approach — files and changes needed}
---
*Investigated by Claude Code*
EOF
)"
Confidence assessment — evaluate before deciding:
Assess confidence based on:
| Situation | Confidence |
|---|---|
| Root cause pinpointed + fix is surgical (1-3 files) + low risk | HIGH |
| Root cause identified but fix touches multiple modules or has side effects | MEDIUM |
| Root cause unconfirmed, multiple theories, or complex fix | LOW |
In autonomous mode:
Investigation complete. Root cause [found/not confirmed]. Fix confidence: {MEDIUM/LOW} because {specific reason}. Recommendation: {your recommended action with reasoning} Would you like me to: 1) Proceed with the fix, 2) Investigate further ({what specifically}), 3) Stop here?
In interactive mode:
Always ask, presenting confidence level and recommendation clearly.
MANDATORY — Do this FIRST, before creating a branch or touching any files.
Use the exact label name from the label list fetched in Step 2 (e.g. "4️⃣ phase/WIP"):
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --add-label "{EXACT_PHASE_WIP_LABEL}"
Always create a dedicated fix branch before touching any source files.
Never commit fixes to master or the current branch directly.
Branch naming convention: fix/{ISSUE_NUMBER}-{short-description}
git checkout -b fix/{ISSUE_NUMBER}-{short-description}
turbo run lint --filter @growi/app
turbo run test --filter @growi/app
fix(scope): brief description of fix
Fixes #ISSUE_NUMBER
Confidence assessment — evaluate after implementation:
| Situation | Confidence |
|---|---|
| All tests pass + lint passes + fix stays within originally scoped files | HIGH |
| Tests pass but warnings exist, or fix expanded beyond original scope | MEDIUM |
| Tests fail, lint errors, or unexpected scope expansion | LOW |
In autonomous mode:
Implementation complete on
fix/{ISSUE_NUMBER}-{short-description}. PR confidence: {MEDIUM/LOW} because {specific reason — e.g., "2 tests failing in unrelated module", "fix expanded to touch auth middleware"}. Recommendation: {your recommended action} Would you like me to: 1) Create a PR, 2) Review first, 3) Stop here?
In interactive mode:
Always ask, presenting confidence level and recommendation clearly.
gh pr create \
--repo growilabs/growi \
--title "fix: {brief description}" \
--body "$(cat <<'EOF'
## Summary
{description of the fix}
## Root Cause
{root cause identified during investigation}
## Changes
- {bullet list of changes}
## Test Plan
- [ ] {manual test step 1}
- [ ] {manual test step 2}
Closes #{ISSUE_NUMBER}
EOF
)"
After the PR is created, update the labels:
# Remove WIP label
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --remove-label "{EXACT_PHASE_WIP_LABEL}"
# Add resolved label
gh issue edit {ISSUE_NUMBER} --repo growilabs/growi --add-label "{EXACT_PHASE_RESOLVED_LABEL}"
gh and stopgh is not authenticated: instruct the user to run gh auth loginGROWI main application (apps/app) specific commands and scripts. Auto-invoked when working in apps/app.
Auto-invoked when modifying page transition logic, global atom hydration, or the `[[...path]]` dynamic route. Explains the data flow from SSR/client navigation to page rendering, and the hydration-vs-subsequent-sync rule for global atoms (`currentPathnameAtom`, `currentUserAtom`, `isMaintenanceModeAtom`).
Organize and clean up specification documents after implementation completion. Removes implementation details while preserving essential context for future refactoring.
Initialize a new specification with detailed project description
Quick spec generation with interactive or automatic mode
GROWI apps/app Turbopack configuration, module optimization, and build measurement tooling. Auto-invoked when working in apps/app.