diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 15ef978..8f7cce2 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,6 +1,6 @@ { "name": "samarth", - "description": "Samarth Rayar's Claude Code plugins, mods and skills", + "description": "Samarth Rayar's Claude Code plugins: mods, skills, subagents, hooks and MCP servers", "owner": { "name": "Samarth Rayar", "url": "https://github.com/Samarth2001" }, "plugins": [ { diff --git a/.claude/skills/new-plugin/SKILL.md b/.claude/skills/new-plugin/SKILL.md new file mode 100644 index 0000000..496bbe2 --- /dev/null +++ b/.claude/skills/new-plugin/SKILL.md @@ -0,0 +1,13 @@ +--- +name: new-plugin +description: Scaffold a new plugin in this marketplace. Use when asked to add, create or start a new plugin, skill bundle, mod, subagent, hook or MCP server in this repo. +argument-hint: " [what it should do]" +--- + +Create a new plugin from: $ARGUMENTS + +1. Pick a kebab-case name and the components it needs (`skill`, `agent`, `hooks`, `mcp`, `mod`). Read `docs/plugin-anatomy.md` to choose. If the name or purpose is unclear, ask. +2. Run `node --experimental-strip-types scripts/new-plugin.mts --with --description ""`. +3. Fill in every TODO in `plugins//`. For a skill, follow `docs/writing-skills.md`. For a mod, load the `plugin-authoring` skill first. +4. Write the plugin README: what it adds, usage with an example, configuration, and what code it runs. +5. Run `claude plugin validate plugins/`, `claude plugin test plugins/` for a mod, `claude plugin validate .` and `node --experimental-strip-types scripts/catalog.mts --check`. Fix anything they report. diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md new file mode 100644 index 0000000..74da7df --- /dev/null +++ b/.claude/skills/release/SKILL.md @@ -0,0 +1,14 @@ +--- +name: release +description: Release a new version of a plugin in this marketplace. +disable-model-invocation: true +argument-hint: " [patch|minor|major]" +--- + +Release plugin: $ARGUMENTS + +1. Read `plugins//CHANGELOG.md` and run `git log --v..HEAD -- plugins/`. If that tag doesn't exist, use the full log for the folder. Then list what changed. +2. Choose the bump if none was given: patch for fixes, minor for features, major for breaking changes such as renamed commands or settings. Confirm it with me. +3. Set `version` in `plugins//.claude-plugin/plugin.json`. Add a `## [] - ` section to the CHANGELOG under Added, Changed or Fixed, plus its compare link at the bottom. +4. Run `claude plugin validate .`, `claude plugin validate plugins/`, `claude plugin test plugins/` if it has tests, and `node --experimental-strip-types scripts/catalog.mts --check`. +5. Commit as `: release `. Then stop and show me the commands to push and tag: `git push` and `claude plugin tag plugins/ --push`. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..d90d1e4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +## What changed + +## Plugins touched + +- [ ] Version bumped in `plugin.json` and a CHANGELOG section added for each plugin whose shipped files changed +- [ ] The plugin's README is updated for anything users see +- [ ] `claude plugin validate .` and `claude plugin validate plugins/` pass +- [ ] `claude plugin test plugins/` passes (mods) +- [ ] `node --experimental-strip-types scripts/catalog.mts --check` passes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5c6c6a..4deb8f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,11 @@ jobs: manifest="plugins/$name/.claude-plugin/plugin.json" changelog="plugins/$name/CHANGELOG.md" + if [ ! -f "$manifest" ]; then + echo "::error::$TAG names no plugin: $manifest does not exist" + exit 1 + fi + actual=$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$manifest" | head -1) if [ "$actual" != "$version" ]; then echo "::error::$TAG does not match $manifest ($actual)" @@ -40,6 +45,7 @@ jobs: on { print } ' "$changelog" > notes.md [ -s notes.md ] || echo "See $changelog." > notes.md - printf '\nInstall or update:\n\n```bash\nclaude plugin marketplace add %s\nclaude plugin install %s@samarth\n```\n' "$GITHUB_REPOSITORY" "$name" >> notes.md + marketplace=$(jq -r .name .claude-plugin/marketplace.json) + printf '\nInstall or update:\n\n```bash\nclaude plugin marketplace add %s\nclaude plugin install %s@%s\n```\n' "$GITHUB_REPOSITORY" "$name" "$marketplace" >> notes.md gh release create "$TAG" --title "$name $version" --notes-file notes.md --verify-tag diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 277319d..03e9ee1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -33,8 +33,15 @@ jobs: fi echo "::endgroup::" done + - name: Catalog is consistent + run: node --experimental-strip-types scripts/catalog.mts --check - name: Generated assets are up to date - run: node --experimental-strip-types scripts/render-buddy-gallery.mts --check + run: | + set -e + for script in scripts/assets/*.mts; do + [ -e "$script" ] || continue + node --experimental-strip-types "$script" --check + done - name: Changed plugins bumped their version run: | if [ "${{ github.event_name }}" = "pull_request" ]; then diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e15c7cb --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,19 @@ +# claude-plugins + +A Claude Code plugin marketplace (`samarth`). Each plugin lives in `plugins//`. Read CONTRIBUTING.md before changing structure or releasing. + +## Rules + +- Keep the root README neutral. Never feature one plugin there. Its catalog table is generated: edit `.claude-plugin/marketplace.json`, then run `node --experimental-strip-types scripts/catalog.mts`. +- Keep each plugin self-contained, in Claude Code's standard layout, with its own README.md and CHANGELOG.md. Dev-only tooling goes in `scripts/`, never inside a plugin. +- Never rename a plugin's `name`. Leave `version` out of marketplace entries. +- Any change to a plugin's shipped files needs a version bump and a CHANGELOG section. README, CHANGELOG, `assets/` and tests are exempt. +- Before reporting work done, run `claude plugin validate .`, `claude plugin validate plugins/`, `claude plugin test plugins/` (if it has tests) and `node --experimental-strip-types scripts/catalog.mts --check`. +- Before writing a mod, load the `plugin-authoring` skill. +- Guides in `docs/` summarize the official docs at code.claude.com. Link to the source and don't state behavior you haven't checked. + +## Commands + +- New plugin: `node --experimental-strip-types scripts/new-plugin.mts --with skill,agent,hooks,mcp,mod --description "..."` +- Regenerate assets: `node --experimental-strip-types scripts/assets/