📋 Pre-flight Checks
🔍 Problem Description
Factory.AI and its Droid CLI do not have first class support in Engram like CC, OpenCode, etc. Droid users like myself have to manually wire up the MCP server, plugin, and Memory Protocol. This is error-prone and misses the first-message tool-loading behavior that makes Engram reliable in other agents.
💡 Proposed Solution
Add a droid agent to engram setup so users can run:
The command should:
- Register
mcpServers.engram in ~/.factory/mcp.json with the absolute path to the engram binary.
- Extract the
UserPromptSubmit hook scripts to ~/.factory/hooks/engram/.
- Write a
UserPromptSubmit entry to ~/.factory/hooks.json in Droid's standalone format.
- Install the Engram plugin from the GitHub marketplace so Droid gets the
SessionStart, Stop, PreCompact, SubagentStop hooks and the engram-memory skill.
The user-level UserPromptSubmit hook is required because Droid (like Claude Code) does not execute UserPromptSubmit hooks that are declared inside a plugin, even though it registers and matches them. The user-level hook works around this and forces the agent to load Engram tools on the first message.
Expected output after running engram setup droid:
✓ Installed droid plugin (3 files)
→ /Users/<user>/.factory
Next steps:
1. Restart Droid so MCP config and hooks are reloaded
2. Verify ~/.factory/mcp.json includes mcpServers.engram
3. Verify ~/.factory/hooks.json has a UserPromptSubmit entry for engram
4. Verify the plugin is installed with: droid plugin list --scope user
📦 Affected Area
CLI (commands, flags)
🔄 Alternatives Considered
- Native Droid plugin: A first-class
.factory-plugin/ plugin could be created, but it would still need the user-level UserPromptSubmit hook because of the plugin-hook limitation. Reusing the existing Claude Code plugin via Droid's marketplace translation avoids duplicating hook scripts.
- Manual setup: Users could manually edit
~/.factory/mcp.json and ~/.factory/hooks.json, but this is brittle and doesn't handle the absolute binary path or plugin installation.
📎 Additional Context
Validation notes:
- Droid successfully translates the existing
.claude-plugin/ marketplace plugin.
- Lifecycle hooks (
SessionStart, Stop, PreCompact, SubagentStop) from the translated plugin fire correctly.
- Droid exposes Engram MCP tools as
engram___<tool> (e.g. engram___mem_save), so the first-message ToolSearch instruction must use that pattern.
droid exec does not appear to fire UserPromptSubmit hooks; interactive droid sessions do.
A working implementation is available at https://github.com/ahjota/engram (branch main, commits 94b4f31 and earlier). Would be more than willing to open a PR here.
📋 Pre-flight Checks
status:approvedbefore a PR can be opened🔍 Problem Description
Factory.AI and its Droid CLI do not have first class support in Engram like CC, OpenCode, etc. Droid users like myself have to manually wire up the MCP server, plugin, and Memory Protocol. This is error-prone and misses the first-message tool-loading behavior that makes Engram reliable in other agents.
💡 Proposed Solution
Add a
droidagent toengram setupso users can run:The command should:
mcpServers.engramin~/.factory/mcp.jsonwith the absolute path to theengrambinary.UserPromptSubmithook scripts to~/.factory/hooks/engram/.UserPromptSubmitentry to~/.factory/hooks.jsonin Droid's standalone format.SessionStart,Stop,PreCompact,SubagentStophooks and theengram-memoryskill.The user-level
UserPromptSubmithook is required because Droid (like Claude Code) does not executeUserPromptSubmithooks that are declared inside a plugin, even though it registers and matches them. The user-level hook works around this and forces the agent to load Engram tools on the first message.Expected output after running
engram setup droid:📦 Affected Area
CLI (commands, flags)
🔄 Alternatives Considered
.factory-plugin/plugin could be created, but it would still need the user-levelUserPromptSubmithook because of the plugin-hook limitation. Reusing the existing Claude Code plugin via Droid's marketplace translation avoids duplicating hook scripts.~/.factory/mcp.jsonand~/.factory/hooks.json, but this is brittle and doesn't handle the absolute binary path or plugin installation.📎 Additional Context
Validation notes:
.claude-plugin/marketplace plugin.SessionStart,Stop,PreCompact,SubagentStop) from the translated plugin fire correctly.engram___<tool>(e.g.engram___mem_save), so the first-messageToolSearchinstruction must use that pattern.droid execdoes not appear to fireUserPromptSubmithooks; interactivedroidsessions do.A working implementation is available at https://github.com/ahjota/engram (branch
main, commits94b4f31and earlier). Would be more than willing to open a PR here.