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"
- Install:
gem install clawthor - Verify:
which clawthor - 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:
- Takes a
definition.rbfile - Runs
clawthor compileautomatically - Generates plugin files
- Makes them available to Pants
That's all—it's a simple bridge between Pants and Clawthor.
Related
- Clawthor Gem — The DSL compiler
- Baseline Plugin — Reference & modules
- Clawthor Monorepo — Overview
- Pants Docs — Build system
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)
| File | Size | Uploaded | |
|---|---|---|---|
| jaymd96_pants_clawthor-0.1.3.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|