Skip to content
FunCoding

Search

Search docs, Skills and MCP

debug

Debug issues by investigating logs, database state, and git history

数据库与数据3.9k.claude/skills/debug/SKILL.md

Install

Send this to Claude Code, Codex or Cursor. The agent checks the Skill for safety first and installs it only after you confirm.

读取 https://funcoding.ai/skills/parcadei/continuous-claude-v3/debug/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

Debug

You are tasked with helping debug issues during manual testing or implementation. This command allows you to investigate problems by examining logs, database state, and git history without editing files. Think of this as a way to bootstrap a debugging session without using the primary window's context.

Initial Response

When invoked WITH a plan/ticket file:

I'll help debug issues with [file name]. Let me understand the current state.

What specific problem are you encountering?
- What were you trying to test/implement?
- What went wrong?
- Any error messages?

I'll investigate the logs, database, and git state to help figure out what's happening.

When invoked WITHOUT parameters:

I'll help debug your current issue.

Please describe what's going wrong:
- What are you working on?
- What specific problem occurred?
- When did it last work?

I can investigate logs, database state, and recent changes to help identify the issue.

Environment Information

You have access to these key locations and tools:

Logs:

  • Application logs (check project-specific locations)
  • Common locations: ./logs/, ~/.local/share/{app}/, /var/log/

Database (if applicable):

  • SQLite databases can be queried with sqlite3
  • Check project config for database locations

Git State:

  • Check current branch, recent commits, uncommitted changes
  • Similar to how commit and describe_pr commands work

Service Status:

  • Check running processes: ps aux | grep {service}
  • Check listening ports: lsof -i :{port}

Process Steps

Step 1: Understand the Problem

After the user describes the issue:

  1. Read any provided context (plan or ticket file):

    • Understand what they're implementing/testing
    • Note which phase or step they're on
    • Identify expected vs actual behavior
  2. Quick state check:

    • Current git branch and recent commits
    • Any uncommitted changes
    • When the issue started occurring

Step 2: Investigate the Issue

Spawn parallel Task agents for efficient investigation:

Task 1 - Check Recent Logs:
Find and analyze the most recent logs for errors:
1. Find latest logs: ls -t ./logs/*.log | head -1 (or project-specific location)
2. Search for errors, warnings, or issues around the problem timeframe
3. Note the working directory if shown
4. Look for stack traces or repeated errors
Return: Key errors/warnings with timestamps
Task 2 - Database State (if applicable):
Check the current database state:
1. Locate database file (check project config)
2. Connect: sqlite3 {database_path}
3. Check schema: .tables and .schema for relevant tables
4. Query recent data based on the issue
5. Look for stuck states or anomalies
Return: Relevant database findings
Task 3 - Git and File State:
Understand what changed recently:
1. Check git status and current branch
2. Look at recent commits: git log --oneline -10
3. Check uncommitted changes: git diff
4. Verify expected files exist
5. Look for any file permission issues
Return: Git state and any file issues

Step 3: Present Findings

Based on the investigation, present a focused debug report:

## Debug Report

### What's Wrong
[Clear statement of the issue based on evidence]

### Evidence Found

**From Logs**:
- [Error/warning with timestamp]
- [Pattern or repeated issue]

**From Database** (if applicable):
```sql
-- Relevant query and result
[Finding from database]

From Git/Files:

  • [Recent changes that might be related]
  • [File state issues]

Root Cause

[Most likely explanation based on evidence]

Next Steps

  1. Try This First:

    [Specific command or action]
    
  2. If That Doesn't Work:

    • Restart relevant services
    • Check browser console for frontend errors
    • Run with debug flags enabled

Can't Access?

Some issues might be outside my reach:

  • Browser console errors (F12 in browser)
  • MCP server internal state
  • System-level issues

Would you like me to investigate something specific further?


## Important Notes

- **Focus on manual testing scenarios** - This is for debugging during implementation
- **Always require problem description** - Can't debug without knowing what's wrong
- **Read files completely** - No limit/offset when reading context
- **Think like `commit` or `describe_pr`** - Understand git state and changes
- **Guide back to user** - Some issues (browser console, MCP internals) are outside reach
- **No file editing** - Pure investigation only

## Quick Reference

**Find Latest Logs**:
```bash
ls -t ./logs/*.log | head -1
# Or check project-specific log locations

Database Queries (SQLite):

sqlite3 {database_path} ".tables"
sqlite3 {database_path} ".schema {table}"
sqlite3 {database_path} "SELECT * FROM {table} ORDER BY created_at DESC LIMIT 5;"

Service Check:

ps aux | grep {service_name}
lsof -i :{port}

Git State:

git status
git log --oneline -10
git diff

Remember: This command helps you investigate without burning the primary window's context. Perfect for when you hit an issue during manual testing and need to dig into logs, database, or git state.

Similar Skills

xlsx
anthropics/skills180k

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

Databases & data

deprecation-and-migration
addyosmani/agent-skills103k

deprecation-and-migration

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

Databases & data

host-observer
thedotmack/claude-mem98k

host-observer

Use this when fulfilling claude-mem observer jobs on Grok Bot: reply only skip_summary or one full observation XML, never prose.

Databases & data

babysit
thedotmack/claude-mem98k

babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

Databases & data

mem-search
thedotmack/claude-mem98k

mem-search

Search claude-mem's persistent cross-session memory database. Use when user asks "did we already solve this?", "how did we do X last time?", or needs work from previous sessions.

Databases & data

Agent Cost Report
thedotmack/claude-mem98k

Agent Cost Report

Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.

Databases & data