gstack-openclaw-investigate
- Repo stars 110,511
- Forks 16,437
- Author updated Jun 14, 2026, 06:40 PM
- Author repo gstack
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @garrytan · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Env read
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: gstack-openclaw-investigate
description: Use when asked to debug, fix a bug, investigate an error, or do root cause analysis, and when us…
category: engineering
runtime: no special runtime
---
# gstack-openclaw-investigate output preview
## PART A: Task fit
- Use case: Use when asked to debug, fix a bug, investigate an error, or do root cause analysis, and when users report errors, stack traces, unexpected behavior, or say something stopped working. Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find. Find the root cause, then fix it. runs entirely ….
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Iron Law / Phase 1: Root Cause Investigation / Phase 2: Pattern Analysis” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Use when asked to debug, fix a bug, investigate an error, or do root cause analysis, and when users report errors, stack traces, unexpected behavior, or say something stopped working. Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find. Find the root cause, then fix it. runs entirely …”.
- **02** When the source has headings, the agent prioritizes “Iron Law / Phase 1: Root Cause Investigation / Phase 2: Pattern Analysis” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, read environment variables.
Start with a small task and check whether the result follows “Iron Law / Phase 1: Root Cause Investigation / Phase 2: Pattern Analysis”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: gstack-openclaw-investigate
description: Use when asked to debug, fix a bug, investigate an error, or do root cause analysis, and when us…
category: engineering
source: garrytan/gstack
---
# gstack-openclaw-investigate
## When to use
- Use when asked to debug, fix a bug, investigate an error, or do root cause analysis, and when users report errors, sta…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Iron Law / Phase 1: Root Cause Investigation / Phase 2: Pattern Analysis” and keep inference separate from source facts.
- read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "gstack-openclaw-investigate" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Iron Law / Phase 1: Root Cause Investigation / Phase 2: Pattern Analysis
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, read environment variables | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Systematic Debugging
Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find. Find the root cause, then fix it.
Phase 1: Root Cause Investigation
Gather context before forming any hypothesis.
Collect symptoms: Read the error messages, stack traces, and reproduction steps. If the user hasn't provided enough context, ask ONE question at a time. Don't ask five questions at once.
Read the code: Trace the code path from the symptom back to potential causes. Search for all references, read the logic around the failure point.
Check recent changes:
git log --oneline -20 -- <affected-files>Was this working before? What changed? A regression means the root cause is in the diff.
Reproduce: Can you trigger the bug deterministically? If not, gather more evidence before proceeding.
Check memory for prior debugging sessions on the same area. Recurring bugs in the same files are an architectural smell.
Output: "Root cause hypothesis: ..." ... a specific, testable claim about what is wrong and why.
Phase 2: Pattern Analysis
Check if this bug matches a known pattern:
Race condition ... Intermittent, timing-dependent. Look at concurrent access to shared state.
Nil/null propagation ... NoMethodError, TypeError. Missing guards on optional values.
State corruption ... Inconsistent data, partial updates. Check transactions, callbacks, hooks.
Integration failure ... Timeout, unexpected response. External API calls, service boundaries.
Configuration drift ... Works locally, fails in staging/prod. Env vars, feature flags, DB state.
Stale cache ... Shows old data, fixes on cache clear. Redis, CDN, browser cache.
Also check:
- Known issues in the project for related problems
- Git log for prior fixes in the same area. Recurring bugs in the same files are an architectural smell, not a coincidence.
External search: If the bug doesn't match a known pattern, search for the error type online. Sanitize first: strip hostnames, IPs, file paths, SQL, customer data. Search the error category, not the raw message.
Phase 3: Hypothesis Testing
Before writing ANY fix, verify your hypothesis.
Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match?
If the hypothesis is wrong: Search for the error (sanitize sensitive data first). Return to Phase 1. Gather more evidence. Do not guess.
3-strike rule: If 3 hypotheses fail, STOP. Tell the user:
"3 hypotheses tested, none match. This may be an architectural issue rather than a simple bug."
Options:
- Continue investigating with a new hypothesis (describe it)
- Escalate for human review (needs someone who knows the system)
- Add logging and wait (instrument the area and catch it next time)
Red flags ... if you see any of these, slow down:
- "Quick fix for now" ... there is no "for now." Fix it right or escalate.
- Proposing a fix before tracing data flow ... you're guessing.
- Each fix reveals a new problem elsewhere ... wrong layer, not wrong code.
Phase 4: Implementation
Once root cause is confirmed:
Fix the root cause, not the symptom. The smallest change that eliminates the actual problem.
Minimal diff: Fewest files touched, fewest lines changed. Resist the urge to refactor adjacent code.
Write a regression test that:
- Fails without the fix (proves the test is meaningful)
- Passes with the fix (proves the fix works)
Run the full test suite. No regressions allowed.
If the fix touches >5 files: Flag the blast radius to the user before proceeding. That's large for a bug fix.
Phase 5: Verification & Report
Fresh verification: Reproduce the original bug scenario and confirm it's fixed. This is not optional.
Run the test suite.
Output a structured debug report:
DEBUG REPORT
- Symptom: what the user observed
- Root cause: what was actually wrong
- Fix: what was changed, with file references
- Evidence: test output, reproduction showing fix works
- Regression test: location of the new test
- Related: prior bugs in same area, architectural notes
- Status: DONE | DONE_WITH_CONCERNS | BLOCKED
Save the report to memory/ with today's date so future sessions can reference it.
Important Rules
- 3+ failed fix attempts: STOP and question the architecture. Wrong architecture, not failed hypothesis.
- Never apply a fix you cannot verify. If you can't reproduce and confirm, don't ship it.
- Never say "this should fix it." Verify and prove it. Run the tests.
- If fix touches >5 files: Flag to user before proceeding.
- Completion status:
- DONE ... root cause found, fix applied, regression test written, all tests pass
- DONE_WITH_CONCERNS ... fixed but cannot fully verify (e.g., intermittent bug, requires staging)
- BLOCKED ... root cause unclear after investigation, escalated
Decide Fit First
Design Intent
How To Use It
Boundaries And Review