Skip to main content

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.

License

MIT — See ../clawthor/LICENSE

Metadata

Release files for jaymd96-pants-clawthor 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jaymd96-pants-clawthor 0.1.3
File Size Uploaded
jaymd96_pants_clawthor-0.1.3.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaymd96-pants-clawthor 0.1.3
File Interpreter ABI Platform
jaymd96_pants_clawthor-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / jaymd96_pants_clawthor-0.1.3.tar.gz

Download URL jaymd96_pants_clawthor-0.1.3.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd92d76d2daf2ba13c00ad41d90f2249b26d21fac404400dead347d71a0dc7a8
BLAKE2b-256 checksum
How to use checksums
7a3e5fc2573b7772959b47fbf6ce78d060c34ab894a98c53dab43955cf35df24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1

Release files / jaymd96_pants_clawthor-0.1.3-py3-none-any.whl

Download URL jaymd96_pants_clawthor-0.1.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a47114fefcba2242f8b9222f2e03b1353680f13dde72b3e1db0855b0cddb37d
BLAKE2b-256 checksum
How to use checksums
1288ec8b1970ec7d4a77c0a174d0079affbfdbe69d3292f1ca4499eda1d91a8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page