Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

knowledge-consolidation知识巩固

Agent Skill

knowledge-consolidation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,420

周安装

58

GitHub Stars

1

下载量

459
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:knowledge-consolidation(知识巩固)
来源仓库:https://github.com/learnwy/skills
仓库路径:skills/knowledge-consolidation
安装命令:
npx skills add https://github.com/learnwy/skills --skill knowledge-consolidation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/learnwy/skills --skill knowledge-consolidation

简介

knowledge-consolidation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 适用于研究检索类任务,可结合来源仓库和原始 README 核验具体用法。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前建议确认权限范围和维护状态,注意是否会触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Knowledge Consolidation

Persist valuable knowledge from AI conversations into structured, reusable documents. Captures debugging breakthroughs, architecture decisions, patterns, and lessons learned — so neither you nor the AI have to rediscover them.

Core Principle: Knowledge that stays in a chat thread is lost knowledge. This skill extracts it, classifies it, and writes it to a discoverable location in the project.

When to Use

Invoke when:

  • User says "save this knowledge", "document this", "记录下来", "总结一下"
  • User says "we figured it out", "that was hard to solve", "let's not forget this"
  • A debugging session reaches resolution — root cause is known and fix is applied
  • An architecture decision is made with clear trade-offs discussed
  • A reusable pattern or workaround is discovered during development
  • A non-obvious configuration was required to make something work
  • User asks to summarize, consolidate, or preserve learnings from the conversation

Do NOT invoke when:

  • User wants to save AI memory/identity across sessions → delegate to ai-brain
  • User wants to create a reusable skill → delegate to project-skill-writer
  • User wants to create a rule → delegate to trae-rules-writer
  • The knowledge is trivial or already well-documented in official docs
  • The conversation contains no actionable insight worth preserving

Prerequisites

  • Node.js >= 18
  • Target project with a supported AI IDE marker (.trae/, .claude/, .cursor/, .windsurf/)

Workflow

[L1: Detect AI IDE]
         ↓
[L2: Identify Knowledge Candidates]
         ↓
[L3: Classify Knowledge Type]
         ↓
[L4: Generate Output Path]  ← get-knowledge-path.cjs
         ↓
[L5: Write Document]        ← knowledge.md.template
         ↓
[L6: Verify & Deliver]

L1: Detect AI IDE

Scan the project root for AI IDE markers to determine the correct storage path. Check in priority order:

IndicatorAI TypeStorage Path
.trae/ dirtrae.trae/knowledges/
.claude/ dirclaude-code.claude/knowledges/
.cursor/ dircursor.cursor/knowledges/
.windsurf/ dirwindsurf.windsurf/knowledges/

Detection method: Use LS or Glob on the project root looking for these marker directories. If multiple markers exist, prefer the one matching the current AI IDE environment. If none are found, halt and inform the user that a supported AI IDE marker directory is required.

L2: Identify Knowledge Candidates

Review the conversation for knowledge worth preserving. Do NOT ask the user "what should I save?" — infer from the conversation.

Candidate Signals

SignalIndicatesPriority
Root cause identified after investigationDebug knowledgeHigh
Trade-off discussion with a decision madeArchitecture knowledgeHigh
"This is how you should always do X"Pattern knowledgeHigh
Non-obvious config that took effort to findConfig knowledgeMedium
API integration with gotchas discoveredAPI knowledgeMedium
Multi-step process that was establishedWorkflow knowledgeMedium
"I wish I'd known this earlier"Lesson knowledgeMedium

Extraction Rules

  1. Extract the core insight, not the entire conversation
  2. Include the context that makes the insight actionable (what project, what version, what constraints)
  3. Preserve code snippets only when they demonstrate the key point
  4. Capture why, not just what — future readers need the reasoning

If the user explicitly requests consolidation, capture everything they mention. If auto-detecting, focus on the highest-value candidate first and ask whether additional items should also be saved.

L3: Classify Knowledge Type

Select the appropriate type from the reference guide. Each type has specific structural expectations:

TypeWhen to UseKey Elements
debugBug fixes, crash analysis, error resolutionSymptoms, investigation steps, root cause, fix
architectureSystem design, module structure decisionsContext, decisions, trade-offs, future concerns
patternReusable code patterns, best practicesProblem context, pattern description, code example
configBuild settings, environment setupConfiguration context, settings, rationale
apiAPI design, integration detailsPurpose, endpoints, usage examples, error handling
workflowDevelopment processes, proceduresSteps, tools used, best practices
lessonPost-mortems, retrospectivesWhat happened, what was learned, recommendations
referenceTechnical references, specificationsScope, specifications, examples

See knowledge-types.md for detailed descriptions and key elements per type.

Type selection rule: If the knowledge spans multiple types (e.g., a debug session that also revealed an architecture pattern), pick the primary type and mention the secondary insight in the Key Takeaways section.

L4: Generate Output Path

Run the path generator to get a unique, date-sequenced filename:

node {skill_root}/scripts/get-knowledge-path.cjs \
  -r <project_root> \
  -a <ai_type> \
  -t <type> \
  -n <filename>

Arguments

FlagRequiredDescriptionExample
-r, --rootYesProject root directory/Users/me/my-project
-a, --ai-typeYesAI IDE typetrae, trae-cn, claude-code, cursor, windsurf
-t, --typeYesKnowledge typedebug, architecture, pattern, etc.
-n, --nameYesDescriptive filename (no extension)memory-leak-fix, singleton-impl

Output Format

{project_root}/{ai_path}/knowledges/{YYYYMMDD}_{daily_seq}_{type}_{filename}.md

Example: /project/.trae/knowledges/20260325_001_debug_memory-leak-fix.md

The script auto-creates the knowledges/ directory if it doesn't exist and auto-increments the daily sequence number.

Filename Guidelines

  • Use lowercase kebab-case: memory-leak-fix, not MemoryLeakFix
  • Be specific: react-18-hydration-mismatch, not bug-fix
  • Keep it under 50 characters

L5: Write Document

Use the knowledge.md.template to write the document. Fill in all sections:

# {Title}

> **Type:** {type}
> **Date:** {YYYY-MM-DD}
> **Context:** {Brief context — project name, component, technology}

## Summary

{2-3 sentence summary of the knowledge. A reader should know whether this document is relevant after reading only this section.}

## Background

{The situation, problem, or context that led to this knowledge. Include enough detail for someone unfamiliar with the conversation to understand.}

## Details

{Technical content: code snippets, configuration, analysis, step-by-step explanation. This is the core of the document.}

## Key Takeaways

{Bullet points of actionable insights. Each takeaway should be independently useful.}

## Related

{Links to related files, docs, issues, or other knowledge documents. Leave empty if none.}

Writing Quality Rules

  1. Title: Use a descriptive title that answers "what will I learn from this?" — not "Debug Session" but "Memory Leak in WebSocket Reconnection Handler"
  2. Summary: Must be self-contained — a reader decides whether to read further based on this
  3. Background: Include the "why" — what triggered this investigation or decision
  4. Details: Use code blocks with language tags, use headings for subsections if lengthy
  5. Key Takeaways: Each point is actionable — "Always check X before Y" not "X is important"
  6. Related: Link to source files, PRs, or other knowledge docs when available

L6: Verify & Deliver

Before responding to the user, run through the execution checklist.

Execution Checklist

  • AI IDE detected and storage path is correct
  • Knowledge type matches the content (not a generic fallback)
  • get-knowledge-path.cjs ran successfully and returned a valid path
  • Document follows the template structure with all sections filled
  • Title is descriptive and specific (not generic like "Bug Fix")
  • Summary is self-contained (understandable without reading the rest)
  • Code snippets have language tags and are minimal (only what illustrates the point)
  • Key Takeaways are actionable bullet points
  • File was written to the correct project-relative path

Delivery Report

After writing the document, report to the user:

Knowledge saved:
  Type:  {type}
  Title: {title}
  Path:  {project-relative path}

Key takeaways:
  - {takeaway 1}
  - {takeaway 2}

Error Handling

IssueSolution
No AI IDE marker directory foundInform user, ask which IDE they use, create the marker directory
Multiple AI IDE markers detectedPrefer the one matching current environment; if ambiguous, ask user
get-knowledge-path.cjs failsCheck args are correct; verify project root exists and is writable
Knowledge type is ambiguousPick the primary type, mention secondary aspects in Key Takeaways
Conversation has no clear knowledge to extractTell user honestly — don't generate filler content
Filename collision (same day, same name)Script auto-increments daily sequence; no manual intervention needed
Project root is not writableInform user of permission issue; suggest alternative path
User requests a type not in the valid listMap to closest valid type, explain the mapping

Boundary Enforcement

This skill ONLY handles:

  • Detecting the AI IDE and determining the storage path
  • Identifying knowledge worth preserving from conversations
  • Classifying knowledge into the defined type system
  • Generating unique file paths via get-knowledge-path.cjs
  • Writing structured knowledge documents using the template
  • Verifying document quality before delivery

This skill does NOT handle:

  • Building a full knowledge base from raw sources → llm-wiki
  • Persistent AI memory across sessions → ai-brain
  • Creating reusable skills → project-skill-writer
  • Creating project rules → trae-rules-writer
  • Creating agents → project-agent-writer
  • Searching or indexing existing knowledge documents (read-only retrieval is out of scope)
  • Modifying or updating previously written knowledge documents

Scripts

ScriptPurposeInvocation
get-knowledge-path.cjsGenerate unique date-sequenced file pathnode get-knowledge-path.cjs -r <root> -a <ai_type> -t <type> -n <name>

Resources

ResourcePurpose
get-knowledge-path.cjsPath generation script with auto-sequencing and directory creation
knowledge-types.mdDetailed type selection guide with key elements per type
knowledge.md.templateDocument template with all required sections

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.52%
按下载量换算168

Claude

29.18%
按下载量换算134

Cursor

21.2%
按下载量换算97

Gemini CLI

9.7%
按下载量换算45

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills