Merge pull request #195 from CelsoDeSa/main

Thanks @CelsoDeSa — clean Kimi Code integration, follows existing patterns perfectly!
This commit is contained in:
Michael Sitarzewski
2026-03-26 23:47:09 -05:00
committed by GitHub
6 changed files with 240 additions and 6 deletions

2
.gitignore vendored
View File

@@ -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

View File

@@ -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
@@ -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.
@@ -516,6 +517,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/`
---
@@ -552,8 +554,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
```
@@ -763,6 +766,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
@@ -781,7 +810,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

View File

@@ -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
@@ -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
integrations/kimi/README.md Normal file
View File

@@ -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'))"
```

View File

@@ -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.
@@ -373,6 +374,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)"
@@ -470,6 +504,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
@@ -500,7 +535,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
@@ -519,7 +554,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

View File

@@ -101,7 +101,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
@@ -142,6 +142,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
@@ -155,6 +156,7 @@ is_detected() {
aider) detect_aider ;;
windsurf) detect_windsurf ;;
qwen) detect_qwen ;;
kimi) detect_kimi ;;
*) return 1 ;;
esac
}
@@ -172,6 +174,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
}
@@ -468,6 +471,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 ;;
@@ -480,6 +505,7 @@ install_tool() {
aider) install_aider ;;
windsurf) install_windsurf ;;
qwen) install_qwen ;;
kimi) install_kimi ;;
esac
}