skills/knowledge-consolidation/SKILL.md
Use when the user wants to persist a single insight from the current chat as a structured, project-local doc — debugging breakthroughs, hard-won config, workflow steps, or post-mortem lessons. Triggers: 'save this', 'document this', 'we figured it out', '记录下来', '总结一下'. Writes to <project>/.{trae,claude,cursor,windsurf}/knowledges/. For global compounding knowledge (architecture, patterns, APIs), use llm-wiki instead.
npx skillsauth add learnwy/skills knowledge-consolidationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Project-local fix journal. One conversation → one structured Markdown file in this repo's IDE folder. Stays with the codebase; ships in the repo; future sessions on this project can find it.
Boundary: project-local debugging/config/workflow/lesson notes belong here. Global, reusable knowledge (architectures, design patterns, API integrations, references) belongs in llm-wiki. KC's
promotecommand moves a doc across the seam when it earns its way into the wiki.
| Trigger | Action |
|---|---|
| User says "save this", "记录下来", "we solved it" | Run cli.cjs save … |
| Stop nudge fired ("looks like you resolved a non-trivial problem") | Offer to save |
| Solved a bug specific to this codebase | --type debug |
| Locked in a non-obvious config / build setting | --type config |
| Established an ops procedure (deploy / rollback) | --type workflow |
| Post-mortem / retrospective takeaway | --type lesson |
Do not use for: cross-project knowledge (→ llm-wiki), reusable skills (→ project-skill-writer), AI rules (→ project-rules-writer), updating a previously saved doc (KC is write-once).
.trae/, .claude/, .cursor/, or .windsurf/node scripts/cli.cjs save \
-r <project_root> \
-a <ai_type> \
-t <type> \
-n <kebab-slug> \
--title "Short, specific title" \
--summary "2-3 sentences readers can stop at" \
--details "Body in Markdown." \
--takeaways "First actionable insight\nSecond insight" \
[--background "<one-line problem context>"] \
[--context "<project / version / component>"] \
[--related "<links / files>"]
Returns the absolute path of the new file. Atomically resolves a date-sequenced name, creates the directory, fills the template, validates required fields.
| -a, --ai-type | trae, trae-cn, claude-code (or claude), cursor, windsurf |
|---|---|
| -t, --type | debug, config, workflow, lesson only — see knowledge-types.md |
| -n, --name | kebab-case slug, ≤50 chars, specific (react-18-hydration-mismatch, not bug-fix) |
Output filename: {YYYYMMDD}_{NNN}_{type}_{slug}.md under <root>/<ide>/knowledges/.
When a doc turns out to be reusable across projects, push it into llm-wiki's ingestion queue:
node scripts/cli.cjs promote -p <project>/.trae/knowledges/20260511_001_debug_x.md
Copies into ~/.learnwy/llm-wiki/raw/notes/<date>-<slug>.md with a frontmatter pointer back to the original. No-op if the wiki isn't initialised. Run llm-wiki's ingestion next.
node scripts/cli.cjs path -r <root> -a <ai> -t <type> -n <name>
# → just prints the resolved path; useful for scripts that want to write the file themselves.
A Stop hook scans the assistant's last response for resolution signals ("the bug was…", "fixed it", "## Solution"). If it fires AND the response shows substantive markers (race condition, regression, design decision, "subtle", etc.) AND no session-local trivia markers (typo, missing semicolon, wrong env var), it injects a one-time per-session nudge: "consider running knowledge-consolidation save".
The hook never auto-writes. It nudges; the AI asks the user.
The hook is wired through learnwy-dispatch (single Node process, no per-skill spawn).
[[wiki-page]] references where applicable.This skill only:
This skill does not:
tools
Fallback skill when no project-specific one matches. Provides 10 battle-tested software-engineering methodology agents: problem-definer (Weinberg), story-mapper (Patton), spec-by-example (Adzic), domain-modeler (DDD/Evans), responsibility-modeler (CRC/Wirfs-Brock), architecture-advisor (Bass), tdd-coach (Beck), refactoring-guide (Fowler), legacy-surgeon (Feathers), test-strategist (Crispin). Use when user asks about DDD, TDD, refactoring, story mapping, test strategy, or software-architecture quality attributes.
development
Use when the user wants to build, implement, or develop a feature. Orchestrates evidence-driven Spec-Driven Development. Default lifecycle is `lite` (INIT → IMPLEMENTING → TESTING → DONE); auto-promote to `standard` or `full` when scope, risk, or AC traceability demands it. Triggers: 'develop feature', 'implement this', 'build feature', 'add module', 'fix bug', '开发功能', '实现这个'.
documentation
当用户需要创建、更新或设计项目级技能(.agents/skills/*/SKILL.md)时使用此技能。Analyzes the user's problem and project context to design reusable skill solutions. 触发词:'创建技能'、'编写技能'、'构建技能'、'添加技能'、'更新技能'、'项目技能'、'新建技能'、'设计技能', or when the user describes a repetitive workflow that should be captured as a reusable AI skill.
tools
Use this skill when the user wants to install, add, or configure a skill in a project. Analyze the project's tech stack and workflow, then recommend and install the best-matching skill. Triggers: 'install skill', 'add skill', 'configure skill', 'set up skill', 'enable skill', 'use skill in project', 'project skill', or when the user asks how to bring an existing skill capability into the current workspace.