Communitygithub.com

知識操作

跨多個儲存層(本地檔案、MCP 記憶體、向量資料庫、Git 儲存庫)進行知識庫管理、擷取、同步與檢索。當使用者想要儲存、組織、同步、去重或搜尋其知識系統時使用。

知識操作 是什麼?

知識操作(knowledge-ops)是一項 AI 代理技能,可管理一個多層級的知識系統,用於從多個儲存來源(包括 Claude Code 記憶體、MCP 記憶體伺服器、知識庫 Git 儲存庫、Supabase 等外部資料庫,以及本機的 context/archive 資料夾)中擷取、組織、同步和檢索知識。它支援在 Claude Code、Cursor 和 Codex 等平台上運作,並在處理工程計劃、發布或路線圖變更時,優先使用 GitHub 和 Linear 等活躍執行來源作為唯一真相點。該技能會透過一個有條理的工作流程來引導使用:分類知識類型、針對現有內容進行去重、寫入適當的儲存層,並更新索引。它可以處理知識同步作業,例如對話歷史同步、工作區狀態與 GitHub/Linear 的同步,以及跨來源知識合併,同時遵循最佳實踐,例如保持記憶體檔案精簡、使用 YAML 前置中繼資料以及對 Git 提交進行敏感性資料遮罩。

相容平台✓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 以及儲存庫本機的 working-context 檔案中
  • 更面向人類的筆記可以存放在非儲存庫的 context/archive 資料夾中
  • 跨機器的持久性記憶體應歸屬於知識庫,而非影子儲存庫工作區

何時啟用

  • 使用者想要將資訊儲存到其知識庫
  • 將文件、對話或資料擷取到結構化儲存中
  • 跨系統(本地檔案、MCP 記憶體、Supabase、Git 儲存庫)同步知識
  • 對現有知識進行去重或組織
  • 使用者說「儲存到知識庫」、「同步知識」、「我知道關於 X 的什麼」、「擷取這個」、「更新知識庫」
  • 任何超出簡單記憶回想的知識管理任務

知識架構

第 1 層:活躍執行真相

  • 來源: GitHub 問題、PR、討論、發布說明、Linear 問題/專案/文件
  • 用途: 工作的當前操作狀態
  • 規則: 如果某事物影響到活躍的工程計劃、路線圖、發布或部署,優先將其放在此處

第 2 層:Claude Code 記憶體(快速存取)

  • 路徑: ~/.claude/projects/*/memory/
  • 格式: 帶有前置中繼資料的 Markdown 檔案
  • 類型: 使用者偏好、回饋、專案上下文、參考資料
  • 用途: 跨對話持續存在的快速存取上下文
  • 會話開始時自動載入

第 3 層:MCP 記憶體伺服器(結構化知識圖譜)

  • 存取: MCP 記憶體工具(create_entities、create_relations、add_observations、search_nodes)
  • 用途: 在所有儲存的記憶體中進行語意搜尋、關係對映
  • 跨會話持久性,具有可查詢的圖結構

第 4 層:知識庫儲存庫 / 持久文件儲存

  • 用途: 策劃的持久性筆記、會話匯出、綜合研究、操作員記憶體、長篇文件
  • 規則: 當內容不屬於儲存庫擁有的程式碼時,這是跨機器上下文的首選持久性儲存

第 5 層:外部資料儲存(Supabase、PostgreSQL 等)

  • 用途: 結構化資料、大型文件儲存、全文搜尋
  • 適用於: 對記憶體檔案而言過大的文件、需要 SQL 查詢的資料

第 6 層:本機 context/archive 資料夾

  • 用途: 面向人類的筆記、歸檔的作戰計畫、本機媒體組織、暫時性的非程式碼文件
  • 規則: 可寫入用於資訊儲存,但不是影子程式碼工作區
  • 請勿用於: 應歸屬於上游的活躍程式碼變更或儲存庫真相

擷取工作流程

當需要捕獲新知識時:

1. 分類

這是哪種類型的知識?

  • 業務決策 -> 記憶體檔案(專案類型)+ MCP 記憶體
  • 活躍路線圖 / 發布 / 實作狀態 -> 優先放在 GitHub + Linear
  • 個人偏好 -> 記憶體檔案(使用者/回饋類型)
  • 參考資訊 -> 記憶體檔案(參考類型)+ MCP 記憶體
  • 大型文件 -> 外部資料儲存 + 記憶體中的摘要
  • 對話/會話 -> 知識庫儲存庫 + 記憶體中的簡短摘要

2. 去重

檢查此知識是否已存在:

  • 搜尋記憶體檔案中是否有現有條目
  • 使用相關術語查詢 MCP 記憶體
  • 在建立另一個本機筆記之前,檢查該資訊是否已存在於 GitHub 或 Linear 中
  • 不要建立重複項。應改為更新現有條目。

3. 儲存

寫入適當的層級:

  • 始終更新 Claude Code 記憶體以實現快速存取
  • 使用 MCP 記憶體以實現語意可搜尋性和關係對映
  • 當資訊改變即時專案真相時,優先更新 GitHub / Linear
  • 提交到知識庫儲存庫以實現持久的長篇新增內容

4. 索引

更新任何相關的索引或摘要檔案。

同步操作

對話同步

定期將會話歷史記錄同步到知識庫:

  • 來源:Claude 會話檔案、Codex 會話、其他代理會話
  • 目的地:知識庫儲存庫
  • 產生一個會話索引以便快速瀏覽
  • 提交並推送

工作區狀態同步

將重要的工作區配置和腳本鏡像到知識庫:

  • 產生目錄對映
  • 在提交前對敏感配置進行遮罩
  • 隨時間追蹤變更
  • 不要將知識庫或 archive 資料夾視為即時程式碼工作區

GitHub / Linear 同步

當資訊影響活躍執行時:

  • 更新相關的 GitHub 問題、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 金鑰、密碼)進行遮罩。
  • 對知識檔案使用一致的命名慣例(lowercase-kebab-case)。
  • 使用主題/類別標記條目,以便於檢索。

品質關卡

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

  • 沒有建立重複條目
  • 任何 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.

相關技能