@planu/cli 8.2.1 → 8.2.2

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,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [8.2.2] - 2026-09-21
4
+
5
+ - `sdd_init_workspace` copies cognitive skills into `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/` instead of `.sdd/skills` in client projects
6
+
3
7
  ## [8.2.1] - 2026-09-21
4
8
 
5
9
  - reject `sdd_apply_file_patch` under `planu/specs`; `sdd_list_features` / `sdd_init_workspace` warn when that tree exists, without a `legacy` catalog
package/README.md CHANGED
@@ -16,7 +16,7 @@ Planu v8 is a **thin MCP sandbox + cognitive skills** stack for Spec Driven Deve
16
16
  - **Zero-Freedom Execution** — mutations and exact `DELETE:` operations go through `sdd_apply_file_patch`; the File Manifest is the sandbox
17
17
  - **Single Task Window** — `sdd_get_active_task` + `sdd_read_file_slice`
18
18
  - **9 Canonical MCP Tools** — listed below
19
- - **Cognitive gates** — `.sdd/skills/` personas replace `challenge_spec` / `check_readiness` / `validate`
19
+ - **Cognitive gates** — host skills under `.claude/skills/planu-*`, `.cursor/skills/planu-*`, and `.agents/skills/planu-*` replace `challenge_spec` / `check_readiness` / `validate`
20
20
  - **Git Hygiene** — `git-janitor.md` skill (the server does not mutate Git)
21
21
 
22
22
  Authentication is **not required**. Do not call `mcp_auth`.
@@ -84,7 +84,7 @@ The published server asks the host for MCP roots and binds to the open project t
84
84
  sdd_init_workspace → sdd_create_feature → architect trinity → sdd_lock_spec → execute tasks → verify → git-janitor
85
85
  ```
86
86
 
87
- 1. **Initialize:** `sdd_init_workspace` writes `.sdd/`, copies skills, and stamps `.cursor/rules/planu-sdd.mdc`, `.claude/rules/planu-sdd.md`, and `.gemini/planu-sdd.md`. Existing `AGENTS.md` is preserved unless `force: true` or it is still a v6 host contract.
87
+ 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.
88
88
  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.
89
89
  3. **Lock:** `sdd_lock_spec` hashes spec, plan, and tasks. It rejects empty skeletons. Reseal after review with `relock: true` and `reason`.
90
90
  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.
@@ -114,7 +114,11 @@ src/
114
114
  │ ├── plan.md
115
115
  │ ├── tasks.md
116
116
  │ └── .lock
117
- └── skills/ # preflight, architect, executor, verifier, sunset, reconciler, lib-sync, janitor
117
+
118
+ .claude/skills/planu-*/SKILL.md # Claude Code
119
+ .cursor/skills/planu-*/SKILL.md # Cursor
120
+ .agents/skills/planu-*/SKILL.md # Codex
121
+ .gemini/skills/planu-*.md # Gemini
118
122
  ```
119
123
 
120
124
  ---
@@ -1,4 +1,5 @@
1
1
  export declare function isStaleV6HostDoc(content: string): boolean;
2
2
  export declare function copyGlobalRules(workspaceRoot: string, force?: boolean): Promise<'preserved' | 'replaced' | 'created'>;
3
+ export declare function installHostSkillPack(workspaceRoot: string): Promise<string[]>;
3
4
  export declare function installHostRulePack(workspaceRoot: string): Promise<string[]>;
4
5
  //# sourceMappingURL=host-rule-pack.d.ts.map
@@ -11,7 +11,7 @@ The only SDD contract is \`.sdd/features/{FEAT-*}/spec.md\`, \`plan.md\`, and \`
11
11
  - Use the nine \`sdd_*\` tools. Never call deleted v6 tools (\`create_spec\`, \`challenge_spec\`, \`check_readiness\`, \`validate\`, \`planu_status\`, …).
12
12
  - Never create, thin, or copy files under \`planu/specs/\`. Planu does not read that tree.
13
13
  - If a pre-push, commitlint, or husky guard still requires \`planu/specs/SPEC-*/spec.md\`, that guard is the defect. Delete or rewrite it. Do not stub a SPEC file.
14
- - Quality lives in \`.sdd/skills/\`. There is no validate MCP tool.
14
+ - Quality lives in \`.claude/skills/\`, \`.cursor/skills/\`, \`.agents/skills/\`, and \`.gemini/skills/\`. Specs stay in \`.sdd/features\`. There is no validate MCP tool.
15
15
  `;
16
16
  const PROHIBITION = /\b(never|do not|don't|no longer|not|forbidden|prohibited|deleted|removed|retired|invalid|reject(?:s|ed)?)\b/iu;
17
17
  const LEGACY_TREE = /planu\/specs\/SPEC-|write (?:specs )?to planu\/specs/iu;
@@ -52,6 +52,27 @@ export async function copyGlobalRules(workspaceRoot, force) {
52
52
  return existed ? 'preserved' : 'created';
53
53
  }
54
54
  }
55
+ const HOST_SKILL_DESCRIPTIONS = {
56
+ 'preflight-guardian': 'Use before architecture, first execution, resumed work, or any change under src/sdd-engine.',
57
+ 'spec-architect': 'Use when creating or completing an unlocked Holy Trinity before user-approved lock.',
58
+ 'spec-executor': 'Use when implementing the active task of a locked FEAT-* through sdd_apply_file_patch.',
59
+ 'verification-auditor': 'Use after implementation to independently prove locked BDD and task verification commands.',
60
+ 'visual-release-auditor': 'Use when website or planu.dev layout, CSS, or deploy needs desktop and mobile browser proof.',
61
+ 'legacy-sunset': 'Use only for classified, snapshotted, and explicitly authorized permanent legacy retirement.',
62
+ reconciler: 'Use when requirements changed while a feature is unlocked, or a locked delta must be identified.',
63
+ 'lib-sync': 'Use when core or public package behavior, metadata, templates, or tool surface changes.',
64
+ 'git-janitor': 'Use after approval or abandonment, before switching context, with authorization for destructive Git.',
65
+ };
66
+ function toHostSkillMarkdown(slug, source) {
67
+ const body = source.replace(/^---[\s\S]*?---\n*/u, '');
68
+ const description = HOST_SKILL_DESCRIPTIONS[slug] ?? `Planu SDD cognitive skill ${slug}.`;
69
+ return `---
70
+ name: planu-${slug}
71
+ description: ${description}
72
+ ---
73
+
74
+ ${body}`;
75
+ }
55
76
  async function readHostBody() {
56
77
  try {
57
78
  return await fs.readFile(path.join(TEMPLATES_ROOT, 'host', 'planu-sdd.md'), 'utf-8');
@@ -60,6 +81,34 @@ async function readHostBody() {
60
81
  return FALLBACK_HOST_BODY;
61
82
  }
62
83
  }
84
+ 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
+ }
105
+ }
106
+ return written;
107
+ }
108
+ catch {
109
+ return [];
110
+ }
111
+ }
63
112
  export async function installHostRulePack(workspaceRoot) {
64
113
  try {
65
114
  const body = await readHostBody();
@@ -4,7 +4,7 @@ import { registerUltralightSddTools } from './tools.js';
4
4
  export function createUltralightSddServer(workspaceRoot) {
5
5
  const server = new McpServer({
6
6
  name: 'sdd-engine',
7
- version: '8.2.1',
7
+ version: '8.2.2',
8
8
  }, {
9
9
  capabilities: {
10
10
  tools: {},
@@ -6,7 +6,7 @@ import { TaskWindowManager } from '../task-window.js';
6
6
  import { formatResult } from './format-result.js';
7
7
  import { homeFallbackFailure } from '../workspace-root.js';
8
8
  import { writeLockedTrinity } from '../lock-integrity.js';
9
- import { copyGlobalRules, installHostRulePack } from '../host-rule-pack.js';
9
+ import { copyGlobalRules, installHostRulePack, installHostSkillPack } from '../host-rule-pack.js';
10
10
  const moduleDir = path.dirname(fileURLToPath(import.meta.url));
11
11
  const MISSING_SDD_HINT = 'No .sdd directory in the client project. Call sdd_init_workspace with scope=project. MCP hosts should advertise roots; do not pin PLANU_WORKSPACE globally.';
12
12
  const LEGACY_SPECS_HINT = 'Planu ignores planu/specs. Do not create SPEC-* stubs or copy a FEAT into that tree. Retire host hooks that require planu/specs/SPEC-*/spec.md; the only contract is .sdd/features/FEAT-*.';
@@ -46,22 +46,28 @@ function registerInitTool(server, workspace) {
46
46
  const featuresDir = path.join(targetBase, 'features');
47
47
  const skillsDir = path.join(targetBase, 'skills');
48
48
  await fs.mkdir(featuresDir, { recursive: true });
49
- await fs.mkdir(skillsDir, { recursive: true });
50
- await copySkillTemplates(skillsDir);
49
+ if (args.scope === 'global') {
50
+ await fs.mkdir(skillsDir, { recursive: true });
51
+ await copySkillTemplates(skillsDir);
52
+ }
51
53
  const agentsMd = await copyGlobalRules(resolved.workspaceRoot, args.force);
52
54
  const hostRules = args.scope === 'project' ? await installHostRulePack(resolved.workspaceRoot) : [];
53
- const hint = await composeWorkspaceHint(resolved.workspaceRoot, 'Commit .sdd/ with the project. Host quality gates must map .sdd/ as versioned documentation. Cursor, Claude, Gemini, and Codex load Planu-owned host rules from sdd_init_workspace.');
55
+ const hostSkills = args.scope === 'project' ? await installHostSkillPack(resolved.workspaceRoot) : [];
56
+ const hint = await composeWorkspaceHint(resolved.workspaceRoot, 'Commit .sdd/features with the project. Host quality gates must map .sdd/ as versioned documentation. Cursor, Claude, Gemini, and Codex load Planu skills from sdd_init_workspace host folders, not .sdd/skills.');
54
57
  return formatResult({
55
58
  success: true,
56
59
  data: {
57
60
  initializedPath: targetBase,
58
61
  scope: args.scope,
59
62
  featuresDir,
60
- skillsDir,
63
+ skillsDir: args.scope === 'global'
64
+ ? skillsDir
65
+ : path.join(resolved.workspaceRoot, '.claude', 'skills'),
61
66
  workspaceRoot: resolved.workspaceRoot,
62
67
  source: resolved.source,
63
68
  agentsMd,
64
69
  hostRules,
70
+ hostSkills,
65
71
  versionedHint: hint,
66
72
  },
67
73
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "8.2.1",
3
+ "version": "8.2.2",
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",
@@ -4,7 +4,7 @@ You are operating within a Spec-Driven Development environment (Planu v8).
4
4
  Canonical contract: `PLANU_V8_MANIFESTO.txt`.
5
5
 
6
6
  1. **SDD Skills Primacy:**
7
- - ALWAYS refer to `.sdd/skills/` for role directives.
7
+ - ALWAYS refer to `.claude/skills/planu-*`, `.cursor/skills/planu-*`, `.agents/skills/planu-*`, or `.gemini/skills/planu-*` for role directives. Specs stay in `.sdd/features`.
8
8
  - Before beginning any task, load and adopt the matching persona (Preflight Guardian, Spec Architect, Spec Executor, Verification Auditor, Visual Release Auditor, Legacy Sunset, Reconciler, Git Janitor, Lib Sync).
9
9
  - Start architecture and execution with `preflight-guardian.md`; finish implementation with the independent `verification-auditor.md`. For `website/**` or `planu.dev`, also adopt `visual-release-auditor.md`.
10
10
  - Use `legacy-sunset.md` only for classified, snapshotted, and explicitly authorized permanent retirement.
@@ -47,7 +47,7 @@ Canonical contract: `PLANU_V8_MANIFESTO.txt`.
47
47
  7. **No v6 spec tree:**
48
48
  - Planu reads only `.sdd/features/FEAT-*`. Never create or thin `planu/specs/SPEC-*` to satisfy commitlint, husky, or a "known limitation".
49
49
  - If a host hook still requires the retired v6 tree, delete or rewrite the hook. Duplicating a FEAT into SPEC is forbidden.
50
- - `sdd_init_workspace` always stamps `.cursor/rules/planu-sdd.mdc`, `.claude/rules/planu-sdd.md`, and `.gemini/planu-sdd.md`. Existing `AGENTS.md` is preserved unless `force` is true or the file still treats the retired v6 tree as the contract. Never write `planu/specs/SPEC-*` and never call `create_spec`.
50
+ - `sdd_init_workspace` always stamps host rules and copies cognitive skills into `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`. Existing `AGENTS.md` is preserved unless `force` is true or the file still treats the retired v6 tree as the contract. Never write `planu/specs/SPEC-*` and never call `create_spec`.
51
51
 
52
52
  Failure to adhere to these rules compromises the SDD environment and is strictly forbidden.
53
53
 
@@ -6,4 +6,4 @@ The only SDD contract is `.sdd/features/{FEAT-*}/spec.md`, `plan.md`, and `tasks
6
6
  - Use the nine `sdd_*` tools. Never call deleted v6 tools (`create_spec`, `challenge_spec`, `check_readiness`, `validate`, `planu_status`, …).
7
7
  - Never create, thin, or copy files under `planu/specs/`. Planu does not read that tree.
8
8
  - If a pre-push, commitlint, or husky guard still requires `planu/specs/SPEC-*/spec.md`, that guard is the defect. Delete or rewrite it. Do not stub a SPEC file.
9
- - Quality lives in `.sdd/skills/`. There is no validate MCP tool.
9
+ - Quality lives in `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`. Specs stay in `.sdd/features`. There is no validate MCP tool.
@@ -18,7 +18,7 @@ Any change to the MCP core (`src/sdd-engine/**`, `src/types/sdd-engine.ts`, `src
18
18
  2. **Cognitive starter pack (copied by `sdd_init_workspace`)**
19
19
  - `templates/AGENTS.md`
20
20
  - `templates/host/planu-sdd.md`
21
- - `templates/skills/*.md`
21
+ - `templates/skills/*.md` copied by init into `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`
22
22
  - After editing templates, copy the same bytes into `.sdd/skills/` in this repo
23
23
 
24
24
  3. **Host skills / rules** if tool names, lifecycle, or install command changed