Communitygithub.com

知識庫操作

管理知識庫的攝取、同步、去重與檢索,涵蓋多種儲存層(本地檔案、MCP 記憶體、向量資料庫、Git 儲存庫)。當使用者想要儲存、整理、同步、去重或搜尋其知識系統時使用。

知識庫操作 是什麼?

知識庫操作(Knowledge Operations)是一個用於管理多層級知識系統的技能,支援知識的攝取、組織、同步與檢索。它適用於 Claude Code、Coder、Codex 等 AI 代理平台,透過六層架構來處理不同類型的知識:本地工作目錄、Claude Code 記憶檔、MCP 記憶伺服器、知識庫儲存庫(Git)、外部資料庫(如 Supabase)以及本地封存檔。當使用者需要儲存資訊、同步知識、去重或搜尋既有知識時,此技能會自動啟動。其運作流程包含分類、去重、儲存與索引四個步驟,確保知識被正確歸檔於適當的層級,同時避免重複。同步操作支援會話紀錄、工作區狀態、GitHub/Linear 事件及跨來源知識的整合,並透過記憶模式(短期、中期、長期與語義層)來管理不同時間範圍的知識。最佳實踐要求保持檔案簡潔、使用 YAML 前置資料、去重後再儲存、避免資料重複、遮蔽敏感資訊,以及採用一致的命名慣例。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

知識庫操作 是做什麼的?

管理一個多層級的知識系統,用於在多個儲存層之間攝取、組織、同步與檢索知識。

偏好即時工作區模型:

  • 程式碼工作存在於實際複製的儲存庫中
  • 活躍執行上下文存在於 GitHub、Linear 與儲存庫本地的工作上下文檔案中
  • 更廣泛的面向人類的筆記可以存放在非儲存庫的上下文/封存資料夾中
  • 跨機器的持久性記憶屬於知識庫,而不是影子儲存庫工作區

啟動時機

  • 使用者想要將資訊儲存到知識庫
  • 攝取文件、對話或資料到結構化儲存中
  • 跨系統同步知識(本地檔案、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 層:本地上下文/封存資料夾

  • 用於: 面向人類的筆記、封存的遊戲計畫、本地媒體整理、暫存非程式碼文件
  • 規則: 可寫入以儲存資訊,但不是影子程式碼工作區
  • 請勿用於: 應歸屬於上游的活躍程式碼變更或儲存庫真相

攝取工作流程

當需要擷取新知識時:

1. 分類

這是什麼類型的知識?

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

2. 去重

檢查此知識是否已存在:

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

3. 儲存

寫入適當的層級:

  • 始終更新 Claude Code 記憶以利快速存取
  • 使用 MCP 記憶以利語義搜尋與關係映射
  • 當資訊變更活躍專案真相時,優先更新 GitHub / Linear
  • 提交到知識庫儲存庫以利持久的長篇新增

4. 索引

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

同步操作

對話同步

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

  • 來源:Claude 工作階段檔案、Codex 工作階段、其他代理工作階段
  • 目的地:知識庫儲存庫
  • 產生工作階段索引以利快速瀏覽
  • 提交並推送

工作區狀態同步

將重要的工作區設定與腳本鏡像到知識庫:

  • 產生目錄地圖
  • 提交前遮蔽敏感設定
  • 隨時間追蹤變更
  • 不要將知識庫或封存資料夾視為即時程式碼工作區

GitHub / Linear 同步

當資訊影響活躍執行時:

  • 更新相關的 GitHub 議題、PR、討論、發行說明或路線圖討論串
  • 當工作需要持久規劃上下文時,將支援文件附加到 Linear
  • 僅在本地筆記仍有附加價值時才在事後鏡像它

跨來源知識同步

從多個來源將知識拉取到一處:

  • Claude/ChatGPT/Grok 對話匯出
  • 瀏覽器書籤
  • GitHub 活動事件
  • 寫入狀態摘要,提交並推送

記憶模式

# 短期:當前工作階段上下文
使用 TodoWrite 進行工作階段內任務追蹤

# 中期:專案記憶檔案
寫入 ~/.claude/projects/*/memory/ 以利跨工作階段回顧

# 長期:GitHub / Linear / 知識庫
將活躍執行真相放入 GitHub + Linear
將持久的綜合上下文放入知識庫儲存庫

# 語義層:MCP 知識圖譜
使用 mcp__memory__create_entities 建立永久結構化資料
使用 mcp__memory__create_relations 進行關係映射
使用 mcp__memory__add_observations 為已知實體新增事實
使用 mcp__memory__search_nodes 尋找既有知識

最佳實踐

  • 保持記憶檔案簡潔。將舊資料封存,而不是讓檔案無限制增長。
  • 在所有知識檔案上使用前置資料(YAML)作為元資料。
  • 在儲存前先進行去重。先搜尋,然後建立或更新。
  • 每組事實集偏好一個權威歸宿。避免在本地筆記、儲存庫檔案與追蹤器文件之間出現同一計畫的平行副本。
  • 在提交到 Git 之前,遮蔽敏感資訊(API 金鑰、密碼)。
  • 對知識檔案使用一致的命名慣例(小寫-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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相關技能