mxcli-olc-setup 1.0.0 → 1.0.1

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,6 +1,6 @@
1
1
  # mxcli-olc-setup
2
2
 
3
- Automates [mxcli](https://github.com/mendixlabs/mxcli) setup for Mendix projects. Downloads the correct mxcli binary for your platform, initializes it, adds AI-agent skills, and configures your project's `.gitignore`.
3
+ Automates [mxcli](https://github.com/mendixlabs/mxcli) setup for Mendix projects. Downloads the correct mxcli binary for your platform, initializes it with all supported AI tools, adds AI-agent skills, and sets up a shared knowledge base that AI agents maintain across sessions.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -18,11 +18,34 @@ npx mxcli-olc-setup /path/to/mendix-project
18
18
 
19
19
  ## What It Does
20
20
 
21
- 1. **Downloads mxcli** — fetches the latest release binary for your OS/architecture
22
- 2. **Runs `mxcli init`** — initializes mxcli with Claude and OpenCode tool support
23
- 3. **Adds Mendix Developer Skill** — copies the AI skill file to `.ai-context/skills/`
21
+ 1. **Downloads mxcli** — fetches the latest release binary for your OS/architecture into `.tools/mxcli/`
22
+ 2. **Runs `mxcli init --all-tools`** — initializes mxcli with all supported AI tools (Claude, OpenCode, Cursor, Windsurf, Continue.dev, Aider)
23
+ 3. **Adds Mendix Developer Skill** — copies the AI skill file to `.ai-context/skills/` with guardrails for `.mpr` inspection, microflow tracing, SCSS conventions, and more
24
24
  4. **Updates `.gitignore`** — appends entries for AI/mxcli generated files
25
- 5. **Creates knowledge base** — generates a `project-knowledge-base.md` template for AI agents
25
+ 5. **Creates knowledge base** — generates a `project-knowledge-base.md` template where AI agents document what they learn about the project
26
+ 6. **Wires up knowledge base instructions** — appends instructions to `AGENTS.md` and `CLAUDE.md` telling AI agents to read and update the knowledge base every session
27
+
28
+ ## How the Knowledge Base Works
29
+
30
+ After setup, a `project-knowledge-base.md` file lives at the project root. AI agents are instructed (via `AGENTS.md`, `CLAUDE.md`, and the Mendix Developer Skill) to:
31
+
32
+ - **Read it** at the start of every session to learn what previous agents discovered
33
+ - **Update it** when they find new information — module purposes, entity relationships, microflow traces, architectural patterns, gotchas
34
+
35
+ This creates a persistent memory across AI sessions, so agents don't re-discover the same things.
36
+
37
+ ## CLI Usage
38
+
39
+ ```
40
+ npx mxcli-olc-setup [project-path]
41
+
42
+ Arguments:
43
+ project-path Path to the Mendix project root (default: current directory)
44
+
45
+ Options:
46
+ --help, -h Show help
47
+ --version, -v Show version
48
+ ```
26
49
 
27
50
  ## Global Install
28
51
 
@@ -44,3 +67,7 @@ mxcli-olc-setup
44
67
  | Windows | x64, arm64 |
45
68
  | macOS | x64 (Intel), arm64 (Apple Silicon) |
46
69
  | Linux | x64, arm64 |
70
+
71
+ ## Re-running
72
+
73
+ Safe to run multiple times. It skips steps that are already done (existing binary, existing knowledge base) and only appends new `.gitignore` entries or knowledge base instructions if they're missing.
@@ -172,6 +172,21 @@ Purpose: align decision dropdown spacing and sizing in the record sheet action r
172
172
 
173
173
  Existing legacy styles that already target `.mx-name-*` selectors should not be expanded unless the task is specifically to clean up or migrate them.
174
174
 
175
+ ## Project Knowledge Base
176
+
177
+ A file named `project-knowledge-base.md` exists at the project root. This is a shared memory across AI sessions. You MUST update it whenever you learn something that would help a future AI agent (or yourself in a new session) work on this project.
178
+
179
+ Update the knowledge base when you:
180
+
181
+ 1. Discover a module's purpose or responsibility.
182
+ 2. Identify key domain entities and their relationships.
183
+ 3. Trace an important microflow or page navigation path.
184
+ 4. Find a gotcha, edge case, or non-obvious constraint.
185
+ 5. Make an architectural decision or observe an existing pattern.
186
+ 6. Complete any analysis that produced reusable findings.
187
+
188
+ When updating, add to the appropriate section (Module Map, Key Entities, Important Microflows, etc.). Add a dated entry under Change Log. Keep entries concise and factual. Do not remove existing entries unless they are confirmed wrong.
189
+
175
190
  ## Git ignore
176
191
 
177
192
  Whenever AI or mxcli generated any files in the project directory, make sure the files to be included in git ignore file of the Mendix project.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxcli-olc-setup",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Automates mxcli setup for Mendix projects — downloads mxcli binary, runs init, adds custom skills, and configures gitignore",
5
5
  "bin": {
6
6
  "mxcli-olc-setup": "./setup.js"
@@ -13,6 +13,13 @@
13
13
  "engines": {
14
14
  "node": ">=14"
15
15
  },
16
- "keywords": ["mendix", "mxcli", "ai", "low-code", "cli", "setup"],
16
+ "keywords": [
17
+ "mendix",
18
+ "mxcli",
19
+ "ai",
20
+ "low-code",
21
+ "cli",
22
+ "setup"
23
+ ],
17
24
  "license": "UNLICENSED"
18
25
  }
package/setup.js CHANGED
@@ -68,10 +68,11 @@ function printHelp() {
68
68
 
69
69
  What it does:
70
70
  1. Downloads the latest mxcli binary for your platform
71
- 2. Runs mxcli init with Claude and OpenCode tools
71
+ 2. Runs mxcli init with all supported AI tools
72
72
  3. Adds the Mendix Developer Skill to .ai-context/skills/
73
73
  4. Appends AI/mxcli entries to .gitignore
74
74
  5. Creates a project-knowledge-base.md template
75
+ 6. Wires up knowledge base instructions in AGENTS.md and CLAUDE.md
75
76
  `);
76
77
  }
77
78
 
@@ -232,7 +233,7 @@ function runMxcliInit(binaryPath, projectRoot) {
232
233
  log('Running mxcli init...');
233
234
  try {
234
235
  const result = execSync(
235
- `"${binaryPath}" init --tool claude --tool opencode "${projectRoot}"`,
236
+ `"${binaryPath}" init --all-tools "${projectRoot}"`,
236
237
  { encoding: 'utf8', stdio: 'pipe', cwd: projectRoot }
237
238
  );
238
239
  log('mxcli init completed successfully');
@@ -333,6 +334,34 @@ function createKnowledgeBase(projectRoot) {
333
334
  log('Created project-knowledge-base.md');
334
335
  }
335
336
 
337
+ const KNOWLEDGE_BASE_NOTICE = `
338
+
339
+ ## Project Knowledge Base
340
+
341
+ A shared knowledge base exists at \`project-knowledge-base.md\` in the project root. This file persists across AI sessions.
342
+
343
+ **You MUST update it** when you discover new information about the project — module purposes, entity relationships, microflow traces, architectural patterns, gotchas, or any findings that would help a future agent. Add a dated entry under the Change Log section.
344
+
345
+ Read this file at the start of every session to understand what previous agents have already learned.
346
+ `;
347
+
348
+ function appendKnowledgeBaseNotice(projectRoot) {
349
+ const targets = ['AGENTS.md', 'CLAUDE.md'];
350
+ for (const filename of targets) {
351
+ const filePath = path.join(projectRoot, filename);
352
+ if (!fs.existsSync(filePath)) continue;
353
+
354
+ const content = fs.readFileSync(filePath, 'utf8');
355
+ if (content.includes('project-knowledge-base.md')) {
356
+ log(`${filename} already references knowledge base, skipping`);
357
+ continue;
358
+ }
359
+
360
+ fs.appendFileSync(filePath, KNOWLEDGE_BASE_NOTICE, 'utf8');
361
+ log(`Added knowledge base instructions to ${filename}`);
362
+ }
363
+ }
364
+
336
365
  async function main() {
337
366
  const projectRoot = getProjectRoot();
338
367
  log(`Project root: ${projectRoot}`);
@@ -358,6 +387,8 @@ async function main() {
358
387
 
359
388
  createKnowledgeBase(projectRoot);
360
389
 
390
+ appendKnowledgeBaseNotice(projectRoot);
391
+
361
392
  log('Setup complete!');
362
393
  }
363
394