From 62e7e7cabff18f01bc25e8206c77dd977d46912d Mon Sep 17 00:00:00 2001 From: AlphaComposite <25360554+AlphaComposite@users.noreply.github.com> Date: Mon, 11 May 2026 04:19:11 +0300 Subject: [PATCH] fix(plugin): mirror installed CLI stale guidance --- gitnexus-claude-plugin/hooks/gitnexus-hook.js | 5 +++-- gitnexus-claude-plugin/skills/gitnexus-cli/SKILL.md | 4 ++-- gitnexus-claude-plugin/skills/gitnexus-debugging/SKILL.md | 2 +- gitnexus-claude-plugin/skills/gitnexus-exploring/SKILL.md | 2 +- gitnexus-claude-plugin/skills/gitnexus-guide/SKILL.md | 2 +- .../skills/gitnexus-impact-analysis/SKILL.md | 2 +- gitnexus-claude-plugin/skills/gitnexus-pr-review/SKILL.md | 2 +- gitnexus-claude-plugin/skills/gitnexus-refactoring/SKILL.md | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gitnexus-claude-plugin/hooks/gitnexus-hook.js b/gitnexus-claude-plugin/hooks/gitnexus-hook.js index 7d8fbfda4..60994693e 100644 --- a/gitnexus-claude-plugin/hooks/gitnexus-hook.js +++ b/gitnexus-claude-plugin/hooks/gitnexus-hook.js @@ -296,11 +296,12 @@ function handlePostToolUse(input) { // If HEAD matches last indexed commit, no reindex needed if (currentHead && currentHead === lastCommit) return; - const analyzeCmd = `npx gitnexus analyze${hadEmbeddings ? ' --embeddings' : ''}`; + const analyzeCmd = `gitnexus analyze${hadEmbeddings ? ' --embeddings' : ''}`; + const npxAnalyzeCmd = `npx gitnexus analyze${hadEmbeddings ? ' --embeddings' : ''}`; sendHookResponse( 'PostToolUse', `GitNexus index is stale (last indexed: ${lastCommit ? lastCommit.slice(0, 7) : 'never'}). ` + - `Run \`${analyzeCmd}\` to update the knowledge graph.`, + `Run \`${analyzeCmd}\` to update the knowledge graph, or \`${npxAnalyzeCmd}\` if the CLI is not installed.`, ); } diff --git a/gitnexus-claude-plugin/skills/gitnexus-cli/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-cli/SKILL.md index 1c38face4..3dabd9f36 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-cli/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-cli/SKILL.md @@ -5,14 +5,14 @@ description: "Use when the user needs to run GitNexus CLI commands like analyze/ # GitNexus CLI Commands -All commands work via `npx` — no global install required. +Use the installed `gitnexus` CLI when available. Prefix commands with `npx gitnexus` if the CLI is not installed globally. ## Commands ### analyze — Build or refresh the index ```bash -npx gitnexus analyze +gitnexus analyze ``` Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files. diff --git a/gitnexus-claude-plugin/skills/gitnexus-debugging/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-debugging/SKILL.md index 9510b97ac..04d4fdac0 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-debugging/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-debugging/SKILL.md @@ -22,7 +22,7 @@ description: "Use when the user is debugging a bug, tracing an error, or asking 4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed ``` -> If "Index is stale" → run `npx gitnexus analyze` in terminal. +> If "Index is stale" → run `gitnexus analyze` in terminal (`npx gitnexus analyze` if the CLI is not installed). ## Checklist diff --git a/gitnexus-claude-plugin/skills/gitnexus-exploring/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-exploring/SKILL.md index 927a4e4b6..61ef6ea7d 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-exploring/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-exploring/SKILL.md @@ -23,7 +23,7 @@ description: "Use when the user asks how code works, wants to understand archite 5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow ``` -> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal. +> If step 2 says "Index is stale" → run `gitnexus analyze` in terminal (`npx gitnexus analyze` if the CLI is not installed). ## Checklist diff --git a/gitnexus-claude-plugin/skills/gitnexus-guide/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-guide/SKILL.md index 937ac73d1..16f260b63 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-guide/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-guide/SKILL.md @@ -15,7 +15,7 @@ For any task involving code understanding, debugging, impact analysis, or refact 2. **Match your task to a skill below** and **read that skill file** 3. **Follow the skill's workflow and checklist** -> If step 1 warns the index is stale, run `npx gitnexus analyze` in the terminal first. +> If step 1 warns the index is stale, run `gitnexus analyze` in the terminal first (`npx gitnexus analyze` if the CLI is not installed). ## Skills diff --git a/gitnexus-claude-plugin/skills/gitnexus-impact-analysis/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-impact-analysis/SKILL.md index e19af280c..36511adf3 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-impact-analysis/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-impact-analysis/SKILL.md @@ -23,7 +23,7 @@ description: "Use when the user wants to know what will break if they change som 4. Assess risk and report to user ``` -> If "Index is stale" → run `npx gitnexus analyze` in terminal. +> If "Index is stale" → run `gitnexus analyze` in terminal (`npx gitnexus analyze` if the CLI is not installed). ## Checklist diff --git a/gitnexus-claude-plugin/skills/gitnexus-pr-review/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-pr-review/SKILL.md index e112f47ba..5bf173c28 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-pr-review/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-pr-review/SKILL.md @@ -26,7 +26,7 @@ description: "Use when the user wants to review a pull request, understand what 6. Summarize findings with risk assessment ``` -> If "Index is stale" → run `npx gitnexus analyze` in terminal before reviewing. +> If "Index is stale" → run `gitnexus analyze` in terminal before reviewing (`npx gitnexus analyze` if the CLI is not installed). ## Checklist diff --git a/gitnexus-claude-plugin/skills/gitnexus-refactoring/SKILL.md b/gitnexus-claude-plugin/skills/gitnexus-refactoring/SKILL.md index f48cc01bd..a538b8f15 100644 --- a/gitnexus-claude-plugin/skills/gitnexus-refactoring/SKILL.md +++ b/gitnexus-claude-plugin/skills/gitnexus-refactoring/SKILL.md @@ -22,7 +22,7 @@ description: "Use when the user wants to rename, extract, split, move, or restru 4. Plan update order: interfaces → implementations → callers → tests ``` -> If "Index is stale" → run `npx gitnexus analyze` in terminal. +> If "Index is stale" → run `gitnexus analyze` in terminal (`npx gitnexus analyze` if the CLI is not installed). ## Checklists