Skip to main content
rule CX Codex

marketplaces — Claude Code rule: what it does, how to install

The marketplaces rule for Claude Code organizes component discovery and integration from external registries. It helps the agent evaluate code quality before adding dependencies.

Apache-2.0 ★ 141 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/marketplaces.md
Open on GitHub

What marketplaces does

This rule guides the agent when sourcing and using components from platforms like 21st.dev. It defines criteria for checking production-readiness, documentation depth, and demo availability, preventing the inclusion of substandard dependencies.

To install for Claude Code, create a file at .claude/rules/marketplaces.md. The rule accounts for integration patterns like shadcn/ui and enforces diligence by requiring verification of author reputation and maintenance status, reducing long-term technical debt.

What it helps with

  • evaluate third-party component quality
  • execute installation via npx shadcn@latest
  • verify component compliance with project requirements
  • audit dependencies before integration

Example prompts for the agent

  • Find a suitable dialog component on 21st.dev and verify it against the marketplaces rule
  • Install a component from 21st.dev using npx shadcn@latest add
  • Check if the selected UI component meets accessibility and testing requirements

How to install marketplaces

Manually: put the files in place

.claude/rules/marketplaces.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about marketplaces

How to install the marketplaces rule in Claude Code?

Create a .claude/rules/marketplaces.md file in your project root and paste the rule content inside.

What does the marketplaces rule do?

It establishes standards for evaluating and integrating components from marketplaces to ensure that only tested, high-quality code enters your codebase.

What is required to use components with this rule?

You need Node.js installed in your environment and the shadcn/ui CLI available to run the npx shadcn@latest add command.

Source text

marketplaces.md · Apache-2.0
---
title: Component Marketplaces
impact: LOW
impactDescription: Centralized discovery and distribution
tags: marketplaces, 21st-dev, distribution, discovery, publishing
---

## Component Marketplaces

Marketplaces like [21st.dev](https://21st.dev) combine registry accessibility with package repository discoverability.

### When to Use

**For Publishing:**

- Share without managing infrastructure
- Reach built-in audience
- Monetize your work
- Get community feedback

**For Consuming:**

- Curated discovery by category
- Quality assurance
- Unified tooling

### Installation Pattern

```bash
npx shadcn@latest add https://21st.dev/r/<author>/<component>
```

Example:

```bash
npx shadcn@latest add https://21st.dev/r/haydenbleasel/dialog-stack
```

### What Marketplaces Provide

1. **Hosting** - No infrastructure management
2. **Unified CLI** - Same installation pattern
3. **Previews** - Live demos and examples
4. **Discovery** - Search, categories, recommendations

### Publishing Requirements

Ensure components have:

- Comprehensive documentation
- Multiple demo variations
- Responsive design
- Cross-browser testing
- Accessibility compliance
- Production-ready code

**Bad:**

```json
{
  "name": "my-component",
  "description": "A component",
  "demos": []
}
```

Incomplete documentation, no demos, minimal description - marketplace users can't evaluate quality.

**Good:**

```json
{
  "name": "dialog-stack",
  "description": "A composable dialog system with stack management, keyboard navigation, and focus trapping",
  "demos": [
    {
      "title": "Basic Dialog",
      "description": "Simple modal dialog with close button",
      "code": "..."
    },
    {
      "title": "Nested Dialogs",
      "description": "Multiple dialogs in a stack",
      "code": "..."
    },
    {
      "title": "Form Dialog",
      "description": "Dialog with form validation",
      "code": "..."
    }
  ],
  "documentation": {
    "props": "...",
    "examples": "...",
    "accessibility": "..."
  }
}
```

Comprehensive documentation, multiple demo variations, clear descriptions - enables proper evaluation.

### Benefits

**For Authors:**

- Distribution without infrastructure
- Built-in audience and discovery
- Monetization opportunities
- Community feedback (ratings, comments)

**For Consumers:**

- Curated discovery by category
- Quality assurance through reviews
- Unified installation tooling

### Challenges

**For Authors:**

- Competition and visibility
- Platform dependency
- Quality pressure

**For Consumers:**

- Variable quality despite reviews
- Lock-in concerns
- Discovery paradox (too much choice)

### Best Practices

**When Publishing:**

1. Only publish production-ready components
2. Document thoroughly
3. Create multiple demos
4. Test extensively
5. Maintain actively
6. Engage with community

**When Consuming:**

1. Evaluate before installing
2. Test in your environment
3. Check maintenance status
4. Review code quality
5. Consider alternatives

### Discovery Categories

```
Browse by category:
├── Marketing (Heroes, Pricing, Testimonials)
├── Application (Dashboards, Forms, Data Display)
└── E-commerce (Product Cards, Cart, Checkout)
```

### Due Diligence

Always check:

- Component age and last update
- Documentation quality
- Author reputation
- Dependencies and compatibility
- Test in your environment

© maxtrigify · Apache-2.0 · maxtrigify/Otto

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set18

The whole set →
npm npm is a Claude Code rule that guides the packaging of UI components into versioned releases. It enforces strict exports mapping, peer dependency boundaries, and build steps. CX Codex +1 ★ 141repo stars registry registry is a Claude Code rule for publishing UI components as source code. It defines registry metadata and a deployment flow. CX Codex +1 ★ 141repo stars design-tokens design-tokens is a Claude Code rule that replaces hardcoded colors with semantic tokens. Light and dark themes then change variable values instead of component classes. CX Codex +1 ★ 141repo stars composition The composition rule for Claude Code guides the breakdown of complex UI components into small, focused parts. It serves when building component libraries or flexible interfaces. CX Codex +1 ★ 141repo stars overview overview is a Claude Code rule for designing accessible, composable UI components. It comes into play while shaping component APIs and shared patterns. CX Codex +1 ★ 141repo stars types The types rule for Claude Code standardizes component prop definitions in TypeScript. It provides a framework for building flexible, type-safe interfaces across React projects. CX Codex +1 ★ 141repo stars data-attributes data-attributes is a Claude Code rule for styling component states and targeting nested parts with data-state and data-slot. CX Codex +1 ★ 141repo stars principles The principles rule for Claude Code establishes six core standards for component design. It guides agents during component creation, refactoring, and evaluation. CX Codex +1 ★ 141repo stars

Project sponsors

Companies that keep this analytics open