Skip to content

Conversation

@yordis
Copy link
Member

@yordis yordis commented Nov 10, 2025

No description provided.

@cursor
Copy link

cursor bot commented Nov 10, 2025

PR Summary

Adds Claude Code marketplace object schema support with type-aware manifest loading and path resolution, updates commands to use it, and refreshes tests and utilities.

  • Marketplaces/Claude Code:
    • Parse Claude Code known_marketplaces.json as an object map; add robust schemas/types and conversion to AIPM format.
    • Support installLocation, nested source (incl. GitHub), URL/branch fallbacks, and cross-platform absolute/relative path resolution.
    • Introduce MarketplaceType and getMarketplaceType; load manifests per type (aipm vs claude).
    • Improve manifest error handling with detailed validation output.
  • Commands (info, plugin-install, plugin-update, plugin-search, sync):
    • Use getMarketplaceType and pass marketplace type to loadMarketplaceManifest.
  • Helpers:
    • git.resolveMarketplacePath: respect absolute directory paths.
    • marketplace.ts: split loadAipmMarketplaceManifest/loadClaudeCodeMarketplaceManifest and unify via loadMarketplaceManifest.
  • Tests:
    • Update for object-based Claude schema and new behaviors; add tests/helpers/test-setup.ts for isolated env; broaden marketplace/manifest tests.
  • CI:
    • Add ci:all script to package.json.

Written by Cursor Bugbot for commit 6d88525. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Refactors marketplace handling to distinguish AIPM vs Claude marketplaces via getMarketplaceType(), adds type-specific manifest loaders, converts Claude marketplace config from an array to a name-keyed object, improves path resolution, and centralizes test environment setup for tests.

Changes

Cohort / File(s) Summary
Build Configuration
package.json
Added scripts.ci:all running format:check, typecheck, and test sequentially
Marketplace Type & Schema
src/schema.ts
Added MarketplaceTypeSchema enum (`'aipm'
Marketplace Helpers
src/helpers/marketplace.ts
Added getMarketplaceType(name), split manifest loading into loadAipmMarketplaceManifest and loadClaudeCodeMarketplaceManifest, and introduced dispatcher loadMarketplaceManifest(path, type) with refined error handling and JsonFileError usage
Claude Code Config
src/helpers/claude-code-config.ts
Switched marketplaces from array → object map; added types ClaudeMarketplaceObjectEntry/ClaudeKnownMarketplaces; changed readClaudeCodeMarketplaces, getClaudeCodeMarketplacePath, and convertClaudeMarketplaceToAIPM to accept (marketplaceName, marketplaceConfig); added source normalization and path-resolution helpers
Git Path Handling
src/helpers/git.ts
Import node:path and improve absolute vs relative path resolution (preserve absolute paths, join relative with cwd)
Commands — manifest usage
Command files
src/commands/info.ts, src/commands/plugin-install.ts, src/commands/plugin-search.ts, src/commands/plugin-update.ts, src/commands/sync.ts
Import getMarketplaceType and call loadMarketplaceManifest(marketplacePath, getMarketplaceType(marketplaceName)) where manifests are loaded; adjust dry-run/manifest logic accordingly
Config Loader
src/config/loader.ts
Iterate Claude marketplaces via Object.entries() and call convertClaudeMarketplaceToAIPM(marketplaceName, marketplaceConfig)
Test Environment Helper
tests/helpers/test-setup.ts
New exported setupTestEnvironment(options?) and TestSetup type to create isolated HOME, optional project init, and provide cleanup
Tests — adapt to new shapes & helper
tests/helpers/claude-code-config.test.ts, tests/helpers/marketplace.test.ts, tests/config/loader.test.ts, tests/commands/claude-code-auto-discovery.test.ts, tests/commands/list.test.ts, tests/commands/marketplace-add.test.ts, tests/commands/marketplace-remove.test.ts
Updated tests to use setupTestEnvironment(), adapted to object-keyed Claude marketplaces, updated getClaudeCodeMarketplacePath/convertClaudeMarketplaceToAIPM usages, and updated loadMarketplaceManifest call sites to include marketplace type argument

Sequence Diagram(s)

sequenceDiagram
    participant Cmd as Command (e.g., plugin-install)
    participant GM as getMarketplaceType()
    participant Dispatcher as loadMarketplaceManifest(path, type)
    participant AIPM as loadAipmMarketplaceManifest()
    participant Claude as loadClaudeCodeMarketplaceManifest()

    Cmd->>GM: getMarketplaceType(marketplaceName)
    GM-->>Cmd: MarketplaceType ('aipm' | 'claude')

    Cmd->>Dispatcher: loadMarketplaceManifest(marketplacePath, type)

    alt type == "claude"
        Dispatcher->>Claude: loadClaudeCodeMarketplaceManifest(marketplacePath)
        Claude-->>Dispatcher: Manifest | null
    else type == "aipm"
        Dispatcher->>AIPM: loadAipmMarketplaceManifest(marketplacePath)
        AIPM-->>Dispatcher: Manifest | null
    end

    Dispatcher-->>Cmd: Manifest | null
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Attention items:
    • src/helpers/claude-code-config.ts: schema change (array→object), new helpers, path-resolution logic, and multiple signature updates.
    • src/helpers/marketplace.ts: dispatcher, dual manifest loaders, JsonFileError handling, and getMarketplaceType correctness.
    • Command files: ensure marketplaceName passed correctly and dry-run manifest behavior unchanged.
    • Tests and test helper: verify setupTestEnvironment isolation, cleanup, and updated test expectations.

Possibly related PRs

Poem

🐰
I hopped through manifests, two kinds to see,
AIPM or Claude — now they name me free,
Arrays became maps, paths chose their way,
Tests in neat burrows sleep safe each day,
A small rabbit cheers this tidy array.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a description explaining the changes made, such as why the marketplace schema was changed from array to object format and what benefits it provides.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: claude code marketplace schema' directly describes the main change in the changeset, which involves restructuring the Claude Code marketplace configuration from an array-based format to an object-map format with updated schema definitions.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 512639f and 6d88525.

📒 Files selected for processing (19)
  • package.json (1 hunks)
  • src/commands/info.ts (2 hunks)
  • src/commands/plugin-install.ts (2 hunks)
  • src/commands/plugin-search.ts (2 hunks)
  • src/commands/plugin-update.ts (2 hunks)
  • src/commands/sync.ts (2 hunks)
  • src/config/loader.ts (2 hunks)
  • src/helpers/claude-code-config.ts (5 hunks)
  • src/helpers/git.ts (2 hunks)
  • src/helpers/marketplace.ts (1 hunks)
  • src/schema.ts (2 hunks)
  • tests/commands/claude-code-auto-discovery.test.ts (6 hunks)
  • tests/commands/list.test.ts (1 hunks)
  • tests/commands/marketplace-add.test.ts (1 hunks)
  • tests/commands/marketplace-remove.test.ts (1 hunks)
  • tests/config/loader.test.ts (12 hunks)
  • tests/helpers/claude-code-config.test.ts (6 hunks)
  • tests/helpers/marketplace.test.ts (2 hunks)
  • tests/helpers/test-setup.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yordis yordis force-pushed the yordis/fix-cc-marketplace-2 branch 2 times, most recently from 3fa51d9 to 661b85d Compare November 10, 2025 00:45
@yordis yordis force-pushed the yordis/fix-cc-marketplace-2 branch 3 times, most recently from 7cde9dc to fce793d Compare November 10, 2025 04:24
@yordis yordis force-pushed the yordis/fix-cc-marketplace-2 branch from fce793d to 9fb9018 Compare November 11, 2025 19:34
@yordis yordis marked this pull request as ready for review November 11, 2025 19:34
@yordis yordis force-pushed the yordis/fix-cc-marketplace-2 branch from 9fb9018 to 70a9887 Compare November 11, 2025 19:36
@yordis yordis force-pushed the yordis/fix-cc-marketplace-2 branch from 70a9887 to 6d88525 Compare November 11, 2025 19:37
@yordis yordis merged commit 609727e into main Nov 11, 2025
5 checks passed
@yordis yordis deleted the yordis/fix-cc-marketplace-2 branch November 11, 2025 19:39
return {
source: 'directory',
path: resolvedPath,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Claude Code: Redundant Marketplace Paths

Path duplication occurs when converting Claude Code marketplace configs with relative paths. The getClaudeCodeMarketplacePath function joins claudePluginsDir/marketplaces/ with the config's path value, but if the config's path already contains marketplaces/ prefix (like marketplaces/test-marketplace), this creates a duplicated path like ~/.claude/plugins/marketplaces/marketplaces/test-marketplace. The function should strip the marketplaces/ prefix from relative paths before joining, or use the path as-is without the extra marketplaces/ directory.

Fix in Cursor Fix in Web

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.

2 participants