smithery/aiskillstore

spawn-agent

Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.

Installation

$ npx skills add smithery/aiskillstore --skill spawn-agent

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/aiskillstore · top by installs.

npx skills add smithery/aiskillstore

Browse all from smithery/aiskillstore

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Declared
Codex Declared
GitHub Copilot Declared
Windsurf Not declared
Gemini CLI Declared
Cline Not declared
OpenCode Declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code cursor codex github-copilot gemini opencode

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 7,165 B
  • docs SUMMARY.md 153 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Purpose

Spawn an AI coding agent in a new terminal window. Follow the 'Instructions', execute the 'Workflow', based on the 'Cookbook'.

Variables

Variable Default Description
DEFAULT_AGENT claude-code Agent to use when not explicitly specified
ENABLEDCLAUDECLI true Enable Claude Code agent
ENABLEDCODEXCLI true Enable OpenAI Codex agent
ENABLEDGEMINICLI true Enable Google Gemini agent
ENABLEDCURSORCLI true Enable Cursor agent
ENABLEDOPENCODE_CLI true Enable OpenCode agent
ENABLEDCOPILOTCLI true Enable GitHub Copilot agent
LOGTOFILE false Write full terminal output to debug file
LOGAGENTOUTPUT true Write clean agent JSON response to file
READCAPTUREDOUTPUT false Read and display agent output after spawn
AGENTICCODINGTOOLS claude-code, codex-cli, gemini-cli, cursor-cli, opencode-cli, copilot-cli Available agentic tools

Instructions

MANDATORY - You MUST follow the Workflow steps below in order. Do not skip steps.

Agent Selection

  1. Explicit request: If user specifies an agent (e.g., "use gemini", "spawn codex"), use that agent
  2. No agent specified: Use DEFAULT_AGENT (claude-code)
  3. Check enabled: Verify the ENABLED*CLI flag is true before proceeding

Reading Cookbooks

  • Based on the selected agent, follow the 'Cookbook' section to read the appropriate .md file
  • You MUST read and execute the appropriate cookbook file before spawning the agent

Red Flags - STOP and follow Cookbook

If you're about to:

  • Spawn an agent without reading the cookbook first
  • Execute a CLI command without running --help
  • Skip steps because "this is simple"
  • Run a CLI agent with a prompt but without checking INTERACTIVE_MODE requirements

STOP -> Read the appropriate cookbook file -> Follow its instructions -> Then proceed

Common Mistake: When spawning agentic CLIs (Claude, Codex, Gemini) with a prompt,
most require command chaining (e.g., && claude --continue) to stay in interactive
mode after the prompt completes. Always check the cookbook for the correct pattern.

Spawn Summary User Prompt

  • IF: The user requests spawning an agent with a summary of the conversation
  • THEN:

- Read and REPLACE the <userpromptsummary> and <agentresponsesummary> fields in './prompts/fork-summary-user-prompt.md' with the history of the conversation between you and the user. - Include the next users request in the Next User Request field. - This will be what you pass into the PROMPT field of the agentic coding tool. - Spawn the agent with: forkterminal(command: str, capture=False, logtofile=False, logagent_output=True)

  • Examples:

- "Spawn agent use claude code to <xyz> with a summary" - "spin up a new terminal with <xyz> with claude code. Include a summary of the conversation." - "create a new agent with claude code to <xyz>. Summarize work so far." - "spawn agent use gemini to <xyz> with a summary"

Workflow

MANDATORY CHECKPOINTS - Verify each before proceeding:

  1. [ ] Understand the user's request
  2. [ ] SELECT AGENT: Determine which agent (explicit or DEFAULT_AGENT)
  3. [ ] READ: './fork_terminal.py' to understand the tooling
  4. [ ] Follow the Cookbook (read the appropriate .md file for selected agent)
  5. [ ] CHECKPOINT: Confirm cookbook instructions were followed (e.g., ran --help)
  6. [ ] Execute forkterminal(command: str, capture=False, logtofile=False, logagent_output=True)
  7. [ ] IF 'READCAPTUREDOUTPUT' is true: Read and display the agent output using readforkoutput()

Cookbook

Claude Code (Default)

  • IF: User requests Claude Code OR no agent explicitly specified
  • THEN: Read and execute './cookbook/claude-code.md'
  • Examples:

- "Spawn an agent to <xyz>" - "Fork terminal to <xyz>" (no agent specified = claude-code) - "Spawn agent use claude code to <xyz>" - "spin up a new terminal with claude code"

Codex CLI

  • IF: User requests Codex/OpenAI agent and 'ENABLEDCODEXCLI' is true
  • THEN: Read and execute './cookbook/codex-cli.md'
  • Examples:

- "Spawn agent use codex to <xyz>" - "create a new terminal with codex cli to <xyz>" - "spawn openai agent to <xyz>"

Gemini CLI

  • IF: User requests Gemini/Google agent and 'ENABLEDGEMINICLI' is true
  • THEN: Read and execute './cookbook/gemini-cli.md'
  • Examples:

- "Spawn agent use gemini to <xyz>" - "create a new terminal with gemini cli to <xyz>" - "spawn google agent to <xyz>"

Cursor CLI

  • IF: User requests Cursor agent and 'ENABLEDCURSORCLI' is true
  • THEN: Read and execute './cookbook/cursor-cli.md'
  • Examples:

- "Spawn agent use cursor cli to <xyz>" - "create a new terminal with cursor to <xyz>" - "spawn cursor agent to <xyz>"

OpenCode CLI

  • IF: User requests OpenCode agent and 'ENABLEDOPENCODE_CLI' is true
  • THEN: Read and execute './cookbook/opencode-cli.md'
  • Examples:

- "Spawn agent use opencode cli to <xyz>" - "create a new terminal with opencode to <xyz>" - "spawn opencode agent to <xyz>"

Copilot CLI

  • IF: User requests Copilot/GitHub agent and 'ENABLEDCOPILOTCLI' is true
  • THEN: Read and execute './cookbook/copilot-cli.md'
  • Examples:

- "Spawn agent use copilot cli to <xyz>" - "create a new terminal with copilot to <xyz>" - "spawn github copilot agent to <xyz>"

Output Retrieval

The fork_terminal() function supports three output controls:

Parameter Default Output File Description
logagentoutput True /tmp/fork-agent-*.json Clean agent JSON response
logtofile False /tmp/fork-debug-*.txt Full terminal output (debug)
capture False N/A Block and return content directly

Parameter Combinations

capture logagentoutput logtofile Behavior
False True (default) False Returns agent JSON file path
False False True Returns debug file path
False False False Returns empty string
True True * Blocks, returns agent JSON content
True False True Blocks, returns debug content

Retrieving Output Later

When logagentoutput=True (default), clean agent output is logged. Use readforkoutput(file_path) to retrieve it:

# Spawn without blocking (returns path to JSON output)
file_path = fork_terminal(cmd, log_agent_output=True)
print(f"Agent output will be at: {file_path}")

# Later, read the output when needed
output = read_fork_output(file_path, timeout=60)

Debug Mode

For debugging, enable logtofile=True to capture full terminal output (including stderr):

# Debug mode: capture everything
file_path = fork_terminal(cmd, log_to_file=True, log_agent_output=False)