Communitygithub.com

知识运维

知识库管理、摄入、同步与检索,覆盖多存储层(本地文件、MCP 记忆、向量存储、Git 仓库)。当用户希望保存、组织、同步、去重或搜索其知识体系时使用。

知识运维 是什么?

该技能为 AI 代理提供了一个完整的多层知识管理系统,能够从六个不同的存储层(本地上下文文件夹、Claude Code 记忆、MCP 记忆服务器、知识库 Git 仓库、Supabase 等外部数据存储,以及 GitHub/Linear 等活跃执行平台)中摄入、去重、存储、索引和检索知识。它解决的核心痛点是在不同会话和机器间实现持久化、可搜索且去重的上下文,避免信息孤岛和重复存储。“知识运维”适用于任何需要保存会话见解、同步跨系统工作状态或查询先前知识点的场景。其工作流程包括:分类知识类型、在多个存储中执行去重、写入适当的层级(例如,活跃项目状态优先更新 GitHub/Linear,结构化数据写入 MCP 图形,大型文档存入外部数据库),并更新索引。该技能可在 Claude Code、Codex 以及任何支持 MCP 工具(用于记忆服务器访问)和文件系统访问的代理中使用。它通过遵循明确规则(如“活跃执行真相”优先于本地笔记)并利用 YAML 前言和一致的文件命名规范,确保知识组织清晰且易于检索。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/knowledge-ops

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

知识运维 是做什么的?

管理一个多层知识系统,用于跨多个存储层摄入、组织、同步和检索知识。

优先采用实时工作区模型:

  • 代码工作位于真实的克隆仓库中
  • 活跃执行上下文存在于 GitHub、Linear 以及仓库本地的工作上下文文件中
  • 更面向人类的笔记可以存放在非仓库的上下文/归档文件夹中
  • 跨机器持久化记忆属于知识库,而非影子仓库工作区

何时激活

  • 用户希望将信息保存到其知识库
  • 将文档、对话或数据摄入到结构化存储中
  • 跨系统同步知识(本地文件、MCP 记忆、Supabase、Git 仓库)
  • 对现有知识进行去重或组织
  • 用户说“将此保存到知识库”、“同步知识”、“我知道关于 X 的什么”、“摄入此内容”、“更新知识库”
  • 任何超出简单记忆调用的知识管理任务

知识架构

第 1 层:活跃执行真相

  • 来源: GitHub issues、PR、讨论、发布说明、Linear issues/项目/文档
  • 用途: 工作的当前操作状态
  • 规则: 如果某内容影响到活跃的工程计划、路线图、上线或发布,则优先将其放在此处

第 2 层:Claude Code 记忆(快速访问)

  • 路径: ~/.claude/projects/*/memory/
  • 格式: 带前言(frontmatter)的 Markdown 文件
  • 类型: 用户偏好、反馈、项目上下文、参考
  • 用途: 跨会话持久化的快速访问上下文
  • 会话启动时自动加载

第 3 层:MCP 记忆服务器(结构化知识图谱)

  • 访问方式: MCP 记忆工具(create_entities、create_relations、add_observations、search_nodes)
  • 用途: 跨所有存储记忆进行语义搜索、关系映射
  • 跨会话持久化,具有可查询的图结构

第 4 层:知识库仓库/持久化文档存储

  • 用途: 精选的持久化笔记、会话导出、综合研究、操作者记忆、长文档
  • 规则: 当内容不属于仓库所属的代码时,这是跨机器上下文的优选持久化存储

第 5 层:外部数据存储(Supabase、PostgreSQL 等)

  • 用途: 结构化数据、大型文档存储、全文搜索
  • 适用场景: 对于记忆文件来说过大的文档、需要 SQL 查询的数据

第 6 层:本地上下文/归档文件夹

  • 用途: 面向人类的笔记、已归档的游戏计划、本地媒体组织、临时非代码文档
  • 规则: 可写入用于信息存储,但不是一个影子代码工作区
  • 不要用于: 活跃的代码更改或应存储在上游的仓库真相

摄入工作流

当需要捕获新知识时:

1. 分类

该知识属于什么类型?

  • 业务决策 -> 记忆文件(项目类型)+ MCP 记忆
  • 活跃路线图/发布/实现状态 -> 先更新 GitHub + Linear
  • 个人偏好 -> 记忆文件(用户/反馈类型)
  • 参考信息 -> 记忆文件(参考类型)+ MCP 记忆
  • 大型文档 -> 外部数据存储 + 记忆中的摘要
  • 对话/会话 -> 知识库仓库 + 记忆中的简短摘要

2. 去重

检查此知识是否已存在:

  • 搜索记忆文件中是否已有条目
  • 使用相关术语查询 MCP 记忆
  • 在创建另一个本地笔记之前,检查 GitHub 或 Linear 中是否已存在该信息
  • 不要创建重复项。改为更新现有条目。

3. 存储

写入适当的层:

  • 始终更新 Claude Code 记忆以实现快速访问
  • 使用 MCP 记忆实现语义可搜索性和关系映射
  • 当信息改变实时项目真相时,优先更新 GitHub / Linear
  • 提交到知识库仓库以实现持久的长期添加

4. 索引

更新任何相关的索引或摘要文件。

同步操作

对话同步

将对话历史记录定期同步到知识库:

  • 来源:Claude 会话文件、Codex 会话、其他代理会话
  • 目标:知识库仓库
  • 生成会话索引以便快速浏览
  • 提交并推送

工作区状态同步

将重要的工作区配置和脚本镜像到知识库:

  • 生成目录结构图
  • 在提交前对敏感配置进行脱敏处理
  • 随时间跟踪变更
  • 不要将知识库或归档文件夹视为实时代码工作区

GitHub / Linear 同步

当信息影响到活跃执行时:

  • 更新相关的 GitHub issue、PR、讨论、发布说明或路线图线程
  • 当工作需要持久的计划上下文时,将支持文档附加到 Linear
  • 之后仅在仍有附加价值时才镜像本地笔记

跨源知识同步

将来自多个来源的知识汇聚到一处:

  • Claude/ChatGPT/Grok 对话导出
  • 浏览器书签
  • GitHub 活动事件
  • 写入状态摘要,提交并推送

记忆模式

# 短期:当前会话上下文
使用 TodoWrite 进行会话内任务跟踪

# 中期:项目记忆文件
写入 ~/.claude/projects/*/memory/ 实现跨会话召回

# 长期:GitHub / Linear / KB
将活跃执行真相放到 GitHub + Linear 中
将持久化综合上下文放到知识库仓库中

# 语义层:MCP 知识图谱
使用 mcp__memory__create_entities 创建永久结构化数据
使用 mcp__memory__create_relations 进行关系映射
使用 mcp__memory__add_observations 添加关于已知实体的新事实
使用 mcp__memory__search_nodes 查找现有知识

最佳实践

  • 保持记忆文件简洁。归档旧数据,而不是让文件无限增长。
  • 在所有知识文件上使用前端 (YAML) 元数据。
  • 存储前先进行去重。先搜索,然后创建或更新。
  • 每套事实集优选一个规范存储位置。避免在本地笔记、仓库文件和跟踪器文档中并行副本相同计划。
  • 在提交到 Git 之前,脱敏处理敏感信息(API 密钥、密码)。
  • 对知识文件使用一致的命名约定(小写-短横线-分隔)。
  • 为条目打上主题/类别标签,以便于检索。

质量关卡

在完成任何知识操作之前:

  • 没有创建重复条目
  • 所有 Git 跟踪文件中的敏感数据已脱敏处理
  • 索引和摘要已更新
  • 为数据类型选择了适当的存储层
  • 在相关位置添加了交叉引用

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能