anki
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnki Flashcard Management
Anki闪卡管理
Use the script to create and manage flashcards via AnkiConnect.
anki.shbash
ANKI="$(dirname "$SKILL_PATH")/scripts/anki.sh"Preflight:
- Ensure Anki desktop is running with AnkiConnect enabled
- Ensure and
curlare available in PATHjq
使用脚本通过AnkiConnect创建和管理闪卡。
anki.shbash
ANKI="$(dirname "$SKILL_PATH")/scripts/anki.sh"前置检查:
- 确保Anki桌面端已运行且AnkiConnect已启用
- 确保和
curl已在PATH中可用jq
CRITICAL: User Approval Required
重要提示:必须获得用户批准
NEVER add cards to Anki without explicit user approval.
Before adding any cards:
- Display all proposed cards in full (front + back)
- Ask user to confirm: "Ready to add these cards?"
- Only proceed after explicit "yes" / approval
This is non-negotiable. Users must review card quality before adding.
For potentially destructive or irreversible actions:
- : ask explicit confirmation before deleting notes
delete - : confirm exact fields/IDs before updating notes
update - : show card + suggested rating, then wait for user confirmation before submitting
rate
未经用户明确批准,绝不能向Anki中添加卡片。
添加任何卡片前:
- 完整展示所有拟添加的卡片(正面+背面)
- 询问用户确认:“是否准备好添加这些卡片?”
- 仅在用户明确回复“是”或批准后再执行操作
这是不可协商的规则。用户必须在添加前审核卡片质量。
对于具有潜在破坏性或不可逆的操作:
- :删除笔记前需明确确认
delete - :更新笔记前需确认具体字段/ID
update - :展示卡片及建议评分,等待用户确认后再提交
rate
Guidelines
格式指南
- MUST use the note type
Anki Markdown - Use markdown for both front and back fields
- Test exactly one fact or idea per card
- Make questions atomic and simple
- Keep questions and answers short, clear, and unambiguous
- Ensure each card has one unique, specific answer
- Avoid long lists or multiple items in one card
- Add context or hints so your future self understands
- Personalize with examples or mnemonics if helpful
- Allow multiple simple cards for important concepts
- Create multiple variants of important questions from different angles
- Connect cards to personal goals and projects to avoid "orphan" facts
- Always use syntax highlighting for code (see Code Snippets section)
- When creating multiple related cards, use bulk operations for efficiency
- 必须使用笔记类型
Anki Markdown - 正面和背面字段均使用markdown格式
- 每张卡片仅测试一个事实或概念
- 问题需简洁、独立
- 问题和答案应简短、清晰、明确
- 确保每张卡片有一个唯一、具体的答案
- 避免在单张卡片中包含长列表或多个条目
- 添加上下文或提示,以便未来的自己理解
- 如有帮助,可加入示例或记忆技巧
- 重要概念可创建多张简单卡片
- 从不同角度为重要问题创建多种变体
- 将卡片与个人目标和项目关联,避免“孤立”知识点
- 代码部分始终使用语法高亮(见代码片段章节)
- 创建多张相关卡片时,使用批量操作以提高效率
Front Field Format
正面字段格式
Use markdown on the front to highlight key terms the question is about:
- Use bold or for the main concept being tested
==highlight== - Use inline code for technical terms, functions, or syntax
Example:
What does **vertex_index** return in WGSL?在正面使用markdown高亮问题的核心术语:
- 使用粗体或标记测试的主要概念
==高亮== - 技术术语、函数或语法使用行内代码格式
示例:(这里保留原英文示例,因为是格式示例,或者翻译成“WGSL中的vertex_index返回什么?”?不对,原示例是英文的,应该保留吗?不,用户要求翻译内容,但示例中的代码和技术术语保留,比如“WGSL中的vertex_index返回什么?”这样更符合中文用户,但原示例是英文的,看原文示例是,翻译的话应该是“WGSL中的vertex_index返回什么?”
What does **vertex_index** return in WGSL?What does **vertex_index** return in WGSL?哦,对,翻译时示例中的问题可以翻译成中文,但技术术语保留。比如原示例: 翻译成“WGSL中的vertex_index返回什么?”
What does **vertex_index** return in WGSL?Back Field Format
背面字段格式
Use this format for the Back field:
- Bold one-liner with the direct answer
- Blank line
- Additional context in normal text (optional)
背面字段使用以下格式:
- 粗体单行文本给出直接答案
- 空行
- 普通文本补充上下文(可选)
Formatting for Fast Skimming
便于快速浏览的格式
- Use to make key terms stand out at a glance
==highlighted== - Use bold for critical concepts within explanations
- Use syntax highlighting for all code blocks including inline
- Optimize for quick visual scanning—readers should grasp the core idea instantly
- 使用让关键术语一眼可见
==高亮== - 解释中的核心概念使用粗体
- 所有代码块(包括行内代码)都使用语法高亮
- 优化视觉扫描体验——读者应能立即掌握核心要点
Keyboard Shortcuts
键盘快捷键
Use tags for keyboard keys:
<kbd>markdown
Press <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> to open the command palette.使用标签标记键盘按键:
<kbd>markdown
按下<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>打开命令面板。Code Snippets
代码片段
Always use syntax highlighting:
- Fenced blocks: Use triple backticks with language (python, ```rust, etc.)
js, - Inline code: Use syntax (e.g.,
`code`{lang})`const x = 1`{js}
Advanced features:
- Line highlighting: ```js {2} to highlight line 2
- Word highlighting: ```js /pattern/ to highlight specific words
- Focus mode: Add comment to focus specific lines
// [!code focus]
始终使用语法高亮:
- 代码块:使用带语言标识的三个反引号(python、```rust等)
js、 - 行内代码:使用语法(例如
`code`{lang})`const x = 1`{js}
高级功能:
- 行高亮:```js {2} 高亮第2行
- 词高亮:```js /pattern/ 高亮特定词汇
- 聚焦模式:添加注释聚焦特定行
// [!code focus]
Callouts
提示框
Use GitHub-style alerts sparingly for important notes:
markdown
> [!TIP]
> Brief helpful insight here.
> [!NOTE]
> Useful context the learner should know.
> [!WARNING]
> Common mistake or gotcha to avoid.谨慎使用GitHub风格的提示框标注重要信息:
markdown
> [!TIP]
> 此处为简短实用的提示。
> [!NOTE]
> 学习者应了解的实用上下文。
> [!WARNING]
> 需要避免的常见错误或陷阱。Example
示例
Front: What does `passEncoder.draw(3)`{js} do with **no vertex buffer**?
Back:
**Invokes the ==vertex shader== 3 times.**
The shader uses `@builtin(vertex_index)`{wgsl} to generate positions ==procedurally==.
> [!TIP]
> Useful for fullscreen quads without geometry data.正面:无顶点缓冲区时,`passEncoder.draw(3)`{js}的作用是什么?
背面:
**调用==顶点着色器==3次。**
着色器使用`@builtin(vertex_index)`{wgsl}==程序化==生成位置。
> [!TIP]
> 适用于无需几何数据的全屏四边形。Common Operations
常见操作
Run via :
$ANKI <action> [args...]| Action | Description | Example |
|---|---|---|
| Trigger AnkiWeb sync | |
| List decks | |
| List note types | |
| Fields for a model | |
| Search notes | |
| Note details | |
| Add one note | |
| Add many notes | |
| Update fields | |
| Delete notes | |
| Get due cards | |
| Show card | |
| Rate card (1-4) | |
| List tags | |
通过运行:
$ANKI <action> [args...]| 操作 | 描述 | 示例 |
|---|---|---|
| 触发AnkiWeb同步 | |
| 列出所有卡组 | |
| 列出笔记类型 | |
| 查看笔记类型的字段 | |
| 搜索笔记 | |
| 查看笔记详情 | |
| 添加单条笔记 | |
| 批量添加笔记 | |
| 更新字段内容 | |
| 删除笔记 | |
| 获取待复习卡片 | |
| 展示卡片 | |
| 为卡片评分(1-4) | |
| 列出标签 | |
Typical workflow
典型工作流程
bash
$ANKI sync # sync first
$ANKI decks # check available decks
$ANKI models # verify required model exists
$ANKI fields "Anki Markdown" # verify field names for selected model
$ANKI find "deck:MyDeck front:test" # check for duplicates
$ANKI add "MyDeck" "Anki Markdown" '{"Front":"...","Back":"..."}'
$ANKI sync # sync after changesbash
$ANKI sync # 先同步
$ANKI decks # 查看可用卡组
$ANKI models # 确认所需笔记类型存在
$ANKI fields "Anki Markdown" # 确认所选笔记类型的字段名称
$ANKI find "deck:MyDeck front:test" # 检查重复内容
$ANKI add "MyDeck" "Anki Markdown" '{"Front":"...","Back":"..."}'
$ANKI sync # 修改后同步