[PR #2492] feat(setup): support CodeBuddy as a setup client #5270

Open
opened 2026-10-31 01:05:19 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2492
Author: @cainiao1992
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: feat/codebuddy-setup-client


📝 Commits (1)

  • 9505450 feat(setup): support CodeBuddy as a setup client

📊 Changes

5 files changed (+170 additions, -0 deletions)

View changed files

📝 docs/client-configuration.md (+12 -0)
📝 docs/installation.md (+1 -0)
📝 src/application/SupportedClients.ts (+8 -0)
📝 tests/boundary/filesystem/clientLifecycle.test.ts (+1 -0)
➕ tests/boundary/filesystem/codebuddyClientConfiguration.test.ts (+148 -0)

📄 Description

Summary

Adds CodeBuddy as a supported setup client. rea setup --client codebuddy (and auto-detection when ~/.codebuddy exists) now registers REA's local MCP server in the global ~/.codebuddy/mcp.json and installs the bundled skill under ~/.codebuddy/skills. Closes #2490.

Problem and expected behavior

CodeBuddy reads a standard mcpServers JSON file at ~/.codebuddy/mcp.json, but it was absent from SUPPORTED_CLIENT_DEFINITIONS, so CodeBuddy users had to hand-edit that file and rea setup/doctor/uninstall could not manage the registration. Expected behavior now: setup upserts mcpServers.rea (stdio command) while preserving unrelated servers and top-level keys; client detection uses the ~/.codebuddy directory as its marker; uninstall removes only the rea entry.

Change and scope

  • New codebuddy entry in SUPPORTED_CLIENT_DEFINITIONS mirroring the Cursor json-dialect entry plus a skillPath (.codebuddy/skills). The --client allowlist, detection, registration, uninstall, and the generated product catalog all derive from this array, so no CLI or registration-logic changes were needed.
  • Docs: supported-agents table row in docs/installation.md; a CodeBuddy section in docs/client-configuration.md.
  • Tests: new tests/boundary/filesystem/codebuddyClientConfiguration.test.ts mirroring the Trae client tests; detection list in clientLifecycle.test.ts extended.

Follow the contribution scope: not applicable — an ordinary setup-client addition within existing boundaries; no new provider and no capability involving target execution, injection, mutation, or protection recovery.

Contract and boundary impact

  • Semantic owner and earliest changed stage: setup / client registration (application layer).
  • Contribution scope fit and linked maintainer decision: not applicable (ordinary setup-client addition; feature request #2490 linked).
  • CLI and MCP/tool-catalog contract: new accepted --client codebuddy value; docs/public/product-catalog.json setup_clients gains codebuddy (generated and CI-validated; not committed).
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: regenerated locally to validate (node scripts/generate-product-catalog.mjs); the file is gitignored and CI-generated.

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.

Setup itself writes only the user's local CodeBuddy configuration file on explicit request; no analyzed-target interaction is introduced.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/codebuddyClientConfiguration.test.ts (new; per-platform path resolution, json format, personal skill directory, upsert preserving unrelated servers, registration into an existing config without servers, registration into an empty file, uninstall removing only rea); tests/boundary/filesystem/clientLifecycle.test.ts detection list extended with codebuddy.
  • Base reproduction or other evidence: before the change, supportedClients(home) returned no codebuddy client and --client codebuddy failed CLI validation.
  • User-visible CLI/MCP output: end-to-end run against an isolated HOME with node scripts/rea.mjs setup --client codebuddy --skill-client codebuddy --yes:
    plannedActions[2]:
      configure_client:codebuddy — target: <home>/.codebuddy/mcp.json
      install_skill:codebuddy    — target: <home>/.codebuddy/skills/reverse-engineer-anything
    appliedActions[2]: configured_codebuddy, installed_skill
    clients:
      codebuddy:
        status: configured
    
    resulting <home>/.codebuddy/mcp.json (the registered command reflects the entrypoint that launched setup — the local checkout in this run, npx -y rea-agents@latest mcp from a published install):
    {
      "mcpServers": {
        "rea": { "command": "<rea entrypoint>", "args": ["mcp"] }
      }
    }
    
  • Remaining proof gaps: none known. Verified by the author in the real CodeBuddy client: the registration loads, the bundled skill is discovered, and real REA tool calls execute through the registered server (recorded in docs/client-configuration.md, commit 7ae8b1189).

For evidence-bearing changes: not applicable — this change produces no analysis evidence or artifacts.

Validation performed

  • npm run typecheck — passed
  • npx vitest run tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/codebuddyClientConfiguration.test.ts tests/boundary/filesystem/productCatalog.test.ts — 71/71 tests passed
  • node scripts/check-doc-facts.mjs — no issues
  • node scripts/generate-product-catalog.mjs --check — generated catalog matches source definitions
  • npx oxfmt --check on the five changed files — all formatted
  • npx oxlint on the changed source/test files — no new findings (pre-existing max-lines warning in SupportedClients.ts unchanged)
  • npm run build:cached — build succeeded; isolated-HOME setup --client codebuddy --skill-client codebuddy --yes run configured the client and installed the skill as shown above
  • Real-client verification by the author: CodeBuddy loaded the registration and the skill, and real REA tool calls ran successfully (7ae8b1189)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none beyond the generated (gitignored) product catalog gaining the codebuddy setup client; documentation updated.
  • Security, privacy, process, or containment review: no target-facing behavior; setup writes only the local CodeBuddy configuration file when requested.

Author readiness

Human owner: @cainiao1992

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

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. (Not applicable: ordinary setup-client addition; no new provider or target-interacting capability.)
  • 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. (#2490)
  • 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/2492 **Author:** [@cainiao1992](https://github.com/cainiao1992) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/codebuddy-setup-client` --- ### 📝 Commits (1) - [`9505450`](https://github.com/morluto/rea/commit/950545033661bd99201cc90b44e499d80001c352) feat(setup): support CodeBuddy as a setup client ### 📊 Changes **5 files changed** (+170 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/client-configuration.md` (+12 -0) 📝 `docs/installation.md` (+1 -0) 📝 `src/application/SupportedClients.ts` (+8 -0) 📝 `tests/boundary/filesystem/clientLifecycle.test.ts` (+1 -0) ➕ `tests/boundary/filesystem/codebuddyClientConfiguration.test.ts` (+148 -0) </details> ### 📄 Description ## Summary Adds CodeBuddy as a supported setup client. `rea setup --client codebuddy` (and auto-detection when `~/.codebuddy` exists) now registers REA's local MCP server in the global `~/.codebuddy/mcp.json` and installs the bundled skill under `~/.codebuddy/skills`. Closes #2490. ## Problem and expected behavior CodeBuddy reads a standard `mcpServers` JSON file at `~/.codebuddy/mcp.json`, but it was absent from `SUPPORTED_CLIENT_DEFINITIONS`, so CodeBuddy users had to hand-edit that file and `rea setup`/`doctor`/`uninstall` could not manage the registration. Expected behavior now: setup upserts `mcpServers.rea` (stdio command) while preserving unrelated servers and top-level keys; client detection uses the `~/.codebuddy` directory as its marker; uninstall removes only the `rea` entry. ## Change and scope - New `codebuddy` entry in `SUPPORTED_CLIENT_DEFINITIONS` mirroring the Cursor `json`-dialect entry plus a `skillPath` (`.codebuddy/skills`). The `--client` allowlist, detection, registration, uninstall, and the generated product catalog all derive from this array, so no CLI or registration-logic changes were needed. - Docs: supported-agents table row in `docs/installation.md`; a CodeBuddy section in `docs/client-configuration.md`. - Tests: new `tests/boundary/filesystem/codebuddyClientConfiguration.test.ts` mirroring the Trae client tests; detection list in `clientLifecycle.test.ts` extended. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope): not applicable — an ordinary setup-client addition within existing boundaries; no new provider and no capability involving target execution, injection, mutation, or protection recovery. ## Contract and boundary impact - Semantic owner and earliest changed stage: setup / client registration (application layer). - Contribution scope fit and linked maintainer decision: not applicable (ordinary setup-client addition; feature request #2490 linked). - CLI and MCP/tool-catalog contract: new accepted `--client codebuddy` value; `docs/public/product-catalog.json` `setup_clients` gains `codebuddy` (generated and CI-validated; not committed). - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: regenerated locally to validate (`node scripts/generate-product-catalog.mjs`); the file is gitignored and CI-generated. 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. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. Setup itself writes only the user's local CodeBuddy configuration file on explicit request; no analyzed-target interaction is introduced. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/filesystem/codebuddyClientConfiguration.test.ts` (new; per-platform path resolution, `json` format, personal skill directory, upsert preserving unrelated servers, registration into an existing config without servers, registration into an empty file, uninstall removing only `rea`); `tests/boundary/filesystem/clientLifecycle.test.ts` detection list extended with `codebuddy`. - Base reproduction or other evidence: before the change, `supportedClients(home)` returned no `codebuddy` client and `--client codebuddy` failed CLI validation. - User-visible CLI/MCP output: end-to-end run against an isolated HOME with `node scripts/rea.mjs setup --client codebuddy --skill-client codebuddy --yes`: ``` plannedActions[2]: configure_client:codebuddy — target: <home>/.codebuddy/mcp.json install_skill:codebuddy — target: <home>/.codebuddy/skills/reverse-engineer-anything appliedActions[2]: configured_codebuddy, installed_skill clients: codebuddy: status: configured ``` resulting `<home>/.codebuddy/mcp.json` (the registered `command` reflects the entrypoint that launched setup — the local checkout in this run, `npx -y rea-agents@latest mcp` from a published install): ```json { "mcpServers": { "rea": { "command": "<rea entrypoint>", "args": ["mcp"] } } } ``` - Remaining proof gaps: none known. Verified by the author in the real CodeBuddy client: the registration loads, the bundled skill is discovered, and real REA tool calls execute through the registered server (recorded in `docs/client-configuration.md`, commit 7ae8b1189). For evidence-bearing changes: not applicable — this change produces no analysis evidence or artifacts. ## Validation performed - `npm run typecheck` — passed - `npx vitest run tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/codebuddyClientConfiguration.test.ts tests/boundary/filesystem/productCatalog.test.ts` — 71/71 tests passed - `node scripts/check-doc-facts.mjs` — no issues - `node scripts/generate-product-catalog.mjs --check` — generated catalog matches source definitions - `npx oxfmt --check` on the five changed files — all formatted - `npx oxlint` on the changed source/test files — no new findings (pre-existing `max-lines` warning in `SupportedClients.ts` unchanged) - `npm run build:cached` — build succeeded; isolated-HOME `setup --client codebuddy --skill-client codebuddy --yes` run configured the client and installed the skill as shown above - Real-client verification by the author: CodeBuddy loaded the registration and the skill, and real REA tool calls ran successfully (7ae8b1189) ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none beyond the generated (gitignored) product catalog gaining the `codebuddy` setup client; documentation updated. - Security, privacy, process, or containment review: no target-facing behavior; setup writes only the local CodeBuddy configuration file when requested. ## Author readiness Human owner: @cainiao1992 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## 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. (Not applicable: ordinary setup-client addition; no new provider or target-interacting capability.) - [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. (#2490) - [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>
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#5270
No description provided.