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.
- package/dist/cli.js +46 -45
- 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
|
|
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:
|
|
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:
|
|
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
|
|
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
|
-
|
|
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
|
-
###
|
|
45
|
-
-
|
|
46
|
-
-
|
|
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
|
-
###
|
|
51
|
-
-
|
|
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
|
-
###
|
|
57
|
-
-
|
|
58
|
-
-
|
|
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
|
-
###
|
|
62
|
-
|
|
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
|
-
###
|
|
68
|
-
-
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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) {
|