feat(integrations): add WorkBuddy integration - #1337
Conversation
Add a WorkBuddy hooks integration backed by a running PowerContext server: a UserPromptSubmit hook that recalls bounded prepared context and captures user prompts as Sources, a Streamable HTTP MCP registration, and the project-context Skill for Memory and Handoff workflows. Also documents the manual installation in integrations/workbuddy/README.md and docs (en/zh), and lists WorkBuddy in the README integration tables.
|
ci failed |
done |
Teingi
left a comment
There was a problem hiding this comment.
Reviewed current head 510ee022; the inline findings below still reproduce.
| entry: dict[str, Any] = { | ||
| "type": "http", | ||
| "url": WORKBUDDY_MCP_URL, | ||
| "headers": {}, |
There was a problem hiding this comment.
This always resets the PowerContext MCP entry to the loopback URL with no headers, even when the hook uses POWERCONTEXT_WORKBUDDY_SERVER_URL and POWERCONTEXT_WORKBUDDY_AUTHORIZATION. Re-running setup also overwrites an existing remote or authenticated MCP configuration, so authenticated servers lose all Memory and Handoff tools. WorkBuddy supports environment expansion in MCP URL and header values; please wire both transports to the same configuration and cover public and bearer-authenticated service chains.
|
|
||
| entry: dict[str, Any] = { | ||
| "type": "command", | ||
| "command": f"python3 {hooks_dir}/{WORKBUDDY_HOOK_DRIVER}", |
There was a problem hiding this comment.
The generated shell command is not quoted. A valid WorkBuddy home such as /Users/Jane Doe/.workbuddy is split at the space; I reproduced setup succeeding and the hook then failing because Python tries to open the path only up to the space. Hard-coding python3 is also not portable across Windows installs. Please resolve a supported interpreter and quote the script path (or install a wrapper), with a path-containing-spaces and Windows regression test.
| MCP remains available for explicit Memory maintenance and the inspected Handoff | ||
| lifecycle when the Server is reachable. | ||
|
|
||
| See [`integrations/workbuddy/README.md`](../README.md) for installation steps |
There was a problem hiding this comment.
Both relative links here are broken from this file: ../README.md resolves to integrations/workbuddy/plugins/README.md, and the docs link resolves under integrations/docs/.... Please use ../../README.md and ../../../../docs/en/docs/how-to/configure-workbuddy.md.
| description: Install the PowerContext WorkBuddy hooks and control its local behavior. | ||
| --- | ||
|
|
||
| # Configure WorkBuddy |
There was a problem hiding this comment.
zensical.toml uses an explicit Integrations nav, but neither the English nor Chinese WorkBuddy page is registered, so users cannot discover these new guides from the docs site navigation. Please add both locale entries.
| @@ -91,6 +91,7 @@ PowerContext Server; the host integrations do not start or embed the Server. | |||
| <td align="center" width="120"><a href="docs/en/docs/how-to/configure-dsh.md"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48" /><br /><sub><b>DeepSeek Harness</b></sub></a></td> | |||
| <td align="center" width="120"><a href="integrations/hermes/README.md"><img src="https://github.com/NousResearch/hermes-agent/blob/main/website/static/img/logo.png?raw=true&size=120" alt="Hermes Agent" width="48" height="48" /><br /><sub><b>Hermes Agent</b></sub></a></td> | |||
There was a problem hiding this comment.
GitHub strips the src from this data:image/svg+xml value. I verified the exact pattern through GitHub GFM render API, which returns an <img> with no src, so the integration table shows a broken icon. Please commit an SVG or PNG asset and reference it with a repository-relative path.
Which issue or RFC does this PR close?
No issue or RFC. This PR adds a WorkBuddy integration following the existing
integrations/hermespattern, requested by a WorkBuddy user.Rationale for this change
WorkBuddy (Tencent) shares its engine with CodeBuddy CLI and supports hooks that
are nearly isomorphic to Claude Code's (UserPromptSubmit / PreToolUse /
SessionStart events; stdin JSON payload;
hookSpecificOutput.additionalContextinjection). PowerContext's core value — automatic memory recall on every prompt
and automatic prompt capture as Content Source evidence — requires that hook
layer; MCP tools alone cannot replace it. This PR makes the integration
officially supported, including a
powercontext setup workbuddyone-shotinstaller.
What changes are included in this PR?
integrations/workbuddy/README.md: integration overview and install steps(CLI installer plus a manual alternative).
integrations/workbuddy/plugins/powercontext/: plugin layout matching thehermes/codex conventions:
.mcp.json: HTTP MCP server template pointing athttp://127.0.0.1:8000/mcp.hooks/workbuddy_powercontext_hook.py: UserPromptSubmit hook that recallsprepared context via
/v1/context/prepareand injects it throughadditionalContext, and captures the prompt via/v1/sources/content;fail-open, loopback-only by default.
hooks/workbuddy_settings.py,hooks/prepared_context.py,scripts/project_scope.py: ported from the Claude Code plugin withPOWERCONTEXT_WORKBUDDY_*environment variables.hooks/hooks.workbuddy.json: WorkBuddy hooks config template.skills/project-context/SKILL.md: usage protocol for memory/handoff tools.README.md: plugin notes.src/powercontext/cli/workbuddy.py:powercontext setup workbuddyandpowercontext doctor workbuddy. The installer copies the hooks/scoperesolver, merges the hook into
~/.workbuddy/settings.jsonand the MCP serverinto
~/.workbuddy/mcp.json(preserving existing entries), installs theproject-contextSkill with placeholder substitution, writes atomically, androlls back snapshots on failure.
WORKBUDDY_HOMEoverrides the default~/.workbuddylocation (also used by tests).src/powercontext/cli/system.py:SetupErrorfactories and thesetup workbuddy/doctor workbuddysubcommands.tests/test_cli_workbuddy.py: installer behavior (merge preserves existingfields, idempotency, rollback, diagnostics, no
__pycache__copy).docs/zh/docs/how-to/configure-workbuddy.mdanddocs/en/docs/how-to/configure-workbuddy.md: CLI and manual install,behavior, configuration (env vars), authentication, scope resolution, failure
behavior, diagnostics.
README.md,README_CN.md,README_JP.md: integration table entries forWorkBuddy.
Are there any user-facing changes?
Yes (additive only): a new supported integration with a one-shot installer. No
breaking changes to public APIs or persisted formats.
How was this change tested?
ruff checkandruff format --checkon all added files — pass.ty check(full repo) — pass.pytest tests/test_cli_workbuddy.py— 9 passed (plus the existing CLI suite).in a temp
WORKBUDDY_HOME; hook behavior (recall/additionalContext, capture,fail-open, loopback-only) against a running local server; MCP initialize
handshake.
grep -rn "/Users/alex" integrations/workbuddy/and new docs: 0 hits — nomachine-specific paths remain (placeholders documented).
AI usage statement
AI tools (CodeBuddy/WorkBuddy software team with model assistance) were used to
author, review, and validate this change.