# claude-priority
Fast, cross-platform validator for Claude Code plugins written in Rust.
## Features
- ✅ **Fast**: Written in Rust for maximum performance
- ✅ **Cross-platform**: Works on Linux, macOS, and Windows
- ✅ **Zero runtime dependencies**: Single binary, no installation required
- ✅ **Comprehensive validation**: Checks naming, JSON schema, and YAML frontmatter
- ✅ **GitHub Actions integration**: Native support for CI/CD pipelines
- ✅ **Colored output**: Clear, readable terminal output
- ✅ **Detailed error messages**: Know exactly what needs to be fixed
## Installation
### From Cargo (crates.io)
```bash
cargo install claude-priority
```
### From Source
```bash
git clone https://github.com/ZenterFlow/claude-priority.git
cd .distributions/10-cli-binary
cargo build --release
sudo cp target/release/claude-priority /usr/local/bin/
```
### Pre-built Binaries
Download the latest binary for your platform from the [releases page](https://github.com/ZenterFlow/claude-priority/releases).
## Usage
### Basic Validation
Validate a Claude Code plugin in the current directory:
```bash
claude-priority validate
```
Validate a specific plugin directory:
```bash
claude-priority validate /path/to/plugin
```
### Advanced Options
Skip specific checks:
```bash
# Skip naming validation
claude-priority validate --skip-naming
# Skip JSON validation
claude-priority validate --skip-json
# Skip frontmatter validation
claude-priority validate --skip-frontmatter
```
Continue even if validation fails:
```bash
claude-priority validate --no-fail-on-error
```
### Help
```bash
claude-priority --help
claude-priority validate --help
```
## What It Validates
### 1. Naming Conventions
- Plugin directory must be `lowercase-with-hyphens`
- Skill directories must be `lowercase-with-hyphens`
- Command directories must be `lowercase-with-hyphens`
- Agent directories must be `lowercase-with-hyphens`
- Frontmatter names must match directory names
### 2. JSON Schema
- `marketplace.json` must exist and be valid JSON
- Required fields: `name`, `version`, `description`, `author`
- Version must follow semantic versioning (x.y.z)
- `author` field must be an object (not a string)
- `skills` array must contain objects if present
### 3. YAML Frontmatter
- `skill.md` files must have YAML frontmatter
- Required fields: `name`, `description`
- Description length: 10-200 characters for skills
- Description length: 5-100 characters for commands
- License must be from approved list: MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, CC-BY-SA, Unlicense
- Title heading should match skill name
## GitHub Actions Integration
The CLI automatically detects when running in GitHub Actions and outputs annotations:
```yaml
- name: Validate Plugin
run: claude-priority validate .
```
Outputs:
- `validation-status`: `pass` or `fail`
- `total-checks`: Number of checks run
- `passed-checks`: Number of checks that passed
- `failed-checks`: Number of checks that failed
- `error-messages`: All error messages
## Exit Codes
- `0`: Validation passed
- `1`: Validation failed
## Performance
**10x faster than bash implementation** 🚀
Typical validation times:
- Small plugin (1-2 skills): < 10ms
- Medium plugin (5-10 skills): < 50ms
- Large plugin (20+ skills): < 100ms
## Development
### Build
```bash
cargo build
```
### Test
```bash
cargo test
```
### Run
```bash
cargo run -- validate /path/to/plugin
```
### Release
```bash
cargo build --release
```
Binary will be at `target/release/claude-priority`
## Publishing to Cargo
```bash
# Login to crates.io
cargo login
# Publish
cargo publish
```
## License
MIT - See [LICENSE](../../LICENSE) for details
## Links
- **Repository**: https://github.com/ZenterFlow/claude-priority
- **Crates.io**: https://crates.io/crates/claude-priority
- **Documentation**: https://docs.rs/claude-priority
## Author
**ZenterFlow** - jonathan.mcguinness@outlook.com