@planu/cli 8.2.3 → 8.2.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [8.2.4] - 2026-09-24
4
+
5
+ - MCP handshake reports the package.json version instead of a hardcoded one
6
+ - `sdd_lock_spec` requires GIVEN/WHEN/THEN acceptance criteria before locking
7
+ - `sdd_init_workspace` surfaces host pack and global skill copy failures instead of writing stubs
8
+ - a CREATE manifest entry accepts search/replace patches after the file exists
9
+ - Claude Code plugin ships `planu-guard` hooks: native writes are denied while a locked feature has an unchecked task, `git --no-verify` is denied, and session start re-injects the active task
10
+ - README documents the Codex plugin install and the Cursor install deeplink
11
+ - `pnpm eval:skills` also measures the spec-executor skill
12
+ - verification-auditor skill checks for silent failures
13
+
3
14
  ## [8.2.3] - 2026-09-24
4
15
 
5
16
  - manifest parser ignores `none` placeholder paths and re-evaluates the section at every heading, so a plan title containing "File Manifest" no longer empties the manifest (`sdd_lock_spec` / `sdd_apply_file_patch`)
package/README.md CHANGED
@@ -34,7 +34,26 @@ Claude Code users can install Planu as a plugin instead of hand-editing `.mcp.js
34
34
  /plugin install planu@planu
35
35
  ```
36
36
 
37
- This registers the same `npx -y @planu/cli@latest` server.
37
+ This registers the same `npx -y @planu/cli@latest` server. The plugin also ships `planu-guard` hooks: while a locked feature has an unchecked task, native `Write`/`Edit` inside the workspace is denied in favor of `sdd_apply_file_patch`; `git ... --no-verify` is denied; and session start re-injects the active task. Disable them with the plugin manager.
38
+
39
+ ### Codex plugin
40
+
41
+ Codex CLI reads the same marketplace:
42
+
43
+ ```
44
+ codex plugin marketplace add planu-dev/planu
45
+ codex plugin add planu@planu
46
+ ```
47
+
48
+ This registers the same `npx -y @planu/cli@latest` server as MCP server `planu`. The `planu-guard` hooks are Claude Code only.
49
+
50
+ ### Cursor one-click install
51
+
52
+ Open this link in a browser with Cursor installed. It installs the server below with `PLANU_WORKSPACE` bound to `${workspaceFolder}`:
53
+
54
+ ```
55
+ cursor://anysphere.cursor-deeplink/mcp/install?name=planu&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBwbGFudS9jbGlAbGF0ZXN0Il0sImVudiI6eyJQTEFOVV9XT1JLU1BBQ0UiOiIke3dvcmtzcGFjZUZvbGRlcn0ifX0=
56
+ ```
38
57
 
39
58
  Paste this into **Claude Code, Cursor, Windsurf, Codex, Copilot, Gemini CLI, OpenCode, or any stdio MCP client**. Prefer a **project** config so the host can bind the open folder. A user-global server with no workspace interpolation will start in `$HOME` and fail closed.
40
59
 
@@ -98,7 +117,7 @@ sdd_init_workspace → sdd_create_feature → architect trinity → sdd_lock_spe
98
117
  1. **Initialize:** `sdd_init_workspace` writes `.sdd/features`, stamps host rules, and copies cognitive skills into `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`. Existing `AGENTS.md` is preserved unless `force: true` or it is still a v6 host contract.
99
118
  2. **Architect:** Adopt `spec-architect.md`. Call `sdd_create_feature` with a title and omit `id` to reserve the next global `FEAT-NNNN-TITLE` identifier. Explicit `FEAT-*` IDs remain supported for imports; `SPEC-001` is rejected.
100
119
  3. **Lock:** `sdd_lock_spec` hashes spec, plan, and tasks. It rejects empty skeletons. Reseal after review with `relock: true` and `reason`.
101
- 4. **Execute:** `sdd_get_active_task` → `sdd_apply_file_patch` → `sdd_complete_task`. CREATE, MODIFY, and READ_ONLY may use `*` / `**` (dot-prefixed segments require an exact entry). DELETE is an exact path. `.sdd/` and `.git/` are never writable.
120
+ 4. **Execute:** `sdd_get_active_task` → `sdd_apply_file_patch` → `sdd_complete_task`. CREATE, MODIFY, and READ_ONLY may use `*` / `**` (dot-prefixed segments require an exact entry). DELETE is an exact path. A CREATE entry accepts search/replace patches after the file exists. `.sdd/` and `.git/` are never writable.
102
121
  5. **Verify:** independently prove acceptance criteria with `verification-auditor.md`.
103
122
  6. **Janitor:** prune local branches and orphaned worktrees only with authorization.
104
123
 
@@ -150,7 +169,7 @@ MCP:
150
169
  node dist/sdd-engine/cli.js
151
170
  ```
152
171
 
153
- `pnpm eval:skills` is an operator-only eval of the spec-architect skill. It spends API budget by shelling out to the local `claude` CLI against a throwaway workspace, so it is not part of `pnpm check` and never runs in CI.
172
+ `pnpm eval:skills` is an operator-only eval of the spec-architect and spec-executor skills. Executor cases (`"skill": "executor"`) ship a locked trinity and fail on unchecked tasks, edits outside the File Manifest, or failing `checks`. It spends API budget by shelling out to the local `claude` CLI against a throwaway workspace, so it is not part of `pnpm check` and never runs in CI.
154
173
 
155
174
  ---
156
175
 
@@ -43,14 +43,9 @@ export async function copyGlobalRules(workspaceRoot, force) {
43
43
  if (existed && force !== true && !isStaleV6HostDoc(existing)) {
44
44
  return 'preserved';
45
45
  }
46
- try {
47
- const content = await fs.readFile(sourcePath, 'utf-8');
48
- await fs.writeFile(targetPath, content, 'utf-8');
49
- return existed ? 'replaced' : 'created';
50
- }
51
- catch {
52
- return existed ? 'preserved' : 'created';
53
- }
46
+ const content = await fs.readFile(sourcePath, 'utf-8');
47
+ await fs.writeFile(targetPath, content, 'utf-8');
48
+ return existed ? 'replaced' : 'created';
54
49
  }
55
50
  const HOST_SKILL_DESCRIPTIONS = {
56
51
  'preflight-guardian': 'Use before architecture, first execution, resumed work, or any change under src/sdd-engine.',
@@ -82,58 +77,48 @@ async function readHostBody() {
82
77
  }
83
78
  }
84
79
  export async function installHostSkillPack(workspaceRoot) {
85
- try {
86
- const skillsDir = path.join(TEMPLATES_ROOT, 'skills');
87
- const files = (await fs.readdir(skillsDir)).filter((file) => file.endsWith('.md'));
88
- const written = [];
89
- for (const file of files) {
90
- const slug = file.replace(/\.md$/u, '');
91
- const body = toHostSkillMarkdown(slug, await fs.readFile(path.join(skillsDir, file), 'utf-8'));
92
- const hostSlug = `planu-${slug}`;
93
- const targets = [
94
- path.join('.claude', 'skills', hostSlug, 'SKILL.md'),
95
- path.join('.cursor', 'skills', hostSlug, 'SKILL.md'),
96
- path.join('.agents', 'skills', hostSlug, 'SKILL.md'),
97
- path.join('.gemini', 'skills', `${hostSlug}.md`),
98
- ];
99
- for (const relative of targets) {
100
- const fullPath = path.join(workspaceRoot, relative);
101
- await fs.mkdir(path.dirname(fullPath), { recursive: true });
102
- await fs.writeFile(fullPath, body, 'utf-8');
103
- written.push(relative);
104
- }
80
+ const skillsDir = path.join(TEMPLATES_ROOT, 'skills');
81
+ const files = (await fs.readdir(skillsDir)).filter((file) => file.endsWith('.md'));
82
+ const written = [];
83
+ for (const file of files) {
84
+ const slug = file.replace(/\.md$/u, '');
85
+ const body = toHostSkillMarkdown(slug, await fs.readFile(path.join(skillsDir, file), 'utf-8'));
86
+ const hostSlug = `planu-${slug}`;
87
+ const targets = [
88
+ path.join('.claude', 'skills', hostSlug, 'SKILL.md'),
89
+ path.join('.cursor', 'skills', hostSlug, 'SKILL.md'),
90
+ path.join('.agents', 'skills', hostSlug, 'SKILL.md'),
91
+ path.join('.gemini', 'skills', `${hostSlug}.md`),
92
+ ];
93
+ for (const relative of targets) {
94
+ const fullPath = path.join(workspaceRoot, relative);
95
+ await fs.mkdir(path.dirname(fullPath), { recursive: true });
96
+ await fs.writeFile(fullPath, body, 'utf-8');
97
+ written.push(relative);
105
98
  }
106
- return written;
107
- }
108
- catch {
109
- return [];
110
99
  }
100
+ return written;
111
101
  }
112
102
  export async function installHostRulePack(workspaceRoot) {
113
- try {
114
- const body = await readHostBody();
115
- const cursorRule = `---
103
+ const body = await readHostBody();
104
+ const cursorRule = `---
116
105
  description: Planu v8 FEAT-only. Specs live in .sdd/features. Never write planu/specs or SPEC-* stubs.
117
106
  alwaysApply: true
118
107
  ---
119
108
 
120
109
  ${body}`;
121
- const targets = [
122
- { relative: path.join('.cursor', 'rules', 'planu-sdd.mdc'), contents: cursorRule },
123
- { relative: path.join('.claude', 'rules', 'planu-sdd.md'), contents: body },
124
- { relative: path.join('.gemini', 'planu-sdd.md'), contents: body },
125
- ];
126
- const written = [];
127
- for (const target of targets) {
128
- const fullPath = path.join(workspaceRoot, target.relative);
129
- await fs.mkdir(path.dirname(fullPath), { recursive: true });
130
- await fs.writeFile(fullPath, target.contents, 'utf-8');
131
- written.push(target.relative);
132
- }
133
- return written;
134
- }
135
- catch {
136
- return [];
110
+ const targets = [
111
+ { relative: path.join('.cursor', 'rules', 'planu-sdd.mdc'), contents: cursorRule },
112
+ { relative: path.join('.claude', 'rules', 'planu-sdd.md'), contents: body },
113
+ { relative: path.join('.gemini', 'planu-sdd.md'), contents: body },
114
+ ];
115
+ const written = [];
116
+ for (const target of targets) {
117
+ const fullPath = path.join(workspaceRoot, target.relative);
118
+ await fs.mkdir(path.dirname(fullPath), { recursive: true });
119
+ await fs.writeFile(fullPath, target.contents, 'utf-8');
120
+ written.push(target.relative);
137
121
  }
122
+ return written;
138
123
  }
139
124
  //# sourceMappingURL=host-rule-pack.js.map
@@ -2,13 +2,14 @@ import { createHash } from 'node:crypto';
2
2
  import * as fs from 'node:fs/promises';
3
3
  import * as path from 'node:path';
4
4
  const CHECKBOX_TASK = /^[-*]\s*\[[ xX]\]/u;
5
+ const BDD_KEYWORDS = [/\bGIVEN\b/u, /\bWHEN\b/u, /\bTHEN\b/u];
5
6
  export function hashArtifact(content) {
6
7
  return createHash('sha256').update(content).digest('hex');
7
8
  }
8
9
  function assessTrinityCompleteness(specContent, planContent, tasksContent) {
9
10
  const specOk = hasHeading(specContent, 'Out-of-Scope') &&
10
11
  hasHeading(specContent, 'Error Matrix') &&
11
- (hasHeading(specContent, 'Acceptance Criteria') || /\bGIVEN\b/u.test(specContent));
12
+ BDD_KEYWORDS.every((keyword) => keyword.test(specContent));
12
13
  const planOk = hasHeading(planContent, 'Frozen Dependencies') && hasHeading(planContent, 'File Manifest');
13
14
  const hasTask = tasksContent.split('\n').some((line) => CHECKBOX_TASK.test(line.trim()));
14
15
  const manifest = scanManifest(planContent);
@@ -25,7 +26,7 @@ function assessTrinityCompleteness(specContent, planContent, tasksContent) {
25
26
  return {
26
27
  ok: false,
27
28
  code: 'ERR_TRINITY_INCOMPLETE',
28
- message: 'Lock requires Out-of-Scope, Error Matrix, Acceptance Criteria or GIVEN, Frozen Dependencies, a File Manifest path, and at least one checkbox task.',
29
+ message: 'Lock requires Out-of-Scope, Error Matrix, GIVEN/WHEN/THEN acceptance criteria, Frozen Dependencies, a File Manifest path, and at least one checkbox task.',
29
30
  };
30
31
  }
31
32
  export async function verifyLockedTrinity(featDir) {
@@ -39,15 +39,16 @@ export class PatchSandbox {
39
39
  },
40
40
  };
41
41
  }
42
+ const effective = permission === 'CREATE' && searchContent !== '' ? 'MODIFY' : permission;
42
43
  const fullPath = path.resolve(this.workspaceRoot, normalizedTarget);
43
- const containmentError = await this.validateTargetContainment(fullPath, normalizedTarget, permission);
44
+ const containmentError = await this.validateTargetContainment(fullPath, normalizedTarget, effective);
44
45
  if (containmentError) {
45
46
  return containmentError;
46
47
  }
47
- if (permission === 'CREATE') {
48
+ if (effective === 'CREATE') {
48
49
  return this.executeCreatePatch(fullPath, normalizedTarget, searchContent, replaceContent);
49
50
  }
50
- if (permission === 'DELETE') {
51
+ if (effective === 'DELETE') {
51
52
  return this.executeDeletePatch(fullPath, normalizedTarget, searchContent, replaceContent);
52
53
  }
53
54
  return this.executeModifyPatch(fullPath, normalizedTarget, searchContent, replaceContent);
@@ -1,10 +1,12 @@
1
+ import { readFileSync } from 'node:fs';
1
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
4
  import { registerUltralightSddTools } from './tools.js';
5
+ const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
4
6
  export function createUltralightSddServer(workspaceRoot) {
5
7
  const server = new McpServer({
6
8
  name: 'sdd-engine',
7
- version: '8.2.2',
9
+ version,
8
10
  }, {
9
11
  capabilities: {
10
12
  tools: {},
@@ -233,19 +233,13 @@ function isNodeErrorCode(err, code) {
233
233
  }
234
234
  async function copySkillTemplates(skillsDir) {
235
235
  const sourceSkillsDir = path.resolve(moduleDir, '..', '..', '..', 'templates', 'skills');
236
- try {
237
- const files = await fs.readdir(sourceSkillsDir);
238
- for (const file of files) {
239
- if (file.endsWith('.md')) {
240
- const content = await fs.readFile(path.join(sourceSkillsDir, file), 'utf-8');
241
- await fs.writeFile(path.join(skillsDir, file), content, 'utf-8');
242
- }
236
+ const files = await fs.readdir(sourceSkillsDir);
237
+ for (const file of files) {
238
+ if (file.endsWith('.md')) {
239
+ const content = await fs.readFile(path.join(sourceSkillsDir, file), 'utf-8');
240
+ await fs.writeFile(path.join(skillsDir, file), content, 'utf-8');
243
241
  }
244
242
  }
245
- catch {
246
- await fs.writeFile(path.join(skillsDir, 'spec-architect.md'), '# Spec Architect Skill\n\nDefine Out-of-Scope, Contracts, and File Manifest.\n', 'utf-8');
247
- await fs.writeFile(path.join(skillsDir, 'spec-executor.md'), '# Spec Executor Skill\n\nOperate in Zero-Freedom mode.\n', 'utf-8');
248
- }
249
243
  }
250
244
  async function collectFeatures(featuresDir, taskWindow, statusFilter) {
251
245
  const result = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "8.2.3",
3
+ "version": "8.2.4",
4
4
  "description": "Planu — MCP Server for Spec Driven Development. Cross-platform (Linux/macOS/Windows, x64/arm64).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,6 +47,12 @@ Count-only assertions, existence checks, snapshots without semantics, and tests
47
47
  - For `website/**` or `planu.dev`, adopt `visual-release-auditor.md` and require executed browser evidence. Do not approve from tests or curl alone.
48
48
  - For deletion or legacy retirement, prove absence from runtime reachability, package contents, templates, active documentation, and supported entrypoints.
49
49
 
50
+ ## Silent failures
51
+
52
+ - Search the diff for swallowed failures: empty catch blocks, catch blocks returning defaults ([], '', false, null, success values), .catch(() => …) that converts a rejection into success, || true, and ignored exit codes.
53
+ - Each one must rethrow, return a typed error the caller surfaces, or be a deliberate probe or fallback whose safety is evident from the code.
54
+ - A result that reports success, created, or an empty list while the underlying operation failed is CHANGES_REQUESTED.
55
+
50
56
  ## Verdict
51
57
 
52
58
  Emit exactly one verdict: