k0ntext 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +281 -382
- package/dist/agent-system/timestamp-tracker.d.ts +159 -0
- package/dist/agent-system/timestamp-tracker.d.ts.map +1 -0
- package/dist/agent-system/timestamp-tracker.js +405 -0
- package/dist/agent-system/timestamp-tracker.js.map +1 -0
- package/dist/agent-system/todolist-manager.d.ts +244 -0
- package/dist/agent-system/todolist-manager.d.ts.map +1 -0
- package/dist/agent-system/todolist-manager.js +580 -0
- package/dist/agent-system/todolist-manager.js.map +1 -0
- package/dist/analyzer/intelligent-analyzer.d.ts +7 -0
- package/dist/analyzer/intelligent-analyzer.d.ts.map +1 -1
- package/dist/analyzer/intelligent-analyzer.js +46 -1
- package/dist/analyzer/intelligent-analyzer.js.map +1 -1
- package/dist/cli/commands/embeddings-refresh.d.ts.map +1 -1
- package/dist/cli/commands/embeddings-refresh.js +4 -1
- package/dist/cli/commands/embeddings-refresh.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +8 -0
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/snapshot.d.ts +28 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +408 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/repl/init/wizard.d.ts.map +1 -1
- package/dist/cli/repl/init/wizard.js +12 -4
- package/dist/cli/repl/init/wizard.js.map +1 -1
- package/dist/cli/version/comparator.d.ts +1 -0
- package/dist/cli/version/comparator.d.ts.map +1 -1
- package/dist/cli/version/comparator.js +1 -0
- package/dist/cli/version/comparator.js.map +1 -1
- package/dist/db/client.d.ts +5 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +7 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.js +1 -1
- package/dist/embeddings/openrouter.d.ts.map +1 -1
- package/dist/embeddings/openrouter.js +8 -3
- package/dist/embeddings/openrouter.js.map +1 -1
- package/dist/services/snapshot-manager.d.ts +251 -0
- package/dist/services/snapshot-manager.d.ts.map +1 -0
- package/dist/services/snapshot-manager.js +541 -0
- package/dist/services/snapshot-manager.js.map +1 -0
- package/dist/utils/chunking.d.ts +38 -0
- package/dist/utils/chunking.d.ts.map +1 -0
- package/dist/utils/chunking.js +133 -0
- package/dist/utils/chunking.js.map +1 -0
- package/dist/utils/encoding.d.ts +24 -0
- package/dist/utils/encoding.d.ts.map +1 -0
- package/dist/utils/encoding.js +32 -0
- package/dist/utils/encoding.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/docs/QUICKSTART.md +1 -1
- package/docs/TROUBLESHOOTING.md +51 -76
- package/docs/plans/2026-02-09-v3.7.0-database-fixes-and-improvements.md +900 -0
- package/docs/plans/2026-02-11-context-engineering-enhancement.md +1402 -0
- package/package.json +8 -2
- package/src/agent-system/timestamp-tracker.ts +520 -0
- package/src/agent-system/todolist-manager.ts +753 -0
- package/src/analyzer/intelligent-analyzer.ts +58 -1
- package/src/cli/commands/embeddings-refresh.ts +4 -1
- package/src/cli/commands/migrate.ts +8 -0
- package/src/cli/commands/snapshot.ts +471 -0
- package/src/cli/repl/init/wizard.ts +12 -4
- package/src/cli/version/comparator.ts +1 -0
- package/src/db/client.ts +8 -0
- package/src/db/migrations/0016_add_context_system_tables.sql +38 -0
- package/src/db/migrations/files/0015_add_sync_state_version_tracking.sql +18 -0
- package/src/db/schema.ts +1 -1
- package/src/embeddings/openrouter.ts +10 -4
- package/src/services/snapshot-manager.ts +719 -0
- package/src/utils/chunking.ts +152 -0
- package/src/utils/encoding.ts +33 -0
- package/src/utils/index.ts +8 -0
package/README.md
CHANGED
|
@@ -7,43 +7,30 @@
|
|
|
7
7
|
[](https://nodejs.org)
|
|
8
8
|
[](https://modelcontextprotocol.io)
|
|
9
9
|
|
|
10
|
-
Universal AI context engineering for Claude, GitHub Copilot, Cline, Cursor, Windsurf, Aider, Continue, Antigravity, and Gemini with OpenRouter-powered intelligent analysis.
|
|
10
|
+
**v3.8.0** -- Universal AI context engineering for Claude, GitHub Copilot, Cline, Cursor, Windsurf, Aider, Continue, Antigravity, and Gemini with OpenRouter-powered intelligent analysis.
|
|
11
|
+
|
|
12
|
+
---
|
|
11
13
|
|
|
12
14
|
## Table of Contents
|
|
13
15
|
|
|
14
|
-
- [Quick Start](
|
|
15
|
-
- [Zero-to-Hero Workflow](
|
|
16
|
-
- [Windows Support](
|
|
17
|
-
- [Features Overview](
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- [Complete CLI](#-complete-cli-18-commands)
|
|
29
|
-
- [Smart Agents](#-smart-agents)
|
|
30
|
-
- [SQLite Storage](#-sqlite-storage)
|
|
31
|
-
- [Complete CLI Reference](#-complete-cli-reference)
|
|
32
|
-
- [Core Commands](#core-commands)
|
|
33
|
-
- [v3.1.0 New Commands](#v310-new-commands)
|
|
34
|
-
- [Git Hooks Workflow](#-git-hooks-workflow-v310)
|
|
35
|
-
- [MCP Server Usage](#-mcp-server-usage)
|
|
36
|
-
- [Supported AI Tools](#-supported-ai-tools)
|
|
37
|
-
- [Configuration](#-configuration)
|
|
38
|
-
- [Architecture](#-architecture)
|
|
39
|
-
- [Development](#-development)
|
|
40
|
-
- [Performance Monitoring](#-performance-monitoring)
|
|
41
|
-
- [Troubleshooting](#-troubleshooting)
|
|
42
|
-
- [Community](#-community)
|
|
16
|
+
- [Quick Start](#quick-start)
|
|
17
|
+
- [Zero-to-Hero Workflow](#zero-to-hero-workflow)
|
|
18
|
+
- [Windows Support](#windows-support)
|
|
19
|
+
- [Features Overview](#features-overview)
|
|
20
|
+
- [Latest Release](#latest-release-v380)
|
|
21
|
+
- [Complete CLI Reference](#complete-cli-reference)
|
|
22
|
+
- [MCP Server Usage](#mcp-server-usage)
|
|
23
|
+
- [Supported AI Tools](#supported-ai-tools)
|
|
24
|
+
- [Configuration](#configuration)
|
|
25
|
+
- [Architecture](#architecture)
|
|
26
|
+
- [Development](#development)
|
|
27
|
+
- [Performance Monitoring](#performance-monitoring)
|
|
28
|
+
- [Troubleshooting](#troubleshooting)
|
|
29
|
+
- [Community](#community)
|
|
43
30
|
|
|
44
31
|
---
|
|
45
32
|
|
|
46
|
-
##
|
|
33
|
+
## Quick Start
|
|
47
34
|
|
|
48
35
|
```bash
|
|
49
36
|
# Install globally
|
|
@@ -59,7 +46,7 @@ k0ntext generate
|
|
|
59
46
|
k0ntext mcp
|
|
60
47
|
```
|
|
61
48
|
|
|
62
|
-
##
|
|
49
|
+
## Zero-to-Hero Workflow
|
|
63
50
|
|
|
64
51
|
### New Project Setup
|
|
65
52
|
```bash
|
|
@@ -91,7 +78,7 @@ k0ntext generate --force
|
|
|
91
78
|
k0ntext validate --strict
|
|
92
79
|
```
|
|
93
80
|
|
|
94
|
-
##
|
|
81
|
+
## Windows Support
|
|
95
82
|
|
|
96
83
|
K0ntext uses native SQLite extensions for high-performance vector search.
|
|
97
84
|
|
|
@@ -100,224 +87,153 @@ K0ntext uses native SQLite extensions for high-performance vector search.
|
|
|
100
87
|
- **Instant install:** These versions install without extra tools
|
|
101
88
|
- **Non-LTS versions (v23/v24):** May require [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) to compile the database driver
|
|
102
89
|
|
|
103
|
-
##
|
|
90
|
+
## Features Overview
|
|
104
91
|
|
|
105
|
-
###
|
|
92
|
+
### Interactive REPL Shell
|
|
106
93
|
- **Auto-start**: Running `k0ntext` with no arguments launches the interactive shell
|
|
107
94
|
- **Session persistence**: Command history and statistics saved across sessions
|
|
108
95
|
- **Built-in commands**: help, stats, index, search, config, drift, init, update, exit
|
|
109
96
|
- **Orange gradient theme** with Unicode/ASCII fallback and terminal capability detection
|
|
110
97
|
- **Update checker** with automatic version notifications on startup
|
|
111
98
|
|
|
112
|
-
###
|
|
113
|
-
- **Advanced Search Panel**
|
|
114
|
-
- **Configuration UI**
|
|
115
|
-
- **Indexing Progress**
|
|
116
|
-
- **Drift Detection**
|
|
99
|
+
### Enhanced TUI Panels
|
|
100
|
+
- **Advanced Search Panel** -- Filtered, sortable search with `--type`, `--sort`, `--limit` flags and content previews
|
|
101
|
+
- **Configuration UI** -- Interactive editor with 4 categories (Project, AI Tools, Features, Display)
|
|
102
|
+
- **Indexing Progress** -- Real-time multi-stage progress visualization with ora spinner
|
|
103
|
+
- **Drift Detection** -- Three-axis analysis (file dates, structure, git diff) with severity-coded reporting
|
|
117
104
|
|
|
118
|
-
###
|
|
105
|
+
### Intelligent Analysis
|
|
119
106
|
- OpenRouter-powered codebase analysis with embeddings
|
|
120
107
|
- Tech stack detection and documentation
|
|
121
108
|
- Workflow discovery and categorization
|
|
122
109
|
- Automatic context generation
|
|
123
|
-
-
|
|
110
|
+
- Centralized model configuration -- single source of truth for all AI operations
|
|
124
111
|
|
|
125
|
-
###
|
|
112
|
+
### Semantic Search
|
|
126
113
|
- Vector database (sqlite-vec) for intelligent code retrieval
|
|
127
114
|
- Hybrid search (text + semantic)
|
|
128
115
|
- Content type filtering (workflow, agent, command, code, doc, etc.)
|
|
129
116
|
- Real-time indexing with watch mode
|
|
130
117
|
|
|
131
|
-
###
|
|
118
|
+
### Cross-Tool Sync
|
|
132
119
|
- **9 AI Tools Supported:** Claude, Copilot, Cline, Antigravity, Windsurf, Aider, Continue, Cursor, Gemini
|
|
133
120
|
- Automatic synchronization between tool configurations
|
|
134
121
|
- Change detection with SHA256 hashing
|
|
135
122
|
- Sync status monitoring
|
|
136
|
-
-
|
|
123
|
+
- Intelligent cross-sync -- AI-powered propagation of changes across tools
|
|
137
124
|
|
|
138
|
-
###
|
|
139
|
-
- **Pre-commit workflow**
|
|
125
|
+
### Git Hooks Automation
|
|
126
|
+
- **Pre-commit workflow** -- Automatic context maintenance
|
|
140
127
|
- Drift detection on every commit
|
|
141
128
|
- Automatic cross-sync when drift detected
|
|
142
129
|
- Updated context files auto-added to commits
|
|
143
130
|
|
|
144
|
-
###
|
|
145
|
-
- **AI-powered semantic analysis**
|
|
131
|
+
### Drift Detection
|
|
132
|
+
- **AI-powered semantic analysis** -- Detect when documentation diverges from code
|
|
146
133
|
- Replaces hash-based checks with intelligent understanding
|
|
147
134
|
- Severity-based reporting (high/medium/low)
|
|
148
135
|
- Automatic fix suggestions
|
|
149
136
|
|
|
150
|
-
###
|
|
137
|
+
### Fact-Checking
|
|
151
138
|
- Validate documentation accuracy against codebase
|
|
152
139
|
- Identify outdated APIs, wrong file paths, missing dependencies
|
|
153
140
|
- Confidence scoring for each claim
|
|
154
141
|
|
|
155
|
-
###
|
|
142
|
+
### Map-Based Context
|
|
156
143
|
- Concise, structured context files
|
|
157
144
|
- Reduce hallucination through precise references
|
|
158
145
|
- Alternative to verbose documentation format
|
|
159
146
|
|
|
160
|
-
###
|
|
161
|
-
- **Automatic version checking**
|
|
162
|
-
- **Semantic version parsing**
|
|
163
|
-
- **Update type indicators**
|
|
164
|
-
- **Database tracking**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- **
|
|
169
|
-
- **
|
|
170
|
-
- **
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- **
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- **
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
- **
|
|
182
|
-
- **
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
- **
|
|
186
|
-
- **
|
|
187
|
-
- **
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- **
|
|
191
|
-
|
|
192
|
-
### 🤖 MCP Server
|
|
193
|
-
- **Auto-Configuration** (v3.1.1) - MCP server automatically configured in `.claude/settings.json` on init
|
|
147
|
+
### Version Detection
|
|
148
|
+
- **Automatic version checking** -- Detects outdated context files
|
|
149
|
+
- **Semantic version parsing** -- Supports 5 version marker formats
|
|
150
|
+
- **Update type indicators** -- Major/minor/patch with emoji
|
|
151
|
+
- **Database tracking** -- Stores version history and check timestamps
|
|
152
|
+
|
|
153
|
+
### User Modification Handling
|
|
154
|
+
- **SHA-256 hash detection** -- Detects when users edit generated files
|
|
155
|
+
- **Automatic backup creation** -- Creates backups before overwriting modified files
|
|
156
|
+
- **Dual backup strategy** -- File-copy with git-stash fallback
|
|
157
|
+
- **Interactive prompts** -- Asks user before overwriting custom changes
|
|
158
|
+
|
|
159
|
+
### Template Engine
|
|
160
|
+
- **Handlebars integration** -- Rich template-based content generation
|
|
161
|
+
- **15 custom helpers** -- join, first, truncate, slugify, formatDate, eq, ne, and, or, defaults, json, keys, values, length
|
|
162
|
+
- **Rich project data** -- Generated files include actual project metadata
|
|
163
|
+
|
|
164
|
+
### Template Sync System
|
|
165
|
+
- **Automatic `.claude/` sync** -- Syncs commands/, agents/, schemas/, standards/, tools/, automation/ from package
|
|
166
|
+
- **Hash-based change detection** -- SHA-256 for consistency with DatabaseClient
|
|
167
|
+
- **File state classification** -- identical, safe-update, conflict, new, deleted, user-only
|
|
168
|
+
- **Interactive conflict resolution** -- Show diff, keep-local, overwrite, or skip options
|
|
169
|
+
- **Backup before overwrite** -- Automatic backups to `.k0ntext/backups/`
|
|
170
|
+
|
|
171
|
+
### Database Snapshots
|
|
172
|
+
- **Create/restore/diff snapshots** -- Full database save/restore with gzip compression
|
|
173
|
+
- **Snapshot comparison** -- Diff two snapshots to see what changed
|
|
174
|
+
- **Persistent todo lists** -- Survive context compactions via markdown files
|
|
175
|
+
|
|
176
|
+
### MCP Server
|
|
177
|
+
- **Auto-Configuration** -- MCP server automatically configured in `.claude/settings.json` on init
|
|
194
178
|
- **10 Tools:** search_context, get_item, add_knowledge, analyze, get_tool_configs, query_graph, get_stats
|
|
195
179
|
- **6 Prompts:** context-engineer, core-architect, api-developer, database-ops, integration-hub, deployment-ops
|
|
196
180
|
- Real-time context access for AI assistants
|
|
197
181
|
- Knowledge graph traversal
|
|
198
182
|
|
|
199
|
-
###
|
|
200
|
-
- `init`
|
|
201
|
-
- `generate`
|
|
202
|
-
- `mcp`
|
|
203
|
-
- `sync`
|
|
204
|
-
- `cleanup`
|
|
205
|
-
- `validate`
|
|
206
|
-
- `export`
|
|
207
|
-
- `import`
|
|
208
|
-
- `performance`
|
|
209
|
-
- `watch`
|
|
210
|
-
- `index`
|
|
211
|
-
- `search`
|
|
212
|
-
- `stats`
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
- `generate --map`
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
- **
|
|
228
|
-
|
|
229
|
-
|
|
183
|
+
### Complete CLI
|
|
184
|
+
- `init` -- Initialize with intelligent analysis (auto-configures MCP)
|
|
185
|
+
- `generate` -- Generate context files for all tools
|
|
186
|
+
- `mcp` -- Start MCP server
|
|
187
|
+
- `sync` -- Sync across AI tools
|
|
188
|
+
- `cleanup` -- Clean up conflicting tool folders
|
|
189
|
+
- `validate` -- Validate context files
|
|
190
|
+
- `export` -- Export database
|
|
191
|
+
- `import` -- Import from exports
|
|
192
|
+
- `performance` -- Show performance metrics
|
|
193
|
+
- `watch` -- Auto-index file changes
|
|
194
|
+
- `index` -- Index codebase
|
|
195
|
+
- `search` -- Search indexed content
|
|
196
|
+
- `stats` -- View database statistics
|
|
197
|
+
- `check` -- Check if context files are outdated
|
|
198
|
+
- `restore` -- Restore AI tool config files from backups
|
|
199
|
+
- `sync-templates` -- Sync `.claude/` templates from package
|
|
200
|
+
- `template-status` -- Show template sync status
|
|
201
|
+
- `drift-detect` -- AI-powered documentation drift detection
|
|
202
|
+
- `cross-sync` -- Intelligent sync across all AI tools
|
|
203
|
+
- `hooks` -- Git hooks management (install/uninstall/status)
|
|
204
|
+
- `fact-check` -- Validate documentation accuracy
|
|
205
|
+
- `generate --map` -- Generate concise map-based context files
|
|
206
|
+
- `snapshot` -- Create/restore/list/diff/delete database snapshots
|
|
207
|
+
- `migrate` -- Manage database migrations
|
|
208
|
+
- `shell` -- Launch interactive REPL shell
|
|
209
|
+
|
|
210
|
+
### Smart Agents
|
|
211
|
+
- **CleanupAgent** -- Remove conflicting AI tool folders (.cursor, .windsurf, .cline, etc.)
|
|
212
|
+
- **PerformanceMonitorAgent** -- Track database performance and suggest optimizations
|
|
213
|
+
- **DriftAgent** -- AI-powered documentation drift detection
|
|
214
|
+
- **FactCheckAgent** -- Validate documentation accuracy against codebase
|
|
215
|
+
|
|
216
|
+
### SQLite Storage
|
|
230
217
|
- Persistent database with SHA256 change detection
|
|
231
218
|
- Embeddings support for semantic search
|
|
232
219
|
- Knowledge graph relationships
|
|
233
220
|
- Automatic schema migrations
|
|
234
221
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
### Smart Template Management
|
|
238
|
-
|
|
239
|
-
K0ntext v3.5.0 introduces a comprehensive template sync system that automatically keeps your `.claude/` directory up-to-date with the latest package templates while preserving your customizations.
|
|
240
|
-
|
|
241
|
-
**Key Features:**
|
|
242
|
-
- ✅ **Automatic sync on init** - Templates are synced during `k0ntext init`
|
|
243
|
-
- ✅ **User modification detection** - Detects files you've customized
|
|
244
|
-
- ✅ **Interactive conflict resolution** - Choose to keep your changes or use templates
|
|
245
|
-
- ✅ **Hash-based comparison** - Efficient SHA-256 change detection
|
|
246
|
-
- ✅ **Backup before overwrites** - Automatic backups to `.k0ntext/backups/`
|
|
247
|
-
- ✅ **Dry-run mode** - Preview changes before applying them
|
|
248
|
-
- ✅ **Selective sync** - Sync specific directories (commands, agents, etc.)
|
|
249
|
-
|
|
250
|
-
### How It Works
|
|
251
|
-
|
|
252
|
-
1. **First init** - Creates all 55 template files (agents, commands, schemas, standards, tools)
|
|
253
|
-
2. **You modify files** - Your customizations are tracked
|
|
254
|
-
3. **Re-run init** - Detects your modifications and prompts for resolution
|
|
255
|
-
4. **Force sync** - Use `--force` to auto-overwrite with templates
|
|
256
|
-
|
|
257
|
-
### User Modification Detection
|
|
258
|
-
|
|
259
|
-
The system intelligently detects when you've modified template files:
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
# You customize a file
|
|
263
|
-
echo "# My custom notes" >> .claude/commands/analytics.md
|
|
264
|
-
|
|
265
|
-
# Re-run init - detects modification
|
|
266
|
-
k0ntext init
|
|
267
|
-
|
|
268
|
-
# Output:
|
|
269
|
-
# ⚠ 1 conflict(s) detected:
|
|
270
|
-
# ⚠ commands/analytics.md [modified]
|
|
271
|
-
#
|
|
272
|
-
# File: commands/analytics.md
|
|
273
|
-
# State: Modified in both template and locally
|
|
274
|
-
# ⚠ You have modified this file
|
|
275
|
-
# Template hash: 375ec9c90c168811
|
|
276
|
-
# Local hash: ee727b7a1a20a0c2
|
|
277
|
-
# ? How would you like to resolve this?
|
|
278
|
-
# Show diff
|
|
279
|
-
# ❯ Keep local version
|
|
280
|
-
# Overwrite with template
|
|
281
|
-
# Skip for now
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### New Commands
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
# Sync templates and handle conflicts
|
|
288
|
-
k0ntext sync-templates # Interactive mode
|
|
289
|
-
k0ntext sync-templates --dry-run # Preview changes
|
|
290
|
-
k0ntext sync-templates --force # Auto-overwrite conflicts
|
|
291
|
-
k0ntext sync-templates --verbose # Show detailed diffs
|
|
292
|
-
|
|
293
|
-
# Check sync status
|
|
294
|
-
k0ntext template-status # Quick status check
|
|
295
|
-
k0ntext template-status --verbose # Detailed file listings
|
|
296
|
-
|
|
297
|
-
# Skip template sync during init
|
|
298
|
-
k0ntext init --no-template-sync
|
|
299
|
-
```
|
|
222
|
+
---
|
|
300
223
|
|
|
301
|
-
|
|
224
|
+
## Latest Release (v3.8.0)
|
|
302
225
|
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
226
|
+
- **Database Snapshots** -- Create, restore, diff, and delete database snapshots with gzip compression
|
|
227
|
+
- **Persistent Todo Lists** -- TodoListManager service with markdown files that survive context compactions
|
|
228
|
+
- **AI-Powered Cleanup** -- CleanupAgent with OpenRouter-powered analysis for intelligent folder cleanup
|
|
229
|
+
- **Timestamp Tracking** -- TimestampTracker service for precise sync tracking
|
|
230
|
+
- **Database Schema v1.6.0** -- New tables for todo sessions, tasks, file timestamps, and generated files
|
|
307
231
|
|
|
308
|
-
|
|
232
|
+
See [CHANGELOG.md](CHANGELOG.md) for full release history.
|
|
309
233
|
|
|
310
|
-
|
|
311
|
-
|-----------|-------|-------------|
|
|
312
|
-
| `commands/` | 12 | Slash command definitions |
|
|
313
|
-
| `agents/` | 6 | AI agent configurations |
|
|
314
|
-
| `schemas/` | 14 | JSON schemas for validation |
|
|
315
|
-
| `standards/` | 4 | Coding standards |
|
|
316
|
-
| `tools/` | 3 | Tool-specific configurations |
|
|
317
|
-
| `automation/` | 1 | Automation settings |
|
|
318
|
-
| **Total** | **40** | **Excluded:** `context/`, `indexes/` (user-specific) |
|
|
234
|
+
---
|
|
319
235
|
|
|
320
|
-
##
|
|
236
|
+
## Complete CLI Reference
|
|
321
237
|
|
|
322
238
|
### Core Commands
|
|
323
239
|
|
|
@@ -336,10 +252,10 @@ k0ntext init --no-intelligent
|
|
|
336
252
|
```
|
|
337
253
|
|
|
338
254
|
**Options:**
|
|
339
|
-
- `--no-intelligent`
|
|
340
|
-
- `--no-version-check`
|
|
341
|
-
- `--no-template-sync`
|
|
342
|
-
- `-v, --verbose`
|
|
255
|
+
- `--no-intelligent` -- Skip OpenRouter-powered analysis
|
|
256
|
+
- `--no-version-check` -- Skip version checking for outdated context files
|
|
257
|
+
- `--no-template-sync` -- Skip template synchronization
|
|
258
|
+
- `-v, --verbose` -- Show detailed output
|
|
343
259
|
|
|
344
260
|
#### `k0ntext generate`
|
|
345
261
|
Generate context files for all AI tools.
|
|
@@ -359,10 +275,10 @@ k0ntext generate -v
|
|
|
359
275
|
```
|
|
360
276
|
|
|
361
277
|
**Options:**
|
|
362
|
-
- `-ai, --ai <tools>`
|
|
363
|
-
- `--force`
|
|
364
|
-
- `--map`
|
|
365
|
-
- `-v, --verbose`
|
|
278
|
+
- `-ai, --ai <tools>` -- Specific tools (comma-separated)
|
|
279
|
+
- `--force` -- Force regenerate all files
|
|
280
|
+
- `--map` -- Use concise map-based format
|
|
281
|
+
- `-v, --verbose` -- Show detailed output
|
|
366
282
|
|
|
367
283
|
#### `k0ntext mcp`
|
|
368
284
|
Start the Model Context Protocol server.
|
|
@@ -376,7 +292,7 @@ k0ntext mcp --db .my-context.db
|
|
|
376
292
|
```
|
|
377
293
|
|
|
378
294
|
**Options:**
|
|
379
|
-
- `--db <path>`
|
|
295
|
+
- `--db <path>` -- Database file path
|
|
380
296
|
|
|
381
297
|
#### `k0ntext sync`
|
|
382
298
|
Synchronize context across AI tools.
|
|
@@ -399,10 +315,10 @@ k0ntext sync --force
|
|
|
399
315
|
```
|
|
400
316
|
|
|
401
317
|
**Options:**
|
|
402
|
-
- `--check`
|
|
403
|
-
- `--from <tool>`
|
|
404
|
-
- `--to <tool>`
|
|
405
|
-
- `--force`
|
|
318
|
+
- `--check` -- Only check synchronization status
|
|
319
|
+
- `--from <tool>` -- Sync from specific tool
|
|
320
|
+
- `--to <tool>` -- Sync to specific tool
|
|
321
|
+
- `--force` -- Force sync even if up-to-date
|
|
406
322
|
|
|
407
323
|
#### `k0ntext cleanup`
|
|
408
324
|
Clean up context folders from other AI tools.
|
|
@@ -419,10 +335,10 @@ k0ntext cleanup -v
|
|
|
419
335
|
```
|
|
420
336
|
|
|
421
337
|
**Options:**
|
|
422
|
-
- `--dry-run`
|
|
423
|
-
- `--keep <folders>`
|
|
424
|
-
- `--ai`
|
|
425
|
-
- `-v, --verbose`
|
|
338
|
+
- `--dry-run` -- Show what would be removed
|
|
339
|
+
- `--keep <folders>` -- Folders to keep (comma-separated)
|
|
340
|
+
- `--ai` -- Use AI to intelligently analyze which folders can be safely removed
|
|
341
|
+
- `-v, --verbose` -- Show detailed output
|
|
426
342
|
|
|
427
343
|
#### `k0ntext validate`
|
|
428
344
|
Validate context files and AI tool configurations.
|
|
@@ -439,8 +355,8 @@ k0ntext validate --strict
|
|
|
439
355
|
```
|
|
440
356
|
|
|
441
357
|
**Options:**
|
|
442
|
-
- `--fix`
|
|
443
|
-
- `--strict`
|
|
358
|
+
- `--fix` -- Automatically fix validation errors
|
|
359
|
+
- `--strict` -- Treat warnings as errors
|
|
444
360
|
|
|
445
361
|
#### `k0ntext export <output>`
|
|
446
362
|
Export context database to file.
|
|
@@ -457,8 +373,8 @@ k0ntext export workflows.json --type workflow
|
|
|
457
373
|
```
|
|
458
374
|
|
|
459
375
|
**Options:**
|
|
460
|
-
- `--format <format>`
|
|
461
|
-
- `--type <type>`
|
|
376
|
+
- `--format <format>` -- Export format (json, markdown)
|
|
377
|
+
- `--type <type>` -- Filter by context type
|
|
462
378
|
|
|
463
379
|
#### `k0ntext import <input>`
|
|
464
380
|
Import context data from exported files.
|
|
@@ -472,8 +388,8 @@ k0ntext import context.json --merge
|
|
|
472
388
|
```
|
|
473
389
|
|
|
474
390
|
**Options:**
|
|
475
|
-
- `--format <format>`
|
|
476
|
-
- `--merge`
|
|
391
|
+
- `--format <format>` -- Import format (json, markdown)
|
|
392
|
+
- `--merge` -- Merge with existing data (default: replace)
|
|
477
393
|
|
|
478
394
|
#### `k0ntext performance`
|
|
479
395
|
Show performance metrics and optimization suggestions.
|
|
@@ -487,7 +403,7 @@ k0ntext performance --json
|
|
|
487
403
|
```
|
|
488
404
|
|
|
489
405
|
**Options:**
|
|
490
|
-
- `--json`
|
|
406
|
+
- `--json` -- Output as JSON
|
|
491
407
|
|
|
492
408
|
#### `k0ntext watch`
|
|
493
409
|
Watch for file changes and auto-update index.
|
|
@@ -501,7 +417,7 @@ k0ntext watch -d 2000
|
|
|
501
417
|
```
|
|
502
418
|
|
|
503
419
|
**Options:**
|
|
504
|
-
- `-d, --delay <ms>`
|
|
420
|
+
- `-d, --delay <ms>` -- Debounce delay in milliseconds
|
|
505
421
|
|
|
506
422
|
#### `k0ntext index`
|
|
507
423
|
Index codebase content into the database.
|
|
@@ -524,11 +440,11 @@ k0ntext index -v
|
|
|
524
440
|
```
|
|
525
441
|
|
|
526
442
|
**Options:**
|
|
527
|
-
- `--docs`
|
|
528
|
-
- `--code`
|
|
529
|
-
- `--tools`
|
|
530
|
-
- `--all`
|
|
531
|
-
- `-v, --verbose`
|
|
443
|
+
- `--docs` -- Index documentation files only
|
|
444
|
+
- `--code` -- Index source code only
|
|
445
|
+
- `--tools` -- Index AI tool configurations only
|
|
446
|
+
- `--all` -- Index everything (default)
|
|
447
|
+
- `-v, --verbose` -- Show detailed output
|
|
532
448
|
|
|
533
449
|
#### `k0ntext search <query>`
|
|
534
450
|
Search across indexed content.
|
|
@@ -551,9 +467,9 @@ k0ntext search "database" -l 5
|
|
|
551
467
|
```
|
|
552
468
|
|
|
553
469
|
**Options:**
|
|
554
|
-
- `-t, --type <type>`
|
|
555
|
-
- `-l, --limit <n>`
|
|
556
|
-
- `-m, --mode <mode>`
|
|
470
|
+
- `-t, --type <type>` -- Filter by type
|
|
471
|
+
- `-l, --limit <n>` -- Maximum results (default: 10)
|
|
472
|
+
- `-m, --mode <mode>` -- Search mode: text, semantic, hybrid
|
|
557
473
|
|
|
558
474
|
#### `k0ntext stats`
|
|
559
475
|
Show database and indexing statistics.
|
|
@@ -561,14 +477,11 @@ Show database and indexing statistics.
|
|
|
561
477
|
```bash
|
|
562
478
|
# View all statistics
|
|
563
479
|
k0ntext stats
|
|
564
|
-
|
|
565
|
-
# Show specific stats (filtered by index)
|
|
566
|
-
k0ntext stats | grep "Context Items"
|
|
567
480
|
```
|
|
568
481
|
|
|
569
|
-
###
|
|
482
|
+
### Context Management Commands
|
|
570
483
|
|
|
571
|
-
#### `k0ntext check`
|
|
484
|
+
#### `k0ntext check`
|
|
572
485
|
Check if context files are outdated.
|
|
573
486
|
|
|
574
487
|
```bash
|
|
@@ -586,11 +499,11 @@ k0ntext check --update --force
|
|
|
586
499
|
```
|
|
587
500
|
|
|
588
501
|
**Options:**
|
|
589
|
-
- `--update`
|
|
590
|
-
- `--force`
|
|
591
|
-
- `-v, --verbose`
|
|
502
|
+
- `--update` -- Prompt to update outdated files
|
|
503
|
+
- `--force` -- Update without prompting
|
|
504
|
+
- `-v, --verbose` -- Show detailed output
|
|
592
505
|
|
|
593
|
-
#### `k0ntext restore`
|
|
506
|
+
#### `k0ntext restore`
|
|
594
507
|
Restore AI tool config files from backups.
|
|
595
508
|
|
|
596
509
|
```bash
|
|
@@ -605,18 +518,15 @@ k0ntext restore --backup "AI_CONTEXT.md.2026-02-09T14.30.45.123Z.bak"
|
|
|
605
518
|
|
|
606
519
|
# Restore for specific tool
|
|
607
520
|
k0ntext restore --tool claude --list
|
|
608
|
-
|
|
609
|
-
# Force restore without confirmation
|
|
610
|
-
k0ntext restore --backup <path> --force
|
|
611
521
|
```
|
|
612
522
|
|
|
613
523
|
**Options:**
|
|
614
|
-
- `--list`
|
|
615
|
-
- `--backup <path>`
|
|
616
|
-
- `--tool <name>`
|
|
617
|
-
- `--force`
|
|
524
|
+
- `--list` -- List available backups
|
|
525
|
+
- `--backup <path>` -- Restore from specific backup path
|
|
526
|
+
- `--tool <name>` -- Filter by tool name
|
|
527
|
+
- `--force` -- Restore without confirmation
|
|
618
528
|
|
|
619
|
-
#### `k0ntext sync-templates`
|
|
529
|
+
#### `k0ntext sync-templates`
|
|
620
530
|
Sync `.claude/` templates from package `templates/base/`.
|
|
621
531
|
|
|
622
532
|
```bash
|
|
@@ -631,22 +541,16 @@ k0ntext sync-templates --subdirs commands,agents
|
|
|
631
541
|
|
|
632
542
|
# Force overwrite all conflicts
|
|
633
543
|
k0ntext sync-templates --force
|
|
634
|
-
|
|
635
|
-
# Verbose output with diffs
|
|
636
|
-
k0ntext sync-templates --verbose
|
|
637
|
-
|
|
638
|
-
# Skip archiving removed files
|
|
639
|
-
k0ntext sync-templates --no-archive
|
|
640
544
|
```
|
|
641
545
|
|
|
642
546
|
**Options:**
|
|
643
|
-
- `--dry-run`
|
|
644
|
-
- `--force`
|
|
645
|
-
- `--subdirs <dirs>`
|
|
646
|
-
- `-v, --verbose`
|
|
647
|
-
- `--no-archive`
|
|
547
|
+
- `--dry-run` -- Show changes without applying
|
|
548
|
+
- `--force` -- Auto-overwrite conflicts without prompting
|
|
549
|
+
- `--subdirs <dirs>` -- Comma-separated subdirectories to sync
|
|
550
|
+
- `-v, --verbose` -- Show detailed output including diffs
|
|
551
|
+
- `--no-archive` -- Skip archiving removed files
|
|
648
552
|
|
|
649
|
-
#### `k0ntext template-status`
|
|
553
|
+
#### `k0ntext template-status`
|
|
650
554
|
Show template sync status.
|
|
651
555
|
|
|
652
556
|
```bash
|
|
@@ -657,10 +561,24 @@ k0ntext template-status
|
|
|
657
561
|
k0ntext template-status --verbose
|
|
658
562
|
```
|
|
659
563
|
|
|
660
|
-
|
|
661
|
-
|
|
564
|
+
#### `k0ntext snapshot`
|
|
565
|
+
Manage database snapshots.
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
# Create a snapshot
|
|
569
|
+
k0ntext snapshot
|
|
662
570
|
|
|
663
|
-
|
|
571
|
+
# Restore from snapshot
|
|
572
|
+
k0ntext snapshot restore
|
|
573
|
+
|
|
574
|
+
# List all snapshots
|
|
575
|
+
k0ntext snapshots
|
|
576
|
+
|
|
577
|
+
# Diff two snapshots
|
|
578
|
+
k0ntext snap-diff
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### AI Analysis Commands
|
|
664
582
|
|
|
665
583
|
#### `k0ntext drift-detect`
|
|
666
584
|
AI-powered documentation drift detection using semantic analysis.
|
|
@@ -672,23 +590,16 @@ k0ntext drift-detect
|
|
|
672
590
|
# Detect drift in specific paths
|
|
673
591
|
k0ntext drift-detect -p CLAUDE.md,.cursorrules
|
|
674
592
|
|
|
675
|
-
# Check up to 20 files
|
|
676
|
-
k0ntext drift-detect --max-files 20
|
|
677
|
-
|
|
678
593
|
# Strict mode (fails on any drift)
|
|
679
594
|
k0ntext drift-detect --strict
|
|
680
|
-
|
|
681
|
-
# Verbose output
|
|
682
|
-
k0ntext drift-detect -v
|
|
683
595
|
```
|
|
684
596
|
|
|
685
597
|
**Options:**
|
|
686
|
-
- `--fix`
|
|
687
|
-
- `--strict`
|
|
688
|
-
- `-p, --paths <paths>`
|
|
689
|
-
- `--max-files <number>`
|
|
690
|
-
-
|
|
691
|
-
- `-v, --verbose` - Show detailed output
|
|
598
|
+
- `--fix` -- Automatically fix detected drift (experimental)
|
|
599
|
+
- `--strict` -- Fail on any drift detected
|
|
600
|
+
- `-p, --paths <paths>` -- Comma-separated paths to check
|
|
601
|
+
- `--max-files <number>` -- Maximum files to check (default: 50)
|
|
602
|
+
- `-v, --verbose` -- Show detailed output
|
|
692
603
|
|
|
693
604
|
#### `k0ntext cross-sync`
|
|
694
605
|
Intelligently synchronize context across all AI tools after drift detection.
|
|
@@ -702,20 +613,14 @@ k0ntext cross-sync --dry-run
|
|
|
702
613
|
|
|
703
614
|
# Sync to specific tools only
|
|
704
615
|
k0ntext cross-sync --to claude,cursor
|
|
705
|
-
|
|
706
|
-
# Sync from specific files
|
|
707
|
-
k0ntext cross-sync --affected CLAUDE.md,.cursorrules
|
|
708
|
-
|
|
709
|
-
# Verbose output with details
|
|
710
|
-
k0ntext cross-sync -v
|
|
711
616
|
```
|
|
712
617
|
|
|
713
618
|
**Options:**
|
|
714
|
-
- `--dry-run`
|
|
715
|
-
- `--from <tool>`
|
|
716
|
-
- `--to <tools>`
|
|
717
|
-
- `--affected <files>`
|
|
718
|
-
- `-v, --verbose`
|
|
619
|
+
- `--dry-run` -- Show what would be synced without making changes
|
|
620
|
+
- `--from <tool>` -- Sync only from specific tool
|
|
621
|
+
- `--to <tools>` -- Sync only to specific tools (comma-separated)
|
|
622
|
+
- `--affected <files>` -- Comma-separated list of affected files
|
|
623
|
+
- `-v, --verbose` -- Show detailed sync output
|
|
719
624
|
|
|
720
625
|
#### `k0ntext hooks`
|
|
721
626
|
Manage git hooks for automatic context synchronization.
|
|
@@ -724,9 +629,6 @@ Manage git hooks for automatic context synchronization.
|
|
|
724
629
|
# Install git hooks
|
|
725
630
|
k0ntext hooks install
|
|
726
631
|
|
|
727
|
-
# Install with force (overwrite existing)
|
|
728
|
-
k0ntext hooks install -f
|
|
729
|
-
|
|
730
632
|
# Uninstall git hooks
|
|
731
633
|
k0ntext hooks uninstall
|
|
732
634
|
|
|
@@ -735,13 +637,9 @@ k0ntext hooks status
|
|
|
735
637
|
```
|
|
736
638
|
|
|
737
639
|
**Subcommands:**
|
|
738
|
-
- `install`
|
|
739
|
-
- `uninstall`
|
|
740
|
-
- `status`
|
|
741
|
-
|
|
742
|
-
**Install Options:**
|
|
743
|
-
- `-f, --force` - Overwrite existing hooks
|
|
744
|
-
- `--skip-backup` - Skip backing up existing hooks
|
|
640
|
+
- `install` -- Install pre-commit hook for automatic workflow
|
|
641
|
+
- `uninstall` -- Remove installed hooks
|
|
642
|
+
- `status` -- Show hook installation status
|
|
745
643
|
|
|
746
644
|
#### `k0ntext fact-check [files...]`
|
|
747
645
|
Validate documentation accuracy using AI analysis.
|
|
@@ -752,28 +650,22 @@ k0ntext fact-check
|
|
|
752
650
|
|
|
753
651
|
# Check specific files
|
|
754
652
|
k0ntext fact-check CLAUDE.md .cursorrules
|
|
755
|
-
|
|
756
|
-
# Set minimum confidence threshold
|
|
757
|
-
k0ntext fact-check --min-confidence 0.7
|
|
758
|
-
|
|
759
|
-
# Verbose output
|
|
760
|
-
k0ntext fact-check -v
|
|
761
653
|
```
|
|
762
654
|
|
|
763
655
|
**Options:**
|
|
764
|
-
- `--fix`
|
|
765
|
-
- `-v, --verbose`
|
|
766
|
-
- `--min-confidence <number>`
|
|
656
|
+
- `--fix` -- Automatically fix detected issues (experimental)
|
|
657
|
+
- `-v, --verbose` -- Show detailed output
|
|
658
|
+
- `--min-confidence <number>` -- Minimum confidence to report (0-1, default: 0.5)
|
|
767
659
|
|
|
768
|
-
### Git Hooks Workflow
|
|
660
|
+
### Git Hooks Workflow
|
|
769
661
|
|
|
770
662
|
When you install hooks with `k0ntext hooks install`, the pre-commit hook automatically:
|
|
771
663
|
|
|
772
|
-
1. **Autosync**
|
|
773
|
-
2. **Validate**
|
|
774
|
-
3. **Drift Detect**
|
|
775
|
-
4. **Cross-Sync**
|
|
776
|
-
5. **Auto-Add**
|
|
664
|
+
1. **Autosync** -- Sync context from source of truth
|
|
665
|
+
2. **Validate** -- Check for context errors
|
|
666
|
+
3. **Drift Detect** -- AI-powered drift detection
|
|
667
|
+
4. **Cross-Sync** -- Update all AI tool contexts if drift found
|
|
668
|
+
5. **Auto-Add** -- Include updated context files in commit
|
|
777
669
|
|
|
778
670
|
**Skip hooks temporarily:**
|
|
779
671
|
```bash
|
|
@@ -782,9 +674,9 @@ K0NTEXT_SKIP_HOOKS=1 git commit -m "message"
|
|
|
782
674
|
git commit --no-verify -m "message"
|
|
783
675
|
```
|
|
784
676
|
|
|
785
|
-
##
|
|
677
|
+
## MCP Server Usage
|
|
786
678
|
|
|
787
|
-
### Auto-Configuration
|
|
679
|
+
### Auto-Configuration
|
|
788
680
|
|
|
789
681
|
When you run `k0ntext init`, the MCP server is **automatically configured** in `.claude/settings.json`:
|
|
790
682
|
|
|
@@ -812,22 +704,22 @@ k0ntext mcp
|
|
|
812
704
|
|
|
813
705
|
### Available MCP Tools
|
|
814
706
|
|
|
815
|
-
1. **search_context**
|
|
816
|
-
2. **get_item**
|
|
817
|
-
3. **add_knowledge**
|
|
818
|
-
4. **analyze**
|
|
819
|
-
5. **get_tool_configs**
|
|
820
|
-
6. **query_graph**
|
|
821
|
-
7. **get_stats**
|
|
707
|
+
1. **search_context** -- Semantic search across all indexed content
|
|
708
|
+
2. **get_item** -- Get a specific context item by ID or path
|
|
709
|
+
3. **add_knowledge** -- Store new insights or facts
|
|
710
|
+
4. **analyze** -- Run intelligent analysis on codebase
|
|
711
|
+
5. **get_tool_configs** -- Get AI tool configurations
|
|
712
|
+
6. **query_graph** -- Traverse knowledge graph
|
|
713
|
+
7. **get_stats** -- Get database statistics
|
|
822
714
|
|
|
823
715
|
### Available Prompts
|
|
824
716
|
|
|
825
|
-
1. **context-engineer**
|
|
826
|
-
2. **core-architect**
|
|
827
|
-
3. **api-developer**
|
|
828
|
-
4. **database-ops**
|
|
829
|
-
5. **integration-hub**
|
|
830
|
-
6. **deployment-ops**
|
|
717
|
+
1. **context-engineer** -- Initialize and configure AI context system
|
|
718
|
+
2. **core-architect** -- Design system architecture
|
|
719
|
+
3. **api-developer** -- Develop API endpoints
|
|
720
|
+
4. **database-ops** -- Database operations
|
|
721
|
+
5. **integration-hub** -- External integrations
|
|
722
|
+
6. **deployment-ops** -- CI/CD and deployment
|
|
831
723
|
|
|
832
724
|
### Example MCP Tool Usage
|
|
833
725
|
|
|
@@ -852,28 +744,28 @@ await add_knowledge({
|
|
|
852
744
|
});
|
|
853
745
|
```
|
|
854
746
|
|
|
855
|
-
##
|
|
747
|
+
## Supported AI Tools
|
|
856
748
|
|
|
857
749
|
### Fully Supported
|
|
858
|
-
- **Claude**
|
|
859
|
-
- **GitHub Copilot**
|
|
860
|
-
- **Cursor**
|
|
861
|
-
- **Windsurf**
|
|
862
|
-
- **Cline**
|
|
863
|
-
- **Aider**
|
|
864
|
-
- **Continue**
|
|
865
|
-
- **Antigravity**
|
|
866
|
-
- **Gemini**
|
|
750
|
+
- **Claude** -- AI_CONTEXT.md
|
|
751
|
+
- **GitHub Copilot** -- .github/copilot-instructions.md
|
|
752
|
+
- **Cursor** -- .cursorrules
|
|
753
|
+
- **Windsurf** -- .windsurf/rules.md
|
|
754
|
+
- **Cline** -- .clinerules
|
|
755
|
+
- **Aider** -- .aider.conf.yml
|
|
756
|
+
- **Continue** -- .continue/config.json
|
|
757
|
+
- **Antigravity** -- .agent/README.md
|
|
758
|
+
- **Gemini** -- .gemini/config.md
|
|
867
759
|
|
|
868
760
|
### RPI Workflow Skills
|
|
869
|
-
- **@context-engineer**
|
|
870
|
-
- **@core-architect**
|
|
871
|
-
- **@api-developer**
|
|
872
|
-
- **@database-ops**
|
|
873
|
-
- **@integration-hub**
|
|
874
|
-
- **@deployment-ops**
|
|
761
|
+
- **@context-engineer** -- Setup and configuration
|
|
762
|
+
- **@core-architect** -- System design
|
|
763
|
+
- **@api-developer** -- API development
|
|
764
|
+
- **@database-ops** -- Database operations
|
|
765
|
+
- **@integration-hub** -- External integrations
|
|
766
|
+
- **@deployment-ops** -- CI/CD and deployment
|
|
875
767
|
|
|
876
|
-
##
|
|
768
|
+
## Configuration
|
|
877
769
|
|
|
878
770
|
### Environment Variables
|
|
879
771
|
|
|
@@ -900,49 +792,58 @@ Each AI tool has its own configuration file path:
|
|
|
900
792
|
- Antigravity: `.agent/README.md`
|
|
901
793
|
- Gemini: `.gemini/config.md`
|
|
902
794
|
|
|
903
|
-
##
|
|
795
|
+
## Architecture
|
|
904
796
|
|
|
905
797
|
### System Components
|
|
906
798
|
|
|
907
799
|
```
|
|
908
800
|
k0ntext/
|
|
909
801
|
├── src/ # TypeScript source
|
|
910
|
-
│ ├──
|
|
911
|
-
│
|
|
912
|
-
│ │ ├── commands/ # Command implementations
|
|
913
|
-
│ │ └── utils/ # File detector, backup manager (v3.4.0)
|
|
914
|
-
│ ├── config/ # Centralized configuration (v3.1.0)
|
|
915
|
-
│ ├── db/ # SQLite database client
|
|
802
|
+
│ ├── agent-system/ # TodoListManager, TimestampTracker
|
|
803
|
+
│ ├── agents/ # Smart agents (Cleanup, Performance, Drift, FactCheck)
|
|
916
804
|
│ ├── analyzer/ # Intelligent codebase analysis
|
|
805
|
+
│ ├── cli/ # CLI commands, REPL shell, utilities
|
|
806
|
+
│ │ ├── version/ # Version detection system
|
|
807
|
+
│ │ ├── commands/ # Command implementations
|
|
808
|
+
│ │ └── utils/ # File detector, backup manager
|
|
809
|
+
│ ├── config/ # Centralized model configuration
|
|
810
|
+
│ ├── db/ # SQLite database client + migrations
|
|
917
811
|
│ ├── embeddings/ # OpenRouter integration
|
|
918
|
-
│ ├──
|
|
919
|
-
│ ├── template-engine/ # Handlebars template system
|
|
812
|
+
│ ├── services/ # SnapshotManager and services
|
|
813
|
+
│ ├── template-engine/ # Handlebars template system
|
|
814
|
+
│ ├── template-sync/ # Template synchronization
|
|
815
|
+
│ ├── utils/ # Utilities (chunking, encoding)
|
|
920
816
|
│ └── mcp.ts # MCP server implementation
|
|
921
817
|
├── agents/ # Agent definitions
|
|
922
818
|
├── skills/ # RPI workflow skills
|
|
923
819
|
├── templates/ # Output templates
|
|
820
|
+
│ ├── base/ # Templates synced to user .claude/ directories
|
|
821
|
+
│ └── map/ # Map-based context templates
|
|
924
822
|
└── .k0ntext.db # SQLite database (auto-created)
|
|
925
823
|
```
|
|
926
824
|
|
|
927
825
|
### Data Flow
|
|
928
826
|
|
|
929
|
-
1. **Initialization**
|
|
930
|
-
2. **Indexing**
|
|
931
|
-
3. **Generation**
|
|
932
|
-
4. **Sync**
|
|
933
|
-
5. **MCP Server**
|
|
827
|
+
1. **Initialization** -- `k0ntext init` discovers and analyzes codebase
|
|
828
|
+
2. **Indexing** -- `k0ntext index` stores content in SQLite with embeddings
|
|
829
|
+
3. **Generation** -- `k0ntext generate` creates tool-specific context files
|
|
830
|
+
4. **Sync** -- `k0ntext sync` keeps all AI tools synchronized
|
|
831
|
+
5. **MCP Server** -- `k0ntext mcp` provides real-time context to AI assistants
|
|
934
832
|
|
|
935
833
|
### Database Schema
|
|
936
834
|
|
|
937
835
|
The SQLite database contains:
|
|
938
|
-
- **Context Items**
|
|
939
|
-
- **Embeddings**
|
|
940
|
-
- **Relations**
|
|
941
|
-
- **Sync State**
|
|
942
|
-
- **Tool Configs**
|
|
943
|
-
- **Generated Files**
|
|
944
|
-
|
|
945
|
-
|
|
836
|
+
- **Context Items** -- Workflows, agents, commands, code, docs
|
|
837
|
+
- **Embeddings** -- Vector embeddings for semantic search
|
|
838
|
+
- **Relations** -- Knowledge graph connections
|
|
839
|
+
- **Sync State** -- Change tracking for synchronization (with version tracking)
|
|
840
|
+
- **Tool Configs** -- AI tool configurations
|
|
841
|
+
- **Generated Files** -- File tracking with hashes and backups
|
|
842
|
+
- **Todo Sessions/Tasks** -- Persistent task management
|
|
843
|
+
- **File Timestamps** -- Sync tracking timestamps
|
|
844
|
+
- **Snapshots** -- Database snapshot metadata
|
|
845
|
+
|
|
846
|
+
## Development
|
|
946
847
|
|
|
947
848
|
### Build and Test
|
|
948
849
|
|
|
@@ -981,16 +882,18 @@ npm run publish:public
|
|
|
981
882
|
4. Run tests and linting
|
|
982
883
|
5. Submit a pull request
|
|
983
884
|
|
|
885
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
886
|
+
|
|
984
887
|
### Project Structure
|
|
985
888
|
|
|
986
|
-
- `src/cli/`
|
|
987
|
-
- `src/db/`
|
|
988
|
-
- `src/analyzer/`
|
|
989
|
-
- `src/agents/`
|
|
990
|
-
- `templates/`
|
|
991
|
-
- `.claude/`
|
|
889
|
+
- `src/cli/` -- Command implementations
|
|
890
|
+
- `src/db/` -- Database operations
|
|
891
|
+
- `src/analyzer/` -- Code analysis logic
|
|
892
|
+
- `src/agents/` -- Smart agents
|
|
893
|
+
- `templates/` -- Context templates
|
|
894
|
+
- `.claude/` -- Claude Code development context
|
|
992
895
|
|
|
993
|
-
##
|
|
896
|
+
## Performance Monitoring
|
|
994
897
|
|
|
995
898
|
The PerformanceMonitorAgent provides insights into:
|
|
996
899
|
- Query execution times
|
|
@@ -1006,13 +909,7 @@ k0ntext performance
|
|
|
1006
909
|
k0ntext performance --json
|
|
1007
910
|
```
|
|
1008
911
|
|
|
1009
|
-
|
|
1010
|
-
- Add indexes for frequently queried columns
|
|
1011
|
-
- Run VACUUM for large databases
|
|
1012
|
-
- Review and optimize slow queries
|
|
1013
|
-
- Monitor cache hit rates
|
|
1014
|
-
|
|
1015
|
-
## 🔍 Troubleshooting
|
|
912
|
+
## Troubleshooting
|
|
1016
913
|
|
|
1017
914
|
### Common Issues
|
|
1018
915
|
|
|
@@ -1049,13 +946,15 @@ k0ntext index -v
|
|
|
1049
946
|
k0ntext generate -v
|
|
1050
947
|
```
|
|
1051
948
|
|
|
1052
|
-
|
|
949
|
+
See [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for the full troubleshooting guide.
|
|
950
|
+
|
|
951
|
+
## Community
|
|
1053
952
|
|
|
1054
953
|
- **GitHub Issues:** [Report bugs and request features](https://github.com/SireJeff/k0ntext/issues)
|
|
1055
954
|
- **Discussions:** [Join community discussions](https://github.com/SireJeff/k0ntext/discussions)
|
|
1056
|
-
- **Documentation:** [Full
|
|
955
|
+
- **Documentation:** [Full docs](./docs/)
|
|
1057
956
|
|
|
1058
|
-
##
|
|
957
|
+
## License
|
|
1059
958
|
|
|
1060
959
|
MIT License - see [LICENSE](LICENSE) file for details.
|
|
1061
960
|
|
|
@@ -1066,4 +965,4 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
1066
965
|
**Issues:** https://github.com/SireJeff/k0ntext/issues
|
|
1067
966
|
**MCP Protocol:** https://modelcontextprotocol.io
|
|
1068
967
|
|
|
1069
|
-
Made with
|
|
968
|
+
Made with care by [SireJeff](https://github.com/SireJeff)
|