Skip to content

feat: add KiloCode target provider#320

Open
jrthib wants to merge 1 commit intoEveryInc:mainfrom
jrthib:main
Open

feat: add KiloCode target provider#320
jrthib wants to merge 1 commit intoEveryInc:mainfrom
jrthib:main

Conversation

@jrthib
Copy link

@jrthib jrthib commented Mar 19, 2026

Summary

Adds a kilocode target provider to the converter CLI, enabling automatic conversion and installation of the compound-engineering plugin for KiloCode CLI users.

Changes

  • Converter (src/converters/claude-to-kilocode.ts): Converts Claude plugin format to KiloCode format with MCP type mapping (http → remote, stdio → local)
  • Writer (src/targets/kilocode.ts): Writes KiloCode bundle with backup/merge for existing kilo.json
  • Types (src/types/kilocode.ts): Type definitions for KiloCode bundle structure
  • Spec (docs/specs/kilocode.md): Format specification documenting KiloCode's directory structure, agent frontmatter, and MCP configuration
  • Tests: Converter and writer tests with full coverage including agentMode option tests
  • README: Updated with KiloCode install and sync commands

Key Features

  • Respects options.agentMode for agent mode (primary or subagent)
  • Supports both global (~/.config/kilo/) and workspace (.kilo/) scopes
  • Backs up existing kilo.json before merging MCP servers
  • Both stdio (local) and HTTP (remote) MCP servers supported

Usage

# Install to global scope
bunx @every-env/compound-plugin install compound-engineering --to kilocode

# Install to workspace scope
bunx @every-env/compound-plugin install compound-engineering --to kilocode --scope workspace

Test plan

  • bun test passes (403 tests)
  • bun run src/index.ts convert --to kilocode ./plugins/compound-engineering produces valid output
  • bun run src/index.ts install --to kilocode --scope global ./plugins/compound-engineering installs to ~/.config/kilo/
  • All 46 skills copied correctly
  • MCP servers converted with correct type mapping
  • Existing kilo.json backed up before modification

- Add converter (src/converters/claude-to-kilocode.ts) with MCP type mapping
- Add writer (src/targets/kilocode.ts) with backup/merge for kilo.json
- Add type definitions (src/types/kilocode.ts)
- Add format specification (docs/specs/kilocode.md)
- Update README with KiloCode install and sync commands
- Add converter and writer tests
- Converter respects options.agentMode (primary/subagent)
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 423e0af025

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +49 to +52
if (targetName === "kilocode") {
if (hasExplicitOutput) return outputRoot
if (scope === "global") return path.join(os.homedir(), ".config", "kilo")
return path.join(process.cwd(), ".kilo")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve workspace KiloCode installs from the project root

When install/convert --to kilocode --scope workspace runs without an explicit --output, this branch resolves the root to cwd/.kilo, but writeKiloCodeBundle() still appends .kilo and .kilocode inside whatever it receives. The default workspace flow therefore writes agents to .kilo/.kilo/agents, skills to .kilo/.kilocode/skills, and kilo.json under .kilo/ instead of the documented project locations. Either return cwd here or make the writer detect an already-resolved .kilo root like writeKiroBundle() does.

Useful? React with 👍 / 👎.

Comment on lines +81 to +85
const home = process.env.HOME || process.env.USERPROFILE || ""
return {
configDir: path.join(home, ".config", "kilo"),
agentsDir: path.join(home, ".config", "kilo", "agents"),
skillsDir: path.join(home, ".kilocode", "skills"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor --output for global KiloCode installs

In global scope this helper ignores the outputRoot argument and recomputes destinations from HOME/USERPROFILE, so install/convert --to kilocode --scope global --output /tmp/out still mutates the real ~/.config/kilo/~/.kilocode tree. That makes dry runs and tests unsafe and breaks the explicit-output override that resolveTargetOutputRoot() already provides.

Useful? React with 👍 / 👎.

Comment on lines +27 to +29
const skillDirs = plugin.skills.map((skill) => ({
name: skill.name,
sourceDir: skill.sourceDir,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize copied skill names to KiloCode's naming rules

This copies Claude skill directories verbatim, but the KiloCode spec added in this change only allows skill names matching ^[a-z][a-z0-9-]*$. The compound-engineering plugin already ships generate_command and resolve_parallel, so the converted .kilocode/skills/* tree contains invalid names that KiloCode will not index or auto-activate. A KiloCode-specific rename step is needed instead of pass-through copying.

Useful? React with 👍 / 👎.

@tmchow
Copy link
Collaborator

tmchow commented Mar 20, 2026

@jrthib please address the review feedback please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants