{"slug":"spawn","title":"spawn","summary":"Generate PhD-level expert-agent prompt files (.md) for Claude Code - authoring, not runtime. For spawning parallel RUNTIME workers use fleet-worker/fleetflow (via parallel-ops). Triggers: spawn agent, create agent file, generate expert prompt, new agent persona.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-30T19:36:56.442498Z","repo":{"url":"https://github.com/0xDarkMatter/claude-mods","stars":43,"forks":7,"license":"MIT","updatedAt":"2026-09-30T15:18:48Z"},"bodyHtml":"<hr>\n<h2>name: spawn\ndescription: \"Generate PhD-level expert-agent prompt files (.md) for Claude Code - authoring, not runtime. For spawning parallel RUNTIME workers use fleet-worker/fleetflow (via parallel-ops). Triggers: spawn agent, create agent file, generate expert prompt, new agent persona.\"\nlicense: MIT\ncompatibility: \"Requires internet access for WebSearch/WebFetch to research official docs.\"\nallowed-tools: \"Read Write Bash WebSearch WebFetch AskUserQuestion\"\nmetadata:\nauthor: claude-mods</h2>\n<h1>Spawn - Expert Agent Generator</h1>\n<p>Generate world-class, comprehensive expert agent prompts for Claude Code. Each agent should be a definitive reference for its domain - the kind of guide a PhD-level practitioner would create.</p>\n<p><strong>Target quality:</strong> 500-1000 lines per agent with real code examples, complete configs, and detailed patterns.</p>\n<p><strong>Benchmark agents:</strong> <code>firecrawl-expert.md</code> (1026 lines), <code>project-organizer.md</code> (610 lines)</p>\n<h2>Usage Modes</h2>\n<h3>Mode 1: Single Agent Generation</h3>\n<p>Generate one expert agent prompt for a specific technology platform.</p>\n<p><strong>Prompt for:</strong></p>\n<ul>\n<li>Technology platform/framework name</li>\n<li>Scope (project-level or global/user-level)</li>\n<li>Focus areas (optional: specific features, patterns, use cases)</li>\n<li>Output format (markdown file or clipboard-ready text)</li>\n</ul>\n<h3>Mode 2: Batch Agent Generation</h3>\n<p>Create multiple agent prompts from a list of technology platforms.</p>\n<p><strong>Accept:</strong></p>\n<ul>\n<li>Multi-line list of technology platforms</li>\n<li>Scope (project-level or global/user-level)</li>\n<li>Common focus areas (optional)</li>\n<li>Output format (individual .md files or consolidated text)</li>\n</ul>\n<h3>Mode 3: Architecture Analysis</h3>\n<p>Analyze a tech stack or architecture description and suggest relevant agents.</p>\n<p><strong>Process:</strong></p>\n<ol>\n<li>Read architecture description (from user input or file)</li>\n<li>Identify all technology platforms/services</li>\n<li>Ask for scope (project or global)</li>\n<li>Present checkbox selector for agent creation</li>\n<li>Generate selected agents</li>\n</ol>\n<h2>Agent File Format</h2>\n<p>All agents MUST be created as Markdown files with <strong>YAML frontmatter</strong>:</p>\n<ul>\n<li><strong>Project-level</strong>: <code>.claude/agents/</code> (current project only)</li>\n<li><strong>Global/User-level</strong>: <code>~/.claude/agents/</code> or <code>C:\\Users\\[username]\\.claude\\agents\\</code> (all projects)</li>\n</ul>\n<p><strong>File Structure:</strong></p>\n<pre><code>---\nname: technology-name-expert\ndescription: When this agent should be used. Can include examples and use cases. No strict length limit - be clear and specific. Include \"use PROACTIVELY\" for automatic invocation.\nmodel: inherit\ncolor: blue\n---\n\n[Agent system prompt content here]\n</code></pre>\n<p><strong>YAML Frontmatter Fields:</strong></p>\n<ul>\n<li><code>name</code> (required): Unique identifier, lowercase-with-hyphens (e.g., \"redis-expert\")</li>\n<li><code>description</code> (required): Clear, specific description of when to use this agent\n<ul>\n<li>No strict length limit - prioritize clarity over brevity</li>\n<li>Can include examples, use cases, and context</li>\n<li>Use \"use PROACTIVELY\" or \"MUST BE USED\" to encourage automatic invocation</li>\n<li>Multi-line YAML string format is fine for lengthy descriptions</li>\n</ul>\n</li>\n<li><code>tools</code> (optional): Comma-separated list of allowed tools (e.g., \"Read, Grep, Glob, Bash\")\n<ul>\n<li>If omitted, agent inherits all tools from main session</li>\n<li><strong>Best practice</strong>: Only grant tools necessary for the agent's purpose (improves security and focus)</li>\n</ul>\n</li>\n<li><code>model</code> (optional): Specify model (\"sonnet\", \"opus\", \"haiku\", or \"inherit\" to use main session model)</li>\n<li><code>color</code> (optional): Visual identifier in UI (\"blue\", \"green\", \"purple\", etc.)</li>\n</ul>\n<p><strong>File Creation:</strong>\nAgents can be created programmatically using the Write tool:</p>\n<pre><code>Project-level: .claude/agents/[platform]-expert.md\nGlobal/User-level: ~/.claude/agents/[platform]-expert.md (or C:\\Users\\[username]\\.claude\\agents\\ on Windows)\n</code></pre>\n<p><strong>Choosing Scope:</strong></p>\n<ul>\n<li><strong>Project Agent</strong> (<code>.claude/agents/</code>): Specific to the current project, can be version controlled and shared with team</li>\n<li><strong>Global Agent</strong> (<code>~/.claude/agents/</code>): Available across all projects on your machine</li>\n</ul>\n<p>After creation, the agent is immediately available for use with the Task tool.</p>\n<h2>Claude Code Agent Documentation</h2>\n<p><strong>Essential Reading:</strong></p>\n<ul>\n<li><strong>Subagents Overview</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/sub-agents\">https://docs.claude.com/en/docs/claude-code/sub-agents</a></li>\n<li><strong>Subagents in SDK</strong>: <a href=\"https://docs.claude.com/en/api/agent-sdk/subagents\">https://docs.claude.com/en/api/agent-sdk/subagents</a></li>\n<li><strong>Agent SDK Overview</strong>: <a href=\"https://docs.claude.com/en/api/agent-sdk/overview\">https://docs.claude.com/en/api/agent-sdk/overview</a></li>\n<li><strong>Agent Skills Guide</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/skills\">https://docs.claude.com/en/docs/claude-code/skills</a></li>\n<li><strong>Agent Skills in SDK</strong>: <a href=\"https://docs.claude.com/en/api/agent-sdk/skills\">https://docs.claude.com/en/api/agent-sdk/skills</a></li>\n<li><strong>Skill Authoring Best Practices</strong>: <a href=\"https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices\">https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices</a></li>\n<li><strong>Using Agent Skills with API</strong>: <a href=\"https://docs.claude.com/en/api/skills-guide\">https://docs.claude.com/en/api/skills-guide</a></li>\n<li><strong>Agent Skills Quickstart</strong>: <a href=\"https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart\">https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart</a></li>\n<li><strong>Claude Code Settings</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/settings\">https://docs.claude.com/en/docs/claude-code/settings</a></li>\n<li><strong>Common Workflows</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/common-workflows\">https://docs.claude.com/en/docs/claude-code/common-workflows</a></li>\n<li><strong>Claude Code Overview</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/overview\">https://docs.claude.com/en/docs/claude-code/overview</a></li>\n<li><strong>Plugins Reference</strong>: <a href=\"https://docs.claude.com/en/docs/claude-code/plugins-reference\">https://docs.claude.com/en/docs/claude-code/plugins-reference</a></li>\n</ul>\n<p><strong>Key Concepts from Documentation:</strong></p>\n<ul>\n<li>Subagents operate in separate context windows with customized system prompts</li>\n<li>Each subagent can have restricted tool access for focused capabilities</li>\n<li>Multiple subagents can run concurrently for parallel processing</li>\n<li>User-level agents (<code>~/.claude/agents/</code>) are available across all projects</li>\n<li>Project-level agents (<code>.claude/agents/</code>) are project-specific and shareable</li>\n<li>Use <code>/agents</code> command for the recommended UI to manage agents</li>\n<li>Start with Claude-generated agents, then customize for best results</li>\n<li>Version control project-level subagents for team collaboration</li>\n</ul>\n<h2>Generation Requirements</h2>\n<p>For each agent, create a comprehensive expert prompt with:</p>\n<p><strong>Agent Content Structure (10-Part Template):</strong></p>\n<p>Every generated agent MUST follow this comprehensive 10-part structure:</p>\n<ol>\n<li><strong>Part 1: Core Concepts</strong> - Fundamental principles, mental model, architecture overview</li>\n<li><strong>Part 2: Essential Patterns</strong> (5-10 patterns) - Each with: when to use, full implementation (20-50 lines), variations, common mistakes</li>\n<li><strong>Part 3: Advanced Techniques</strong> (3-5 techniques) - Deep dives with complete examples</li>\n<li><strong>Part 4: Configuration</strong> - Complete dev config, complete prod config, environment variables table</li>\n<li><strong>Part 5: Integration Patterns</strong> - Integration code for 2-3 common technologies</li>\n<li><strong>Part 6: Testing Strategies</strong> - Unit tests with mocks, integration tests, test configuration</li>\n<li><strong>Part 7: Error Handling</strong> - Custom exception hierarchy, retry/circuit breaker patterns, structured logging</li>\n<li><strong>Part 8: Performance Optimization</strong> - Profiling techniques, optimization table, caching strategies</li>\n<li><strong>Part 9: Security Considerations</strong> - Common vulnerabilities, security hardening checklist</li>\n<li><strong>Part 10: Quick Reference</strong> - Common operations cheat sheet (20-30 snippets), CLI commands, troubleshooting table</li>\n</ol>\n<p>Plus: Quality Checklist, Anti-Patterns (5-10 with bad/good code), Canonical Resources (10-15 URLs)</p>\n<p>See <code>firecrawl-expert.md</code> and <code>project-organizer.md</code> in agents/ for reference implementations.</p>\n<p><strong>Requirements:</strong></p>\n<ul>\n<li>YAML frontmatter at top with required fields (name, description)</li>\n<li>Concise, actionable system prompt (not verbose)</li>\n<li>Minimum 10 official/authoritative URLs</li>\n<li>Include real, production-ready code examples (10+ code blocks)</li>\n<li>Include complete configuration files (dev + prod)</li>\n<li>Include testing patterns with actual test code</li>\n<li>Focus on patterns, best practices, architecture</li>\n<li>Include canonical references for expansion</li>\n<li>Markdown formatted for direct use</li>\n<li>Description field can be lengthy with examples if needed for clarity</li>\n</ul>\n<h2>Output Options</h2>\n<p><strong>Ask user to choose scope:</strong></p>\n<ol>\n<li><strong>Project Agent</strong> - Save to <code>.claude/agents/</code> (project-specific, version controlled)</li>\n<li><strong>Global Agent</strong> - Save to <code>~/.claude/agents/</code> or <code>C:\\Users\\[username]\\.claude\\agents\\</code> (all projects)</li>\n</ol>\n<p><strong>Ask user to choose format:</strong></p>\n<ol>\n<li><strong>Clipboard-ready</strong> - Output complete markdown (with YAML frontmatter) in code block</li>\n<li><strong>File creation</strong> - Use Write tool to save to appropriate agents directory based on scope</li>\n<li><strong>Both</strong> - Create file using Write tool AND show complete content in chat for review</li>\n</ol>\n<p><strong>File Creation Process:</strong>\nWhen creating files programmatically:</p>\n<ol>\n<li>Generate complete agent content with YAML frontmatter</li>\n<li>Determine path based on scope selection:\n<ul>\n<li>Project: <code>.claude/agents/[platform-name]-expert.md</code></li>\n<li>Global: <code>~/.claude/agents/[platform-name]-expert.md</code> (or Windows equivalent)</li>\n</ul>\n</li>\n<li>Use Write tool with appropriate path</li>\n<li>Verify file was created successfully</li>\n<li>Agent is immediately available for use</li>\n</ol>\n<h2>Examples</h2>\n<h3>Example 1: Single Agent</h3>\n<pre><code>User: /spawn\nAgent: [Shows multi-tab AskUserQuestion with 5 tabs]\n  Tab 1 (Mode): Single Agent / Batch Generation / Architecture Analysis\n  Tab 2 (Scope): Project Agent / Global Agent\n  Tab 3 (Output): Create File / Show in Chat / Both\n  Tab 4 (Platform): Custom Platform / [or popular options]\n  Tab 5 (Focus): [Multi-select] General Coverage / Caching Patterns / Pub/Sub / etc.\nUser: [Selects all answers and submits once]\n  Mode: Single Agent\n  Scope: Global Agent\n  Output: Both\n  Platform: Redis (via Other field)\n  Focus: General Coverage, Caching Patterns, Pub/Sub\nAgent: [Generates Redis expert prompt and saves to ~/.claude/agents/redis-expert.md]\n</code></pre>\n<h3>Example 2: Batch Generation</h3>\n<pre><code>User: /spawn\nAgent: [Shows multi-tab AskUserQuestion with 3 tabs]\n  Tab 1 (Mode): Single Agent / Batch Generation / Architecture Analysis\n  Tab 2 (Scope): Project Agent / Global Agent\n  Tab 3 (Output): Create Files / Show in Chat / Both\nUser: [Submits]\n  Mode: Batch Generation\n  Scope: Project Agent\n  Output: Create Files\nAgent: Please provide platforms (one per line):\nUser: PostgreSQL\nRedis\nRabbitMQ\n\nAgent: [Creates 3 .md files in .claude/agents/ (project directory)]\n</code></pre>\n<h3>Example 3: Architecture Analysis</h3>\n<pre><code>User: /spawn\nAgent: [Shows multi-tab AskUserQuestion with 3 tabs]\n  Tab 1 (Mode): Single Agent / Batch Generation / Architecture Analysis\n  Tab 2 (Scope): Project Agent / Global Agent\n  Tab 3 (Output): Create Files / Show in Chat / Both\nUser: [Submits]\n  Mode: Architecture Analysis\n  Scope: Global Agent\n  Output: Both\nAgent: Describe your architecture or provide file path:\nUser: E-commerce platform: Next.js frontend, Node.js API, PostgreSQL, Redis cache, Stripe payments, AWS S3 storage, SendGrid emails\nAgent: Found platforms: Next.js, Node.js, PostgreSQL, Redis, Stripe, AWS S3, SendGrid\n[Shows multi-select AskUserQuestion]\nUser: [Selects: nextjs-expert, redis-expert, stripe-expert, sendgrid-expert]\nAgent: [Generates 4 selected agents in ~/.claude/agents/]\n</code></pre>\n<h2>Implementation Steps</h2>\n<ol>\n<li><p><strong>Ask All Questions at Once</strong> using a single multi-question AskUserQuestion call:</p>\n<ul>\n<li><strong>Question 1</strong> (header: \"Mode\"): Single Agent / Batch Generation / Architecture Analysis</li>\n<li><strong>Question 2</strong> (header: \"Scope\"): Project Agent (this project only) / Global Agent (all projects)</li>\n<li><strong>Question 3</strong> (header: \"Output\"): Create File / Show in Chat / Both</li>\n</ul>\n<p>For Single Mode, also ask in the same call:</p>\n<ul>\n<li><strong>Question 4</strong> (header: \"Platform\"): Offer \"Custom Platform\" option (user types in Other field)</li>\n<li><strong>Question 5</strong> (header: \"Focus\", multiSelect: true): General Coverage / [2-3 common focus areas for that tech]</li>\n</ul>\n</li>\n<li><p><strong>For Single Mode:</strong></p>\n<ul>\n<li>If user selected \"Custom Platform\", prompt for the platform name in chat</li>\n<li>Generate comprehensive prompt based on answers</li>\n<li>Create file and/or display based on output preference</li>\n</ul>\n</li>\n<li><p><strong>For Batch Mode:</strong></p>\n<ul>\n<li>Ask user to provide multi-line platform list in chat</li>\n<li>For each platform:\n<ul>\n<li>Generate expert prompt</li>\n<li>Save to <code>.claude/agents/[platform]-expert.md</code></li>\n</ul>\n</li>\n<li>Report completion with file paths</li>\n</ul>\n</li>\n<li><p><strong>For Architecture Analysis:</strong></p>\n<ul>\n<li>Ask user for architecture description in chat</li>\n<li>Parse and identify technologies</li>\n<li>Present checkbox selector using AskUserQuestion (multiSelect: true)</li>\n<li>Generate selected agents</li>\n<li>Save to files based on output preference</li>\n</ul>\n</li>\n<li><p><strong>Generate Each Agent Prompt:</strong></p>\n<ul>\n<li>Research official docs (WebSearch or WebFetch)</li>\n<li>Find 10+ authoritative URLs</li>\n<li>Structure according to template above</li>\n<li>Focus on patterns and best practices</li>\n<li>Target 500-1000 lines with comprehensive patterns</li>\n<li>Markdown formatted</li>\n</ul>\n</li>\n<li><p><strong>Output:</strong></p>\n<ul>\n<li>Determine file path based on Scope selection:\n<ul>\n<li><strong>Project Agent</strong>: <code>.claude/agents/[platform]-expert.md</code></li>\n<li><strong>Global Agent</strong>: <code>~/.claude/agents/[platform]-expert.md</code> (Unix/Mac) or <code>C:\\Users\\[username]\\.claude\\agents\\[platform]-expert.md</code> (Windows)</li>\n</ul>\n</li>\n<li>If \"Create File\" or \"Both\": Use Write tool with appropriate path and complete YAML frontmatter + system prompt</li>\n<li>If \"Show in Chat\" or \"Both\": Display complete markdown (including frontmatter) in code block</li>\n<li>Confirm creation with full file path</li>\n<li>Remind user agent is immediately available via Task tool</li>\n</ul>\n</li>\n</ol>\n<p><strong>Important</strong>: Always use a single AskUserQuestion call with multiple questions (2-4) to create the multi-tab interface. Never ask questions sequentially one at a time.</p>\n<h2>Quality Checklist</h2>\n<p>Before outputting each agent prompt, verify:</p>\n<ul>\n<li>YAML frontmatter present with required fields (name, description)</li>\n<li>Name uses lowercase-with-hyphens format</li>\n<li>Description is clear and specific (length is flexible)</li>\n<li>Tools field specified if restricting access (best practice: limit to necessary tools)</li>\n<li>10+ authoritative URLs included in system prompt</li>\n<li>10+ production-ready code examples included</li>\n<li>Complete dev and prod configuration files</li>\n<li>Testing patterns with actual test code</li>\n<li>Error handling patterns and exception hierarchy</li>\n<li>5+ anti-patterns with bad/good code comparison</li>\n<li>Concise and scannable system prompt</li>\n<li>Clear use cases defined</li>\n<li>Integration points identified</li>\n<li>Common patterns referenced</li>\n<li>Anti-patterns listed</li>\n<li>Proper markdown formatting throughout</li>\n<li>Filename matches name field: <code>[name].md</code></li>\n<li>Follows Claude Code subagent best practices (see documentation links above)</li>\n</ul>\n<h2>Post-Generation</h2>\n<p>After creating agents, remind user:</p>\n<ol>\n<li>Review generated prompts</li>\n<li>Test agent with sample questions</li>\n<li>Refine based on actual usage</li>\n<li>Add to version control if satisfied</li>\n<li>Consult Claude Code documentation links above for advanced features and best practices</li>\n</ol>\n<p><strong>Additional Resources:</strong></p>\n<ul>\n<li>Use <code>/agents</code> command to view and manage all available agents</li>\n<li>Refer to <a href=\"https://docs.claude.com/en/docs/claude-code/sub-agents\">https://docs.claude.com/en/docs/claude-code/sub-agents</a> for detailed subagent documentation</li>\n<li>Check <a href=\"https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices\">https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices</a> for authoring guidelines</li>\n</ul>\n","files":[{"path":"assets/.gitkeep","sizeBytes":0,"isText":false},{"path":"references/.gitkeep","sizeBytes":0,"isText":false},{"path":"scripts/.gitkeep","sizeBytes":0,"isText":false},{"path":"SKILL.md","sizeBytes":14527,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-30T19:39:01.869633Z","sha256":"8A79156D8C80395E009F625FF3F53A81566044FDC21D30C0A8EBA7BE6CCB547A","sizeBytes":5510},"review":null,"source":{"repositoryUrl":"https://github.com/0xDarkMatter/claude-mods","path":"skills/spawn","license":"MIT","commit":"3dfaf0ba5753026a99ee13f9d9ed56b9793bb6e8","subtreeSha":"63D13D7BD7A866AC027ACDD813CCA358FB4436E406E774B6679156D9DD30F4BC","lastSyncedAt":"2026-09-30T19:37:28.226022Z"},"reviewedAt":"2026-09-30T19:42:57.939651Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/0xDarkMatter/claude-mods/tree/main/skills/spawn"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install 0xdarkmatter-claude-mods@llmmart"},{"target":"git","command":"git clone https://github.com/0xDarkMatter/claude-mods.git"}]}