jpskill.com
🛠️ 開発・MCP コミュニティ

spawn-agent

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

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o spawn-agent.zip https://jpskill.com/download/18046.zip && unzip -o spawn-agent.zip && rm spawn-agent.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18046.zip -OutFile "$d\spawn-agent.zip"; Expand-Archive "$d\spawn-agent.zip" -DestinationPath $d -Force; ri "$d\spawn-agent.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して spawn-agent.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → spawn-agent フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

目的

新しいターミナルウィンドウでAIコーディングエージェントを起動します。「手順」に従い、「クックブック」に基づいて「ワークフロー」を実行します。

変数

変数 デフォルト 説明
DEFAULT_AGENT claude-code 明示的に指定されていない場合に使用するエージェント
ENABLED_CLAUDE_CLI true Claude Code エージェントを有効にする
ENABLED_CODEX_CLI true OpenAI Codex エージェントを有効にする
ENABLED_GEMINI_CLI true Google Gemini エージェントを有効にする
ENABLED_CURSOR_CLI true Cursor エージェントを有効にする
ENABLED_OPEN_CODE_CLI true OpenCode エージェントを有効にする
ENABLED_COPILOT_CLI true GitHub Copilot エージェントを有効にする
LOG_TO_FILE false デバッグファイルにターミナルの出力をすべて書き込む
LOG_AGENT_OUTPUT true 整形されたエージェントの JSON レスポンスをファイルに書き込む
READ_CAPTURED_OUTPUT false 起動後にエージェントの出力を読み込んで表示する
AGENTIC_CODING_TOOLS claude-code, codex-cli, gemini-cli, cursor-cli, opencode-cli, copilot-cli 利用可能なエージェントツール

手順

必須 - 以下のワークフローの手順を順番に実行する必要があります。手順を省略しないでください。

エージェントの選択

  1. 明示的なリクエスト: ユーザーがエージェントを指定した場合(例: "use gemini"、"spawn codex")、そのエージェントを使用します。
  2. エージェントが指定されていない: DEFAULT_AGENT (claude-code) を使用します。
  3. 有効化の確認: 続行する前に、ENABLED_*_CLI フラグが true であることを確認します。

クックブックの読み込み

  • 選択されたエージェントに基づいて、「クックブック」セクションに従って、適切な .md ファイルを読み込みます。
  • エージェントを起動する前に、適切なクックブックファイルを読み込み、実行する必要があります。

危険信号 - 中止してクックブックに従ってください

以下のような状況になろうとしている場合:

  • クックブックを最初に読まずにエージェントを起動しようとしている
  • --help を実行せずに CLI コマンドを実行しようとしている
  • 「これは簡単だ」という理由で手順を省略しようとしている
  • プロンプト付きで CLI エージェントを実行しようとしているが、INTERACTIVE_MODE の要件を確認していない

中止 -> 適切なクックブックファイルを読み込む -> その指示に従う -> その後、続行する

よくある間違い: プロンプト付きでエージェント CLI (Claude, Codex, Gemini) を起動する場合、 プロンプトが完了した後もインタラクティブモードを維持するには、ほとんどの場合、コマンドチェイン(例: && claude --continue)が必要です。 常にクックブックで正しいパターンを確認してください。

起動概要ユーザープロンプト

  • IF: ユーザーが会話の概要とともにエージェントの起動を要求した場合
  • THEN:
    • './prompts/fork-summary-user-prompt.md' の <user_prompt_summary> および <agent_response_summary> フィールドを、あなたとユーザーの間の会話の履歴で読み込んで置換します。
    • 次のユーザーのリクエストを Next User Request フィールドに含めます。
    • これは、エージェントツールの PROMPT フィールドに渡すものです。
    • 次のようにしてエージェントを起動します: fork_terminal(command: str, capture=False, log_to_file=False, log_agent_output=True)
  • 例:
    • "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"

ワークフロー

必須チェックポイント - 続行する前にそれぞれを確認してください:

  1. [ ] ユーザーのリクエストを理解する
  2. [ ] エージェントの選択: どのエージェント(明示的または DEFAULT_AGENT)を選択するかを決定する
  3. [ ] 読み込み: ツールを理解するために './fork_terminal.py' を読み込む
  4. [ ] クックブックに従う(選択したエージェントの適切な .md ファイルを読み込む)
  5. [ ] チェックポイント: クックブックの指示に従ったことを確認する(例: --help を実行した)
  6. [ ] fork_terminal(command: str, capture=False, log_to_file=False, log_agent_output=True) を実行する
  7. [ ] 'READ_CAPTURED_OUTPUT' が true の場合: read_fork_output() を使用してエージェントの出力を読み込んで表示する

クックブック

Claude Code (デフォルト)

  • IF: ユーザーが Claude Code を要求した場合、またはエージェントが明示的に指定されていない場合
  • THEN: './cookbook/claude-code.md' を読み込んで実行する
  • 例:
    • "Spawn an agent to <xyz>"
    • "Fork terminal to <xyz>" (エージェントが指定されていない = claude-code)
    • "Spawn agent use claude code to <xyz>"
    • "spin up a new terminal with claude code"

Codex CLI

  • IF: ユーザーが Codex/OpenAI エージェントを要求し、'ENABLED_CODEX_CLI' が true の場合
  • THEN: './cookbook/codex-cli.md' を読み込んで実行する
  • 例:
    • "Spawn agent use codex to <xyz>"
    • "create a new terminal with codex cli to <xyz>"
    • "spawn openai agent to <xyz>"

Gemini CLI

  • IF: ユーザーが Gemini/Google エージェントを要求し、'ENABLED_GEMINI_CLI' が true の場合
  • THEN: './cookbook/gemini-cli.md' を読み込んで実行する
  • 例:
    • "Spawn agent use gemini to <xyz>"
    • "create a new terminal with gemini cli to <xyz>"
    • "spawn google agent to <xyz>"

Cursor CLI

  • IF: ユーザーが Cursor エージェントを要求し、'ENABLED_CURSOR_CLI' が true の場合
  • THEN: './cookbook/cursor-cli.md' を読み込んで実行する
  • 例:
    • "Spawn agent use cursor cli to <xyz>"
    • "create a new terminal with cursor to <xyz>"
    • "spawn cursor agent to <xyz>"

OpenCode CLI

  • IF: ユーザーが OpenCode エージェントを要求し、'ENABLED_OPEN_CODE_CLI' が true の場合
  • THEN: './cookbook/opencode-cli.md' を読み込んで実行する
  • 例:
    • "Spawn agent use opencode cli to <xyz>"
    • "create a new terminal with opencode to <xyz>"
    • "spawn opencode agent to <xyz>"

Copilot CLI

  • IF: ユーザーが Copilot/GitHub エージェントを要求し、'ENABLED_COPILOT_CLI' が true の場合
  • THEN: './cookbook/copilot-cli.md' を読み込んで実行する
  • 例:
    • "Spawn agent use copilot cli to <xyz>"
    • "create a new terminal with copilot to <xyz>"
    • "spawn github copilot agent to <xyz>"

出力の取得

fork_terminal() 関数は、3つの出力制御をサポートしています。

パラメータ デフォルト 出力ファイル 説明
log_agent_output True /tmp/fork-agent-*.json 整形されたエージェントの JSON レスポンス
log_to_file False /tmp/fork-debug-*.txt ターミナルの出力すべて (デバッグ用)
capture False N/A ブロックしてコンテンツを直接返す

パラメータの組み合わせ

| capture | log_agent_output | log_to_file | 動作 | |-----------|------

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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
ENABLED_CLAUDE_CLI true Enable Claude Code agent
ENABLED_CODEX_CLI true Enable OpenAI Codex agent
ENABLED_GEMINI_CLI true Enable Google Gemini agent
ENABLED_CURSOR_CLI true Enable Cursor agent
ENABLED_OPEN_CODE_CLI true Enable OpenCode agent
ENABLED_COPILOT_CLI true Enable GitHub Copilot agent
LOG_TO_FILE false Write full terminal output to debug file
LOG_AGENT_OUTPUT true Write clean agent JSON response to file
READ_CAPTURED_OUTPUT false Read and display agent output after spawn
AGENTIC_CODING_TOOLS 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 <user_prompt_summary> and <agent_response_summary> 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: fork_terminal(command: str, capture=False, log_to_file=False, log_agent_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 fork_terminal(command: str, capture=False, log_to_file=False, log_agent_output=True)
  7. [ ] IF 'READ_CAPTURED_OUTPUT' is true: Read and display the agent output using read_fork_output()

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 'ENABLED_CODEX_CLI' 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 'ENABLED_GEMINI_CLI' 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 'ENABLED_CURSOR_CLI' 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 'ENABLED_OPEN_CODE_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 'ENABLED_COPILOT_CLI' 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
log_agent_output True /tmp/fork-agent-*.json Clean agent JSON response
log_to_file False /tmp/fork-debug-*.txt Full terminal output (debug)
capture False N/A Block and return content directly

Parameter Combinations

capture log_agent_output log_to_file 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 log_agent_output=True (default), clean agent output is logged. Use read_fork_output(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 log_to_file=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)