Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

fix: claude-marketplace extension#11

Merged
pacphi merged 21 commits into
mainfrom
feature/claude-marketplace-enhancements
Nov 6, 2025
Merged

fix: claude-marketplace extension#11
pacphi merged 21 commits into
mainfrom
feature/claude-marketplace-enhancements

Conversation

@pacphi

@pacphi pacphi commented Nov 5, 2025

Copy link
Copy Markdown
Owner

Pull Request

Description

Claude marketplace extension fails to install plugins

Fixes #(issue number)

No issue created

Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)

Changes Made

See individual tested commits

Testing

Describe the tests that you ran to verify your changes.

  • Existing extension test and self-service workflows exercise crucial dependencies (e.g., scripts)

Test Environment

  • OS: [e.g., macOS 14.0, Ubuntu 22.04]
  • Fly.io region: sjc
  • VM configuration:

Cost Impact

  • No impact on Fly.io costs

Security Considerations

  • No security implications

Breaking Changes

n/a

Documentation

  • Documentation in /docs updated

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Context

n/a

Deployment Notes

Special instructions for deploying these changes:

  • Standard deployment
  • Secrets need to be updated

pacphi and others added 21 commits November 4, 2025 17:18
…workflows

Enable Claude Code authentication in CI/CD pipelines by adding optional ANTHROPIC_API_KEY secret support across all workflows and the deploy action. When provided, the API key is automatically configured in deployed VMs, allowing automated testing of Claude extensions with full functionality, particularly enabling plugin installation via claude-marketplace extension during CI runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…in repository support

- Add get_marketplace_plugins() to discover plugins from marketplace.json files
- Rewrite installation workflow: add marketplace → discover plugins → install each
- Improve test accuracy by counting plugins from marketplace metadata rather than repositories
- Update validation to handle repositories with multiple plugins correctly
- Add better error handling with retry logic and detailed progress logging
- Enhance test-key-functionality.sh with flexible plugin counting and clearer error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ology consistency

- Standardize terminology from "repository" to "marketplace" throughout
- Add find_marketplace_directory() with robust fallback discovery strategies
- Enhance parse_marketplace_json() to extract both marketplace name and plugin list
- Add 30-second timeout protection for plugin installations to prevent hangs
- Improve error handling and status reporting in install_plugins_from_file()
- Update test assertions to use marketplace-centric language
- Ensure validation logic uses new helper functions for reliability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…h Commands

Restructure Claude Code slash commands from flat files to organized
subdirectories for better maintainability and discoverability:

- Move extension commands to .claude/commands/extension-api/
  - new.md (create new extensions)
  - test.md (test extension functionality)
  - validate-manifest.md (validate extension manifest)

- Move GitHub workflow commands to .claude/commands/github/
  - check-ci.md (analyze CI workflow status)
  - review-workflow.md (review workflow best practices)

- Move git commands to .claude/commands/git/
  - commit.md (intelligent commit creation)

Update claude-marketplace extension to use marketplace-based approach:

- Rename .plugins* files to .marketplaces* (terminology consistency)
- Update README.md with marketplace.json documentation
- Adjust test-key-functionality.sh to verify .marketplaces config
- Each marketplace can provide multiple plugins via marketplace.json

This reorganization improves command discoverability and aligns with
the project's hierarchical structure for better scalability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…atus check

Fix critical bug where status() incorrectly reported extension as installed
when only the claude dependency existed. The extension would skip installation
during CI tests, causing failures with old code.

Changes:
- Check for ~/.claude/plugins/known_marketplaces.json existence
- Verify all marketplaces in .marketplaces file are registered
- Compare source.repo values in known_marketplaces.json with .marketplaces entries
- Return NOT_INSTALLED if marketplaces file missing or incomplete
- Add detailed missing marketplace reporting in status output
- Use jq for robust JSON parsing with grep fallback

This ensures the extension only reports INSTALLED when marketplaces are
actually registered with Claude CLI, preventing false positives that caused
workflow tests to skip installation and run against stale code.

Fixes workflow test failures where pre-built images had claude installed
but claude-marketplace was not properly configured.
The extension was failing in CI because `claude /plugin marketplace add`
registers the marketplace synchronously but clones the repository
asynchronously. The 2-second wait was insufficient in CI environments.

Changes:
- Add `wait_for_marketplace_clone()` to poll for up to 30 seconds
- Enhance `find_marketplace_directory()` to read known_marketplaces.json
  first for the exact installLocation path
- Add debug output when timeout occurs to help diagnose clone failures
- Update step numbers in comments for clarity

This fixes the "Cannot find marketplace directory" errors in CI workflows
where marketplace cloning takes longer than the previous 2-second timeout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…kflow

Completely refactor the claude-marketplace extension to align with Claude Code's
official marketplace configuration approach using YAML and settings.json integration.

**Breaking Changes:**
- Replace simple .marketplaces text file with marketplaces.yml (YAML format)
- Remove CLI-based marketplace registration in favor of direct settings.json merge
- Change from "install all plugins" to selective plugin installation via enabledPlugins array

**Extension Script Improvements:**
- Rewrite all API functions (prerequisites, install, configure, validate, status, upgrade, remove)
- Add mise-based yq installation (replaces manual wget downloads)
- Implement YAML→JSON→settings.json conversion workflow
- Add automatic settings.json backup system (keeps last 5 backups)
- Add comprehensive validation for YAML syntax, JSON structure, and plugin references
- Add helper functions: convert_yaml_to_json(), merge_settings_json(), backup_settings_json()

**Test Suite Enhancements:**
- Create test-yaml-config.sh (10 tests for YAML→JSON→settings.json workflow)
- Create test-settings-validation.sh (9 tests for settings.json validation)
- Create test-marketplace-status.sh (12 tests for status output)
- Update test-key-functionality.sh (8 new tests for YAML workflow)
- Update test-idempotency.sh (settings.json idempotency verification)

**Documentation Updates:**
- Completely rewrite README.md (559 lines, remove all .marketplaces references)
- Update CLAUDE.md (new YAML workflow, mise-based yq installation)
- Add YAML configuration examples and troubleshooting guides
- Document mise-based yq installation and version management

**Configuration Format:**
- New: extraKnownMarketplaces (object) + enabledPlugins (array)
- Old: .marketplaces (simple text file, one repo per line)
- Aligns with official Claude Code settings documentation

**Key Benefits:**
- Selective plugin installation (not all plugins from all marketplaces)
- Compatible with Claude Code's automatic marketplace/plugin installation
- Team marketplace sharing via standard settings.json format
- Unified tool management via mise (consistent with nodejs, python, rust, go, ruby)
- Automatic backup/restore capabilities for settings.json
- Comprehensive validation at every step

**Files Changed:**
- Modified: claude-marketplace.extension (~400 lines rewritten)
- Deleted: .marketplaces.example, .marketplaces.ci.example
- Added: marketplaces.yml.example, marketplaces.ci.yml.example, default-settings.json
- Added: 3 new test scripts (~600 lines)
- Modified: 2 existing test scripts
- Modified: README.md (complete rewrite), CLAUDE.md (section update)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…to object

Fix critical structure mismatch in enabledPlugins configuration format to align
with Claude Code's actual implementation.

**Issue:**
Implementation used array format for enabledPlugins, but Claude Code expects
an object/map with boolean values.

**Changes:**

Extension Script (claude-marketplace.extension):
- validate(): Check for object type instead of array type
- validate(): Iterate plugins using `to_entries[] | select(.value == true) | .key`
- configure(): Change default value from `// []` to `// {}`
- status(): Update plugin iteration to use object entries
- remove(): Update jq filter to use `with_entries(select(...))`
- Comment: Changed "array" to "enabled=true" for clarity

Documentation:
- README.md: Updated all 6 YAML/JSON examples (array → object format)
- CLAUDE.md: Updated configuration format example
- YAML examples: Updated marketplaces.yml.example and marketplaces.ci.yml.example

Test Scripts:
- test-yaml-config.sh: Validate object type, not array type
- test-settings-validation.sh: Check for object type and iterate with to_entries
- test-marketplace-status.sh: Use `// {}` default instead of `// []`
- test-key-functionality.sh: Update plugin count and iteration
- test-idempotency.sh: Use `// {}` default for plugin count checks

**Correct Format:**

YAML:
```yaml
enabledPlugins:
  plugin-name@marketplace-name: true
```

JSON:
```json
"enabledPlugins": {
  "beads@beads-marketplace": true,
  "bp@cc-blueprint-toolkit": true
}
```

**Previous (Incorrect) Format:**

YAML:
```yaml
enabledPlugins:
  - plugin-name@marketplace-name
```

JSON:
```json
"enabledPlugins": [
  "plugin-name@marketplace-name"
]
```

**jq Operations Updated:**
- Count: `.enabledPlugins // [] | length` → `.enabledPlugins // {} | length`
- Iterate: `.enabledPlugins[]?` → `.enabledPlugins | to_entries[] | select(.value == true) | .key`
- Type check: `type == "array"` → `type == "object"`
- Remove: `map(select(...))` → `with_entries(select(...))`

**Files Changed:**
- claude-marketplace.extension (6 fixes)
- README.md (6 example updates)
- CLAUDE.md (1 example update)
- marketplaces.yml.example (structure update)
- marketplaces.ci.yml.example (structure update)
- test-yaml-config.sh (1 type check fix)
- test-settings-validation.sh (2 fixes)
- test-marketplace-status.sh (1 fix)
- test-key-functionality.sh (2 fixes)
- test-idempotency.sh (2 fixes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Break long line in CLAUDE.md extension list for better readability
- Add blank line before bullet list in README.md for proper markdown rendering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Ensures per-extension tests only run after API validation completes,
improving workflow dependency ordering and test reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add a GitHub Actions workflow that enables users to safely teardown
Sindri development VMs via manual trigger. This complements the existing
self-service-deploy workflow by providing complete VM lifecycle management.

Features:
- Double confirmation safety check (type app name twice)
- Three-job pipeline: validate → backup (conditional) → teardown
- Optional volume backup with 30-day artifact retention
- Optional volume preservation to keep data while removing compute
- Comprehensive resource inventory and cost savings reporting
- Graceful error handling with detailed GitHub Actions summaries

Inputs:
- app_name (required): Fly.io app to teardown
- confirmation (required): Must match app_name
- create_backup (optional): Create backup before deletion
- keep_volumes (optional): Preserve persistent volumes

Requires FLYIO_AUTH_TOKEN secret for Fly.io API authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ci-mode input parameter to deploy-fly-app action (defaults to false)
- Conditionally set CI_MODE secret only when ci-mode is explicitly enabled
- Update all workflow files to explicitly pass ci-mode: "true"
- Improve YAML config detection in test-key-functionality.sh to check
  actual installed files rather than assuming based on CI_MODE variable

This change improves production safety by requiring explicit opt-in for
CI mode rather than defaulting to it, while maintaining proper CI test
environment configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace string inputs with choice dropdowns across all workflows
(extension-tests, integration, self-service-deploy) to include:
- 7 North America regions (US + Canada)
- 5 Europe regions
- 4 Asia Pacific regions
- 1 South America region (Brazil)
- 1 Africa region (South Africa)

Provides better UX for manual workflow dispatch by showing all
available regions with clear geographic labels.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…onfig

Add validation to check for marketplace configuration in settings.json
during status check. Ensures either extraKnownMarketplaces or
enabledPlugins exists before reporting successful installation.

This prevents false positives where settings.json exists but lacks
actual marketplace configuration, improving extension validation
accuracy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ystem package

Move yq installation from mise-based dynamic installation to system package in
base Docker image. This simplifies the claude-marketplace extension by removing
the dependency on mise-config and the yq tool auto-installation logic.

Changes:
- Add yq PPA repository and install yq via apt in base image
- Remove yq auto-installation logic from prerequisites()
- Remove mise-config dependency references in documentation
- Update troubleshooting guide to reflect system package approach

Benefits:
- Simpler prerequisites - no dynamic yq installation needed
- Reduces extension dependencies (no longer requires mise-config)
- More reliable - yq always available in base image
- Consistent with jq installation approach

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Introduces a three-tier CI/CD optimization strategy to reduce average
build time by 60-75% while maintaining quality gates.

Changes:
- Add quick-checks.yml workflow for fast validation (2-5 min)
- Add single-extension-test.yml for focused testing (2-4 min)
- Restrict full test suite to main branch pushes only
- Add weekly scheduled runs (Sundays 2am UTC) for comprehensive testing
- Narrow path triggers to core system files only (not individual extensions)
- Skip all tests for documentation-only changes

Performance improvements:
- Docs-only commits: 0 minutes (skipped entirely)
- Single extension changes: 2-4 minutes (vs 16 min previously)
- Core system changes: 12-15 minutes (unchanged, as intended)

The develop branch now runs PR checks only, preventing redundant
full test suite runs while still validating changes before merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…operations

Move software-properties-common installation to occur before add-apt-repository
command, as it is a required dependency for PPA management. This prevents
potential failures when adding the yq PPA repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace Ubuntu PPA installation method with direct download from
mikefarah/yq GitHub releases. This provides better version control
and eliminates the need for add-apt-repository operations.

Changes:
- Remove yq PPA repository configuration
- Move software-properties-common to main apt install list
- Install yq binary directly from GitHub releases to /usr/local/bin
- Consolidate package installation steps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pacphi pacphi merged commit 8be0ff4 into main Nov 6, 2025
2 checks passed
@pacphi pacphi deleted the feature/claude-marketplace-enhancements branch November 6, 2025 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant