Skip to content

refactor(plugin): drop Cursor, bundle deps, rename /analyze to /bp-analyze#168

Merged
onlycastle merged 7 commits intomainfrom
refactor/plugin-drop-cursor-bundle-deps-20260319
Mar 19, 2026
Merged

refactor(plugin): drop Cursor, bundle deps, rename /analyze to /bp-analyze#168
onlycastle merged 7 commits intomainfrom
refactor/plugin-drop-cursor-bundle-deps-20260319

Conversation

@onlycastle
Copy link
Owner

@onlycastle onlycastle commented Mar 19, 2026

Summary

  • Drop Cursor support: Remove all Cursor session counting code from debounce.ts — BetterPrompt only supports Claude Code sessions
  • Bundle non-native deps: @modelcontextprotocol/sdk and zod bundled into plugin output via tsup noExternal, eliminating runtime node_modules dependency
  • Auto-install native addon: ensureNativeDeps() in session-start hook installs better-sqlite3 into CLAUDE_PLUGIN_DATA/node_modules on first session
  • Rename /analyze → /bp-analyze: Namespace prefix to avoid plugin command conflicts. All docs, code references, and tests updated

Changes

  1. refactor(plugin): drop Cursor support, use Claude-only session counting
  2. feat(plugin): bundle non-native deps, auto-install better-sqlite3
  3. chore(plugin): rebuild dist with bundled deps and Cursor removal
  4. refactor(plugin): rename /analyze skill to /bp-analyze
  5. docs: update all references from /analyze to /bp-analyze
  6. chore(plugin): rebuild dist with /bp-analyze skill rename
  7. test(plugin): update test assertions for /bp-analyze rename

Code Simplification

  • State mutation functions in debounce.ts simplified to let normalizeState() handle derived boolean fields

Test Plan

  • TypeScript type-check passes (npx tsc --noEmit)
  • All 430 tests pass (npm test)
  • Manual: install plugin in clean environment, verify better-sqlite3 auto-installs
  • Manual: run /bp-analyze and verify pipeline completes

Generated with Claude Code using /ship-it

onlycastle and others added 3 commits March 19, 2026 10:08
Remove all Cursor-related session counting code (Cursor chats directory,
Cursor Composer DB access, better-sqlite3 direct import). countLocalSessions()
is replaced by countClaudeSessions() as BetterPrompt only supports Claude Code.

Also simplify state mutation functions to let normalizeState() handle derived
boolean fields instead of setting them redundantly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change bundling strategy: @modelcontextprotocol/sdk and zod are now bundled
into the plugin output (noExternal). Only better-sqlite3 remains external
as a native addon.

Add ensureNativeDeps() to session-start hook that installs better-sqlite3
into CLAUDE_PLUGIN_DATA/node_modules on first session. Set NODE_PATH in
.mcp.json so the MCP server resolves the native module at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rebuild plugin output reflecting both the Cursor support removal and the
new bundling strategy. MCP SDK and zod are now inlined into server.js,
reducing external runtime dependencies to only better-sqlite3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onlycastle
Copy link
Owner Author

Code Review

No issues found.

6 potential findings were evaluated across 5 review dimensions (CLAUDE.md compliance, bug scan, git history, previous PR feedback, code comments). All scored below the actionable threshold:

  • NODE_PATH env var substitution: false positive (expanded by Claude Code plugin runtime, not shell)
  • normalizeState() edge case: theoretical only, safe on all current call sites
  • ensureNativeDeps error handling: appropriate for a best-effort hook installer
  • Path validation: CLAUDE_PLUGIN_DATA is set by the Claude Code runtime
  • 2 minor comment accuracy items (docstring scope, JSDoc parenthetical)

Generated with Claude Code

If useful, react with a thumbs-up. Otherwise, thumbs-down.

onlycastle and others added 4 commits March 19, 2026 10:45
Add namespace prefix to avoid conflicts with other plugins that may
register an /analyze command. Update all internal references in
background-analyzer deprecation message and hook-utils pending context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update README with /bp-analyze command and add available commands table.
Update agent docs, human docs, onboarding plans and specs to use the
new namespaced skill name consistently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onlycastle onlycastle changed the title refactor(plugin): drop Cursor support, bundle deps, auto-install native addon refactor(plugin): drop Cursor, bundle deps, rename /analyze to /bp-analyze Mar 19, 2026
@onlycastle
Copy link
Owner Author

Code Review (commits 4-7: /bp-analyze rename)

No issues found.

Mechanical string rename from /analyze to /bp-analyze across source, docs, and tests. Verified no stale /analyze command references remain — all other occurrences of "analyze" in the codebase are URL routes (/dashboard/analyze), script names, or skill filenames.

All 430 tests pass after the update.

Generated with Claude Code

If useful, react with a thumbs-up. Otherwise, thumbs-down.

@onlycastle onlycastle merged commit 0c1c92f into main Mar 19, 2026
1 check passed
@onlycastle onlycastle deleted the refactor/plugin-drop-cursor-bundle-deps-20260319 branch March 19, 2026 17:48
onlycastle added a commit that referenced this pull request Mar 20, 2026
Cursor support was dropped in PR #168 but the supported tools table
and scan_sessions description still referenced it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onlycastle added a commit that referenced this pull request Mar 20, 2026
* docs: update remaining plugin commands to slash command syntax

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: remove stale Cursor references from README

Cursor support was dropped in PR #168 but the supported tools table
and scan_sessions description still referenced it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant