diff --git a/.gitignore b/.gitignore index c3bcec7..00428b4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md index 2ef6e1d..430d3ce 100644 --- a/README.md +++ b/README.md @@ -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 +
+Kimi Code + +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. + +
+ --- ### 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 diff --git a/integrations/README.md b/integrations/README.md index c909700..f051a30 100644 --- a/integrations/README.md +++ b/integrations/README.md @@ -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. diff --git a/integrations/kimi/README.md b/integrations/kimi/README.md new file mode 100644 index 0000000..37381ca --- /dev/null +++ b/integrations/kimi/README.md @@ -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'))" +``` diff --git a/scripts/convert.sh b/scripts/convert.sh index 27d2f66..5dd26bc 100755 --- a/scripts/convert.sh +++ b/scripts/convert.sh @@ -18,6 +18,7 @@ # windsurf — Single .windsurfrules for Windsurf # openclaw — OpenClaw SOUL.md files (openclaw_workspace//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// 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" < "$outdir/system.md" </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.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 }