Invoke agent
Playbook for invoking non-interactive coding-agent CLIs (codex, gemini, cursor, kimi, claude, antigravity) as subprocesses. Use this skill inside a moderate-debate per-turn subagent, or when any skill needs to shell out to another AI CLI with a prompt and capture the reply — covers install checks, exact non-interactive invocation, input/output conventions, budget flags, and known per-CLI quirks.From its SKILL.md
npx -y skills add SebastianElvis/senate --skill invoke-agentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.8 KB, as published. Nobody here has run it
invoke-agent — CLI invocation playbook
This skill is a reference library, not a flow. When you need to call another AI CLI, read the relevant file below for the exact command, flags, input conventions, output parsing rules, and known quirks.
Where this is read from: moderate-debate does not call CLIs from its own context. Each turn is dispatched into a fresh subagent (Agent / Task tool, isolated context) that loads the playbook for one CLI, runs the call, validates the contract, and returns a small structured result. See ../moderate-debate/SKILL.md § "Per-turn subagent" for the contract between moderator and subagent. If you find yourself reading these playbooks from a long-lived debate context, you are in the wrong place — dispatch a subagent.
Supported CLIs
| CLI | File | Typical use |
|---|---|---|
| codex | references/codex.md | OpenAI Codex CLI |
| gemini | references/gemini.md | Google Gemini CLI |
| cursor | references/cursor.md | Cursor Agent CLI (cursor-agent) |
| kimi | references/kimi.md | Moonshot Kimi CLI |
| claude | references/claude.md | Anthropic Claude Code CLI |
| antigravity | references/antigravity.md | Google Antigravity CLI (agy) |
Common invocation shape
Every CLI playbook follows the same schema so you can read them interchangeably:
- Install check — one shell command that proves the CLI is on PATH.
- Invoke — the exact non-interactive command template with placeholders for
{prompt},{model},{system}. - Input — stdin vs. flag vs. file. How to pass long prompts (usually: heredoc to stdin, or a tempfile).
- Output — stdout shape (plain text, JSON, streaming). Any banner/ANSI stripping rules.
- Budget flags — token/time caps if the CLI supports them.
- Known quirks — auth env vars, rate limits, non-zero exits that are benign, output truncation.
General rules for the caller
- Always non-interactive. Use the CLI's one-shot / headless /
-p/execflag. Never spawn an interactive shell. - Pass the full prompt via stdin or a tempfile. Command-line length limits bite on long debate contexts. Use a heredoc:
codex exec - <<'PROMPT' <prompt body> PROMPT - Capture stdout and stderr to the per-turn directory at
.senate/runs/<id>/stages/<n>-<name>/turns/<NNN>-<cli>-<role>/{stdout,stderr}.log(the moderator mints this directory before dispatching the per-turn subagent;<NNN>is the monotonic turn number fromtranscript.jsonl). Always keepstdout.log, even if empty on a hard failure — the workspace contract uses it as the stable raw-output slot, and the moderator records its path on the transcript line. Deletestderr.logonly when it ends up empty ([ -s "$TURN_DIR/stderr.log" ] || rm -f "$TURN_DIR/stderr.log"). - Read exit code. Classify failures with
../moderate-debate/references/failures.md; retry only for that file's retryable cases (rate_limit,timeout, and the documented exit-0 empty-stdoutunknowncase), sharing the same singler1retry budget as contract re-prompts. - Strip ANSI. Pipe through
sed 's/\x1b\[[0-9;]*m//g'if the CLI emits color codes even when stdout is a pipe. - Timeout. Wrap every invocation with the portable timeout command defined in
../moderate-debate/references/budget.md(use GNUtimeoutwhen available,gtimeouton Homebrew/Coreutils macOS installs, otherwise the Perl fallback). Do not assume baretimeoutexists on macOS. - Sanitize. Never put shell metacharacters from the transcript into a command line — pass everything via stdin.
If a CLI isn't supported yet
Copy one of the existing files as a template, fill in the six sections above, and add it to the table. No code changes needed anywhere else.
Files in this skill
Per-CLI playbooks (load only the file matching the CLI you're about to invoke this turn):
references/codex.mdreferences/gemini.mdreferences/cursor.mdreferences/kimi.mdreferences/claude.mdreferences/antigravity.md
Cross-cutting reference (load only on demand):
references/skill-authoring.md— Agent Skills spec & best practices. Load only when the prompt being sent to a CLI is asking it to author or revise an Agent Skill (otherwise it is dead weight in context).