一键导入
deadlock-analysis
Analyze application hangs, thread deadlocks, and circular wait conditions. Do not use for race conditions or infinite loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze application hangs, thread deadlocks, and circular wait conditions. Do not use for race conditions or infinite loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use to implement a REST or GraphQL API endpoint from a specification or description, including request validation, error handling, and accompanying tests. Activate for building a new API route, resolver, or handler end-to-end. Do NOT use for API design/contract creation, documentation generation, or frontend API consumption.
Use to implement background job processing with a queue, worker, retry with exponential backoff, dead letter queue, and monitoring. Activate when the request involves offloading work from the request cycle (emails, reports, data processing). Do NOT use for real-time event streaming, webhook handling, or scheduled cron jobs.
Use to scaffold a new project from scratch — generating directory structure, configuration files, entry points, and a README skeleton. Activate when starting a new project, service, or package and needing a production-ready starting point. Do NOT use for adding features to existing projects, generating tests, or CI/CD configuration.
Use to design and implement a caching layer for data that is expensive to compute or fetch. Activate for cache-aside, write-through, or write-behind patterns, TTL strategy, and cache invalidation logic. Do NOT use for database query optimization, CDN configuration, or HTTP response caching headers.
Use to generate a CI/CD pipeline configuration for building, testing, and deploying an application. Activate for GitHub Actions, GitLab CI, CircleCI, or similar pipeline tools for any tech stack. Do NOT use for infrastructure provisioning, Dockerfile creation, or deployment strategy design.
Use to generate production-ready code for a new feature, function, class, or module from a description. Activate for writing new code from scratch with error handling, inline documentation, and a self-review checklist. Do NOT use for refactoring existing code, code review, or test generation.
基于 SOC 职业分类
| name | deadlock-analysis |
| description | Analyze application hangs, thread deadlocks, and circular wait conditions. Do not use for race conditions or infinite loops. |
| version | 1.1.0 |
| time_saved | Manual: 3–8 hours | With skill: 30–60 minutes |
| license | Proprietary — Personal Use Only |
| category | debugging |
| complexity | Advanced |
| tokens | ~4500 |
| tags | ["deadlock","threading","lock-ordering","concurrency","debugging"] |
| author | vheins |
Resolve thread deadlocks by analyzing lock order and thread dumps, identifying circular waits, and implementing consistent ordering or granularity fixes.
| Variable | Type | Req | Description |
|---|---|---|---|
tech_stack | string | Yes | e.g., "Java + Spring" |
code | string | Yes | Resource acquisition logic |
thread_dump | string | No | Log of waiting threads |
context | string | Yes | Types, counts, recent changes |
tryLock with timeouts.jstack).| Case | Strategy |
|---|---|
| No Dump | Analyze circular dependencies in code; draw hypothetical resource graphs. |
| DB Deadlock | Check DB logs; adjust isolation levels; reorder DML statements. |
| Livelock | Recommend randomized backoff or retry jitter. |
flowchart TD
A([Start: Deadlock Analysis]) --> B[Parse tech_stack, code, thread_dump, context]
B --> C{Thread dump available?}
C -- No --> D[Analyze code for circular locks]
D --> E[Draw resource graph]
E --> F[Provide thread dump commands]
C -- Yes --> G[Confirm deadlock: Thread A holds X waits Y, Thread B holds Y waits X]
G --> H[Draw Wait-For Graph]
H --> I[Identify lock ordering issue]
I --> J{Deadlock type?}
J -- App locks --> K[Fix: Enforce global lock ordering]
J -- DB deadlock --> L[Check DB log, adjust isolation, reorder DML]
J -- Livelock --> M[Add randomized backoff]
K --> N{Performance allows coarse lock?}
N -- Yes --> O[Use single coarse lock]
N -- No --> P[Use tryLock or reduce granularity]
O & P --> Q[Show before/after code]
Q --> R[Add Prevention Strategy]
R --> S([Output: 5-Section Report])
@modelcontextprotocol/server-sequential-thinking: Complex reasoning.| Version | Date | Description |
|---|---|---|
| 1.1.0 | 2026-03-20 | Restructured: examples/references separated, added fields |
| 1.0.0 | 2026-03-20 | Initial release |