> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prpm.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Workflows

> Step-by-step guides for common PRPM tasks

## Getting Started with PRPM

### First Time Setup

1. **Install the CLI:**
   ```bash theme={null}
   npm install -g prpm
   ```

2. **Verify installation:**
   ```bash theme={null}
   prpm --version
   ```

3. **Create an account and login:**
   ```bash theme={null}
   prpm login
   ```

4. **Browse available packages:**
   ```bash theme={null}
   prpm trending
   ```

***

## Discovering and Installing Packages

### Finding the Right Package

**Search by keyword:**

```bash theme={null}
prpm search typescript
```

**Browse trending packages:**

```bash theme={null}
prpm trending --format cursor
```

**View package details:**

```bash theme={null}
prpm info @username/typescript-rules
```

**Check collections:**

```bash theme={null}
# List all collections
prpm collections --list

# View a specific collection
prpm collections web-development
```

### Installing Packages

**Install a single package:**

```bash theme={null}
prpm install @username/typescript-best-practices
```

**Install multiple packages at once:**

```bash theme={null}
prpm install \
  @username/react-rules \
  @username/typescript-config \
  @username/testing-guidelines
```

**Install an entire collection:**

```bash theme={null}
prpm collections web-development --install
```

**Install and convert to a specific format:**

```bash theme={null}
prpm install @username/typescript-rules --as cursor
```

### Verifying Installation

**List installed packages:**

```bash theme={null}
prpm list
```

**List packages for a specific format:**

```bash theme={null}
prpm list --format cursor
```

**Check package details:**

```bash theme={null}
prpm list --verbose
```

***

## Managing Existing Projects

### Indexing Local Prompt Files

If you have existing prompt files in your project, register them with PRPM:

```bash theme={null}
# Scan and register all prompt files
prpm index

# View registered packages
prpm list
```

This will scan these directories:

* `.cursor/rules/`, `.cursor/agents/`, `.cursor/commands/`
* `.claude/agents/`, `.claude/skills/`, `.claude/commands/`
* `.continue/rules/`
* `.windsurf/rules/`
* `.prompts/`
* `.mcp/`

### Keeping Packages Up to Date

**Check for outdated packages:**

```bash theme={null}
prpm outdated
```

**Update a specific package:**

```bash theme={null}
prpm update package-name
```

**Update all packages:**

```bash theme={null}
prpm upgrade
```

**Preview updates without applying:**

```bash theme={null}
prpm upgrade --dry-run
```

**Interactive updates (choose which to update):**

```bash theme={null}
prpm upgrade --interactive
```

### Cleaning Up Packages

**Remove a package:**

```bash theme={null}
prpm uninstall package-name
```

**Remove multiple packages:**

```bash theme={null}
prpm uninstall package1 package2 package3
```

**Remove without confirmation:**

```bash theme={null}
prpm uninstall package-name --force
```

***

## Creating and Publishing Packages

### Creating Your First Package

1. **Initialize a new package:**
   ```bash theme={null}
   mkdir @username/my-cursor-rules
   cd @username/my-cursor-rules
   prpm init
   ```

2. **Follow the interactive prompts:**
   * Package name: `my-username/@username/my-cursor-rules`
   * Description: Describe what your package does
   * Format: `cursor`
   * Subtype: `rule`
   * Author: Your name
   * License: `MIT` (or your choice)
   * Tags: `typescript`, `react`, `best-practices`

3. **Edit the generated files:**
   ```bash theme={null}
   # Edit your rules file
   vim .cursorrules

   # Update the README
   vim README.md
   ```

4. **Test locally:**
   ```bash theme={null}
   # Install in a test project
   cd ../test-project
   prpm install /path/to/@username/my-cursor-rules
   ```

### Publishing Your Package

1. **Ensure you're logged in:**
   ```bash theme={null}
   prpm whoami
   # If not logged in:
   prpm login
   ```

2. **Validate your package:**
   ```bash theme={null}
   prpm schema --validate prpm.json
   ```

3. **Test publish (dry run):**
   ```bash theme={null}
   prpm publish --dry-run
   ```

4. **Publish to registry:**
   ```bash theme={null}
   prpm publish
   ```

5. **Verify publication:**
   ```bash theme={null}
   prpm info my-username/@username/my-cursor-rules
   ```

### Updating Your Published Package

1. **Update version in `prpm.json`:**
   ```json theme={null}
   {
     "name": "@username/my-cursor-rules",
     "version": "1.1.0",
     ...
   }
   ```

2. **Publish the update:**
   ```bash theme={null}
   prpm publish
   ```

3. **Publish a beta version:**
   ```bash theme={null}
   # Update version to 2.0.0-beta.1
   prpm publish --tag beta
   ```

***

## Working Across Multiple Projects

### Setting Up a Standardized Environment

Create a script to install your standard packages across projects:

```bash theme={null}
#!/bin/bash
# setup-prpm.sh

echo "Installing standard PRPM packages..."

prpm install \
  @username/typescript-rules \
  @username/react-best-practices \
  @username/testing-guidelines \
  @username/git-commit-standards

echo "Setup complete!"
```

Make it executable and run:

```bash theme={null}
chmod +x setup-prpm.sh
./setup-prpm.sh
```

### Sharing Configurations Across Teams

1. **Create a collection for your team:**
   * Contact PRPM support or create via registry API
   * Add your team's standard packages

2. **Team members can install everything at once:**
   ```bash theme={null}
   prpm collections your-team-name --install
   ```

### Cross-Project Packages

PRPM currently installs packages into the current project directory. To use packages across projects:

```bash theme={null}
# Create a shared setup script
cat > ~/prpm-setup.sh << 'EOF'
#!/bin/bash
prpm install @username/typescript-rules
prpm install @username/react-patterns
EOF

# Run in each project
chmod +x ~/prpm-setup.sh
cd /path/to/project && ~/prpm-setup.sh
```

***

## Advanced Workflows

### Using PRPM in CI/CD

**Install packages in CI:**

```yaml theme={null}
# .github/workflows/ci.yml
steps:
  - name: Install PRPM packages
    run: |
      npm install -g prpm
      prpm install @username/typescript-rules1 @username/typescript-rules2
    env:
      PRPM_TOKEN: ${{ secrets.PRPM_TOKEN }}
```

**Verify packages are up to date:**

```yaml theme={null}
steps:
  - name: Check for outdated packages
    run: |
      prpm outdated --json > outdated.json
      if [ $(jq length outdated.json) -gt 0 ]; then
        echo "Outdated packages found!"
        exit 1
      fi
```

### Scripting with PRPM

**Check if a package is installed:**

```bash theme={null}
#!/bin/bash
if prpm list --json | jq -e '.[] | select(.id=="package-name")' > /dev/null; then
  echo "Package is installed"
else
  echo "Package not found"
  prpm install @username/typescript-rules
fi
```

**Batch operations:**

```bash theme={null}
#!/bin/bash
# Update all cursor packages
prpm list --format cursor --json | \
  jq -r '.[].id' | \
  xargs prpm update
```

### Custom Registry

**Use a private registry:**

```bash theme={null}
# Set custom registry
prpm config set registry https://registry.example.com

# Or use environment variable
export PRPM_REGISTRY_URL=https://registry.example.com
prpm search internal-packages
```

**Switch between registries:**

```bash theme={null}
# Production registry
alias prpm-prod='PRPM_REGISTRY_URL=https://registry.prpm.dev prpm'

# Development registry
alias prpm-dev='PRPM_REGISTRY_URL=https://dev.registry.prpm.dev prpm'

# Use them
prpm-prod search typescript
prpm-dev publish
```

***

## Troubleshooting Common Issues

### Package Not Found

```bash theme={null}
# Ensure you're using the correct package name
prpm search package-name

# Check if you're authenticated (for private packages)
prpm whoami

# Try specifying a version
prpm install @username/typescript-rules --version 1.0.0
```

### Installation Fails

```bash theme={null}
# Check for conflicting files
ls -la .cursor/rules/

# Force reinstall
prpm uninstall package-name
prpm install @username/typescript-rules --force

# Check disk space and permissions
df -h
ls -la .cursor/
```

### Authentication Issues

```bash theme={null}
# Re-authenticate
prpm login

# Check current auth status
prpm whoami

# Manually set token
prpm config set token YOUR_TOKEN
```

### Updates Not Working

```bash theme={null}
# Check what's outdated
prpm outdated

# Try force update
prpm update package-name --force

# Or uninstall and reinstall
prpm uninstall package-name
prpm install @username/typescript-rules
```

### Lock File Conflicts

```bash theme={null}
# Rebuild lock file from installed packages
prpm index

# Or manually edit prpm.lock if needed
vim prpm.lock
```

***

## Best Practices

### For Package Users

1. **Always check package info before installing:**
   ```bash theme={null}
   prpm info @username/typescript-rules
   ```

2. **Keep packages updated:**
   ```bash theme={null}
   # Set up a weekly reminder
   prpm outdated
   ```

3. **Convert to your preferred format:**
   ```bash theme={null}
   prpm install package-name --as cursor  # Convert to Cursor format
   prpm install package-name --as claude  # Convert to Claude format
   ```

4. **Document your dependencies:**
   ```markdown theme={null}
   # README.md

   ## PRPM Packages

   This project uses:
   - `@username/typescript-rules` - TypeScript coding standards
   - `@username/react-patterns` - React best practices
   ```

### For Package Authors

1. **Follow semantic versioning:**
   * Patch: Bug fixes (1.0.1)
   * Minor: New features (1.1.0)
   * Major: Breaking changes (2.0.0)

2. **Write comprehensive READMEs:**
   * What the package does
   * Installation instructions
   * Usage examples
   * Configuration options

3. **Use descriptive tags:**
   ```json theme={null}
   {
     "tags": ["typescript", "react", "testing", "best-practices"]
   }
   ```

4. **Test before publishing:**
   ```bash theme={null}
   prpm publish --dry-run
   ```

5. **Keep packages focused:**
   * One clear purpose per package
   * Split large packages into smaller ones
   * Use collections to group related packages

***

## Getting Help

* **Command help:** `prpm <command> --help`
* **GitHub Issues:** [https://github.com/pr-pm/prpm/issues](https://github.com/pr-pm/prpm/issues)
