Skip to content

Commit bb3200f

Browse files
sjnimsclaude
andauthored
fix: enable router invocation of workflow commands (#145)
## Summary Enable the `/plugin-dev:start` router command to successfully invoke child workflows by removing `disable-model-invocation: true` from target commands. ## Problem Fixes #143 The `/plugin-dev:start` router uses `SlashCommand` tool to invoke child workflows (`/plugin-dev:create-plugin` or `/plugin-dev:create-marketplace`). However, both target commands had `disable-model-invocation: true` set, which per [official documentation](https://code.claude.com/docs/en/slash-commands.md) blocks programmatic invocation via the SlashCommand tool. ## Solution Apply the correct protection pattern: - **Entry point** (`start.md`) has `disable-model-invocation: true` ✅ - **Child commands** are invocable internally via SlashCommand tool Removed `disable-model-invocation: true` from both child commands to allow the router pattern to work. ### Alternatives Considered 1. **Remove router entirely**: Would lose the user-friendly entry point that helps new users choose the right workflow 2. **Direct user to manually invoke commands**: Poor UX - defeats the purpose of having a guided router 3. **Remove all disable-model-invocation flags**: Would lose protection on the entry point ## Changes - `plugins/plugin-dev/commands/create-plugin.md`: Remove `disable-model-invocation: true` - `plugins/plugin-dev/commands/create-marketplace.md`: Remove `disable-model-invocation: true` - `plugins/plugin-dev/commands/start.md`: Add new router command (was untracked) - `CLAUDE.md`: Document the new `/plugin-dev:start` command - `README.md`: Document the new entry point workflow ## Testing - [x] Markdownlint passes - [x] Verified frontmatter structure is valid - [ ] Manual test: Load plugin and run `/plugin-dev:start`, select plugin → should invoke create-plugin - [ ] Manual test: Load plugin and run `/plugin-dev:start`, select marketplace → should invoke create-marketplace --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8db8955 commit bb3200f

5 files changed

Lines changed: 170 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ Hooks defined in `hooks/hooks.json`:
178178

179179
## Workflow
180180

181+
### `/plugin-dev:start`
182+
183+
The primary entry point for plugin development. Presents users with a choice:
184+
185+
1. **Create a plugin** (recommended for most users) - Routes to `/plugin-dev:create-plugin`
186+
2. **Create a marketplace** - Routes to `/plugin-dev:create-marketplace`
187+
188+
Use this command when starting fresh or when unsure which workflow to use.
189+
181190
### `/plugin-dev:create-plugin`
182191

183192
An 8-phase guided workflow for plugin creation:

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,17 @@ claude --plugin-dir /path/to/plugin-dev/plugins/plugin-dev
6363

6464
## Quick Start
6565

66-
### Creating Your First Plugin
66+
**New to plugin development?** Start with the guided entry point:
67+
68+
```bash
69+
/plugin-dev:start
70+
```
71+
72+
This will help you choose between creating a **plugin** (most users) or a **marketplace** (for distributing multiple plugins).
73+
74+
### Learning by Asking
75+
76+
You can also learn progressively by asking questions. Skills load automatically:
6777

6878
1. **Plan your plugin structure:**
6979
- Ask: "What's the best directory structure for a plugin with commands and MCP integration?"
@@ -77,12 +87,6 @@ claude --plugin-dir /path/to/plugin-dev/plugins/plugin-dev
7787
- Ask: "Create a PreToolUse hook that validates file writes"
7888
- The hook-development skill gives working examples and utilities
7989

80-
Or use the guided workflow:
81-
82-
```bash
83-
/plugin-dev:create-plugin A plugin for managing database migrations
84-
```
85-
8690
## Skills
8791

8892
Skills load automatically when you ask relevant questions. Each skill includes core documentation, reference guides, working examples, and utility scripts.
@@ -111,6 +115,10 @@ For detailed documentation on any skill, ask Claude Code or browse the `skills/`
111115

112116
## Guided Workflows
113117

118+
### /plugin-dev:start
119+
120+
A guided entry point to help you choose between creating a **plugin** (most users) or a **marketplace** (for distributing multiple plugins).
121+
114122
### /plugin-dev:create-plugin
115123

116124
A comprehensive, end-to-end workflow for creating plugins from scratch.

plugins/plugin-dev/commands/create-marketplace.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: Create plugin marketplaces with guided workflow
33
argument-hint: [marketplace-description]
44
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(mkdir:*), Bash(git init:*), TodoWrite, AskUserQuestion, Skill, Task
55
model: sonnet
6-
disable-model-invocation: true
76
---
87

98
# Marketplace Creation Workflow

plugins/plugin-dev/commands/create-plugin.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: Create plugins with guided 8-phase workflow
33
argument-hint: [plugin-description]
44
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(mkdir:*), Bash(git init:*), TodoWrite, AskUserQuestion, Skill, Task
55
model: sonnet
6-
disable-model-invocation: true
76
---
87

98
# Plugin Creation Workflow
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
description: Start plugin development - choose your path
3+
allowed-tools: AskUserQuestion, SlashCommand, TodoWrite
4+
model: sonnet
5+
disable-model-invocation: true
6+
---
7+
8+
# Plugin Development Entry Point
9+
10+
Welcome the user and help them choose the right path for their plugin development journey.
11+
12+
## Your Task
13+
14+
Present the user with a clear choice between two development paths, explain when each is appropriate, then route them to the correct workflow.
15+
16+
## Step 1: Present Options with AskUserQuestion
17+
18+
Use the AskUserQuestion tool to ask the user which path they want to take. Present these options:
19+
20+
**Question**: "What would you like to create?"
21+
22+
**Options**:
23+
24+
1. **A plugin** (Recommended for most users)
25+
- Description: "Create a single plugin with skills, commands, agents, hooks, or MCP integrations. Best for: building something new, adding functionality to Claude Code, or learning plugin development."
26+
27+
2. **A marketplace**
28+
- Description: "Create a collection to organize and distribute multiple plugins. Best for: teams sharing internal tools, publishing a curated set of plugins, or organizing existing plugins."
29+
30+
## Step 2: Provide Context Before They Choose
31+
32+
Before presenting the question, briefly explain:
33+
34+
```
35+
Welcome to the Plugin Development Toolkit!
36+
37+
I'll help you get started. First, let me explain your options:
38+
39+
**Plugin** → A self-contained extension that adds functionality to Claude Code
40+
- Contains skills (knowledge), commands (actions), agents (automation), hooks (events), or MCP servers (integrations)
41+
- Example: "A plugin for managing database migrations"
42+
- This is what most developers want to create
43+
44+
**Marketplace** → A collection that organizes and distributes multiple plugins
45+
- Contains references to one or more plugins (local or remote)
46+
- Example: "A marketplace for our team's internal tools"
47+
- Choose this if you already have plugins to organize, or want to plan a collection upfront
48+
```
49+
50+
## Step 3: Route Based on Choice
51+
52+
After the user selects an option:
53+
54+
**If they chose "A plugin"**:
55+
- Acknowledge their choice
56+
- Use the SlashCommand tool to invoke `/plugin-dev:create-plugin`
57+
- Pass through any context from $ARGUMENTS if provided
58+
59+
**If they chose "A marketplace"**:
60+
- Acknowledge their choice
61+
- Use the SlashCommand tool to invoke `/plugin-dev:create-marketplace`
62+
- Pass through any context from $ARGUMENTS if provided
63+
64+
## Step 4: Handle Arguments
65+
66+
If the user provided arguments ($ARGUMENTS is not empty):
67+
- Analyze the arguments to see if intent is already clear
68+
- If arguments clearly indicate a plugin (e.g., "database migration tool"), suggest plugin path
69+
- If arguments clearly indicate a marketplace (e.g., "team collection", "distribute our plugins"), suggest marketplace path
70+
- Still ask for confirmation before routing
71+
72+
**Initial request:** $ARGUMENTS
73+
74+
---
75+
76+
## Example Interactions
77+
78+
### Example 1: No arguments provided
79+
80+
```
81+
User: /plugin-dev:start
82+
83+
Claude: Welcome to the Plugin Development Toolkit!
84+
85+
I'll help you get started. First, let me explain your options:
86+
87+
**Plugin** → A self-contained extension that adds functionality to Claude Code
88+
- Contains skills (knowledge), commands (actions), agents (automation), hooks (events), or MCP servers (integrations)
89+
- Example: "A plugin for managing database migrations"
90+
- This is what most developers want to create
91+
92+
**Marketplace** → A collection that organizes and distributes multiple plugins
93+
- Contains references to one or more plugins (local or remote)
94+
- Example: "A marketplace for our team's internal tools"
95+
- Choose this if you already have plugins to organize, or want to plan a collection upfront
96+
97+
[Uses AskUserQuestion to present the choice]
98+
```
99+
100+
### Example 2: Arguments suggest a plugin
101+
102+
```
103+
User: /plugin-dev:start a code review assistant
104+
105+
Claude: Welcome to the Plugin Development Toolkit!
106+
107+
Based on your description "a code review assistant", it sounds like you want to create a **plugin** - a self-contained extension that adds code review functionality to Claude Code.
108+
109+
[Uses AskUserQuestion to confirm: "Does creating a plugin sound right for your needs?"]
110+
111+
User: Yes
112+
113+
Claude: Great! Let me start the plugin creation workflow...
114+
[Invokes /plugin-dev:create-plugin a code review assistant]
115+
```
116+
117+
### Example 3: Arguments suggest a marketplace
118+
119+
```
120+
User: /plugin-dev:start organize our team's internal tools
121+
122+
Claude: Welcome to the Plugin Development Toolkit!
123+
124+
Based on your description "organize our team's internal tools", it sounds like you want to create a **marketplace** - a collection to distribute plugins to your team.
125+
126+
[Uses AskUserQuestion to confirm: "Does creating a marketplace sound right for your needs?"]
127+
128+
User: Yes
129+
130+
Claude: Great! Let me start the marketplace creation workflow...
131+
[Invokes /plugin-dev:create-marketplace organize our team's internal tools]
132+
```
133+
134+
---
135+
136+
## Important Notes
137+
138+
- Always present both options clearly before asking
139+
- If arguments are provided, analyze them but still confirm before routing
140+
- Use a friendly, welcoming tone - this is the user's first interaction
141+
- The goal is to help users quickly get to the right workflow, not to slow them down
142+
- If users ask questions instead of choosing, answer briefly and guide them back to the choice
143+
144+
---
145+
146+
Begin by presenting the welcome message and using AskUserQuestion to help the user choose their path.

0 commit comments

Comments
 (0)