core: move /learn command from built-in to .opencode/command/

This commit is contained in:
Ryan Vogel
2026-01-26 20:48:55 -05:00
parent 997b5ea9a5
commit 26ced7b789
2 changed files with 7 additions and 14 deletions

View File

@@ -1,10 +1,14 @@
---
description: Extract non-obvious learnings from session to AGENTS.md files to build codebase understanding
---
Analyze this session and extract non-obvious learnings to add to AGENTS.md files.
AGENTS.md files can exist at any directory level, not just the project root. When an agent reads a file, any AGENTS.md in parent directories are automatically loaded into the context of the tool read. Place learnings as close to the relevant code as possible:
- Project-wide learnings → ${path}/AGENTS.md
- Package/module-specific → ${path}/packages/foo/AGENTS.md
- Feature-specific → ${path}/src/auth/AGENTS.md
- Project-wide learnings → root AGENTS.md
- Package/module-specific → packages/foo/AGENTS.md
- Feature-specific → src/auth/AGENTS.md
What counts as a learning (non-obvious discoveries only):

View File

@@ -4,7 +4,6 @@ import { Config } from "../config/config"
import { Instance } from "../project/instance"
import { Identifier } from "../id/id"
import PROMPT_INITIALIZE from "./template/initialize.txt"
import PROMPT_LEARN from "./template/learn.txt"
import PROMPT_REVIEW from "./template/review.txt"
import { MCP } from "../mcp"
@@ -54,7 +53,6 @@ export namespace Command {
export const Default = {
INIT: "init",
REVIEW: "review",
LEARN: "learn",
} as const
const state = Instance.state(async () => {
@@ -78,15 +76,6 @@ export namespace Command {
subtask: true,
hints: hints(PROMPT_REVIEW),
},
[Default.LEARN]: {
name: Default.LEARN,
description: "create/update scoped AGENTS.md files after a session",
get template() {
return PROMPT_LEARN.replace("${path}", Instance.worktree)
},
subtask: true,
hints: hints(PROMPT_LEARN),
},
}
for (const [name, command] of Object.entries(cfg.command ?? {})) {