Conversation
- Add MarketplaceManifest deserialization type for marketplace.json - Add marketplace-aware scanning to scan_root (resolves nested plugins via marketplace.json source field) - Handle cache/ and marketplaces/ container directory layouts for Claude Code plugin discovery - Detect marketplace indirection during forge plugin install - Count MCP servers from .mcp.json sidecar in trust prompt - Copy only effective plugin root during install (not entire repo) - Add CLAUDE_PLUGIN_ROOT env var alias for hook and MCP subprocesses - Add CLAUDE_PROJECT_DIR and CLAUDE_SESSION_ID env var aliases - Add modes count to trust prompt, /plugin info, and /plugin list - Add marketplace plugin test fixture and comprehensive tests
- test_format_path_for_display_no_home: explicitly set home to None instead of relying on Faker-generated random value - test_hook_exit_before_prompt_response_does_not_hang: increase elapsed threshold from 3s to 4s to account for parallel test load
Root cause: .gitignore line 44 contains '.mcp.json' which prevented the test fixture at marketplace_author/plugin/.mcp.json from being committed. Test passed locally (file existed on disk) but failed on CI (file missing from git checkout). Fix: git add -f the specific fixture file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add full compatibility with Claude Code marketplace plugin directory structure, enabling Forge to discover, install, and run plugins designed for Claude Code's ecosystem.
Context
When installing a Claude Code marketplace plugin (e.g.
claude-memfrom~/.claude/plugins/marketplaces/thedotmack), Forge showed all components as 0/none despite the plugin containing skills, hooks, MCP servers, and modes. The root cause: Claude Code marketplace repositories use a nested layout wheremarketplace.jsonpoints to the actual plugin subdirectory (e.g../plugin/), but Forge only looked for components at the repository root.Additionally, Claude Code plugins reference
$CLAUDE_PLUGIN_ROOT,$CLAUDE_PROJECT_DIR, and$CLAUDE_SESSION_IDin their hook commands and MCP server definitions — variables that Forge didn't provide.Changes
Marketplace Discovery (Runtime + Install)
MarketplaceManifest/MarketplacePluginEntrydomain types for parsingmarketplace.jsonscan_rootto detect marketplace indirection: when a directory lacks a direct plugin manifest but containsmarketplace.json, the loader follows thesourcefield to find the real plugincache/andmarketplaces/layouts used by Claude Code's plugin managerforge plugin installto resolve marketplace structure, count components from the effective plugin root, and copy only the plugin subdirectory (not the entire repo)MCP Sidecar Counting
.mcp.jsonsidecar file in addition toplugin.jsonmanifest — matching how the runtime loader already worksEnvironment Variable Aliases
CLAUDE_PLUGIN_ROOT,CLAUDE_PROJECT_DIR, andCLAUDE_SESSION_IDas aliases alongside theirFORGE_*counterparts for both hook subprocesses and MCP server processes${CLAUDE_PLUGIN_ROOT}in hook commands now work under Forge without modificationModes Display
modescount to trust prompt,/plugin info, and/plugin listoutput — Claude Code plugins often ship dozens of operational modesFlaky Test Fixes
test_format_path_for_display_no_home: explicitly sethometoNoneinstead of relying on Faker-generated random value that could collide with test pathstest_hook_exit_before_prompt_response_does_not_hang: increased elapsed threshold from 3s to 4s to account for parallel test load while still validating no-hang behaviorUse Cases
forge plugin install ~/.claude/plugins/marketplaces/thedotmackcorrectly resolves the nested plugin, showing accurate component counts (skills: 7, hooks: present, MCP servers: 1, modes: 36)~/.claude/plugins/automatically finds plugins insidemarketplaces/<author>/viamarketplace.jsonindirection${CLAUDE_PLUGIN_ROOT}/scripts/worker.cjsexecute correctly with the variable resolved to the plugin's installed directoryTesting
23 new/updated tests added across 6 crates.