用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/htlin222/dotfiles --skill debug命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
依 ticket/issue 產出初版實作 — 解析需求、從最新 develop 切出符合命名規範的分支、寫出實作、跑既有測試與 lint、conventional commit,然後交棒給 /simplify。Use when the user types /develop, or asks to start implementing a ticket, issue, or feature request end-to-end from requirement to first commit.
Put a website behind a Cloudflare Access (Zero Trust) login gate, or remove one, entirely from the CLI — no dashboard GUI. Use when the user wants to password/email-protect a hostname, gate a Cloudflare Pages or Workers site, restrict a site to specific emails, set up Zero Trust Access, or asks about "cf-gate". Manages Access applications and allow-email policies via the Cloudflare API using a token in the skill's .env. Note: wrangler does NOT manage Access — this uses the Cloudflare REST API directly.
Curate a GitHub repository's wiki (the separate repo.wiki.git) into a coherent, tightly written set of pages: Home, Introduction (project + features), Roadmap, Gotchas/Lessons, Tech Debt, and an Architecture page taught through the book *Head First Software Architecture* — with mermaid diagrams, in the repo's own language and style, then commit and push. Use when the user wants to create, update, curate, or document a GitHub repo's wiki; write or refresh wiki pages; add an architecture / design page to a wiki; enable a wiki; or asks for "/wiki-git". Handles both first-time wikis and updates to existing ones, and can fan out across many repos.
基于 SOC 职业分类
正在显示 SKILL.md
| name | debug |
| description | Debug errors and unexpected behavior with log analysis. Use for issues and error messages. |
Systematic debugging for errors, test failures, unexpected behavior, and production issues.
/debug [issue] [--logs] [--correlate] [--trace] [--type bug|build|perf|deploy]
| Flag | Purpose |
|---|---|
--logs | Enable log pattern analysis (error spikes, frequency, types) |
--correlate | Run SQL correlation queries on structured logs |
--trace | Deep stack trace analysis with context |
--type | Issue category: bug, build, perf(ormance), deploy(ment) |
--logs)--correlate)--trace)# Check recent changes that might have caused the issue
git log --oneline -10
git diff HEAD~3
# Find error patterns in logs
grep -r "error\|Error\|ERROR" logs/ 2>/dev/null | tail -20
# Check test output
npm test 2>&1 | tail -50 # or pytest, cargo test, etc.
--logs)# Recent errors with context
grep -B 5 -A 10 "ERROR" /var/log/app.log
# Count by error type
grep -oE "Error: [^:]*" app.log | sort | uniq -c | sort -rn
# Errors in time range
awk '/2024-01-15 14:/ && /ERROR/' app.log
# Find repeated errors
grep "ERROR" app.log | cut -d']' -f2 | sort | uniq -c | sort -rn | head -20
# Find error spikes
grep "ERROR" app.log | cut -d' ' -f1-2 | uniq -c | sort -rn
| Pattern | Indicates | Action |
|---|---|---|
| NullPointer | Missing null check | Add validation |
| Timeout | Slow dependency | Add timeout, retry |
| Connection refused | Service down | Check health, retry |
| OOM | Memory leak | Profile, increase limits |
| Rate limit | Too many requests | Add backoff, queue |
--correlate)-- Errors by endpoint
SELECT endpoint, count(*) as errors
FROM logs
WHERE level = 'ERROR' AND time > NOW() - INTERVAL '1 hour'
GROUP BY endpoint ORDER BY errors DESC;
-- Error rate over time
SELECT
date_trunc('minute', time) as minute,
count(*) filter (where level = 'ERROR') as errors,
count(*) as total
FROM logs
WHERE time > NOW() - INTERVAL '1 hour'
GROUP BY minute ORDER BY minute;
-- Correlate request IDs across services
SELECT service, message, time
FROM logs
WHERE request_id = 'req-12345'
;
--trace)import re
def parse_stack_trace(log_content: str) -> list[dict]:
pattern = r'(?P<exception>\w+Error|\w+Exception): (?P<message>.*?)\n(?P<trace>(?:\s+at .+\n)+)'
traces = []
for match in re.finditer(pattern, log_content):
traces.append({
'type': match.group('exception'),
'message': match.group('message'),
'trace': match.group('trace').strip().split('\n')
})
return traces
## Debug Report
**Issue:** [Brief description]
**Root Cause:** [What's actually wrong]
### Evidence
- [Finding 1]
- [Finding 2]
### Fix
[Code or configuration change]
### Verification
[How to confirm the fix works]
### Prevention
[How to prevent this in the future]
Input: "TypeError: Cannot read property 'map' of undefined" Action: Trace the undefined value, find where data should be initialized, fix the source
Input: "Tests are failing" Action: Run tests, capture failures, analyze each failure, fix underlying issues
Input: /debug --logs "API returning 500 errors"
Action: Search logs for 500 status, find stack traces, identify root cause, check error frequency
Input: /debug --correlate "intermittent failures"
Action: Run correlation queries to find patterns, identify affected endpoints, correlate with events