feat: add Factory AI (Droid) integration#195
Conversation
|
@mrwogu is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
f56124d to
44c3e71
Compare
6969afb to
2787491
Compare
reversTeam
left a comment
There was a problem hiding this comment.
Impressive work, @mrwogu! This is a substantial integration and the PR description is excellent — the Claude Code vs Factory AI comparison table is especially helpful. A few observations:
What looks good:
- The adaptation table clearly documents every difference between the two platforms and how each is handled.
- The plugin structure (
gitnexus-factory-plugin/) is well-organized with proper manifest, hooks, MCP config, and skills. - The hook logic in
gitnexus-hook.jsis defensive — it checks for the.gitnexusindex, validates tool names, and has graceful fallback from direct binary to npx. - Skills are comprehensive and well-written with clear workflows and examples.
- The
.gitignoreadditions for Factory-specific files are correct.
Issues / suggestions:
-
Hook uses
Executebut hooks.json matcher also lists it — TheextractPatternfunction handlesGrep,Glob, andExecute. ForExecute, it only fires when the command containsrgorgrep. This is smart, but the regex/\brg$/with$anchor might not matchrgmid-path (e.g.,/usr/bin/rg). Consider using just\brg\b(which you already use in the earlier test). Same for\bgrep$. -
Timeout mismatch —
hooks.jsonsets a 10-second timeout, but the npx fallback in the hook script has a 15-secondspawnSynctimeout. If the hook runner kills the process at 10s, the 15s inner timeout is never reached. You might want to align these (e.g., hook timeout at 20s, or npx timeout at 8s). -
Skills content duplication — The 7 skills in
gitnexus-factory-plugin/skills/appear to be near-copies of the Claude Code skills in.claude/skills/. Long-term this creates a maintenance burden. Consider whether the setup script could generate/symlink these from a single source of truth. Not a blocker for this PR, but worth noting. -
setup.tsandai-context.tschanges — These look correct. The parallel installation to both.claude/skills/and.factory/skills/is straightforward. One thing to verify: doesinstallFactoryHooks()handle the case where.factory/doesn't exist yet? I seemkdirSyncwithrecursive: truein the setup code, which should cover it. -
Plugin author attribution — The
plugin.jsonlists you as the author, but the homepage/repository point to the main GitNexus repo. This seems appropriate for a first-party plugin contributed upstream. -
The shell hook (
post-tool-use.sh) — Nice to have as a reference implementation, but make sure it's not also registered inhooks.json(it isn't — only the JS hook is). The shell version usesjqwhich may not be available everywhere. A note in the file header about this being an alternative would help.
Overall this is high-quality work with good attention to platform differences. The main actionable items are the regex fix and the timeout alignment.
2787491 to
8ee961a
Compare
|
Thanks for the thorough review, @reversTeam! Rebased onto latest Fixed:
Acknowledged (follow-up):
All tests passing locally ( |
8ee961a to
08a6838
Compare
Port of gitnexus-claude-plugin adapted for Factory AI's plugin format:
- .factory-plugin/ manifest directory
- ${DROID_PLUGIN_ROOT} hook variable
- Root-level mcp.json (no dot prefix)
- PostToolUse hook (Factory PreToolUse doesn't support additionalContext)
- Execute tool name (Factory equivalent of Claude Code's Bash)
- Change \brg$ and \bgrep$ to \brg\b and \bgrep\b so full paths like /usr/bin/rg are matched correctly (all 3 hook variants) - Reduce npx fallback timeout from 15s to 8s to fit within the 10s hook runner timeout (Factory plugin)
08a6838 to
ef12f98
Compare
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 4320 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
|
Please submit a new PR if this is still relevant |
Summary
Full Factory AI (Droid) support, mirroring the existing Claude Code integration. Factory AI reads
AGENTS.md(the shared standard), so no separate context file is needed.What's included
Plugin (
gitnexus-factory-plugin/):.factory-plugin/manifest,mcp.json, 7 skills, PostToolUse hookdroid plugin addfrom the Factory marketplaceCore CLI (
gitnexus/):setup.ts—setupFactory(),installFactorySkills(),installFactoryHooks()added tonpx gitnexus setupai-context.ts—npx gitnexus analyzenow installs skills to.factory/skills/gitnexus/hooks/factory/—gitnexus-hook.cjs+post-tool-use.sh(shell equivalent)Docs (
README.md,gitnexus/README.md):droid mcp add).claude/skills/+.factory/skills/)Claude Code vs Factory AI differences addressed
.claude-plugin/.factory-plugin/.mcp.jsonmcp.json${CLAUDE_PLUGIN_ROOT}${DROID_PLUGIN_ROOT}BashExecutePreToolUsePostToolUseadditionalContextCLAUDE.mdAGENTS.md(shared standard)~/.claude/~/.factory/.claude/skills/.factory/skills/Files changed
gitnexus-factory-plugin/**gitnexus/src/cli/setup.tsgitnexus/src/cli/ai-context.tsgitnexus/hooks/factory/gitnexus-hook.cjsgitnexus/hooks/factory/post-tool-use.shREADME.mdgitnexus/README.md.gitignore.factory/settings.local.json,.factory/worktrees/Test plan
droid plugin addand verify it loadsnpx gitnexus mcp)npx gitnexus setupand verify Factory AI is detected and configurednpx gitnexus analyzeand verify .factory/skills/ are created