/cf-learn

Medium~1K–2.5K tokens injected into prompt

Extract human learning docs from coding sessions.

Context footprint: ⚡⚡ (medium) — what does this mean?

The /cf-learn skill creates learning documentation from your coding sessions. It captures what you learned, insights gained, and techniques used. Unlike /cf-remember (project context for AI recall), this creates educational notes for the human to learn from. These docs can be hosted as a personal knowledge base or served via MCP.

💡 Looking for a deeper, conversational breakdown of what happened and why during a task? Check out /cf-teach — it explains everything like a sharp friend over coffee, covering approach, alternatives, tradeoffs, mistakes, and transferable lessons.

💡 To see what you've learned so far, run cf host to view the learning notes in your browser or using cf mcp to integrate with other LLM clients.

Usage

/cf-learn [arguments]

Or run without arguments to extract learnings from the current session. Your argument narrows what to extract, not what to name the file.

What It Does

  1. Analyzes Session — Reviews what you built and problems you solved
  2. Extracts Insights — Identifies key learnings and techniques
  3. Categorizes — Organizes by concept type (concepts, patterns, languages, tools, debugging)
  4. Creates Docs — Generates clear learning materials with examples
  5. Saves to Output — Stores in configurable directory (default: docs/learn/)
  6. Enables Sharing — Docs can be hosted as website or served via MCP

Examples

/cf-learn TypeScript generics and constraints
/cf-learn
# Auto detect the key knowledge based on the conversation
# Auto-invoked after substantial new knowledge

Configuration

All settings are optional. Configure in .coding-friend/config.json (local, overrides global) or ~/.coding-friend/config.json (global).

SettingDefaultDescription
learn.languageenLanguage for learning notes (falls back to top-level language, then en)
learn.outputDirdocs/learnWhere to store learning docs (relative to project root, or absolute)
learn.categoriesSee table belowSubdirectories and their descriptions
learn.autoCommitfalseAuto git-commit after writing
learn.readmeIndexfalseIndex mode: false (none), true (single README), "per-category" (separate README per category)

Default Categories

CategoryFolderExamples
ConceptsconceptsDependency injection, event sourcing
PatternspatternsRepository pattern, observer pattern
LanguageslanguagesTypeScript generics, Python decorators
ToolstoolsPrisma migrations, Docker compose
DebuggingdebuggingRace condition fix, memory leak hunt

You can override these categories in your config to match your preferred organization.

Auto-Invocation

cf-learn activates automatically when you:

  • Solve a complex technical problem
  • Learn a new pattern or technique
  • Overcome a major debugging challenge
  • Complete a feature with novel architecture

cf-learn vs cf-teach

Both skills write to the same docs/learn/ directory, but serve different purposes:

/cf-learn/cf-teach
PurposeConcise reference notesDeep narrative explanation
FormatStructured (What / Why / How / Gotchas)Flowing prose storytelling
ToneTechnical reference docsFriend explaining over coffee
LengthShort, denseLong-form narrative
Output path{dir}/{category}/{name}.md{dir}/{category}/{name}.md
TriggerAuto-invoke + slash commandSlash command only
Best for"What is X?" — future quick recall"Why did we do it this way?" — genuine understanding

Use /cf-learn to build a reference library of concepts and patterns. Use /cf-teach when you want to truly understand what happened during a session — the reasoning, the tradeoffs, and the lessons.