@xelth/eck-snapshot 6.0.2 โ†’ 6.0.4

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 CHANGED
@@ -1,71 +1,52 @@
1
1
  # ๐Ÿ“ธ eckSnapshot v6.0
2
2
 
3
- A specialized, AI-native CLI tool designed to create and restore single-file text snapshots of Git repositories. Optimized for providing full project context to Large Language Models (LLMs) and serving as the coordination hub for Multi-Agent AI Architectures.
3
+ A specialized, AI-native CLI tool designed to create and restore single-file text snapshots of Git repositories. Optimized for providing full project context to Large Language Models (LLMs) and serving as the coordination hub for AI Coders.
4
4
 
5
- ## ๐ŸŒŸ Key Features
5
+ ## ๐ŸŽฏ The Battle-Tested Workflow & Quick Start
6
6
 
7
- * **๐Ÿง  Multi-Agent Protocol (Royal Court):** Built-in support for the "Royal Court" architecture. Delegate tasks from a Senior Architect (Claude/Gemini) to Junior Managers, who orchestrate a swarm of specialized GLM-4.7 workers.
8
- * **โ˜ ๏ธ Skeleton Mode:** Uses `Tree-sitter` and `Babel` to strip function bodies, drastically reducing token count while preserving structural context. Supports JS/TS, Rust, Go, Python, C, Java, and Kotlin.
9
- * **๐Ÿ”„ Smart Delta Updates:** Tracks incremental changes via Git anchors with sequential numbering. Now accurately tracks and reports deleted files to prevent LLM hallucinations.
10
- * **๐Ÿ›ก๏ธ Security (SecretScanner):** Automatically redacts API keys and credentials before sending context to LLMs. Features both Regex matching and **Shannon Entropy** analysis for catching non-standard hardcoded secrets.
11
- * **๐Ÿ“Š Telemetry Hub:** Integrated with a Rust-based microservice (`eck-telemetry`) for tracking agent execution metrics, auto-syncing token estimation weights via linear regression, and in-memory caching.
12
- * **๐Ÿ”Œ Native MCP Integration:** Instantly spins up Model Context Protocol (MCP) servers (`eck-core` for context sync and `glm-zai` for worker swarms) for Claude Code and OpenCode.
7
+ I personally use this tool daily with local AI coding agents (**Claude Code** using Claude, and **OpenCode** using GLM). My reliable, heavily-tested workflow is:
13
8
 
14
- ## ๐Ÿš€ Quick Start
15
-
16
- ### Installation
9
+ ### 1. Installation
17
10
  ```bash
18
11
  npm install -g @xelth/eck-snapshot
19
12
  ```
20
13
 
21
- ### Basic Usage
14
+ ### 2. Initial Context (Full Snapshots)
15
+ Take a full snapshot and feed it to a powerful Web LLM (Senior Architect like **Gemini** or **Grok**). *(Note: **ChatGPT** also works, but you MUST paste the specific prompt provided at the end of the snapshot output as your first prompt).*
22
16
  ```bash
23
- # Create a standard full snapshot
24
17
  eck-snapshot snapshot
25
-
26
- # Create a highly compressed skeleton snapshot
27
- eck-snapshot snapshot --skeleton
28
-
29
- # Create an incremental update (only changed/deleted files)
30
- eck-snapshot update
31
18
  ```
19
+ *(For massive monorepos, slice the context using profiles: `eck-snapshot snapshot --profile frontend`)*
32
20
 
33
- ## ๐Ÿค– AI Swarm Setup (GLM Z.AI)
21
+ ### 3. Direct Execution
22
+ Pass the Architect's technical plan to your local Coder agent (Claude Code / OpenCode). The Coder will implement the changes directly in your repository.
34
23
 
35
- eckSnapshot v6 acts as the bridge between your primary AI IDE (Claude Code or OpenCode) and a cost-effective GLM-4.7 worker swarm.
24
+ ### 4. Auto-Updates vs Manual Updates
25
+ When the Coder agent finishes a task, it automatically calls the built-in MCP tool (`eck_finish_task`), which commits the code and automatically generates an incremental delta update snapshot.
36
26
 
37
- 1. **Get an API Key:** Register at [Z.AI](https://z.ai) and set `export ZAI_API_KEY="your-key"`.
38
- 2. **Setup MCP Servers:**
39
- ```bash
40
- eck-snapshot setup-mcp --both
41
- ```
42
- 3. **Initialize Project Manifests:**
43
- ```bash
44
- # Generates smart instructions (CLAUDE.md / AGENTS.md)
45
- eck-snapshot snapshot --jas # For Claude Code (Sonnet 4.5)
46
- eck-snapshot snapshot --jaz # For OpenCode (GLM-4.7)
47
- ```
27
+ **Optional Manual Update:**
28
+ If you make manual changes yourself (without the agent), use this command to create a delta snapshot to sync your Web AI:
29
+ ```bash
30
+ eck-snapshot update
31
+ ```
32
+ This core loop is highly polished, actively maintained, and works exceptionally well.
48
33
 
49
- ## ๐Ÿ“ The `.eck/` Manifest Directory
34
+ ## ๐ŸŒŸ Core Features
50
35
 
51
- eckSnapshot automatically maintains a `.eck/` directory in your project to provide deep context to AI agents:
52
- - `CONTEXT.md` - High-level architecture (Auto-generated)
53
- - `ENVIRONMENT.md` - Runtime specifics (Auto-generated)
54
- - `ROADMAP.md` & `TECH_DEBT.md` - Strategic planning
55
- - `RUNTIME_STATE.md` - Live port/process status
36
+ * **๐Ÿ”„ Smart Delta Updates:** Tracks incremental changes via Git anchors with sequential numbering. Accurately tracks and reports deleted files to prevent LLM hallucinations.
37
+ * **๐Ÿ›ก๏ธ Security (SecretScanner):** Automatically redacts API keys and credentials before sending context to LLMs. Features both Regex matching and **Shannon Entropy** analysis.
38
+ * **๐Ÿ”Œ Native MCP Integration:** Instantly spins up Model Context Protocol (MCP) servers (`eck-core` for context sync) for Claude Code and OpenCode.
39
+ * **๐Ÿ“ The `.eck/` Manifest:** Automatically maintains project context files (`CONTEXT.md`, `ROADMAP.md`, `TECH_DEBT.md`) to onboard AI agents instantly.
56
40
 
57
- *Note: The tool automatically filters confidential files like `SERVER_ACCESS.md` from snapshots to ensure security.*
41
+ ---
58
42
 
59
- ## ๐Ÿ“ˆ Token Estimation
43
+ ## ๐Ÿงช Experimental / Advanced Features
60
44
 
61
- Train the local estimator to perfectly predict token counts for your specific project:
62
- ```bash
63
- # Manually push agent telemetry
64
- eck-snapshot telemetry push
45
+ *The following features are included in the tool, but I am not actively using them in my daily workflow right now. They are available for power users, but might have edge cases. If you use them and find issues, please open an issue on GitHub, or better yet, try fixing it yourself (you have the ultimate AI coding tool in your hands now!)*
65
46
 
66
- # Sync global token weights from the Telemetry Hub
67
- eck-snapshot telemetry sync-weights
68
- ```
47
+ * **๐Ÿง  Multi-Agent Protocol (Royal Court):** Built-in support for delegating tasks from a Senior Architect to Junior Managers (`--jas`, `--jao`, `--jaz`), who orchestrate a swarm of specialized GLM workers via MCP.
48
+ * **โ˜ ๏ธ Skeleton Mode:** Uses `Tree-sitter` and `Babel` to strip function bodies (`--skeleton`), drastically reducing token count.
49
+ * **๐Ÿ“Š Telemetry Hub:** Integrated with a Rust-based microservice for tracking agent execution metrics and auto-syncing token estimation weights.
69
50
 
70
51
  ## License
71
52
  MIT ยฉ xelth-com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xelth/eck-snapshot",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
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
5
  "main": "index.js",
6
6
  "type": "module",
package/src/cli/cli.js CHANGED
@@ -106,27 +106,21 @@ export function run() {
106
106
  const pkg = createRequire(import.meta.url)('../../package.json');
107
107
  const helpGuide = `eck-snapshot (v${pkg.version}) - AI-Native Repository Context Tool.
108
108
 
109
- --- ๐Ÿš€ Core Workflow: Optimized for Web LLMs (Gemini/ChatGPT) ---
109
+ --- ๐Ÿš€ Core Workflow: Optimized for Web LLMs (Claude/Gemini/Grok) ---
110
+ ๐Ÿ’ก Note: ChatGPT is supported but can be slow. Use the suggested prompt at the end of the snapshot.
110
111
 
111
- 1. Initial Context (Maximum Compression)
112
- Create a lightweight map of your entire project. Bodies of functions are hidden.
113
- This fits huge monoliths into the context window.
114
-
115
- $ eck-snapshot --skeleton
116
- -> Generates: .eck/snapshots/<name>_sk.md (Upload this to AI)
112
+ 1. Initial Context (Full Snapshot)
113
+ Create a complete map of your project to feed to the AI Architect.
114
+ $ eck-snapshot snapshot
117
115
 
118
- 2. Lazy Loading (On-Demand Details)
119
- If the AI needs to see the implementation of specific files, it will ask you.
120
- You can display multiple files at once to copy-paste back to the chat.
121
-
122
- $ eck-snapshot show src/auth.js src/utils/hash.js
116
+ (For very large projects, use profiles: $ eck-snapshot --profile backend)
117
+
118
+ 2. Working & Updating
119
+ Local coders (Claude Code / OpenCode) will automatically sync context using MCP tools when they finish a task.
120
+ If YOU make manual changes, send an incremental update to the Web AI:
123
121
 
124
- 3. Working & Updating
125
- As you apply changes, the AI loses context. Instead of re-sending the full repo,
126
- send only what changed since the last snapshot.
127
-
128
122
  $ eck-snapshot update
129
- -> Generates: .eck/snapshots/update_<timestamp>.md (Contains changed files + git diff)
123
+ -> Generates: .eck/snapshots/update_<timestamp>.md (Contains changed/deleted files)
130
124
 
131
125
  --- ๐Ÿ› ๏ธ Managing Context Profiles ---
132
126
 
@@ -136,7 +130,7 @@ Option A: Auto-Detection (Best for start)
136
130
 
137
131
  Option B: Manual Guide (Best for large repos)
138
132
  If the project is too big for auto-detection, this generates a prompt text file
139
- that you can paste into a powerful Web LLM (like Gemini 1.5 Pro) to design profiles manually.
133
+ that you can paste into a powerful Web LLM (like Gemini, Claude, or Grok) to design profiles manually.
140
134
 
141
135
  1. Run: $ eck-snapshot generate-profile-guide
142
136
  2. Open: .eck/profile_generation_guide.md
@@ -155,6 +149,9 @@ Option C: Using Profiles
155
149
  - ask-claude: Delegate tasks to Claude CLI agent.
156
150
  - setup-gemini: Configure gemini-cli integration.
157
151
  - setup-mcp: Setup/restore MCP servers (eck-core + glm-zai).
152
+
153
+ --- ๐Ÿงช Experimental Features ---
154
+ Run eck-snapshot snapshot --help to see experimental flags like --skeleton, --jas, --jaz.
158
155
  `;
159
156
 
160
157
  program
@@ -629,19 +629,19 @@ export async function createRepoSnapshot(repoPath, options) {
629
629
  ...options // Command-line options have the final say
630
630
  };
631
631
 
632
- // Detect architect modes
633
- const isJas = options.jas;
634
- const isJao = options.jao;
635
- const isJaz = options.jaz;
636
-
637
- // If NOT in Junior Architect mode, hide JA-specific documentation to prevent context pollution
638
- if (!options.withJa && !isJas && !isJao && !isJaz) {
639
- if (!config.filesToIgnore) config.filesToIgnore = [];
640
- config.filesToIgnore.push(
641
- 'COMMANDS_REFERENCE.md',
642
- 'codex_delegation_snapshot.md'
643
- );
644
- }
632
+ // Detect architect modes
633
+ const isJas = options.jas;
634
+ const isJao = options.jao;
635
+ const isJaz = options.jaz;
636
+
637
+ // If NOT in Junior Architect mode, hide JA-specific documentation to prevent context pollution
638
+ if (!options.withJa && !isJas && !isJao && !isJaz) {
639
+ if (!config.filesToIgnore) config.filesToIgnore = [];
640
+ config.filesToIgnore.push(
641
+ 'COMMANDS_REFERENCE.md',
642
+ 'codex_delegation_snapshot.md'
643
+ );
644
+ }
645
645
 
646
646
  // Apply defaults for options that may not be provided via command line
647
647
  if (!config.output) {
@@ -720,83 +720,83 @@ export async function createRepoSnapshot(repoPath, options) {
720
720
  // File body always includes full content
721
721
  let fileBody = (directoryTree ? `\n## Directory Structure\n\n\`\`\`\n${directoryTree}\`\`\`\n\n` : '') + contentArray.join('');
722
722
 
723
- // Helper to write snapshot file
724
- const writeSnapshot = async (suffix, isAgentMode) => {
725
- // CHANGE: Force agent to FALSE for the main snapshot header.
726
- // The snapshot is read by the Human/Senior Arch, not the Agent itself.
727
- // The Agent reads CLAUDE.md.
728
- const opts = { ...options, agent: false, jas: isJas, jao: isJao, jaz: isJaz };
729
- const header = await generateEnhancedAIHeader({ stats, repoName, mode: 'file', eckManifest, options: opts, repoPath: processedRepoPath }, isGitRepo);
730
-
731
- // Compact filename format: eck{ShortName}{timestamp}_{hash}_{suffix}.md
732
- // getShortRepoName ensures Capitalized Start/End (e.g. SnaOt)
733
- const shortHash = gitHash ? gitHash.substring(0, 7) : '';
734
- const shortRepoName = getShortRepoName(repoName);
735
-
736
- let fname = `eck${shortRepoName}${timestamp}`;
737
- if (shortHash) fname += `_${shortHash}`;
738
-
739
- // Add mode suffix
740
- if (options.skeleton) {
741
- fname += '_sk';
742
- } else if (suffix) {
743
- fname += suffix;
744
- }
745
-
746
- const fullContent = header + fileBody;
747
- const sizeKB = Math.max(1, Math.round(Buffer.byteLength(fullContent, 'utf-8') / 1024));
748
- fname += `_${sizeKB}kb.${fileExtension}`;
749
- const fpath = path.join(outputPath, fname);
750
- await fs.writeFile(fpath, fullContent);
751
- console.log(`๐Ÿ“„ Generated Snapshot: ${fname}`);
752
-
753
- // --- FEATURE: Active Snapshot (.eck/lastsnapshot/) ---
754
- // Only create .eck/lastsnapshot/ entries for the main snapshot
755
- if (!isAgentMode) {
756
- try {
757
- const snapDir = path.join(originalCwd, '.eck', 'lastsnapshot');
758
- await fs.mkdir(snapDir, { recursive: true });
759
-
760
- // 1. Clean up OLD snapshots in this specific folder
761
- // We keep AnswerToSA.md, but remove old snapshots and legacy answer.md
762
- const existingFiles = await fs.readdir(snapDir);
763
- for (const file of existingFiles) {
764
- if ((file.startsWith('eck') && file.endsWith('.md')) || file === 'answer.md') {
765
- await fs.unlink(path.join(snapDir, file));
766
- }
767
- }
768
-
769
- // 2. Save the NEW specific named file
770
- await fs.writeFile(path.join(snapDir, fname), fullContent);
771
-
772
- console.log(chalk.cyan(`๐Ÿ“‹ Active snapshot updated in .eck/lastsnapshot/: ${fname}`));
773
- } catch (e) {
774
- // Non-critical failure
775
- console.warn(chalk.yellow(`โš ๏ธ Could not update .eck/lastsnapshot/: ${e.message}`));
776
- }
777
- }
778
- // --------------------------------------------
779
-
780
- return fpath;
781
- };
782
-
783
- // Generate snapshot file for ALL modes
784
- if (isJas) {
785
- architectFilePath = await writeSnapshot('_jas', true);
786
- } else if (isJao) {
787
- architectFilePath = await writeSnapshot('_jao', true);
788
- } else if (isJaz) {
789
- architectFilePath = await writeSnapshot('_jaz', true);
790
- } else {
791
- // Standard snapshot behavior
792
- architectFilePath = await writeSnapshot('', false);
793
-
794
- // --- File 2: Junior Architect Snapshot (legacy --with-ja support) ---
795
- if (options.withJa && fileExtension === 'md') {
796
- console.log('๐Ÿ–‹๏ธ Generating Junior Architect (_ja) snapshot...');
797
- jaFilePath = await writeSnapshot('_ja', true);
798
- }
799
- }
723
+ // Helper to write snapshot file
724
+ const writeSnapshot = async (suffix, isAgentMode) => {
725
+ // CHANGE: Force agent to FALSE for the main snapshot header.
726
+ // The snapshot is read by the Human/Senior Arch, not the Agent itself.
727
+ // The Agent reads CLAUDE.md.
728
+ const opts = { ...options, agent: false, jas: isJas, jao: isJao, jaz: isJaz };
729
+ const header = await generateEnhancedAIHeader({ stats, repoName, mode: 'file', eckManifest, options: opts, repoPath: processedRepoPath }, isGitRepo);
730
+
731
+ // Compact filename format: eck{ShortName}{timestamp}_{hash}_{suffix}.md
732
+ // getShortRepoName ensures Capitalized Start/End (e.g. SnaOt)
733
+ const shortHash = gitHash ? gitHash.substring(0, 7) : '';
734
+ const shortRepoName = getShortRepoName(repoName);
735
+
736
+ let fname = `eck${shortRepoName}${timestamp}`;
737
+ if (shortHash) fname += `_${shortHash}`;
738
+
739
+ // Add mode suffix
740
+ if (options.skeleton) {
741
+ fname += '_sk';
742
+ } else if (suffix) {
743
+ fname += suffix;
744
+ }
745
+
746
+ const fullContent = header + fileBody;
747
+ const sizeKB = Math.max(1, Math.round(Buffer.byteLength(fullContent, 'utf-8') / 1024));
748
+ fname += `_${sizeKB}kb.${fileExtension}`;
749
+ const fpath = path.join(outputPath, fname);
750
+ await fs.writeFile(fpath, fullContent);
751
+ console.log(`๐Ÿ“„ Generated Snapshot: ${fname}`);
752
+
753
+ // --- FEATURE: Active Snapshot (.eck/lastsnapshot/) ---
754
+ // Only create .eck/lastsnapshot/ entries for the main snapshot
755
+ if (!isAgentMode) {
756
+ try {
757
+ const snapDir = path.join(originalCwd, '.eck', 'lastsnapshot');
758
+ await fs.mkdir(snapDir, { recursive: true });
759
+
760
+ // 1. Clean up OLD snapshots in this specific folder
761
+ // We keep AnswerToSA.md, but remove old snapshots and legacy answer.md
762
+ const existingFiles = await fs.readdir(snapDir);
763
+ for (const file of existingFiles) {
764
+ if ((file.startsWith('eck') && file.endsWith('.md')) || file === 'answer.md') {
765
+ await fs.unlink(path.join(snapDir, file));
766
+ }
767
+ }
768
+
769
+ // 2. Save the NEW specific named file
770
+ await fs.writeFile(path.join(snapDir, fname), fullContent);
771
+
772
+ console.log(chalk.cyan(`๐Ÿ“‹ Active snapshot updated in .eck/lastsnapshot/: ${fname}`));
773
+ } catch (e) {
774
+ // Non-critical failure
775
+ console.warn(chalk.yellow(`โš ๏ธ Could not update .eck/lastsnapshot/: ${e.message}`));
776
+ }
777
+ }
778
+ // --------------------------------------------
779
+
780
+ return fpath;
781
+ };
782
+
783
+ // Generate snapshot file for ALL modes
784
+ if (isJas) {
785
+ architectFilePath = await writeSnapshot('_jas', true);
786
+ } else if (isJao) {
787
+ architectFilePath = await writeSnapshot('_jao', true);
788
+ } else if (isJaz) {
789
+ architectFilePath = await writeSnapshot('_jaz', true);
790
+ } else {
791
+ // Standard snapshot behavior
792
+ architectFilePath = await writeSnapshot('', false);
793
+
794
+ // --- File 2: Junior Architect Snapshot (legacy --with-ja support) ---
795
+ if (options.withJa && fileExtension === 'md') {
796
+ console.log('๐Ÿ–‹๏ธ Generating Junior Architect (_ja) snapshot...');
797
+ jaFilePath = await writeSnapshot('_ja', true);
798
+ }
799
+ }
800
800
 
801
801
  // Save git anchor for future delta updates
802
802
  await saveGitAnchor(processedRepoPath);
@@ -816,20 +816,20 @@ export async function createRepoSnapshot(repoPath, options) {
816
816
  console.log('๐Ÿ” Scanning for confidential files...');
817
817
  const confidentialFiles = await scanEckForConfidentialFiles(processedRepoPath, config);
818
818
 
819
- let claudeMode = 'coder';
820
- if (isJas) claudeMode = 'jas';
821
- if (isJao) claudeMode = 'jao';
822
- if (isJaz) claudeMode = 'jaz';
823
-
824
- // Claude Code exclusively uses CLAUDE.md
825
- if (isJas || isJao || (!isJaz && !options.withJa)) {
826
- await updateClaudeMd(processedRepoPath, claudeMode, directoryTree, confidentialFiles, { zh: options.zh });
827
- }
828
-
829
- // OpenCode exclusively uses AGENTS.md
830
- if (isJaz || (!isJas && !isJao && !options.withJa)) {
831
- await generateOpenCodeAgents(processedRepoPath, claudeMode, directoryTree, confidentialFiles, { zh: options.zh });
832
- }
819
+ let claudeMode = 'coder';
820
+ if (isJas) claudeMode = 'jas';
821
+ if (isJao) claudeMode = 'jao';
822
+ if (isJaz) claudeMode = 'jaz';
823
+
824
+ // Claude Code exclusively uses CLAUDE.md
825
+ if (isJas || isJao || (!isJaz && !options.withJa)) {
826
+ await updateClaudeMd(processedRepoPath, claudeMode, directoryTree, confidentialFiles, { zh: options.zh });
827
+ }
828
+
829
+ // OpenCode exclusively uses AGENTS.md
830
+ if (isJaz || (!isJas && !isJao && !options.withJa)) {
831
+ await generateOpenCodeAgents(processedRepoPath, claudeMode, directoryTree, confidentialFiles, { zh: options.zh });
832
+ }
833
833
 
834
834
  // --- Combined Report ---
835
835
  console.log('\nโœ… Snapshot generation complete!');
@@ -924,6 +924,14 @@ export async function createRepoSnapshot(repoPath, options) {
924
924
  console.log(' Replace [ACTUAL_TOKENS_HERE] with the real token count from your LLM');
925
925
  }
926
926
 
927
+ // Output AI Prompt Suggestion for stubborn LLMs
928
+ console.log('\n๐Ÿค– AI PROMPT SUGGESTION (Crucial for ChatGPT, helpful for others):');
929
+ console.log('---------------------------------------------------');
930
+ console.log(chalk.yellow('๐Ÿ’ก Tip: Claude, Gemini, and Grok handle large files best. ChatGPT works but can be slow.'));
931
+ console.log('If your AI ignores the file instructions and acts as an external reviewer,');
932
+ console.log('copy and paste this exact prompt along with your snapshot file:\n');
933
+ console.log(chalk.cyan.bold('Read the SYSTEM DIRECTIVE at the very beginning of the attached file. Immediately assume the role of Senior Architect as instructed, then await my first task.\n'));
934
+
927
935
  } finally {
928
936
  process.chdir(originalCwd); // Final reset back to original CWD
929
937
  }
@@ -133,7 +133,7 @@ export async function generateProfileGuide(repoPath = process.cwd(), options = {
133
133
  // 3. Print clear instructions
134
134
  console.log(chalk.cyan('\n๐Ÿ“‹ Next Steps (Workflow):'));
135
135
  console.log(`1. Open: ${chalk.bold('.eck/profile_generation_guide.md')}`);
136
- console.log('2. Copy the PROMPT + TREE content and paste it into an AI (Gemini 1.5 Pro, Claude Opus, ChatGPT).');
136
+ console.log('2. Copy the PROMPT + TREE content and paste it into an AI (Gemini, Claude, Grok).');
137
137
  console.log('3. Copy the JSON response from the AI.');
138
138
  console.log(`4. Paste the JSON into: ${chalk.bold('.eck/profiles.json')} ${profilesCreated ? '(I created this file for you)' : '(File exists)'}`);
139
139
  console.log('\nโœ… Once saved, run: ' + chalk.green('eck-snapshot --profile <profile_name>'));
@@ -1,8 +1,14 @@
1
- # AI Instructions
1
+ # SYSTEM DIRECTIVE FOR THE ACTIVE AI AGENT
2
2
 
3
- ## 1. How to Read This Snapshot
3
+ **CRITICAL:** If you are the AI (LLM) reading this file in the current chat session, you must IMMEDIATELY assume the role defined below. Do not act as an external reviewer or generic assistant. This document is your active operating environment and contract.
4
4
 
5
- This document is a self-contained, single-file snapshot of the **{{repoName}}** software repository, generated by the `eck-snapshot` tool on **{{timestamp}}**. It is designed to provide a Large Language Model (LLM) with the complete context of a project.
5
+ ## 1. Your Role & Identity
6
+
7
+ You are the **Senior Project Manager and Solution Architect AI**. Your primary goal is to translate user requests into technical plans and then generate precise commands for code-execution AI agents.
8
+
9
+ ## 2. How to Read This Snapshot
10
+
11
+ This document is a self-contained, single-file snapshot of the **{{repoName}}** software repository, generated by the `eck-snapshot` tool on **{{timestamp}}**. Treat the file structure and code below as your absolute source of truth for the project state.
6
12
 
7
13
  * **Source of Truth:** Treat this snapshot as the complete and authoritative source code.
8
14
  * **Structure:** The file contains a **Directory Structure** tree, followed by the full content of each file, demarcated by `--- File: /path/to/file ---` headers.
@@ -13,15 +19,13 @@ This document is a self-contained, single-file snapshot of the **{{repoName}}**
13
19
 
14
20
  ---
15
21
 
16
- ## 2. Your Core Operational Workflow
17
-
18
- You are the Project Manager and Solution Architect AI. Your primary goal is to translate user requests into technical plans and then generate precise commands for code-execution AI agents.
22
+ ## 3. Your Core Operational Workflow
19
23
 
20
24
  {{projectOverview}}
21
25
 
22
26
  {{eckManifestSection}}
23
27
 
24
- ### ๐Ÿ›  MANIFEST MAINTENANCE PROTOCOL (CRITICAL)
28
+ ### MANIFEST MAINTENANCE PROTOCOL (CRITICAL)
25
29
 
26
30
  The `.eck/` directory files are your "Source of Knowledge".
27
31
  1. **Stub Detection:** If a file starts with `# [STUB: ...]`, it means the system failed to auto-generate meaningful content.
@@ -100,7 +104,7 @@ The Coder agent is intelligent and will understand what information they need ba
100
104
  6. **Review & Report:** After the command is executed, analyze the results and report back to the user in their language.
101
105
  7. **Iterate:** Continue the cycle based on user feedback.
102
106
 
103
- ### ๐Ÿ›ก๏ธ ANTI-TRUNCATION PROTOCOL (CRITICAL)
107
+ ### ANTI-TRUNCATION PROTOCOL (CRITICAL)
104
108
 
105
109
  Web interfaces (like Gemini or ChatGPT) sometimes silently drop the content of large text files during upload, replacing the file's content with a tiny JSON metadata string (e.g., `{"fileName": "...", "contentFetchId": "..."}`).
106
110
 
@@ -108,7 +112,7 @@ Web interfaces (like Gemini or ChatGPT) sometimes silently drop the content of l
108
112
  1. **Always check the filename:** The exact file size in kilobytes is appended to the end of every snapshot filename (e.g., `..._up7_1250kb.md`).
109
113
  2. **Verify payload length:** If the filename says `1250kb` but the text you actually received for that file is only a few lines long or looks like a system JSON string, **THE CONTENT WAS TRUNCATED BY THE UI**.
110
114
  3. **Alert the User:** DO NOT hallucinate the missing code. Immediately stop and tell the user:
111
- > "๐Ÿšจ **System Error:** The web interface truncated the file `[FileName]`. I only received the metadata/JSON stub, not the actual `[Size]kb` of code. Please split the snapshot or paste the text directly."
115
+ > "**System Error:** The web interface truncated the file `[FileName]`. I only received the metadata/JSON stub, not the actual `[Size]kb` of code. Please split the snapshot or paste the text directly."
112
116
 
113
117
  {{hierarchicalWorkflow}}
114
118
 
@@ -125,4 +129,3 @@ Web interfaces (like Gemini or ChatGPT) sometimes silently drop the content of l
125
129
  You can command multiple specialized agents. **YOU must choose the most appropriate agent** based on the task requirements and target environment:
126
130
 
127
131
  {{agentDefinitions}}
128
-
@@ -72,11 +72,11 @@ function getVisibleAgents(executionAgents, options) {
72
72
  // These keys must match IDs in setup.json
73
73
  const standardCoders = ['local_dev', 'production_server', 'android_wsl_dev'];
74
74
 
75
- // 2. Determine Priority Agent (The Junior Architect)
76
- let priorityAgentKey = null;
77
- if (options.jas) priorityAgentKey = 'jas';
78
- if (options.jao) priorityAgentKey = 'jao';
79
- if (options.jaz) priorityAgentKey = 'jaz';
75
+ // 2. Determine Priority Agent (The Junior Architect)
76
+ let priorityAgentKey = null;
77
+ if (options.jas) priorityAgentKey = 'jas';
78
+ if (options.jao) priorityAgentKey = 'jao';
79
+ if (options.jaz) priorityAgentKey = 'jaz';
80
80
 
81
81
  // 3. Build the list
82
82
  // If a JA is selected, add them FIRST with a note
@@ -438,10 +438,10 @@ ${operationsSection}
438
438
  // The `agent` prompt template is used ONLY in CLAUDE.md (via claudeMdGenerator.js)
439
439
  // NOT in the snapshot itself.
440
440
 
441
- const isJas = context.options && context.options.jas;
442
- const isJao = context.options && context.options.jao;
443
- const isJaz = context.options && context.options.jaz;
444
- const isJaMode = isJas || isJao || isJaz;
441
+ const isJas = context.options && context.options.jas;
442
+ const isJao = context.options && context.options.jao;
443
+ const isJaz = context.options && context.options.jaz;
444
+ const isJaMode = isJas || isJao || isJaz;
445
445
 
446
446
  // --- Determine Workflow Content based on JA Flag ---
447
447
  let hierarchicalWorkflow = '';
@@ -449,15 +449,15 @@ ${operationsSection}
449
449
 
450
450
  if (isJaMode) {
451
451
  // Instructions strictly for the Senior Architect on how to use the JA
452
- hierarchicalWorkflow = `### ๐Ÿ‘‘ ROYAL COURT ARCHITECTURE (Active)
453
-
454
- You are the **Senior Architect**. You have a **Junior Architect** available to handle implementation.
455
-
456
- **PROTOCOL:**
457
- 1. **Prefer Delegation:** Unless the task is trivial (1-2 file edits), assign it to the **Junior Architect** (ID: \`jas\`, \`jao\`, or \`jaz\` - see agents list above).
458
- 2. **Direct Execution:** Only use \`local_dev\` or \`production_server\` directly if the Junior Architect fails or for simple "hotfixes".
459
- 3. **No Micro-Management:** Do not tell the Junior Architect *how* to use GLM Z.AI or internal tools. Just give them the strategic objective.
460
- `;
452
+ hierarchicalWorkflow = `### ๐Ÿ‘‘ ROYAL COURT ARCHITECTURE (Active)
453
+
454
+ You are the **Senior Architect**. You have a **Junior Architect** available to handle implementation.
455
+
456
+ **PROTOCOL:**
457
+ 1. **Prefer Delegation:** Unless the task is trivial (1-2 file edits), assign it to the **Junior Architect** (ID: \`jas\`, \`jao\`, or \`jaz\` - see agents list above).
458
+ 2. **Direct Execution:** Only use \`local_dev\` or \`production_server\` directly if the Junior Architect fails or for simple "hotfixes".
459
+ 3. **No Micro-Management:** Do not tell the Junior Architect *how* to use GLM Z.AI or internal tools. Just give them the strategic objective.
460
+ `;
461
461
 
462
462
  commandFormats = `### COMMAND FORMATS (Eck-Protocol v2)
463
463
 
@@ -516,11 +516,11 @@ Use \`apply_code_changes\` for simple, direct tasks where you provide all detail
516
516
  "agent_environment": "Development environment with full GUI support and development tools",
517
517
  "command_for_agent": "apply_code_changes",
518
518
  "task_id": "unique-task-id",
519
- "payload": {
520
- "objective": "Brief, clear task description",
521
- "context": "Why this change is needed - include relevant .eck manifest context",
522
- "architect_confidence": "high (90%) - I am certain of this plan / low (30%) - Please investigate first",
523
- "files_to_modify": [
519
+ "payload": {
520
+ "objective": "Brief, clear task description",
521
+ "context": "Why this change is needed - include relevant .eck manifest context",
522
+ "architect_confidence": "high (90%) - I am certain of this plan / low (30%) - Please investigate first",
523
+ "files_to_modify": [
524
524
  {
525
525
  "path": "exact/file/path.js",
526
526
  "action": "specific action (add, modify, replace, delete)",
@@ -687,7 +687,10 @@ const x = 1;
687
687
 
688
688
  } catch (error) {
689
689
  console.warn('Warning: Could not load setup.json, using minimal header', error.message);
690
- return `# Snapshot for ${context.repoName || 'Project'}
690
+ return `# SYSTEM DIRECTIVE FOR THE ACTIVE AI AGENT
691
+ **CRITICAL:** If you are the AI reading this, immediately assume the role of Solution Architect for this project. Do not act as an external reviewer.
692
+
693
+ # Snapshot for ${context.repoName || 'Project'}
691
694
 
692
695
  Generated: ${new Date().toISOString()}
693
696