nimai-core 0.4.8 → 0.5.0

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/dist/prompts.js CHANGED
@@ -1,54 +1,98 @@
1
1
  "use strict";
2
2
  /**
3
- * FORGE prompt builders — pure string functions, no IO, no LLM calls.
4
- * These live in @nimai/core so any package can import them without
5
- * depending on @nimai/mcp internals.
3
+ * Nimai prompt builders — pure string functions, no IO, no LLM calls.
4
+ * These live in nimai-core so any package can import them without
5
+ * depending on nimai-mcp internals.
6
+ *
7
+ * Template texts are passed in by callers (MCP server, CLI spec command)
8
+ * which load them via template.ts. prompts.ts stays pure (no fs/IO).
6
9
  */
7
10
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.buildPrompt1 = buildPrompt1;
11
+ exports.buildSpecProtocol = buildSpecProtocol;
9
12
  exports.buildPrompt15 = buildPrompt15;
10
13
  exports.buildPrompt2 = buildPrompt2;
11
14
  /**
12
- * FORGE Prompt 1Self-Spec Agent (from FORGE-quickref.md).
13
- * Returns the populated prompt ready to hand to a host model.
15
+ * Nimai Spec ProtocolPHASE 1 through PHASE 4.
16
+ * Returns the protocol prompt the host model runs to turn a loose request
17
+ * into a graded, build-ready spec.
18
+ *
19
+ * Callers load liteTemplate and fullTemplate via loadTierTemplate() from template.ts
20
+ * and pass them here. The [EMBED] placeholder is replaced with both template texts.
21
+ *
22
+ * Signature: buildSpecProtocol(request, repoPath, liteTemplate, fullTemplate)
14
23
  */
15
- function buildPrompt1(request, contextSummary) {
16
- return `You are a Specification Engineering agent operating under the FORGE.
17
-
18
- **What you are:** A spec drafter. Your sole output is a complete FORGE spec document.
19
- **What you are not:** An implementation agent. Do not write code, choose final tech stack, or execute the request.
20
- **Who consumes your output:** An implementation agent that will build from this spec without asking clarifying questions. Every unresolved decision you leave will become an invention by that agent — two builders given the same spec must produce compatible systems.
21
-
22
- Your job is to take the loose request below and generate a complete draft spec
23
- using the framework's structure. Do not execute the request — only spec it.
24
-
25
- **On architecture:** Do not invent architecture beyond what the repo context below reveals. If an architectural decision is required but cannot be answered from the provided context, mark it \`[NEEDS HUMAN INPUT: reason]\`. For greenfield repos with no prior context, state explicit MVP-level assumptions and document them as assumptions — do not present them as facts.
26
-
27
- **If you have RepoPrompt available:** Before filling the spec, call RepoPrompt's discovery or read tool on the repo to get full architectural context (existing schemas, data models, tech stack, patterns). Use the output to populate Section 3 (Context Layer) accurately and to inform Section 1.6 (Architecture Lock) with real decisions rather than assumptions.
28
-
29
- For each section, fill in what you can infer and mark anything uncertain
30
- with [NEEDS HUMAN INPUT: reason].
31
-
32
- Generate:
33
- 1. Final deliverable (precise, format, measurable quality bar)
34
- 2. Scope boundaries (in / out)
35
- 3. Agent deployment purpose (what it is, is not, who consumes output)
36
- 4. Trade-off hierarchy (ranked: accuracy / speed / cost / safety / other)
37
- 5. Constraint architecture (Must / Must-Not / Prefer / Escalate)
38
- 6. Task decomposition (sub-tasks under 2 hours, with acceptance criteria)
39
- 7. Risk tier (Low / Medium / High with reasoning)
40
- 8. Cognitive mode per sub-task
41
- 9. Context needed (what the executing agent requires)
42
- 10. Proposed validator prompt (what a reviewer should check)
43
-
44
- --- REPO CONTEXT ---
45
- ${contextSummary || '(no repo context extracted — if you have RepoPrompt, call it now before filling the spec)'}
46
- --- END CONTEXT ---
47
-
48
- Loose request: ${request}`;
24
+ function buildSpecProtocol(request, repoPath, liteTemplate, fullTemplate) {
25
+ const embedBlock = `--- LITE TIER TEMPLATE ---\n${liteTemplate}\n--- FULL TIER TEMPLATE ---\n${fullTemplate}`;
26
+ return `You are running the Nimai spec protocol. Your job is to turn the request
27
+ below into a graded, build-ready spec. You are drafting a contract, not
28
+ implementing it write no application code during this protocol.
29
+
30
+ Request: ${request}
31
+ Repository: ${repoPath}
32
+
33
+ Run the four phases in order. Do not skip a phase; say which phase you
34
+ are in as you work.
35
+
36
+ PHASE 1 EXPLORE
37
+ Use your own tools to learn the ground truth before asking the user
38
+ anything:
39
+ - Read the manifest and build files (package.json or equivalent) for
40
+ stack, dependencies, and scripts.
41
+ - Read the README and any schema, model, or type definition files.
42
+ - Search the code for anything related to the request.
43
+ - Look for existing specs (files ending with a nimai-spec marker
44
+ comment) they show conventions already in force.
45
+ If the repository is empty or this is a new project, note "greenfield"
46
+ and move on. Ask the user nothing during this phase.
47
+
48
+ PHASE 2 INTERVIEW
49
+ Write 5–8 clarifying questions SPECIFIC to this request and this
50
+ repository — never generic ones. Good questions force a decision the
51
+ user does not realize they have not made:
52
+ - Who uses this, and what do they see first?
53
+ - When [specific failure you can foresee] happens, what is the right
54
+ behavior?
55
+ - The request could mean [interpretation A] or [interpretation B] —
56
+ which one?
57
+ - What is explicitly NOT part of this?
58
+ - How will you know it works — what would you check by hand?
59
+ Skip any question the request already answers. Ask all questions in one
60
+ message and wait for the answers.
61
+
62
+ Then choose the tier and tell the user which and why:
63
+ - lite — small or low-risk work; the one-page spec.
64
+ - full — work that is medium/high risk, touches existing code, or has
65
+ architectural consequences; adds decomposition, architecture lock,
66
+ change surface, and edge cases.
67
+ When unsure, choose full.
68
+
69
+ PHASE 3 — DRAFT
70
+ Fill the tier template below completely. Rules:
71
+ - Every Mechanism Decision commits to exactly ONE approach. If you
72
+ cannot decide from the interview answers, ask — do not assume.
73
+ - Acceptance criteria are binary and left unchecked.
74
+ - full tier in an existing repository: the Change Surface table lists
75
+ every file the work touches; the builder may not go outside it.
76
+ - No placeholder text or blank required fields may remain.
77
+ Save the spec to specs/<short-name>.md with the tier marker as the
78
+ final line of the file.
79
+
80
+ PHASE 4 — GATE
81
+ 1. Run nimai_validate on the spec (CLI: nimai validate <path>). Fix
82
+ structural issues and re-run until it passes.
83
+ 2. Run nimai_review with target "spec" (CLI: nimai review <path>
84
+ --target spec). Hand the returned reviewer prompt to a FRESH agent
85
+ session — not this one. The drafter must not grade its own draft.
86
+ 3. Read the reviewer's verdict (the last fenced JSON block). If it has
87
+ HARD_FAIL issues: fix the spec, then return to step 1.
88
+ 4. When the verdict passes, tell the user: "purification complete —
89
+ the spec is build-ready", and where it is saved. Your job ends here
90
+ — building is a separate session with a separate agent.
91
+
92
+ ${embedBlock}`;
49
93
  }
50
94
  /**
51
- * FORGE Prompt 1.5 — Spec-Quality Reviewer.
95
+ * Nimai Prompt 1.5 — Spec-Quality Reviewer.
52
96
  * Returns a prompt for a reviewing LLM to evaluate whether a draft spec is
53
97
  * executable by an agent without requiring clarifying questions.
54
98
  *
@@ -62,9 +106,19 @@ Loose request: ${request}`;
62
106
  */
63
107
  function buildPrompt15(specContent) {
64
108
  return `You are the independent reviewer for this draft spec. Evaluate it now.
65
- You are a Specification Quality Reviewer operating under the FORGE framework.
109
+ You are a senior engineer doing a full gap audit operating as a Specification Quality Reviewer under the Nimai framework.
110
+ Be exacting: every gap you catch now is one the builder never hits.
111
+ Be strict about the spec and kind to its author — report impurities as findings, not judgments.
112
+
113
+ Your primary mission: find every gap, ambiguity, and implementation blocker in this spec.
114
+ Steelman the spec as the builder who will implement it: what will you hit mid-execution that the spec does not answer?
115
+ What assumptions are baked in but undeclared? What would make two competent builders produce incompatible systems?
116
+
117
+ The 10 dimensions below are your **minimum checklist** — you MUST cover all of them, but do not stop there.
118
+ After checking all 10 dimensions, run a full gap audit for any issues not already caught by the named dimensions.
119
+
120
+ **Evidence requirement:** Every FAIL issue MUST include an exact quoted snippet from the spec (verbatim inline code or blockquote) that demonstrates the problem. An assertion without a quoted evidence snippet is invalid — do not issue a FAIL without one.
66
121
 
67
- Your job is to evaluate the draft spec below for **spec quality only** — not implementation correctness.
68
122
  Do NOT assess any code, code diffs, or implementation output.
69
123
 
70
124
  ## What to check
@@ -74,16 +128,16 @@ A verdict without citation is treated as NO_GO — do not assert PASS without ev
74
128
 
75
129
  **Dimensions:**
76
130
 
77
- 1. **Binary acceptance criteria** — are all sub-task ACs measurable and unambiguous? Are any ACs pre-checked (- [x]) in the draft, which is always invalid? If Section 1.1 defines a quantitative quality bar, Section 1.4 must include at least one AC that directly enforces that bar (same metric family and threshold intent). Otherwise, FAIL.
78
- 2. **Scope coherence** — are in-scope and out-of-scope boundaries clearly stated and non-contradictory? Check for conflicts between conceptual terminology (e.g., state names, entity names used in descriptions) and persisted/modelled representations (e.g., enums, schemas, data shapes). Any mismatch is a HARD_FAIL.
79
- 3. **Constraint sufficiency** — do Must / Must-Not / Prefer / Escalate constraints cover the key risks?
80
- 4. **Decomposition realism** — can each sub-task be completed within the stated 2-hour limit by a skilled agent? Check that sub-task dependencies are stated explicitly (if task B requires task A's output, that must be documented). If Section 1.1 defines a benchmark/dataset path, at least one sub-task must explicitly own creating or curating that benchmark artifact.
131
+ 1. **Binary acceptance criteria** — are all sub-task ACs measurable and unambiguous? Are any ACs pre-checked (- [x]) in the draft, which is always invalid? If the Deliverable section defines a quantitative quality bar, the Acceptance Criteria section must include at least one AC that directly enforces that bar (same metric family and threshold intent). Otherwise, FAIL.
132
+ 2. **Scope coherence** — are in-scope and out-of-scope boundaries in the Scope section clearly stated and non-contradictory? Check for conflicts between conceptual terminology (e.g., state names, entity names used in descriptions) and persisted/modelled representations (e.g., enums, schemas, data shapes). Any mismatch is a HARD_FAIL.
133
+ 3. **Constraint sufficiency** — does the Scope Out-of-scope list cover the key risks? Check that the must-not constraints are explicit and complete enough to prevent the most likely forms of scope creep and builder drift for this specific request.
134
+ 4. **Decomposition realism** — can each sub-task be completed within 2 hours by a skilled agent? Check that sub-task dependencies are stated explicitly (if task B requires task A's output, that must be documented). If the Deliverable section defines a benchmark/dataset path, at least one sub-task must explicitly own creating or curating that benchmark artifact.
81
135
  5. **Start-without-clarification viability** — can an agent begin immediately with the context provided, without asking the human for more information?
82
- 6. **Internal consistency** — are terms, names, and concepts used consistently throughout the spec? Flag any case where the same entity is described differently in different sections (e.g., "webhook event" in scope, "push notification" in ACs — are these the same thing?). Treat data-type/precision mismatches as consistency defects (e.g., float vs decimal/cents representation). Also FAIL if obvious template artifact text remains (example guidance that should have been replaced by project-specific content).
83
- 7. **Mechanism lock** — does every core flow (data pipeline, primary algorithm, key architecture choice) commit to exactly ONE implementation approach? Scan for "e.g.", "or", "could", "might", "such as" in Deliverable, Scope, Constraints, and Task decomposition sections. If any of these offer multiple options without making an explicit decision, that is a HARD_FAIL — a spec that leaves the mechanism unresolved forces the builder to choose architecture, creating drift in multi-builder workflows. Additional lock checks: (a) external service lock requires concrete vendor/model (env var names alone are not sufficient), (b) auth lock requires token/session type plus expiry policy, (c) endpoint lists without request/response field shapes are SOFT_FAIL.
136
+ 6. **Internal consistency** — are terms, names, and concepts used consistently throughout the spec? Flag any case where the same entity is described differently in different sections (e.g., "webhook event" in Scope, "push notification" in Acceptance Criteria — are these the same thing?). Treat data-type/precision mismatches as consistency defects (e.g., float vs decimal/cents representation). Also FAIL if obvious template artifact text remains (example guidance that should have been replaced by project-specific content).
137
+ 7. **Mechanism lock** — does every core flow (data pipeline, primary algorithm, key architecture choice) commit to exactly ONE implementation approach? Scan for "e.g.", "or", "could", "might", "such as" in Deliverable, Scope, Mechanism Decisions, and Task Decomposition sections. If any of these offer multiple options without making an explicit decision, that is a HARD_FAIL — a spec that leaves the mechanism unresolved forces the builder to choose architecture, creating drift in multi-builder workflows. Additional lock checks: (a) external service lock requires concrete vendor/model (env var names alone are not sufficient), (b) auth lock requires token/session type plus expiry policy, (c) endpoint lists without request/response field shapes are SOFT_FAIL. Option-language scan: flag any "could use X or Y", "such as X or Y", or "(e.g., X or Y)" in Mechanism Decisions that does not commit to a single choice. Unresolved-threshold scan: flag any comparison of the form "if X >= threshold" or "score < threshold" where "threshold" is not replaced by a concrete numeric value.
84
138
  8. **Convergence declaration** — does the spec include a \`## Spec Convergence\` section with \`open_questions: 0\` and \`ambiguities_remaining: 0\`? If the section is absent, or either value is non-zero, or \`ready_for_build\` is "no", that is a HARD_FAIL. This is the formal GO gate — a spec with declared open questions is not agent-ready regardless of how well the other sections are written.
85
- 9. **Adversarial gap scan** — does the spec include an \`## Edge Cases and Failure Modes\` section that is substantively filled? Steelman the spec as a builder who will follow it exactly: what will you hit mid-execution that the spec does not answer? What implicit assumption is baked in but undeclared? What failure mode from the FORGE taxonomy (scope creep, hallucinated completion, intent drift, context collapse, runaway cost, overconfident output) does the spec not address? For mobile/capture flows, explicitly check offline/no-network behavior at capture time and retry/sync handling. An absent or blank section is a HARD_FAIL for medium/high risk specs. Placeholder-only content (\`___\`) is treated as absent.
86
- 10. **Architecture completeness** — for medium/high coding specs, does the spec include \`## 1.6 Architecture Lock\` with all required fields resolved: Persistence layer, File/object storage, External model/service + env var, API trigger flow, Entity status state machine, Auth implementation? Any missing field, blank placeholder, or \`TBD\` is a HARD_FAIL. For low/unknown/non-coding specs, this is NOTE-only advisory.
139
+ 9. **Adversarial gap scan** — does the spec include an \`## Edge Cases and Failure Modes\` section that is substantively filled? Steelman the spec as a builder who will follow it exactly: what will you hit mid-execution that the spec does not answer? What implicit assumption is baked in but undeclared? What failure mode from the Nimai taxonomy (scope creep, hallucinated completion, intent drift, context collapse, runaway cost, overconfident output) does the spec not address? For mobile/capture flows, explicitly check offline/no-network behavior at capture time and retry/sync handling. An absent or blank section is a HARD_FAIL for full-tier specs. Placeholder-only content (\`___\`) is treated as absent.
140
+ 10. **Architecture completeness** — for full-tier coding specs, does the spec include \`## Architecture Lock\` with all required fields resolved: Persistence layer, File/object storage, External services + env vars, API/trigger flow, Entity states and transitions, Auth? Any missing field, blank placeholder, or \`TBD\` is a HARD_FAIL. For lite-tier or non-coding specs, this is NOTE-only advisory. Also check the \`## Change Surface\` section for full-tier specs in existing repositories: the table must list every file the work touches; an empty table or missing section for a brownfield spec is a HARD_FAIL. Module-rule contradiction scan: if an Architecture Lock section declares a strict import chain (e.g., A → B → C → D) and a module boundary line says a layer "may call" a target not in its direct successor set, that is a HARD_FAIL.
87
141
 
88
142
  ## Severity classification
89
143
 
@@ -118,7 +172,7 @@ If this is a re-review (you were given the builder's fix summary):
118
172
  - Re-evaluate each previously-failed dimension directly against the current spec content.
119
173
  - Your evidence citation must quote or reference the specific text in the spec that shows the fix was applied.
120
174
  - If the fix is present, mark that dimension PASS. If it is absent or incomplete, mark it FAIL.
121
- - You are only authorized to evaluate the 10 dimensions defined above. Do not invent new dimensions, process gates, or required sections not in the FORGE spec template.
175
+ - You are only authorized to evaluate the 10 dimensions defined above. Do not invent new dimensions, process gates, or required sections not in the Nimai spec template.
122
176
 
123
177
  ## Important
124
178
 
@@ -160,8 +214,9 @@ Write one actionable fix instruction per issue, in order. Each line must include
160
214
  ${specContent}`;
161
215
  }
162
216
  /**
163
- * FORGE Prompt 2 — Reviewer / Validator Prompt Generator (from FORGE-quickref.md).
217
+ * Nimai Prompt 2 — Implementation Reviewer Prompt Generator.
164
218
  * Returns the populated reviewer prompt derived from an approved spec.
219
+ * Used for reviewing an implementation against the spec (target=implementation).
165
220
  */
166
221
  function buildPrompt2(specContent) {
167
222
  return `You are a Specification Engineering agent.
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAMH,oCAkCC;AAeD,sCAkGC;AAMD,oCAgBC;AA7KD;;;GAGG;AACH,SAAgB,YAAY,CAAC,OAAe,EAAE,cAAsB;IAClE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BP,cAAc,IAAI,2FAA2F;;;iBAG9F,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAAC,WAAmB;IAC/C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGP,WAAW,EAAE,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,WAAmB;IAC9C,OAAO;;;;;;;;;;;;;;EAcP,WAAW,EAAE,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAYH,8CA2EC;AAeD,sCA4GC;AAOD,oCAgBC;AAvOD;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAC/B,OAAe,EACf,QAAgB,EAChB,YAAoB,EACpB,YAAoB;IAEpB,MAAM,UAAU,GAAG,+BAA+B,YAAY,iCAAiC,YAAY,EAAE,CAAC;IAE9G,OAAO;;;;WAIE,OAAO;cACJ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DpB,UAAU,EAAE,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAAC,WAAmB;IAC/C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GP,WAAW,EAAE,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,WAAmB;IAC9C,OAAO;;;;;;;;;;;;;;EAcP,WAAW,EAAE,CAAC;AAChB,CAAC"}
@@ -1,4 +1,15 @@
1
- import { ForgeTemplate, ForgeSection } from './types';
1
+ import { ForgeTemplate, ForgeSection, Tier } from './types';
2
2
  export declare function loadTemplate(filePath: string): ForgeTemplate;
3
+ /**
4
+ * Parse the tier from the nimai-spec marker comment in the spec content.
5
+ * When multiple markers appear (e.g., a spec quoting template text), the LAST marker wins.
6
+ * Bare "<!-- nimai-spec -->" (no tier) defaults to "full" for backward compatibility with v0.4 specs.
7
+ */
8
+ export declare function parseTierFromMarker(content: string): Tier;
9
+ /**
10
+ * Load one of the two shipped tier templates (lite or full) from the data/ directory.
11
+ * Returns the raw template text.
12
+ */
13
+ export declare function loadTierTemplate(tier: Tier): string;
3
14
  export declare function parseSections(content: string): ForgeSection[];
4
15
  //# sourceMappingURL=template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAItD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAQ5D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CA0B7D"}
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO5D,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAQ5D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAOnD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CA0B7D"}
package/dist/template.js CHANGED
@@ -34,9 +34,15 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.loadTemplate = loadTemplate;
37
+ exports.parseTierFromMarker = parseTierFromMarker;
38
+ exports.loadTierTemplate = loadTierTemplate;
37
39
  exports.parseSections = parseSections;
38
40
  const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ const forge_root_1 = require("./forge-root");
39
43
  const HEADING_RE = /^(#{1,6})\s+(.+)$/;
44
+ // Matches the nimai-spec marker with optional tier attribute
45
+ const NIMAI_MARKER_RE = /<!--\s*nimai-spec(?:\s+tier=(lite|full))?\s*-->/;
40
46
  function loadTemplate(filePath) {
41
47
  let raw;
42
48
  try {
@@ -47,6 +53,32 @@ function loadTemplate(filePath) {
47
53
  }
48
54
  return { raw, sections: parseSections(raw) };
49
55
  }
56
+ /**
57
+ * Parse the tier from the nimai-spec marker comment in the spec content.
58
+ * When multiple markers appear (e.g., a spec quoting template text), the LAST marker wins.
59
+ * Bare "<!-- nimai-spec -->" (no tier) defaults to "full" for backward compatibility with v0.4 specs.
60
+ */
61
+ function parseTierFromMarker(content) {
62
+ const matches = [...content.matchAll(/<!--\s*nimai-spec(?:\s+tier=(lite|full))?\s*-->/g)];
63
+ if (matches.length === 0)
64
+ return 'full';
65
+ const last = matches[matches.length - 1];
66
+ const tier = last[1]; // undefined if bare marker
67
+ return tier === 'lite' ? 'lite' : 'full';
68
+ }
69
+ /**
70
+ * Load one of the two shipped tier templates (lite or full) from the data/ directory.
71
+ * Returns the raw template text.
72
+ */
73
+ function loadTierTemplate(tier) {
74
+ const templatePath = path.join(forge_root_1.FORGE_ROOT, `nimai-spec-${tier}.md`);
75
+ try {
76
+ return fs.readFileSync(templatePath, 'utf-8');
77
+ }
78
+ catch (err) {
79
+ throw new Error(`Cannot read ${tier} tier template at "${templatePath}": ${err.message}`);
80
+ }
81
+ }
50
82
  function parseSections(content) {
51
83
  const lines = content.split('\n');
52
84
  const sections = [];
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,oCAQC;AAED,sCA0BC;AAzCD,uCAAyB;AAGzB,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,SAAgB,YAAY,CAAC,QAAgB;IAC3C,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,MAAO,GAA6B,CAAC,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;IACD,OAAO,EAAE,GAAG,E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AAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export type LintIssueType = 'blank_field' | 'needs_human_input' | 'missing_section' | 'missing_module_boundary' | 'missing_interface_contract' | 'missing_non_goals' | 'missing_change_surface' | 'missing_dependency_direction' | 'pre_checked_ac' | 'missing_marker' | 'unresolved_mechanism' | 'missing_mechanism_decision' | 'ambiguous_chosen_approach' | 'missing_convergence_section' | 'unresolved_convergence' | 'missing_edge_cases' | 'missing_architecture_lock';
1
+ export type LintIssueType = 'blank_field' | 'needs_human_input' | 'missing_required_section' | 'pre_checked_ac' | 'missing_marker' | 'blank_placeholder' | 'unresolved_convergence' | 'missing_convergence_section';
2
2
  export interface LintIssue {
3
3
  line: number;
4
4
  type: LintIssueType;
5
5
  message: string;
6
- /** Advisory issues are warnings only — nimai validate exits 0 unless --strict-architecture */
6
+ /** Advisory issues are warnings only — nimai validate exits 0 unless they are the only issues */
7
7
  advisory?: boolean;
8
8
  }
9
9
  export interface ForgeSection {
@@ -15,9 +15,5 @@ export interface ForgeTemplate {
15
15
  raw: string;
16
16
  sections: ForgeSection[];
17
17
  }
18
- export interface ContextItem {
19
- file: string;
20
- snippet: string;
21
- relevance: number;
22
- }
18
+ export type Tier = 'lite' | 'full';
23
19
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,mBAAmB,GACnB,iBAAiB,GACjB,yBAAyB,GACzB,4BAA4B,GAC5B,mBAAmB,GACnB,wBAAwB,GACxB,8BAA8B,GAC9B,gBAAgB,GAChB,gBAAgB,GAChB,sBAAsB,GACtB,4BAA4B,GAC5B,2BAA2B,GAC3B,6BAA6B,GAC7B,wBAAwB,GACxB,oBAAoB,GACpB,2BAA2B,CAAC;AAEhC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,mBAAmB,GACnB,0BAA0B,GAC1B,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,wBAAwB,GACxB,6BAA6B,CAAC;AAElC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nimai-core",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "Nimai core library — template loading, lint engine, context extraction. No LLM dependencies.",
5
5
  "keywords": [
6
6
  "nimai",
@@ -19,7 +19,8 @@
19
19
  "directory": "packages/core"
20
20
  },
21
21
  "files": [
22
- "dist/"
22
+ "dist/",
23
+ "data/"
23
24
  ],
24
25
  "main": "dist/index.js",
25
26
  "types": "dist/index.d.ts",
@@ -1,22 +0,0 @@
1
- /**
2
- * Rule-based clarification heuristics for nimai_spec.
3
- *
4
- * These are pure functions — no IO, no LLM calls.
5
- * Trigger `clarifications_needed` when any heuristic fires.
6
- */
7
- export interface ClarificationResult {
8
- needed: boolean;
9
- reasons: string[];
10
- questions: string[];
11
- }
12
- /**
13
- * Evaluate whether a spec request needs clarification before drafting.
14
- *
15
- * Heuristics (any one firing triggers clarification):
16
- * 1. Request is under 10 words
17
- * 2. Zero repo files matched by context extractor
18
- * 3. No domain nouns or action verbs detected
19
- * 4. Conflicting stack hints (two competing tech choices in same category)
20
- */
21
- export declare function detectClarifications(request: string, contextFileCount: number): ClarificationResult;
22
- //# sourceMappingURL=clarification.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clarification.d.ts","sourceRoot":"","sources":["../src/clarification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuEH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GACvB,mBAAmB,CA+BrB"}
@@ -1,106 +0,0 @@
1
- "use strict";
2
- /**
3
- * Rule-based clarification heuristics for nimai_spec.
4
- *
5
- * These are pure functions — no IO, no LLM calls.
6
- * Trigger `clarifications_needed` when any heuristic fires.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.detectClarifications = detectClarifications;
10
- // ─── Domain noun / action vocab ───────────────────────────────────────────────
11
- /**
12
- * Minimum set of technical domain nouns and action verbs that indicate the
13
- * request describes a real engineering task. If the request contains none of
14
- * these, it is likely too vague to spec reliably.
15
- */
16
- const DOMAIN_TOKENS = new Set([
17
- // Action verbs
18
- 'add', 'build', 'create', 'implement', 'fix', 'refactor', 'update', 'migrate',
19
- 'design', 'integrate', 'deploy', 'remove', 'generate', 'optimize', 'extend',
20
- 'replace', 'extract', 'expose', 'wire', 'scaffold', 'test', 'benchmark',
21
- // Technical nouns
22
- 'api', 'service', 'component', 'model', 'module', 'database', 'endpoint',
23
- 'interface', 'schema', 'type', 'function', 'class', 'route', 'handler',
24
- 'middleware', 'auth', 'token', 'config', 'cli', 'ui', 'hook', 'store',
25
- 'query', 'mutation', 'event', 'queue', 'cache', 'index', 'migration',
26
- 'server', 'client', 'backend', 'frontend', 'test', 'spec', 'pipeline',
27
- 'workflow', 'adapter', 'plugin', 'sdk', 'contract', 'validator', 'parser',
28
- ]);
29
- /**
30
- * Returns true if the request contains at least one recognizable domain token.
31
- */
32
- function hasDomainNoun(request) {
33
- const words = request.toLowerCase().match(/\b[a-z]+\b/g) ?? [];
34
- return words.some(w => DOMAIN_TOKENS.has(w));
35
- }
36
- // ─── Conflicting stack detection ──────────────────────────────────────────────
37
- /** Groups of mutually-competing technology choices. Two items from the same group = conflict. */
38
- const STACK_GROUPS = [
39
- // Programming languages — any two in the same request signals ambiguous stack
40
- [
41
- 'python', 'ruby', 'java', 'golang', 'rust', 'kotlin', 'swift', 'scala',
42
- 'php', 'elixir', 'csharp', 'typescript', 'javascript',
43
- ],
44
- // JS UI frameworks
45
- ['react', 'vue', 'angular', 'svelte'],
46
- // CSS frameworks
47
- ['tailwind', 'bootstrap'],
48
- // Relational databases
49
- ['postgresql', 'postgres', 'mysql', 'sqlite'],
50
- // NoSQL databases
51
- ['mongodb', 'dynamodb', 'firestore', 'cassandra'],
52
- // JS test frameworks
53
- ['jest', 'vitest', 'jasmine'],
54
- ];
55
- /**
56
- * Returns true if the request mentions ≥2 items from the same competing stack group,
57
- * indicating an ambiguous or conflicting technology choice.
58
- */
59
- function hasConflictingStack(request) {
60
- const lower = request.toLowerCase();
61
- for (const group of STACK_GROUPS) {
62
- const hits = group.filter(tech => {
63
- // Match as whole word or compound (e.g. "typescript", "vue.js")
64
- const pattern = new RegExp(`\\b${tech.replace(/[-.]/g, '[-.\\s]?')}\\b`, 'i');
65
- return pattern.test(lower);
66
- });
67
- if (hits.length >= 2)
68
- return true;
69
- }
70
- return false;
71
- }
72
- /**
73
- * Evaluate whether a spec request needs clarification before drafting.
74
- *
75
- * Heuristics (any one firing triggers clarification):
76
- * 1. Request is under 10 words
77
- * 2. Zero repo files matched by context extractor
78
- * 3. No domain nouns or action verbs detected
79
- * 4. Conflicting stack hints (two competing tech choices in same category)
80
- */
81
- function detectClarifications(request, contextFileCount) {
82
- const reasons = [];
83
- const wordCount = request.trim().split(/\s+/).length;
84
- if (wordCount < 10) {
85
- reasons.push(`request is too short (${wordCount} words — add more context)`);
86
- }
87
- if (contextFileCount === 0) {
88
- reasons.push('no relevant repo files matched — is the repo path correct, or is this a new project?');
89
- }
90
- if (!hasDomainNoun(request)) {
91
- reasons.push('no recognizable domain nouns or action verbs found — describe what should be built or changed');
92
- }
93
- if (hasConflictingStack(request)) {
94
- reasons.push('conflicting technology stack hints detected — clarify which stack applies or separate into distinct tasks');
95
- }
96
- const needed = reasons.length > 0;
97
- const questions = needed
98
- ? [
99
- 'What is the primary goal or outcome you want to achieve?',
100
- 'Which specific files, components, or systems should be modified?',
101
- 'Are there constraints, dependencies, or requirements we should be aware of?',
102
- ]
103
- : [];
104
- return { needed, reasons, questions };
105
- }
106
- //# sourceMappingURL=clarification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clarification.js","sourceRoot":"","sources":["../src/clarification.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAsFH,oDAkCC;AAtHD,iFAAiF;AAEjF;;;;GAIG;AACH,MAAM,aAAa,GAAG,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,CAAC;IACrD,IAAI,SAAS,GAAG,EAAE,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,yBAAyB,SAAS,4BAA4B,CAAC,CAAC;IAC/E,CAAC;IAED,IAAI,gBAAgB,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,sFAAsF,CAAC,CAAC;IACvG,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;IAChH,CAAC;IAED,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,2GAA2G,CAAC,CAAC;IAC5H,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAElC,MAAM,SAAS,GAAa,MAAM;QAChC,CAAC,CAAC;YACE,0DAA0D;YAC1D,kEAAkE;YAClE,6EAA6E;SAC9E;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACxC,CAAC"}
package/dist/context.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { ContextItem } from './types';
2
- export declare function extractContext(repoPath: string, request: string): ContextItem[];
3
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA4DtC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAiB/E"}