dude-claude-plugin 2026.2.11 → 2026.2.12

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dude-claude-plugin",
3
- "version": "2026.2.11",
3
+ "version": "2026.2.12",
4
4
  "description": "Ultra-minimal RAG and cross-project memory for Claude CLI",
5
5
  "author": {
6
6
  "name": "Fingerskier"
@@ -21,13 +21,18 @@ switch (command) {
21
21
  await import('../hooks/auto-persist.js');
22
22
  break;
23
23
  }
24
+ case 'auto-persist-plan': {
25
+ await import('../hooks/auto-persist-plan.js');
26
+ break;
27
+ }
24
28
  default:
25
- console.error(`Usage: dude-claude [mcp|serve|auto-retrieve|auto-persist]
29
+ console.error(`Usage: dude-claude [mcp|serve|auto-retrieve|auto-persist|auto-persist-plan]
26
30
 
27
31
  Commands:
28
- mcp Start the MCP stdio server (default)
29
- serve Start the web UI server on http://127.0.0.1:${process.env.DUDE_PORT || 3456}
30
- auto-retrieve Run the auto-retrieve hook (reads prompt from stdin)
31
- auto-persist Run the auto-persist hook (reads classification from stdin)`);
32
+ mcp Start the MCP stdio server (default)
33
+ serve Start the web UI server on http://127.0.0.1:${process.env.DUDE_PORT || 3456}
34
+ auto-retrieve Run the auto-retrieve hook (reads prompt from stdin)
35
+ auto-persist Run the auto-persist hook (reads classification from stdin)
36
+ auto-persist-plan Run the auto-persist-plan hook for plan events`);
32
37
  process.exit(1);
33
38
  }
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SubagentStop hook (Plan matcher) — auto-persist plan records.
5
+ * Reads classification JSON from stdin, upserts plan as a spec record.
6
+ * On malformed JSON or action=none, exits silently.
7
+ */
8
+
9
+ import { embed } from '../src/embed.js';
10
+ import { initDb, upsertRecord, getCurrentProject } from '../src/db.js';
11
+
12
+ try {
13
+ const chunks = [];
14
+ for await (const chunk of process.stdin) {
15
+ chunks.push(chunk);
16
+ }
17
+ const raw = Buffer.concat(chunks).toString().trim();
18
+
19
+ let input;
20
+ try {
21
+ input = JSON.parse(raw);
22
+ } catch {
23
+ process.stdout.write('Auto-persist-plan skipped: malformed JSON from classification prompt\n');
24
+ process.exit(0);
25
+ }
26
+
27
+ if (!input.action || input.action === 'none') {
28
+ process.exit(0);
29
+ }
30
+
31
+ if (input.action === 'upsert') {
32
+ const kind = input.kind || 'spec';
33
+ const title = input.title || 'Untitled Plan';
34
+ const body = input.body || '';
35
+ const status = input.status || 'open';
36
+
37
+ await initDb();
38
+ const text = `${title} ${body}`.trim();
39
+ const embedding = await embed(text);
40
+
41
+ const record = upsertRecord(
42
+ {
43
+ projectId: getCurrentProject().id,
44
+ kind,
45
+ title,
46
+ body,
47
+ status,
48
+ },
49
+ embedding,
50
+ );
51
+
52
+ process.stdout.write(`Auto-persisted plan as ${kind}: "${record.title}" (id=${record.id})\n`);
53
+ }
54
+ } catch (err) {
55
+ // Non-blocking: exit cleanly on any error
56
+ console.error(`[dude] auto-persist-plan error: ${err.message}`);
57
+ process.stdout.write(`Auto-persist-plan skipped: ${err.message}\n`);
58
+ process.exit(0);
59
+ }
package/hooks.json CHANGED
@@ -11,12 +11,29 @@
11
11
  ]
12
12
  }
13
13
  ],
14
+ "SubagentStop": [
15
+ {
16
+ "matcher": "Plan",
17
+ "hooks": [
18
+ {
19
+ "type": "prompt",
20
+ "prompt": "A plan has been created. Review it and output JSON to save it as a project spec: {\"action\":\"upsert\",\"kind\":\"spec\",\"title\":\"<plan title>\",\"body\":\"<full plan details including steps>\",\"status\":\"open\"}. Output ONLY the JSON, no other text.",
21
+ "timeout": 30
22
+ },
23
+ {
24
+ "type": "command",
25
+ "command": "npx -y dude-claude-plugin auto-persist-plan",
26
+ "timeout": 60
27
+ }
28
+ ]
29
+ }
30
+ ],
14
31
  "Stop": [
15
32
  {
16
33
  "hooks": [
17
34
  {
18
35
  "type": "prompt",
19
- "prompt": "Review the conversation. If a bug was fixed, output JSON: {\"action\":\"upsert\",\"kind\":\"issue\",\"title\":\"...\",\"body\":\"...\",\"status\":\"resolved\"}. If a feature or improvement was made, output JSON: {\"action\":\"upsert\",\"kind\":\"spec\",\"title\":\"...\",\"body\":\"...\"}. If neither, output {\"action\":\"none\"}. Output ONLY the JSON, no other text.",
36
+ "prompt": "Review the conversation. If a bug was fixed, output JSON: {\"action\":\"upsert\",\"kind\":\"issue\",\"title\":\"...\",\"body\":\"...\",\"status\":\"resolved\"}. If a feature or improvement was made (including completing a plan), output JSON: {\"action\":\"upsert\",\"kind\":\"spec\",\"title\":\"...\",\"body\":\"<summary of what was implemented>\",\"status\":\"resolved\"}. If a plan was created but not yet implemented, output {\"action\":\"none\"}. If neither applies, output {\"action\":\"none\"}. Output ONLY the JSON, no other text.",
20
37
  "timeout": 30
21
38
  },
22
39
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dude-claude-plugin",
3
- "version": "2026.2.11",
3
+ "version": "2026.2.12",
4
4
  "description": "Ultra-minimal RAG and cross-project memory for Claude CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,10 @@
12
12
  "scripts": {
13
13
  "start": "node bin/dude-claude.js mcp",
14
14
  "serve": "node bin/dude-claude.js serve",
15
- "prepublishOnly": "node scripts/sync-plugin-version.cjs"
15
+ "prepublishOnly": "node scripts/sync-plugin-version.cjs",
16
+ "release": "npm version patch && git push && git push --tags && npm publish",
17
+ "release:minor": "npm version minor && git push && git push --tags && npm publish",
18
+ "release:major": "npm version major && git push && git push --tags && npm publish"
16
19
  },
17
20
  "keywords": [
18
21
  "claude",