context-bank 0.0.2 β 0.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 +1 -0
- package/dist/commands/init.js +34 -0
- package/package.json +1 -1
- package/templates/.ai/architecture.md +24 -0
- package/templates/.ai/roadmap.md +18 -0
- package/templates/.ai/rules.md +5 -1
package/README.md
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -77,6 +77,40 @@ export async function initCommand(options) {
|
|
|
77
77
|
storyContent = storyContent.replace("[Auto-filled by init]", new Date().toISOString().split("T")[0]);
|
|
78
78
|
await fs.writeFile(storyPath, storyContent);
|
|
79
79
|
}
|
|
80
|
+
// Special handling for README.md
|
|
81
|
+
const readmePath = path.join(targetDir, "README.md");
|
|
82
|
+
const aiContextMarker = "<!-- AI-CONTEXT: .ai/rules.md -->";
|
|
83
|
+
if (fs.existsSync(readmePath)) {
|
|
84
|
+
const readmeContent = await fs.readFile(readmePath, "utf-8");
|
|
85
|
+
if (!readmeContent.includes(aiContextMarker)) {
|
|
86
|
+
await fs.writeFile(readmePath, `${aiContextMarker}\n${readmeContent}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const projectName = path.basename(targetDir);
|
|
91
|
+
await fs.writeFile(readmePath, `${aiContextMarker}\n\n# ${projectName}\n`);
|
|
92
|
+
}
|
|
93
|
+
// Gemini CLI Integration
|
|
94
|
+
const geminiDir = path.join(targetDir, ".gemini");
|
|
95
|
+
const geminiMemoryPath = path.join(geminiDir, "GEMINI.md");
|
|
96
|
+
const geminiRule = "- [Context Bank] Always check and follow the instructions in .ai/rules.md and .ai/active-context.md.";
|
|
97
|
+
if (!fs.existsSync(geminiDir)) {
|
|
98
|
+
await fs.ensureDir(geminiDir);
|
|
99
|
+
}
|
|
100
|
+
if (fs.existsSync(geminiMemoryPath)) {
|
|
101
|
+
const memoryContent = await fs.readFile(geminiMemoryPath, "utf-8");
|
|
102
|
+
if (!memoryContent.includes("[Context Bank]")) {
|
|
103
|
+
// Append to existing memory
|
|
104
|
+
const newContent = memoryContent.endsWith("\n")
|
|
105
|
+
? `${memoryContent}${geminiRule}\n`
|
|
106
|
+
: `${memoryContent}\n${geminiRule}\n`;
|
|
107
|
+
await fs.writeFile(geminiMemoryPath, newContent);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// Create new memory file
|
|
112
|
+
await fs.writeFile(geminiMemoryPath, `${geminiRule}\n`);
|
|
113
|
+
}
|
|
80
114
|
s.stop(chalk.green("Context initialized!"));
|
|
81
115
|
outro(chalk.green(`
|
|
82
116
|
Context Bank setup complete! π
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ποΈ Project Architecture
|
|
2
|
+
|
|
3
|
+
> **AI INSTRUCTION:**
|
|
4
|
+
> Update this file when:
|
|
5
|
+
> 1. New architectural decisions are made.
|
|
6
|
+
> 2. The system design evolves.
|
|
7
|
+
> 3. New integrations or dependencies are added.
|
|
8
|
+
|
|
9
|
+
## π High-Level Design
|
|
10
|
+
[Describe the high-level architecture here]
|
|
11
|
+
|
|
12
|
+
## π Directory Structure
|
|
13
|
+
```
|
|
14
|
+
src/
|
|
15
|
+
βββ features/
|
|
16
|
+
βββ shared/
|
|
17
|
+
βββ ...
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## π Data Flow
|
|
21
|
+
[Describe how data moves through the application]
|
|
22
|
+
|
|
23
|
+
## π οΈ Key Decisions
|
|
24
|
+
- [Decision 1]: [Reasoning]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# πΊοΈ Project Roadmap
|
|
2
|
+
|
|
3
|
+
> **AI INSTRUCTION:**
|
|
4
|
+
> Update this file when:
|
|
5
|
+
> 1. A new feature is planned.
|
|
6
|
+
> 2. A feature is completed (mark with [x]).
|
|
7
|
+
> 3. Priorities change.
|
|
8
|
+
|
|
9
|
+
## π Upcoming
|
|
10
|
+
- [ ] [Feature 1]
|
|
11
|
+
- [ ] [Feature 2]
|
|
12
|
+
|
|
13
|
+
## π¦ Backlog
|
|
14
|
+
- [ ] [Idea 1]
|
|
15
|
+
- [ ] [Idea 2]
|
|
16
|
+
|
|
17
|
+
## β
Completed
|
|
18
|
+
- [x] Project Initialization
|
package/templates/.ai/rules.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# AI CONTEXT: ALWAYS READ THIS FILE FIRST
|
|
2
|
+
|
|
1
3
|
# π§ Project Context & Rules (Master File)
|
|
2
4
|
|
|
3
5
|
> **AI AGENT INSTRUCTION (CRITICAL):**
|
|
@@ -8,7 +10,9 @@
|
|
|
8
10
|
>
|
|
9
11
|
> 1. **Capture Preferences:** If the user specifies a preference, update **`rules.md`**.
|
|
10
12
|
> 2. **Track Progress:** At the end of a task, update **`active-context.md`** with the current status and next steps.
|
|
11
|
-
> 3. **
|
|
13
|
+
> 3. **Update Roadmap:** When a feature is completed or planned, update **`roadmap.md`**.
|
|
14
|
+
> 4. **Document Architecture:** When structure/design changes, update **`architecture.md`**.
|
|
15
|
+
> 5. **Log History:** When a major milestone is reached, append it to **`story.md`**.
|
|
12
16
|
>
|
|
13
17
|
> **TOKEN SAVING STRATEGY:**
|
|
14
18
|
> Do not rely on chat history for long-term memory. Rely on these files.
|