| name | Knowledge Base Builder |
| slug | knowledge-base-builder |
| description | Build and maintain AI-accessible knowledge bases for projects. Use when the user says "build knowledge base", "create knowledge base", "organize knowledge", "structure knowledge", or wants to audit/improve docs, book frameworks, or indexes in this repo. |
| category | meta |
| complexity | complex |
| version | 1.0.0 |
| author | ID8Labs |
| triggers | ["build knowledge base","create knowledge base","knowledge base builder","organize knowledge","structure knowledge","知识库","整理书框架","审计知识库"] |
| tags | ["knowledge-management","documentation","memory"] |
Knowledge Base Builder
The Knowledge Base Builder skill helps you create, structure, and maintain knowledge bases that AI agents can effectively query and utilize. It transforms scattered information—from project documentation to tribal knowledge—into organized, accessible knowledge that improves AI performance and team productivity.
This skill guides you through knowledge extraction, organization, structuring, and maintenance. It understands different knowledge formats (documentation, code comments, decision logs, schemas), helps you choose appropriate storage (markdown files, knowledge graphs, databases), and ensures knowledge remains current and useful.
Use this skill when starting new projects, onboarding AI to complex systems, preserving institutional knowledge, or improving AI agent effectiveness through better context.
用户级使用说明
本 Skill 已作为用户级 Skill 提供,路径均指当前工作区。若当前项目无下文提到的目录(如 book/、prompts/),需先创建对应结构或按项目实际路径适配。下节「本项目专用说明」为原 life 项目示例,可类比到当前项目。
本项目 (life) 专用说明
在本仓库中,知识库已部分成型,可与本 skill 的工作流对齐:
| 本项目已有 | 对应工作流 / 动作 |
|---|
| 知识库总索引.md | 顶层入口;审计时从此开始,检查各链接与层次是否完整。 |
| 知识库框架分析与使用深化方案.md | 四层结构、场景用法;对应「定义目的、结构、维护周期」。 |
| book/资料索引.md、book/框架索引.md | 书 ↔ 层次/象限;对应「组织项目知识」中的索引与命名规范。 |
| book/*_框架.md、book/*_提取.txt | 单书知识单元;对应「从源抽取 → 结构 → 填充」;维护时补全核心概念、元数据。 |
| book/参考文献.md | 元数据表;对应「元数据规范、时效性、可引用性」。 |
| prompts/(00–04、master-system-prompt) | 如何用知识库回答问题;对应「Format for consumption」「Integrate with AI」。 |
在本项目中调用本 skill 的示例:
「用 knowledge base builder 审计一下 book 下的框架和索引」「按知识库规范补全某书的元数据」「整理书框架并更新框架索引」。
Core Workflows
Workflow 1: Build Knowledge Base from Scratch
- Define knowledge base purpose:
- Who will use it? (AI agents, developers, both)
- What problems does it solve?
- What scope/boundaries?
- Identify knowledge sources:
- Existing documentation
- Code repositories
- Team conversations
- Decision records
- Tribal knowledge
- Extract relevant information:
- Key concepts and relationships
- Architectural decisions
- Domain terminology
- Common patterns
- Troubleshooting knowledge
- Structure the knowledge:
- Choose organization (hierarchical, graph, hybrid)
- Define categories/taxonomies
- Establish relationships
- Create metadata schema
- Format for consumption:
- Markdown for documentation
- Knowledge graph for relationships
- Schema files for structure
- Code comments for implementation
- Populate the knowledge base:
- Create initial content
- Link related concepts
- Add examples
- Include references
- Validate accessibility:
- Can AI find information?
- Is context sufficient?
- Are relationships clear?
- Establish maintenance process
Workflow 2: Extract Knowledge from Codebase
- Analyze codebase structure:
- Architecture patterns
- Module organization
- Key abstractions
- Data flow
- Identify extractable knowledge:
- Design decisions
- API contracts
- Data models
- Business logic
- Edge cases
- Generate documentation:
- Architecture overview
- Component descriptions
- API reference
- Data dictionary
- Integration guides
- Create knowledge graph:
- Entities (modules, services, models)
- Relationships (depends on, implements, extends)
- Observations (purpose, constraints, patterns)
- Link to code:
- File paths for reference
- Function signatures
- Configuration locations
- Maintain synchronization:
- Update on code changes
- Version knowledge with code
- Automate where possible
Workflow 3: Organize Project Knowledge
- Audit existing knowledge:
- What documentation exists?
- What's missing?
- What's outdated?
- What's scattered?
- Define structure:
- Documentation hierarchy
- File organization
- Naming conventions
- Cross-referencing approach
- Create core documents:
- README.md (overview, getting started)
- ARCHITECTURE.md (system design)
- DECISIONS.md (ADRs)
- PIPELINE_STATUS.md (project state)
- CONTRIBUTING.md (development guide)
- Establish conventions:
- Document templates
- Metadata standards
- Update procedures
- Review processes
- Populate with content:
- Migrate existing docs
- Fill gaps with new content
- Link related documents
- Add navigation
- Integrate with AI:
- Add to context
- Create knowledge graph entries
- Enable discovery
- Test accessibility
Workflow 4: Build Knowledge Graph
- Identify entities:
- What are the key concepts?
- What needs to be remembered?
- What has relationships?
- Define entity types:
- Project (repos, services, apps)
- Component (modules, features, functions)
- Person (team members, stakeholders)
- Decision (architectural choices)
- Process (workflows, procedures)
- Resource (docs, tools, dependencies)
- Extract observations:
- Facts about each entity
- Properties and attributes
- Context and purpose
- Status and state
- Map relationships:
- How entities connect
- Relationship types
- Directionality
- Strength/importance
- Store in knowledge graph:
- Use Memory MCP (if available)
- Create entities
- Create relations
- Add observations
- Query to validate:
- Can you find entities?
- Do relationships make sense?
- Is information complete?
- Maintain over time:
- Add new entities
- Update observations
- Add new relationships
- Prune obsolete information
Workflow 5: Maintain Knowledge Base
- Monitor knowledge health:
- Usage frequency
- Outdated content
- Gaps in coverage
- User feedback
- Update regularly:
- Reflect code changes
- Document new decisions
- Add new patterns
- Remove deprecated info
- Review periodically:
- Quarterly knowledge audit
- Validate accuracy
- Check completeness
- Improve clarity
- Optimize for consumption:
- Improve searchability
- Add missing links
- Consolidate redundancy
- Enhance examples
- Gather feedback:
- What's confusing?
- What's missing?
- What's most useful?
- Iterate on structure:
- Reorganize if needed
- Add new categories
- Improve navigation
- Refine metadata
Quick Reference
| Action | Command/Trigger |
|---|
| Build new knowledge base | "Build knowledge base for [project]" |
| Extract from codebase | "Extract knowledge from codebase" |
| Organize project docs | "Organize project knowledge" |
| Create knowledge graph | "Create knowledge graph for [domain]" |
| Update knowledge base | "Update knowledge base with [new info]" |
| Audit knowledge | "Audit knowledge base health" |
| Structure documentation | "Structure documentation for [project]" |
Best Practices
- Start with Purpose: Define what the knowledge base should accomplish (enable AI to understand codebase, onboard developers, preserve decisions, document domain knowledge).
- Structure for Discovery: Clear hierarchy, consistent naming, comprehensive indexing, rich cross-linking, metadata tagging.
- Write for AI and Humans: Clear language, structured formats (tables, lists), explicit relationships, contextual information, code examples.
- Keep It Current: Update with code changes, review regularly, remove obsolete info, version alongside code.
- Make It Accessible: Link from README, reference in code comments, add to AI context, create in knowledge graph.
- Use Multiple Formats: Markdown for prose; knowledge graphs for relationships; schema files for structure; code comments for implementation; diagrams for architecture.
- Preserve Context: Document "why" (why this architecture, why not alternatives, constraints, trade-offs).
- Link Generously: Cross-reference documents, link code to docs, connect related decisions, reference external resources.
Knowledge Base Structure (Generic)
Recommended File Organization
/docs
README.md
ARCHITECTURE.md
DECISIONS.md
PIPELINE_STATUS.md
CONTRIBUTING.md
API.md
/guides/
/reference/
/decisions/
Knowledge Quality Checklist
Good knowledge base entries should:
Maintenance Schedule
- Daily: Document new decisions; update status docs; add code comments for complex logic.
- Weekly: Review open questions; check outdated info; update API docs; sync knowledge graph.
- Monthly: Audit completeness; improve unclear docs; update diagrams; clean obsolete content.
- Quarterly: Major review; reorganize if needed; gather feedback; plan improvements.
Common Pitfalls
- Over-documentation / Under-documentation
- Outdated docs (worse than no docs)
- Scattered information
- Missing context ("why")
- Poor organization
- No maintenance
- One format only
Source: SkillMD.ai Knowledge Base Builder. Adapted for life project; 本项目专用说明 added locally.