Add Factory Droid as a converter target (#174)

Adds a new 'droid' target to the converter that outputs Claude Code plugins
in Factory Droid's format:

- Commands flattened to ~/.factory/commands/ (strips namespace prefixes)
- Agents converted to droids in ~/.factory/droids/ with proper frontmatter
- Skills copied to ~/.factory/skills/
- Content transforms: Task calls, slash commands, and @agent references
  adapted to Droid conventions

This resolves the manual workaround described in issue #31 by automating
the conversion from Claude Code plugin format to Factory Droid's expected
directory structure.

Includes 13 tests covering converter logic and file writer behavior.

Co-authored-by: adamprime <adamprime@hey.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Adam Tervort
2026-02-11 11:48:13 -06:00
committed by GitHub
parent e8f3bbcb35
commit 4ab08dce78
8 changed files with 648 additions and 10 deletions

View File

@@ -1,10 +1,13 @@
import type { ClaudePlugin } from "../types/claude"
import type { OpenCodeBundle } from "../types/opencode"
import type { CodexBundle } from "../types/codex"
import type { DroidBundle } from "../types/droid"
import { convertClaudeToOpenCode, type ClaudeToOpenCodeOptions } from "../converters/claude-to-opencode"
import { convertClaudeToCodex } from "../converters/claude-to-codex"
import { convertClaudeToDroid } from "../converters/claude-to-droid"
import { writeOpenCodeBundle } from "./opencode"
import { writeCodexBundle } from "./codex"
import { writeDroidBundle } from "./droid"
export type TargetHandler<TBundle = unknown> = {
name: string
@@ -26,4 +29,10 @@ export const targets: Record<string, TargetHandler> = {
convert: convertClaudeToCodex as TargetHandler<CodexBundle>["convert"],
write: writeCodexBundle as TargetHandler<CodexBundle>["write"],
},
droid: {
name: "droid",
implemented: true,
convert: convertClaudeToDroid as TargetHandler<DroidBundle>["convert"],
write: writeDroidBundle as TargetHandler<DroidBundle>["write"],
},
}