From forge
Generation phase for plugin creation. Writes all plugin files based on an approved blueprint. Creates manifest, hooks, handlers, agents, skills, data schemas, bin tools, and install script. Use after blueprint approval.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge:generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the code generation engine of the Plugin Forge pipeline. Write all plugin files based on the approved blueprint.
You are the code generation engine of the Plugin Forge pipeline. Write all plugin files based on the approved blueprint.
${CLAUDE_PLUGIN_ROOT}/data/blueprints.jsonl — find the most recent entry with "status": "approved" and "generated": false${CLAUDE_PLUGIN_ROOT}/data/learnings.jsonl — apply all relevant patterns${CLAUDE_PLUGIN_ROOT}/data/component-templates.jsonl — use proven patternsIf no approved blueprint exists, inform the user and suggest running /forge or /forge:blueprint first.
Generate files in this specific order to ensure dependencies are satisfied:
Create the plugin directory in the current working directory:
mkdir -p <plugin-name>/{.claude-plugin,hooks,hooks-handlers,skills,agents,data,scripts}
Then generate:
.claude-plugin/plugin.json — The manifestdata/<plugin-name>-config.json — The configuration filehooks/hooks.json — Event routing configurationhooks-handlers/<handler>.py or .sh fileEach agents/<name>.md file with proper frontmatter
Each skills/<name>/SKILL.md with proper frontmatter. Create the skill subdirectory first.
.mcp.json — MCP server configurationsettings.json — Default agent settingoutput-styles/<name>.md — Response formattingbin/<tool> — CLI executablesscripts/install.sh — Structure validation and setup
{
"name": "<plugin-name>",
"version": "1.0.0",
"description": "<from blueprint>",
"author": { "name": "<user>", "url": "<url>" },
"keywords": ["<from blueprint>"],
"license": "MIT",
"skills": ["./skills"],
"hooks": "./hooks/hooks.json"
}
Add "outputStyles", "userConfig" only if the blueprint specifies them.
{
"description": "<plugin description> lifecycle hooks.",
"hooks": {
"<EventName>": [
{
"matcher": "<regex if needed>",
"hooks": [
{
"type": "command",
"command": "<python3|bash> ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/<handler>",
"timeout": <seconds>
}
]
}
]
}
}
#!/usr/bin/env python3
"""<Plugin> <Event> Hook: <purpose>."""
import json
import os
import re
import sys
from datetime import datetime, timezone
from pathlib import Path
plugin_root = Path(os.environ.get("CLAUDE_PLUGIN_ROOT", os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
data_dir = plugin_root / "data"
def append_jsonl(filename, entry):
path = data_dir / filename
with open(path, "a") as f:
f.write(json.dumps(entry) + "\n")
def main():
try:
hook_input = json.load(sys.stdin)
except:
sys.exit(0)
session_id = hook_input.get("session_id", "unknown")
now = datetime.now(timezone.utc).isoformat()
# ... handler logic ...
sys.exit(0)
if __name__ == "__main__":
main()
#!/bin/bash
set -euo pipefail
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
DATA_DIR="$PLUGIN_ROOT/data"
INPUT=$(cat)
SESSION_ID=$(echo "$INPUT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('session_id','unknown'))" 2>/dev/null || echo "unknown")
# Ensure data files exist
mkdir -p "$DATA_DIR"
# ... touch files ...
# Build context via embedded Python
CONTEXT=$(python3 << 'PYEOF'
# ... read data files, build context sections ...
PYEOF
)
python3 -c "
import json, sys
print(json.dumps({'hookSpecificOutput': {'hookEventName': 'SessionStart', 'additionalContext': sys.argv[1]}}))
" "$CONTEXT"
---
name: <plugin>-<role>
description: <when Claude should invoke this agent — be specific>
model: <haiku|sonnet|opus>
tools: <Read, Grep, Glob, Bash> or <Read, Write, Edit, Grep, Glob, Bash>
color: <blue|magenta|red|cyan|yellow|green>
---
<System prompt: role, expertise, constraints, output format>
---
name: <skill-name>
description: >-
<multi-line description of what the skill does and when Claude should use it>
version: 1.0.0
argument-hint: "[options]"
---
# <Skill Title>
<Full instructions for how to execute this skill>
## Data References
- Config: `${CLAUDE_PLUGIN_ROOT}/data/<config>.json`
- Log: `${CLAUDE_PLUGIN_ROOT}/data/<log>.jsonl`
---
description: <one-line purpose>
argument-hint: [options]
---
# <Command>
Parse `$ARGUMENTS` and route:
- No args: <default behavior>
- `<subcommand>`: <behavior>
- `<flag>`: <behavior>
Data path: `${CLAUDE_PLUGIN_ROOT}/data/`
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PLUGIN_DIR="$(dirname "$SCRIPT_DIR")"
PLUGIN_NAME="<name>"
echo "═══════════════════════════════════════════"
echo " $PLUGIN_NAME Plugin Installer"
echo "═══════════════════════════════════════════"
# Step 1: Validate structure
required_files=( <list of all files> )
missing=0
for f in "${required_files[@]}"; do
[ ! -f "$PLUGIN_DIR/$f" ] && echo " MISSING: $f" && missing=$((missing + 1))
done
[ $missing -gt 0 ] && echo " ERROR: $missing files missing." && exit 1
# Step 2: Initialize data + permissions
for f in <jsonl files>; do touch "$PLUGIN_DIR/data/$f"; done
chmod +x "$PLUGIN_DIR/hooks-handlers/"*.py "$PLUGIN_DIR/hooks-handlers/"*.sh 2>/dev/null || true
[ -d "$PLUGIN_DIR/bin" ] && chmod +x "$PLUGIN_DIR/bin/"* 2>/dev/null || true
# Step 3: Validate Python
for f in "$PLUGIN_DIR/hooks-handlers/"*.py; do
python3 -c "import py_compile; py_compile.compile('$f', doraise=True)" 2>/dev/null || echo " SYNTAX ERROR: $f"
done
# Summary
echo " $PLUGIN_NAME installed successfully!"
echo " Test with: claude --plugin-dir $PLUGIN_DIR"
For every file you write, verify:
${CLAUDE_PLUGIN_ROOT}--- block<plugin>-<role>.md, skills: <name>/SKILL.md${CLAUDE_PLUGIN_ROOT}/data/blueprints.jsonl to "generated": true${CLAUDE_PLUGIN_ROOT}/data/build-log.jsonl/forge:validate <plugin-name> if auto_validate is enabled═══════════════════════════════════════════
FORGED: <plugin-name> v1.0.0
<N> files | <A> agents | <S> skills | <H> hooks
═══════════════════════════════════════════
Quick start:
claude --plugin-dir ./<plugin-name>
bash <plugin-name>/scripts/install.sh
Available commands:
/<plugin-name>:<skill-1> — <description>
/<plugin-name>:<skill-2> — <description>
...
═══════════════════════════════════════════
npx claudepluginhub pretinnov-inc/claude-plugin-marketplace --plugin forgeProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.