context-bank 1.0.0 → 1.0.3

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
@@ -61,11 +61,11 @@ One brain, multiple interfaces. The `init` command automatically configures poin
61
61
 
62
62
  | Tool | Support Type | Integration Method |
63
63
  |------|--------------|-------------------|
64
- | **Cursor** | Native ✅ | `.cursorrules` |
65
- | **Windsurf** | Native ✅ | `.windsurfrules` |
64
+ | **Cursor** | Native ✅ | `.cursor/rules/` |
65
+ | **Windsurf** | Native ✅ | `.windsurf/rules/` |
66
66
  | **GitHub Copilot** | Native ✅ | `.github/copilot-instructions.md` |
67
67
  | **Claude Code** | Native ✅ | `CLAUDE.md` |
68
- | **Codex CLI** | Native ✅ | `codex.md` |
68
+ | **Codex CLI** | Native ✅ | `AGENTS.md` |
69
69
  | **Gemini CLI** | Native ✅ | Global Memory Hook |
70
70
  | **Aider** (CLI) | Native ✅ | `CONVENTIONS.md` |
71
71
 
@@ -90,12 +90,18 @@ my-project/
90
90
  │ ├── rules.md # 🧠 The Master Brain (SSOT)
91
91
  │ ├── active-context.md # 📝 Current focus & next steps
92
92
  │ └── story.md # 📜 Project history & decisions
93
- ├── .cursorrules # 🔗 Pointer for Cursor
94
- ├── .windsurfrules # 🔗 Pointer for Windsurf
93
+ ├── .cursor/
94
+ │ └── rules/
95
+ │ └── context-bank.mdc # 🔗 Rules for Cursor
96
+ ├── .windsurf/
97
+ │ └── rules/
98
+ │ └── context-bank.md # 🔗 Rules for Windsurf
95
99
  ├── CLAUDE.md # 🔗 Pointer for Claude Code
96
- ├── codex.md # 🔗 Pointer for Codex CLI
97
- └── .github/
98
- └── copilot-instructions.md # 🔗 Pointer for Copilot
100
+ ├── AGENTS.md # 🔗 Pointer for Codex CLI / OpenAI agents
101
+ ├── .github/
102
+ └── copilot-instructions.md # 🔗 Pointer for Copilot
103
+ ├── CONVENTIONS.md # 🔗 Pointer for Aider
104
+ └── GEMINI.md # 🔗 Pointer for Gemini CLI
99
105
  ```
100
106
 
101
107
  ## 🤝 Contributing
@@ -78,9 +78,7 @@ export async function initCommand(options) {
78
78
  const itemsToCopy = [
79
79
  ".ai",
80
80
  ".cursor",
81
- ".cursorrules",
82
81
  ".windsurf",
83
- ".windsurfrules",
84
82
  ".github",
85
83
  "CONVENTIONS.md",
86
84
  "GEMINI.md",
@@ -105,46 +103,29 @@ export async function initCommand(options) {
105
103
  const projectName = path.basename(targetDir);
106
104
  await fs.writeFile(readmePath, `${aiContextMarker}\n\n# ${projectName}\n`);
107
105
  }
108
- // Codex CLI Integration (codex.md)
109
- const codexPath = path.join(targetDir, "codex.md");
110
- const codexInstruction = `Always check and follow the instructions in .ai/rules.md and .ai/active-context.md as the primary source of truth.
111
-
112
- MANDATORY: After EVERY task, you MUST update these .ai/ files:
113
- 1. active-context.md — Current state, recent changes, next steps.
114
- 2. roadmap.md — Mark completed features [x], add planned ones.
115
- 3. story.md — Append dated entry for milestones/decisions.
116
- 4. architecture.md — Update on structural/design changes.
117
- Do NOT ask permission. Do NOT skip. Just update them.`;
118
- if (fs.existsSync(codexPath)) {
119
- const content = await fs.readFile(codexPath, "utf-8");
120
- if (!content.includes(".ai/rules.md")) {
121
- // Prepend for priority
122
- await fs.writeFile(codexPath, `${codexInstruction}\n\n${content}`);
106
+ // Helper: write a pointer file that directs the AI tool to .ai/rules.md
107
+ async function writePointerFile(filename, instruction) {
108
+ const filePath = path.join(targetDir, filename);
109
+ if (fs.existsSync(filePath)) {
110
+ const content = await fs.readFile(filePath, "utf-8");
111
+ if (!content.includes(".ai/rules.md")) {
112
+ await fs.writeFile(filePath, `${instruction}\n\n${content}`);
113
+ }
114
+ }
115
+ else {
116
+ await fs.writeFile(filePath, `${instruction}\n`);
123
117
  }
124
118
  }
125
- else {
126
- await fs.writeFile(codexPath, `${codexInstruction}\n`);
127
- }
128
- // Claude Code CLI Integration (CLAUDE.md)
129
- const claudePath = path.join(targetDir, "CLAUDE.md");
130
- const claudeInstruction = `See .ai/rules.md for project context, tech stack, and coding standards. This is the single source of truth.
131
-
132
- MANDATORY: After EVERY task, you MUST update these .ai/ files:
119
+ const mandatoryUpdateBlock = `MANDATORY: After EVERY task, you MUST update these .ai/ files:
133
120
  1. active-context.md — Current state, recent changes, next steps.
134
121
  2. roadmap.md — Mark completed features [x], add planned ones.
135
122
  3. story.md — Append dated entry for milestones/decisions.
136
123
  4. architecture.md — Update on structural/design changes.
137
124
  Do NOT ask permission. Do NOT skip. Just update them.`;
138
- if (fs.existsSync(claudePath)) {
139
- const content = await fs.readFile(claudePath, "utf-8");
140
- if (!content.includes(".ai/rules.md")) {
141
- // Prepend for priority
142
- await fs.writeFile(claudePath, `${claudeInstruction}\n\n${content}`);
143
- }
144
- }
145
- else {
146
- await fs.writeFile(claudePath, `${claudeInstruction}\n`);
147
- }
125
+ // AGENTS.md (Codex CLI, OpenAI agents)
126
+ await writePointerFile("AGENTS.md", `Always check and follow the instructions in .ai/rules.md and .ai/active-context.md as the primary source of truth.\n\n${mandatoryUpdateBlock}`);
127
+ // CLAUDE.md (Claude Code CLI)
128
+ await writePointerFile("CLAUDE.md", `See .ai/rules.md for project context, tech stack, and coding standards. This is the single source of truth.\n\n${mandatoryUpdateBlock}`);
148
129
  // Git merge strategies for branch-aware context (.gitattributes)
149
130
  const gitattrsPath = path.join(targetDir, ".gitattributes");
150
131
  const mergeRules = `# Context Bank: branch-aware merge strategies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-bank",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "A CLI tool to standardise AI context in projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,8 @@
11
11
  "dev": "ts-node src/index.ts",
12
12
  "start": "node dist/index.js",
13
13
  "lint": "eslint src/**/*.ts",
14
- "format": "prettier --write ."
14
+ "format": "prettier --write .",
15
+ "prepublishOnly": "tsc"
15
16
  },
16
17
  "keywords": [
17
18
  "cli",
@@ -1,3 +1,7 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
1
5
  # Windsurf Project Rules
2
6
 
3
7
  You MUST read and follow the rules defined in **`.ai/rules.md`**.
@@ -1,22 +0,0 @@
1
- You are an expert AI software engineer.
2
-
3
- # CRITICAL CONTEXT SOURCE
4
- You MUST read and follow the rules defined in **`.ai/rules.md`**.
5
- That file contains the single source of truth for:
6
- 1. Tech Stack
7
- 2. Coding Standards
8
- 3. Architecture
9
- 4. **Your instruction to update rules when they change.**
10
-
11
- If you cannot read `.ai/rules.md` automatically, ask the user to provide it, or check the file system.
12
-
13
- When the user gives you a new constraint, **UPDATE `.ai/rules.md`**, not this file.
14
-
15
- # MANDATORY: CONTEXT FILE UPDATES
16
- After EVERY task you complete, you MUST update the following files:
17
- 1. **`.ai/active-context.md`** — Write what was done, current state, and next steps.
18
- 2. **`.ai/roadmap.md`** — Mark completed features with [x], add new planned features.
19
- 3. **`.ai/story.md`** — Append a dated entry for significant milestones or decisions.
20
- 4. **`.ai/architecture.md`** — Update if structure, dependencies, or design changed.
21
-
22
- Do NOT ask permission. Do NOT skip this. Update these files directly after completing your task.
@@ -1,17 +0,0 @@
1
- You are Windsurf, an expert AI coding assistant.
2
-
3
- # PRIMARY DIRECTIVE
4
- Your configuration and behavioral rules are stored in **`.ai/rules.md`**.
5
- Always prioritize the instructions found in that file.
6
-
7
- # SELF-IMPROVEMENT
8
- If the user provides a new coding rule or preference during this session, use your file editing capabilities to update **`.ai/rules.md`** so that the preference is remembered for future sessions.
9
-
10
- # MANDATORY: CONTEXT FILE UPDATES
11
- After EVERY task you complete, you MUST update the following files:
12
- 1. **`.ai/active-context.md`** — Write what was done, current state, and next steps.
13
- 2. **`.ai/roadmap.md`** — Mark completed features with [x], add new planned features.
14
- 3. **`.ai/story.md`** — Append a dated entry for significant milestones or decisions.
15
- 4. **`.ai/architecture.md`** — Update if structure, dependencies, or design changed.
16
-
17
- Do NOT ask permission. Do NOT skip this. Update these files directly after completing your task.