feat(droid): add Factory AI Droid support#912
Conversation
|
In hooks/droid/rtk-rewrite.sh, if rtk rewrite "$CMD" exits with code 0 but produces empty stdout (e.g., rtk binary bug, edge case), REWRITTEN becomes empty. The equality guard [ "$CMD" = "$REWRITTEN" ] is false since Suggested fix (around line 62, after |
|
Valid edge case, but the Claude Code hook ( |
|
Fair point |
…tory-ai-droid-support # Conflicts: # README.md # src/hooks/init.rs # src/main.rs
|
Hi @skrabe — thank you for this, and apologies for the overlap. Factory Droid support has since landed on Since the feature is already shipped, I'm closing this as superseded to keep the queue clean — this is no reflection on your work, the timing just didn't line up (your PR predated #2267 but sat in merge conflict while the other landed). If you spot anything the merged integration is missing compared to your version, please do open a follow-up PR or an issue pointing at the gap — happy to review that. Thanks again for contributing! |
Summary
PreToolUsehook system with the samehookSpecificOutputJSON format as Claude Code, with the shell tool namedExecuteinstead ofBashRTK.md+@RTK.mdinAGENTS.md+settings.jsonpatchingChanges
New files:
hooks/droid/rtk-rewrite.sh— Shell hook script (delegates tortk rewrite, same JSON protocol as Claude Code)hooks/droid/rtk-awareness.md— Slim RTK awareness instructions for hook-based usagehooks/droid/README.md— Integration docsModified files:
src/main.rs— Added--droidflag toInitcommand, dispatch torun_droid(), wired intouninstall()src/hooks/init.rs— Addedrun_droid(),patch_droid_settings(),uninstall_droid(),resolve_droid_dir()README.md— Added Factory AI Droid to supported tools table and Quick StartInstall flow (
rtk init -g --droid)~/.factory/hooks/rtk-rewrite.sh(chmod 755)RTK.mdto~/.factory/RTK.md@RTK.mdreference to~/.factory/AGENTS.md(creates if missing, preserves existing content)~/.factory/settings.jsonwithPreToolUsehook entry (Executematcher)Uninstall flow (
rtk init -g --droid --uninstall)~/.factory/hooks/rtk-rewrite.sh~/.factory/RTK.md@RTK.mdline from~/.factory/AGENTS.md(preserves other content)~/.factory/settings.jsonTest plan
cargo fmt --all --checkpassescargo clippy --all-targets— no new warningscargo test— 1138 passed, 0 failedrtk init -g --droid --auto-patchinstalls all artifacts correctly@RTK.mdor settings entryrtk init -g --droid --uninstallremoves all RTK artifactsAGENTS.mdcontent andsettings.jsoncustom models preserved through install/uninstall cycle