@10kdevs/matha 0.1.1 → 0.1.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
@@ -162,15 +162,60 @@ matha_get_routing(operationType?) Learned model routing rules
162
162
  ## Initialising From An Existing Document
163
163
 
164
164
  If your project already has a BRD, spec, or requirements document:
165
+ ## Setting Up Your Project Brain
166
+
167
+ Before running `matha init`, generate a `requirements.md` file that
168
+ captures your project's intent, rules, and boundaries in a format
169
+ MATHA understands deeply.
170
+
171
+ **Paste this prompt into any AI assistant:**
172
+ ```
173
+ I am setting up MATHA — a persistent cognitive layer for AI-assisted
174
+ development. I need you to generate a requirements.md file for my
175
+ project that MATHA will parse during initialisation.
176
+
177
+ My project: [describe your project in 2-3 sentences]
178
+
179
+ Generate a requirements.md with exactly these sections:
180
+
181
+ ## Overview
182
+ A concise paragraph explaining what problem this project solves
183
+ and why it exists. Focus on the WHY, not the features.
184
+
185
+ ## Business Rules
186
+ A bullet list of non-negotiable rules that must always be true.
187
+ These are constraints the codebase must never violate.
188
+ Examples: calculation logic, data integrity rules,
189
+ financial constraints, domain-specific invariants.
190
+
191
+ ## Out of Scope
192
+ A bullet list of things this project explicitly does NOT do.
193
+ These are boundaries that protect the system from scope creep.
194
+
195
+ ## Owner
196
+ The name or team responsible for this project.
197
+
198
+ Be specific and precise. Vague rules are useless.
199
+ Each rule should be concrete enough that a developer
200
+ who has never seen the codebase understands exactly
201
+ what it means.
202
+ ```
203
+
204
+ Then run:
165
205
 
166
206
  ```bash
167
207
  matha init --from requirements.md
168
208
  ```
169
209
 
210
+ MATHA will parse the document, show you what it found,
211
+ and let you confirm or override before writing anything.
212
+
213
+
170
214
  MATHA parses business rules, boundaries, and intent from the document and pre-fills the init prompts. You review and confirm. Nothing is written without your sign-off.
171
215
 
172
216
  ---
173
217
 
218
+
174
219
  ## What MATHA Is Not
175
220
 
176
221
  MATHA does not generate code.
@@ -132,6 +132,28 @@ export async function runInit(projectRoot = process.cwd(), deps) {
132
132
  catch {
133
133
  log('No git history found — cortex will build as commits accumulate');
134
134
  }
135
+ // Write MCP server config
136
+ try {
137
+ const mcpServerPath = await resolveMcpServerPath(projectRoot);
138
+ const mcpConfigContent = {
139
+ mcpServers: {
140
+ matha: {
141
+ command: 'node',
142
+ args: [mcpServerPath, 'serve'],
143
+ description: 'MATHA persistent cognitive layer',
144
+ },
145
+ },
146
+ };
147
+ const mcpConfigPath = path.join(mathaDir, 'mcp-config.json');
148
+ await writeAtomic(mcpConfigPath, mcpConfigContent, { overwrite: true });
149
+ log('');
150
+ log('MCP server config written to .matha/mcp-config.json');
151
+ log('Add this to your IDE MCP settings:');
152
+ log(JSON.stringify(mcpConfigContent, null, 2));
153
+ }
154
+ catch (err) {
155
+ log(`Warning: Could not write MCP config: ${err.message}`);
156
+ }
135
157
  return {
136
158
  projectRoot,
137
159
  brainDir: '.matha',
@@ -264,3 +286,13 @@ async function defaultAsk(message) {
264
286
  const prompts = await import('@inquirer/prompts');
265
287
  return prompts.input({ message });
266
288
  }
289
+ async function resolveMcpServerPath(projectRoot) {
290
+ // Try node_modules/.bin/matha first
291
+ const npmBinPath = path.join(projectRoot, 'node_modules', '.bin', 'matha');
292
+ if (await pathExists(npmBinPath)) {
293
+ return npmBinPath;
294
+ }
295
+ // Fall back to dist/index.js
296
+ const distPath = path.join(projectRoot, 'dist', 'index.js');
297
+ return distPath;
298
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10kdevs/matha",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "The persistent cognitive layer for AI-assisted development. Gives AI agents the project context that currently only exists inside a senior engineer's head.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {