Skip to content

feat(harness): add OpenClaw, Kimi, Grok, Cursor, and OpenCode user profiles - #467

Merged
solomonneas merged 1 commit into
mainfrom
feat/issue-438-user-scope-harness-slice2
Jul 23, 2026
Merged

feat(harness): add OpenClaw, Kimi, Grok, Cursor, and OpenCode user profiles#467
solomonneas merged 1 commit into
mainfrom
feat/issue-438-user-scope-harness-slice2

Conversation

@solomonneas

Copy link
Copy Markdown
Collaborator

Summary

Slice 2 of #438, based on latest main and built on the slice-1 profile layer merged in #465. Adds the five remaining user-scope harness adapters behind the same contract and closes #438.

Harness Instructions Skills MCP
OpenClaw marked block in canonical workspace ~/.openclaw/workspace/AGENTS.md ~/.openclaw/skills existing openclaw adapter
Kimi Code AGENTS.md under probed root skills/ under probed root new kimi-user adapter (mcpServers JSON), probed path
Grok CLI ~/.grok/AGENTS.md ~/.grok/skills existing grok-user adapter
Cursor managed plugin/rule/hook (reuses cursor_user_cmd builders) ~/.cursor/skills existing cursor-user adapter
OpenCode ~/.config/opencode/AGENTS.md ~/.config/opencode/skills new opencode-user adapter (global config, top key mcp)

Design notes

  • The shared profile engine is reused, not forked. It gains two additive surfaces on top of the schema-v2 state sections reserved in slice 1: whole-file generated artifacts (digest-owned, prune-on-uninstall) and a single managed entry inside a co-owned JSON hook config.
  • Cursor instructions are not a plain marked block: the managed brigade-loop.mdc rule uses whole-file ownership so its alwaysApply frontmatter stays at the top of the file; plugin.json and the session-start hook script are generated artifacts; hooks.json keeps exactly one managed sessionStart entry and preserves foreign entries.
  • Kimi paths are version-sensitive: a capability probe selects ~/.kimi when it exists and falls back to ~/.kimi-code; the profile carries the probed MCP path instead of blindly copying the static adapter path.
  • _server_targets_harness aliases grok/kimi/opencode to their *-user adapters, matching the existing cursor/cursor-user alias. Slice-1 Claude/Codex behavior is unchanged (slice-1 suites pass unmodified except the two --target all assertions, which now expect seven profiles).
  • Legacy cursor_user_cmd state (version 1) and profile state (schema_version 2) share ~/.cursor/brigade/install-state.json; each refuses the other's schema as a conflict, so they never clobber each other.

Contract honored per harness

  • Dry-run default; --write required to touch disk.
  • Only Brigade-owned files/marked blocks are written; hand-authored user instruction sections survive sync (tested for the four AGENTS.md harnesses; foreign Cursor hook entries and foreign MCP servers survive too).
  • Idempotent: second sync writes nothing (no state/receipt churn).
  • Uninstall removes exactly the Brigade-owned artifacts via the receipt model, including prune of created directories.
  • doctor reports drift/conflicts read-only.
  • --target all now covers all seven harnesses (Pi keeps its own bridge).

Tests

New tests/test_harness_user_scope_slice2.py (48 cases) drives everything through a temp HOME/tmp_path: dry-run vs --write, existing-config preservation, idempotent re-sync, uninstall-only-owned, doctor drift, Kimi probe selection, Kimi MCP foreign-key round-trip, Cursor managed-surface + conflict handling, stdio gate, and MCP uninstall per harness. No test touches the real ~/.openclaw, ~/.kimi-code, ~/.grok, ~/.cursor, or ~/.config/opencode.

Verification (brigade-wired)

brigade work verify run --target . --command "pytest -q tests/test_harness_user_scope.py tests/test_harness_user_scope_slice2.py tests/test_harness_profile_cmd.py" --capture brigade-work
# status: completed — exit=0 (90 passed)

brigade work verify run --target . --command "./scripts/verify" --capture brigade-work
# status: completed — exit=0
# ruff: All checks passed! / 532 files already formatted
# mypy: Success: no issues found in 318 source files
# version=0.25.1 checked=13 locations; managed snapshot: ok (6 manifests)
# 4182 passed, 3 skipped in 382.24s

Closes #438

…ofiles

Extend the slice-1 user-scope profile layer (#465) with the five
remaining issue #438 harnesses behind the same sync/doctor/uninstall
contract: dry-run default, receipt-based ownership, idempotent sync,
and uninstall that removes only Brigade-owned artifacts.

- OpenClaw: marked block in the canonical workspace AGENTS.md,
  ~/.openclaw/skills, existing openclaw MCP adapter.
- Kimi Code: capability probe selects ~/.kimi over ~/.kimi-code, with
  the profile carrying the probed MCP path; new kimi-user adapter
  (mcpServers JSON) round-trips foreign keys.
- Grok CLI: ~/.grok AGENTS.md + skills, existing grok-user adapter.
- Cursor: instructions ride the managed plugin/rule/hook surface from
  cursor_user_cmd (whole-file managed rule + generated plugin/hook
  artifacts + one managed hooks.json sessionStart entry), existing
  cursor-user adapter.
- OpenCode: ~/.config/opencode AGENTS.md + skills, new opencode-user
  adapter for the global config.

The profile engine gains generated-file and co-owned hook planning on
top of the pre-reserved state section; slice-1 Claude/Codex behavior is
unchanged. --target all now covers all seven harnesses.

Closes #438

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: be8fc77a-2ea9-42b3-ab14-b5bc01874455

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-438-user-scope-harness-slice2

Comment @coderabbitai help to get the list of available commands.

@solomonneas
solomonneas merged commit 0941c3e into main Jul 23, 2026
28 checks passed
@solomonneas solomonneas self-assigned this Jul 23, 2026
@solomonneas
solomonneas deleted the feat/issue-438-user-scope-harness-slice2 branch July 26, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add user-scope harness parity for skills, routing instructions, and MCP

1 participant