Context Library
This directory contains reusable context for AI-assisted development. Documents here are indexed into the knowledge graph and made available for semantic search.
Directory Structure
context-library/
βββ architecture/ # System architecture documentation
βββ patterns/ # Design patterns and best practices
βββ rules/ # Coding rules and standards
βββ references/ # Library and tool referencesUsage
Adding Context
- Create markdown files in the appropriate subdirectory
- Use hashtags to tag concepts:
#async #rust #patterns - Cross-reference related documents:
See [[async-patterns]] - Include code examples where relevant
Searching Context
With Terraphim running:
# Search semantically
# Via MCP in Claude Desktop
# Claude will automatically search this context when relevantOrganizing Content
architecture/
System design, data flow, API contracts, and high-level architecture decisions.
Example topics:
- System design documents
- Architecture decision records (ADRs)
- Data flow diagrams
- API contracts and schemas
- Component interactions
patterns/
Reusable design patterns, best practices, and problem-solving approaches.
Example topics:
- Async/concurrent programming patterns
- Error handling strategies
- Testing approaches
- Performance optimization techniques
- Security patterns
rules/
Coding standards, conventions, and project-specific guidelines.
Example topics:
- Language-specific coding standards
- Code review checklists
- Security guidelines
- Performance requirements
- Documentation requirements
references/
Quick reference for libraries, tools, and frameworks used in the project.
Example topics:
- Library API quick references
- Tool usage guides
- Framework conventions
- Common commands and snippets
- Troubleshooting guides
Best Practices
Document Structure
- -Tagging Strategy
Use consistent hashtags across documents:
- Languages:
#rust,#python,#typescript - Categories:
#async,#error,#testing,#security - Frameworks:
#tokio,#fastapi,#react - Patterns:
#pattern,#antipattern,#refactoring
Cross-References
Link related documents using [[wiki-style]] links:
- --The knowledge graph will create edges between linked concepts.
Integration with Vibe-Rules
This context library complements vibe-rules:
- Context Library: Background knowledge, architecture, references
- Vibe-Rules: Actionable coding rules and patterns
Both are indexed together into the knowledge graph, allowing semantic search across all content.
Token Management
To track token usage:
- Add metadata to document frontmatter:
- Query document stats:
# Get indexing statistics
| Maintenance
Regular Updates
- Review and update documents quarterly
- Remove obsolete information
- Add new patterns as they emerge
- Update examples to match current best practices
Quality Checks
- Ensure all code examples compile/run
- Verify cross-references are valid
- Check that hashtags are consistent
- Validate document structure
Version Control
# Track changes
# Share with team
Examples
See existing context in:
../vibe-rules/- Coding rules and patterns../src/- Project-specific documentation
Contributing
- Follow the document structure template
- Include working code examples
- Use consistent hashtags
- Cross-reference related documents
- Test that examples work
See Also
- Conare Comparison - Feature comparison with Conare AI
- Knowledge Graph System - How indexing works
- Vibe Rules - Actionable coding rules