[PR #2309] [MERGED] feat(clients): register Factory Droid during setup #5154

Closed
opened 2026-10-31 01:04:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2309
Author: @0xRafie
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: feat/setup-factory-droid


📝 Commits (1)

  • 1c4e343 feat(clients): register Factory Droid during setup

📊 Changes

6 files changed (+191 additions, -1 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/connection-and-recovery.md (+1 -1)
📝 docs/client-configuration.md (+8 -0)
📝 docs/installation.md (+1 -0)
📝 src/application/SupportedClients.ts (+13 -0)
📝 tests/boundary/filesystem/clientLifecycle.test.ts (+1 -0)
➕ tests/boundary/filesystem/droidClientConfiguration.test.ts (+167 -0)

📄 Description

Summary

Registers Factory Droid (the droid CLI) as a supported client during npx rea-agents setup, following the Qoder registration (#1572). After this change, Droid users can install REA with one command: setup writes the rea MCP server into the user-level ~/.factory/mcp.json and installs the skill copy into ~/.factory/skills. No linked issue; I found no existing issue or PR for Droid support.

Problem and expected behavior

Factory Droid is not among the clients setup recognizes, so Droid users have to hand-edit ~/.factory/mcp.json and copy the skill themselves. Expected: after rea setup --client droid, mcpServers.rea exists in ~/.factory/mcp.json, the skill is installed under ~/.factory/skills/reverse-engineer-anything, doctor reports the registration as aligned, and uninstall removes exactly the rea entry and the skill copy.

Droid's configuration, per the official docs (MCP, skills):

  • User-level MCP servers live under the top-level mcpServers key of ~/.factory/mcp.json. A project-level .factory/mcp.json also exists; it is out of scope here.
  • Droid's own entries usually carry type (stdio or http), command, args, env and disabled. REA's existing json format writes command/args (plus env when needed) without type. With the real Droid CLI, such an entry is listed as a stdio server and connects (see Evidence).
  • Personal skills are discovered from ~/.factory/skills/<name>/SKILL.md.

Change and scope

  • SupportedClients: droid definition (display name "Factory Droid"): config path ~/.factory/mcp.json, marker ~/.factory, skills ~/.factory/skills, format json. No new dialect or code path.
  • Tests: new tests/boundary/filesystem/droidClientConfiguration.test.ts (6 cases); the clientLifecycle.test.ts expected detection list includes droid.
  • Docs: a row in the Supported agents table, a "Factory Droid" section in docs/client-configuration.md, and the client id in the skill's references/connection-and-recovery.md.
  • Intentionally out of scope: the project-level .factory/mcp.json, and a home-directory override variable (I found none documented by Factory, so none is honored).
  • The client id droid matches the CLI name; happy to rename it (for example factory_droid) if you prefer.

Contribution scope: a setup registration within existing boundaries, following the Qoder (#1572) and Qwen Code (#1415) registrations; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application-layer setup client registration (SupportedClients).
  • Contribution scope fit and linked maintainer decision: not applicable (see above).
  • CLI and MCP/tool-catalog contract: no tools added or changed; --client droid becomes a valid value.
  • Provider, bridge, target-format, or platform compatibility: adds the droid client, reusing the existing json configuration format.
  • Evidence, artifact, provenance, or reconstruction contract: not applicable.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): setup writes only mcpServers.rea; unrelated servers and Droid's top-level persistentPermissions are preserved. Uninstall removes only the rea entry and the skill copy.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none authored; generated catalogs stay CI-owned.

Expected effects (check known effects; use documentation-only on its own).

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The two checked effects are setup's existing behavior (reading and writing the client's MCP config with a backup), now applied to ~/.factory/mcp.json.

Evidence and regression coverage

  • Tests added or updated: droidClientConfiguration.test.ts covers config path resolution on linux/darwin/win32; the skill destination; an upsert that preserves an unrelated mcpServers entry and a Droid-shaped top-level persistentPermissions object; an idempotent re-run that reports unchanged with registration status aligned; creating mcpServers in an existing file without servers; an empty file; and uninstall removing only rea. clientLifecycle.test.ts now expects droid in the detected list.
  • Base reproduction or other evidence: end-to-end with the real Droid CLI 0.235.0 on macOS 26.7.1, in a throwaway HOME that contained only an empty .factory directory, using the CLI built from this branch:
    • rea setup --client droid --yes wrote mcpServers.rea = {"command": "<checkout>/scripts/rea.mjs", "args": ["mcp"]} (no type) and installed .factory/skills/reverse-engineer-anything.
    • rea doctor --json: the droid registration reports state: "aligned" and remediation: null. doctor itself exits 1 in such an empty HOME; it does the same in an empty HOME without .factory, so that status comes from the other unconfigured checks, not from this client.
    • droid mcp list: rea stdio connected [user].
    • rea uninstall removed the Droid registration and the skill copy; mcp.json became {"mcpServers": {}}.
  • User-visible CLI/MCP output (if applicable): setup, doctor and uninstall list "Factory Droid" / droid.
  • Remaining proof gaps: only macOS was run (path resolution for Linux and Windows is covered by the boundary test). The project-level .factory/mcp.json is not handled. The test fixture matches the real persistentPermissions shape by key and type only, with fake values.

For evidence-bearing changes: not applicable (setup registration; no Evidence contract change).

Validation performed

  • npx vitest run tests/boundary/filesystem/droidClientConfiguration.test.ts tests/boundary/filesystem/clientLifecycle.test.ts — 2 files, 59 tests passed
  • npm run check — passed (architecture guards across 1227 source files)
  • npm run check:fast — typecheck and lint passed
  • npm run verify:test-discovery — all 963 test files discovered exactly once
  • npm run docs:check — passed
  • npm run verify:package — passed (skill and its 6 references installed with Skills 1.7.2; setup planned-then-idempotent; 185 MCP tools)
  • npm pack --dry-run — passed (1473 files)
  • The end-to-end run under Evidence, with the real Droid CLI
  • Fetched https://docs.factory.com/harness/mcp and https://docs.factory.com/harness/skills (both HTTP 200); they document ~/.factory/mcp.json and ~/.factory/skills/<skill-name>/SKILL.md
  • Toolchain: Node 26.9.0 and npm 11.19.1 on main 0365454 (.nvmrc pins 24.18.0, so CI covers the pinned toolchain)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. macOS 26.7.1 with Droid CLI 0.235.0 for the end-to-end run; config I/O is covered by filesystem boundary tests.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: setup writes only the rea entry into ~/.factory/mcp.json, preserving all unrelated content; no network access or process execution added.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2309 **Author:** [@0xRafie](https://github.com/0xRafie) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `feat/setup-factory-droid` --- ### 📝 Commits (1) - [`1c4e343`](https://github.com/morluto/rea/commit/1c4e34332cd5488de4cd98f485f67365026256f0) feat(clients): register Factory Droid during setup ### 📊 Changes **6 files changed** (+191 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/connection-and-recovery.md` (+1 -1) 📝 `docs/client-configuration.md` (+8 -0) 📝 `docs/installation.md` (+1 -0) 📝 `src/application/SupportedClients.ts` (+13 -0) 📝 `tests/boundary/filesystem/clientLifecycle.test.ts` (+1 -0) ➕ `tests/boundary/filesystem/droidClientConfiguration.test.ts` (+167 -0) </details> ### 📄 Description ## Summary Registers Factory Droid (the `droid` CLI) as a supported client during `npx rea-agents setup`, following the Qoder registration (#1572). After this change, Droid users can install REA with one command: setup writes the `rea` MCP server into the user-level `~/.factory/mcp.json` and installs the skill copy into `~/.factory/skills`. No linked issue; I found no existing issue or PR for Droid support. ## Problem and expected behavior Factory Droid is not among the clients setup recognizes, so Droid users have to hand-edit `~/.factory/mcp.json` and copy the skill themselves. Expected: after `rea setup --client droid`, `mcpServers.rea` exists in `~/.factory/mcp.json`, the skill is installed under `~/.factory/skills/reverse-engineer-anything`, `doctor` reports the registration as aligned, and uninstall removes exactly the `rea` entry and the skill copy. Droid's configuration, per the official docs ([MCP](https://docs.factory.com/harness/mcp), [skills](https://docs.factory.com/harness/skills)): - User-level MCP servers live under the top-level `mcpServers` key of `~/.factory/mcp.json`. A project-level `.factory/mcp.json` also exists; it is out of scope here. - Droid's own entries usually carry `type` (`stdio` or `http`), `command`, `args`, `env` and `disabled`. REA's existing `json` format writes `command`/`args` (plus `env` when needed) without `type`. With the real Droid CLI, such an entry is listed as a stdio server and connects (see Evidence). - Personal skills are discovered from `~/.factory/skills/<name>/SKILL.md`. ## Change and scope - `SupportedClients`: `droid` definition (display name "Factory Droid"): config path `~/.factory/mcp.json`, marker `~/.factory`, skills `~/.factory/skills`, format `json`. No new dialect or code path. - Tests: new `tests/boundary/filesystem/droidClientConfiguration.test.ts` (6 cases); the `clientLifecycle.test.ts` expected detection list includes `droid`. - Docs: a row in the Supported agents table, a "Factory Droid" section in `docs/client-configuration.md`, and the client id in the skill's `references/connection-and-recovery.md`. - Intentionally out of scope: the project-level `.factory/mcp.json`, and a home-directory override variable (I found none documented by Factory, so none is honored). - The client id `droid` matches the CLI name; happy to rename it (for example `factory_droid`) if you prefer. Contribution scope: a setup registration within existing boundaries, following the Qoder (#1572) and Qwen Code (#1415) registrations; maintainer scope decision not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: application-layer setup client registration (`SupportedClients`). - Contribution scope fit and linked maintainer decision: not applicable (see above). - CLI and MCP/tool-catalog contract: no tools added or changed; `--client droid` becomes a valid value. - Provider, bridge, target-format, or platform compatibility: adds the `droid` client, reusing the existing `json` configuration format. - Evidence, artifact, provenance, or reconstruction contract: not applicable. - Target selection, authority, upstream behavior, and cleanup details (if applicable): setup writes only `mcpServers.rea`; unrelated servers and Droid's top-level `persistentPermissions` are preserved. Uninstall removes only the `rea` entry and the skill copy. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none authored; generated catalogs stay CI-owned. Expected effects (check known effects; use documentation-only on its own). - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. The two checked effects are setup's existing behavior (reading and writing the client's MCP config with a backup), now applied to `~/.factory/mcp.json`. ## Evidence and regression coverage - Tests added or updated: `droidClientConfiguration.test.ts` covers config path resolution on linux/darwin/win32; the skill destination; an upsert that preserves an unrelated `mcpServers` entry and a Droid-shaped top-level `persistentPermissions` object; an idempotent re-run that reports `unchanged` with registration status `aligned`; creating `mcpServers` in an existing file without servers; an empty file; and uninstall removing only `rea`. `clientLifecycle.test.ts` now expects `droid` in the detected list. - Base reproduction or other evidence: end-to-end with the real Droid CLI 0.235.0 on macOS 26.7.1, in a throwaway `HOME` that contained only an empty `.factory` directory, using the CLI built from this branch: - `rea setup --client droid --yes` wrote `mcpServers.rea = {"command": "<checkout>/scripts/rea.mjs", "args": ["mcp"]}` (no `type`) and installed `.factory/skills/reverse-engineer-anything`. - `rea doctor --json`: the `droid` registration reports `state: "aligned"` and `remediation: null`. `doctor` itself exits 1 in such an empty `HOME`; it does the same in an empty `HOME` without `.factory`, so that status comes from the other unconfigured checks, not from this client. - `droid mcp list`: `rea stdio connected [user]`. - `rea uninstall` removed the Droid registration and the skill copy; `mcp.json` became `{"mcpServers": {}}`. - User-visible CLI/MCP output (if applicable): setup, doctor and uninstall list "Factory Droid" / `droid`. - Remaining proof gaps: only macOS was run (path resolution for Linux and Windows is covered by the boundary test). The project-level `.factory/mcp.json` is not handled. The test fixture matches the real `persistentPermissions` shape by key and type only, with fake values. For evidence-bearing changes: not applicable (setup registration; no Evidence contract change). ## Validation performed - `npx vitest run tests/boundary/filesystem/droidClientConfiguration.test.ts tests/boundary/filesystem/clientLifecycle.test.ts` — 2 files, 59 tests passed - `npm run check` — passed (architecture guards across 1227 source files) - `npm run check:fast` — typecheck and lint passed - `npm run verify:test-discovery` — all 963 test files discovered exactly once - `npm run docs:check` — passed - `npm run verify:package` — passed (skill and its 6 references installed with Skills 1.7.2; setup planned-then-idempotent; 185 MCP tools) - `npm pack --dry-run` — passed (1473 files) - The end-to-end run under Evidence, with the real Droid CLI - Fetched https://docs.factory.com/harness/mcp and https://docs.factory.com/harness/skills (both HTTP 200); they document `~/.factory/mcp.json` and `~/.factory/skills/<skill-name>/SKILL.md` - Toolchain: Node 26.9.0 and npm 11.19.1 on main `0365454` (`.nvmrc` pins 24.18.0, so CI covers the pinned toolchain) ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. macOS 26.7.1 with Droid CLI 0.235.0 for the end-to-end run; config I/O is covered by filesystem boundary tests. - Package or release metadata impact: none. - Security, privacy, process, or containment review: setup writes only the `rea` entry into `~/.factory/mcp.json`, preserving all unrelated content; no network access or process execution added. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5154
No description provided.