Compatibility: IfAskUserQuestionis unavailable, present options as a numbered list and wait for the user's reply. IfTaskis unavailable, run parallel steps sequentially. Thecontext: forkandagent:frontmatter fields are Claude Code-specific — on OpenCode and VS Code Copilot they are ignored and the skill runs inline using the current model.
Two modes -- detect from user message:
Learn Mode
Triggered by teaching phrases: "remember: X", "learn: X", "our rule is X", "from now on X".
Steps
- Extract the knowledge from the user's message.
- Infer the type (
recipeorstyleguide) and tags from content. If ambiguous, ask:
AskUserQuestion:
question: "What type of knowledge is this?"
options:
- "styleguide -- a convention or rule the team follows"
- "recipe -- a how-to guide or procedure"- Ask for a one-sentence description if one cannot be clearly inferred:
AskUserQuestion:
question: "One-sentence description for this knowledge doc?"- Slug the subject into a filename (e.g., "always use pnpm" ->
pnpm-over-npm.md). - Read the configured docs directory:
npx @codevoyant/agent-kit settings get mem.docsDir 2>/dev/null || echo "docs"Store as DOCS_DIR (default: docs). Choose the appropriate subdirectory based on type:
styleguide->{DOCS_DIR}/styleguide/directoryrecipe->{DOCS_DIR}/recipes/directory
- Write the
.mdfile with frontmatter:
---
type: styleguide | recipe
tags: [inferred, tags]
description: One-sentence summary
status: active
---Then the knowledge content as markdown body.
- Run index:
npx @codevoyant/agent-kit mem index- Confirm:
Learned: {DOCS_DIR}/styleguide/pnpm-over-npm.mdRecall Mode
Triggered by lookup phrases: "remind me about X", "what did we decide on Y", "what's our rule for Z".
Steps
- Infer type and/or tags from the question.
- Run:
npx @codevoyant/agent-kit mem find --type <inferred> --tag <inferred> --json- Read the matching files.
- Answer the user's question from the content of those files.
If no matches found, say so and suggest /mem:learn to capture new knowledge.