agentleFS
shalombshalomb/agent-skills/skills/kiro-sub-agent/SKILL.md

kiro-sub-agent

Skill3 starsChanged 3 months agoMITView on GitHub

Launch Kiro CLI as a headless sub-agent in a tmux pane and monitor its completion. Use when delegating a well-defined coding task to a Kiro agent subprocess. Triggers include "run kiro agent", "delegate to kiro", "kiro sub-agent", or any request to run kiro-cli headlessly.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you want to use Kiro's tool ecosystem (AWS, code intelligence, etc.)

    line 19
  2. Distinctive:

    No structured output — cannot extract cost, turn count, or tool calls programmatically

    line 106
  3. Very specific:

    No session persistence control beyond --no-interactive

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kiro Sub-Agent Skill

Launch kiro-cli chat as a headless sub-agent in a tmux pane.

When to use

  • Delegating a scoped task to Kiro CLI running autonomously
  • Parallel execution alongside other sub-agents (claude, gemini, pi)
  • Running Ralph or Bart loops via Kiro instead of Claude CLI
  • When you want to use Kiro's tool ecosystem (AWS, code intelligence, etc.)

Key differences from Claude CLI

AspectClaude CLIKiro CLI
Structured output--output-format stream-json (JSONL)None — ANSI terminal output only
Non-interactive--print + --no-session-persistence--no-interactive
Tool trust--dangerously-skip-permissions-a / --trust-all-tools
Prompt input-p @/path/to/file.md or -p "text"Positional argument "text"
Model selection--model haiku|sonnet|opus--model <model>
Completion signal{"type":"result"} in JSONLProcess exit (exit code 0)
Cost trackingtotal_cost_usd in result eventNot available in output

Non-interactive invocation

kiro-cli chat \
  --trust-all-tools \
  --no-interactive \
  --model <model> \
  "Your prompt here"

Reading prompt from file

Kiro CLI doesn't support @file syntax. Use command substitution:

kiro-cli chat -a --no-interactive "$(cat /tmp/task-prompt.md)"

Or for very long prompts (argument length limits), use a heredoc wrapper:

cat > /tmp/launch-kiro.sh << 'SCRIPT'
#!/bin/bash
cd /path/to/worktree
kiro-cli chat -a --no-interactive "$(cat /tmp/ralph-task.md)" \
  > /tmp/kiro-task.log 2>&1
echo "EXIT_CODE: $?"
SCRIPT
chmod +x /tmp/launch-kiro.sh

Monitoring

Since Kiro doesn't produce JSONL, monitoring is process-based:

Check if still running

# From tmux pane scraping
tmux capture-pane -t "$PANE" -p | tail -5

Check completion

# Look for the credits/time line that signals end of response
tmux capture-pane -t "$PANE" -p | grep -q "Credits:.*Time:" && echo "DONE"

Log-based monitoring

# If output is redirected to a file
tail -f /tmp/kiro-task.log | grep --line-buffered "Credits:"

Launch template (for dispatch.py)

#!/bin/bash
cd {worktree}
kiro-cli chat -a --no-interactive "$(cat {prompt})" \
  > {logfile} 2>&1
echo "KIRO_EXIT: $?" >> {logfile}

Completion detection

Unlike Claude's JSONL result event, detect Kiro completion by:

  1. Process exit — the kiro-cli chat process terminates
  2. Log marker — look for Credits: and Time: in output
  3. Exit code file — append echo "KIRO_EXIT: $?" after the command

Limitations

  • No structured output — cannot extract cost, turn count, or tool calls programmatically
  • No session persistence control beyond --no-interactive
  • Prompt size limited by shell argument length (getconf ARG_MAX, typically 2MB on Linux)
  • ANSI escape codes in output require stripping for clean log analysis
  • No --append-system-prompt equivalent — persona must be included in the prompt text

Integration with agent-mux

In dispatch.py, Kiro uses a different launch template:

AGENT_CONFIG = {
    "ralph": {
        "runner": "kiro",
        "model": None,  # uses default
        "logfile": "/tmp/kiro-ralph-{id}.log",
    },
}

The dispatch script writes the prompt to a file and launches via:

cd <worktree> && kiro-cli chat -a --no-interactive "$(cat <prompt>)" > <logfile> 2>&1

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.