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"
- 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaymd96_pants_clawthor-0.1.1.tar.gz.
File metadata
- Download URL: jaymd96_pants_clawthor-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8854df4120a50e657a11395fb9c89dddf4a4168fab51bf23002900798a25a3d
|
|
| MD5 |
397d97417598c7ad5b7c5424a80d71db
|
|
| BLAKE2b-256 |
8fecad16d5c90732a07759b03957c63d260845d0cbeaba208c9470d9aa835fac
|
File details
Details for the file jaymd96_pants_clawthor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jaymd96_pants_clawthor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe71b303e600fa9a731d73c1d276668abc82f77c0872a4411eaf0db513e1817b
|
|
| MD5 |
66eed10bb255b28f1602ecf526defc6d
|
|
| BLAKE2b-256 |
5e771dac4fd49e53bc8b8087009f0ab3de6ec31f7f15384bef4788ad22533beb
|