Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ integrations/aider/CONVENTIONS.md
integrations/windsurf/.windsurfrules
integrations/openclaw/*
integrations/qwen/agents/
integrations/kimi/*/
!integrations/openclaw/README.md
!integrations/kimi/README.md
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Each agent file contains:

Browse the agents below and copy/adapt the ones you need!

### Option 3: Use with Other Tools (Cursor, Aider, Windsurf, Gemini CLI, OpenCode)
### Option 3: Use with Other Tools (Cursor, Aider, Windsurf, Gemini CLI, OpenCode, Kimi Code)

```bash
# Step 1 -- generate integration files for all supported tools
Expand All @@ -58,6 +58,7 @@ Browse the agents below and copy/adapt the ones you need!
./scripts/install.sh --tool copilot
./scripts/install.sh --tool aider
./scripts/install.sh --tool windsurf
./scripts/install.sh --tool kimi
```

See the [Multi-Tool Integrations](#-multi-tool-integrations) section below for full details.
Expand Down Expand Up @@ -496,6 +497,7 @@ The Agency works natively with Claude Code, and ships conversion + install scrip
- **[Windsurf](https://codeium.com/windsurf)** β€” single `.windsurfrules` β†’ `./.windsurfrules`
- **[OpenClaw](https://github.com/openclaw/openclaw)** β€” `SOUL.md` + `AGENTS.md` + `IDENTITY.md` per agent
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** β€” `.md` SubAgent files β†’ `~/.qwen/agents/`
- **[Kimi Code](https://github.com/MoonshotAI/kimi-cli)** β€” YAML agent specs β†’ `~/.config/kimi/agents/`

---

Expand Down Expand Up @@ -530,8 +532,9 @@ The installer scans your system for installed tools, shows a checkbox UI, and le
[ ] 8) [ ] Aider (CONVENTIONS.md)
[ ] 9) [ ] Windsurf (.windsurfrules)
[ ] 10) [ ] Qwen Code (~/.qwen/agents)
[ ] 11) [ ] Kimi Code (~/.config/kimi/agents)

[1-10] toggle [a] all [n] none [d] detected
[1-11] toggle [a] all [n] none [d] detected
[Enter] install [q] quit
```

Expand Down Expand Up @@ -731,6 +734,32 @@ cd /your/project

</details>

<details>
<summary><strong>Kimi Code</strong></summary>

Agents are converted to Kimi Code CLI format (YAML + system prompt) and installed to `~/.config/kimi/agents/`.

```bash
# Convert and install
./scripts/convert.sh --tool kimi
./scripts/install.sh --tool kimi
```

**Usage with Kimi Code:**
```bash
# Use an agent
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml

# In a project
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml \
--work-dir /your/project \
"Review this React component"
```

See [integrations/kimi/README.md](integrations/kimi/README.md) for details.

</details>

---

### Regenerating After Changes
Expand All @@ -748,7 +777,7 @@ When you add new agents or edit existing ones, regenerate all integration files:

- [ ] Interactive agent selector web tool
- [x] Multi-agent workflow examples -- see [examples/](examples/)
- [x] Multi-tool integration scripts (Claude Code, GitHub Copilot, Antigravity, Gemini CLI, OpenCode, OpenClaw, Cursor, Aider, Windsurf, Qwen Code)
- [x] Multi-tool integration scripts (Claude Code, GitHub Copilot, Antigravity, Gemini CLI, OpenCode, OpenClaw, Cursor, Aider, Windsurf, Qwen Code, Kimi Code)
- [ ] Video tutorials on agent design
- [ ] Community agent marketplace
- [ ] Agent "personality quiz" for project matching
Expand Down
34 changes: 34 additions & 0 deletions integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ supported agentic coding tools.
- **[Cursor](#cursor)** β€” `.mdc` rule files in `cursor/`
- **[Aider](#aider)** β€” `CONVENTIONS.md` in `aider/`
- **[Windsurf](#windsurf)** β€” `.windsurfrules` in `windsurf/`
- **[Kimi Code](#kimi-code)** β€” YAML agent specs in `kimi/`

## Quick Install

Expand Down Expand Up @@ -172,3 +173,36 @@ cd /your/project && /path/to/agency-agents/scripts/install.sh --tool windsurf
```

See [windsurf/README.md](windsurf/README.md) for details.

---

## Kimi Code

Each agent is converted to a Kimi Code CLI agent specification (YAML format with
separate system prompt files). Agents are installed to `~/.config/kimi/agents/`.

Because the Kimi agent files are generated from the source Markdown, run
`./scripts/convert.sh --tool kimi` before installing from a fresh clone.

```bash
./scripts/convert.sh --tool kimi
./scripts/install.sh --tool kimi
```

### Usage

After installation, use an agent with the `--agent-file` flag:

```bash
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml
```

Or in a specific project:

```bash
cd /your/project
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml \
--work-dir /your/project
```

See [kimi/README.md](kimi/README.md) for details.
108 changes: 108 additions & 0 deletions integrations/kimi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Kimi Code CLI Integration

Converts all Agency agents into Kimi Code CLI agent specifications. Each agent
becomes a directory containing `agent.yaml` (agent spec) and `system.md` (system
prompt).

## Installation

### Prerequisites

- [Kimi Code CLI](https://github.com/MoonshotAI/kimi-cli) installed

### Install

```bash
# Generate integration files (required on fresh clone)
./scripts/convert.sh --tool kimi

# Install agents
./scripts/install.sh --tool kimi
```

This copies agents to `~/.config/kimi/agents/`.

## Usage

### Activate an Agent

Use the `--agent-file` flag to load a specific agent:

```bash
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml
```

### In a Project

```bash
cd /your/project
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml \
--work-dir /your/project \
"Review this React component for performance issues"
```

### List Installed Agents

```bash
ls ~/.config/kimi/agents/
```

## Agent Structure

Each agent directory contains:

```
~/.config/kimi/agents/frontend-developer/
β”œβ”€β”€ agent.yaml # Agent specification (tools, subagents)
└── system.md # System prompt with personality and instructions
```

### agent.yaml format

```yaml
version: 1
agent:
name: frontend-developer
extend: default # Inherits from Kimi's built-in default agent
system_prompt_path: ./system.md
tools:
- "kimi_cli.tools.shell:Shell"
- "kimi_cli.tools.file:ReadFile"
# ... all default tools
```

## Regenerate

After modifying source agents:

```bash
./scripts/convert.sh --tool kimi
./scripts/install.sh --tool kimi
```

## Troubleshooting

### Agent file not found

Ensure you've run `convert.sh` before `install.sh`:

```bash
./scripts/convert.sh --tool kimi
```

### Kimi CLI not detected

Make sure `kimi` is in your PATH:

```bash
which kimi
kimi --version
```

### Invalid YAML

Validate the generated files:

```bash
python3 -c "import yaml; yaml.safe_load(open('integrations/kimi/frontend-developer/agent.yaml'))"
```
39 changes: 37 additions & 2 deletions scripts/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# windsurf β€” Single .windsurfrules for Windsurf
# openclaw β€” OpenClaw SOUL.md files (openclaw_workspace/<agent>/SOUL.md)
# qwen β€” Qwen Code SubAgent files (~/.qwen/agents/*.md)
# kimi β€” Kimi Code CLI agent files (~/.config/kimi/agents/)
# all β€” All tools (default)
#
# Output is written to integrations/<tool>/ relative to the repo root.
Expand Down Expand Up @@ -348,6 +349,39 @@ HEREDOC
fi
}

convert_kimi() {
local file="$1"
local name description slug outdir agent_file body

name="$(get_field "name" "$file")"
description="$(get_field "description" "$file")"
slug="$(slugify "$name")"
body="$(get_body "$file")"

outdir="$OUT_DIR/kimi/$slug"
agent_file="$outdir/agent.yaml"
mkdir -p "$outdir"

# Kimi Code CLI agent format: YAML with separate system prompt file
# Uses extend: default to inherit Kimi's default toolset
cat > "$agent_file" <<HEREDOC
version: 1
agent:
name: ${slug}
extend: default
system_prompt_path: ./system.md
HEREDOC

# Write system prompt to separate file
cat > "$outdir/system.md" <<HEREDOC
# ${name}

${description}

${body}
HEREDOC
}

# Aider and Windsurf are single-file formats β€” accumulate into temp files
# then write at the end.
AIDER_TMP="$(mktemp)"
Expand Down Expand Up @@ -445,6 +479,7 @@ run_conversions() {
cursor) convert_cursor "$file" ;;
openclaw) convert_openclaw "$file" ;;
qwen) convert_qwen "$file" ;;
kimi) convert_kimi "$file" ;;
aider) accumulate_aider "$file" ;;
windsurf) accumulate_windsurf "$file" ;;
esac
Expand All @@ -470,7 +505,7 @@ main() {
esac
done

local valid_tools=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "all")
local valid_tools=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi" "all")
local valid=false
for t in "${valid_tools[@]}"; do [[ "$t" == "$tool" ]] && valid=true && break; done
if ! $valid; then
Expand All @@ -486,7 +521,7 @@ main() {

local tools_to_run=()
if [[ "$tool" == "all" ]]; then
tools_to_run=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen")
tools_to_run=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "openclaw" "qwen" "kimi")
else
tools_to_run=("$tool")
fi
Expand Down
28 changes: 27 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
INTEGRATIONS="$REPO_ROOT/integrations"

ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf qwen)
ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf qwen kimi)

# ---------------------------------------------------------------------------
# Usage
Expand Down Expand Up @@ -118,6 +118,7 @@ detect_aider() { command -v aider >/dev/null 2>&1; }
detect_openclaw() { command -v openclaw >/dev/null 2>&1 || [[ -d "${HOME}/.openclaw" ]]; }
detect_windsurf() { command -v windsurf >/dev/null 2>&1 || [[ -d "${HOME}/.codeium" ]]; }
detect_qwen() { command -v qwen >/dev/null 2>&1 || [[ -d "${HOME}/.qwen" ]]; }
detect_kimi() { command -v kimi >/dev/null 2>&1; }

is_detected() {
case "$1" in
Expand All @@ -131,6 +132,7 @@ is_detected() {
aider) detect_aider ;;
windsurf) detect_windsurf ;;
qwen) detect_qwen ;;
kimi) detect_kimi ;;
*) return 1 ;;
esac
}
Expand All @@ -148,6 +150,7 @@ tool_label() {
aider) printf "%-14s %s" "Aider" "(CONVENTIONS.md)" ;;
windsurf) printf "%-14s %s" "Windsurf" "(.windsurfrules)" ;;
qwen) printf "%-14s %s" "Qwen Code" "(~/.qwen/agents)" ;;
kimi) printf "%-14s %s" "Kimi Code" "(~/.config/kimi/agents)" ;;
esac
}

Expand Down Expand Up @@ -444,6 +447,28 @@ install_qwen() {
warn "Tip: Run '/agents manage' in Qwen Code to refresh, or restart session"
}

install_kimi() {
local src="$INTEGRATIONS/kimi"
local dest="${HOME}/.config/kimi/agents"
local count=0

[[ -d "$src" ]] || { err "integrations/kimi missing. Run convert.sh first."; return 1; }

mkdir -p "$dest"

local d
while IFS= read -r -d '' d; do
local name; name="$(basename "$d")"
mkdir -p "$dest/$name"
cp "$d/agent.yaml" "$dest/$name/agent.yaml"
cp "$d/system.md" "$dest/$name/system.md"
(( count++ )) || true
done < <(find "$src" -mindepth 1 -maxdepth 1 -type d -print0)

ok "Kimi Code: installed $count agents to $dest"
ok "Usage: kimi --agent-file ~/.config/kimi/agents/<agent-name>/agent.yaml"
}

install_tool() {
case "$1" in
claude-code) install_claude_code ;;
Expand All @@ -456,6 +481,7 @@ install_tool() {
aider) install_aider ;;
windsurf) install_windsurf ;;
qwen) install_qwen ;;
kimi) install_kimi ;;
esac
}

Expand Down