Skip to content

Commit e1049df

Browse files
retsohuangclaude
andcommitted
refactor: remove Node.js toolchain and rewrite plugin validation
Replace the Bun/TypeScript validate-plugin.ts with a shell script that validates .claude-plugin/plugin.json. Remove package.json, bun.lock, lefthook.yml, and node_modules since no plugins use Node.js anymore. Simplify CI to only run plugin validation without bun setup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9a74580 commit e1049df

13 files changed

Lines changed: 126 additions & 434 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,6 @@ on:
55
branches: [main]
66

77
jobs:
8-
check:
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- uses: actions/checkout@v4
13-
14-
- uses: oven-sh/setup-bun@v2
15-
with:
16-
bun-version: latest
17-
18-
- name: Install dependencies
19-
run: bun install --frozen-lockfile
20-
21-
- name: Build
22-
run: bun run build
23-
24-
- name: Type check
25-
run: bun run typecheck
26-
27-
- name: Test
28-
run: bun test
29-
308
validate-plugins:
319
runs-on: ubuntu-latest
3210

@@ -35,13 +13,6 @@ jobs:
3513
with:
3614
fetch-depth: 0
3715

38-
- uses: oven-sh/setup-bun@v2
39-
with:
40-
bun-version: latest
41-
42-
- name: Install dependencies
43-
run: bun install --frozen-lockfile
44-
4516
- name: Get modified plugins
4617
id: changed-plugins
4718
run: |
@@ -57,9 +28,9 @@ jobs:
5728
failed=0
5829
while IFS= read -r plugin_dir; do
5930
[ -z "$plugin_dir" ] && continue
60-
if [ -f "${plugin_dir}/plugin.json" ]; then
31+
if [ -f "${plugin_dir}/.claude-plugin/plugin.json" ]; then
6132
echo "Validating: $plugin_dir"
62-
if ! bun scripts/validate-plugin.ts "$plugin_dir"; then
33+
if ! bash scripts/validate-plugin.sh "$plugin_dir"; then
6334
failed=1
6435
fi
6536
fi

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ Thumbs.db
1212
.mcp.json
1313
.worktreeinclude.yaml
1414

15-
# Node modules (if plugins use npm)
16-
node_modules/
17-
npm-debug.log*
18-
yarn-debug.log*
19-
yarn-error.log*
20-
2115
# Environment files
2216
.env
2317
.env.local
@@ -33,7 +27,5 @@ yarn-error.log*
3327
# Build outputs
3428
build/
3529
*.log
36-
*.bun-build
37-
*/dist/
3830
.spectra/
3931
openspec/.vector-search.db

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
Retso Marketplace is a custom plugin marketplace for Claude Code. It's a Bun monorepo containing plugins and the marketplace registry.
7+
Retso Marketplace is a custom plugin marketplace for Claude Code, containing plugins and the marketplace registry.
88

99
## Version Bumping
1010

@@ -24,13 +24,13 @@ plugins/
2424
## Plugin Structure
2525

2626
Each plugin contains:
27-
- `plugin.json` - Metadata: name, version, commands[], agents[], skills[]
27+
- `.claude-plugin/plugin.json` - Metadata: name, version, commands[], agents[], skills[]
2828
- `commands/*.md` - Slash commands with YAML frontmatter (description, allowed-tools, model)
2929
- `agents/*.md` - Sub-agents for parallel processing with JSON input/output contracts
3030
- `skills/*/SKILL.md` - Auto-invoked skills with their own scripts/assets
3131

3232
## Adding a New Plugin
3333

34-
1. Create `plugins/<name>/` with `plugin.json`
34+
1. Create `plugins/<name>/` with `.claude-plugin/plugin.json`
3535
2. Add entry to `.claude-plugin/marketplace.json` plugins array
3636
3. Update root `README.md` Available Plugins table

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ A typical plugin in this marketplace should follow this structure:
126126

127127
```
128128
plugins/my-plugin/
129-
├── plugin.json # Plugin metadata (optional if strict: false)
129+
├── .claude-plugin/
130+
│ └── plugin.json # Plugin metadata
130131
├── commands/ # Slash commands
131132
│ └── my-command.md
132133
├── agents/ # AI agents

bun.lock

Lines changed: 0 additions & 210 deletions
This file was deleted.

lefthook.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
## Context
22

3-
The `cli/` directory contains a React + Ink terminal UI (`plugin-kit`) for interactive plugin installation. It was the only way to install plugins before Claude Code added native `--plugin-dir` and marketplace support. The CLI is now unused but still referenced in workspaces, CI, README, and project docs.
4-
5-
The `cli/scripts/validate-plugin.ts` script is independently useful — it validates `plugin.json` manifests in CI — and must be preserved.
3+
The `cli/` directory has been removed (phase 1 complete). However, the CI `check` job now fails because `bun run --filter '*' build` finds no matching workspaces. More broadly, the entire Node.js/Bun toolchain is dead weight — no plugins use node/bun, and the validate script checks for `plugin.json` at the plugin root which no longer exists. Plugins now store metadata at `.claude-plugin/plugin.json`.
64

75
## Goals / Non-Goals
86

97
**Goals:**
108

11-
- Remove all CLI installer code and its dependencies
12-
- Preserve the plugin validation script for CI use
13-
- Clean up all references to the CLI across project files
9+
- Fix the CI build failure
10+
- Remove all Node.js/Bun toolchain files (`package.json`, `bun.lock`, `lefthook.yml`, `node_modules/`)
11+
- Replace the TypeScript validation script with a shell script that validates `.claude-plugin/plugin.json`
12+
- Update documentation to reflect the current plugin structure
1413

1514
**Non-Goals:**
1615

1716
- Changing any plugin structure or marketplace behavior
18-
- Modifying the validation logic itself
19-
- Removing CLI-related dependencies from root `package.json` (only workspace removal)
17+
- Adding new CI checks beyond plugin validation
2018

2119
## Decisions
2220

23-
### Inline the Zod schema into validate-plugin.ts
21+
### Replace validate-plugin.ts with shell script
22+
23+
The TypeScript validation script requires Bun and Zod. Since we're removing the entire Node.js toolchain, rewrite it as `scripts/validate-plugin.sh` using `jq` (pre-installed on Ubuntu CI runners). The new script validates `.claude-plugin/plugin.json` instead of root `plugin.json`.
24+
25+
**Alternative**: Keep Bun just for the validate script. Rejected because maintaining an entire runtime for one small script is excessive.
2426

25-
The validate script imports `PluginManifestSchema` from `cli/src/types/plugin.ts`. Rather than keeping a separate types file, inline the schema directly into `scripts/validate-plugin.ts`. The schema is small (~15 lines) and the validate script is its only remaining consumer.
27+
### Remove the check CI job entirely
2628

27-
**Alternative**: Create `scripts/types/plugin.ts` as a separate file. Rejected because it adds unnecessary file structure for a single small schema.
29+
The `check` job ran `build`, `typecheck`, and `test` — all delegating to workspaces via `--filter '*'`. No workspaces exist anymore. Remove the job entirely rather than trying to make it work.
2830

29-
### Delete cli/ entirely before relocating
31+
### Remove lefthook pre-commit hooks
3032

31-
Delete the entire `cli/` directory first, then create the new `scripts/validate-plugin.ts` with inlined schema. This is cleaner than a partial move.
33+
The lefthook hooks only trigger on `plugins/*/scripts/**/*.{ts,js}` files which no longer exist. Remove `lefthook.yml` entirely.
3234

3335
## Risks / Trade-offs
3436

35-
- [Removing install method]Users who relied on `plugin-kit` CLI lose that path. Mitigated by `--plugin-dir` and marketplace being strictly better alternatives.
36-
- [CI breakage during transition]If CI runs between deleting `cli/` and updating the workflow path. Mitigated by making all changes in a single commit.
37+
- [No pre-commit hooks]Losing lint/format checks on commit. Acceptable because no JS/TS plugin code exists to lint.
38+
- [jq dependency in CI]`jq` is pre-installed on GitHub Actions ubuntu runners, so no additional setup needed.

openspec/changes/delete-cli-installation/proposal.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ The CLI installer (`plugin-kit` / `pk`) was built before Claude Code supported `
44

55
## What Changes
66

7-
- **Remove** the entire `cli/` directory (React + Ink terminal UI, build scripts, install script)
8-
- **Relocate** `cli/scripts/validate-plugin.ts` to a top-level `scripts/` directory (still used by CI)
9-
- **Inline** the `PluginManifestSchema` into the relocated validate script (eliminating the dependency on `cli/src/types/plugin.ts`)
10-
- **Update** project configuration: `package.json` workspaces, `.gitignore`, CI workflow path, README, CLAUDE.md
11-
- **Regenerate** `bun.lock` without CLI dependencies
7+
- **Remove** the entire `cli/` directory (React + Ink terminal UI, build scripts, install script) *(done)*
8+
- **Remove** the entire Node.js/Bun toolchain: `package.json`, `bun.lock`, `node_modules/`, `lefthook.yml`
9+
- **Replace** `scripts/validate-plugin.ts` (Bun + Zod) with `scripts/validate-plugin.sh` (shell + jq), validating `.claude-plugin/plugin.json` instead of root `plugin.json`
10+
- **Rewrite** CI workflow: remove `check` job, simplify `validate-plugins` to use shell script without bun
11+
- **Update** documentation: README Plugin Structure section, CLAUDE.md, `.gitignore`
1212

1313
## Capabilities
1414

@@ -22,6 +22,6 @@ The CLI installer (`plugin-kit` / `pk`) was built before Claude Code supported `
2222

2323
## Impact
2424

25-
- Affected code: `cli/` (deleted), `scripts/validate-plugin.ts` (new location), `.github/workflows/ci.yml`, `package.json`, `README.md`, `CLAUDE.md`, `.gitignore`, `bun.lock`
26-
- Dependencies removed: `ink`, `react`, `ink-text-input`, `yaml` (CLI-only dependencies)
25+
- Affected code: `cli/` (deleted), `scripts/validate-plugin.ts` `scripts/validate-plugin.sh`, `.github/workflows/ci.yml`, `package.json` (deleted), `bun.lock` (deleted), `lefthook.yml` (deleted), `README.md`, `CLAUDE.md`, `.gitignore`
26+
- All npm dependencies removed — project no longer uses Node.js/Bun runtime
2727
- No plugin functionality affected — marketplace and `--plugin-dir` workflows remain unchanged

openspec/changes/delete-cli-installation/specs/cli-removal/spec.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
### Requirement: CLI plugin installer
44
**Reason**: Replaced by Claude Code's native `--plugin-dir` flag and marketplace installation
55
**Migration**: Use `claude --plugin-dir ./plugins/<name>` for local testing, or `/plugin marketplace add` for marketplace installation
6+
7+
#### Scenario: CLI binary no longer available
8+
- **WHEN** user attempts to run `plugin-kit` or `pk`
9+
- **THEN** the command SHALL NOT be available as the binary is no longer built or distributed

openspec/changes/delete-cli-installation/tasks.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,33 @@
2020

2121
- [x] 4.1 Run `bun run typecheck` — should pass
2222
- [x] 4.2 Run `bun test` — should pass
23-
- [x] 4.3 Commit all changes: `refactor: remove CLI installer in favor of native plugin-dir support`
23+
- [x] 4.3 Commit all changes: `refactor: remove CLI plugin installer in favor of native plugin-dir support`
24+
25+
## 5. Replace validate-plugin.ts with shell script
26+
27+
- [x] 5.1 Delete `scripts/validate-plugin.ts`
28+
- [x] 5.2 Create `scripts/validate-plugin.sh` using jq to validate `.claude-plugin/plugin.json` (check required fields: name matches directory, description, version semver, referenced commands/agents files exist)
29+
- [x] 5.3 Verify `bash scripts/validate-plugin.sh plugins/github-tools` runs successfully
30+
31+
## 6. Remove Node.js toolchain
32+
33+
- [x] 6.1 Delete `package.json`
34+
- [x] 6.2 Delete `bun.lock`
35+
- [x] 6.3 Remove lefthook pre-commit hooks — delete `lefthook.yml`
36+
- [x] 6.4 Delete `node_modules/` directory
37+
- [x] 6.5 Clean up `.gitignore` — remove `node_modules/` and npm/yarn log entries
38+
39+
## 7. Rewrite CI workflow
40+
41+
- [x] 7.1 Remove the check CI job entirely from `.github/workflows/ci.yml`
42+
- [x] 7.2 Update `validate-plugins` job: remove bun setup and `bun install`, use `bash scripts/validate-plugin.sh` instead
43+
44+
## 8. Update documentation
45+
46+
- [x] 8.1 Update Plugin Structure section in `README.md` — change `plugin.json` at root to `.claude-plugin/plugin.json`
47+
- [x] 8.2 Update `CLAUDE.md` — remove any remaining bun/node references
48+
49+
## 9. Verification
50+
51+
- [ ] 9.1 Push and confirm CI passes on PR #17
52+
- [x] 9.2 Commit all changes

0 commit comments

Comments
 (0)