# Distribution #10: CLI Binary (Rust)
# Distribution #17: Cargo Package
These two distributions are built together - a Rust CLI binary published to Cargo (crates.io).
## Overview
**claude-priority** is a fast, cross-platform validator for Claude Code plugins written in Rust. It provides the same validation capabilities as the npm package and GitHub Action, but with significantly better performance.
## Key Features
- **10x faster** than bash implementation
- **Single binary** - no runtime dependencies
- **Cross-platform** - Linux, macOS, Windows
- **GitHub Actions integration** - native CI/CD support
- **Colored terminal output** - clear error messages
- **Comprehensive validation** - naming, JSON, frontmatter
## Distribution Strategy
### Distribution #10: CLI Binary
**Target Platforms:**
- Linux (x86_64, aarch64)
- macOS (Intel, Apple Silicon)
- Windows (x86_64)
**Distribution Channels:**
1. GitHub Releases (pre-built binaries)
2. Cargo install (from crates.io)
3. Homebrew (via formula in homebrew-claude-priority)
4. Chocolatey (Windows package manager)
5. Snap (universal Linux package)
6. AUR (Arch Linux user repository)
### Distribution #17: Cargo Package
**Package Name:** `claude-priority`
**Registry:** https://crates.io
**Documentation:** https://docs.rs/claude-priority
## Publishing Checklist
### Prerequisites
- [ ] Rust toolchain installed (latest stable)
- [ ] Cargo account on crates.io
- [ ] API token configured (`cargo login`)
- [ ] GitHub repo permissions
- [ ] crates.io package name available
### Step 1: Build and Test
```bash
cd .distributions/10-cli-binary
# Build release binary
cargo build --release
# Run tests
cargo test
# Run clippy (linter)
cargo clippy
# Format code
cargo fmt
# Test install locally
cargo install --path .
```
### Step 2: Pre-Release Checks
```bash
# Check package contents
cargo package --list
# Dry run publish
cargo publish --dry-run
# Verify Cargo.toml metadata
cat Cargo.toml
```
Verify:
- [ ] All metadata fields filled (name, version, authors, description, license, repository)
- [ ] README.md exists and is referenced
- [ ] LICENSE file exists (MIT)
- [ ] All dependencies have correct versions
- [ ] Keywords and categories are appropriate
- [ ] No sensitive files included
### Step 3: Publish to Cargo
```bash
# Login to crates.io (one time)
cargo login <YOUR_API_TOKEN>
# Publish
cargo publish
# Verify on crates.io
open https://crates.io/crates/claude-priority
```
### Step 4: Create GitHub Release
```bash
# Tag the release
git tag v1.0.0
git push origin v1.0.0
# Build binaries for all platforms
# (Use GitHub Actions for cross-compilation)
# Create release on GitHub
gh release create v1.0.0 \
--title "v1.0.0 - Initial Release" \
--notes "First stable release of claude-priority CLI"
# Upload binaries
gh release upload v1.0.0 \
target/release/claude-priority-linux-x86_64 \
target/release/claude-priority-macos-x86_64 \
target/release/claude-priority-macos-aarch64 \
target/release/claude-priority-windows-x86_64.exe
```
### Step 5: Update Homebrew Formula
Update the formula in `ZenterFlow/homebrew-claude-priority` to use the Cargo version:
```ruby
class ClaudePriority < Formula
desc "Fast validator for Claude Code plugins"
homepage "https://github.com/ZenterFlow/claude-priority"
url "https://github.com/ZenterFlow/claude-priority/archive/v1.0.0.tar.gz"
sha256 "..."
license "MIT"
depends_on "rust" => :build
def install
cd ".distributions/10-cli-binary" do
system "cargo", "install", *std_cargo_args
end
end
test do
system "#{bin}/claude-priority", "--version"
end
end
```
## Cross-Compilation for Releases
Use GitHub Actions to build for all platforms:
```yaml
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: claude-priority
asset_name: claude-priority-linux-x86_64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: claude-priority
asset_name: claude-priority-linux-aarch64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: claude-priority
asset_name: claude-priority-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: claude-priority
asset_name: claude-priority-macos-aarch64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: claude-priority.exe
asset_name: claude-priority-windows-x86_64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }} --manifest-path .distributions/10-cli-binary/Cargo.toml
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: .distributions/10-cli-binary/target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
```
## Post-Release Tasks
- [ ] Update README.md with installation instructions
- [ ] Announce on Discord/Twitter
- [ ] Update documentation site
- [ ] Create blog post about Rust rewrite
- [ ] Update distribution tracking in main README
- [ ] Mark distributions #10 and #17 as published
## Performance Benchmarks
Document performance improvements over bash implementation:
```bash
# Benchmark bash version
time ./validate.sh /path/to/plugin
# Benchmark Rust version
time claude-priority validate /path/to/plugin
# Expected: ~10x faster
```
## Future Enhancements
- [ ] Add `--format json` for machine-readable output
- [ ] Add `--fix` flag to auto-fix common issues
- [ ] Add `--watch` mode for development
- [ ] Add `--config` file support for custom rules
- [ ] Parallel validation of multiple plugins
- [ ] Custom policy engine
- [ ] API server mode for integrations
## Support
- **Issues**: https://github.com/ZenterFlow/claude-priority/issues
- **Discussions**: https://github.com/ZenterFlow/claude-priority/discussions
- **Email**: jonathan.mcguinness@outlook.com
## License
MIT - See [LICENSE](../../LICENSE) for details