Skip to content
Open
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
9 changes: 6 additions & 3 deletions code_review_graph/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,17 @@ def _handle_init(args: argparse.Namespace) -> None:

from .skills import (
generate_skills,
generate_kilo_skills,
inject_claude_md,
inject_platform_instructions,
install_hooks,
)

if not skip_skills:
skills_dir = generate_skills(repo_root)
print(f"Generated skills in {skills_dir}")
print(f"Generated Claude Code skills in {skills_dir}")
kilo_skills_dir = generate_kilo_skills(repo_root)
print(f"Generated Kilo CLI skills in {kilo_skills_dir}")
inject_claude_md(repo_root)
updated = inject_platform_instructions(repo_root)
if updated:
Expand Down Expand Up @@ -188,7 +191,7 @@ def main() -> None:
"--platform",
choices=[
"claude", "claude-code", "cursor", "windsurf", "zed",
"continue", "opencode", "antigravity", "all",
"continue", "opencode", "kilocode", "antigravity", "all",
],
default="all",
help="Target platform for MCP config (default: all detected)",
Expand Down Expand Up @@ -218,7 +221,7 @@ def main() -> None:
"--platform",
choices=[
"claude", "claude-code", "cursor", "windsurf", "zed",
"continue", "opencode", "antigravity", "all",
"continue", "opencode", "kilocode", "antigravity", "all",
],
default="all",
help="Target platform for MCP config (default: all detected)",
Expand Down
59 changes: 56 additions & 3 deletions code_review_graph/skills.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Claude Code skills and hooks auto-install.
"""Claude Code and Kilo CLI skills and hooks auto-install.

Generates Claude Code agent skill files, hooks configuration, and
CLAUDE.md integration for seamless code-review-graph usage.
Generates Claude Code and Kilo CLI agent skill files, hooks configuration,
and CLAUDE.md integration for seamless code-review-graph usage.
Also supports multi-platform MCP server installation.
"""

Expand Down Expand Up @@ -75,6 +75,14 @@ def _zed_settings_path() -> Path:
"format": "object",
"needs_type": True,
},
"kilocode": {
"name": "Kilo CLI",
"config_path": lambda root: root / ".opencode" / "opencode.jsonc",
"key": "mcpServers",
"detect": lambda: (Path.cwd() / ".opencode" / "opencode.jsonc").exists(),
"format": "object",
"needs_type": True,
},
"antigravity": {
"name": "Antigravity",
"config_path": lambda root: Path.home() / ".gemini" / "antigravity" / "mcp_config.json",
Expand Down Expand Up @@ -331,6 +339,51 @@ def generate_skills(repo_root: Path, skills_dir: Path | None = None) -> Path:
return skills_dir


# Kilo CLI skill files — same body, directory-per-skill format
# Written to .kilocode/skills/<slug>/SKILL.md so Kilo agents discover them
# Slug is derived from the skill name: "Explore Codebase" → "explore-codebase"

_KILO_SKILL_SLUG = {name: name.lower().replace(" ", "-").removesuffix(".md") for name in _SKILLS}


def generate_kilo_skills(repo_root: Path, skills_dir: Path | None = None) -> Path:
"""Generate Kilo CLI skill files.

Creates `.kilocode/skills/<slug>/SKILL.md` for each skill — Kilo's
directory-per-skill format required for its agent to discover skills.

Kilo skill files use YAML frontmatter (name, description) and a
markdown body.

Args:
repo_root: Repository root directory.
skills_dir: Custom skills directory. Defaults to repo_root/.kilocode/skills.

Returns:
Path to the skills directory.
"""
if skills_dir is None:
skills_dir = repo_root / ".kilocode" / "skills"
skills_dir.mkdir(parents=True, exist_ok=True)

for name, skill in _SKILLS.items():
slug = _KILO_SKILL_SLUG[name]
skill_dir = skills_dir / slug
skill_dir.mkdir(parents=True, exist_ok=True)
path = skill_dir / "SKILL.md"
content = (
"---\n"
f"name: {skill['name']}\n"
f"description: {skill['description']}\n"
"---\n\n"
f"{skill['body']}\n"
)
path.write_text(content)
logger.info("Wrote Kilo skill: %s", path)

return skills_dir


def generate_hooks_config() -> dict[str, Any]:
"""Generate Claude Code hooks configuration.

Expand Down
3 changes: 2 additions & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ code-review-graph install --platform claude-code
| **Windsurf** | `.windsurf/mcp.json` |
| **Zed** | `.zed/settings.json` |
| **Continue** | `.continue/config.json` |
| **OpenCode** | `.opencode/config.json` |
| **OpenCode** | `.opencode.json` |
| **Kilo CLI** | `.opencode/opencode.jsonc` |

## Core Workflow

Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading