---
name: new-plugin-factory
description: >-
  Quick entry-point for all RBA Skills plugin and skill factory operations.
  Dispatches to the right factory skill based on what you pass: a plugin
  description for a full bundle, an existing plugin slug to extend it, or
  a mode flag to run a specific factory operation. Wraps scaffold-plugin,
  scaffold-skill, scaffold-agent, scaffold-hook, and audit-plugin.
argument-hint: "'<plugin description>' | <plugin-slug> --add-skill '<desc>' | <plugin-slug> --add-agent '<desc>' | <plugin-slug> --add-hook '<desc>' | <plugin-slug> --audit | --standalone '<skill description>'"
allowed-tools:
  - Read
  - Glob
  - Grep
  - Bash(find * -name plugin.json)
  - Bash(find * -name SKILL.md)
---

# /new-plugin-factory — RBA Skills Factory Dispatcher

Dispatch to the appropriate factory skill based on `$ARGUMENTS`:

## Routing logic

| Input pattern | Dispatches to |
|--------------|--------------|
| A quoted description with no flag | `scaffold-plugin` — full new plugin bundle |
| `<slug> --add-skill '<desc>'` | `scaffold-skill` — add skill to existing plugin |
| `<slug> --add-agent '<desc>'` | `scaffold-agent` — add subagent to existing plugin |
| `<slug> --add-hook '<desc>'` | `scaffold-hook` — add hooks.json to existing plugin |
| `<slug> --audit` | `audit-plugin` — gap report against CLAUDE.md rules |
| `--standalone '<desc>'` | `scaffold-skill` with `--standalone` flag — standalone skill |
| No argument | Print usage (this help text) |

## Behaviour

1. Parse `$ARGUMENTS` using the routing table above.
2. State which factory skill you are dispatching to and why.
3. Apply that skill's complete methodology — do not shortcut phases.
4. After scaffolding, always run the `audit-plugin` self-check on the output.

## Quick reference

```
/new-plugin-factory 'Generates Optimizely content-type models from a brief description'
# → scaffold-plugin: new plugin bundle, slug derived from description

/new-plugin-factory estimate-sow-builder --add-skill 'Drafts a change-order notice from a scope delta'
# → scaffold-skill: adds draft-change-order skill to estimate-sow-builder

/new-plugin-factory code-review-enforcer --add-agent 'Autonomous reviewer that orchestrates all review skills'
# → scaffold-agent: adds agent to code-review-enforcer

/new-plugin-factory code-review-enforcer --add-hook 'Run prettier after every Write'
# → scaffold-hook: adds PostToolUse hook to code-review-enforcer

/new-plugin-factory code-review-enforcer --audit
# → audit-plugin: gap report on code-review-enforcer bundle

/new-plugin-factory --standalone 'Converts Figma tokens JSON to CSS custom properties'
# → scaffold-skill --standalone: standalone skill at skills/<slug>/SKILL.md
```
