SKILL.md
LeetCode → Anki Card Generator (Markdown Fields)
When to use
Use this skill when the user wants to generate an Anki card for a LeetCode problem (or similar coding problem) using their fixed HTML template fields: title / status / difficulty / tags / companies / description / explanation / code / complexity / notes.
The user typically provides:
- The problem statement (may include examples/constraints)
- A Go solution they wrote (sometimes says "do not change my answer")
Inputs
Prefer to use (in order):
- The current chat message content
- Selected text in editor (if present)
- Nearby open file content that obviously contains the problem + solution
If essential info is missing, make best-effort inferences (do NOT ask follow-up unless absolutely necessary).
Output rules (STRICT)
- Output ONLY the Markdown fields block (no preamble, no commentary, no extra sections).
- Keep the exact field names and ordering as in
templates/card.md. - Language: Chinese (as the user's deck is Chinese), keep technical terms in English when conventional (e.g., monotonic queue, prefix sum).
- Code: always a fenced Go code block.
- If the user indicates "do not change my answer / I recited this", copy the code verbatim (format included). If you notice a bug, mention it in notes only—do not rewrite the code.
- If "companies" is not provided, set
companies: —. - Tags: 3–6 concise items, slash-separated.
How to generate each field
- title: "{problemid}. {problemname}" if available; else use best-effort title from text.
- difficulty: 从题面提取(简单/中等/困难),缺失则推断但不要装作确定(可写"中等(推断)")。
- description: 2–4 句中文,包含输入/输出/关键约束;不要复读整段题面。
- explanation: 给出核心思路 + 关键不变量/边界点;控制在 8–14 句内;不要展开到"教程长文"。
- complexity: 明确时间/空间复杂度(含关键维度:n、m、k 等)。
- notes: 3–6 条 bullet,写易错点、边界、实现细节、可替代解法(可简短提及)。
Template
Follow templates/card.md exactly.