Skip to main content

Pants plugin for compiling Clawthor Claude Code plugins

Project description

Pants Clawthor Plugin

Optional Pants backend that compiles Clawthor plugins as part of your build.

Use this when: You define plugins in BUILD files and want automatic compilation via Pants.

Don't use if: You just want to compile manually with clawthor compile (use the gem directly instead).

Installation

1. Install clawthor gem

gem install clawthor
which clawthor    # Verify it's available

2. Add to pants.toml

[GLOBAL]
plugins = [
    "jaymd96-pants-clawthor==0.1.0",
]

Requirements

  • Pants 2.18+
  • Python 3.9+
  • Ruby 3.0+
  • clawthor gem 0.3.0+

Quick Start

1. Create a BUILD file

# plugins/my_plugin/BUILD
claude_plugin(
    name="my_plugin",
    definition="definition.rb",
)

2. Create definition.rb

# plugins/my_plugin/definition.rb
workspace :my_plugin do
  version "1.0.0"
  author "My Team"
end

skill :example do
  description "Example skill"
end

command :hello do
  description "Say hello"
  template { prompt "Say hello" }
end

3. Build

pants build //plugins/my_plugin:my_plugin

That's it! Generated plugin is in plugins/my_plugin/output/.

Target Options

Option Type Default Description
definition string required Path to definition.rb
output_dir string output Where to generate files
marketplace bool false Use marketplace layout?

Examples

Basic plugin

# plugins/docs/BUILD
claude_plugin(
    name="docs",
    definition="definition.rb",
)

With modules

# plugins/dev/BUILD
claude_plugin(
    name="dev",
    definition="definition.rb",
    output_dir="plugin",
)
# plugins/dev/definition.rb
workspace :dev_tools do
  version "1.0.0"
end

require_relative './modules/planning'
use :planning

Marketplace layout

claude_plugin(
    name="release",
    definition="definition.rb",
    marketplace=True,
)

Reusing Claudo modules

Copy Claudo modules into your project:

cp ../baseline/modules/planning.rb plugins/my_plugin/

Then use them:

require_relative './modules/planning'

workspace :my_plugin do
  use :planning
end

Troubleshooting

"clawthor command not found"

  1. Install: gem install clawthor
  2. Verify: which clawthor
  3. If using rbenv/rvm, check Ruby version: ruby --version

Compilation fails

Check definition file manually:

cd plugins/my_plugin
clawthor compile definition.rb output/

Path issues

Make sure definition is relative to the BUILD file:

claude_plugin(
    name="my_plugin",
    definition="definition.rb",  # Same dir as BUILD
)

Development

Setup

cd pants-plugin
hatch env create
hatch run test

Test your backend

hatch run test

Format code

hatch run fmt

How It Works

This backend:

  1. Takes a definition.rb file
  2. Runs clawthor compile automatically
  3. Generates plugin files
  4. Makes them available to Pants

That's all—it's a simple bridge between Pants and Clawthor.

Related

License

MIT — See ../clawthor/LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jaymd96_pants_clawthor-0.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jaymd96_pants_clawthor-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file jaymd96_pants_clawthor-0.1.3.tar.gz.

File metadata

  • Download URL: jaymd96_pants_clawthor-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1

File hashes

Hashes for jaymd96_pants_clawthor-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fd92d76d2daf2ba13c00ad41d90f2249b26d21fac404400dead347d71a0dc7a8
MD5 573c45e3a97990fc01a5ea0f18815560
BLAKE2b-256 7a3e5fc2573b7772959b47fbf6ce78d060c34ab894a98c53dab43955cf35df24

See more details on using hashes here.

File details

Details for the file jaymd96_pants_clawthor-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for jaymd96_pants_clawthor-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a47114fefcba2242f8b9222f2e03b1353680f13dde72b3e1db0855b0cddb37d
MD5 6f1cd9d786440decfb9a43e209d25481
BLAKE2b-256 1288ec8b1970ec7d4a77c0a174d0079affbfdbe69d3292f1ca4499eda1d91a8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page