knowledge-consolidation

Original🇺🇸 English
Translated
1 scripts

Proactively summarize and consolidate knowledge from AI conversation sessions. Auto-triggers when: (1) Starting a new session after meaningful previous work, (2) Session contains significant learnings worth preserving. Captures debugging insights, architecture decisions, patterns, configs, and lessons learned into structured knowledge documents. Explicit triggers: 'summarize', 'consolidate', 'save knowledge', 'document this'.

3installs
Added on

NPX Install

npx skill4agent add learnwy/skills knowledge-consolidation

Knowledge Consolidation

Persist valuable knowledge from AI conversations into structured documents.

When to Invoke

Proactive (AI self-invoke):
  • Starting new session after substantial prior work
  • Accumulated debugging/architecture/pattern knowledge worth preserving
  • Resolved non-trivial issues with reusable insights
Skip when:
  • Simple Q&A with no novel insights
  • Trivial changes with nothing worth preserving

Workflow

Step 1: Detect AI IDE Type

Check project root for AI IDE indicator directory:
Environment IndicatorAI TypeStorage Path
.trae/
dir or TraeAI/TraeCN env
trae-cn
.trae/knowledges/
.claude/
dir or Claude Code env
claude-code
.claude/knowledges/
.cursor/
dir
cursor
.cursor/knowledges/
.windsurf/
dir
windsurf
.windsurf/knowledges/

Step 2: Identify Consolidation Candidates

Scan conversation for knowledge worth preserving:
  • Debug sessions with root cause analysis
  • Architecture decisions with rationale
  • Code patterns discovered or established
  • Configuration knowledge (build, env, tooling)
  • API integration insights
  • Workflow improvements
  • Lessons learned from issues

Step 3: Classify Knowledge Type

Select appropriate type based on content:
TypeWhen to Use
debug
Bug fixes, crash analysis, error resolution
architecture
System design, module structure, dependencies
pattern
Reusable code patterns, idioms, best practices
config
Build settings, environment, tooling setup
api
API design, integration, protocol details
workflow
Development processes, procedures
lesson
Post-mortems, retrospectives, project insights
reference
Technical specs, schema docs, standards
See knowledge-types.md for detailed guidance on each type.

Step 4: Generate Document Path

Run path generation script:
bash
{skill_root}/scripts/get-knowledge-path.sh \
  -r <project_root> -a <ai_type> -t <type> -n <filename>
Output format:
{project_root}/{ai_path}/knowledges/{YYYYMMDD}_{seq}_{type}_{filename}.md

Step 5: Write Knowledge Document

Create document using template:
markdown
# {Title}

> **Type:** {type}
> **Date:** {YYYY-MM-DD}
> **Context:** {Brief context}

## Summary

{2-3 sentence summary}

## Background

{Situation/problem/context}

## Details

{Technical content, code snippets, analysis}

## Key Takeaways

{Bullet points of actionable insights}

## Related

{Links to related files or knowledge entries}

Step 6: Confirm with User

📚 Knowledge Consolidated:
- File: {path}
- Type: {type}
- Topic: {title}

Summary: {brief summary}

Resources

ResourcePurpose
scripts/get-knowledge-path.sh
Generate timestamped file path
references/knowledge-types.md
Detailed type selection guide
assets/knowledge.md.template
Document template
examples/debug-session.md
Complete workflow example