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.2.tar.gz (4.6 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.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jaymd96_pants_clawthor-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 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.2.tar.gz
Algorithm Hash digest
SHA256 26761c8d20bd8c3d96d31c3b0e3332a3e4b43b72648425035eb44bd4cfa51ed2
MD5 599051afa41961dd1f22c6ee068ca9a9
BLAKE2b-256 14b1b8024501f3db92261829028ed04422d2f8070fbd435fdf30b53dab889c23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jaymd96_pants_clawthor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81480aea71e4583222cfafe71d076d0c944217be013852ecc9dceef36a8984b1
MD5 da69d195d90b56e5a950e49a84d97315
BLAKE2b-256 b2bd61a0314aa509114ba1ac521d025da4ae274ac5e2f88f981a223ac46eba49

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