@xelth/eck-snapshot 5.9.0 → 6.6.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 +321 -190
- package/index.js +1 -1
- package/package.json +15 -2
- package/scripts/mcp-eck-core.js +143 -13
- package/setup.json +119 -81
- package/src/cli/cli.js +256 -385
- package/src/cli/commands/createSnapshot.js +391 -175
- package/src/cli/commands/recon.js +308 -0
- package/src/cli/commands/setupMcp.js +280 -19
- package/src/cli/commands/trainTokens.js +42 -32
- package/src/cli/commands/updateSnapshot.js +136 -43
- package/src/core/depthConfig.js +54 -0
- package/src/core/skeletonizer.js +280 -21
- package/src/templates/architect-prompt.template.md +34 -0
- package/src/templates/multiAgent.md +68 -15
- package/src/templates/opencode/coder.template.md +53 -17
- package/src/templates/opencode/junior-architect.template.md +54 -15
- package/src/templates/skeleton-instruction.md +1 -1
- package/src/templates/update-prompt.template.md +2 -0
- package/src/utils/aiHeader.js +57 -27
- package/src/utils/claudeMdGenerator.js +182 -88
- package/src/utils/fileUtils.js +217 -149
- package/src/utils/gitUtils.js +12 -8
- package/src/utils/opencodeAgentsGenerator.js +8 -2
- package/src/utils/projectDetector.js +66 -21
- package/src/utils/tokenEstimator.js +11 -7
- package/src/cli/commands/consilium.js +0 -86
- package/src/cli/commands/detectProfiles.js +0 -98
- package/src/cli/commands/envSync.js +0 -319
- package/src/cli/commands/generateProfileGuide.js +0 -144
- package/src/cli/commands/pruneSnapshot.js +0 -106
- package/src/cli/commands/restoreSnapshot.js +0 -173
- package/src/cli/commands/setupGemini.js +0 -149
- package/src/cli/commands/setupGemini.test.js +0 -115
- package/src/cli/commands/showFile.js +0 -39
- package/src/services/claudeCliService.js +0 -626
- package/src/services/claudeCliService.test.js +0 -267
package/README.md
CHANGED
|
@@ -1,190 +1,321 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
A CLI tool that
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
###
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
eck-snapshot
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
eck-snapshot
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
eck-snapshot
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
eck-snapshot
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
eck-snapshot
|
|
113
|
-
eck-snapshot
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
eck-snapshot
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
eck-snapshot
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
eck-snapshot
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
1
|
+
# 📸 eckSnapshot v6.5.0 (AI-Native Edition)
|
|
2
|
+
|
|
3
|
+
A specialized, AI-native CLI tool that creates single-file text snapshots of entire Git repositories and feeds them directly into LLM context windows. Instead of letting AI agents guess which files to read, eckSnapshot force-feeds the complete project into the model's context — giving it a "university degree" in your codebase from the very first prompt.
|
|
4
|
+
|
|
5
|
+
It also serves as the coordination hub for multi-agent AI coding workflows: generating role-specific instructions (`CLAUDE.md`, `AGENTS.md`), maintaining project manifests (`.eck/` directory), and providing MCP integration for automatic context sync after every code change.
|
|
6
|
+
|
|
7
|
+
> **Want to see it in action?** This project snapshots itself.
|
|
8
|
+
> [**Download ecksnapshot-context.md**](https://github.com/xelth-com/eckSnapshot/releases/download/v6.2.3/ecksnapshot-context.md) (364 KB), drop it into [Gemini](https://gemini.google.com/), ChatGPT, or any LLM with a large context window — and ask anything in your language — the AI will answer you natively while keeping code-level discussions in English. It becomes a Senior Architect who built this tool.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> **v6.5.0 Breakthrough:** By analyzing Claude Code's internal source architecture, eckSnapshot now features **native integration** with Anthropic's flagship tool. It no longer generates a monolithic markdown file; it natively wires into Claude's `.claude/` topology — Async Hooks, Native Skills, and Subagents. Claude Code is the recommended environment for eckSnapshot.
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g @xelth/eck-snapshot
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🎯 The Battle-Tested Workflow
|
|
23
|
+
|
|
24
|
+
### 1. Initial Context (Full Snapshot)
|
|
25
|
+
Take a full snapshot and feed it to a powerful **Web LLM** — the **Senior Architect**.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
eck-snapshot
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The generated `.md` file goes into the chat of your chosen Architect model. The Architect analyzes the full codebase and produces a detailed technical plan.
|
|
32
|
+
|
|
33
|
+
*(For massive monorepos, slice the context using profiles: `eck-snapshot '{"name": "eck_snapshot", "arguments": {"profile": "frontend"}}'`)*
|
|
34
|
+
|
|
35
|
+
### 2. Direct Execution
|
|
36
|
+
Pass the Architect's technical plan to your local **Coder agent** (Claude Code / OpenCode / Codex). The Coder implements the changes directly in your repository.
|
|
37
|
+
|
|
38
|
+
### 3. Auto-Updates
|
|
39
|
+
When the Coder agent finishes a task, it automatically calls the built-in MCP tool (`eck_finish_task`), which commits the code and generates an incremental delta update snapshot. Feed that update back to the Architect to keep it in sync.
|
|
40
|
+
|
|
41
|
+
> **Custom base:** Use `eck-snapshot update --base <snapshot.md>` to generate a delta relative to any past snapshot file. Pass the filename (e.g. `eckRepo26-04-01_f2e1bd4_up1_29kb.md`) — the anchor hash is extracted automatically. This doesn't disturb the automatic sequence counter — custom-base snapshots get a `_upcustom` suffix. A raw git hash (7+ hex chars) also works.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🧠 Which Models to Use
|
|
46
|
+
|
|
47
|
+
### Senior Architect (Web LLM — reads the snapshot)
|
|
48
|
+
|
|
49
|
+
The Architect needs a **massive context window** and strong reasoning to digest the full codebase snapshot:
|
|
50
|
+
|
|
51
|
+
| Model | Context Window | Notes |
|
|
52
|
+
|-------|---------------|-------|
|
|
53
|
+
| **Grok 4 Fast** | **2M tokens** | Largest context available. Can swallow even the biggest monorepos whole. |
|
|
54
|
+
| **Gemini 3.1 Pro** | 1M tokens | Excellent for large projects. Handles huge snapshots effortlessly. *(Author's choice)* |
|
|
55
|
+
| **ChatGPT (GPT-5.4 via web)** | 1M tokens | Works, but can be stubborn with instructions. You **MUST** paste the specific prompt provided at the end of the snapshot output as your first message — otherwise ChatGPT will act as a generic code reviewer instead of assuming the Architect role. |
|
|
56
|
+
|
|
57
|
+
### Coder Agent (Local — executes the plan)
|
|
58
|
+
|
|
59
|
+
The Coder needs **tool access** (file editing, terminal, MCP) and works locally in your repository:
|
|
60
|
+
|
|
61
|
+
| Tool | Engine | Best For |
|
|
62
|
+
|------|--------|----------|
|
|
63
|
+
| **Claude Code** | Claude Sonnet/Opus 4.6 | **Recommended.** Natively integrated into the `.claude/` architecture. Silent background context-syncing, native slash skills (`/eck-scout`), and native subagents. |
|
|
64
|
+
| **OpenCode** | GLM-4.7 / any model | **Solid alternative.** Budget-friendly with `AGENTS.md` support and GLM Z.AI worker swarm via MCP, but lacks the deep background hook integration of Claude Code. |
|
|
65
|
+
| **Codex CLI** | GPT models | OpenAI's coding agent. Basic auto-configuration via `.codex/config.toml`. |
|
|
66
|
+
|
|
67
|
+
### MCP Setup (One-Time)
|
|
68
|
+
Register the MCP servers so your Coder agent can auto-commit and sync context:
|
|
69
|
+
```bash
|
|
70
|
+
eck-snapshot setup-mcp
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🤖 The AI-Native JSON Interface (New in v6.1)
|
|
76
|
+
|
|
77
|
+
`eck-snapshot` is a **100% pure JSON/MCP bridge**. AI agents interact with the CLI by passing a single JSON payload:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"profile": "backend", "jas": true}}'
|
|
81
|
+
eck-snapshot '{"name": "eck_update"}'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 🧑💻 Human Shorthands (Ranked by Usage)
|
|
85
|
+
For humans typing in the terminal, short commands work too:
|
|
86
|
+
|
|
87
|
+
| # | Command | Description |
|
|
88
|
+
|---|---------|-------------|
|
|
89
|
+
| 1 | `eck-snapshot snapshot` | Full project snapshot |
|
|
90
|
+
| 2 | `eck-snapshot update` | Delta update (changed files only). Supports `--base <snapshot.md>` to compare against an old snapshot file. |
|
|
91
|
+
| 3 | `eck-snapshot profile [name]` | Snapshot filtered by profile (no arg = list profiles) |
|
|
92
|
+
| 4 | `eck-snapshot scout [0-9]` | Scout external repo (see depth scale below) |
|
|
93
|
+
| 5 | `eck-snapshot fetch "src/**/*.rs"` | Fetch specific files by glob |
|
|
94
|
+
| 6 | `eck-snapshot link [0-9]` | Linked companion snapshot |
|
|
95
|
+
| 7 | `eck-snapshot notebook` | NotebookLM: Primary project (Hybrid mode) |
|
|
96
|
+
| 7a | `eck-snapshot notebook link 5` | NotebookLM: Linked project (chunked, depth-controlled) |
|
|
97
|
+
| 7b | `eck-snapshot notebook scout 3` | NotebookLM: Scouted project (chunked, read-only) |
|
|
98
|
+
| 8 | `eck-snapshot booklm` | NotebookLM: Scout mode (fetch generator) |
|
|
99
|
+
| 9 | `eck-snapshot notelm` | NotebookLM: Architect mode (experimental) |
|
|
100
|
+
| 10 | `eck-snapshot setup-mcp` | Configure MCP servers |
|
|
101
|
+
| 10 | `eck-snapshot detect` | Detect project type and active filters |
|
|
102
|
+
| 11 | `eck-snapshot doctor` | Check project health and stubs |
|
|
103
|
+
| 12 | `eck-snapshot telemetry` | Check telemetry status (also: `enable` / `disable`) |
|
|
104
|
+
|
|
105
|
+
Running `eck-snapshot` with no arguments defaults to a full snapshot.
|
|
106
|
+
|
|
107
|
+
### ✉️ Feedback & Telemetry
|
|
108
|
+
```bash
|
|
109
|
+
eck-snapshot -e "Great tool, but scout could be faster" # Normal feedback
|
|
110
|
+
eck-snapshot -E "Crash on Windows when path has spaces" # Urgent bug report
|
|
111
|
+
eck-snapshot telemetry disable # Opt out completely
|
|
112
|
+
eck-snapshot telemetry enable # Opt back in
|
|
113
|
+
eck-snapshot telemetry # Check current status
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Feedback is saved locally to `.eck/telemetry_queue.json` and will be sent to developers during the next telemetry sync.
|
|
117
|
+
|
|
118
|
+
#### 🔒 Datenschutz / Privacy
|
|
119
|
+
By default, eck-snapshot collects **anonymous usage counts** and **crash logs** to improve the tool. **NO source code or sensitive data is ever sent.** Each CLI instance is identified by a random UUID stored in `~/.eck/cli-config.json`. You can completely disable telemetry at any time with `eck-snapshot telemetry disable`.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 🔗 Cross-Context: Scouts & Links (Working with External Projects)
|
|
124
|
+
|
|
125
|
+
When your AI is working on **Project A** but needs awareness of **Project B** (a shared backend, a component library, a microservice), feeding it a standard snapshot of Project B will cause "context pollution" — the AI forgets which project it's supposed to edit.
|
|
126
|
+
|
|
127
|
+
eckSnapshot solves this with two complementary tools that share a **unified depth scale (0-9)** for controlling how much content is included:
|
|
128
|
+
|
|
129
|
+
### `scout` — Quick Exploration (read-only)
|
|
130
|
+
Run inside the external repository:
|
|
131
|
+
```bash
|
|
132
|
+
cd ../project-b
|
|
133
|
+
eck-snapshot scout # depth 0: tree only (fast overview)
|
|
134
|
+
eck-snapshot scout 3 # depth 3: tree + 60 lines per file
|
|
135
|
+
eck-snapshot scout 5 # depth 5: tree + function signatures
|
|
136
|
+
```
|
|
137
|
+
*Result:* Generates `.eck/scouts/scout_tree_...md` — a directory tree (and optionally file contents) with strict instructions telling the AI **NOT** to edit this code. Feed it to your AI, and it can request specific files via `eck-snapshot fetch "src/**/*.js"`.
|
|
138
|
+
|
|
139
|
+
### `link` — Deep Cross-Context Snapshot (companion file)
|
|
140
|
+
Run inside the companion project:
|
|
141
|
+
```bash
|
|
142
|
+
cd ../project-b
|
|
143
|
+
eck-snapshot link 5 # skeleton: function signatures
|
|
144
|
+
eck-snapshot link 9 # full: complete file contents
|
|
145
|
+
```
|
|
146
|
+
*Result:* Generates a standalone `link_*.md` file saved to `.eck/links/` with a read-only cross-context header. Upload it alongside your main project snapshot. The AI will automatically receive instructions to **not edit** the linked project and will be given `eck_fetch` commands to drill deeper if needed.
|
|
147
|
+
|
|
148
|
+
### `fetch` — Targeted File Extraction (by glob pattern)
|
|
149
|
+
```bash
|
|
150
|
+
eck-snapshot fetch "src/core/parser.js" "docs/**/*.md"
|
|
151
|
+
```
|
|
152
|
+
*Result:* Generates `.eck/scouts/scout_data_...md` containing only the requested file contents, perfectly formatted for reading without losing the primary role.
|
|
153
|
+
|
|
154
|
+
### Shared Depth Scale (0-9)
|
|
155
|
+
Both `scout` and `link` use the same depth scale to control content granularity:
|
|
156
|
+
|
|
157
|
+
| Depth | Mode | Use Case |
|
|
158
|
+
|-------|------|----------|
|
|
159
|
+
| **0** | Tree only | "Just show me the folder structure" |
|
|
160
|
+
| **1** | Truncated (10 lines) | Imports and file headers only |
|
|
161
|
+
| **2** | Truncated (30 lines) | Quick surface scan |
|
|
162
|
+
| **3** | Truncated (60 lines) | API surface overview |
|
|
163
|
+
| **4** | Truncated (100 lines) | Detailed surface scan |
|
|
164
|
+
| **5** | Skeleton | Function/class signatures only (no docs) |
|
|
165
|
+
| **6** | Skeleton + docs | Signatures with JSDoc/docstrings preserved |
|
|
166
|
+
| **7** | Full (compact) | Full content, truncated at 500 lines per file |
|
|
167
|
+
| **8** | Full (standard) | Full content, truncated at 1000 lines per file |
|
|
168
|
+
| **9** | Full (unlimited) | Everything, no limits |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 🤖 The Claude Code Native Ecosystem (New in v6.5.0)
|
|
173
|
+
|
|
174
|
+
By analyzing Claude Code's internal architecture, eckSnapshot replaces the old monolithic `CLAUDE.md` approach with a natively injected ecosystem inside your `.claude/` directory:
|
|
175
|
+
|
|
176
|
+
1. **Async Background Context Sync:** A native `PostToolUse` hook (`async: true`) is injected into Claude's `settings.json`. Every time Claude edits a file, `eck-snapshot update-auto` runs silently in the background — your snapshot context stays current without interrupting the chat flow.
|
|
177
|
+
2. **Native Slash Skills:** Cross-repo exploration is built into Claude's UI. Type `/eck-scout path="../other-repo"` or `/eck-fetch` in the Claude CLI, and it executes the scout protocol as a first-class skill.
|
|
178
|
+
3. **Native Subagents:** Junior Architects (`jas`, `jao`) are injected as native `.claude/agents/`. Claude can spawn them directly via the `AgentTool` for parallel task delegation.
|
|
179
|
+
4. **Modular Rules:** Instructions, Swarm delegation protocols, and manifest loaders are split into `.claude/rules/`, loaded by the LLM only when relevant — no more context-polluting 1000-line `CLAUDE.md` files.
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
.claude/
|
|
183
|
+
├── rules/01-eck-protocol.md # Role-specific protocol (coder/jas/jao)
|
|
184
|
+
├── skills/
|
|
185
|
+
│ ├── eck-scout/SKILL.md # Cross-repo exploration
|
|
186
|
+
│ └── eck-fetch/SKILL.md # Targeted file extraction
|
|
187
|
+
├── agents/
|
|
188
|
+
│ ├── jas.md # Junior Architect (Sonnet)
|
|
189
|
+
│ └── jao.md # Junior Architect (Opus)
|
|
190
|
+
└── settings.json # PostToolUse async hook
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🌟 Core Features
|
|
196
|
+
|
|
197
|
+
* **🔄 Smart Delta Updates:** Tracks incremental changes via Git anchors. Accurately tracks and reports deleted files to prevent LLM hallucinations.
|
|
198
|
+
* **🛡️ Security (SecretScanner):** Automatically redacts API keys and credentials before sending context to LLMs. Features both Regex matching and **Shannon Entropy** analysis.
|
|
199
|
+
* **🔌 Native MCP Integration:** Instantly spins up Model Context Protocol (MCP) servers (`eck-core` and `glm-zai`) for Claude Code, OpenCode, and Codex. Includes `eck_manifest_edit` for atomic `.eck/` file editing without loading full files into context.
|
|
200
|
+
* **📁 The `.eck/` Manifest:** Automatically maintains project context files (`CONTEXT.md`, `ROADMAP.md`, `TECH_DEBT.md`). Dynamic scanning — any `.md` file you add to `.eck/` is automatically included in snapshots.
|
|
201
|
+
* **☠️ Skeleton Mode:** Uses Tree-sitter and Babel to strip function bodies, drastically reducing token count for huge codebases.
|
|
202
|
+
* **📚 NotebookLM Export:** Semantic chunking for Google's NotebookLM with "Brain + Body" architecture (see below).
|
|
203
|
+
* **🧪 ML Model Compatibility:** Smart metadata extraction for `.safetensors`, `.onnx`, `.pt`, `.pth`, `.h5`, `.pb`, `.bin`, `.ckpt`, `.gguf` — reads the first 4KB header instead of loading multi-GB weights into memory.
|
|
204
|
+
* **🧠 Multi-Agent Protocol:** Junior Architect delegation system for multi-agent coding workflows (see below).
|
|
205
|
+
|
|
206
|
+
### 🤖 Autonomous AI Protocols
|
|
207
|
+
`eckSnapshot` automatically injects strict behavioral protocols into the AI Architect's prompt (`multiAgent.md`) to ensure high code quality and prevent context degradation:
|
|
208
|
+
1. **Context Hygiene Protocol:** The AI actively monitors the directory tree for bloat (logs, DB dumps, binaries). If detected, it autonomously constructs an `.eckignore` file to hide the garbage, saving tokens and context space.
|
|
209
|
+
2. **Proactive Tech Debt:** The AI scans for `TODO`, `FIXME`, and `HACK` comments, evaluating them against the actual code. It will autonomously delete obsolete comments, fix quick bugs, or document major issues in `.eck/TECH_DEBT.md`.
|
|
210
|
+
3. **The Boy Scout Rule:** Whenever the AI modifies or creates a function, it is forced to write or update its JSDoc/Docstring to explain *why* the code exists, keeping documentation perfectly synced.
|
|
211
|
+
4. **Zero-Broken-Windows (Reliability):** Blind commits are strictly forbidden. The AI must run the project's test suite (e.g., `npm test`, `cargo test`) and ensure all tests pass before calling the task completion tool.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 📚 NotebookLM Integration
|
|
216
|
+
|
|
217
|
+
Google's NotebookLM provides **free RAG** (Retrieval-Augmented Generation) over up to **50 sources**, making it a perfect companion for your paid Architect LLM. Instead of feeding your entire codebase into Gemini or Grok on every question, you let NotebookLM index it and answer targeted queries.
|
|
218
|
+
|
|
219
|
+
eckSnapshot exports your repository as semantically packed chunks using a **Brain + Body** architecture:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
Part 0 (Brain) — Project metadata, .eck/ manifests, full directory tree. No code.
|
|
223
|
+
Part 1 (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
224
|
+
Part 2 (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
225
|
+
...
|
|
226
|
+
Part N (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Files from the same directory stay together for better RAG retrieval. The directory tree lives only in Part 0 to avoid wasting tokens across chunks.
|
|
230
|
+
|
|
231
|
+
### System Prompts
|
|
232
|
+
|
|
233
|
+
NotebookLM now supports **Custom Instructions** (system prompts) with a 10,000-character limit. eckSnapshot prints a tailored system prompt to your terminal after every export — copy it into NotebookLM's `Chat konfigurieren → Benutzerdefiniert` field. The Brain file no longer embeds role instructions, so the AI won't "forget" them.
|
|
234
|
+
|
|
235
|
+
### Three Modes
|
|
236
|
+
|
|
237
|
+
**`notebook` — Hybrid (Primary Project)**
|
|
238
|
+
```bash
|
|
239
|
+
eck-snapshot notebook
|
|
240
|
+
```
|
|
241
|
+
The main export for your primary repository. The system prompt instructs NotebookLM to act as a Senior Architect managing a multi-repo ecosystem, distinguishing between Primary sources (editable), Linked sources (cross-project companions), and Scouted sources (read-only reference).
|
|
242
|
+
|
|
243
|
+
**`booklm` — Scout (Fetch Generator)**
|
|
244
|
+
```bash
|
|
245
|
+
eck-snapshot booklm
|
|
246
|
+
```
|
|
247
|
+
NotebookLM becomes a free "code librarian". Ask *"I'm working on fiscalization, which files do I need?"* — it analyzes the codebase via RAG and returns precise fetch commands:
|
|
248
|
+
```bash
|
|
249
|
+
cd /path/to/project
|
|
250
|
+
eck-snapshot fetch "**/FiscalPrinter.kt" "**/TaxCalculator.kt"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**`notelm` — Architect (Experimental)**
|
|
254
|
+
```bash
|
|
255
|
+
eck-snapshot notelm
|
|
256
|
+
```
|
|
257
|
+
NotebookLM acts as the Senior Architect itself — analyzing architecture, proposing refactoring, designing features.
|
|
258
|
+
|
|
259
|
+
### Chunked Links & Scouts
|
|
260
|
+
|
|
261
|
+
Secondary projects (linked companions or external repositories you're scouting) can also be chunked and uploaded to the same NotebookLM project:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
eck-snapshot notebook link 5 # Linked project: skeleton depth, modifiable
|
|
265
|
+
eck-snapshot notebook scout 3 # Scouted project: truncated, read-only
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The depth scale (0–9) from the `scout`/`link` commands applies — depth 0 produces a brain-only export (tree + manifests, no code), depth 5 skeletonizes, depth 9 includes everything. Each secondary project's Part 0 header explicitly labels its role so the AI knows whether it can modify the code or must treat it as read-only reference.
|
|
269
|
+
|
|
270
|
+
### Quick Start
|
|
271
|
+
1. Run `eck-snapshot notebook` inside your primary project
|
|
272
|
+
2. Copy the system prompt printed in your terminal into NotebookLM's Custom Instructions
|
|
273
|
+
3. Upload all generated `part*.md` files as sources
|
|
274
|
+
4. (Optional) Run `eck-snapshot notebook link 5` / `notebook scout 3` for secondary projects and upload those too
|
|
275
|
+
5. Start asking questions
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 🧠 Multi-Agent Protocol: Junior Architects (Testing)
|
|
280
|
+
|
|
281
|
+
> **Status:** Active testing. The delegation protocol works, prompt optimization is ongoing.
|
|
282
|
+
|
|
283
|
+
### The Concept
|
|
284
|
+
For large projects, a single AI can't hold the full context AND write code efficiently. eckSnapshot implements a **Royal Court** hierarchy:
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
Senior Architect (Gemini/Grok — Web LLM, huge context)
|
|
288
|
+
│
|
|
289
|
+
├── Junior Architect Sonnet (jas) — Claude Code with Sonnet 4.6
|
|
290
|
+
├── Junior Architect Opus (jao) — Claude Code with Opus 4.6
|
|
291
|
+
├── Junior Architect GLM (jaz) — OpenCode with GLM-4.7
|
|
292
|
+
│ │
|
|
293
|
+
│ └── GLM Z.AI Workers (MCP) — cheap bulk coding
|
|
294
|
+
│
|
|
295
|
+
└── Coder (default) — standard developer mode
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
The Senior Architect reads the full snapshot, plans the work, and delegates tasks via the Eck-Protocol v2. Junior Architects receive filtered snapshots with role-specific `CLAUDE.md` / `AGENTS.md` instructions and execute the plan locally.
|
|
299
|
+
|
|
300
|
+
### Usage
|
|
301
|
+
```bash
|
|
302
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jas": true}}' # Sonnet mode
|
|
303
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jao": true}}' # Opus mode
|
|
304
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jaz": true}}' # GLM/OpenCode mode
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Each mode generates a snapshot with tailored AI headers. For Claude Code (`jas`/`jao`), it natively registers them as subagents in `.claude/agents/` so you can spawn them via Claude's `AgentTool`. For OpenCode (`jaz`), it updates the `AGENTS.md` manifest.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 💡 The Philosophy: Why force a full snapshot?
|
|
312
|
+
|
|
313
|
+
LLMs work like humans who have memorized a textbook. Giving an AI a "file search" tool is like putting a beginner next to a bookshelf — they have to guess what to look for. Forcing a complete project snapshot into the LLM's massive context window is like giving it a university degree in your specific codebase. That is what `eck-snapshot` does.
|
|
314
|
+
|
|
315
|
+
## Ethical Automation Policy
|
|
316
|
+
|
|
317
|
+
This project respects the Terms of Service of AI providers. We do not implement browser automation to bypass or spoof web chat interfaces intended for human use. All AI integrations use official APIs.
|
|
318
|
+
|
|
319
|
+
## License
|
|
320
|
+
MIT © xelth-com
|
|
321
|
+
<div align="right"><sup>made in Eschborn</sup></div>
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xelth/eck-snapshot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories
|
|
3
|
+
"version": "6.6.0",
|
|
4
|
+
"description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories. Optimized for AI context, LLM workflows, and multi-agent Swarm coordination.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"llm",
|
|
8
|
+
"mcp",
|
|
9
|
+
"snapshot",
|
|
10
|
+
"context",
|
|
11
|
+
"claude",
|
|
12
|
+
"gemini",
|
|
13
|
+
"grok",
|
|
14
|
+
"chatgpt",
|
|
15
|
+
"agent",
|
|
16
|
+
"prompt"
|
|
17
|
+
],
|
|
5
18
|
"main": "index.js",
|
|
6
19
|
"type": "module",
|
|
7
20
|
"bin": {
|