|
| 1 | +# Contributing to the PyWry Claude Code plugin |
| 2 | + |
| 3 | +This document covers the mechanics of changing anything under `claude/`. |
| 4 | +For general PyWry development see the top-level [CLAUDE.md](../CLAUDE.md) |
| 5 | +and the PyWry contributing guide. |
| 6 | + |
| 7 | +## What lives here |
| 8 | + |
| 9 | +- **`claude/.claude-plugin/marketplace.json`** — the single, canonical |
| 10 | + marketplace manifest for this repo. It lists every plugin under |
| 11 | + `claude/plugins/*`. Discovered automatically when a Claude Code user |
| 12 | + adds `deeleeramone/PyWry --path claude/.claude-plugin/marketplace.json` |
| 13 | + as a marketplace. |
| 14 | +- **`claude/plugins/<name>/`** — one plugin each. Every plugin has its |
| 15 | + own `.claude-plugin/plugin.json`, `.mcp.json`, assets, CHANGELOG, and |
| 16 | + README. |
| 17 | + |
| 18 | +## Versioning |
| 19 | + |
| 20 | +Every plugin follows [semver](https://semver.org/) independently of the |
| 21 | +PyWry Python package. |
| 22 | + |
| 23 | +| Bump | When | |
| 24 | +|---|---| |
| 25 | +| **Patch** (0.1.0 → 0.1.1) | Bug fixes, doc tweaks, tightening a skill, renaming an internal helper | |
| 26 | +| **Minor** (0.1.0 → 0.2.0) | New slash command, new skill, new subagent, new hook, new MCP tool surfaced | |
| 27 | +| **Major** (0.1.0 → 1.0.0) | Renaming the plugin, changing the marketplace name, removing a command/skill/tool, bumping the minimum required PyWry version | |
| 28 | + |
| 29 | +The version appears in **two** places and they **must match**: |
| 30 | + |
| 31 | +1. `claude/plugins/<name>/.claude-plugin/plugin.json` → `version` |
| 32 | +2. `claude/.claude-plugin/marketplace.json` → `plugins[…].version` |
| 33 | + |
| 34 | +CI ([.github/workflows/plugin-manifest.yml](../.github/workflows/plugin-manifest.yml)) |
| 35 | +fails PRs that leave those out of sync or change any `claude/plugins/<name>/` |
| 36 | +file without bumping the plugin's version. |
| 37 | + |
| 38 | +## Release checklist |
| 39 | + |
| 40 | +Use [RELEASING.md](plugins/pywry/RELEASING.md) for the step-by-step — |
| 41 | +summary below: |
| 42 | + |
| 43 | +1. Land all pending changes on `main`. |
| 44 | +2. Bump the version in both manifest files. |
| 45 | +3. Update `claude/plugins/<name>/CHANGELOG.md` with the release notes |
| 46 | + (keep a `## [Unreleased]` section at the top). |
| 47 | +4. Commit with a message like |
| 48 | + `Release claude/plugins/pywry v0.2.0`. |
| 49 | +5. Tag: |
| 50 | + ```bash |
| 51 | + git tag -a plugin-pywry-v0.2.0 -m "pywry plugin v0.2.0" |
| 52 | + git push origin plugin-pywry-v0.2.0 |
| 53 | + ``` |
| 54 | +6. Users pin with `/plugin install pywry@pywry --version plugin-pywry-v0.2.0` |
| 55 | + to avoid tracking `main`. |
| 56 | + |
| 57 | +## Adding a new plugin |
| 58 | + |
| 59 | +``` |
| 60 | +claude/plugins/<new-plugin-name>/ |
| 61 | +├── .claude-plugin/ |
| 62 | +│ └── plugin.json # {name, version, description, author, ...} |
| 63 | +├── .mcp.json # (optional) MCP server declaration |
| 64 | +├── agents/ # (optional) |
| 65 | +├── commands/ # (optional) |
| 66 | +├── hooks/ # (optional) |
| 67 | +├── skills/ # (optional) |
| 68 | +├── README.md |
| 69 | +└── CHANGELOG.md |
| 70 | +``` |
| 71 | + |
| 72 | +Then append an entry to `claude/.claude-plugin/marketplace.json`: |
| 73 | + |
| 74 | +```json |
| 75 | +{ |
| 76 | + "name": "<new-plugin-name>", |
| 77 | + "source": "./plugins/<new-plugin-name>/", |
| 78 | + "description": "...", |
| 79 | + "version": "0.1.0", |
| 80 | + "license": "Apache-2.0", |
| 81 | + "homepage": "https://github.com/deeleeramone/PyWry", |
| 82 | + "keywords": ["..."] |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +CI will reject the PR if: |
| 87 | + |
| 88 | +- `.claude-plugin/plugin.json` or `.mcp.json` is malformed JSON. |
| 89 | +- The plugin version in the plugin manifest doesn't match the |
| 90 | + marketplace entry. |
| 91 | +- A referenced skill/command/agent/hook file is missing. |
| 92 | +- Any `source` path in `marketplace.json` doesn't exist on disk. |
| 93 | + |
| 94 | +## Running the plugin locally during development |
| 95 | + |
| 96 | +```bash |
| 97 | +# From the repo root, in the worktree or main checkout: |
| 98 | +pip install -e './pywry[dev]' # install worktree pywry |
| 99 | +/plugin marketplace add $(pwd)/claude # absolute path |
| 100 | +/plugin install pywry@pywry |
| 101 | +``` |
| 102 | + |
| 103 | +Then `/pywry:doctor` to verify. |
0 commit comments