| name | api-learn |
| description | Internalize project-domain APIs โ collect official docs + examples for a given library/framework, store them in the project's .claude/references/, and register them in CLAUDE.md as the Knowledge Authority. Use for requests like "API ํ์ต", "api learn", "๋ฌธ์ ๋ด์ฌํ", "๋ ํผ๋ฐ์ค ์์ง", "๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ์ต", "API ๋ฌธ์ ์ ์ฅ", "api-learn", "๋ฌธ์ ์์ง", "๋ด์ฌํ", "internalize", "learn api", "react-query ๋ฌธ์", "zod ํ์ต", "๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฌธ์ํ". |
| argument-hint | <library-name> |
user: "/api-learn react-query"
assistant: "react-query ๋ฌธ์๋ฅผ ์์งํฉ๋๋ค. context7 โ ์น ๊ฒ์ ์์ผ๋ก ์งํํ๊ฒ ์ต๋๋ค."
user: "zod API ํ์ต์์ผ์ค"
assistant: "zod ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฌธ์๋ฅผ ์์งํ์ฌ .claude/references/zod.md์ ์ ์ฅํ๊ฒ ์ต๋๋ค."
user: "/api-learn drizzle-orm"
assistant: "drizzle-orm ๋ฌธ์๋ฅผ ์์งํฉ๋๋ค. ์ด๋ฏธ ๋ด์ฌํ๋ ๋ฌธ์๊ฐ ์์ผ๋ฏ๋ก ๊ฐฑ์ ๋ชจ๋๋ก ์งํํฉ๋๋ค."
user: "tanstack router ๋ด์ฌํํด์ค"
assistant: "tanstack-router ๋ฌธ์๋ฅผ context7 + ์น ๊ฒ์์ผ๋ก ์์งํ์ฌ ์ ์ฅํ๊ฒ ์ต๋๋ค."
user: "/api-learn SwiftData"
assistant: "SwiftData๋ Apple ํ๋ ์์ํฌ์
๋๋ค. DocumentationSearch + apple-craft ์ฐธ์กฐ ํ์ธ โ context7 โ ์น ๊ฒ์ ์์ผ๋ก ์์งํ๊ฒ ์ต๋๋ค."
user: "/api-learn Alamofire"
assistant: "Alamofire์ Swift ์๋ํํฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์
๋๋ค. context7 โ ์น ๊ฒ์์ผ๋ก ์์งํฉ๋๋ค."
api-learn
Collect and refine the official documentation for libraries/frameworks used in a project, and store it as reference documents inside the project.
Respond to the user in Korean.
Workflow
Phase 0 โ Apple platform detection
Before collecting, determine whether the target library is a first-party Apple framework.
Criteria for an Apple framework:
- The library name matches an official Apple framework (SwiftUI, UIKit, AppKit, Foundation, SwiftData, MapKit, StoreKit, WebKit, WidgetKit, CoreData, CoreML, ARKit, RealityKit, HealthKit, CloudKit, GameKit, AVFoundation, CoreBluetooth, CoreLocation, AlarmKit, FoundationModels, AppIntents, etc.)
- Or the project contains
Package.swift, Podfile, *.xcodeproj, or *.xcworkspace, identifying it as an Apple project
Based on the result:
- Apple framework โ run Step 0 + Step 0.5 in Phase 1, then proceed with the existing Step 1~2
- Third-party library in an Apple project โ use the existing external-doc collection strategy as-is
- Non-Apple project โ use the existing external-doc collection strategy as-is
Scope policy: This skill internalizes external official docs only. It does not collect or document local code usage patterns โ if you need code-usage analysis, use a separate tool (e.g. Grep, apple-review).
Phase 1 โ Collection (composite strategy)
Run sequentially for the <library-name> passed as the argument:
Step 0: Xcode Documentation lookup (Apple frameworks only)
Run only when Phase 0 identified an Apple framework.
- Search official docs for
{library} with mcp__xcode__DocumentationSearch
- Collect signatures and descriptions for the main types, protocols, and methods
- If a Getting Started / Overview doc exists, collect it too
- If Xcode MCP is not connected, skip and proceed to Step 0.5
Step 0.5: apple-craft reference check (Apple frameworks only)
Run only when Phase 0 identified an Apple framework.
- Search for
**/apple-craft/skills/apple-craft/references/_index.md with Glob
- If found, Read
_index.md to find reference files related to the target library
- If a relevant reference exists, Read it and add to the collected data (source:
apple-craft reference)
- Also Read
common-mistakes.md to collect anti-pattern info for the library
- If apple-craft is not installed (no Glob result), skip silently
Step 1: context7 lookup
- Resolve the library ID with
resolve-library-id
- Query core docs with
query-docs (topic: per major API, tokens: max)
- On lookup failure, skip and proceed to Step 2
Step 2: Web search supplement
- Search "{library} official documentation site" with
WebSearch
- Identify the official docs URL, then collect these pages with
WebFetch:
- Getting Started / Quick Start
- API Reference (core APIs)
- Migration Guide (if any)
- Examples / Recipes
- Remove parts that duplicate content already collected from context7
Step 2.5: Codex parallel doc collection (optional)
If the Codex skill is available, use /codex:rescue to collect additional docs in parallel with Step 1~2.
- Dispatch the
codex:codex-rescue subagent in the background (read-only, without --write):
- Task: "{library} API reference, best practices, migration guide, common patterns๋ฅผ ๊ฒ์ํ๊ณ ํต์ฌ API ์๊ทธ๋์ฒ๋ฅผ ์ ๋ฆฌํ๋ผ."
- After Step 1~2 complete, collect the Codex result with
/codex:result
- Merge with the existing collected data:
- APIs already collected in Step 1 (context7) / Step 2 (web search) โ remove duplicates
- New APIs/patterns found only by Codex โ add
codex-research to sources
- When refining in Phase 2, mark the Codex source:
sources: - codex-research: "{topic}"
Guardrail: For Apple frameworks, Xcode DocumentationSearch + apple-craft references take priority over Codex. If a Codex result conflicts with the Xcode docs, adopt the Xcode docs.
If the Codex skill is not installed, skip this step.
Phase 2 โ Refine and store
Refine the collected raw data into a single Markdown file in the format below.
Output file: {project}/.claude/references/{library}.md
---
library: {library-name}
version: {detected-version}
collected: "{YYYY-MM-DD}"
sources:
- xcode-docs (Apple ํ๋ ์์ํฌ, DocumentationSearch ์ฌ์ฉ๋ ๊ฒฝ์ฐ)
- apple-craft-ref: "{์ฐธ์กฐํ์ผ๋ช
}" (apple-craft ์ฐธ์กฐ ์ฌ์ฉ๋ ๊ฒฝ์ฐ)
- context7 (์ฌ์ฉ๋ ๊ฒฝ์ฐ)
- web: "{๊ณต์๋ฌธ์URL}" (์ฌ์ฉ๋ ๊ฒฝ์ฐ)
- codex-research: "{topic}" (Codex ์ฌ์ฉ๋ ๊ฒฝ์ฐ)
---
# {Library Display Name}
## Overview
[๋ผ์ด๋ธ๋ฌ๋ฆฌ ์๊ฐ: ๋ชฉ์ , ํต์ฌ ์ปจ์
, ์ธ์ ์ฌ์ฉํ๋์ง]
## Core APIs
### {API 1}
**์๊ทธ๋์ฒ:**
[ํจ์/ํด๋์ค/ํ
์๊ทธ๋์ฒ]
**ํ๋ผ๋ฏธํฐ:**
[๊ฐ ํ๋ผ๋ฏธํฐ ์ค๋ช
]
**๋ฐํ๊ฐ:**
[๋ฐํ ํ์
๋ฐ ์ค๋ช
]
**์์ :**
[๊ณต์ ๋ฌธ์ ์์ ์ฝ๋]
### {API 2}
[๋์ผ ๊ตฌ์กฐ ๋ฐ๋ณต]
## Common Pitfalls & Migration Notes
[์ฃผ์์ฌํญ, ํํ ์ค์, ๋ฒ์ ๋ณ ์ฃผ์ ๋ณ๊ฒฝ์ ]
## Source URLs
- [๊ฐ ์ถ์ฒ URL ๋์ด]
Collection depth: comprehensive โ target 500~2000 lines per file. Include the core content of the official docs without omission.
Version detection: Extract the version from the project's dependency files (package.json, Podfile, requirements.txt, etc.). For first-party Apple frameworks, record the minimum deployment target or Xcode version (e.g. "iOS 18+", "Xcode 26"). If undetectable, record "unknown".
_index.md update
If .claude/references/_index.md does not exist, create it; if it exists, add/update the row for the library:
---
project: {project-name from nearest package.json/Package.swift/etc or directory name}
scan_date: "{YYYY-MM-DD}"
doc_count: {์ด ๋ฌธ์ ์}
---
# API References Index
| Library | Version | Collected | Lines | Sources |
|---------|---------|-----------|-------|---------|
| {library} | {version} | {date} | {lines} | {sources} |
Phase 3 โ Register in CLAUDE.md
Check the project root CLAUDE.md:
- No CLAUDE.md: create it with the API References block only
- CLAUDE.md exists but has no API References block: append the block at the end
- CLAUDE.md exists and already has an API References block: do nothing (skip)
Block to add:
## API References (.claude/references/)
์๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์์
์ ํด๋น ์ฐธ์กฐ ๋ฌธ์๋ฅผ ํ์ต ๋ฐ์ดํฐ๋ณด๋ค ์ฐ์ ํ์ธ์.
๋ชฉ๋ก: .claude/references/_index.md ์ฐธ์กฐ
- ๋ชจ๋ฅด๋ API โ ์ฐธ์กฐ ๋ฌธ์์์ ๋จผ์ ๊ฒ์
- ์ฐธ์กฐ ๋ฌธ์์ ํ์ต ๋ฐ์ดํฐ ์ถฉ๋ ์ โ ์ฐธ์กฐ ๋ฌธ์ ์ฐ์
- ์ฐธ์กฐ ๋ฌธ์์ ์๋ ๊ฒฝ์ฐ โ context7 ๋๋ ์น ๊ฒ์ ํด๋ฐฑ
Update mode
If .claude/references/{library}.md already exists:
- Confirm with the user: "์ด๋ฏธ ๋ด์ฌํ๋ ๋ฌธ์๊ฐ ์์ต๋๋ค. ๊ฐฑ์ ํ์๊ฒ ์ต๋๊น?"
- On approval, overwrite the existing file and update the date/line count in
_index.md
- Leave the CLAUDE.md block alone, since it already exists
Phase 4 โ Wiki sync proposal (Pipeline)
Run only when a .wiki/ directory exists in the project:
- Check
.wiki/index.md for whether a wiki page exists for the library
- If the wiki page is missing: propose "์ํค์๋ ๋๊ธฐํํ์๊ฒ ์ต๋๊น?"
- If the wiki page exists: propose "์ํค ํ์ด์ง๋ฅผ ๊ฐฑ์ ํ์๊ฒ ์ต๋๊น?"
- On user approval, run the same flow as
/wiki-ingest .claude/references/{library}.md
- Automatically set the metadata
source_kind: api-learn, authority_path: .claude/references/{library}.md
Loose Coupling principle: api-learn works fully standalone even without .wiki/. Wiki sync is purely a proposal; if .wiki/ is absent, this phase is skipped silently.
Completion report
After collection completes, report the following:
- Storage path
- Collected sources (which of xcode-docs/apple-craft-ref/context7/web/codex-research were used)
- Total line count
- Whether registered in CLAUDE.md
- Whether synced to the wiki (when
.wiki/ exists)