@infinitedusky/indusk-mcp 1.1.1 → 1.1.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.
@@ -176,7 +176,7 @@ export async function init(projectRoot, options = {}) {
176
176
  console.info("\n[Hooks]");
177
177
  const hooksSource = join(packageRoot, "hooks");
178
178
  const hooksTarget = join(projectRoot, ".claude/hooks");
179
- const hookFiles = ["check-gates.js", "gate-reminder.js", "validate-impl-structure.js"];
179
+ const hookFiles = ["check-gates.js", "gate-reminder.js", "validate-impl-structure.js", "check-catchup.js"];
180
180
  if (existsSync(hooksSource)) {
181
181
  mkdirSync(hooksTarget, { recursive: true });
182
182
  for (const file of hookFiles) {
@@ -202,6 +202,7 @@ export async function init(projectRoot, options = {}) {
202
202
  hooks: [
203
203
  { type: "command", command: "node .claude/hooks/check-gates.js" },
204
204
  { type: "command", command: "node .claude/hooks/validate-impl-structure.js" },
205
+ { type: "command", command: "node .claude/hooks/check-catchup.js" },
205
206
  ],
206
207
  },
207
208
  ],
@@ -221,7 +222,8 @@ export async function init(projectRoot, options = {}) {
221
222
  // Check if our hook is already present
222
223
  const hasOurHook = existingEntries.some((e) => e.hooks?.some((h) => h.command?.includes("check-gates") ||
223
224
  h.command?.includes("gate-reminder") ||
224
- h.command?.includes("validate-impl")));
225
+ h.command?.includes("validate-impl") ||
226
+ h.command?.includes("check-catchup")));
225
227
  if (!hasOurHook || force) {
226
228
  // Remove old entries if force, then add
227
229
  if (force) {
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * PreToolUse hook: blocks Edit/Write on project files until /catchup is complete.
4
+ *
5
+ * Reads .claude/handoff.md and checks that all Catchup Status boxes are checked.
6
+ * Allows edits TO the handoff file itself (so catchup can check off boxes).
7
+ * Allows edits if no handoff file exists (first session, no enforcement).
8
+ *
9
+ * Exit 0 = allow
10
+ * Exit 2 = block (stderr sent to agent)
11
+ */
12
+
13
+ import { existsSync, readFileSync } from "node:fs";
14
+ import { join, resolve } from "node:path";
15
+
16
+ const input = JSON.parse(readFileSync("/dev/stdin", "utf-8"));
17
+ const toolInput = input.tool_input ?? {};
18
+ const filePath = toolInput.file_path ?? "";
19
+
20
+ // Find project root by looking for .claude/ directory
21
+ function findProjectRoot() {
22
+ let dir = process.cwd();
23
+ for (let i = 0; i < 10; i++) {
24
+ if (existsSync(join(dir, ".claude"))) return dir;
25
+ const parent = resolve(dir, "..");
26
+ if (parent === dir) break;
27
+ dir = parent;
28
+ }
29
+ return process.cwd();
30
+ }
31
+
32
+ const projectRoot = findProjectRoot();
33
+ const handoffPath = join(projectRoot, ".claude", "handoff.md");
34
+
35
+ // Allow if no handoff exists (first session or handoff not yet created)
36
+ if (!existsSync(handoffPath)) {
37
+ process.exit(0);
38
+ }
39
+
40
+ // Always allow edits to the handoff file itself (catchup needs to check boxes)
41
+ if (filePath.endsWith("handoff.md")) {
42
+ process.exit(0);
43
+ }
44
+
45
+ // Read the handoff and check catchup status
46
+ const content = readFileSync(handoffPath, "utf-8");
47
+
48
+ // Look for the Catchup Status section
49
+ const statusMatch = content.match(/## Catchup Status\n([\s\S]*?)(?:\n##|\n$|$)/);
50
+ if (!statusMatch) {
51
+ // No catchup status section — allow (handoff was written before this feature)
52
+ process.exit(0);
53
+ }
54
+
55
+ const statusSection = statusMatch[1];
56
+ const unchecked = [];
57
+ const checkboxes = statusSection.matchAll(/- \[( |x)\] (\w+)/g);
58
+
59
+ for (const match of checkboxes) {
60
+ if (match[1] === " ") {
61
+ unchecked.push(match[2]);
62
+ }
63
+ }
64
+
65
+ if (unchecked.length === 0) {
66
+ // All boxes checked — catchup is complete
67
+ process.exit(0);
68
+ }
69
+
70
+ // Block the edit
71
+ process.stderr.write(
72
+ `Catchup incomplete. Run /catchup before editing project files.\n` +
73
+ `Missing steps: ${unchecked.join(", ")}\n` +
74
+ `The handoff file (.claude/handoff.md) has unchecked catchup boxes. ` +
75
+ `Complete each /catchup step to check them off.`,
76
+ );
77
+ process.exit(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitedusky/indusk-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "InDusk development system — skills, MCP tools, and CLI for structured AI-assisted development",
5
5
  "type": "module",
6
6
  "files": [
package/skills/catchup.md CHANGED
@@ -16,14 +16,20 @@ Check if `.claude/handoff.md` exists. If it does, read it first — this is the
16
16
 
17
17
  If the handoff exists, present a brief summary to the user: "Last session was working on X, stopped at Y. Ready to pick up there?"
18
18
 
19
- If no handoff exists, skip to step 2.
19
+ **After reading, edit the handoff to check off:** `- [x] handoff`
20
+
21
+ If no handoff exists, create one with all catchup status boxes unchecked, then check off handoff.
20
22
 
21
23
  ### 2. Read Lessons
22
24
  Call `list_lessons`. Read every lesson. These are rules learned from past mistakes — not suggestions. Internalize them before touching any code.
23
25
 
26
+ **After reading, edit the handoff to check off:** `- [x] lessons`
27
+
24
28
  ### 3. Check Infrastructure
25
29
  Call `check_health`. Verify FalkorDB and CGC are running. If unhealthy, tell the user what's down and how to fix it.
26
30
 
31
+ **After checking, edit the handoff to check off:** `- [x] health`
32
+
27
33
  ### 4. Read Project Context
28
34
  Call `get_context` to read CLAUDE.md. This contains:
29
35
  - **Architecture** — what the project is, how it's structured
@@ -34,12 +40,16 @@ Call `get_context` to read CLAUDE.md. This contains:
34
40
 
35
41
  Read it fully. Don't skim.
36
42
 
43
+ **After reading, edit the handoff to check off:** `- [x] context`
44
+
37
45
  ### 5. Check Active Plans
38
46
  Call `list_plans`. This shows every plan and its status. Pay attention to:
39
47
  - Plans with status `in-progress` — these are actively being worked on
40
48
  - The current phase of each active plan — this is where `/work` will pick up
41
49
  - Dependencies between plans — don't start a blocked plan
42
50
 
51
+ **After checking, edit the handoff to check off:** `- [x] plans`
52
+
43
53
  ### 6. Review Skills and Extensions
44
54
  Call `extensions_status` to see what extensions are enabled and their capabilities.
45
55
 
@@ -51,8 +61,12 @@ Then read all installed skill files in `.claude/skills/*/SKILL.md`. These define
51
61
 
52
62
  Understand what each skill does and when to use it. You should be able to answer: "What slash commands are available and what do they do?"
53
63
 
64
+ **After reviewing, edit the handoff to check off:** `- [x] skills` and `- [x] extensions`
65
+
54
66
  ### 7. Check Code Graph
55
- Call `get_repository_stats` to understand the codebase size and structure. This gives you a sense of what's indexed and queryable. If it fails, the CGC extension may not be enabled or FalkorDB may be down check_health will have flagged this.
67
+ Call `graph_stats` to understand the codebase size and structure. This gives you a sense of what's indexed and queryable. If it fails, call `graph_doctor` to diagnose. If FalkorDB is down or the repo isn't indexed, flag it.
68
+
69
+ **After checking, edit the handoff to check off:** `- [x] graph`
56
70
 
57
71
  ### 8. Summarize
58
72
 
package/skills/handoff.md CHANGED
@@ -32,6 +32,16 @@ Create or overwrite `.claude/handoff.md` with:
32
32
 
33
33
  ## Watch Out For
34
34
  {Gotchas the next agent should know. "The FalkorDB graph needs reindexing." "The hooks aren't published yet — version 1.0.3 has them." "Don't touch init.ts until the extension system PR is merged."}
35
+
36
+ ## Catchup Status
37
+ - [ ] handoff
38
+ - [ ] lessons
39
+ - [ ] skills
40
+ - [ ] health
41
+ - [ ] context
42
+ - [ ] plans
43
+ - [ ] extensions
44
+ - [ ] graph
35
45
  ```
36
46
 
37
47
  ## When to Write a Handoff
@@ -48,3 +58,4 @@ Create or overwrite `.claude/handoff.md` with:
48
58
  - **Decisions that aren't saved anywhere else MUST go here.** They'll be lost otherwise.
49
59
  - **Overwrite the previous handoff.** There's only one — the most recent session's. Old handoffs are consumed by /catchup and don't need to persist.
50
60
  - **Keep it short.** This isn't a retrospective. It's a sticky note for the next person.
61
+ - **Always include the Catchup Status section** with all boxes unchecked. This is enforced by a hook — the next session cannot edit or write code until `/catchup` checks off every box. Each step in catchup marks its box when completed.