本文へ移動
cccskills
無料GitHub で公開

client-compatibility

Platform detection and adaptive spawning for CLI vs VS Code vs other surfaces

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Context

Squad runs on multiple Copilot surfaces (CLI, VS Code, JetBrains, GitHub.com). The coordinator must detect its platform and adapt spawning behavior accordingly. Different tools are available on different platforms, requiring conditional logic for agent spawning, SQL usage, and response timing.

Patterns

Platform Detection

Before spawning agents, determine the platform by checking available tools:

  1. CLI mode — task tool is available → full spawning control. Use task with agent_type, mode, model, description, prompt parameters. Collect results via read_agent.

  2. VS Code mode — runSubagent or agent tool is available → conditional behavior. Use runSubagent with the task prompt. Drop agent_type, mode, and model parameters. Multiple subagents in one turn run concurrently (equivalent to background mode). Results return automatically — no read_agent needed.

  3. Fallback mode — neither task nor runSubagent/agent available → work inline. Do not apologize or explain the limitation. Execute the task directly.

If both task and runSubagent are available, prefer task (richer parameter surface).

VS Code Spawn Adaptations

When in VS Code mode, the coordinator changes behavior in these ways:

  • Spawning tool: Use runSubagent instead of task. The prompt is the only required parameter — pass the full agent prompt (charter, identity, task, hygiene, response order) exactly as you would on CLI.
  • Parallelism: Spawn ALL concurrent agents in a SINGLE turn. They run in parallel automatically. This replaces mode: "background" + read_agent polling.
  • Model selection: Accept the session model. Do NOT attempt per-spawn model selection or fallback chains — they only work on CLI. In Phase 1, all subagents use whatever model the user selected in VS Code's model picker.
  • Scribe: Cannot fire-and-forget. Batch Scribe as the LAST subagent in any parallel group. Scribe is light work (file ops only), so the blocking is tolerable.
  • Launch table: Skip it. Results arrive with the response, not separately. By the time the coordinator speaks, the work is already done.
  • read_agent: Skip entirely. Results return automatically when subagents complete.
  • agent_type: Drop it. All VS Code subagents have full tool access by default. Subagents inherit the parent's tools.
  • description: Drop it. The agent name is already in the prompt.
  • Prompt content: Keep ALL prompt structure — charter, identity, task, hygiene, response order blocks are surface-independent.

Feature Degradation Table

FeatureCLIVS CodeDegradation
Parallel fan-outmode: "background" + read_agentMultiple subagents in one turnNone — equivalent concurrency
Model selectionPer-spawn model param (4-layer hierarchy)Session model only (Phase 1)Accept session model, log intent
Scribe fire-and-forgetBackground, never readSync, must waitBatch with last parallel group
Launch table UXShow table → results laterSkip table → results with responseUX only — results are correct
SQL toolAvailableNot availableAvoid SQL in cross-platform code paths
Response order bugCritical workaroundPossibly necessary (unverified)Keep the block — harmless if unnecessary

SQL Tool Caveat

The sql tool is CLI-only. It does not exist on VS Code, JetBrains, or GitHub.com. Any coordinator logic or agent workflow that depends on SQL (todo tracking, batch processing, session state) will silently fail on non-CLI surfaces. Cross-platform code paths must not depend on SQL. Use filesystem-based state (.squad/ files) for anything that must work everywhere.

Examples

Example 1: CLI parallel spawn

// Coordinator detects task tool available → CLI mode
task({ agent_type: "general-purpose", mode: "background", model: "claude-sonnet-4.5", ... })
task({ agent_type: "general-purpose", mode: "background", model: "claude-haiku-4.5", ... })
// Later: read_agent for both

Example 2: VS Code parallel spawn

// Coordinator detects runSubagent available → VS Code mode
runSubagent({ prompt: "...Fenster charter + task..." })
runSubagent({ prompt: "...Hockney charter + task..." })
runSubagent({ prompt: "...Scribe charter + task..." }) // Last in group
// Results return automatically, no read_agent

Example 3: Fallback mode

// Neither task nor runSubagent available → work inline
// Coordinator executes the task directly without spawning

Anti-Patterns

  • ❌ Using SQL tool in cross-platform workflows (breaks on VS Code/JetBrains/GitHub.com)
  • ❌ Attempting per-spawn model selection on VS Code (Phase 1 — only session model works)
  • ❌ Fire-and-forget Scribe on VS Code (must batch as last subagent)
  • ❌ Showing launch table on VS Code (results already inline)
  • ❌ Apologizing or explaining platform limitations to the user
  • ❌ Using task when only runSubagent is available
  • ❌ Dropping prompt structure (charter/identity/task) on non-CLI platforms

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Standard collaboration patterns for all squad agents — worktree awareness, decisions, cross-agent communication

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

Shared hard rules enforced across all squad agents

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

Route gh-aw design, creation, diagnosis, patching, active debugging, and upgrade requests to the right strategies.

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

How to write comprehensive architectural proposals that drive alignment before code is written

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

Upgrade gh-aw to latest gh-aw-firewall release and identify follow-up spec tasks.

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

Review code that performs git or gh operations against repository checkouts in gh-aw, checking that the right credentials are available at the right time and that sparseness, shallowness and credential-free factors are properly considered.

日本語の概要は準備中です。原文の説明を表示しています。

github/gh-aw5,3812026年10月10日 更新

github のスキルをすべて見る

このスキルの問題を報告する