slyplan-mcp 1.2.0 → 1.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.
Files changed (2) hide show
  1. package/dist/cli.js +46 -45
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -5,77 +5,78 @@ import * as readline from 'readline';
5
5
  import { createClient } from '@supabase/supabase-js';
6
6
  const SUPABASE_URL = 'https://omfzpkwtuzucwwxmyuqt.supabase.co';
7
7
  const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9tZnpwa3d0dXp1Y3d3eG15dXF0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzA5MjMwNDIsImV4cCI6MjA4NjQ5OTA0Mn0.KXGoUez7M45RtFM9qR7mjzGX6UhlaRE-gggAJxSkIHY';
8
- const SYNC_REMINDER = "Remember to sync SlyPlan via MCP tools when you finish a meaningful chunk of work. Rules: (1) Match the RIGHT project first use list_projects + set_project if unsure. (2) Do NOT clutter — only create nodes for significant work, not every small edit. One node per feature/fix is enough. (3) Update EXISTING nodes instead of creating new ones when possible — use search to find relevant nodes first. (4) Ask the user with AskUserQuestion before marking anything as done — e.g. 'Mark X as done?' with Yes/Not yet/Skip options. (5) You CAN auto-create phases and categories when it makes sense — no need to ask. (6) Skip sync entirely for trivial changes like typos, config tweaks, or chat-only turns. (7) When you start working on a node or create a new task, use add_to_work_mode to mark it as active. When done, use remove_from_work_mode. This lets the user see what is being worked on in real-time.";
8
+ const PRE_DIRECTIVE = "ACTION REQUIRED: If you haven't set a SlyPlan project this session, call list_projects + set_project NOW. Then call search to find the node for your current task and add_to_work_mode. If no node exists, create one with add_node first. Do this BEFORE continuing with other work.";
9
+ const POST_DIRECTIVE = "ACTION REQUIRED: You just made changes. Call search to find the SlyPlan node for this task, then update_node with current progress. Skip only for trivial edits (typos, config tweaks). Never mark done without asking the user first.";
9
10
  const POST_HOOK_FILE_CONTENT = `#!/usr/bin/env node
10
- // SlyPlan PostToolUse hook — silent reminder to Claude after file modifications.
11
- // Injects additionalContext that only Claude sees. Completely invisible to the user.
12
-
13
11
  const output = JSON.stringify({
14
12
  suppressOutput: true,
15
13
  hookSpecificOutput: {
16
14
  hookEventName: "PostToolUse",
17
- additionalContext: ${JSON.stringify(SYNC_REMINDER)}
15
+ additionalContext: POST_DIRECTIVE_PLACEHOLDER
18
16
  }
19
17
  });
20
-
21
18
  process.stdout.write(output);
22
19
  process.exit(0);
23
- `;
20
+ `.replace('POST_DIRECTIVE_PLACEHOLDER', JSON.stringify(POST_DIRECTIVE));
24
21
  const PRE_HOOK_FILE_CONTENT = `#!/usr/bin/env node
25
- // SlyPlan PreToolUse hook — silent reminder to Claude BEFORE tool execution.
26
- // Ensures Claude syncs with SlyPlan (especially work mode) before starting work.
27
-
28
22
  const output = JSON.stringify({
29
23
  suppressOutput: true,
30
24
  hookSpecificOutput: {
31
25
  hookEventName: "PreToolCall",
32
- additionalContext: ${JSON.stringify(SYNC_REMINDER)}
26
+ additionalContext: PRE_DIRECTIVE_PLACEHOLDER
33
27
  }
34
28
  });
35
-
36
29
  process.stdout.write(output);
37
30
  process.exit(0);
38
- `;
31
+ `.replace('PRE_DIRECTIVE_PLACEHOLDER', JSON.stringify(PRE_DIRECTIVE));
39
32
  const CLAUDEMD_SECTION = `
40
- ## SlyPlan Sync (Automatic)
33
+ ## SlyPlan Sync — OBLIGATORISKE REGLER
34
+
35
+ DU SKAL holde SlyPlan oppdatert. Dette er ikke valgfritt. Følg disse reglene:
36
+
37
+ ### 1. Sett prosjekt FØRST
38
+ - **Ved start av hver sesjon:** Kall \`list_projects\` + \`set_project\` FØR du gjør noe annet.
39
+ - Match prosjekt basert på cwd-mappenavn eller brukerens kontekst.
40
+ - Hvis tvetydig, spør brukeren. Cache prosjekt-ID resten av sesjonen.
41
+
42
+ ### 2. Finn eller opprett node FØR du begynner arbeid
43
+ - Kall \`search\` for å finne noden som matcher oppgaven din.
44
+ - Hvis ingen node finnes: opprett med \`add_node\` umiddelbart.
45
+ - Kall \`add_to_work_mode\` på noden FØR du starter med Edit/Write/Bash.
46
+ - **Du skal ALDRI starte arbeid uten en aktiv work mode node.**
41
47
 
42
- Claude automatically keeps SlyPlan updated via MCP tools as a side effect of normal work.
48
+ ### 3. Oppdater progress UNDERVEIS
49
+ - Etter hver meningsfull endring: kall \`update_node\` med oppdatert \`progress\` (0-100).
50
+ - Oppdater \`description\` med hva som faktisk ble gjort.
51
+ - Hopp over for trivielle endringer (typos, config-tweaks).
43
52
 
44
- ### When to Update
45
- - After turns where you made file changes, ran commands, or completed work
46
- - Skip pure chat turns (no code changes = no MCP calls)
47
- - Batch updates at end of turn (not per-file)
48
- - A PostToolUse hook silently reminds Claude to sync after file changes
53
+ ### 4. ALDRI merk noe som done uten å spørre
54
+ - Bruk \`AskUserQuestion\` med valg: "Yes, mark as done" / "Not yet" / "Skip".
55
+ - **Ingen unntak.** Auto-marking done er forbudt.
49
56
 
50
- ### Project Matching
51
- - First update in session: call \`list_projects\` to find available projects, then \`set_project\` to select one
52
- - Match project based on: cwd folder name, files being edited, user's request context
53
- - If genuinely ambiguous, ask the user which project
54
- - Cache project ID for the rest of the session
57
+ ### 5. Rydd opp work mode når du er ferdig
58
+ - Kall \`remove_from_work_mode\` når du er ferdig med en node eller bytter til annen oppgave.
55
59
 
56
- ### Node Organization
57
- - AVOID \`get_tree\` it returns the full tree. Use \`search\` to find specific nodes instead.
58
- - Node types follow the 4-tier hierarchy: \`project\` > \`category\` > \`phase\` > \`plan\`
59
- - Auto-create phases, categories, and plan nodes as needed
60
+ ### 6. Alt arbeid skal reflekteres
61
+ - Gjelder ALL type arbeid. Hvis kode endret seg, SKAL SlyPlan reflektere det.
62
+ - Små fix = \`plan\`-node under eksisterende phase. Stor feature = ny \`phase\` med \`plan\`-children.
60
63
 
61
- ### Status Updates
62
- - Auto-set \`in_progress\` via \`update_node\` when starting work
63
- - Update \`progress\` percentage based on completion
64
- - Ask user before marking anything as \`done\`
65
- - Update node descriptions with what was actually done
64
+ ### Node-hierarki
65
+ \`project\` > \`category\` > \`phase\` > \`plan\`
66
66
 
67
- ### Work Mode
68
- - When starting work on a node, call \`add_to_work_mode\` to mark it as active
69
- - When done with a node, call \`remove_from_work_mode\`
67
+ ### Ytelsesregler
68
+ - ALDRI bruk \`get_tree\` (returnerer ~18k tokens). Bruk \`search\` i stedet.
70
69
 
71
- ### MCP Tools Reference
72
- - \`list_projects\` list all projects
73
- - \`set_project\` — set active project for session
74
- - \`search\` find nodes by name/content
75
- - \`add_node\` create new node (project, category, phase, plan)
76
- - \`update_node\` update status, progress, description
77
- - \`add_to_work_mode\` mark node as actively being worked on
78
- - \`remove_from_work_mode\` remove node from active work
70
+ ### MCP-verktøy
71
+ | Verktøy | Bruk |
72
+ |---------|------|
73
+ | \`list_projects\` | Finn prosjekter (sesjonstart) |
74
+ | \`set_project\` | Velg aktivt prosjekt |
75
+ | \`search\` | Finn noder etter navn/innhold |
76
+ | \`add_node\` | Opprett ny node (project/category/phase/plan) |
77
+ | \`update_node\` | Oppdater status, progress, description |
78
+ | \`add_to_work_mode\` | Marker node som aktivt arbeid |
79
+ | \`remove_from_work_mode\` | Fjern fra aktivt arbeid |
79
80
  `;
80
81
  // --- Helpers ---
81
82
  function log(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slyplan-mcp",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "MCP server for Slyplan — visual project management via Claude",
5
5
  "type": "module",
6
6
  "bin": {