agentleFS
Kit4SomeKit4Some/Oh-my-ClaudeClaw/skills/investigate/SKILL.md

investigate

Skill4 starsChanged 9 months agoMITView on GitHub

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST. Fixing symptoms creates whack-a-mole debugging. Find the root cause, then fix it. Before executing this skill: Review returned memories for relevant past context, decisions, and patterns. If conflicting active tasks exist, warn the user before proceeding. If "false": do NOT proactively suggest other OpenClaw-CC skills during this session. Only run skills the user explicitly invokes. Before starting work, load relevant context from the 3-layer memory system: Use retrieved context to: - Avoid repeating…

74 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use qa-only, document-release and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AICreator-WindSkill

    qa-only

    纯 QA 报告工具。只生成 bug 报告,不修复。

    Also in 10 projects that use this

  • AICreator-WindSkill

    document-release

    技术作家工具。更新项目文档。

    Also in 9 projects that use this

  • ayudaySkill

    cso

    Chief Security Officer mode. Performs OWASP Top 10 audit, STRIDE threat modeling, attack surface analysis, auth flow verification, secret detection, dependency CVE scanning, supply chain risk assessment, and data classification review. Use when: "security audit", "threat model", "pentest review", "OWASP", "CSO review".

    Also in 7 projects that use this

  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 7 projects that use this

  • CodeWithBehnamSkill

    setup-browser-cookies

    Import cookies from your real browser (Comet, Chrome, Arc, Brave, Edge) into the headless browse session. Opens an interactive picker UI where you select which cookie domains to import. Use before QA testing authenticated pages.

    Also in 7 projects that use this

  • seek888Skill

    plan-devex-review

    Interactive developer experience plan review. Explores developer personas, benchmarks against competitors, designs magical moments, and traces friction points before scoring. Three modes: DX EXPANSION (competitive advantage), DX POLISH (bulletproof every touchpoint), DX TRIAGE (critical gaps only). Use when asked to "DX review", "developer experience audit", "devex review", or "API design review". Proactively suggest when the user has a plan for developer-facing products (APIs, CLIs, SDKs, libraries, platforms, docs). (gstack) Voice triggers (speech-to-text aliases): "dx review", "developer experience review", "devex review", "devex audit", "API design review", "onboarding review".

    Also in 5 projects that use this

  • +2 more from AICreator-Wind
  • +1 more from ayuday

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. 0 are common, 28 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 28

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before executing this skill:

    line 44
  2. Distinctive:

    If conflicting active tasks exist, warn the user before proceeding.

    line 57
  3. Very specific:

    If "false": do NOT proactively suggest other OpenClaw-CC skills during this session.

    line 68
  4. Distinctive:

    Only run skills the user explicitly invokes.

    line 69
  5. Distinctive:

    Before starting work, load relevant context from the 3-layer memory system:

    line 78
  6. Distinctive:

    Avoid repeating past mistakes

    line 92
  7. Distinctive:

    If critical related memories exist, summarize them before proceeding:

    line 97
  8. Distinctive:

    Check memory for related past bugs:

    line 104
  9. Distinctive:

    If insufficient context, ask ONE question via AskUserQuestion.

    line 132
  10. Distinctive:

    Write a minimal reproduction (test case, script, or command)

    line 145
  11. Distinctive:

    Run it and confirm the failure

    line 146
  12. Distinctive:

    If cannot reproduce → gather more evidence, do NOT proceed to fix

    line 147
  13. Distinctive:

    If reproduction succeeds, it becomes the regression test after the fix.

    line 149
  14. Distinctive:

    After forming root cause hypothesis, lock edits to the affected module:

    line 155
  15. Distinctive:

    If bug spans entire repo or scope is unclear, skip lock and note why.

    line 169
  16. Distinctive:

    Check if bug matches known patterns:

    line 175
  17. Distinctive:

    If unavailable, proceed with in-distribution knowledge

    line 188
  18. Distinctive:

    Before writing ANY fix, verify your hypothesis:

    line 194
  19. Distinctive:

    Add temporary log/assertion at suspected root cause.

    line 196
  20. Distinctive:

    If hypothesis is wrong → return to Stage 1 with new data.

    line 197
  21. Distinctive:

    3-strike rule: If 3 hypotheses fail, STOP.

    line 198
  22. Distinctive:

    After completing the workflow, persist results to the 3-layer memory system:

    line 269
  23. Distinctive:

    Read-only operations (search, list, status)

    line 340
  24. Distinctive:

    Every skill must end with one of these status codes:

    line 344
  25. Distinctive:

    3-strike rule: After 3 failed attempts at any step, STOP and escalate to user.

    line 355
  26. Distinctive:

    Do not continue guessing. Present what was tried and ask for direction.

    line 356
  27. Distinctive:

    Scope escalation: If fix/change touches 5+ files unexpectedly, pause and confirm with the user before proceeding.

    line 358
  28. Distinctive:

    Security uncertainty: If you are unsure about a security implication, STOP and escalate.

    line 361
  29. Distinctive:

    Verification requirement: Never claim DONE without evidence.

    line 364

“Common” is measured: kept by at least 6 in 10 of the 64 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly. Run: node scripts/gen-skill-docs.mjs -->

name: investigate description: > Systematic debugging with root cause investigation. Six stages: investigate, reproduce, analyze, hypothesize, implement, verify. Iron Law: no fixes without root cause. Triggers on "디버깅", "버그 찾아", "investigate", "왜 안 돼", "debug", "find the bug", "root cause", "에러 분석". allowed-tools:

  • Bash
  • Read
  • Write
  • Edit
  • Grep
  • Glob
  • Agent
  • AskUserQuestion
  • WebSearch hooks: PreToolUse:
    • matcher: "Edit" hooks:
      • type: command command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh" statusMessage: "Checking debug scope boundary..."
    • matcher: "Write" hooks:
      • type: command command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh" statusMessage: "Checking debug scope boundary..."

Investigate — Systematic Debugging

Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

Fixing symptoms creates whack-a-mole debugging. Find the root cause, then fix it.

Preamble

Before executing this skill:

  1. Load context from memory:
    memory_search(query: "{skill-relevant-query}", associative: true, limit: 5)
    memory_search(tag: "{skill-name}", limit: 3)
    Review returned memories for relevant past context, decisions, and patterns.
  2. Check OMC state for active work:
    state_get_status()
    If conflicting active tasks exist, warn the user before proceeding.
  3. Detect current branch (for git-related skills):
    git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "not-a-git-repo"
  4. Check proactive mode:
    state_read("occ-proactive")
    If "false": do NOT proactively suggest other OpenClaw-CC skills during this session. Only run skills the user explicitly invokes.
  5. Log skill activation:
    memory_daily_log(type: "note", entry: "Skill activated: /{skill-name}")

Memory Context Loading

Before starting work, load relevant context from the 3-layer memory system:

# Search for related past work
memory_search(query: "{task description}", associative: true, limit: 5)

# Search by relevant tags
memory_search(tag: "{relevant-tag}", limit: 3)

# Check for recent related daily logs
memory_search_date(start: "{7 days ago}", end: "{today}", category: "daily-logs", limit: 5)

Use retrieved context to:

  • Avoid repeating past mistakes
  • Build on previous decisions
  • Maintain consistency with established patterns
  • Reference related knowledge graph nodes

If critical related memories exist, summarize them before proceeding:

Found {N} related memories:
- {memory_1 title}: {brief relevance}
- {memory_2 title}: {brief relevance}

Check memory for related past bugs:

memory_search(query: "{error description}", tag: "bug")
memory_search(query: "{affected component}", tag: "debugging")

Stage 1 — Root Cause Investigation via OMC tracer

Delegate evidence gathering:

Agent(subagent_type: "oh-my-claudecode:tracer", prompt: "
  Investigate: {symptom_description}
  Gather evidence, trace code paths, form competing hypotheses.
  Do NOT fix anything. Output structured hypothesis report.
")

Use OMC code intelligence for precise tracing:

  • lsp_goto_definition — trace symbols to their source definitions
  • lsp_find_references — find all callers/usages of a function
  • lsp_hover — get type information and documentation
  • lsp_diagnostics — check for compiler/linter errors in affected files
  • ast_grep_search — find structural code patterns across the codebase
  1. Collect symptoms: Error messages, stack traces, reproduction steps. If insufficient context, ask ONE question via AskUserQuestion.
  2. Read the code: Trace from symptom back to potential causes.
  3. Check recent changes: git log --oneline -20 -- <affected-files>
  4. Reproduce: Can you trigger the bug deterministically?

Output: "Root cause hypothesis: ..." — specific, testable claim.


Stage 1.5 — Reproduction (NEW)

Before forming hypotheses, reproduce the bug:

  1. Write a minimal reproduction (test case, script, or command)
  2. Run it and confirm the failure
  3. If cannot reproduce → gather more evidence, do NOT proceed to fix

If reproduction succeeds, it becomes the regression test after the fix.


Stage 2 — Scope Lock

After forming root cause hypothesis, lock edits to the affected module:

FREEZE_CHECK="${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
if [ -x "$FREEZE_CHECK" ]; then
  STATE_DIR="${CLAUDE_PLUGIN_DATA:-${HOME}/.omc/state}"
  mkdir -p "$STATE_DIR"
  echo "<detected-directory>/" > "$STATE_DIR/freeze-dir.txt"
  echo "Debug scope locked to: <detected-directory>/"
fi

Tell user: "Edits restricted to <dir>/ for this debug session. This prevents changes to unrelated code. Run /unfreeze to remove."

If bug spans entire repo or scope is unclear, skip lock and note why.


Stage 3 — Pattern Analysis

Check if bug matches known patterns:

PatternSignatureWhere to look
Race conditionIntermittent, timing-dependentConcurrent access to shared state
Nil/null propagationNoMethodError, TypeErrorMissing guards on optional values
State corruptionInconsistent data, partial updatesTransactions, callbacks, hooks
Integration failureTimeout, unexpected responseExternal API calls, service boundaries
Configuration driftWorks locally, fails elsewhereEnv vars, feature flags, DB state
Stale cacheShows old data, fixes on clearRedis, CDN, browser cache

External search (sanitize first — strip hostnames, IPs, paths, customer data):

  • WebSearch: "{framework} {generic error type}"
  • If unavailable, proceed with in-distribution knowledge

Stage 4 — Hypothesis Testing

Before writing ANY fix, verify your hypothesis:

  1. Add temporary log/assertion at suspected root cause. Run reproduction. Does evidence match?
  2. If hypothesis is wrong → return to Stage 1 with new data. Do NOT guess.
  3. 3-strike rule: If 3 hypotheses fail, STOP. AskUserQuestion:
    3 hypotheses tested, none match. This may be an architectural issue rather than a simple bug.
    
    A) Continue investigating — new hypothesis: [describe]
    B) Escalate for human review — someone who knows the system
    C) Add logging and wait — instrument the area and catch it next time

Red flags — slow down if you see:

  • "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 — wrong layer, not wrong code.

Log each hypothesis test result:

memory_store(category: "knowledge", subcategory: "debugging",
  title: "Investigation: {bug} - Hypothesis {N}",
  content: "{hypothesis, test method, result, verdict}",
  tags: ["investigation", "{component}"], importance: 5)

Stage 5 — Implementation via OMC executor (ONLY after root cause confirmed)

Agent(subagent_type: "oh-my-claudecode:executor", model: "opus", prompt: "
  Root cause confirmed: {root_cause}
  Implement fix: {description}
  Files: {file_list}
  Constraints: minimal diff, fix root cause not symptom
")

Safety limits:

  • 5+ files → AskUserQuestion about blast radius
  • 3 failed fix attempts → escalate

Stage 6 — Verification via OMC verifier

Agent(subagent_type: "oh-my-claudecode:verifier", prompt: "
  Verify fix for: {bug_description}
  Root cause: {root_cause}
  Fix: {fix_description}
  1. Confirm original symptom no longer reproduces
  2. Run test suite
  3. Check for regressions in related areas
")

Output structured debug report:

═══════════════════════════════════════
DEBUG REPORT
═══════════════════════════════════════
Symptom:         {what the user observed}
Root cause:      {what was actually wrong}
Fix:             {what was changed, with file:line references}
Evidence:        {test output, reproduction showing fix works}
Regression test: {file:line of the new test}
Related:         {past bugs in same area, architectural notes}
Status:          DONE | DONE_WITH_CONCERNS | BLOCKED
═══════════════════════════════════════

Memory Persistence

After completing the workflow, persist results to the 3-layer memory system:

Required Actions

  1. Log completion to daily log:
    memory_daily_log(type: "done", entry: "{skill-name}: {brief result summary}")
  2. Store significant findings (importance ≥ 6):
    memory_store(
      category: "{appropriate category}",
      title: "{descriptive title}",
      content: "{structured result content}",
      tags: ["{skill-name}", "{project}", "{relevant-tags}"],
      importance: {6-10 based on significance}
    )
  3. Link to related memories (if applicable):
    memory_link(source: "{new_memory_id}", target: "{related_id}", relation: "{related|derived|refines}")

Category Routing

Content TypeCategorySubcategory
Bug fix / debuggingknowledgedebugging
Code review resultsprojects{project-name}
Design decisionsprojects{project-name}
Research findingsknowledge{topic}
Release / deployprojects{project-name}
Person-related infopeople—
Task / action itemtasks—

Messenger Notification

Send notifications for significant events via messenger:

When to Notify

EventPlatformPriority
Task/pipeline completedtelegramNormal
Verification failedtelegramHigh
Long-running task done (10+ min)telegramNormal
Critical error or blockertelegramHigh
PR created / release shippedallNormal
Importance ≥ 8 memory createdtelegramNormal

Notification Format

messenger_send(
  platform: "telegram",
  message: "[{skill-name}] {status_emoji} {brief description}\n\n{details if relevant}"
)

Status Emojis:

  • Completed successfully: ✅
  • Completed with warnings: ⚠️
  • Failed / blocked: ❌
  • Needs attention: 🔔

Do NOT Notify

  • Routine memory operations
  • Intermediate progress steps
  • Read-only operations (search, list, status)

Completion Status Protocol

Every skill must end with one of these status codes:

CodeMeaningWhen to Use
DONEAll steps completed, evidence providedRoot cause found + fix verified, PR created, review finished
DONE_WITH_CONCERNSCompleted with warnings or caveatsTests pass but coverage dropped, fix applied but can't fully verify
BLOCKEDCannot proceed, requires user intervention3 failed attempts, missing permissions, external dependency down
NEEDS_CONTEXTMissing information to continueUnclear requirements, need user clarification

Escalation Rules

  1. 3-strike rule: After 3 failed attempts at any step, STOP and escalate to user. Do not continue guessing. Present what was tried and ask for direction.
  2. Scope escalation: If fix/change touches 5+ files unexpectedly, pause and confirm with the user before proceeding.
  3. Security uncertainty: If you are unsure about a security implication, STOP and escalate. Never guess on security.
  4. Verification requirement: Never claim DONE without evidence.
    • "Should work" → RUN IT. Confidence is not evidence.
    • "Already tested earlier" → Code changed since. Test again.
    • "Trivial change" → Trivial changes break production.

Output Format

═══════════════════════════════════════
Status: {DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT}
Summary: {one-line description of outcome}
Evidence: {test output, verification results, or blocking reason}
═══════════════════════════════════════

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.