Skip to content

feat(droid): add Factory AI Droid support#912

Open
skrabe wants to merge 1 commit intortk-ai:developfrom
skrabe:feat/droid-add-factory-ai-droid-support
Open

feat(droid): add Factory AI Droid support#912
skrabe wants to merge 1 commit intortk-ai:developfrom
skrabe:feat/droid-add-factory-ai-droid-support

Conversation

@skrabe
Copy link
Copy Markdown

@skrabe skrabe commented Mar 29, 2026

Summary

  • Adds RTK integration for Factory AI Droid CLI
  • Factory Droid uses a PreToolUse hook system with the same hookSpecificOutput JSON format as Claude Code, with the shell tool named Execute instead of Bash
  • Follows the Claude Code integration pattern: hook script + RTK.md + @RTK.md in AGENTS.md + settings.json patching

Changes

New files:

  • hooks/droid/rtk-rewrite.sh — Shell hook script (delegates to rtk rewrite, same JSON protocol as Claude Code)
  • hooks/droid/rtk-awareness.md — Slim RTK awareness instructions for hook-based usage
  • hooks/droid/README.md — Integration docs

Modified files:

  • src/main.rs — Added --droid flag to Init command, dispatch to run_droid(), wired into uninstall()
  • src/hooks/init.rs — Added run_droid(), patch_droid_settings(), uninstall_droid(), resolve_droid_dir()
  • README.md — Added Factory AI Droid to supported tools table and Quick Start

Install flow (rtk init -g --droid)

  1. Writes hook script to ~/.factory/hooks/rtk-rewrite.sh (chmod 755)
  2. Writes RTK.md to ~/.factory/RTK.md
  3. Adds @RTK.md reference to ~/.factory/AGENTS.md (creates if missing, preserves existing content)
  4. Patches ~/.factory/settings.json with PreToolUse hook entry (Execute matcher)

Uninstall flow (rtk init -g --droid --uninstall)

  1. Removes ~/.factory/hooks/rtk-rewrite.sh
  2. Removes ~/.factory/RTK.md
  3. Removes @RTK.md line from ~/.factory/AGENTS.md (preserves other content)
  4. Removes RTK hook entry from ~/.factory/settings.json

Test plan

  • cargo fmt --all --check passes
  • cargo clippy --all-targets — no new warnings
  • cargo test — 1138 passed, 0 failed
  • Manual: rtk init -g --droid --auto-patch installs all artifacts correctly
  • Manual: idempotent — second install doesn't duplicate @RTK.md or settings entry
  • Manual: rtk init -g --droid --uninstall removes all RTK artifacts
  • Manual: existing AGENTS.md content and settings.json custom models preserved through install/uninstall cycle
  • Manual: uninstall idempotent — second uninstall reports "nothing to remove"

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

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