Agent skill
working-with-anki
AnkiConnect 연결, 카드/덱/모델 조회, 학습 데이터 복제, 백업/롤백, 어려운 카드 탐지, 커스텀 config 액션 등 Anki와의 모든 상호작용을 다룬다. Triggers: "AnkiConnect 연결", "test 프로필", "ease factor 복제", "카드 정보 조회", "학습 데이터", "AnkiConnect API", "Anki 프로필", "카드 모델", "어려운 카드", "난이도 탐지", "difficulty", "백업", "롤백", "분할 적용", "scheduling", "스케줄링", "getConfig", "setConfig", "커스텀 액션". Covers AnkiConnect API wrapper, scheduling clone, backup/rollback, difficulty detection, and custom config actions.
Install this agent skill to your Project
npx add-skill https://github.com/greenheadHQ/awesome-anki/tree/main/.claude/skills/working-with-anki
SKILL.md
AnkiConnect 작업
안전 규칙 (최우선)
- 반드시
test프로필에서만 작업:open -a Anki --args -p test - 기본 프로필 접근 절대 금지 -- 실제 학습 데이터 보호
--apply없이 항상 미리보기 먼저 확인
AnkiConnect 기본 정보
- 주소:
$ANKI_CONNECT_URL(미설정 시http://localhost:8765폴백, MiniPC headless Anki는 Tailscale 전용) - 애드온 코드: 2055492159
- 대상 모델:
KaTeX and Markdown Cloze(필드: Text, Back Extra) - API 버전: 6
API 래퍼 (packages/core/src/anki/)
| 파일 | 역할 | 주요 export |
|---|---|---|
client.ts |
AnkiConnect 저수준 래퍼 + 고수준 함수 | ankiConnect(), getVersion(), getProfiles(), getDeckNames(), getModelNames(), getModelFieldNames(), findNotes(), getNotesInfo(), updateNoteFields(), addNote(), addNotes(), addTags(), removeTags(), deleteNotes(), sync(), getConfig(), setConfig() |
operations.ts |
카드 CRUD, 분할 적용 (nid 승계) | getDeckNotes(), getNoteById(), updateMainCard(), addSplitCards(), applySplitResult(), extractTextField(), extractTags() |
backup.ts |
분할 전 백업, 롤백 (날짜별 파일, 원자적 쓰기) | createBackup(), preBackup(), updateBackupWithCreatedNotes(), rollback(), listBackups(), getLatestBackupId() |
scheduling.ts |
학습 데이터 조회/복제 (6개 함수) | getCardSchedulingInfo(), getFullCardInfo(), findCardsByNote(), setCardScheduling(), copySchedulingToNewCards(), cloneSchedulingAfterSplit() |
difficulty.ts |
학습 통계 기반 어려운 카드 탐지 | computeDifficultyScore(), getDifficultyReasons(), getDifficultCards(), DEFAULT_THRESHOLDS |
주요 API 호출 패턴
// 고수준 래퍼 (client.ts) -- ankiConnect() 직접 호출 대신 이것을 사용
const decks = await getDeckNames();
const notes = await findNotes('deck:"덱이름"');
const infos = await getNotesInfo([noteId]);
await addTags([noteId], 'tag1 tag2');
await sync();
// 커스텀 config (miniPC 확장 전용)
const val = await getConfig<string>('some-key');
await setConfig('some-key', { foo: 'bar' });
학습 데이터 복제 (scheduling.ts)
cloneSchedulingAfterSplit(originalNoteId, newCardIds): 메인 진입점- 원본 노트의 카드를 찾아 스케줄링 정보 조회
- 리뷰 카드(type=2)이고 reps>0인 경우에만 ease factor 복제
- 새 카드/learning 카드는 복제 건너뜀
- 복제 가능: ease factor (
setEaseFactorsAPI) - 복제 불가: interval, due -- AnkiConnect API 제한
어려운 카드 탐지 (difficulty.ts)
getDifficultCards(deckName, thresholds?): 덱 내 어려운 카드를 난이도순으로 반환- 100개 배치로
getFullCardInfo호출, noteId별 중복 제거(최악 성적 카드 유지) DEFAULT_THRESHOLDS: minLapses=3, maxEaseFactor=2100, minReps=5
- 100개 배치로
computeDifficultyScore(lapses, easeFactor, interval, reps): 0-100 복합 점수- lapses 50% + ease factor 30% + interval 20% 가중치
백업/롤백 (backup.ts)
- 저장 위치:
$ANKI_SPLITTER_BACKUP_DIR또는output/backups/ - 파일 형식:
backup-{YYYY-MM-DD}.json(날짜별, 하루에 여러 엔트리) - 버전 포맷:
BackupFile { version: 1, entries: BackupEntry[] } - 저장 내용: deckName, originalNoteId, 원본 fields/tags/modelName, createdNoteIds
- 원자적 쓰기:
atomicWriteFileSync()+withFileMutex()(in-process 직렬화) - 손상 파일 격리:
quarantineCorruptedBackup()--.corrupt-{timestamp}접미사 preBackup(deckName, noteId): 분할 적용 전 원본 상태 미리 저장rollback(backupId): 생성된 서브 카드 삭제 + 원본 필드/태그 복원 + 스케줄링 경고- 태그 완전 복원: 현재 태그 전체 제거 후 백업된 태그 재적용
- 반환에
warning: "카드 스케줄링 메타데이터는 자동 복원되지 않습니다."포함
커스텀 Config 액션 (getConfig/setConfig)
- 공식 AnkiConnect에는 없는 miniPC 커스텀 확장
mapUnsupportedConfigActionError(): 미지원 에러를 감지하여UNSUPPORTED_REMOTE_CONFIG_ACTION코드로 매핑- 미지원 패턴: "unsupported action", "unknown action", "action not found", 또는 bare action name
연결 확인
# 직접 테스트
curl -s "${ANKI_CONNECT_URL:-http://localhost:8765}" -X POST -d '{"action":"deckNames","version":6}' | python3 -m json.tool
자주 발생하는 문제
- 연결 실패: Anki가 실행 중인지 + AnkiConnect 애드온 활성화 확인
- 프로필 혼동: 반드시
open -a Anki --args -p test로 실행 - cardsInfo vs notesInfo: 학습 데이터는
cardsInfo에서 조회 - getConfig/setConfig 실패: miniPC 커스텀 확장 미설치
상세 참조
references/ankiconnect-api.md-- API 래퍼 상세, 모든 고수준 함수references/scheduling.md-- 학습 데이터 복제 함수별 상세references/backup-system.md-- 백업 파일 구조, 원자적 쓰기, 격리references/troubleshooting.md-- 연결 문제, 프로필 안전, 커스텀 config 에러
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
validating-cards
USE THIS SKILL for card content validation — fact-checking, freshness, similarity, context consistency, or anything about duplicate detection and card quality. Triggers: "팩트 체크 결과가", "유사한 카드 찾아줘", "문맥 검증", "검증 캐시", "최신성 검사", "중복 카드", "검증 상태 아이콘", "validate/all", "Jaccard", "임베딩 유사도", "중복 판정", "useValidateCard", "useBatchValidate", "검증 4종", "일괄 검증", "context-checker", "fact-checker", "freshness-checker", "similarity-checker", "findSimilarGroups", "analyzeCardGroup", "검증 폴백". Covers the 4 validation types: fact-check, freshness, similarity, context.
developing-web-ui
React 프론트엔드의 컴포넌트, 훅, 렌더링, 스타일 관련 작업이면 반드시 이 스킬을 먼저 확인할 것. Triggers: "React 컴포넌트 추가", "ContentRenderer 수정", "TanStack Query", "CSS 충돌", "웹 UI 버그", "페이지 추가", "Tailwind 스타일", "렌더링 문제", "shadcn", "shadcn 컴포넌트", "shadcn 마이그레이션", "variant API", "UI 마이그레이션", "마이그레이션", "toast", "sonner", "Toaster", "DiffViewer", "ContentPreview", "BottomSheet", "CompactSelector", "markdown 렌더링", "모바일 반응형", "useMediaQuery", "useIsMobile", "훅 추가", "query hook", "캐시 무효화", "staleTime", "분할 미리보기 UI", "분할 반려 UI", "카드 브라우저", "어려운 카드". Covers the React frontend, components, hooks, query patterns, rendering pipeline, and UI troubleshooting.
managing-embeddings
USE THIS SKILL for anything related to embeddings, vector similarity, or semantic search. Triggers: "임베딩 생성", "코사인 유사도", "캐시 어디에", "임베딩 상태", "의미 유사도", "text-embedding-3-large", "openai embedding", "벡터 차원", "3072", "임베딩 캐시", "embedding 마이그레이션", "레거시 캐시", "embedding fallback", "유사도 검사 임베딩 모드", "임베딩 배치", "rate limit 429". Covers OpenAI embedding API, file-based cache with migration, and text preprocessing.
understanding-project
프로젝트 구조, 아키텍처, 기술 스택, 패키지 역할 등 전반적인 이해가 필요할 때 사용. 코드가 어디에 있는지, 패키지 간 의존성이 어떤지, 왜 이 구조인지 궁금하면 이 스킬. Triggers: "모노레포 구조가 어떻게 돼", "기술 스택", "export 충돌", "패키지 간 의존성", "프로젝트 구조", "어떤 패키지에 있어", "파일 어디에 있어", "아키텍처", "디렉터리 구조", "코드 위치", "모듈 역할", "어떤 기술 쓰고 있어", "스택", "의존성". Covers the monorepo architecture, package roles, tech stack, and coding conventions.
managing-llm
LLM 추상화 계층, 프로바이더 어댑터, 가격표, 예산 가드 등 LLM 관련 작업이면 무조건 이 스킬. 모델 변경, 프로바이더 추가, 비용 계산, 토큰 카운트 등 모든 LLM 인프라를 다룬다. Triggers: "LLM 모델 변경", "프로바이더 추가", "비용 추정", "예산 가드", "pricing table", "모델 비교", "LLM 비용", "토큰 사용량", "모델 추가", "LLM 설정", "Gemini", "OpenAI", "API key", "model pricing", "budget cap", "token count", "adapter", "factory".
splitting-cards
카드 분할 로직, LLM 기반 Split, nid 승계 전략, 텍스트 파서, 비용 추정, 배치 분할 등 카드 분할의 모든 측면을 다룬다. Triggers: "Split 결과가 이상해", "파서 버그", "분할 미리보기", "nid 승계", "Cloze 번호 리셋", "컨테이너 파서", "카드 분할", "atomic card", "분할 비용", "split cost", "배치 분할", "batch split", "분할 적용", "split apply", "분할 검증", "스타일 보존". Covers Split logic, nid inheritance strategy, text parsers, cost estimation, batch split, and split validation.
Didn't find tool you were looking for?