@pathmode/mcp-server 1.9.1 → 1.11.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/README.md CHANGED
@@ -94,7 +94,7 @@ Your implementation MUST satisfy ALL of these:
94
94
 
95
95
  ## Skill Pack for Claude Code
96
96
 
97
- The package also ships 7 Claude Code skills that auto-trigger based on what you ask — no slash commands required.
97
+ The package also ships 8 Claude Code skills that auto-trigger based on what you ask — no slash commands required.
98
98
 
99
99
  | Skill | Use when |
100
100
  |-------|----------|
@@ -163,7 +163,10 @@ Get your API key from **Settings > API Keys** in the [Pathmode app](https://path
163
163
  ### Local Mode (Offline)
164
164
 
165
165
  Local mode is the **default when no API key is configured**. It reads and writes `intent.md` in your
166
- project directory, and nothing leaves your machine. The plain block is a complete keyless setup:
166
+ project directory, and nothing leaves your machine. Local mode includes `check_intent_readiness`
167
+ the deterministic preflight that scores a spec against six calibrated gates and names the exact
168
+ blockers, with no model call (the same gate that runs at [preflight.pathmode.io](https://preflight.pathmode.io)).
169
+ The plain block is a complete keyless setup:
167
170
 
168
171
  ```json
169
172
  {
@@ -28,6 +28,8 @@ export interface ApiIntent {
28
28
  status: string;
29
29
  version: number;
30
30
  objective: string;
31
+ /** Author-written as-is behavior. Null when not described (net-new capability). */
32
+ currentState?: string | null;
31
33
  problemSeverity?: string;
32
34
  title: string;
33
35
  outcomes: ApiStructuredOutcome[];
@@ -80,6 +82,8 @@ export interface ApiIntent {
80
82
  export interface CreateIntentInput {
81
83
  title: string;
82
84
  objective: string;
85
+ /** Author-written as-is behavior; omit for net-new capability. */
86
+ currentState?: string;
83
87
  productId: string;
84
88
  outcomes?: (string | {
85
89
  text: string;
@@ -112,6 +116,8 @@ export interface CreateIntentInput {
112
116
  export interface UpdateIntentInput {
113
117
  title?: string;
114
118
  objective?: string;
119
+ /** Empty string clears the as-is description. */
120
+ currentState?: string;
115
121
  outcomes?: (string | {
116
122
  text: string;
117
123
  priority?: string;
@@ -179,8 +185,25 @@ export interface ApiVerificationResult {
179
185
  category: string;
180
186
  status: string;
181
187
  reasoning: string;
188
+ basis?: 'artifact' | 'self_report' | 'none';
189
+ evidence?: {
190
+ path: string;
191
+ hunk?: string;
192
+ }[];
182
193
  }[];
183
194
  summary: string;
195
+ /** Whether the verdict was reached by reading a pull request or only the caller's own account. */
196
+ basis?: 'artifact' | 'self_report';
197
+ artifact?: {
198
+ kind: 'pr_diff' | 'self_report';
199
+ repo?: string;
200
+ prNumber?: number;
201
+ headSha?: string;
202
+ filesRead?: number;
203
+ filesOmitted?: number;
204
+ truncated?: boolean;
205
+ reason?: string;
206
+ };
184
207
  }
185
208
  export interface ApiEvidence {
186
209
  id: string;
@@ -310,5 +333,9 @@ export declare class PathmodeClient {
310
333
  linked: number;
311
334
  unlinked: number;
312
335
  }>;
313
- verifyImplementation(intentId: string, summary: string, codeChanges?: string): Promise<ApiVerificationResult>;
336
+ verifyImplementation(intentId: string, body: {
337
+ summary?: string;
338
+ prUrl?: string;
339
+ codeChanges?: string;
340
+ }): Promise<ApiVerificationResult>;
314
341
  }
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW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O,CAAC,WAAW,CAAC;IAQhE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ/I,oBAAoB,CACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GACjE,OAAO,CAAC,qBAAqB,CAAC;CAQpC"}
package/dist/index.js CHANGED
@@ -33742,10 +33742,10 @@ class PathmodeClient {
33742
33742
  });
33743
33743
  return res.json();
33744
33744
  }
33745
- async verifyImplementation(intentId, summary, codeChanges) {
33745
+ async verifyImplementation(intentId, body) {
33746
33746
  const res = await this.fetch(`/intents/${intentId}/verify`, {
33747
33747
  method: 'POST',
33748
- body: JSON.stringify({ summary, codeChanges }),
33748
+ body: JSON.stringify(body),
33749
33749
  });
33750
33750
  return res.json();
33751
33751
  }
@@ -34125,6 +34125,7 @@ IMPORTANT:
34125
34125
  - The spec fields in \`intent_save\` must use this exact structure:
34126
34126
  - title: string
34127
34127
  - objective: string
34128
+ - currentState: string (optional) — how it works today, before the change: existing behavior and the workaround users rely on. Capture it whenever this changes something that already exists; it is how the implementation knows what must not regress. Omit for net-new capability.
34128
34129
  - outcomes: string[] (list of outcome statements)
34129
34130
  - constraints: string[] (optional)
34130
34131
  - edgeCases: { scenario: string, expectedBehavior: string }[] (optional)
@@ -34181,6 +34182,13 @@ function formatIntentMd(spec, opts = {}) {
34181
34182
  sections.push('## Objective');
34182
34183
  sections.push(spec.objective);
34183
34184
  }
34185
+ // Heading text is the round-trip key (readIntentFile keys sections by exact
34186
+ // heading) — keep it plain, exactly like Objective above.
34187
+ if (spec.currentState?.trim()) {
34188
+ sections.push('');
34189
+ sections.push('## Current State');
34190
+ sections.push(spec.currentState.trim());
34191
+ }
34184
34192
  sections.push(...decisionLines(spec.decisions, '## Decisions & Ruled-Out Alternatives'));
34185
34193
  if (spec.outcomes?.length) {
34186
34194
  sections.push('');
@@ -34259,6 +34267,11 @@ function formatCursorRules(spec) {
34259
34267
  sections.push('# WHY');
34260
34268
  sections.push(spec.objective);
34261
34269
  }
34270
+ if (spec.currentState?.trim()) {
34271
+ sections.push('');
34272
+ sections.push('# CURRENT STATE (how it works today — do not regress this)');
34273
+ sections.push(spec.currentState.trim());
34274
+ }
34262
34275
  sections.push(...decisionLines(spec.decisions, '# DECISIONS (already settled — do not relitigate)'));
34263
34276
  if (spec.outcomes?.length) {
34264
34277
  sections.push('');
@@ -34340,6 +34353,9 @@ function formatClaudeMdSection(spec) {
34340
34353
  if (spec.objective) {
34341
34354
  sections.push(`**Objective**: ${spec.objective}`);
34342
34355
  }
34356
+ if (spec.currentState?.trim()) {
34357
+ sections.push(`**Current state** (how it works today): ${spec.currentState.trim()}`);
34358
+ }
34343
34359
  sections.push(...decisionLines(spec.decisions, '**Decisions**:'));
34344
34360
  if (spec.outcomes?.length) {
34345
34361
  sections.push('**Outcomes**:');
@@ -34420,6 +34436,10 @@ function buildWriterDescription(spec) {
34420
34436
  sections.push('');
34421
34437
  sections.push(`Why this matters: ${spec.objective}`);
34422
34438
  }
34439
+ if (spec.currentState?.trim()) {
34440
+ sections.push('');
34441
+ sections.push(`How it works today (do not regress this): ${spec.currentState.trim()}`);
34442
+ }
34423
34443
  const decisions = (spec.decisions || []).filter(d => d && typeof d.choice === 'string' && d.choice.length > 0 && typeof d.reason === 'string');
34424
34444
  if (decisions.length > 0) {
34425
34445
  sections.push('');
@@ -34682,6 +34702,7 @@ function readIntentFile(filePath) {
34682
34702
  status: data.status || 'draft',
34683
34703
  version: Number.isFinite(version) && version >= 1 ? version : 1,
34684
34704
  objective: data.objective || extractSection(sections, 'Objective') || '',
34705
+ currentState: extractSection(sections, 'Current State') || undefined,
34685
34706
  title: data.title || data.userGoal || extractTitle(body) || 'Untitled Intent',
34686
34707
  stageName: data.stage || undefined,
34687
34708
  severity: data.severity || undefined,
@@ -34982,6 +35003,230 @@ function mergePathmodeSection(existing, section) {
34982
35003
  }
34983
35004
 
34984
35005
 
35006
+ /***/ }),
35007
+
35008
+ /***/ 3079:
35009
+ /***/ ((__unused_webpack_module, exports) => {
35010
+
35011
+ "use strict";
35012
+
35013
+ /**
35014
+ * Deterministic intent readiness gate — the preflight.
35015
+ *
35016
+ * This is a PORT of the canonical gate in lib/intentReadiness.ts (the MCP package
35017
+ * cannot import app/lib code). Every regex and threshold below must stay
35018
+ * byte-identical to the source; lib/preflightReadinessParity.test.ts in the app
35019
+ * repo runs both implementations over the 98-item calibration corpus and the
35020
+ * Preflight demo specs, and fails CI on any divergence. Edit the app lib first,
35021
+ * then mirror the change here.
35022
+ *
35023
+ * Pure functions only: no I/O, no network, no model calls. The same spec gets
35024
+ * the same verdict every run — that determinism is the product claim on
35025
+ * https://preflight.pathmode.io, so keep it true.
35026
+ */
35027
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35028
+ exports.READINESS_GATE_ORDER = exports.READINESS_BLOCKER_DESCRIPTIONS = void 0;
35029
+ exports.coerceText = coerceText;
35030
+ exports.asArray = asArray;
35031
+ exports.isTitleMeaningful = isTitleMeaningful;
35032
+ exports.isConstraintConcrete = isConstraintConcrete;
35033
+ exports.isVerificationCheckSubstantive = isVerificationCheckSubstantive;
35034
+ exports.isObjectiveSpecific = isObjectiveSpecific;
35035
+ exports.isOutcomeMeasurable = isOutcomeMeasurable;
35036
+ exports.computeReadinessVerdict = computeReadinessVerdict;
35037
+ exports.formatReadinessVerdict = formatReadinessVerdict;
35038
+ // ── Text/shape coercion (mirrors lib/intentReadiness coerceText/asArray) ───
35039
+ function coerceText(value) {
35040
+ if (typeof value === 'string')
35041
+ return value;
35042
+ if (value && typeof value === 'object') {
35043
+ const o = value;
35044
+ const cand = o.description ?? o.rule ?? o.text ?? o.name ?? o.scenario ?? o.title ?? o.value ?? o.label ?? o.content;
35045
+ if (typeof cand === 'string')
35046
+ return cand;
35047
+ }
35048
+ return '';
35049
+ }
35050
+ function asArray(value) {
35051
+ if (Array.isArray(value))
35052
+ return value;
35053
+ if (value === null || value === undefined)
35054
+ return [];
35055
+ return [value];
35056
+ }
35057
+ /** Mirrors lib/intentSpecHelpers.outcomeText: outcomes arrive as strings or { text }. */
35058
+ function outcomeText(o) {
35059
+ if (typeof o === 'string')
35060
+ return o;
35061
+ const t = o?.text;
35062
+ return typeof t === 'string' ? t : '';
35063
+ }
35064
+ const PLACEHOLDER_INTENT_TITLES = new Set(['new intent', 'untitled intent']);
35065
+ const TEMPLATE_PATTERNS = [
35066
+ /\[your category\]/i,
35067
+ /^template$/i,
35068
+ /^placeholder$/i,
35069
+ /^todo$/i,
35070
+ /^tbd$/i,
35071
+ ];
35072
+ function isLikelyPlaceholderText(value) {
35073
+ const text = coerceText(value).trim();
35074
+ if (!text)
35075
+ return false;
35076
+ if (text.length <= 2)
35077
+ return true;
35078
+ return TEMPLATE_PATTERNS.some((pattern) => pattern.test(text));
35079
+ }
35080
+ // ── The six calibrated gates ────────────────────────────────────────────────
35081
+ const GENERIC_TITLE_WORDS = new Set([
35082
+ 'new', 'my', 'our', 'the', 'a', 'an', 'this', 'that', 'some', 'more', 'better',
35083
+ 'intent', 'intents', 'feature', 'features', 'idea', 'ideas', 'spec', 'specs',
35084
+ 'draft', 'drafts', 'test', 'tests', 'todo', 'tbd', 'wip', 'stuff', 'thing', 'things',
35085
+ 'untitled', 'placeholder', 'misc', 'general', 'various', 'update', 'updates',
35086
+ 'improvement', 'improvements', 'improve', 'fix', 'fixes', 'change', 'changes',
35087
+ 'work', 'item', 'items', 'task', 'tasks',
35088
+ ]);
35089
+ function isTitleMeaningful(title) {
35090
+ const t = coerceText(title).trim();
35091
+ if (!t)
35092
+ return false;
35093
+ if (PLACEHOLDER_INTENT_TITLES.has(t.toLowerCase()))
35094
+ return false;
35095
+ if (TEMPLATE_PATTERNS.some((pattern) => pattern.test(t)))
35096
+ return false;
35097
+ const words = t.split(/\s+/).filter(Boolean);
35098
+ if (words.length < 2)
35099
+ return false;
35100
+ return words.some((w) => !GENERIC_TITLE_WORDS.has(w.toLowerCase().replace(/[^a-z0-9-]/gi, '')));
35101
+ }
35102
+ const CONSTRAINT_MARKER_RE = /\b(never|must|not|no|don'?t|cannot|can'?t|forbidden|prohibit\w*|avoid|without|only|at most|at least|within|under|below|above|max\w*|limit\w*|cap(?:ped|s)?|quota|budget|respect\w*|comply|complian\w*|conform\w*|keep|stays?|remains?|preserve\w*|maintain\w*|require[sd]?|always|read[- ]only|backward[- ]?compatib\w*|p\d{2})\b/i;
35103
+ function isConstraintConcrete(value) {
35104
+ const t = coerceText(value).trim();
35105
+ if (t.length < 8)
35106
+ return false;
35107
+ return CONSTRAINT_MARKER_RE.test(t) || t.length >= 40;
35108
+ }
35109
+ function isVerificationCheckSubstantive(description) {
35110
+ const t = coerceText(description).trim();
35111
+ if (isLikelyPlaceholderText(t))
35112
+ return false;
35113
+ return t.split(/\s+/).filter(Boolean).length >= 3;
35114
+ }
35115
+ const ACTOR_RE = /\b(users?|customers?|clients?|teams?|developers?|admins?|administrators?|visitors?|subscribers?|buyers?|sellers?|operators?|managers?|patients?|agents?|founders?|owners?|leads?|members?|employees?|hires?|applicants?|candidates?|players?|creators?|curators?|seekers?|parents?|students?|teachers?|shoppers?|merchants?|reviewers?|engineers?|designers?|marketers?|recruiters?|stakeholders?|people|staff)\b/i;
35116
+ const ACTOR_STRUCT_RE = /\b(enable|allow|let|help|give|empower|support)\s+[A-Za-z]|\bfor\s+[a-z]+\s+(to|who|so)\b|\b[A-Za-z]+['’]s\b|\b[A-Z][a-z]{2,}\s+(can'?t|cannot|can|could|should|needs?|wants?|struggles?|fails?|miss\w*|lose|loses)\b/;
35117
+ const PROBLEM_RE = /\b(can'?t|cannot|unable|struggl\w*|fail\w*|drop\w*|abandon\w*|miss\w*|los\w*|break\w*|broken|block\w*|confus\w*|delay\w*|bottleneck|stale|stuck|friction|painful|manual\w*|error\w*|slow|waste\w*|risk\w*)\b/i;
35118
+ const CAPABILITY_RE = /\b(enable|allow|let|help|give|empower|provide|support|lift|raise|reduce|cut|eliminat\w*|increase|decrease|improve|streamlin\w*|automat\w*|speed up|accelerat\w*|guarantee|ensure|deliver|complete|clear|maintain|achieve|unlock|simplif\w*|consolidat\w*|surface|track|measure|see|view|access|find|understand|know|preview|schedule|resume|inspect|reorder|publish|reconcile|bulk|able to|act on)\b/i;
35119
+ const VAGUE_MARKER_RE = /\b(best[- ]in[- ]class|world[- ]class|seamless\w*|cutting[- ]edge|delight\w*|intuitive|robust|holistic|synerg\w*|revolutioniz\w*|next[- ]gen\w*|frictionless|game[- ]chang\w*|state[- ]of[- ]the[- ]art|leverage|do more|happ(y|ier|iness)|smoother|polished|magical|amazing|wow)\b/i;
35120
+ function isObjectiveSpecific(objective) {
35121
+ const t = coerceText(objective).trim();
35122
+ if (t.length <= 35)
35123
+ return false;
35124
+ if (VAGUE_MARKER_RE.test(t) && !OUTCOME_NUMERIC_RE.test(t))
35125
+ return false;
35126
+ const hasActor = ACTOR_RE.test(t) || ACTOR_STRUCT_RE.test(t);
35127
+ const hasIntent = PROBLEM_RE.test(t) || CAPABILITY_RE.test(t);
35128
+ return hasActor && hasIntent;
35129
+ }
35130
+ const OUTCOME_NUMERIC_RE = /\d|%|≥|≤|>=|<=/;
35131
+ const OUTCOME_METRIC_RE = /\b(under|within|at least|no more than|fewer than|less than|more than|reach\w*|drop\w*|ris\w*|grow\w*|increas\w*|decreas\w*|reduc\w*|eliminat\w*|stays?\s+(under|below|above|within)|from\s+.+\s+to\s+|success rate|completion rate|conversion|retention|adoption|rate\b|score|benchmark|baseline|per\s+\w+|time[- ]to)\b/i;
35132
+ const OUTCOME_CAPABILITY_RE = /\b([a-z]+s?|they|anyone|everyone)\s+(can|could|sees?|views?|receives?|gets?|is able|are able|able to)\b/i;
35133
+ const OUTCOME_STATE_RE = /\b(no longer|without\s+\w+|is fully|are fully|displays?|shows?|appears?|visible|notified|confirmed|enabled|disabled|redirected|prevented|blocked|templated|automated|documented|exists?|persists?|never|always|produces?\s+no\b|results?\s+in\s+no\b|with\s+no\b|free of)\b/i;
35134
+ const OUTCOME_SUBJECTIVE_RE = /\b(amazing|delight\w*|happ(y|ier|iness)|satisf\w*|quality|love[ds]?|world[- ]class|best[- ]in[- ]class|seamless\w*|intuitive|polished|magical|wow|delightful|engaging|meaningful\w*)\b/i;
35135
+ function isOutcomeMeasurable(text) {
35136
+ const t = coerceText(text).trim();
35137
+ if (!t)
35138
+ return false;
35139
+ if (OUTCOME_SUBJECTIVE_RE.test(t))
35140
+ return false;
35141
+ return OUTCOME_NUMERIC_RE.test(t) || OUTCOME_METRIC_RE.test(t) || OUTCOME_CAPABILITY_RE.test(t) || OUTCOME_STATE_RE.test(t);
35142
+ }
35143
+ // ── Verdict ─────────────────────────────────────────────────────────────────
35144
+ exports.READINESS_BLOCKER_DESCRIPTIONS = {
35145
+ objective: 'Objective is too vague — name the actor and the concrete failure they hit today.',
35146
+ goal: 'Title is missing or generic — name the intent in a short, specific noun phrase.',
35147
+ outcomes: 'Outcomes are not all measurable — at least two-thirds need a testable or observable threshold.',
35148
+ constraints: 'No hard constraint — name at least one thing that must never happen.',
35149
+ edgeCases: 'No edge case with a defined expected behavior.',
35150
+ verification: 'No concrete verification — describe at least one check specific enough to run.',
35151
+ };
35152
+ /** Display order for the gate strip (title first, matching the Preflight page). */
35153
+ exports.READINESS_GATE_ORDER = ['goal', 'objective', 'outcomes', 'constraints', 'edgeCases', 'verification'];
35154
+ /** Blocker emission order — byte-identical to lib/intentReadiness computeReviewSignals. */
35155
+ const BLOCKER_ORDER = ['objective', 'goal', 'outcomes', 'constraints', 'edgeCases', 'verification'];
35156
+ /** Flatten a verification field (checks[] plus legacy buckets) into check descriptions. */
35157
+ function verificationDescriptions(verification) {
35158
+ if (!verification || typeof verification !== 'object')
35159
+ return [];
35160
+ const v = verification;
35161
+ const out = [];
35162
+ for (const c of asArray(v.checks)) {
35163
+ const d = coerceText(c).trim();
35164
+ if (d)
35165
+ out.push(d);
35166
+ }
35167
+ for (const bucket of ['manualChecks', 'unitTests', 'e2eTests']) {
35168
+ for (const c of asArray(v[bucket])) {
35169
+ const d = coerceText(c).trim();
35170
+ if (d)
35171
+ out.push(d);
35172
+ }
35173
+ }
35174
+ return out;
35175
+ }
35176
+ /**
35177
+ * The preflight: six deterministic gates over an intent spec. Mirrors
35178
+ * lib/intentReadiness.computeReviewSignals with conversationFirst semantics
35179
+ * (the legacy phase-engagement signal never gates the verdict here).
35180
+ */
35181
+ function computeReadinessVerdict(spec) {
35182
+ const nonEmptyOutcomes = asArray(spec.outcomes).map(o => outcomeText(o).trim()).filter(Boolean);
35183
+ const testableOutcomeCount = nonEmptyOutcomes.filter(isOutcomeMeasurable).length;
35184
+ const signals = {
35185
+ goal: isTitleMeaningful(typeof spec.title === 'string' ? spec.title : coerceText(spec.title)),
35186
+ objective: isObjectiveSpecific(typeof spec.objective === 'string' ? spec.objective : coerceText(spec.objective)),
35187
+ outcomes: nonEmptyOutcomes.length >= 2 && testableOutcomeCount / Math.max(nonEmptyOutcomes.length, 1) >= 0.66,
35188
+ constraints: asArray(spec.constraints).some(isConstraintConcrete),
35189
+ edgeCases: asArray(spec.edgeCases).some((ec) => {
35190
+ const e = ec;
35191
+ return coerceText(e?.scenario).trim().length > 0 && coerceText(e?.expectedBehavior).trim().length > 0;
35192
+ }),
35193
+ verification: verificationDescriptions(spec.verification).some(isVerificationCheckSubstantive),
35194
+ };
35195
+ const failingBlockers = BLOCKER_ORDER
35196
+ .filter(k => !signals[k])
35197
+ .map(k => exports.READINESS_BLOCKER_DESCRIPTIONS[k]);
35198
+ return { ready: failingBlockers.length === 0, signals, failingBlockers };
35199
+ }
35200
+ const GATE_LABELS = {
35201
+ goal: 'Title',
35202
+ objective: 'Objective',
35203
+ outcomes: 'Outcomes',
35204
+ constraints: 'Constraints',
35205
+ edgeCases: 'Edge cases',
35206
+ verification: 'Verification',
35207
+ };
35208
+ /** Human/agent-readable verdict block, stable enough to parse by line prefix. */
35209
+ function formatReadinessVerdict(verdict, specTitle) {
35210
+ const lines = [];
35211
+ const name = (specTitle || '').trim();
35212
+ if (verdict.ready) {
35213
+ lines.push(`✓ Preflight passed${name ? ` for "${name}"` : ''}. 6/6 checks. Ready to hand to an agent.`);
35214
+ }
35215
+ else {
35216
+ lines.push(`✗ Preflight failed${name ? ` for "${name}"` : ''}. ${verdict.failingBlockers.length}/6 checks blocking.`);
35217
+ for (const b of verdict.failingBlockers)
35218
+ lines.push(` ✗ ${b}`);
35219
+ }
35220
+ lines.push('');
35221
+ lines.push(exports.READINESS_GATE_ORDER.map(k => `${verdict.signals[k] ? '✓' : '·'} ${GATE_LABELS[k]}`).join(' '));
35222
+ if (!verdict.ready) {
35223
+ lines.push('');
35224
+ lines.push('Repair the failing fields (ask the user one targeted question per blocker), save with intent_save, and re-run check_intent_readiness. The verdict is deterministic: the same spec always gets the same result.');
35225
+ }
35226
+ return lines.join('\n');
35227
+ }
35228
+
35229
+
34985
35230
  /***/ }),
34986
35231
 
34987
35232
  /***/ 6137:
@@ -64910,7 +65155,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/dra
64910
65155
  /***/ ((module) => {
64911
65156
 
64912
65157
  "use strict";
64913
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@pathmode/mcp-server","version":"1.9.1","publishConfig":{"access":"public"},"mcpName":"io.github.pathmodeio/mcp-server","description":"Pathmode MCP Server — Build structured intent specs through Socratic AI conversation (zero-config), or connect to your Intent Layer for strategic context, dependency graphs, and implementation prompts.","main":"dist/index.js","bin":{"pathmode-mcp":"dist/index.js"},"files":["dist/","manifest.json","icon.svg","README.md","skills/"],"scripts":{"build":"rm -rf dist && ncc build src/index.ts -o dist","dev":"ts-node src/index.ts","prepublishOnly":"npm run build"},"keywords":["pathmode","mcp","model-context-protocol","claude-code","claude-code-skills","agent-skills","cursor","windsurf","intent-engineering","intent-compiler","ai-agents","product-development","dependency-graph","strategic-planning"],"author":"Pathmode","license":"MIT","type":"commonjs","engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/pathmodeio/mcp-server.git","directory":"packages/mcp-server"},"homepage":"https://pathmode.io","dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","gray-matter":"^4.0.3","zod":"^3.24.0"},"devDependencies":{"@types/node":"^25.1.0","@vercel/ncc":"^0.38.4","ts-node":"^10.9.2","typescript":"^5.9.3"}}');
65158
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@pathmode/mcp-server","version":"1.11.0","publishConfig":{"access":"public"},"mcpName":"io.github.pathmodeio/mcp-server","description":"Pathmode MCP Server — Build structured intent specs through Socratic AI conversation (zero-config), or connect to your Intent Layer for strategic context, dependency graphs, and implementation prompts.","main":"dist/index.js","bin":{"pathmode-mcp":"dist/index.js"},"files":["dist/","manifest.json","icon.svg","README.md","skills/"],"scripts":{"build":"rm -rf dist && ncc build src/index.ts -o dist","dev":"ts-node src/index.ts","prepublishOnly":"npm run build"},"keywords":["pathmode","mcp","model-context-protocol","claude-code","claude-code-skills","agent-skills","cursor","windsurf","intent-engineering","intent-compiler","ai-agents","product-development","dependency-graph","strategic-planning"],"author":"Pathmode","license":"MIT","type":"commonjs","engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/pathmodeio/mcp-server.git","directory":"packages/mcp-server"},"homepage":"https://pathmode.io","dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","gray-matter":"^4.0.3","zod":"^3.24.0"},"devDependencies":{"@types/node":"^25.1.0","@vercel/ncc":"^0.38.4","ts-node":"^10.9.2","typescript":"^5.9.3"}}');
64914
65159
 
64915
65160
  /***/ })
64916
65161
 
@@ -65006,6 +65251,7 @@ const path_1 = __nccwpck_require__(6928);
65006
65251
  const fs_1 = __nccwpck_require__(9896);
65007
65252
  const api_client_1 = __nccwpck_require__(7475);
65008
65253
  const local_reader_1 = __nccwpck_require__(3518);
65254
+ const readiness_1 = __nccwpck_require__(3079);
65009
65255
  const save_policy_1 = __nccwpck_require__(6137);
65010
65256
  const intent_compiler_1 = __nccwpck_require__(6488);
65011
65257
  const pathmode_section_1 = __nccwpck_require__(4681);
@@ -65495,6 +65741,7 @@ function startMcpServer() {
65495
65741
  id: intent.id,
65496
65742
  title: intent.title,
65497
65743
  objective: intent.objective,
65744
+ currentState: intent.currentState ?? undefined,
65498
65745
  outcomes: intent.outcomes ?? [],
65499
65746
  decisions: intent.decisions,
65500
65747
  constraints: intent.constraints,
@@ -65717,6 +65964,7 @@ function startMcpServer() {
65717
65964
  inputSchema: {
65718
65965
  title: zod_1.z.string().describe('Short name for the intent (e.g., "Improve onboarding flow")'),
65719
65966
  objective: zod_1.z.string().describe('Why this matters — the problem and who has it'),
65967
+ currentState: zod_1.z.string().optional().describe('How this works today, before the change: existing behavior, the workaround users rely on, what is broken. Tells implementing agents what must not regress. Omit for genuinely net-new capability.'),
65720
65968
  productId: zod_1.z.string().describe('Product (Space) ID this intent belongs to. Use get_workspace to find product IDs.'),
65721
65969
  outcomes: zod_1.z.array(zod_1.z.string()).optional().describe('Observable, testable state changes'),
65722
65970
  constraints: zod_1.z.array(zod_1.z.string()).optional().describe('Hard limits the implementation must respect'),
@@ -65758,6 +66006,7 @@ function startMcpServer() {
65758
66006
  intentId: zod_1.z.string().describe('The intent ID to update'),
65759
66007
  title: zod_1.z.string().optional().describe('New title'),
65760
66008
  objective: zod_1.z.string().optional().describe('Updated objective'),
66009
+ currentState: zod_1.z.string().optional().describe('Updated as-is behavior (how it works today). Pass an empty string to clear it.'),
65761
66010
  outcomes: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all outcomes'),
65762
66011
  constraints: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all constraints'),
65763
66012
  healthMetrics: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all health metrics'),
@@ -65871,24 +66120,56 @@ function startMcpServer() {
65871
66120
  });
65872
66121
  cloudOnly.registerTool('verify_implementation', {
65873
66122
  title: 'Verify Implementation',
65874
- description: 'AI-grade your implementation against the intent spec. Checks each outcome, constraint, constitution rule, and edge case. Returns pass/fail per item with reasoning and an overall score. Also logs the result as an implementation note.',
66123
+ description: 'Grade an implementation against the intent spec by reading the pull request. Pass prUrl and Pathmode fetches the diff itself and grades each outcome, constraint, constitution rule, edge case and verification check against what the code actually shows. Describing your own work instead is weaker evidence and the result says so. Returns pass/fail per item with reasoning, a score, and the basis the verdict rests on. Also logs the result as an implementation note.',
65875
66124
  inputSchema: {
65876
66125
  intentId: zod_1.z.string().describe('The intent ID to verify against'),
65877
- summary: zod_1.z.string().describe('Description of what was implemented and how'),
65878
- codeChanges: zod_1.z.string().optional().describe('Summary of code changes (file list, key modifications)'),
66126
+ prUrl: zod_1.z.string().optional().describe('Pull request URL (or owner/repo#123) containing the implementation. Strongly preferred: the diff is read from GitHub instead of taken on trust.'),
66127
+ summary: zod_1.z.string().optional().describe('What you implemented and how. Context for the grader, not evidence. Required only when there is no pull request to point at.'),
66128
+ codeChanges: zod_1.z.string().optional().describe('Deprecated, superseded by prUrl. A diff you paste about your own work is not independent evidence.'),
65879
66129
  },
65880
66130
  annotations: WRITE_OP,
65881
- }, async ({ intentId, summary, codeChanges }) => {
66131
+ }, async ({ intentId, prUrl, summary, codeChanges }) => {
65882
66132
  if (isLocalMode) {
65883
66133
  return { content: [{ type: 'text', text: 'Verification requires cloud mode.' }] };
65884
66134
  }
66135
+ if (!prUrl && !summary) {
66136
+ return { content: [{ type: 'text', text: 'Provide prUrl (preferred) or summary.' }] };
66137
+ }
65885
66138
  try {
65886
- const result = await requireCloudClient().verifyImplementation(intentId, summary, codeChanges);
65887
- let text = `Verification ${result.pass ? 'PASSED' : 'FAILED'} (score: ${result.score}/100)\n\n`;
66139
+ const result = await requireCloudClient().verifyImplementation(intentId, { summary, prUrl, codeChanges });
66140
+ let text = `Verification ${result.pass ? 'PASSED' : 'FAILED'} (score: ${result.score}/100)\n`;
66141
+ // Say what the verdict was actually based on. A run that could not read the code must not
66142
+ // read like one that did, or the score becomes a rubber stamp for a well-written summary.
66143
+ const a = result.artifact;
66144
+ if (a?.kind === 'pr_diff') {
66145
+ text += `Graded against ${a.repo}#${a.prNumber} at ${a.headSha?.slice(0, 8)}`
66146
+ + ` (${a.filesRead} file(s)${a.truncated ? `, ${a.filesOmitted} omitted for size` : ''})\n\n`;
66147
+ }
66148
+ else if (a) {
66149
+ text += `Graded on your own description, no code was read (${a.reason}).`
66150
+ + ` Pass a prUrl for a verdict grounded in the diff.\n\n`;
66151
+ }
66152
+ else {
66153
+ text += '\n';
66154
+ }
65888
66155
  text += `${result.summary}\n\n`;
65889
66156
  for (const r of result.results) {
65890
- const icon = r.status === 'pass' ? '[PASS]' : r.status === 'fail' ? '[FAIL]' : '[????]';
66157
+ const icon = r.status === 'pass' ? '[PASS]'
66158
+ : r.status === 'fail' ? '[FAIL]'
66159
+ : r.status === 'not_applicable' ? '[ -- ]'
66160
+ : '[????]';
65891
66161
  text += `${icon} [${r.category}] ${r.item}\n ${r.reasoning}\n`;
66162
+ // Citations are validated server-side against the diff; an item with none, on a run
66163
+ // that had a diff, says so rather than reading like an inspected verdict.
66164
+ if (r.status === 'not_applicable') {
66165
+ // An absence claim has nothing to cite, so a missing citation is not a gap here.
66166
+ }
66167
+ else if (r.evidence?.length) {
66168
+ text += ` cites: ${r.evidence.map(c => c.path).join(', ')}\n`;
66169
+ }
66170
+ else if (r.basis === 'none') {
66171
+ text += ` cites: nothing in the diff\n`;
66172
+ }
65892
66173
  }
65893
66174
  return { content: [{ type: 'text', text }] };
65894
66175
  }
@@ -65954,6 +66235,7 @@ function startMcpServer() {
65954
66235
  id: zod_1.z.string().optional().describe('Existing intent id. Pass it back when re-saving an intent you already saved so the file is updated (version bumped, status preserved) instead of replaced. Omit for a new intent.'),
65955
66236
  title: zod_1.z.string().describe('Short name for the intent'),
65956
66237
  objective: zod_1.z.string().describe('Why this matters — the problem and who has it'),
66238
+ currentState: zod_1.z.string().optional().describe('How this works today, before the change — existing behavior and workarounds, so the implementation knows what must not regress. Omit for net-new capability.'),
65957
66239
  outcomes: zod_1.z.array(zod_1.z.string()).describe('Observable, testable state changes'),
65958
66240
  decisions: zod_1.z.array(zod_1.z.object({
65959
66241
  choice: zod_1.z.string(),
@@ -65993,6 +66275,57 @@ function startMcpServer() {
65993
66275
  }],
65994
66276
  };
65995
66277
  });
66278
+ server.registerTool('check_intent_readiness', {
66279
+ title: 'Check Intent Readiness (Preflight)',
66280
+ description: 'Run the deterministic preflight on an intent spec before handing it to an implementation agent. Six calibrated checks — title, objective, outcomes, constraints, edge cases, verification — computed by pure functions: no model call, no network, the same spec always gets the same verdict. Pass a spec inline to check before saving, pass intentId to check a specific saved intent, or pass nothing to check the current intent. A failing verdict names the exact blockers; repair the fields and re-run. This is the gate that runs at preflight.pathmode.io.',
66281
+ inputSchema: {
66282
+ spec: zod_1.z.object(intentSpecSchema).optional().describe('Check this spec directly (before saving). When omitted, the current intent is checked instead.'),
66283
+ intentId: zod_1.z.string().optional().describe('Check a specific saved intent by id. Ignored when spec is passed.'),
66284
+ },
66285
+ annotations: READ_ONLY,
66286
+ }, async ({ spec, intentId }) => {
66287
+ let subject = spec;
66288
+ let sourceNote = 'inline spec';
66289
+ if (!subject) {
66290
+ if (isLocalMode) {
66291
+ const intents = (0, local_reader_1.readLocalIntents)();
66292
+ subject = intentId ? intents.find(i => i.id === intentId) : pickCurrentIntent(intents);
66293
+ sourceNote = intentId ? `local intent ${intentId}` : 'current local intent (intent.md)';
66294
+ if (!subject) {
66295
+ return {
66296
+ content: [{
66297
+ type: 'text',
66298
+ text: intentId
66299
+ ? `No local intent with id "${intentId}". Check intent.md or .pathmode/intents/.`
66300
+ : 'No intent found. Write one first (intent_save), or pass the spec inline to preflight it before saving.',
66301
+ }],
66302
+ };
66303
+ }
66304
+ }
66305
+ else {
66306
+ const cloud = requireCloudClient();
66307
+ const intents = await cloud.listIntents();
66308
+ subject = intentId ? intents.find((i) => i.id === intentId) : pickCurrentIntent(intents);
66309
+ sourceNote = intentId ? `intent ${intentId}` : 'current intent';
66310
+ if (!subject) {
66311
+ return {
66312
+ content: [{
66313
+ type: 'text',
66314
+ text: intentId ? `No intent with id "${intentId}" in this workspace.` : 'No intents found in workspace.',
66315
+ }],
66316
+ };
66317
+ }
66318
+ }
66319
+ }
66320
+ const verdict = (0, readiness_1.computeReadinessVerdict)(subject);
66321
+ const title = (0, readiness_1.coerceText)(subject.title);
66322
+ return {
66323
+ content: [{
66324
+ type: 'text',
66325
+ text: `${(0, readiness_1.formatReadinessVerdict)(verdict, title)}\n\nChecked: ${sourceNote}.`,
66326
+ }],
66327
+ };
66328
+ });
65996
66329
  server.tool('intent_save', 'Save an intent spec to intent.md in the project root. Called after building a spec through conversation. Re-saving the same intent bumps its version and preserves its status; it never silently replaces a different intent.', {
65997
66330
  spec: zod_1.z.object(intentSpecSchema),
65998
66331
  path: zod_1.z.string().optional().describe('File path relative to the project root. Must stay inside the project (absolute paths and ".." are rejected). Defaults to intent.md'),
@@ -29,6 +29,10 @@ export interface IntentFields {
29
29
  id?: string;
30
30
  title: string;
31
31
  objective: string;
32
+ /** Author-written as-is behavior: how it works today, before this change.
33
+ * Distinct from implementationContext.currentBehavior, which the analyzer
34
+ * derives from the repo. */
35
+ currentState?: string;
32
36
  outcomes: (string | {
33
37
  id?: string;
34
38
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/intent-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,WAAW,cAAc;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAA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,CAwF5D;AAOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CA4DhE;AAOD,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAsLD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,GAAE,oBAAyB,GAAG,MAAM,CAmC/F"}
@@ -33,6 +33,8 @@ export interface LocalIntent {
33
33
  status: string;
34
34
  version: number;
35
35
  objective: string;
36
+ /** Author-written as-is behavior, from the `## Current State` section. */
37
+ currentState?: string;
36
38
  title: string;
37
39
  stageName?: string;
38
40
  severity?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/local-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,MAAM,CAAC;AAE1G,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wGAAwG;AACxG,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAClC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAA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AAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtD,YAAY,EAAE,iBAAiB,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,EAAE,CAmBhD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAcvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAwCnE"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Deterministic intent readiness gate — the preflight.
3
+ *
4
+ * This is a PORT of the canonical gate in lib/intentReadiness.ts (the MCP package
5
+ * cannot import app/lib code). Every regex and threshold below must stay
6
+ * byte-identical to the source; lib/preflightReadinessParity.test.ts in the app
7
+ * repo runs both implementations over the 98-item calibration corpus and the
8
+ * Preflight demo specs, and fails CI on any divergence. Edit the app lib first,
9
+ * then mirror the change here.
10
+ *
11
+ * Pure functions only: no I/O, no network, no model calls. The same spec gets
12
+ * the same verdict every run — that determinism is the product claim on
13
+ * https://preflight.pathmode.io, so keep it true.
14
+ */
15
+ export declare function coerceText(value: unknown): string;
16
+ export declare function asArray<T>(value: T | T[] | null | undefined): T[];
17
+ export declare function isTitleMeaningful(title: string | null | undefined): boolean;
18
+ export declare function isConstraintConcrete(value: unknown): boolean;
19
+ export declare function isVerificationCheckSubstantive(description: string | null | undefined): boolean;
20
+ export declare function isObjectiveSpecific(objective: string | null | undefined): boolean;
21
+ export declare function isOutcomeMeasurable(text: string): boolean;
22
+ export declare const READINESS_BLOCKER_DESCRIPTIONS: Record<string, string>;
23
+ /** Display order for the gate strip (title first, matching the Preflight page). */
24
+ export declare const READINESS_GATE_ORDER: readonly ["goal", "objective", "outcomes", "constraints", "edgeCases", "verification"];
25
+ /** Loose spec shape: covers LocalIntent, cloud intent JSON, and hand-built specs. */
26
+ export interface ReadinessSpecInput {
27
+ title?: unknown;
28
+ objective?: unknown;
29
+ outcomes?: unknown;
30
+ constraints?: unknown;
31
+ edgeCases?: unknown;
32
+ verification?: unknown;
33
+ }
34
+ export interface ReadinessVerdict {
35
+ ready: boolean;
36
+ signals: Record<string, boolean>;
37
+ failingBlockers: string[];
38
+ }
39
+ /**
40
+ * The preflight: six deterministic gates over an intent spec. Mirrors
41
+ * lib/intentReadiness.computeReviewSignals with conversationFirst semantics
42
+ * (the legacy phase-engagement signal never gates the verdict here).
43
+ */
44
+ export declare function computeReadinessVerdict(spec: ReadinessSpecInput): ReadinessVerdict;
45
+ /** Human/agent-readable verdict block, stable enough to parse by line prefix. */
46
+ export declare function formatReadinessVerdict(verdict: ReadinessVerdict, specTitle?: string): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQjD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,EAAE,CAIjE;AAoCD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAQ3E;AAID,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI5D;AAED,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAI9F;AAQD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAOjF;AAQD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKzD;AAID,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOjE,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,wFAAyF,CAAC;AAK3H,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B;AAoBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,kBAAkB,GAAG,gBAAgB,CAkBlF;AAWD,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB5F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathmode/mcp-server",
3
- "version": "1.9.1",
3
+ "version": "1.11.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/skills/README.md CHANGED
@@ -12,6 +12,7 @@ Listed in lifecycle order — most projects use them in roughly this sequence.
12
12
  |-------|----------|
13
13
  | `setup-pathmode-workflow` | First-time setup — capturing test commands, issue tracker, status conventions |
14
14
  | `compile-intent` | Building a structured spec for what to ship |
15
+ | `preflight` | Deterministic readiness verdict before an agent builds — six gates, exact blockers, no model call |
15
16
  | `verify-intent` | Designing the executable feedback loop for a spec (fastest check, manual fallback, shipped signal) |
16
17
  | `grill-intent` | Stress-testing an existing spec for weaknesses before code is written |
17
18
  | `split-intent-to-issues` | Breaking a spec into paste-ready Linear / Jira / GitHub Issues tickets |
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: preflight
3
+ description: Run the deterministic readiness check on an intent spec before an agent builds against it. Six calibrated gates, computed by pure functions — no model judgment, same spec always gets the same verdict. Use before implementing an intent, before handing a spec to another agent, or whenever the user asks "is this spec ready?".
4
+ ---
5
+
6
+ <what-to-do>
7
+
8
+ Call the `check_intent_readiness` MCP tool (Pathmode). With no arguments it checks the current intent (`intent.md` in local mode, the active workspace intent in cloud mode). Pass `spec` inline to preflight a draft before saving it, or `intentId` for a specific saved intent.
9
+
10
+ Show the user the verdict block exactly as returned — the blocker strings are the calibrated gate output, do not paraphrase them.
11
+
12
+ If the verdict fails: repair, one blocker at a time. For each failing gate, ask the user ONE targeted question, and propose your best-guess answer from the spec and the codebase so they can correct rather than compose. Apply the agreed fix to the spec (`intent_save` in local mode), then re-run `check_intent_readiness`. Stop when the verdict passes or the user explicitly accepts a named gap.
13
+
14
+ If the verdict passes: say so and stop. Do not invent extra requirements beyond the six gates.
15
+
16
+ </what-to-do>
17
+
18
+ <supporting-info>
19
+
20
+ ## What the six gates check
21
+
22
+ 1. **Title** — a short, specific noun phrase, not a placeholder or generic label ("Bulk edit" passes; "New feature" fails).
23
+ 2. **Objective** — names an actor and a concrete problem or capability; rejects buzzword-dressed vagueness with no number.
24
+ 3. **Outcomes** — at least two, and at least two-thirds measurable: a threshold, an observable capability, or a concrete state change. "Users are happier" fails.
25
+ 4. **Constraints** — at least one violable statement, something an implementation could actually break ("Never double-charge on retry"). Bare adjectives fail.
26
+ 5. **Edge cases** — at least one scenario with a defined expected behavior.
27
+ 6. **Verification** — at least one check concrete enough to run without asking the author.
28
+
29
+ ## Why deterministic matters
30
+
31
+ The gate is pure functions over the spec text: no model call, no network. Re-running never changes the verdict unless the spec changed. That makes it a floor you can put in front of any implementation work — and it means a passing verdict is reproducible evidence, not an opinion. The same gate runs live at preflight.pathmode.io.
32
+
33
+ ## Division of labor with the other skills
34
+
35
+ - `preflight` — deterministic verdict: IS the spec ready? Cheap, run it first and often.
36
+ - `grill-intent` — adversarial model-driven review: is the spec WISE? Run it when preflight passes but the stakes are high.
37
+ - `compile-intent` — builds a spec from a vague problem. Preflight what it produces.
38
+
39
+ </supporting-info>