knowledge-base
专业的知识库管理系统,旨在解决“知识诅咒”和认知偏差问题。通过显式化隐性知识、扫描代码提取领域概念、整合行业最佳实践,构建结构化的 Markdown 知识库。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- knowledge-base
- description
- 专业的知识库管理系统,旨在解决“知识诅咒”和认知偏差问题。通过显式化隐性知识、扫描代码提取领域概念、整合行业最佳实践,构建结构化的 Markdown 知识库。
02 资源文件 4
- 脚本lib.ts26.3 KB
- 许可证LICENSE1.0 KB
- 参考文档README.md9.3 KB
- 参考文档skill-report.json159.8 KB
03 SKILL.md 正文
Knowledge Base Skill
一个旨在消除认知偏差、显式化隐性知识的知识库管理工具。它结合代码扫描(ace-tool)、网络搜索和结构化文档管理,构建项目的"第二大脑"。
核心理念:打破“知识诅咒”
"知识诅咒"(Curse of Knowledge)是指当我们掌握某种知识后,很难想象不懂这种知识的人的状态。在软件工程中,这表现为:
- 资深开发者假设新人“应该知道”某些上下文。
- 代码中充斥着特定领域的缩写和隐喻。
- 架构决策的背景被遗忘,只留下结果。
本技能通过以下方式解决此问题:
- 显式化(Explicitness):强制将默会知识(Tacit Knowledge)转化为显性知识(Explicit Knowledge)。
- 上下文对齐(Context Alignment):通过代码扫描提取领域术语,建立统一词汇表。
- 认知共识(Cognitive Consensus):记录“为什么这样做”而不仅仅是“怎么做”。
执行环境
| 路径类型 | 路径 | 说明 |
|---|---|---|
| 技能目录 | ~/.pi/agent/skills/knowledge-base/ |
脚本和模板位置 |
| 主脚本 | ~/.pi/agent/skills/knowledge-base/lib.ts |
核心逻辑脚本 |
| 知识库目录 | ./docs/knowledge/ |
项目根目录下的文档存储位置 |
目录结构
docs/knowledge/
├── concepts/ # 领域概念与术语 (名词解释)
│ ├── [Term].md # 一级文档:e.g. "DoubleEntryBookkeeping.md"
│ └── auth/ # 二级分类
│ ├── User.md
│ └── Session.md
│ └── frontend/ # 二级分类
│ ├── responsive/ # 三级分类
│ │ └── design/ # 四级分类
│ │ └── MobileFirst.md
│ └── pwa/ # 三级分类
│ └── advanced/ # 四级分类
│ └── optimization/ # 五级分类
│ └── ProgressiveWebApp.md
├── guides/ # 操作指南与最佳实践 (How-to)
│ ├── [Topic].md # 一级文档:e.g. "ErrorHandlingStrategy.md"
│ └── backend/ # 二级分类
│ ├── API.md
│ └── Database.md
│ └── frontend/ # 二级分类
│ └── css/ # 三级分类
│ └── flexbox/ # 四级分类
│ └── ResponsiveLayout.md
├── decisions/ # 认知决策记录 (Why)
│ ├── [Date]-[Topic].md # 一级文档:e.g. "20240101-WhyChooseRestOverGraphQL.md"
│ └── database/ # 二级分类
│ └── 20240101-WhyUsePostgres.md
│ └── frontend/ # 二级分类
│ └── layout/ # 三级分类
│ └── modern/ # 四级分类
│ └── strategies/ # 五级分类
│ └── 20260107-WhyUseCSSGrid.md
├── external/ # 行业共识与外部参考
│ ├── [Source].md # e.g. "ReactPatternConsensus.md"
│ └── standards/ # 二级分类
│ └── RESTfulAPI.md
├── GLOSSARY.md # 专业术语表(自动生成,包含定义摘要)
└── index.md # 自动生成的知识索引(支持多层级显示)
命令参考
所有命令建议在项目根目录下执行。
# 1. 初始化
bun ~/.pi/agent/skills/knowledge-base/lib.ts init
# 2. 扫描代码提取概念 (集成 ace-tool)
bun ~/.pi/agent/skills/knowledge-base/lib.ts scan
# 3. 发现项目结构并生成文档清单
bun ~/.pi/agent/skills/knowledge-base/lib.ts discover
# 4. 创建知识条目(支持目录分类)
bun ~/.pi/agent/skills/knowledge-base/lib.ts create term "术语名称" [分类路径] # alias for concept
bun ~/.pi/agent/skills/knowledge-base/lib.ts create concept "术语名称" [分类路径]
bun ~/.pi/agent/skills/knowledge-base/lib.ts create guide "指南标题" [分类路径]
bun ~/.pi/agent/skills/knowledge-base/lib.ts create decision "决策标题" [分类路径]
# 示例:创建带分类的文档(支持无限层级)
bun ~/.pi/agent/skills/knowledge-base/lib.ts create concept "UserAuthentication" auth/user
bun ~/.pi/agent/skills/knowledge-base/lib.ts create guide "ErrorHandling" backend/api
bun ~/.pi/agent/skills/knowledge-base/lib.ts create decision "WhyUsePostgres" database
# 三级和四级分类示例
bun ~/.pi/agent/skills/knowledge-base/lib.ts create concept "MobileFirst" frontend/responsive/design
bun ~/.pi/agent/skills/knowledge-base/lib.ts create concept "ProgressiveWebApp" frontend/pwa/advanced/optimization
bun ~/.pi/agent/skills/knowledge-base/lib.ts create guide "ResponsiveLayout" frontend/css/flexbox
bun ~/.pi/agent/skills/knowledge-base/lib.ts create decision "WhyUseCSSGrid" frontend/layout/modern/strategies
# 4. 搜索知识库
bun ~/.pi/agent/skills/knowledge-base/lib.ts search "关键词"
# 5. 生成专业术语表 (GLOSSARY.md)
bun ~/.pi/agent/skills/knowledge-base/lib.ts glossary
# 6. 生成/更新索引
bun ~/.pi/agent/skills/knowledge-base/lib.ts index
核心功能详解
1. 智能扫描 (scan)
利用 ace-tool 分析代码库,识别高频词汇、特定类名和复杂逻辑,自动建议需要创建的“概念文档”。
- 输入:代码库状态
- 输出:推荐创建的概念列表 (
docs/knowledge/suggested_concepts.md)
2. 结构化文档 (create)
提供标准化模板,强制包含:
- Definition: 一句话定义(防歧义)。
- Context: 出现的场景。
- Anti-patterns: 常见的误解(解决认知偏差)。
- References: 代码引用或外部链接。
3. 行业共识集成
通过 external 目录管理通用知识(如 RESTful 规范、React Hooks 规则),避免重复造轮子,明确本项目是遵循标准还是有特殊定制。
4. 专业术语表维护 (glossary)
自动扫描 concepts/ 目录下的所有文档,提取定义(Definition)部分,生成扁平化的 GLOSSARY.md 表格。
- 用途:提供快速查阅的术语字典,适合非技术人员或快速上下文对齐。
- 格式:包含 Term (Link), Category, Definition 的 Markdown 表格。
最佳实践
- 遇到不懂的缩写时:立即运行
create concept [缩写],查明后填入。 - 代码 Review 时:如果需要解释一段逻辑超过 3 句,创建一个
guide并链接。 - 新成员加入时:让他阅读
docs/knowledge/index.md,并要求他记录所有困惑点作为新的 Issue。
04 同仓库更多 Skills
serpmaven
Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.
revnu-landing-page-audit
Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: "audit my landing page", "why isn't this page converting", "review my homepage", "my ads get clicks but no signups", "people bounce from the pricing page", "CRO review", "improve conversion rate", "is my hero section clear", "roast my landing page", "rewrite my headline", "what's wrong with this page", "landing page feedback", "make the signup page convert better". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.
revnu-growth-context
Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents/revnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says "set up our marketing context", "who is our ideal customer", "write our ICP", "describe the product for marketing", "positioning doc", "what's our brand voice", "remember this about our customers", "log what we tried", "what have we learned from marketing", "we changed pricing, update the context", "update our growth notes", "summarize the business for the agent", "import my product-marketing.md", "start a growth doc", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.
revnu-get-listed
Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: "best X" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says "get us listed", "which directories should we submit to", "how do we get into best-of lists", "why does ChatGPT recommend competitors and not us", "get mentioned in AI answers", "submit to awesome lists", "get on G2", "where are our competitors listed", "pitch listicle authors", "find backlink opportunities", "launch directories", "get into roundups", "Product Hunt alternatives", "where should we be listed", "get cited by Perplexity". Never submits, pays or posts without a yes. Works without a Revnu account.
revnu-ai-readiness-audit
Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks "is my site ready for AI search", "audit my site for AI answers", "AEO audit", "GEO audit", "why doesn't ChatGPT quote our pricing", "make our pages citable by AI", "do I need llms.txt", "does schema help with ChatGPT", "check our structured data", "is our content visible without JavaScript", "AI SEO audit", "optimize our homepage for AI answers", "LLM SEO check", "why does AI get our product wrong", "fix our site for AI Overviews". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.
proxy-troubleshooting
Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.