Scaffold Garry's Mod Component
scaffold_gmod_componentGenerate realm-separated GLua boilerplate for 10 Garry's Mod component types. Write to disk or preview virtually to bootstrap addons with idiomatic structure.
Instructions
Generate production-grade, realm-separated Garry's Mod boilerplate code for 10 standard component architectures: SWEP (weapons), SENT (scripted entities), nextbot (NextBot AI with pathfinding coroutines), custom_tool (toolgun STOOLs with CPanel), vgui_panel (Derma UI), hud (Zero-GC HUDPaint overlays), gamemode (GM framework), effect (dynamic particle render effects), darkrp_module (DarkRP jobs, shipments, categories), and addon_skeleton (standard directory layout with addon.json). Dual operational mode: when output_dir is omitted (default), operates as a zero-side-effect preview returning a virtual code_manifest without touching the disk; when output_dir is provided, writes files directly to disk relative to workspace, creating directories and overwriting existing files at target paths. Implements idiomatic realm separation (e.g. server init.lua, client cl_init.lua with AddCSLuaFile headers, shared.lua). Requires component_type (enum: 'swep', 'sent', 'nextbot', 'custom_tool', 'vgui_panel', 'hud', 'gamemode', 'effect', 'darkrp_module', 'addon_skeleton') and alphanumeric identifier name (e.g. 'weapon_plasma_rifle', 'nb_stalker', 'tool_remover'). Optional output_dir designates target folder on disk. Optional options object configures category, base class, author, printable_name, and vgui_type ('frame', 'button', 'scroll', 'custom'). Use this tool when bootstrapping new Garry's Mod addons, weapons, entities, AI nextbots, STOOLs, or UI panels with idiomatic architecture and prediction support. Do NOT use for editing existing code or linting (use lint_glua). After scaffolding, use package_and_validate to verify Steam Workshop packaging compliance. Returns a GModToolResult envelope with status ('success' or 'failed'), summary, and data containing component_type, files_created array (path, purpose), and code_manifest mapping relative file paths to generated Lua source code strings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Unique technical identifier for the component (e.g. 'weapon_plasma_rifle', 'ent_crate', 'vgui_scoreboard', 'tool_remover'). Must be alphanumeric with underscores or dashes. | |
| options | No | Optional metadata configuring component inheritance, display names, and base classes. | |
| output_dir | No | Optional workspace destination directory. If omitted, files are NOT written to disk and only returned in code_manifest (preview mode). If provided, files are written to disk relative to workspace, creating folders as needed and overwriting existing files at those paths. | |
| component_type | Yes | The architectural Garry's Mod component type to scaffold ('swep', 'sent', 'nextbot', 'custom_tool', 'vgui_panel', 'hud', 'gamemode', 'effect', 'darkrp_module', or 'addon_skeleton'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool. | |
| status | Yes | Execution status of the tool call ('success', 'partial', 'blocked', or 'failed'). | |
| summary | Yes | Concise, human-readable summary of operational findings, diagnostics, or execution outcome. | |
| evidence | Yes | Traceability evidence including cited documentation and generated artifacts. | |
| warnings | Yes | List of non-fatal warnings, lint advisories, engine caveats, or security notices. | |
| nextActions | No | Actionable, ordered recommendations for the agent's immediate next steps. |