一键导入
learn
Capture patterns from the current session and audit AGENTS.md files against the actual codebase. Keeps documentation current as code evolves.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Capture patterns from the current session and audit AGENTS.md files against the actual codebase. Keeps documentation current as code evolves.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.
Create a custom skill for this project. Determines skill type, writes SKILL.md (and optional references/scripts) to .opencode/skills/<name>/, commits and pushes. Load FIRST before writing any skill.
Import a bitmap image (PNG/JPEG/GIF) from a URL into a Figma file as a frame. Use whenever an image needs to land in Figma — AI mockups, photos, renders, artwork, screenshots. Bypasses use_figma sandbox limits that block the obvious paths (fetch, atob, createImageAsync, REST upload). If you skip this skill and try the obvious paths, you will lose 30+ minutes. Triggers on: import image to Figma, add image to Figma, put image in Figma, Figma image import, bitmap to Figma.
Generate images, videos, and music using AI models (Imagen, Flux, Veo, Runway, Kling, Sora, Suno, ElevenLabs, etc.). Use when user asks to create, generate, edit, upscale, or produce any visual or audio media.
Install a skill from a GitHub URL or local path. Copies SKILL.md (and references/scripts) into the project's .opencode/skills/ directory and creates the companion command. Use when user wants to add an existing skill to their project.
Creates and maintains Figma Code Connect template files that map Figma components to code snippets. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create/update .figma.js files.
基于 SOC 职业分类
| name | learn |
| description | Capture patterns from the current session and audit AGENTS.md files against the actual codebase. Keeps documentation current as code evolves. |
Maintain AGENTS.md knowledge base by capturing session learnings and auditing existing documentation against the actual codebase.
Every token in AGENTS.md loads on every request, regardless of relevance. Agents can follow ~150-200 instructions reliably. This creates a hard budget:
Read root AGENTS.md and follow pointers to all subdirectory AGENTS.md files. Build a map of what's documented.
If no AGENTS.md exists at root, note it — you'll create one at the end.
Review the current conversation and recent changes. Extract anything worth persisting:
Patterns & conventions:
-action.ts")Architectural decisions:
Anti-patterns:
Capabilities:
Walk each documented AGENTS.md and verify against the actual codebase.
Code maps:
WHERE TO LOOK tables:
Capabilities:
Patterns & conventions:
Subdirectory coverage:
Duplication:
Structure trees:
Line numbers:
Inlined conventions:
Instruction count:
Apply both captured learnings and audit fixes:
When updating existing files:
When trimming root AGENTS.md:
When creating new AGENTS.md files:
git add -A
git commit -m "docs: update AGENTS.md from session"
git push
/learn — full pass: capture session learnings + audit all AGENTS.md/learn [area] — focused on a specific area (e.g., /learn lib/services)When focused on an area, only read and update AGENTS.md files within that subtree.
Root AGENTS.md is the most expensive file — it loads on every request. Structure content in tiers:
| Tier | Location | Loads when | Content |
|---|---|---|---|
| 1 | Root AGENTS.md | Every request | Critical rules, capabilities, where to look, anti-patterns |
| 2 | Subdirectory AGENTS.md | Agent reads files in that subtree | Domain-specific patterns, service architecture |
| 3 | Pattern/convention files | Agent follows a reference link | Detailed examples, code templates, full explanations |
Move content to the lowest tier where it's still discoverable.
Describe what the project can do, not how it's organized:
lib/services/s3/lib/services/email/This skill maintains existing AGENTS.md files. It doesn't regenerate them from scratch. Think git commit, not git init. If the project needs a full AGENTS.md generation, that's a different task.
If something looks stale but you're not 100% sure (e.g., a symbol you can't find might be dynamically generated), leave it and add a ? or note rather than deleting.
AGENTS.md files should be telegraphic. When adding learnings:
Not every session produces learnings worth persisting. Not every directory needs AGENTS.md. If there's nothing meaningful to capture or fix:
Nothing to update from this session.
After updating, report what changed:
Updated AGENTS.md:
AGENTS.md— added CAPABILITIES table, removed inlined service pattern (exists in lib/services/AGENTS.md)lib/services/AGENTS.md— added Encryption service to code mappatterns/TYPESCRIPT_CONVENTIONS.md— added file naming conventions (moved from root)Captured: new error handling pattern, S3 upload convention Trimmed: removed stale directory tree, moved inlined code examples to pattern files