@infinitedusky/indusk-mcp 0.1.0 → 0.3.0
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/bin/cli.js +3 -2
- package/dist/bin/commands/init.d.ts +4 -1
- package/dist/bin/commands/init.js +18 -15
- package/package.json +1 -1
- package/skills/toolbelt.md +80 -0
package/dist/bin/cli.js
CHANGED
|
@@ -13,9 +13,10 @@ program
|
|
|
13
13
|
program
|
|
14
14
|
.command("init")
|
|
15
15
|
.description("Initialize a project with InDusk dev system")
|
|
16
|
-
.
|
|
16
|
+
.option("-f, --force", "Overwrite existing files (except CLAUDE.md and planning/)")
|
|
17
|
+
.action(async (opts) => {
|
|
17
18
|
const { init } = await import("./commands/init.js");
|
|
18
|
-
await init(process.cwd());
|
|
19
|
+
await init(process.cwd(), { force: opts.force ?? false });
|
|
19
20
|
});
|
|
20
21
|
program
|
|
21
22
|
.command("update")
|
|
@@ -70,9 +70,10 @@ function createCgcIgnore(projectRoot) {
|
|
|
70
70
|
].join("\n"));
|
|
71
71
|
console.info(" create: .cgcignore");
|
|
72
72
|
}
|
|
73
|
-
export async function init(projectRoot) {
|
|
73
|
+
export async function init(projectRoot, options = {}) {
|
|
74
|
+
const { force = false } = options;
|
|
74
75
|
const projectName = basename(projectRoot);
|
|
75
|
-
console.info(
|
|
76
|
+
console.info(`Initializing InDusk dev system...${force ? " (--force)" : ""}\n`);
|
|
76
77
|
// 1. Copy skills
|
|
77
78
|
console.info("[Skills]");
|
|
78
79
|
const skillsSource = join(packageRoot, "skills");
|
|
@@ -82,19 +83,21 @@ export async function init(projectRoot) {
|
|
|
82
83
|
const skillName = file.replace(".md", "");
|
|
83
84
|
const targetDir = join(skillsTarget, skillName);
|
|
84
85
|
const targetFile = join(targetDir, "SKILL.md");
|
|
85
|
-
if (existsSync(targetFile)) {
|
|
86
|
+
if (existsSync(targetFile) && !force) {
|
|
86
87
|
console.info(` skip: .claude/skills/${skillName}/SKILL.md (already exists)`);
|
|
87
88
|
continue;
|
|
88
89
|
}
|
|
89
90
|
mkdirSync(targetDir, { recursive: true });
|
|
90
91
|
cpSync(join(skillsSource, file), targetFile);
|
|
91
|
-
console.info(` create: .claude/skills/${skillName}/SKILL.md`);
|
|
92
|
+
console.info(` ${existsSync(targetFile) ? "overwrite" : "create"}: .claude/skills/${skillName}/SKILL.md`);
|
|
92
93
|
}
|
|
93
|
-
// 2. Create CLAUDE.md
|
|
94
|
+
// 2. Create CLAUDE.md (never overwrite — write CLAUDE-NEW.md if exists)
|
|
94
95
|
console.info("\n[Project files]");
|
|
95
96
|
const claudeMdPath = join(projectRoot, "CLAUDE.md");
|
|
96
97
|
if (existsSync(claudeMdPath)) {
|
|
97
|
-
|
|
98
|
+
const newPath = join(projectRoot, "CLAUDE-NEW.md");
|
|
99
|
+
cpSync(join(packageRoot, "templates/CLAUDE.md"), newPath);
|
|
100
|
+
console.info(" create: CLAUDE-NEW.md (merge manually with existing CLAUDE.md)");
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
103
|
cpSync(join(packageRoot, "templates/CLAUDE.md"), claudeMdPath);
|
|
@@ -131,17 +134,17 @@ export async function init(projectRoot) {
|
|
|
131
134
|
const existing = JSON.parse(readFileSync(mcpJsonPath, "utf-8"));
|
|
132
135
|
let updated = false;
|
|
133
136
|
existing.mcpServers = existing.mcpServers || {};
|
|
134
|
-
if (!existing.mcpServers.indusk) {
|
|
137
|
+
if (!existing.mcpServers.indusk || force) {
|
|
135
138
|
existing.mcpServers.indusk = induskEntry;
|
|
136
|
-
console.info("
|
|
139
|
+
console.info(` ${existing.mcpServers.indusk ? "overwrite" : "add"}: .mcp.json indusk entry`);
|
|
137
140
|
updated = true;
|
|
138
141
|
}
|
|
139
142
|
else {
|
|
140
143
|
console.info(" skip: .mcp.json indusk entry (already exists)");
|
|
141
144
|
}
|
|
142
|
-
if (!existing.mcpServers.codegraphcontext) {
|
|
145
|
+
if (!existing.mcpServers.codegraphcontext || force) {
|
|
143
146
|
existing.mcpServers.codegraphcontext = cgcEntry;
|
|
144
|
-
console.info(`
|
|
147
|
+
console.info(` ${existing.mcpServers.codegraphcontext ? "overwrite" : "add"}: .mcp.json codegraphcontext (graph: ${projectName})`);
|
|
145
148
|
updated = true;
|
|
146
149
|
}
|
|
147
150
|
else {
|
|
@@ -164,24 +167,24 @@ export async function init(projectRoot) {
|
|
|
164
167
|
// 5. Generate .vscode/settings.json
|
|
165
168
|
console.info("\n[Editor]");
|
|
166
169
|
const vscodePath = join(projectRoot, ".vscode/settings.json");
|
|
167
|
-
if (existsSync(vscodePath)) {
|
|
170
|
+
if (existsSync(vscodePath) && !force) {
|
|
168
171
|
console.info(" skip: .vscode/settings.json (already exists)");
|
|
169
172
|
}
|
|
170
173
|
else {
|
|
171
174
|
mkdirSync(join(projectRoot, ".vscode"), { recursive: true });
|
|
172
175
|
cpSync(join(packageRoot, "templates/vscode-settings.json"), vscodePath);
|
|
173
|
-
console.info("
|
|
176
|
+
console.info(` ${existsSync(vscodePath) ? "overwrite" : "create"}: .vscode/settings.json`);
|
|
174
177
|
}
|
|
175
178
|
// 6. Create base biome.json
|
|
176
179
|
const biomePath = join(projectRoot, "biome.json");
|
|
177
|
-
if (existsSync(biomePath)) {
|
|
180
|
+
if (existsSync(biomePath) && !force) {
|
|
178
181
|
console.info(" skip: biome.json (already exists)");
|
|
179
182
|
}
|
|
180
183
|
else {
|
|
181
184
|
cpSync(join(packageRoot, "templates/biome.template.json"), biomePath);
|
|
182
|
-
console.info("
|
|
185
|
+
console.info(` ${existsSync(biomePath) ? "overwrite" : "create"}: biome.json`);
|
|
183
186
|
}
|
|
184
|
-
// 7. Create .cgcignore
|
|
187
|
+
// 7. Create .cgcignore (always overwrite — package-owned)
|
|
185
188
|
createCgcIgnore(projectRoot);
|
|
186
189
|
// 8. Infrastructure: FalkorDB + CGC
|
|
187
190
|
console.info("\n[Infrastructure]");
|
package/package.json
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# InDusk Toolbelt
|
|
2
|
+
|
|
3
|
+
You have MCP tools from two servers: **indusk** (dev system) and **codegraphcontext** (code graph). This skill tells you when to use them.
|
|
4
|
+
|
|
5
|
+
## Session Start
|
|
6
|
+
|
|
7
|
+
When a new session begins:
|
|
8
|
+
|
|
9
|
+
1. Call `check_health` — verify FalkorDB and CGC are running. If unhealthy, tell the user what's down and how to fix it before proceeding.
|
|
10
|
+
2. Call `list_plans` — understand what plans exist, their stages, and what's in progress.
|
|
11
|
+
3. Call `get_context` — read the project's CLAUDE.md to understand architecture, conventions, and current state.
|
|
12
|
+
|
|
13
|
+
## Before Modifying Code
|
|
14
|
+
|
|
15
|
+
Before touching any file:
|
|
16
|
+
|
|
17
|
+
1. Call `get_plan_status` for the active plan — know which phase you're in and what items remain.
|
|
18
|
+
2. Use CGC's `analyze_code_relationships` on the files you're about to change — understand dependencies and blast radius.
|
|
19
|
+
3. If the blast radius is large (many downstream consumers), flag it to the user before proceeding.
|
|
20
|
+
|
|
21
|
+
## During Work
|
|
22
|
+
|
|
23
|
+
While executing impl items:
|
|
24
|
+
|
|
25
|
+
- After completing verification items, call `quality_check` to confirm Biome passes.
|
|
26
|
+
- After completing context items, call `get_context` to verify CLAUDE.md was updated correctly.
|
|
27
|
+
- After completing document items, call `list_docs` to verify the doc page exists.
|
|
28
|
+
|
|
29
|
+
## Advancing Phases
|
|
30
|
+
|
|
31
|
+
When you think a phase is complete:
|
|
32
|
+
|
|
33
|
+
1. Call `advance_plan` — it will tell you if anything is missing across all four gates (implementation, verification, context, document).
|
|
34
|
+
2. If blocked, work through the missing items before trying again.
|
|
35
|
+
3. Never manually mark a phase complete without calling `advance_plan` first.
|
|
36
|
+
|
|
37
|
+
## After a Retrospective
|
|
38
|
+
|
|
39
|
+
1. Call `check_docs_coverage` — flag any completed plans missing decision pages.
|
|
40
|
+
2. Call `get_quality_config` — review if new Biome rules should be added based on lessons learned.
|
|
41
|
+
3. If a new rule is needed, call `suggest_rule` with a description of the mistake to find matching Biome rules.
|
|
42
|
+
|
|
43
|
+
## Skill and System Management
|
|
44
|
+
|
|
45
|
+
- Call `get_skill_versions` to check if installed skills are current or outdated.
|
|
46
|
+
- Call `get_system_version` to verify the installed package version.
|
|
47
|
+
|
|
48
|
+
## Code Graph (CGC Tools)
|
|
49
|
+
|
|
50
|
+
These come from the codegraphcontext MCP server:
|
|
51
|
+
|
|
52
|
+
| When | Tool |
|
|
53
|
+
|------|------|
|
|
54
|
+
| Search for code by name | `find_code` |
|
|
55
|
+
| Understand what depends on a file | `analyze_code_relationships` |
|
|
56
|
+
| Find complex functions to refactor | `find_most_complex_functions` |
|
|
57
|
+
| Check for dead code | `find_dead_code` |
|
|
58
|
+
| Scope a plan during research | `analyze_code_relationships` on the target area |
|
|
59
|
+
| Custom graph queries | `execute_cypher_query` |
|
|
60
|
+
|
|
61
|
+
## Tool Reference
|
|
62
|
+
|
|
63
|
+
### indusk (14 tools)
|
|
64
|
+
|
|
65
|
+
| Tool | When to use |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `list_plans` | Session start, orientation |
|
|
68
|
+
| `get_plan_status` | Before working on a plan, checking progress |
|
|
69
|
+
| `advance_plan` | End of every phase — validates all gates |
|
|
70
|
+
| `order_plans` | Understanding plan dependencies |
|
|
71
|
+
| `get_context` | Session start, after context updates |
|
|
72
|
+
| `update_context` | Updating CLAUDE.md sections programmatically |
|
|
73
|
+
| `get_quality_config` | Reviewing Biome rules, after retros |
|
|
74
|
+
| `suggest_rule` | Finding Biome rules for new patterns |
|
|
75
|
+
| `quality_check` | After verification items, before advancing |
|
|
76
|
+
| `list_docs` | After document items, checking coverage |
|
|
77
|
+
| `check_docs_coverage` | After retros, finding doc gaps |
|
|
78
|
+
| `get_system_version` | Debugging, version checks |
|
|
79
|
+
| `get_skill_versions` | Checking for outdated skills |
|
|
80
|
+
| `check_health` | Session start, debugging connectivity |
|