context-bank 0.0.5 → 0.0.7

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
@@ -11,7 +11,7 @@
11
11
  <br/>
12
12
  Standardize, persist, and evolve your project's AI context with a single command.
13
13
  <br/>
14
- Works with **Cursor**, **Windsurf**, and **GitHub Copilot**.
14
+ Works with **Cursor**, **Windsurf**, **GitHub Copilot**, **Gemini CLI**, **Claude Code**, and **Codex CLI**.
15
15
 
16
16
  </div>
17
17
 
@@ -59,16 +59,24 @@ Stop feeding the AI your entire chat history. Context Bank uses "State Managemen
59
59
  ### 🔌 3. Universal Tool Support
60
60
  One brain, multiple interfaces. The `init` command automatically configures pointers for:
61
61
 
62
- | Tool | Support Type | File Created |
63
- |------|--------------|--------------|
62
+ | Tool | Support Type | Integration Method |
63
+ |------|--------------|-------------------|
64
64
  | **Cursor** | Native ✅ | `.cursorrules` |
65
65
  | **Windsurf** | Native ✅ | `.windsurfrules` |
66
66
  | **GitHub Copilot** | Native ✅ | `.github/copilot-instructions.md` |
67
+ | **Claude Code** | Native ✅ | `CLAUDE.md` |
68
+ | **Codex CLI** | Native ✅ | `codex.md` |
69
+ | **Gemini CLI** | Native ✅ | Global Memory Hook |
67
70
  | **Aider** (CLI) | Native ✅ | `CONVENTIONS.md` |
68
- | **Other CLIs** | Manual 🛠️ | (See below) |
69
71
 
70
- #### 🖥️ Using with Gemini CLI, Claude Code, or ChatGPT
71
- If your tool doesn't automatically read configuration files, just start your session with this **Magic Prompt**:
72
+ #### 🤖 Smart CLI Integration
73
+ For tools like **Gemini CLI** that rely on global memory instead of project files, Context Bank performs a smart handshake:
74
+ 1. It detects your global configuration.
75
+ 2. It asks permission to add a **Generic Context Rule**.
76
+ 3. Once enabled, the CLI will **automatically check for `.ai/rules.md`** in ANY folder you work in. No manual linking required!
77
+
78
+ #### 🛠️ For Unsupported Tools
79
+ If your tool isn't listed above, just start your session with this **Magic Prompt**:
72
80
 
73
81
  > "I am starting a session. Please read **`.ai/rules.md`** for project standards and **`.ai/active-context.md`** for the current state. Update these files if plans change."
74
82
 
@@ -84,6 +92,8 @@ my-project/
84
92
  │ └── story.md # 📜 Project history & decisions
85
93
  ├── .cursorrules # 🔗 Pointer for Cursor
86
94
  ├── .windsurfrules # 🔗 Pointer for Windsurf
95
+ ├── CLAUDE.md # 🔗 Pointer for Claude Code
96
+ ├── codex.md # 🔗 Pointer for Codex CLI
87
97
  └── .github/
88
98
  └── copilot-instructions.md # 🔗 Pointer for Copilot
89
99
  ```
@@ -80,6 +80,32 @@ export async function initCommand(options) {
80
80
  const projectName = path.basename(targetDir);
81
81
  await fs.writeFile(readmePath, `${aiContextMarker}\n\n# ${projectName}\n`);
82
82
  }
83
+ // Codex CLI Integration (codex.md)
84
+ const codexPath = path.join(targetDir, "codex.md");
85
+ const codexInstruction = "Always check and follow the instructions in .ai/rules.md and .ai/active-context.md as the primary source of truth.";
86
+ if (fs.existsSync(codexPath)) {
87
+ const content = await fs.readFile(codexPath, "utf-8");
88
+ if (!content.includes(".ai/rules.md")) {
89
+ // Prepend for priority
90
+ await fs.writeFile(codexPath, `${codexInstruction}\n\n${content}`);
91
+ }
92
+ }
93
+ else {
94
+ await fs.writeFile(codexPath, `${codexInstruction}\n`);
95
+ }
96
+ // Claude Code CLI Integration (CLAUDE.md)
97
+ const claudePath = path.join(targetDir, "CLAUDE.md");
98
+ const claudeInstruction = "See .ai/rules.md for project context, tech stack, and coding standards. This is the single source of truth.";
99
+ if (fs.existsSync(claudePath)) {
100
+ const content = await fs.readFile(claudePath, "utf-8");
101
+ if (!content.includes(".ai/rules.md")) {
102
+ // Prepend for priority
103
+ await fs.writeFile(claudePath, `${claudeInstruction}\n\n${content}`);
104
+ }
105
+ }
106
+ else {
107
+ await fs.writeFile(claudePath, `${claudeInstruction}\n`);
108
+ }
83
109
  s.stop(chalk.green("Context initialized!"));
84
110
  // Gemini CLI Global Memory Integration
85
111
  const globalGeminiDir = path.join(os.homedir(), ".gemini");
@@ -93,7 +119,13 @@ export async function initCommand(options) {
93
119
  initialValue: true
94
120
  });
95
121
  if (addGlobalContext === true) {
96
- const genericContextRule = "- [Context Bank] Always check the current working directory for '.ai/rules.md' and '.ai/active-context.md'. If they exist, follow their instructions as the primary source of truth.";
122
+ const genericContextRule = `
123
+ - [Context Bank] CRITICAL INSTRUCTION:
124
+ Before processing ANY user request in a new session, you MUST perform this initialization sequence:
125
+ 1. Check if the ".ai/" directory exists in the current working directory.
126
+ 2. If it exists, you MUST explicitly call the "read_file" tool to read ".ai/rules.md" and ".ai/active-context.md".
127
+ 3. Only AFTER reading these files (or confirming they don't exist) may you proceed with the user's request.
128
+ This is not optional. Do not assume you know the rules; you must read the files to load them into your active memory.`;
97
129
  const newContent = memoryContent.endsWith("\n")
98
130
  ? `${memoryContent}${genericContextRule}\n`
99
131
  : `${memoryContent}\n${genericContextRule}\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-bank",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "A CLI tool to standardise AI context in projects.",
5
5
  "type": "module",
6
6
  "bin": {