nimai-mcp 0.3.5 → 0.3.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.
@@ -88,10 +88,14 @@ export interface ForgeNewOutput {
88
88
  export interface ForgeSpecReviewOutput {
89
89
  /**
90
90
  * FORGE Prompt 1.5 — Spec-Quality Reviewer prompt.
91
- * Pass this to a reviewing LLM. The LLM will respond with a JSON verdict block
92
- * containing {passed: boolean, issues: string[]}.
91
+ * Must be evaluated by an independent reviewer NOT the agent that created the spec.
93
92
  */
94
93
  specReviewerPrompt: string;
94
+ /**
95
+ * Ready-to-display instructions for the user on how to complete the independent review.
96
+ * The agent should present this to the user verbatim and wait for them to return the verdict.
97
+ */
98
+ reviewer_instructions: string;
95
99
  }
96
100
  export declare const TOOL_DESCRIPTORS: {
97
101
  readonly nimai_spec: {
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzD,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAIH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WA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;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAID,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDnB,CAAC"}
package/dist/contract.js CHANGED
@@ -66,14 +66,14 @@ exports.TOOL_DESCRIPTORS = {
66
66
  },
67
67
  nimai_spec_review: {
68
68
  name: 'nimai_spec_review',
69
- description: 'USE THIS BEFORE BUILDING: returns a Prompt 1.5 spec-quality reviewer. ' +
69
+ description: 'USE THIS BEFORE BUILDING: returns a Prompt 1.5 spec-quality reviewer prompt plus reviewer_instructions. ' +
70
70
  'Only call this after nimai_validate passes. ' +
71
- 'IMPORTANT: this tool returns a prompt string — it does NOT perform the review itself. ' +
72
- 'After calling this tool, you MUST use the returned specReviewerPrompt as your next input and evaluate the spec yourself. ' +
73
- 'Read the prompt, apply the 6 dimensions, then end your response with the JSON verdict block: ' +
74
- '{"passed": true/false, "schema_version": "2", "issues": [...]}. ' +
75
- 'The review is NOT complete until you have produced and the human has seen that verdict block. ' +
76
- 'If passed=false, fix the spec, re-run nimai_validate, then call this again. ' +
71
+ 'CRITICAL: do NOT evaluate the specReviewerPrompt yourself. ' +
72
+ 'The agent that built the spec must not be its own reviewer this defeats the purpose of the review. ' +
73
+ 'After calling this tool, present the reviewer_instructions to the user verbatim and stop. ' +
74
+ 'The user will take the specReviewerPrompt to an independent reviewer (fresh session, different model). ' +
75
+ 'Wait for the user to return the verdict block: {"passed": true/false, "schema_version": "2", "issues": [...]}. ' +
76
+ 'If passed=false, fix the spec using the issues list, re-run nimai_validate, then call this again. ' +
77
77
  'For reviewing an implementation against an approved spec, use nimai_review instead.',
78
78
  inputSchema: exports.ForgeSpecReviewInput,
79
79
  },
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,6BAAwB;AAGxB,iFAAiF;AAEpE,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACrE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CACpF,CAAC,CAAC;AAEU,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACzE,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CACxE,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;CACzF,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CAClF,CAAC,CAAC;AAkDH,iFAAiF;AAEpE,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EA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AyG;YACzG,iHAAiH;YACjH,oGAAoG;YACpG,qFAAqF;QACvF,WAAW,EAAE,4BAAoB;KAClC;CACO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"spec-review.d.ts","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,cAAc,CAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC1C,OAAO,CAAC,qBAAqB,CAAC,CAYhC"}
1
+ {"version":3,"file":"spec-review.d.ts","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,cAAc,CAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC1C,OAAO,CAAC,qBAAqB,CAAC,CAqDhC"}
@@ -46,6 +46,45 @@ async function toolSpecReview(input) {
46
46
  catch (err) {
47
47
  throw new Error(`Cannot read spec at "${specPath}": ${err.message}`);
48
48
  }
49
- return { specReviewerPrompt: (0, nimai_core_1.buildPrompt15)(specContent) };
49
+ const specReviewerPrompt = (0, nimai_core_1.buildPrompt15)(specContent);
50
+ const reviewer_instructions = [
51
+ '⚠️ INDEPENDENT REVIEW REQUIRED',
52
+ '',
53
+ 'The spec-quality review must be done by an independent reviewer —',
54
+ 'NOT the agent that created or edited the spec.',
55
+ '',
56
+ '── STEP 1: Send to independent reviewer ──────────────────────────',
57
+ '1. Copy the specReviewerPrompt string from this response.',
58
+ '2. Open a FRESH SESSION with a different model or agent',
59
+ ' (e.g. paste into Claude, a new Codex thread, or any LLM).',
60
+ '3. Paste the prompt and let the reviewer evaluate the spec.',
61
+ '4. The reviewer will end their response with a JSON verdict block:',
62
+ ' {"passed": true/false, "schema_version": "2", "issues": [...]}',
63
+ '',
64
+ '── STEP 2: Return the verdict ────────────────────────────────────',
65
+ 'Bring the full verdict back to THIS session.',
66
+ '',
67
+ ' If passed: true',
68
+ ' → The spec is approved. Proceed to implementation.',
69
+ '',
70
+ ' If passed: false',
71
+ ' → Do NOT re-run nimai_spec (that would discard all spec work).',
72
+ ` → Give the builder this message (fill in the verdict):`,
73
+ '',
74
+ ` ┌─ BUILDER FIX BRIEF ──────────────────────────────────────────`,
75
+ ` │ The independent spec review found issues in: ${specPath}`,
76
+ ` │`,
77
+ ` │ Fix each HARD_FAIL and SOFT_FAIL in the verdict below by`,
78
+ ` │ editing the spec directly. Do not regenerate from scratch.`,
79
+ ` │`,
80
+ ` │ [PASTE VERDICT HERE]`,
81
+ ` │`,
82
+ ` │ After fixing:`,
83
+ ` │ 1. Run nimai_validate — must return passed: true`,
84
+ ` │ 2. Run nimai_spec_review — get new reviewer_instructions`,
85
+ ` │ 3. Send to an independent reviewer again (do not self-review)`,
86
+ ` └──────────────────────────────────────────────────────────────`,
87
+ ].join('\n');
88
+ return { specReviewerPrompt, reviewer_instructions };
50
89
  }
51
90
  //# sourceMappingURL=spec-review.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCAcC;AApBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA2C;AAIpC,KAAK,UAAU,cAAc,CAClC,KAA2C;IAE3C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAA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EAAE;QAC9D,KAAK;QACL,8DAA8D;QAC9D,gEAAgE;QAChE,KAAK;QACL,0BAA0B;QAC1B,KAAK;QACL,mBAAmB;QACnB,sDAAsD;QACtD,8DAA8D;QAC9D,mEAAmE;QACnE,mEAAmE;KACpE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nimai-mcp",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Nimai MCP server — exposes nimai_spec, nimai_review, nimai_validate, nimai_new as tools. No internal LLM calls.",
5
5
  "keywords": [
6
6
  "nimai",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "^1.0.0",
38
38
  "zod": "^3.23.8",
39
- "nimai-core": "0.3.5"
39
+ "nimai-core": "0.3.7"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc",