From claude-factory
Scaffold a Claude Code slash command from a natural language description. Use when creating simple .md commands. Suggests converting to a skill when appropriate. Triggers on /factory:command.
npx claudepluginhub lingelo/marketplace-claude-code --plugin claude-factoryThis skill is limited to using the following tools:
Official specification: @../../references/command-spec.md
Generates custom Claude Code slash commands via guided questions. Includes 10 presets, YAML validation, kebab-case naming, bash permission rules, and folder organization.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Official specification: @../../references/command-spec.md Skill specification (for comparison): @../../references/skill-spec.md Template: @../../templates/command.md
/factory:command "description of what the command should do"
/factory:command my-command "description"
Extract name + description from $ARGUMENTS. If empty, ask.
Check if the target command already exists:
ls -la <target-path>/commands/<command-name>.md 2>/dev/null
Commands are single-file, simpler. Skills support multi-file structure. Suggest a skill instead if:
If a skill would be better, say:
"This use case would benefit from a skill (multi-file support, templates, auto-activation). Would you like me to create a skill instead with /factory:skill?"
If the user wants a command anyway, proceed.
Always use AskUserQuestion to ask: "This might be better as a skill (supports multi-file, auto-activation). Create as skill instead?"
Wait for the user's answer before proceeding.
Determine:
$ARGUMENTS contain?Use AskUserQuestion to resolve ambiguities — only if the description leaves key decisions unclear. Skip this step if the description is precise enough.
Ask only what is unresolved:
Do not ask questions whose answers are obvious from the description.
plugins/<plugin-name>/ → <plugin-root>/commands/<command-name>.md.claude/commands/<command-name>.mdCheck if <target-path>/<command-name>.md exists. If yes, error + suggest alternative.
Also check if a skill with the same name exists (skills take precedence over commands):
ls -la <target-path>/skills/<command-name>/SKILL.md 2>/dev/null
If a skill exists with the same name, warn: "A skill named <name> already exists and takes precedence over commands."
Create <target-path>/commands/<command-name>.md with:
Frontmatter: Minimal.
description: Always include (when to trigger this command)Body: Clear instructions for Claude to follow when the command is invoked.
$ARGUMENTSCommand created: <command-name>
Location: <full-path>/commands/<command-name>.md
Invocation: /<namespace>:<command-name> (plugin) or /<command-name> (standalone)
Note: Commands and skills have been merged. Skills are recommended for new work.
Tip: Run /factory:audit <path> to validate.
Triggered when Step 2 detects the command already exists.
Read the existing command file and parse its frontmatter and body.
Display to the user:
Existing command: <command-name>
Location: <full-path>
Description: <current description from frontmatter>
Tools: <current allowed-tools>
---
<summary of current body/instructions>
Use AskUserQuestion: "What would you like to change in this command? (e.g., description, arguments, behavior, tools)"
Edit the existing file with the requested changes. Use the Edit tool to make targeted modifications, not a full rewrite.
Command updated: <command-name>
Location: <full-path>
Changes: <summary of what was modified>
Tip: Run /factory:audit <path> to validate.