k0ntext
Copilot instructions8 starsChanged 9 months agoMITView on GitHub
This is the k0ntext package (v3.8.0) - a unified AI context engineering tool that provides intelligent context for Claude Code, GitHub Copilot, Cline, Cursor, Windsurf, Aider, Continue, Antigravity, and Gemini. When users install k0ntext, they can run: The MCP server provides these tools: - search_context - Semantic search - get_item - Retrieve context item
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- context-optimizeSkill
- implementSkill
- planSkill
- researchSkill
- validateSkill
- verify-docsSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 60
Database Snapshots: - Create, restore, diff, and manage database snapshots
- Very specific: line 66
When users install k0ntext, they can run:
- Very specific: line 110
When contributing to k0ntext:
- Distinctive: line 112
TypeScript: - All source is in TypeScript
- Distinctive: line 113
Async/Await: - Use async/await for database operations
- Distinctive: line 115
Testing: - Write tests for new features (Vitest)
- Distinctive: line 116
Documentation: - Update README and docs/
- Distinctive: line 143
When generating code for this project:
- Distinctive: line 144
Follow TypeScript best practices
- Distinctive: line 145
Use JSDoc for function documentation
- Very specific: line 147
Consider cross-platform compatibility (Windows/macOS/Linux)
- Distinctive: line 148
Use Vitest for new test files
- Very specific: line 149
Follow existing patterns in src/ directory
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
K0ntext - Copilot Instructions
Project Overview
This is the k0ntext package (v3.8.0) - a unified AI context engineering tool that provides intelligent context for Claude Code, GitHub Copilot, Cline, Cursor, Windsurf, Aider, Continue, Antigravity, and Gemini.
Tech Stack
- Language: TypeScript
- Runtime: Node.js 18+
- Database: SQLite + sqlite-vec (vector embeddings)
- MCP: Model Context Protocol server
- AI: OpenRouter API for intelligent analysis and embeddings
- Testing: Vitest
- CLI: Commander.js
Project Structure
k0ntext/
├── src/ # TypeScript source code
│ ├── agent-system/ # TodoListManager, TimestampTracker
│ ├── agents/ # Smart agents (Cleanup, Performance, Drift, FactCheck)
│ ├── analyzer/ # Intelligent codebase analysis
│ ├── cli/ # CLI commands and REPL shell
│ ├── config/ # Centralized model configuration
│ ├── db/ # SQLite database client and migrations
│ ├── embeddings/ # OpenRouter integration
│ ├── services/ # SnapshotManager and services
│ ├── template-engine/ # Handlebars template system
│ ├── template-sync/ # Template synchronization
│ ├── utils/ # Utilities (chunking, encoding)
│ └── mcp.ts # MCP server
├── bin/ # CLI entry point
├── agents/ # AI agent definitions
├── skills/ # RPI workflow skills
├── templates/ # Context templates
├── tests/ # Vitest tests
└── docs/ # DocumentationKey Commands
| Command | Description |
npm install | Install dependencies |
npm run build | Build TypeScript to dist/ |
npm test | Run test suite (watch mode) |
npm run test:run | Run tests once |
npm run lint | Run ESLint |
Core Features
- Intelligent Analysis - OpenRouter-powered codebase understanding
- Semantic Search - Vector database with embeddings
- MCP Server - 10 tools + 6 prompts for AI assistants
- Cross-Tool Sync - Synchronize context across 9 AI tools
- Interactive REPL Shell - Auto-starts when running
k0ntextwith no arguments - Template Sync - Keeps
.claude/directory up-to-date with package templates - Database Snapshots - Create, restore, diff, and manage database snapshots
- Drift Detection - AI-powered documentation drift detection
- Git Hooks - Automatic context maintenance on commits
CLI Commands
When users install k0ntext, they can run:
| Command | Description |
k0ntext init | Initialize with intelligent analysis |
k0ntext generate | Generate context files for all tools |
k0ntext mcp | Start MCP server |
k0ntext sync | Sync across AI tools |
k0ntext index | Index codebase into database |
k0ntext search | Semantic search across content |
k0ntext stats | Database statistics |
k0ntext check | Check if context files are outdated |
k0ntext restore | Restore AI tool configs from backups |
k0ntext cleanup | Clean up other AI tool folders |
k0ntext validate | Validate context files |
k0ntext drift-detect | AI-powered drift detection |
k0ntext cross-sync | Sync across all AI tools |
k0ntext hooks | Git hooks management |
k0ntext fact-check | Validate documentation accuracy |
k0ntext sync-templates | Sync .claude/ templates |
k0ntext template-status | Show template sync status |
k0ntext snapshot | Create/restore database snapshots |
k0ntext migrate | Manage database migrations |
k0ntext watch | Auto-index file changes |
k0ntext export | Export database |
k0ntext import | Import from exports |
k0ntext performance | Show performance metrics |
MCP Server Tools
The MCP server provides these tools:
search_context- Semantic searchget_item- Retrieve context itemsadd_knowledge- Store insightsanalyze- Run intelligent analysisget_tool_configs- View AI tool configsquery_graph- Traverse knowledge graphget_stats- Database statisticsadd_relation- Add relationshipsfind_path- Find pathsrun_drift_check- Check documentation sync
Development Guidelines
When contributing to k0ntext:
- TypeScript - All source is in TypeScript
- Async/Await - Use async/await for database operations
- Error Handling - Provide clear error messages
- Testing - Write tests for new features (Vitest)
- Documentation - Update README and docs/
Key Dependencies
@modelcontextprotocol/sdk- MCP protocolbetter-sqlite3- SQLite databasesqlite-vec- Vector embeddingscommander- CLI frameworkzod- Schema validationhandlebars- Template engineora- Spinner/progress indicators
Entry Points
- CLI:
bin/k0ntext.js->dist/cli/index.js - MCP:
dist/mcp.js - Main:
dist/index.js
Database
- File:
.k0ntext.db(SQLite) - Schema:
src/db/schema.ts - Client:
src/db/client.ts - Migrations:
src/db/migrations/
Copilot Behavior
When generating code for this project:
- Follow TypeScript best practices
- Use JSDoc for function documentation
- Handle errors gracefully
- Consider cross-platform compatibility (Windows/macOS/Linux)
- Use Vitest for new test files
- Follow existing patterns in
src/directory
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

