diff --git a/plugin/scripts/session-start.sh b/plugin/scripts/session-start.sh index e4363c8..159ae4f 100755 --- a/plugin/scripts/session-start.sh +++ b/plugin/scripts/session-start.sh @@ -17,7 +17,7 @@ CONTEXT="" if ! command_exists git-kb; then CONTEXT="# GitKB Setup${NL}${NL}The GitKB CLI is not installed, so GitKB code intelligence is unavailable in this session.${NL}${NL}Install it with:${NL}${NL}\`\`\`bash${NL}brew install gitkb/tap/gitkb${NL}# or${NL}curl -fsSL https://get.gitkb.com/install.sh | bash${NL}\`\`\`${NL}${NL}After installing, use \`git-kb code doctor --json\`, \`git-kb code index\`, and related \`git-kb code ... --json\` commands in any Git repo. Full persistent KB setup is optional via \`git-kb init && git-kb init claude\`." elif GITKB_ROOT="$CWD" git-kb info >/dev/null 2>&1; then - CONTEXT="# GitKB Ready${NL}${NL}This project has a full \`.kb\` setup. For durable tasks, knowledge, sync, or full Claude integration, use the canonical assets installed by \`git-kb init claude\`. If setup appears stale or missing, ask the user before running \`git-kb init claude --dry-run\` or \`git-kb doctor --check repos,code,kb --json\`." + CONTEXT="# GitKB Ready${NL}${NL}This project has a full \`.kb\` setup. For durable tasks, knowledge, sync, or full Claude integration, use the canonical assets installed by \`git-kb init claude\`. If setup appears stale or missing, ask the user before running \`git-kb init claude --dry-run\`, \`git-kb doctor --check repos,kb --json\`, or \`git-kb code doctor --json\`." elif git -C "$CWD" rev-parse --show-toplevel >/dev/null 2>&1; then CONTEXT="# GitKB Code Intelligence${NL}${NL}This Git repo does not have a full \`.kb\` yet, but GitKB code intelligence works without initialization.${NL}${NL}**Prefer \`git-kb code ... --json\` over grep for code exploration.** Grep matches text; \`git-kb code\` understands the AST and call graph, and JSON output preserves complete symbol IDs and stable fields.${NL}${NL}For code questions, prefer these local CLI commands:${NL}${NL}- \`git-kb code doctor --json\` to inspect language/index health.${NL}- \`git-kb code index\` before first analysis or after large changes.${NL}- \`git-kb code symbols --json\`, \`git-kb code callers --json\`, \`git-kb code callees --json\`, \`git-kb code impact --json\`, \`git-kb code dead --json\`, and \`git-kb code query hotspots --json\` for code intelligence.${NL}${NL}Do not require \`git-kb init\` for code intelligence. If the user wants durable tasks, knowledge, sync, or full Claude integration, guide them through:${NL}${NL}\`\`\`bash${NL}git-kb init${NL}git-kb init claude${NL}\`\`\`${NL}${NL}MCP is supported after full KB setup today; use CLI fallback when MCP is unavailable." else diff --git a/tests/session-start.bats b/tests/session-start.bats index 5761465..d729ea0 100644 --- a/tests/session-start.bats +++ b/tests/session-start.bats @@ -22,7 +22,8 @@ teardown() { ctx=$(echo "$output" | jq -r '.hookSpecificOutput.additionalContext') [[ "$ctx" == *"GitKB Ready"* ]] [[ "$ctx" == *"git-kb init claude"* ]] - [[ "$ctx" == *"git-kb doctor --check repos,code,kb --json"* ]] + [[ "$ctx" == *"git-kb doctor --check repos,kb --json"* ]] + [[ "$ctx" == *"git-kb code doctor --json"* ]] [[ "$ctx" != *"tasks/test-1"* ]] local wp