Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

ankianki 开发

Agent Skill

anki 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

294

周安装

12

GitHub Stars

1

下载量

95
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:anki(anki 开发)
来源仓库:https://github.com/ishiko732/anki-skills
仓库路径:skills/anki
安装命令:
npx skills add https://github.com/ishiko732/anki-skills --skill anki
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ishiko732/anki-skills --skill anki

简介

anki 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写操作。
  • anki 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Anki Skill

Manage Anki flashcards via AnkiConnect HTTP API.


⛔ MANDATORY: Pre-Add Checklist (READ THIS FIRST)

You MUST NOT call addNote or addNotes until ALL steps below are completed. No exceptions. No defaults. No shortcuts.

Agent Mode Exception

When called by the anki-flashcard-generator agent (or any automated agent), skip the interactive checklist below. Instead:

  1. Read deck and model from .claude/anki.json config (create with defaults {"deck": "program::claude", "model": "Basic"} if missing)
  2. Call modelFieldNames to verify the configured model's fields
  3. Proceed directly with addNotes — no user confirmation needed

Interactive Mode (User-Initiated)

Step 1 — Fetch available models: Call modelNames to get the full list of note types from the user's Anki.

Step 2 — Ask the user to choose a model: Present the available models to the user via AskUserQuestion and let them pick one. NEVER default to "Basic" or any other model without explicit user selection.

Step 3 — Verify field mapping: After the user selects a model, call modelFieldNames with that model to inspect its fields. Map the card content to the correct fields and show the mapping to the user for confirmation.

Step 4 — Confirm deck, model, and tags: Present a final summary of deck name, chosen model, field mapping, and tags. Wait for user approval before proceeding.

Only after the user explicitly confirms ALL of the above may you call addNote or addNotes.

Skipping any step (e.g., adding cards without asking for model selection) is a rule violation.


Prerequisites

  1. Anki desktop must be running
  2. AnkiConnect plugin installed (code: 2055492159)

- In Anki: Tools → Add-ons → Get Add-ons… → enter 2055492159

Helper Script

macOS / Linux (Bash)

scripts/anki-connect.sh wraps curl for convenience:

# Basic usage
bash scripts/anki-connect.sh <action> [params_json]

# Examples
bash scripts/anki-connect.sh version
bash scripts/anki-connect.sh deckNames
bash scripts/anki-connect.sh createDeck '{"deck":"MyDeck"}'

Windows (PowerShell)

scripts/anki-connect.ps1 wraps Invoke-RestMethod for convenience:

# Basic usage
pwsh scripts/anki-connect.ps1 <action> [params_json]

# Examples
pwsh scripts/anki-connect.ps1 version
pwsh scripts/anki-connect.ps1 deckNames
pwsh scripts/anki-connect.ps1 createDeck '{"deck":"MyDeck"}'

Platform Detection

Choose the correct script based on the current OS:

  • Windows ($env:OS -eq 'Windows_NT' or os.platform() === 'win32'): use anki-connect.ps1
  • macOS / Linux: use anki-connect.sh

Override the endpoint with ANKI_CONNECT_URL env var (default: http://127.0.0.1:8765).

You can also call AnkiConnect directly with curl:

curl -s http://127.0.0.1:8765 -X POST -d '{"action":"version","version":6}'

API Reference

All requests use POST to http://127.0.0.1:8765 with JSON body:

{"action": "<action>", "version": 6, "params": { ... }}

Response format:

{"result": <value>, "error": <null or string>}

Connection Check

bash scripts/anki-connect.sh version
# → {"result": 6, "error": null}

Deck Operations

List all decks:

bash scripts/anki-connect.sh deckNames
# → {"result": ["Default", "Japanese::JLPT N5"], "error": null}

List decks with IDs:

bash scripts/anki-connect.sh deckNamesAndIds
# → {"result": {"Default": 1}, "error": null}

Create a deck:

bash scripts/anki-connect.sh createDeck '{"deck":"Spanish::Vocabulary"}'

Get deck statistics:

bash scripts/anki-connect.sh getDeckStats '{"decks":["Default"]}'
# Returns: new_count, learn_count, review_count, total_in_deck

Model (Note Type) Operations

List all models:

bash scripts/anki-connect.sh modelNames
# → {"result": ["Basic", "Basic (and reversed card)", "Cloze"], "error": null}

Create a custom model:

bash scripts/anki-connect.sh createModel '{
  "modelName": "MyModel",
  "inOrderFields": ["Front", "Back", "Extra"],
  "css": ".card { font-family: Arial; font-size: 20px; text-align: center; }",
  "isCloze": false,
  "cardTemplates": [
    {
      "Name": "Card 1",
      "Front": "{{Front}}",
      "Back": "{{FrontSide}}<hr id=answer>{{Back}}<br><small>{{Extra}}</small>"
    }
  ]
}'

Note Operations

⛔ STOP: Before using addNote or addNotes, you MUST complete the Pre-Add Checklist above. Do NOT call these APIs until the user has confirmed model, field mapping, deck, and tags.

Add a single note:

bash scripts/anki-connect.sh addNote '{
  "note": {
    "deckName": "Default",
    "modelName": "Basic",
    "fields": {"Front": "What is photosynthesis?", "Back": "The process by which plants convert light energy into chemical energy"},
    "tags": ["biology", "ai-generated"],
    "options": {"allowDuplicate": false, "duplicateScope": "deck"}
  }
}'

Add multiple notes (batch):

bash scripts/anki-connect.sh addNotes '{
  "notes": [
    {
      "deckName": "Default",
      "modelName": "Basic",
      "fields": {"Front": "Q1", "Back": "A1"},
      "tags": ["batch"]
    },
    {
      "deckName": "Default",
      "modelName": "Basic",
      "fields": {"Front": "Q2", "Back": "A2"},
      "tags": ["batch"]
    }
  ]
}'

Find notes:

bash scripts/anki-connect.sh findNotes '{"query":"deck:Default"}'
bash scripts/anki-connect.sh findNotes '{"query":"tag:biology"}'
# Query syntax: https://docs.ankiweb.net/searching.html

Update note fields:

bash scripts/anki-connect.sh updateNoteFields '{
  "note": {
    "id": 1514547547030,
    "fields": {"Front": "updated front", "Back": "updated back"}
  }
}'

Card Operations

Find cards:

bash scripts/anki-connect.sh findCards '{"query":"deck:Default"}'
# → {"result": [1494723142483, 1494703460437], "error": null}

Get card details:

bash scripts/anki-connect.sh cardsInfo '{"cards":[1498938915662]}'
# Returns: question, answer, deckName, modelName, fields, interval, reps, lapses, etc.

Statistics

Cards reviewed today:

bash scripts/anki-connect.sh getNumCardsReviewedToday
# → {"result": 42, "error": null}

Cards reviewed by day:

bash scripts/anki-connect.sh getNumCardsReviewedByDay
# → {"result": [["2025-01-15", 124], ["2025-01-14", 261]], "error": null}

Review history for a deck:

bash scripts/anki-connect.sh cardReviews '{"deck":"Default","startID":0}'
# Returns: [reviewTime, cardID, usn, buttonPressed, newInterval, previousInterval, newFactor, reviewDuration, reviewType]

Review history for specific cards:

bash scripts/anki-connect.sh getReviewsOfCards '{"cards":["1653613948202"]}'

Batch Operations

Use multi to combine multiple actions in one request:

bash scripts/anki-connect.sh multi '{
  "actions": [
    {"action": "deckNames"},
    {"action": "modelNames"},
    {"action": "getNumCardsReviewedToday"}
  ]
}'

Flashcard Generation Guide

When generating flashcards from source material, follow this process:

Step-by-Step Process

  1. Rewrite the content using clear and concise language while retaining its original meaning
  2. Split the rewritten content into sections, each focusing on one main point
  3. Generate multiple flashcards from each section; for sections with more than 10 words, split and summarize before creating cards

Quality Rules

  • Keep flashcards simple, clear, and focused on the most important information
  • Questions must be specific and unambiguous
  • Use simple and direct language for readability
  • Each answer should contain only a single key fact/name/concept/term
  • Avoid yes/no questions — ask "what", "where", "why", "how" instead
  • Do not repeat the question stem in the answer

Example: Dead Sea

Source text:

The characteristics of the Dead Sea: Salt lake located on the border between Israel and Jordan. Its shoreline is the lowest point on the Earth's surface, averaging 396 m below sea level. It is 74 km long. It is seven times as salty (30% by volume) as the ocean. Its density keeps swimmers afloat. Only simple organisms can live in its saline waters.

Generated flashcards:

QuestionAnswer
Where is the Dead Sea located?on the border between Israel and Jordan
What is the lowest point on the Earth's surface?The Dead Sea shoreline
What is the average level on which the Dead Sea is located?396 meters (below sea level)
How long is the Dead Sea?74 km
How much saltier is the Dead Sea as compared with the oceans?7 times
What is the volume content of salt in the Dead Sea?30%
Why can the Dead Sea keep swimmers afloat?due to high salt content
Why is the Dead Sea called Dead?because only simple organisms can live in it
Why only simple organisms can live in the Dead Sea?because of high salt content

Example: ECG (Electrocardiography)

Source text:

The contraction of any muscle is associated with electrical changes called 'depolarization', and these changes can be detected by electrodes attached to the surface of the body. Since all muscular contraction will be detected, the electrical changes associated with contraction of the heart muscle will only be clear if the patient is fully relaxed and no skeletal muscles are contracting. Although the heart has four chambers, from the electrical point of view it can be thought of as having only two, because the two atria contract together ('depolarization'), and then the two ventricles contract together.

Generated flashcards:

QuestionAnswer
What electrical changes are associated with muscle contraction?depolarization
How can depolarization be detected?by electrodes attached to the surface of the body
Why must the patient be fully relaxed during an ECG?because skeletal muscle contractions would also be detected
How many chambers does the heart have from an electrical point of view?two (atria contract together, then ventricles contract together)
What is the term for the two atria contracting together?depolarization

Output Format

Always present generated flashcards in a table for user review before adding to Anki:

| Question | Answer |
|---|---|
| ... | ... |

After user confirms, use addNotes to batch-add all cards at once.

File Integration

PDF → Flashcards

  1. Use the pdf skill to extract text from the PDF
  2. Apply the flashcard generation guide above to create Q&A pairs
  3. Present the table to the user for review
  4. Confirm: target deck, note type (model), and tags
  5. Use addNotes to batch-add

CSV / Excel → Flashcards

  1. Use the xlsx skill to read and parse the file
  2. Inspect the columns — if data is already in Q/A format, map directly to Front/Back fields
  3. If not Q/A format, apply the flashcard generation guide to the content
  4. Present the mapping/cards to the user for review
  5. Confirm: target deck, note type (model), and tags
  6. Use addNotes to batch-add

⛔ IMPORTANT: You MUST follow the Pre-Add Checklist (at the top of this document) before adding any cards. This means: fetch models → ask user to choose → verify fields → confirm deck/model/tags. No exceptions.

Workflow Examples

1. Check Connection and List Decks

bash scripts/anki-connect.sh version
bash scripts/anki-connect.sh deckNames
bash scripts/anki-connect.sh getDeckStats '{"decks":["Default"]}'

2. Generate and Add Flashcards from Text

  1. User provides text content
  2. Apply flashcard generation guide — rewrite, split, generate Q&A pairs
  3. Present table for review
  4. Follow Pre-Add Checklist: a. Fetch models: bash scripts/anki-connect.sh modelNames b. Ask user to choose model via AskUserQuestion c. Verify fields: bash scripts/anki-connect.sh modelFieldNames '{"modelName":"<user-chosen-model>"}' d. Show field mapping to user and confirm e. Confirm deck, model, and tags — present final summary
  5. Only after user confirms all of the above:
bash scripts/anki-connect.sh addNotes '{
  "notes": [
    {"deckName":"<deck>","modelName":"<user-chosen-model>","fields":{"<field1>":"Q1","<field2>":"A1"},"tags":["ai-generated"]},
    {"deckName":"<deck>","modelName":"<user-chosen-model>","fields":{"<field1>":"Q2","<field2>":"A2"},"tags":["ai-generated"]}
  ]
}'

3. Generate Flashcards from PDF

  1. Use pdf skill to extract text
  2. Follow "Flashcard Generation Guide" on extracted text
  3. Present cards for review
  4. Follow Pre-Add Checklist (fetch models → user picks → verify fields → confirm all)
  5. Batch-add with addNotes

4. Import Flashcards from CSV/Excel

  1. Use xlsx skill to parse the file
  2. Map columns to Front/Back or generate cards
  3. Present mapping for review
  4. Follow Pre-Add Checklist (fetch models → user picks → verify fields → confirm all)
  5. Batch-add with addNotes

5. View Study Statistics

# Today's review count
bash scripts/anki-connect.sh getNumCardsReviewedToday

# Review history by day
bash scripts/anki-connect.sh getNumCardsReviewedByDay

# Detailed review history for a deck
bash scripts/anki-connect.sh cardReviews '{"deck":"Default","startID":0}'

# Deck stats (new/learn/review counts)
bash scripts/anki-connect.sh getDeckStats '{"decks":["Default"]}'

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.84%
按下载量换算35

Claude

31.37%
按下载量换算30

Cursor

18.54%
按下载量换算18

Gemini CLI

10.21%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills