一键导入
code-writing-guide
Used when writing or modifying code. Provides coding guidelines for this project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Used when writing or modifying code. Provides coding guidelines for this project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | code-writing-guide |
| description | Used when writing or modifying code. Provides coding guidelines for this project. |
Guide for writing code in this project.
Do NOT maintain backward compatibility unless explicitly requested. Break things boldly.
Add a comment whenever a non-obvious implementation choice was made — especially when a natural or standard approach was tried and rejected. The goal is to prevent future readers (human or AI) from re-discovering the same dead end.
Triggers that require a "why not" comment:
withTimeout deadlocks on the IntelliJ platform test JVM EDT → use java.util.Timer)Format: Explain what was tried, why it failed, and why the chosen approach avoids the problem.
// WHY java.util.Timer instead of withTimeout:
// withTimeout relies on DefaultDelay, whose cancellation is dispatched back to the coroutine's
// event loop. When runBlocking is called from the EDT, the event loop runs ON the EDT — which
// runBlocking blocks — so the callback can never be processed and the timeout never fires.
// java.util.Timer runs on its own daemon thread and calls continuation.resume() directly,
// bypassing the scheduler entirely.