cs-learn 是做什么的?
Turn pitfalls or best practices into a searchable learning archive, with two tracks: pitfall (mistakes) and knowledge (default practices). Triggered when the user says "沉淀知识", "learning", "把这次经验记下来", or when an acceptance/fix is finalized.
How It Works
The skill listens for specific trigger phrases in the conversation:
- "沉淀知识" – Chinese for "accumulate knowledge"
- "learning"
- "把这次经验记下来" – Chinese for "record this experience"
- Acceptance criteria or fix completion events
Once triggered, the AI assistant will ask the user a series of questions to structure the learning document:
- Title – A short, descriptive title for the learning entry.
- Track – Choose either
pitfall(for mistakes and lessons learned) orknowledge(for best practices and default approaches). - Summary – A one-sentence summary of what was learned.
- Detailed Description – A more thorough explanation of the context, the problem, the solution, and any important details.
- Tags – Optional keywords to make the entry easily searchable later.
After the user provides the information, the skill saves the document as a Markdown file in the appropriate directory under docs/learning/:
docs/learning/pitfall/<slug>.md– for pitfallsdocs/learning/knowledge/<slug>.md– for knowledge
The file includes YAML frontmatter with the title, track, tags, and a timestamp.
Example
User: "沉淀知识: When using GraphQL, avoid N+1 queries by using DataLoader"
AI: Prompts for title, track, summary, details, and tags, then creates:
docs/learning/knowledge/avoid-n-plus-1-graphql.md
---
title: Avoid N+1 Queries in GraphQL with DataLoader
track: knowledge
date: 2025-03-29
tags:
- graphql
- dataloader
- n-plus-1
- performance
---
# Avoid N+1 Queries in GraphQL with DataLoader
**Summary:** Always use DataLoader to batch and cache database queries in GraphQL resolvers to prevent the N+1 query problem.
**Details:**
...
Benefits
- Searchable – Easily find past learnings using tags or full-text search.
- Structured – Clear separation between mistakes and best practices.
- Team-friendly – Shareable Markdown files that can be committed to version control.
- Contextual – Captures the "why" behind decisions, not just the code.
Supported Platforms
Designed for AI agents like Claude Code, Cursor, and Codex.