CLI Reference
add

cldpm add

Add a shared component to a project.

Usage

cldpm add <COMPONENT> --to <PROJECT>

Description

Adds a shared component to a project by:

  1. Updating project.json dependencies
  2. Creating a symlink in the project's .claude/ directory
  3. Updating the per-directory .gitignore

Arguments

ArgumentDescription
COMPONENTComponent specification (see format below)

Options

OptionShortDescriptionRequired
--to-tTarget project nameYes
--no-depsSkip installing component dependenciesNo

Component Format

Components can be specified in two ways:

Explicit type

cldpm add skill:my-skill --to my-project
cldpm add agent:my-agent --to my-project
cldpm add hook:my-hook --to my-project
cldpm add rule:my-rule --to my-project

Auto-detect type

cldpm add my-skill --to my-project

CLDPM searches shared/skills/, shared/agents/, shared/hooks/, and shared/rules/ to find the component.

Examples

Add a skill

cldpm add skill:code-review --to my-project

Add an agent

cldpm add agent:debugger --to my-project

Add with auto-detection

cldpm add code-review --to my-project

Add multiple components

cldpm add skill:code-review --to my-project
cldpm add skill:testing --to my-project
cldpm add agent:debugger --to my-project

Add with dependencies

Components can depend on other components. By default, all dependencies are installed:

cldpm add agent:security-audit --to my-project

Output:

✓ Added agents/security-audit to my-project
  ✓ skills/vulnerability-scan (dependency)
  ✓ skills/code-review (dependency)
  ✓ hooks/pre-commit-lint (dependency)

Skip dependencies

cldpm add agent:security-audit --to my-project --no-deps

Only adds the component itself, not its dependencies.

What Happens

  1. project.json updated:

    {
      "dependencies": {
        "skills": ["code-review"]
      }
    }
  2. Symlink created:

    .claude/skills/code-review -> ../../../shared/skills/code-review
  3. .gitignore updated:

    # CLDPM shared components (symlinks to shared/)
    code-review
⚠️

The component must exist in shared/ before adding. Create it first, then run cldpm add.

Component Dependencies

Components can declare dependencies on other components in their metadata file:

// shared/agents/security-audit/agent.json
{
  "name": "security-audit",
  "description": "Security audit agent",
  "dependencies": {
    "skills": ["vulnerability-scan", "code-review"],
    "hooks": ["pre-commit-lint"]
  }
}

When you add a component with dependencies:

  • All dependencies are automatically added (unless --no-deps)
  • Transitive dependencies are resolved (A depends on B, B depends on C → all added)
  • Already-added dependencies are skipped (no duplicates)

Error Cases

ErrorCause
"Component not found"Component doesn't exist in shared/
"Project not found"Target project doesn't exist
"Component already in project"Component already added (skipped)
"dependency not found"A dependency doesn't exist in shared/