Skip to main content

USE SWAMP WITH KIRO

Prerequisites

Initialize the repository

$ swamp repo init --tool kiro

You will see output like:

20:46:56.756 INF repo·init Initialized swamp repository at "/path/to/your/repo" (tool: "kiro")

What this sets up

Swamp writes six files, split between the IDE and the CLI.

IDE-facing (Kiro IDE):

  • .kiro/steering/swamp-rules.md — steering file with swamp rules.
  • .kiro/skills/ — bundled swamp skills (swamp-model, swamp-workflow, and the rest).
  • .vscode/settings.local.json — trusted swamp * commands.

CLI-facing (kiro-cli):

  • .kiro/agents/swamp.json — agent config. Declares skill resources and an explicit tool list (read, write, shell, grep, glob, thinking, todo), restricts shell to swamp .*, and wires in the postToolUse audit hook.
  • .kiro/hooks/swamp-audit.kiro.hookpostToolUse hook that records shell commands via swamp audit record --from-hook --tool kiro.
  • .kiro/settings/cli.json — sets chat.defaultAgent to swamp so plain kiro-cli chat loads the swamp agent and the audit hook runs.

Verify it works

In Kiro IDE, select swamp-getting-started from the / skills menu.

In kiro-cli, type:

I am new to swamp

The agent matches the getting-started skill and walks you through creating your first model.

Record and view agent commands

Every shell command the swamp agent runs through kiro-cli chat is appended to .swamp/audit/commands-YYYY-MM-DD.jsonl by the audit hook. View recent rows:

$ swamp audit --hours 1

Each row shows the command, cwd, timestamp, session ID, and success/failure.

To verify end-to-end, run something like docker ps in kiro-cli chat, then in another terminal run swamp audit --hours 1. You should see that command in the output.

If you already use a custom kiro-cli default agent

If .kiro/settings/cli.json already sets chat.defaultAgent to something other than swamp, swamp leaves it alone and logs a warning at init. Your preference wins, but the audit hook will not run through the default agent. To record agent commands, either:

  • change chat.defaultAgent to swamp in .kiro/settings/cli.json, or
  • invoke kiro-cli chat --agent swamp explicitly.

Upgrading

When a new version of swamp is released, upgrade the repository to get updated skills and configuration:

$ swamp repo upgrade

The steering file, agent config, and .kiro.hook are overwritten with the latest versions. .kiro/settings/cli.json and .vscode/settings.local.json are merged to preserve any keys you added.