nimai-mcp 0.4.9 → 0.5.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/data/nimai-spec-full.md +63 -0
- package/data/nimai-spec-lite.md +39 -0
- package/dist/contract.d.ts +19 -82
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +35 -68
- package/dist/contract.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -16
- package/dist/server.js.map +1 -1
- package/dist/tools/review.d.ts.map +1 -1
- package/dist/tools/review.js +4 -5
- package/dist/tools/review.js.map +1 -1
- package/dist/tools/spec.d.ts.map +1 -1
- package/dist/tools/spec.js +4 -12
- package/dist/tools/spec.js.map +1 -1
- package/package.json +2 -2
- package/data/FORGE-spec-template.md +0 -454
- package/dist/tools/new.d.ts +0 -4
- package/dist/tools/new.d.ts.map +0 -1
- package/dist/tools/new.js +0 -54
- package/dist/tools/new.js.map +0 -1
- package/dist/tools/spec-review.d.ts +0 -4
- package/dist/tools/spec-review.d.ts.map +0 -1
- package/dist/tools/spec-review.js +0 -63
- package/dist/tools/spec-review.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Spec: [title]
|
|
2
|
+
|
|
3
|
+
## Deliverable
|
|
4
|
+
*What exists when this is done. Name the artifact, not the activity.*
|
|
5
|
+
|
|
6
|
+
- Artifact:
|
|
7
|
+
- Format:
|
|
8
|
+
- Quality bar (measurable — a number, a passing command, a checkable property):
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
**In scope:**
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
**Out of scope (will not be built — be explicit, this is what prevents drift):**
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
## Task Decomposition
|
|
18
|
+
*Each sub-task completable in under 2 hours, with its own binary acceptance criteria. State dependencies between sub-tasks explicitly.*
|
|
19
|
+
|
|
20
|
+
| # | Sub-task | Depends on | Acceptance criteria | How it is checked |
|
|
21
|
+
|---|---|---|---|---|
|
|
22
|
+
| 1 | | — | | |
|
|
23
|
+
|
|
24
|
+
## Mechanism Decisions
|
|
25
|
+
*One block per core choice. A builder must never have to pick an approach mid-build.*
|
|
26
|
+
|
|
27
|
+
**Decision: [short name]**
|
|
28
|
+
- Chosen: [exactly one approach]
|
|
29
|
+
- Rejected: [the alternatives considered]
|
|
30
|
+
- Why: [one sentence]
|
|
31
|
+
|
|
32
|
+
## Architecture Lock
|
|
33
|
+
*Resolve every line. "TBD" and blanks mean the spec is not ready. Write "none" where a field genuinely does not apply, with a reason.*
|
|
34
|
+
|
|
35
|
+
- Persistence layer:
|
|
36
|
+
- File/object storage:
|
|
37
|
+
- External services + env vars:
|
|
38
|
+
- API/trigger flow:
|
|
39
|
+
- Entity states and transitions:
|
|
40
|
+
- Auth:
|
|
41
|
+
|
|
42
|
+
## Change Surface
|
|
43
|
+
*Every existing file this work touches, classified. The builder may not touch anything outside this table.*
|
|
44
|
+
*Greenfield project? Replace the table with the single line: "Greenfield — no existing code to change."*
|
|
45
|
+
|
|
46
|
+
| Path | Verb (DELETE / REWRITE / EDIT / KEEP) | Why |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| | | |
|
|
49
|
+
|
|
50
|
+
## Edge Cases and Failure Modes
|
|
51
|
+
*What will the builder hit mid-execution that the sections above do not answer? An empty list here is a red flag, not a green one.*
|
|
52
|
+
|
|
53
|
+
-
|
|
54
|
+
-
|
|
55
|
+
|
|
56
|
+
## Spec Convergence
|
|
57
|
+
*Non-zero counts mean this spec is not ready. Fix the spec, not the numbers.*
|
|
58
|
+
|
|
59
|
+
open_questions: 0
|
|
60
|
+
ambiguities_remaining: 0
|
|
61
|
+
ready_for_build: yes
|
|
62
|
+
|
|
63
|
+
<!-- nimai-spec tier=full -->
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Spec: [title]
|
|
2
|
+
|
|
3
|
+
## Deliverable
|
|
4
|
+
*What exists when this is done. Name the artifact, not the activity.*
|
|
5
|
+
|
|
6
|
+
- Artifact:
|
|
7
|
+
- Format:
|
|
8
|
+
- Quality bar (measurable — a number, a passing command, a checkable property):
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
**In scope:**
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
**Out of scope (will not be built — be explicit, this is what prevents drift):**
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
## Acceptance Criteria
|
|
18
|
+
*Binary and checkable. Leave every box unchecked — they are checked by the reviewer, not the author.*
|
|
19
|
+
|
|
20
|
+
Done when ALL of these are true:
|
|
21
|
+
- [ ]
|
|
22
|
+
- [ ]
|
|
23
|
+
|
|
24
|
+
## Mechanism Decisions
|
|
25
|
+
*One block per core choice. A builder must never have to pick an approach mid-build.*
|
|
26
|
+
|
|
27
|
+
**Decision: [short name]**
|
|
28
|
+
- Chosen: [exactly one approach]
|
|
29
|
+
- Rejected: [the alternatives considered]
|
|
30
|
+
- Why: [one sentence]
|
|
31
|
+
|
|
32
|
+
## Spec Convergence
|
|
33
|
+
*Non-zero counts mean this spec is not ready. Fix the spec, not the numbers.*
|
|
34
|
+
|
|
35
|
+
open_questions: 0
|
|
36
|
+
ambiguities_remaining: 0
|
|
37
|
+
ready_for_build: yes
|
|
38
|
+
|
|
39
|
+
<!-- nimai-spec tier=lite -->
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Nimai MCP Tool Contract — v2 (v0.5.0)
|
|
3
3
|
*
|
|
4
|
+
* Exactly 3 tools: nimai_spec, nimai_validate, nimai_review.
|
|
4
5
|
* All tool schemas are defined and locked here before server implementation.
|
|
5
6
|
* Do NOT change tool names or output shapes without a contract version bump.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
+
* Contract notes:
|
|
8
9
|
* - Tool names prefixed with "nimai_" to avoid collisions with host tool namespaces
|
|
9
10
|
* - All inputs validated with zod to prevent runtime shape errors
|
|
10
11
|
* - Outputs are plain serialisable objects (no class instances, no Buffers)
|
|
11
|
-
* - No LLM calls inside any tool — tools return
|
|
12
|
+
* - No LLM calls inside any tool — tools return prompts/structure only
|
|
12
13
|
* - specPath / repoPath are absolute or relative to cwd; server does NOT resolve ~
|
|
13
|
-
* - outputPath for nimai_new: parent directory is created if missing; write errors surface as tool errors
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
import type { LintIssue
|
|
16
|
+
import type { LintIssue } from 'nimai-core';
|
|
17
17
|
export declare const ForgeSpecInput: z.ZodObject<{
|
|
18
18
|
repoPath: z.ZodString;
|
|
19
19
|
request: z.ZodString;
|
|
@@ -24,13 +24,6 @@ export declare const ForgeSpecInput: z.ZodObject<{
|
|
|
24
24
|
repoPath: string;
|
|
25
25
|
request: string;
|
|
26
26
|
}>;
|
|
27
|
-
export declare const ForgeReviewInput: z.ZodObject<{
|
|
28
|
-
specPath: z.ZodString;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
specPath: string;
|
|
31
|
-
}, {
|
|
32
|
-
specPath: string;
|
|
33
|
-
}>;
|
|
34
27
|
export declare const ForgeValidateInput: z.ZodObject<{
|
|
35
28
|
specPath: z.ZodString;
|
|
36
29
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -38,65 +31,28 @@ export declare const ForgeValidateInput: z.ZodObject<{
|
|
|
38
31
|
}, {
|
|
39
32
|
specPath: string;
|
|
40
33
|
}>;
|
|
41
|
-
export declare const
|
|
42
|
-
outputPath: z.ZodString;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
outputPath: string;
|
|
45
|
-
}, {
|
|
46
|
-
outputPath: string;
|
|
47
|
-
}>;
|
|
48
|
-
export declare const ForgeSpecReviewInput: z.ZodObject<{
|
|
34
|
+
export declare const ForgeReviewInput: z.ZodObject<{
|
|
49
35
|
specPath: z.ZodString;
|
|
36
|
+
target: z.ZodEnum<["spec", "implementation"]>;
|
|
50
37
|
}, "strip", z.ZodTypeAny, {
|
|
51
38
|
specPath: string;
|
|
39
|
+
target: "spec" | "implementation";
|
|
52
40
|
}, {
|
|
53
41
|
specPath: string;
|
|
42
|
+
target: "spec" | "implementation";
|
|
54
43
|
}>;
|
|
55
44
|
export interface ForgeSpecOutput {
|
|
56
|
-
/** The
|
|
57
|
-
|
|
58
|
-
/** Repo context items extracted for the request */
|
|
59
|
-
context: ContextItem[];
|
|
60
|
-
/**
|
|
61
|
-
* Existing nimai-managed spec files found in the repo (sorted newest-first).
|
|
62
|
-
* Empty array means no spec file exists yet — MUST call nimai_new immediately as the next action.
|
|
63
|
-
* Do not ask follow-up questions or narrate alternatives before calling nimai_new.
|
|
64
|
-
* Non-empty means spec files already exist — you may fill one of these instead of creating a new one.
|
|
65
|
-
*/
|
|
66
|
-
existing_specs: string[];
|
|
67
|
-
/**
|
|
68
|
-
* Concrete follow-up questions when request ambiguity blocks reliable spec drafting.
|
|
69
|
-
* Triggered when request is under 10 words OR zero repo files matched.
|
|
70
|
-
* Optional — absent when no clarification is needed.
|
|
71
|
-
*/
|
|
72
|
-
clarifications_needed?: string[];
|
|
73
|
-
}
|
|
74
|
-
export interface ForgeReviewOutput {
|
|
75
|
-
/** The populated FORGE Prompt 2 (Reviewer/Validator), derived from the spec */
|
|
76
|
-
reviewerPrompt: string;
|
|
45
|
+
/** The Nimai spec protocol prompt — run this as the host model to draft the spec */
|
|
46
|
+
protocolPrompt: string;
|
|
77
47
|
}
|
|
78
48
|
export interface ForgeValidateOutput {
|
|
79
49
|
issues: LintIssue[];
|
|
80
50
|
/** true if zero hard (non-advisory) issues found */
|
|
81
51
|
passed: boolean;
|
|
82
52
|
}
|
|
83
|
-
export interface
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
/** Content written to the file */
|
|
87
|
-
content: string;
|
|
88
|
-
}
|
|
89
|
-
export interface ForgeSpecReviewOutput {
|
|
90
|
-
/**
|
|
91
|
-
* FORGE Prompt 1.5 — Spec-Quality Reviewer prompt.
|
|
92
|
-
* Must be evaluated by an independent reviewer — NOT the agent that created the spec.
|
|
93
|
-
*/
|
|
94
|
-
specReviewerPrompt: string;
|
|
95
|
-
/**
|
|
96
|
-
* Ready-to-display instructions for the user on how to complete the independent review.
|
|
97
|
-
* The agent should present this to the user verbatim and wait for them to return the verdict.
|
|
98
|
-
*/
|
|
99
|
-
reviewer_instructions: string;
|
|
53
|
+
export interface ForgeReviewOutput {
|
|
54
|
+
/** The reviewer prompt — pass to an independent model/session */
|
|
55
|
+
reviewerPrompt: string;
|
|
100
56
|
}
|
|
101
57
|
export declare const TOOL_DESCRIPTORS: {
|
|
102
58
|
readonly nimai_spec: {
|
|
@@ -113,17 +69,6 @@ export declare const TOOL_DESCRIPTORS: {
|
|
|
113
69
|
request: string;
|
|
114
70
|
}>;
|
|
115
71
|
};
|
|
116
|
-
readonly nimai_review: {
|
|
117
|
-
readonly name: "nimai_review";
|
|
118
|
-
readonly description: string;
|
|
119
|
-
readonly inputSchema: z.ZodObject<{
|
|
120
|
-
specPath: z.ZodString;
|
|
121
|
-
}, "strip", z.ZodTypeAny, {
|
|
122
|
-
specPath: string;
|
|
123
|
-
}, {
|
|
124
|
-
specPath: string;
|
|
125
|
-
}>;
|
|
126
|
-
};
|
|
127
72
|
readonly nimai_validate: {
|
|
128
73
|
readonly name: "nimai_validate";
|
|
129
74
|
readonly description: string;
|
|
@@ -135,26 +80,18 @@ export declare const TOOL_DESCRIPTORS: {
|
|
|
135
80
|
specPath: string;
|
|
136
81
|
}>;
|
|
137
82
|
};
|
|
138
|
-
readonly
|
|
139
|
-
readonly name: "
|
|
140
|
-
readonly description: "Scaffolds a new FORGE spec file from the canonical template at the specified output path.";
|
|
141
|
-
readonly inputSchema: z.ZodObject<{
|
|
142
|
-
outputPath: z.ZodString;
|
|
143
|
-
}, "strip", z.ZodTypeAny, {
|
|
144
|
-
outputPath: string;
|
|
145
|
-
}, {
|
|
146
|
-
outputPath: string;
|
|
147
|
-
}>;
|
|
148
|
-
};
|
|
149
|
-
readonly nimai_spec_review: {
|
|
150
|
-
readonly name: "nimai_spec_review";
|
|
83
|
+
readonly nimai_review: {
|
|
84
|
+
readonly name: "nimai_review";
|
|
151
85
|
readonly description: string;
|
|
152
86
|
readonly inputSchema: z.ZodObject<{
|
|
153
87
|
specPath: z.ZodString;
|
|
88
|
+
target: z.ZodEnum<["spec", "implementation"]>;
|
|
154
89
|
}, "strip", z.ZodTypeAny, {
|
|
155
90
|
specPath: string;
|
|
91
|
+
target: "spec" | "implementation";
|
|
156
92
|
}, {
|
|
157
93
|
specPath: string;
|
|
94
|
+
target: "spec" | "implementation";
|
|
158
95
|
}>;
|
|
159
96
|
};
|
|
160
97
|
};
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -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,
|
|
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,MAAM,YAAY,CAAC;AAI5C,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;EAM3B,CAAC;AAIH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAC;CACxB;AAID,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCnB,CAAC"}
|
package/dist/contract.js
CHANGED
|
@@ -1,103 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Nimai MCP Tool Contract — v2 (v0.5.0)
|
|
4
4
|
*
|
|
5
|
+
* Exactly 3 tools: nimai_spec, nimai_validate, nimai_review.
|
|
5
6
|
* All tool schemas are defined and locked here before server implementation.
|
|
6
7
|
* Do NOT change tool names or output shapes without a contract version bump.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* Contract notes:
|
|
9
10
|
* - Tool names prefixed with "nimai_" to avoid collisions with host tool namespaces
|
|
10
11
|
* - All inputs validated with zod to prevent runtime shape errors
|
|
11
12
|
* - Outputs are plain serialisable objects (no class instances, no Buffers)
|
|
12
|
-
* - No LLM calls inside any tool — tools return
|
|
13
|
+
* - No LLM calls inside any tool — tools return prompts/structure only
|
|
13
14
|
* - specPath / repoPath are absolute or relative to cwd; server does NOT resolve ~
|
|
14
|
-
* - outputPath for nimai_new: parent directory is created if missing; write errors surface as tool errors
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.TOOL_DESCRIPTORS = exports.
|
|
17
|
+
exports.TOOL_DESCRIPTORS = exports.ForgeReviewInput = exports.ForgeValidateInput = exports.ForgeSpecInput = void 0;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
// ─── Input Schemas ────────────────────────────────────────────────────────────
|
|
20
20
|
exports.ForgeSpecInput = zod_1.z.object({
|
|
21
21
|
repoPath: zod_1.z.string().describe('Absolute path to the repository root'),
|
|
22
|
-
request: zod_1.z.string().min(1).describe('The loose request to turn into a spec
|
|
23
|
-
});
|
|
24
|
-
exports.ForgeReviewInput = zod_1.z.object({
|
|
25
|
-
specPath: zod_1.z.string().describe('Path to the approved spec markdown file'),
|
|
22
|
+
request: zod_1.z.string().min(1).describe('The loose request to turn into a spec'),
|
|
26
23
|
});
|
|
27
24
|
exports.ForgeValidateInput = zod_1.z.object({
|
|
28
25
|
specPath: zod_1.z.string().describe('Path to the spec markdown file to lint'),
|
|
29
26
|
});
|
|
30
|
-
exports.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
specPath: zod_1.z.string().describe('Path to the draft spec markdown file to evaluate'),
|
|
27
|
+
exports.ForgeReviewInput = zod_1.z.object({
|
|
28
|
+
specPath: zod_1.z.string().describe('Path to the spec markdown file'),
|
|
29
|
+
target: zod_1.z.enum(['spec', 'implementation']).describe('What to review: "spec" evaluates spec quality (use before building); ' +
|
|
30
|
+
'"implementation" evaluates whether a build satisfies the spec (use after building)'),
|
|
35
31
|
});
|
|
36
32
|
// ─── Tool Descriptors (used to register tools in the MCP server) ──────────────
|
|
37
33
|
exports.TOOL_DESCRIPTORS = {
|
|
38
34
|
nimai_spec: {
|
|
39
35
|
name: 'nimai_spec',
|
|
40
|
-
description: 'Returns
|
|
41
|
-
'
|
|
36
|
+
description: 'Returns the Nimai spec protocol prompt — a four-phase protocol (EXPLORE → INTERVIEW → DRAFT → GATE) ' +
|
|
37
|
+
'that the host model runs to turn a loose request into a graded, build-ready spec. ' +
|
|
38
|
+
'Nimai performs no repo reading and generates no questions itself — the host model does all of that. ' +
|
|
42
39
|
'IMPORTANT: repoPath must be the specific project directory you are writing the spec for — not a parent directory, home directory, or workspace root. ' +
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'After nimai_validate passes, tell the user to open a fresh reviewer session and ask it to call nimai_spec_review. The builder must not perform the review in the same session. ' +
|
|
50
|
-
'Scope boundary: this tool produces spec prompts/contracts only. ' +
|
|
51
|
-
'Nimai defines and enforces spec-quality contracts; ChatMasala executes agent workflows against those contracts; context platforms provide the execution substrate. ' +
|
|
52
|
-
'It does not orchestrate runtime execution, retries, agent routing, or session control.',
|
|
40
|
+
'After receiving the protocol prompt: run the four phases in order. ' +
|
|
41
|
+
'PHASE 1: explore the repo with your own tools. ' +
|
|
42
|
+
'PHASE 2: ask the user 5–8 specific clarifying questions, then choose the tier (lite or full). ' +
|
|
43
|
+
'PHASE 3: fill the embedded tier template completely. ' +
|
|
44
|
+
'PHASE 4: run nimai_validate, then nimai_review with target "spec" in a FRESH session, iterate until verdict passes. ' +
|
|
45
|
+
'Scope boundary: Nimai defines spec quality contracts only — it does not orchestrate runtime execution, retries, or agent routing.',
|
|
53
46
|
inputSchema: exports.ForgeSpecInput,
|
|
54
47
|
},
|
|
55
|
-
nimai_review: {
|
|
56
|
-
name: 'nimai_review',
|
|
57
|
-
description: 'USE THIS AFTER BUILDING: returns a Reviewer/Validator prompt (Prompt 2) to check whether an ' +
|
|
58
|
-
'implementation satisfies an approved spec. ' +
|
|
59
|
-
'For checking spec quality BEFORE building, use nimai_spec_review instead.',
|
|
60
|
-
inputSchema: exports.ForgeReviewInput,
|
|
61
|
-
},
|
|
62
48
|
nimai_validate: {
|
|
63
49
|
name: 'nimai_validate',
|
|
64
|
-
description: 'Lints a spec file for
|
|
65
|
-
'
|
|
66
|
-
'Run this after filling a spec and again after every fix. ' +
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'Open a fresh reviewer session and give it this instruction:\n\n' +
|
|
72
|
-
' Please call nimai_spec_review({ specPath: \'<ACTUAL PATH>\' })\n' +
|
|
73
|
-
' and evaluate the result.\n\n' +
|
|
74
|
-
'------------------------\n\n' +
|
|
75
|
-
'Replace <ACTUAL PATH> with the exact specPath that was validated. Do not use a placeholder. ' +
|
|
76
|
-
'The builder must not call nimai_spec_review itself — not on the first pass, not after a fix iteration, not ever. ' +
|
|
77
|
-
'This REVIEWER HANDOFF block must be output every time passed: true, whether it is the first validation or a re-validation after fixing reviewer feedback. ' +
|
|
78
|
-
'If this is a re-validation after reviewer feedback, output `--- RE-REVIEW HANDOFF ---` instead, include a short "Changes applied" bullet list, and instruct reviewer to evaluate fresh from current prompt output only (do not reuse prior evaluation context).',
|
|
50
|
+
description: 'Lints a spec file for structural issues: blank placeholders, missing required sections (tier-aware), ' +
|
|
51
|
+
'pre-checked acceptance criteria, and unresolved convergence. Returns structured issues and a pass/fail result. ' +
|
|
52
|
+
'Run this after filling a spec and again after every fix iteration. ' +
|
|
53
|
+
'When passed: true, proceed to nimai_review with target "spec" in a FRESH reviewer session — ' +
|
|
54
|
+
'the drafter must not review its own spec. ' +
|
|
55
|
+
'When re-validating after reviewer feedback: open a fresh reviewer session for re-review; ' +
|
|
56
|
+
'do not continue the existing reviewer conversation.',
|
|
79
57
|
inputSchema: exports.ForgeValidateInput,
|
|
80
58
|
},
|
|
81
|
-
|
|
82
|
-
name: '
|
|
83
|
-
description: '
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'The reviewer evaluates the spec and outputs a verdict. ' +
|
|
91
|
-
'If issues are non-empty (including SOFT_FAIL/NOTE with passed=true), reviewer must output a Builder Brief ' +
|
|
92
|
-
'(header: \'## Paste this to your builder session:\') with one fix instruction per issue. ' +
|
|
93
|
-
'The builder must not perform the review in the same session it wrote the spec — ' +
|
|
94
|
-
'independent review requires a fresh session with no builder context. ' +
|
|
95
|
-
'Every re-review is a fresh evaluation pass: use only the current prompt output and do not reuse prior verdict context as evidence. ' +
|
|
96
|
-
'For reviewing an implementation against an approved spec, use nimai_review instead. ' +
|
|
97
|
-
'Scope boundary: this tool governs spec quality review contracts only. ' +
|
|
98
|
-
'Nimai defines and enforces spec-quality contracts; ChatMasala executes agent workflows against those contracts; context platforms provide the execution substrate. ' +
|
|
99
|
-
'It does not execute implementation workflows or runtime orchestration.',
|
|
100
|
-
inputSchema: exports.ForgeSpecReviewInput,
|
|
59
|
+
nimai_review: {
|
|
60
|
+
name: 'nimai_review',
|
|
61
|
+
description: 'Returns a reviewer prompt for the spec at specPath. ' +
|
|
62
|
+
'target="spec": returns the Spec-Quality Reviewer (Prompt 1.5) — use BEFORE building to evaluate spec quality. ' +
|
|
63
|
+
'target="implementation": returns the Implementation Reviewer (Prompt 2) — use AFTER building to check whether the implementation satisfies the spec. ' +
|
|
64
|
+
'The returned prompt must be evaluated by an independent reviewer in a FRESH session — ' +
|
|
65
|
+
'not the same agent that drafted the spec or built the implementation. ' +
|
|
66
|
+
'Every re-review is a fresh evaluation: start a new conversation, do not reuse prior verdict context.',
|
|
67
|
+
inputSchema: exports.ForgeReviewInput,
|
|
101
68
|
},
|
|
102
69
|
};
|
|
103
70
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.js.map
CHANGED
|
@@ -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,
|
|
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,uCAAuC,CAAC;CAC7E,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,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC/D,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CACjD,uEAAuE;QACvE,oFAAoF,CACrF;CACF,CAAC,CAAC;AAoBH,iFAAiF;AAEpE,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,sGAAsG;YACtG,oFAAoF;YACpF,sGAAsG;YACtG,uJAAuJ;YACvJ,qEAAqE;YACrE,iDAAiD;YACjD,gGAAgG;YAChG,uDAAuD;YACvD,sHAAsH;YACtH,mIAAmI;QACrI,WAAW,EAAE,sBAAc;KAC5B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,uGAAuG;YACvG,iHAAiH;YACjH,qEAAqE;YACrE,8FAA8F;YAC9F,4CAA4C;YAC5C,2FAA2F;YAC3F,qDAAqD;QACvD,WAAW,EAAE,0BAAkB;KAChC;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,sDAAsD;YACtD,gHAAgH;YAChH,uJAAuJ;YACvJ,wFAAwF;YACxF,wEAAwE;YACxE,sGAAsG;QACxG,WAAW,EAAE,wBAAgB;KAC9B;CACO,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAcnE,wBAAgB,YAAY,IAAI,MAAM,CA6DrC;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
|
package/dist/server.js
CHANGED
|
@@ -7,10 +7,8 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
|
7
7
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
8
8
|
const contract_1 = require("./contract");
|
|
9
9
|
const spec_1 = require("./tools/spec");
|
|
10
|
-
const review_1 = require("./tools/review");
|
|
11
10
|
const validate_1 = require("./tools/validate");
|
|
12
|
-
const
|
|
13
|
-
const spec_review_1 = require("./tools/spec-review");
|
|
11
|
+
const review_1 = require("./tools/review");
|
|
14
12
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
13
|
const { version } = require('../package.json');
|
|
16
14
|
function createServer() {
|
|
@@ -39,24 +37,14 @@ function createServer() {
|
|
|
39
37
|
result = await (0, spec_1.toolSpec)(input);
|
|
40
38
|
break;
|
|
41
39
|
}
|
|
42
|
-
case 'nimai_review': {
|
|
43
|
-
const input = contract_1.ForgeReviewInput.parse(args);
|
|
44
|
-
result = await (0, review_1.toolReview)(input);
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
40
|
case 'nimai_validate': {
|
|
48
41
|
const input = contract_1.ForgeValidateInput.parse(args);
|
|
49
42
|
result = await (0, validate_1.toolValidate)(input);
|
|
50
43
|
break;
|
|
51
44
|
}
|
|
52
|
-
case '
|
|
53
|
-
const input = contract_1.
|
|
54
|
-
result = await (0,
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case 'nimai_spec_review': {
|
|
58
|
-
const input = contract_1.ForgeSpecReviewInput.parse(args);
|
|
59
|
-
result = await (0, spec_review_1.toolSpecReview)(input);
|
|
45
|
+
case 'nimai_review': {
|
|
46
|
+
const input = contract_1.ForgeReviewInput.parse(args);
|
|
47
|
+
result = await (0, review_1.toolReview)(input);
|
|
60
48
|
break;
|
|
61
49
|
}
|
|
62
50
|
default:
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAcA,oCA6DC;AAED,kCAIC;AAjFD,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAC5C,yCAAoG;AACpG,uCAAwC;AACxC,+CAAgD;AAChD,2CAA4C;AAE5C,iEAAiE;AACjE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAC1B,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,iCAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,2BAAgB,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACxD,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;oBAClE,GAAG;oBACH,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAG,MAAmC,CAAC,WAAW,IAAI,EAAE,EAAE;iBACxF,CAAC,CACH;gBACD,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC;aACpD;SACF,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,gCAAqB,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QAC9D,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAEjD,IAAI,CAAC;YACH,IAAI,MAAe,CAAC;YAEpB,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,YAAY,CAAC,CAAC,CAAC;oBAClB,MAAM,KAAK,GAAG,yBAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACzC,MAAM,GAAG,MAAM,IAAA,eAAQ,EAAC,KAAK,CAAC,CAAC;oBAC/B,MAAM;gBACR,CAAC;gBACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;oBACtB,MAAM,KAAK,GAAG,6BAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAC7C,MAAM,GAAG,MAAM,IAAA,uBAAY,EAAC,KAAK,CAAC,CAAC;oBACnC,MAAM;gBACR,CAAC;gBACD,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,MAAM,KAAK,GAAG,2BAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAC3C,MAAM,GAAG,MAAM,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;oBACjC,MAAM;gBACR,CAAC;gBACD;oBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAW,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC9E,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,WAAW;IAC/B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,UAAU,CAC9B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GACtC,OAAO,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,UAAU,CAC9B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GACtC,OAAO,CAAC,iBAAiB,CAAC,CAgB5B"}
|
package/dist/tools/review.js
CHANGED
|
@@ -46,10 +46,9 @@ async function toolReview(input) {
|
|
|
46
46
|
catch (err) {
|
|
47
47
|
throw new Error(`Cannot read spec at "${specPath}": ${err.message}`);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return { reviewerPrompt: (0, nimai_core_1.buildPrompt2)(specContent) };
|
|
49
|
+
const reviewerPrompt = input.target === 'spec'
|
|
50
|
+
? (0, nimai_core_1.buildPrompt15)(specContent)
|
|
51
|
+
: (0, nimai_core_1.buildPrompt2)(specContent);
|
|
52
|
+
return { reviewerPrompt };
|
|
54
53
|
}
|
|
55
54
|
//# sourceMappingURL=review.js.map
|
package/dist/tools/review.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,gCAkBC;AAxBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAyD;AAIlD,KAAK,UAAU,UAAU,CAC9B,KAAuC;IAEvC,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,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,MAAO,GAA6B,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,KAAK,MAAM;QAC5C,CAAC,CAAC,IAAA,0BAAa,EAAC,WAAW,CAAC;QAC5B,CAAC,CAAC,IAAA,yBAAY,EAAC,WAAW,CAAC,CAAC;IAE9B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/tools/spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,eAAe,CAAC,CAY1B"}
|
package/dist/tools/spec.js
CHANGED
|
@@ -42,17 +42,9 @@ async function toolSpec(input) {
|
|
|
42
42
|
if (!fs.existsSync(repoPath)) {
|
|
43
43
|
throw new Error(`repoPath does not exist: ${repoPath}`);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const prompt = (0, nimai_core_1.buildPrompt1)(input.request, contextSummary);
|
|
50
|
-
const existingSpecs = (0, nimai_core_1.findNimaiSpecs)(repoPath).map(s => s.filePath);
|
|
51
|
-
const result = { prompt, context, existing_specs: existingSpecs };
|
|
52
|
-
const clarification = (0, nimai_core_1.detectClarifications)(input.request, context.length);
|
|
53
|
-
if (clarification.needed) {
|
|
54
|
-
result.clarifications_needed = clarification.questions;
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
45
|
+
const liteTemplate = (0, nimai_core_1.loadTierTemplate)('lite');
|
|
46
|
+
const fullTemplate = (0, nimai_core_1.loadTierTemplate)('full');
|
|
47
|
+
const protocolPrompt = (0, nimai_core_1.buildSpecProtocol)(input.request, repoPath, liteTemplate, fullTemplate);
|
|
48
|
+
return { protocolPrompt };
|
|
57
49
|
}
|
|
58
50
|
//# sourceMappingURL=spec.js.map
|
package/dist/tools/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4BAcC;AApBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAiE;AAI1D,KAAK,UAAU,QAAQ,CAC5B,KAAqC;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,6BAAgB,EAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,IAAA,6BAAgB,EAAC,MAAM,CAAC,CAAC;IAE9C,MAAM,cAAc,GAAG,IAAA,8BAAiB,EAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IAE9F,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nimai-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Nimai MCP server — exposes nimai_spec, nimai_review, nimai_validate, nimai_new, nimai_spec_review 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.
|
|
39
|
+
"nimai-core": "0.5.1"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsc",
|
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
# FORGE Spec Template
|
|
2
|
-
> **You are here:** This is the Spec Template — the execution tool. Use it to turn a project direction into a complete agent-ready brief.
|
|
3
|
-
>
|
|
4
|
-
> **The other docs in this system:**
|
|
5
|
-
> - **Quick Reference** (`FORGE-quickref.md`) — start here if you don't have a project direction yet. If the request is a new idea or open-ended, go to the Quick Reference and run the Divergence → Convergence Loop or the Self-Spec Agent first. Come back here once you have a chosen direction.
|
|
6
|
-
> - **Canonical Framework** (`FORGE-canonical.md`) — go there if you encounter a concept in this template you don't fully understand. Each section maps to a section in the canonical doc.
|
|
7
|
-
>
|
|
8
|
-
> **When to be in this doc:** You have a specific project or direction. You are ready to define it completely before handing it to an agent. If you can't fill in a field, that is an unresolved decision — resolve it here, not mid-run.
|
|
9
|
-
>
|
|
10
|
-
> **Solo operator shortcut:** Instead of filling this manually, use the Self-Spec Agent prompt in the Quick Reference to generate a draft, then review and approve it here.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
> Fill in every field before handing to an agent. A blank field is an unresolved decision — resolve it here, not mid-run.
|
|
15
|
-
> *Based on the FORGE*
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 0. Pre-Flight Decisions
|
|
20
|
-
> These must be set first. Everything else is built on top of them.
|
|
21
|
-
|
|
22
|
-
**Risk Tier:** [ ] Low [ ] Medium [ ] High
|
|
23
|
-
*(If unsure, go one tier higher)*
|
|
24
|
-
|
|
25
|
-
**Primary Cognitive Mode for this project:**
|
|
26
|
-
[ ] Deterministic [ ] Exploratory [ ] Adversarial [ ] Synthesis [ ] Audit
|
|
27
|
-
[ ] Multi-phase — using Divergence → Convergence Loop (see Section 6)
|
|
28
|
-
*→ Unsure which mode? See Cognitive Mode table in Quick Reference or Canonical doc.*
|
|
29
|
-
|
|
30
|
-
**Resource Governance:**
|
|
31
|
-
- Model tier (Planner): `_______________`
|
|
32
|
-
- Model tier (Workers): `_______________`
|
|
33
|
-
- Max runtime per sub-task: `_______________`
|
|
34
|
-
- Total compute / cost budget: `_______________`
|
|
35
|
-
- Retry limit before escalation: `_______________`
|
|
36
|
-
- Cost threshold that triggers stop-and-report: `_______________`
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 1. Specification Layer — The Blueprint
|
|
41
|
-
|
|
42
|
-
### 1.1 Final Deliverable
|
|
43
|
-
*Describe precisely. Not "a good analysis" — describe the exact artifact, format, and measurable quality.*
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
Deliverable: _______________________________________________
|
|
47
|
-
|
|
48
|
-
Format: ___________________________________________________
|
|
49
|
-
|
|
50
|
-
Length / Size: _____________________________________________
|
|
51
|
-
|
|
52
|
-
Measurable quality bar: ____________________________________
|
|
53
|
-
|
|
54
|
-
Benchmark dataset (if quality bar requires measurement):
|
|
55
|
-
path: _______________ (e.g. tests/fixtures/receipts/ or N/A)
|
|
56
|
-
schema: _____________ (field names and types of each labeled example, or N/A)
|
|
57
|
-
threshold computation rule: ___ (e.g. "pass rate = correct / total labeled examples", or N/A)
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### 1.2 Scope Boundaries
|
|
61
|
-
*Be explicit. Ambiguity here becomes scope creep mid-run.*
|
|
62
|
-
|
|
63
|
-
**In scope:**
|
|
64
|
-
- `_______________`
|
|
65
|
-
- `_______________`
|
|
66
|
-
- `_______________`
|
|
67
|
-
|
|
68
|
-
**Out of scope (Must-Not):**
|
|
69
|
-
- `_______________`
|
|
70
|
-
- `_______________`
|
|
71
|
-
- `_______________`
|
|
72
|
-
|
|
73
|
-
### 1.3 Task Decomposition
|
|
74
|
-
*Break the project into sub-tasks. Each must satisfy the 5 Primitives and complete in under 2 hours.*
|
|
75
|
-
*→ Need a reminder of the 5 Primitives? See Quick Reference or Canonical doc Section "5 Primitives."*
|
|
76
|
-
|
|
77
|
-
| # | Sub-task | Cognitive Mode | Risk Tier | Acceptance Criteria | Eval Method |
|
|
78
|
-
|---|---|---|---|---|---|
|
|
79
|
-
| 1 | | | | | |
|
|
80
|
-
| 2 | | | | | |
|
|
81
|
-
| 3 | | | | | |
|
|
82
|
-
| 4 | | | | | |
|
|
83
|
-
| 5 | | | | | |
|
|
84
|
-
|
|
85
|
-
*Add rows as needed. Every sub-task needs all five columns filled.*
|
|
86
|
-
|
|
87
|
-
*Note: Sub-task risk tiers may differ from the overall project tier. A research sub-task and a production deployment sub-task in the same project have different risk profiles — assign each independently. The project-level tier sets the floor for escalation; sub-task tiers govern validation routing.*
|
|
88
|
-
|
|
89
|
-
### 1.4 Acceptance Criteria — Master Definition of Done
|
|
90
|
-
*Binary. Measurable. No subjective criteria.*
|
|
91
|
-
|
|
92
|
-
The project is complete when ALL of the following are true:
|
|
93
|
-
- [ ] `_______________`
|
|
94
|
-
- [ ] `_______________`
|
|
95
|
-
- [ ] `_______________`
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## 1.5 Mechanism Decision
|
|
100
|
-
*One block per core architectural or algorithmic choice. If no core mechanism applies, write "N/A" and justify.*
|
|
101
|
-
*A builder must be able to start coding without choosing missing architecture. If any mechanism is undecided, resolve it here first.*
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
**Decision: [short name, e.g., "Primary parsing method"]**
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
Chosen approach: _______________________________________________
|
|
109
|
-
|
|
110
|
-
Rejected alternatives: _________________________________________
|
|
111
|
-
|
|
112
|
-
Why rejected: __________________________________________________
|
|
113
|
-
|
|
114
|
-
Impact on ACs: _________________________________________________
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## 1.6 Architecture Lock
|
|
120
|
-
*Required for medium/high coding specs. Advisory for low/unknown/non-coding specs.*
|
|
121
|
-
*All fields must be resolved before builder handoff. Blank placeholders and "TBD" are unresolved.*
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
Persistence layer: _______________________________________________
|
|
125
|
-
|
|
126
|
-
File/object storage: _____________________________________________
|
|
127
|
-
|
|
128
|
-
External model/service + env var: ________________________________
|
|
129
|
-
|
|
130
|
-
API trigger flow: ________________________________________________
|
|
131
|
-
|
|
132
|
-
Entity status state machine: _____________________________________
|
|
133
|
-
|
|
134
|
-
Auth implementation: _____________________________________________
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## 2. Intent Layer — The Compass
|
|
140
|
-
|
|
141
|
-
### 2.1 Agent Deployment Purpose
|
|
142
|
-
*Tell the agent what it is, what it is not, and who consumes its output. One clear paragraph.*
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
You are: ___________________________________________________
|
|
146
|
-
|
|
147
|
-
You are NOT responsible for: _______________________________
|
|
148
|
-
|
|
149
|
-
Your output is consumed by: ________________________________
|
|
150
|
-
(human decision-maker / another agent / automated pipeline)
|
|
151
|
-
|
|
152
|
-
Your output feeds into: ____________________________________
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### 2.2 Trade-off Hierarchy
|
|
156
|
-
*Rank these in order of priority. The agent will use this when it hits a fork.*
|
|
157
|
-
|
|
158
|
-
Rank the following from 1 (highest) to n (lowest) for this task:
|
|
159
|
-
|
|
160
|
-
| Priority | Value |
|
|
161
|
-
|---|---|
|
|
162
|
-
| `___` | Accuracy / Correctness |
|
|
163
|
-
| `___` | Speed / Efficiency |
|
|
164
|
-
| `___` | Cost / Token economy |
|
|
165
|
-
| `___` | Safety / Risk avoidance |
|
|
166
|
-
| `___` | Novelty / Creativity |
|
|
167
|
-
| `___` | Completeness |
|
|
168
|
-
| `___` | Simplicity / Readability |
|
|
169
|
-
| `___` | *(add domain-specific value)* |
|
|
170
|
-
|
|
171
|
-
### 2.3 Constraint Architecture
|
|
172
|
-
|
|
173
|
-
**Must (non-negotiable requirements):**
|
|
174
|
-
- `_______________`
|
|
175
|
-
- `_______________`
|
|
176
|
-
|
|
177
|
-
**Must-Not (hard prohibitions):**
|
|
178
|
-
- `_______________`
|
|
179
|
-
- `_______________`
|
|
180
|
-
|
|
181
|
-
**Prefer (soft preferences when trade-offs arise):**
|
|
182
|
-
- `_______________`
|
|
183
|
-
- `_______________`
|
|
184
|
-
|
|
185
|
-
**Escalate (stop and surface to human when):**
|
|
186
|
-
- `_______________`
|
|
187
|
-
- `_______________`
|
|
188
|
-
|
|
189
|
-
### 2.4 Forbidden Approaches
|
|
190
|
-
*Specific methods, tools, frameworks, or reasoning patterns to avoid.*
|
|
191
|
-
|
|
192
|
-
- `_______________`
|
|
193
|
-
- `_______________`
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## 3. Context Layer — The Environment
|
|
198
|
-
|
|
199
|
-
### 3.1 Provided Context
|
|
200
|
-
*List all documents, artifacts, or data sources being provided. Mark each as AUTHORITATIVE or REFERENCE.*
|
|
201
|
-
|
|
202
|
-
| Source | Type | Authority Level | Notes |
|
|
203
|
-
|---|---|---|---|
|
|
204
|
-
| | | AUTHORITATIVE / REFERENCE | |
|
|
205
|
-
| | | AUTHORITATIVE / REFERENCE | |
|
|
206
|
-
| | | AUTHORITATIVE / REFERENCE | |
|
|
207
|
-
|
|
208
|
-
### 3.2 Known State
|
|
209
|
-
*What has already been tried? What failed? What is known?*
|
|
210
|
-
|
|
211
|
-
```
|
|
212
|
-
Prior attempts: ____________________________________________
|
|
213
|
-
|
|
214
|
-
Known failures / dead ends: ________________________________
|
|
215
|
-
|
|
216
|
-
Known constraints: _________________________________________
|
|
217
|
-
|
|
218
|
-
Current blockers: __________________________________________
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### 3.3 Context Freshness
|
|
222
|
-
*Tell the agent when to trust the provided context vs. when to re-fetch or verify.*
|
|
223
|
-
|
|
224
|
-
[ ] All provided context is current — use as ground truth
|
|
225
|
-
[ ] The following sources may be stale and should be verified: `_______________`
|
|
226
|
-
[ ] The agent must re-fetch live data for: `_______________`
|
|
227
|
-
[ ] MCP connections available: `_______________`
|
|
228
|
-
|
|
229
|
-
### 3.4 Domain Conventions
|
|
230
|
-
*Terminology, style, standards, or norms the agent must match.*
|
|
231
|
-
|
|
232
|
-
```
|
|
233
|
-
Terminology to use: ________________________________________
|
|
234
|
-
|
|
235
|
-
Terminology to avoid: ______________________________________
|
|
236
|
-
|
|
237
|
-
Style / format standards: __________________________________
|
|
238
|
-
|
|
239
|
-
Domain-specific conventions: _______________________________
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## 4. Prompt Layer — The Trigger
|
|
245
|
-
|
|
246
|
-
### 4.1 Opening System Instruction
|
|
247
|
-
*The master instruction that frames the entire run. Reference Sections 1–3 explicitly.*
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
You are [deployment purpose from 2.1].
|
|
251
|
-
|
|
252
|
-
Your task is to produce [deliverable from 1.1].
|
|
253
|
-
|
|
254
|
-
You are operating within the following constraints: [from 2.3].
|
|
255
|
-
|
|
256
|
-
Your trade-off priority order is: [from 2.2].
|
|
257
|
-
|
|
258
|
-
The context you have been provided is: [from 3.1].
|
|
259
|
-
|
|
260
|
-
You will complete this task by executing the following sub-tasks in order: [from 1.3].
|
|
261
|
-
|
|
262
|
-
For each sub-task, your completion criterion is: [from 1.4].
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### 4.2 Per-Sub-Task Prompt Template
|
|
266
|
-
*Use this template for each sub-task trigger.*
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
Sub-task [#]: [name]
|
|
270
|
-
Cognitive mode: [mode]
|
|
271
|
-
Your input: [what you're working from]
|
|
272
|
-
Your output: [exact format and content required]
|
|
273
|
-
Acceptance criteria: [binary criteria from 1.3]
|
|
274
|
-
Evaluation: [how this will be checked]
|
|
275
|
-
Resource cap: [max runtime / tokens for this sub-task]
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## 5. Governance & Validation
|
|
281
|
-
|
|
282
|
-
### 5.1 Escalation Contract
|
|
283
|
-
|
|
284
|
-
**Escalation triggers** *(from 2.3 — repeated here for executor clarity)*:
|
|
285
|
-
- `_______________`
|
|
286
|
-
- `_______________`
|
|
287
|
-
|
|
288
|
-
**Who reviews escalations:**
|
|
289
|
-
```
|
|
290
|
-
Name / Role: _______________________________________________
|
|
291
|
-
Contact: __________________________________________________
|
|
292
|
-
Response SLA: ______________________________________________
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**If no response arrives within SLA, the agent should:**
|
|
296
|
-
[ ] Hold and wait
|
|
297
|
-
[ ] Attempt alternative path: `_______________`
|
|
298
|
-
[ ] Abort and report
|
|
299
|
-
|
|
300
|
-
### 5.2 Adversarial Reflection Trigger
|
|
301
|
-
*(Required for Medium and High risk tasks)*
|
|
302
|
-
|
|
303
|
-
[ ] Not required (Low risk)
|
|
304
|
-
[ ] Required after sub-task(s): `_______________`
|
|
305
|
-
[ ] Required before final delivery
|
|
306
|
-
|
|
307
|
-
The agent should critique: `_______________`
|
|
308
|
-
The revision threshold is: `_______________` *(what level of critique warrants a revision?)*
|
|
309
|
-
|
|
310
|
-
### 5.3 Uncertainty Reporting
|
|
311
|
-
*(Required for non-deterministic domains)*
|
|
312
|
-
|
|
313
|
-
[ ] Not required
|
|
314
|
-
[ ] Required — agent must report:
|
|
315
|
-
- Confidence estimate (0–100%) with justification
|
|
316
|
-
- Primary uncertainty drivers
|
|
317
|
-
- What data would most reduce uncertainty
|
|
318
|
-
- Alternative plausible interpretations
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## 6. Brainstorming Mode (Divergence → Convergence)
|
|
323
|
-
*Complete this section only if primary mode is multi-phase brainstorming.*
|
|
324
|
-
|
|
325
|
-
**Phase 1 — DIVERGE (Exploratory Mode)**
|
|
326
|
-
```
|
|
327
|
-
Generate: _________________________________________________
|
|
328
|
-
Constraint: No filtering or judgment at this stage.
|
|
329
|
-
Output format: ____________________________________________
|
|
330
|
-
Volume target: ____________________________________________
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
**Phase 2 — CLUSTER (Synthesis Mode)**
|
|
334
|
-
```
|
|
335
|
-
Organize the output of Phase 1 by: ________________________
|
|
336
|
-
Identify: _________________________________________________
|
|
337
|
-
Output format: ____________________________________________
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**Phase 3 — STRESS-TEST (Adversarial Mode)**
|
|
341
|
-
```
|
|
342
|
-
Attack the top [n] candidates from Phase 2.
|
|
343
|
-
Criteria to stress-test against: __________________________
|
|
344
|
-
Output format: ____________________________________________
|
|
345
|
-
What constitutes a fatal flaw: ____________________________
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
**Phase 4 — FORMALIZE (Deterministic Mode)**
|
|
349
|
-
```
|
|
350
|
-
Selected direction: ______________________________________
|
|
351
|
-
Formalize as: ____________________________________________
|
|
352
|
-
Acceptance criteria: _____________________________________
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## 7. Domain-Specific Additions
|
|
358
|
-
|
|
359
|
-
### If Coding:
|
|
360
|
-
- Language / framework / version: `_______________`
|
|
361
|
-
- Performance targets: `_______________`
|
|
362
|
-
- API / interface contracts: `_______________`
|
|
363
|
-
- Security requirements: `_______________`
|
|
364
|
-
- Test coverage expectation: `_______________`
|
|
365
|
-
|
|
366
|
-
### If Science / Research:
|
|
367
|
-
- Null hypothesis: `_______________`
|
|
368
|
-
- Falsification criteria: `_______________`
|
|
369
|
-
- Authorized data sources: `_______________`
|
|
370
|
-
- Forbidden data sources: `_______________`
|
|
371
|
-
- Statistical significance threshold: `_______________`
|
|
372
|
-
- Correction method: `_______________`
|
|
373
|
-
- Reproducibility requirements: `_______________`
|
|
374
|
-
|
|
375
|
-
### If Writing / Content:
|
|
376
|
-
- Audience: `_______________`
|
|
377
|
-
- Purpose: `_______________`
|
|
378
|
-
- Structure: `_______________`
|
|
379
|
-
- Word count / length: `_______________`
|
|
380
|
-
- Style reference: `_______________`
|
|
381
|
-
- Mandatory inclusions: `_______________`
|
|
382
|
-
- Mandatory exclusions: `_______________`
|
|
383
|
-
|
|
384
|
-
### If Business / Strategy:
|
|
385
|
-
- Decision-maker: `_______________`
|
|
386
|
-
- Decision to be made: `_______________`
|
|
387
|
-
- Options to evaluate: `_______________`
|
|
388
|
-
- Recommendation format: `_______________`
|
|
389
|
-
- Regulatory Must-Nots: `_______________`
|
|
390
|
-
- Stakeholder sensitivities: `_______________`
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
## 8. Spec Validation (Red-Team Checklist)
|
|
395
|
-
*Complete before handing to the agent. Every unchecked box is a known risk.*
|
|
396
|
-
|
|
397
|
-
**5 Primitives — does every sub-task have:**
|
|
398
|
-
- [ ] A self-contained problem statement (zero questions needed to start)
|
|
399
|
-
- [ ] A Constraint Architecture (Must / Must-Not / Prefer / Escalate)
|
|
400
|
-
- [ ] A runtime under 2 hours
|
|
401
|
-
- [ ] Binary acceptance criteria
|
|
402
|
-
- [ ] A built-in evaluation method
|
|
403
|
-
|
|
404
|
-
**Failure Mode Taxonomy — does this spec prevent:**
|
|
405
|
-
- [ ] Scope Creep — explicit Must-Not list and scope boundaries
|
|
406
|
-
- [ ] Hallucinated Completion — binary acceptance criteria defined
|
|
407
|
-
- [ ] Intent Drift — ranked trade-offs and deployment purpose explicit
|
|
408
|
-
- [ ] Context Collapse — context curated; noise removed
|
|
409
|
-
- [ ] Runaway Cost — resource caps set before decomposition
|
|
410
|
-
- [ ] Overconfident Output — uncertainty reporting required (if applicable)
|
|
411
|
-
|
|
412
|
-
**Final gate:**
|
|
413
|
-
- [ ] Risk tier and resource governance set *before* decomposition
|
|
414
|
-
- [ ] Every agent has a deployment purpose statement
|
|
415
|
-
- [ ] Escalation contract complete (who, when, SLA, no-response behavior)
|
|
416
|
-
- [ ] Planner execution plan will be saved as artifact
|
|
417
|
-
|
|
418
|
-
---
|
|
419
|
-
|
|
420
|
-
## 8.5 Edge Cases and Failure Modes
|
|
421
|
-
> Required for medium/high risk specs. Red-team the spec before builder handoff.
|
|
422
|
-
> For each scenario, document what the spec says the builder must do. A blank list is a hard stop.
|
|
423
|
-
|
|
424
|
-
**FORGE failure mode coverage:**
|
|
425
|
-
- Scope Creep — which Must-Not explicitly prevents it: `_______________`
|
|
426
|
-
- Hallucinated Completion — which AC is hardest to fake: `_______________`
|
|
427
|
-
- Intent Drift — which decision will the builder most likely get wrong: `_______________`
|
|
428
|
-
- Context Collapse — what context is load-bearing and must not be dropped: `_______________`
|
|
429
|
-
- Runaway Cost — what resource cap prevents unbounded execution: `_______________`
|
|
430
|
-
- Overconfident Output — what requires uncertainty reporting: `_______________`
|
|
431
|
-
|
|
432
|
-
**Domain-specific edge cases:**
|
|
433
|
-
- `_______________`
|
|
434
|
-
- `_______________`
|
|
435
|
-
|
|
436
|
-
---
|
|
437
|
-
|
|
438
|
-
## 9. Spec Convergence
|
|
439
|
-
> Fill before handing to a builder. A non-zero count or "no" is a hard stop.
|
|
440
|
-
> Every [NEEDS HUMAN INPUT] flag from spec drafting must be resolved before this section is filled.
|
|
441
|
-
|
|
442
|
-
```
|
|
443
|
-
open_questions: 0
|
|
444
|
-
ambiguities_remaining: 0
|
|
445
|
-
ready_for_build: yes
|
|
446
|
-
convergence_notes: _______________________________________________
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
---
|
|
450
|
-
|
|
451
|
-
*FORGE Spec Template v1.0 — companion to the FORGE system. A blank field is an unresolved decision.*
|
|
452
|
-
*System docs: Quick Reference · Canonical Framework · Spec Template (this doc)*
|
|
453
|
-
|
|
454
|
-
<!-- nimai-spec -->
|
package/dist/tools/new.d.ts
DELETED
package/dist/tools/new.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/tools/new.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,OAAO,CAC3B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GACnC,OAAO,CAAC,cAAc,CAAC,CAczB"}
|
package/dist/tools/new.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.toolNew = toolNew;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const nimai_core_1 = require("nimai-core");
|
|
40
|
-
const prompts_1 = require("../prompts");
|
|
41
|
-
async function toolNew(input) {
|
|
42
|
-
const templatePath = path.join(prompts_1.FORGE_ROOT, 'FORGE-spec-template.md');
|
|
43
|
-
const template = (0, nimai_core_1.loadTemplate)(templatePath);
|
|
44
|
-
const outputPath = path.resolve(input.outputPath);
|
|
45
|
-
const dir = path.dirname(outputPath);
|
|
46
|
-
if (!fs.existsSync(dir)) {
|
|
47
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
const date = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
|
|
50
|
-
const content = template.raw.replace('<!-- nimai-spec -->', `<!-- nimai-spec: ${date} -->`);
|
|
51
|
-
fs.writeFileSync(outputPath, content, 'utf-8');
|
|
52
|
-
return { path: outputPath, content };
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=new.js.map
|
package/dist/tools/new.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/tools/new.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,0BAgBC;AAvBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA0C;AAE1C,wCAAwC;AAGjC,KAAK,UAAU,OAAO,CAC3B,KAAoC;IAEpC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAU,EAAE,wBAAwB,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,IAAA,yBAAY,EAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAElD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa;IACjE,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,oBAAoB,IAAI,MAAM,CAAC,CAAC;IAC5F,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,CA2BhC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.toolSpecReview = toolSpecReview;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const nimai_core_1 = require("nimai-core");
|
|
40
|
-
async function toolSpecReview(input) {
|
|
41
|
-
const specPath = path.resolve(input.specPath);
|
|
42
|
-
let specContent;
|
|
43
|
-
try {
|
|
44
|
-
specContent = fs.readFileSync(specPath, 'utf-8');
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
throw new Error(`Cannot read spec at "${specPath}": ${err.message}`);
|
|
48
|
-
}
|
|
49
|
-
const specReviewerPrompt = (0, nimai_core_1.buildPrompt15)(specContent);
|
|
50
|
-
const reviewer_instructions = `Open a fresh reviewer session with nimai-mcp configured.\n\n` +
|
|
51
|
-
`Give it this instruction:\n\n` +
|
|
52
|
-
`---\n\n` +
|
|
53
|
-
`Please call nimai_spec_review({ specPath: '${specPath}' }) and evaluate the result.\n\n` +
|
|
54
|
-
`For first review: evaluate directly from the current prompt output.\n` +
|
|
55
|
-
`For re-review after builder fixes: evaluate fresh from the current prompt output only; do not reuse your previous evaluation context.\n\n` +
|
|
56
|
-
`The spec content is already embedded in the returned specReviewerPrompt — use that prompt to evaluate the spec. Do not read the spec file separately.\n\n` +
|
|
57
|
-
`Return a verdict JSON block at the end of your response:\n` +
|
|
58
|
-
`{"passed": true/false, "schema_version": "2", "issues": [...]}\n\n` +
|
|
59
|
-
`---\n\n` +
|
|
60
|
-
`If the reviewer session does not have nimai-mcp available, paste the following prompt directly:\n\n\`\`\`\n${specReviewerPrompt}\n\`\`\``;
|
|
61
|
-
return { specReviewerPrompt, reviewer_instructions };
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=spec-review.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCA6BC;AAnCD,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,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,MAAO,GAA6B,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAC;IAEtD,MAAM,qBAAqB,GACzB,8DAA8D;QAC9D,+BAA+B;QAC/B,SAAS;QACT,8CAA8C,QAAQ,mCAAmC;QACzF,uEAAuE;QACvE,2IAA2I;QAC3I,2JAA2J;QAC3J,4DAA4D;QAC5D,oEAAoE;QACpE,SAAS;QACT,8GAA8G,kBAAkB,UAAU,CAAC;IAE7I,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AACvD,CAAC"}
|