Skip to content

feat: [ENG-2697] rewrite ByteRover skill — sub-skill split + Hermes connector#675

Merged
cuongdo-byterover merged 15 commits into
proj/byterover-tool-modefrom
feat/ENG-2697
May 27, 2026
Merged

feat: [ENG-2697] rewrite ByteRover skill — sub-skill split + Hermes connector#675
cuongdo-byterover merged 15 commits into
proj/byterover-tool-modefrom
feat/ENG-2697

Conversation

@DatPham-6996
Copy link
Copy Markdown
Collaborator

Summary

  • Problem: The ByteRover skill was a single 734-line SKILL.md with no
    progressive disclosure, and autonomous agents (OpenClaw, and now Hermes)
    had no reliable way to always load the ByteRover memory contract into their
    system prompt. Hub install also hardcoded scope: 'project', which threw
    "does not support project scope" for global-only skill agents.
  • Why it matters: Following the Superpowers skill model (visible workflow,
    focused sub-skills, predictable folder structure) makes the skill easier
    for agents to navigate and keeps the always-on memory rule in front of
    autonomous agents without bloating every invocation.
  • What changed:
    • Split SKILL.md into a thin entrypoint plus focused sub-skills
      (query/curate/review/swarm/vc/history/troubleshooting.md);
      SKILL_FILE_NAMES enumerates the full managed set and status/uninstall
      key off it.
    • Added the Hermes agent (skill + mcp), connector icon, and a YAML MCP
      config writer; McpConfigFormat now supports 'yaml'
      (~/.hermes/config.yaml).
    • Added managed BYTEROVER RULES block injection into Hermes/OpenClaw
      system-prompt files via autonomous-agent-attachments.ts +
      upsert/remove/hasByteroverBlock (idempotent re-install; stale/missing
      block reported as not-installed).
    • Added shared agent-path-resolver / skill-path-resolver honoring
      HERMES_HOME / OPENCLAW_STATE_DIR / OPENCLAW_CONFIG_PATH and
      per-agent globalRoot; OpenClaw skills moved to the openclaw-state root.
    • Hub install no longer hardcodes project scope; the daemon infers the
      per-agent default (global for global-only skill agents); writeSkillFiles
      takes object params with idempotent per-file existence checks.
  • What did NOT change (scope boundary): No changes to curate/query execution,
    context-tree storage, billing, or the transport schema beyond the existing
    hub-install scope being optional. Existing home/project-rooted agents
    (Claude, Cursor, etc.) keep their current paths and behavior.

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Test
  • Chore (build, dependencies, CI)

Scope (select all touched areas)

  • TUI / REPL
  • Agent / Tools
  • LLM Providers
  • Server / Daemon
  • Shared (constants, types, transport events)
  • CLI Commands (oclif)
  • Hub / Connectors
  • Cloud Sync
  • CI/CD / Infra

Linked issues

  • Closes ENG-2697 (Linear: "Rewrite ByteRover skill based on Superpowers skill")
  • Related #

Root cause (bug fixes only, otherwise write N/A)

  • Root cause: N/A
  • Why this was not caught earlier: N/A

Test plan

  • Coverage added:
    • Unit test
    • Integration test
    • Manual verification only
  • Test file(s):
    • test/unit/infra/connectors/mcp/yaml-mcp-config-writer.test.ts
    • test/unit/infra/connectors/shared/agent-path-resolver.test.ts
    • test/unit/infra/connectors/connector-manager-attachment.test.ts
    • test/unit/infra/connectors/shared/rule-segment-patcher.test.ts
    • test/unit/infra/connectors/skill/skill-connector.test.ts
    • test/unit/infra/connectors/mcp/mcp-connector.test.ts
    • test/commands/hub-install-scope.test.ts
    • test/unit/infra/hub/hub-handler.test.ts
    • test/unit/infra/hub/hub-install-service.test.ts
  • Key scenario(s) covered: YAML MCP config emission; env-override path
    resolution for Hermes/OpenClaw; autonomous-block upsert/remove/has
    (idempotency + stale-block detection); per-agent default scope inference
    in hub install; skill connector install/status/uninstall with attachment
    block; object-param writeSkillFiles idempotent file checks.

User-visible changes

  • New Hermes agent selectable in hub install and the WebUI connectors panel
    (with icon).
  • brv hub install no longer defaults --scope to project; the daemon
    infers the default per agent (global-only agents like Hermes/OpenClaw
    install globally without erroring).
  • Installing the ByteRover skill for Hermes/OpenClaw now also writes/removes
    a managed BYTEROVER RULES block in their system-prompt files.
  • Skill install now creates multiple sub-skill files instead of a single
    SKILL.md; re-install refreshes (no longer short-circuits as "already
    installed").

Evidence

Attach at least one:

  • Failing test/log before + passing after (new unit suites listed above)
  • Trace/log snippets
  • Screenshot/recording

Checklist

  • Tests added or updated and passing (npm test)
  • Lint passes (npm run lint)
  • Type check passes (npm run typecheck)
  • Build succeeds (npm run build)
  • Commits follow Conventional Commits format
  • Documentation updated (if applicable) — skill templates are the docs
  • No breaking changes (or clearly documented above)
  • Branch is up to date with main

Risks and mitigations

  • Risk: Writing/removing the managed block in autonomous-agent system-prompt
    files could clobber user content.
    • Mitigation: Edits are confined to <!-- BEGIN/END BYTEROVER RULES -->
      markers; upsert replaces only the bounded block and preserves surrounding
      content; removal rejoins cleanly. Covered by rule-segment-patcher tests.
  • Risk: Per-agent default scope inference changes hub-install behavior for
    callers that previously relied on the project default.
    • Mitigation: Explicit --scope / data.scope still wins; default only
      flips to global for agents with no project skill path. Covered by
      hub-install-scope and hub-handler tests.
  • Risk: New env-driven path resolution (HERMES_HOME, OPENCLAW_STATE_DIR,
    OPENCLAW_CONFIG_PATH) could resolve unexpected locations.
    • Mitigation: Resolver mirrors OpenClaw's own resolution semantics and is
      unit-tested with injected env/home.

DatPham-6996 and others added 3 commits May 15, 2026 07:25
feat: [ENG-2840] Update SKILL.md to force "brv swarm query" to run si…
…nnector

Rewrite the ByteRover skill on the Superpowers model: a thin SKILL.md
entrypoint with progressive disclosure into focused sub-skill files,
plus first-class support for autonomous agents.

- Skill: split monolithic SKILL.md into query/curate/review/swarm/vc/
  history/troubleshooting.md; SKILL_FILE_NAMES enumerates all managed
  files and status/uninstall key off the full set
- Hermes: add Hermes agent (skill + mcp), connector icon, and YAML MCP
  config writer; McpConfigFormat now supports 'yaml' (~/.hermes/config.yaml)
- Autonomous attachments: write a managed BYTEROVER RULES block into
  Hermes/OpenClaw system-prompt files via autonomous-agent-attachments
  and upsert/remove/hasByteroverBlock; idempotent re-install, status
  reports stale/missing blocks as not-installed
- Path resolution: shared agent-path-resolver + skill-path-resolver
  honor HERMES_HOME / OPENCLAW_STATE_DIR / OPENCLAW_CONFIG_PATH and
  per-agent globalRoot; OpenClaw skills move to openclaw-state root
- Hub: drop hardcoded project scope; daemon infers per-agent default
  (global for global-only skill agents); writeSkillFiles takes object
  params with idempotent per-file existence checks
- Tests: cover yaml writer, agent-path-resolver, attachment manager,
  rule-segment-patcher block ops, hub install scope, skill connector

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Claude finished @DatPham-6996's task in 6m 55s —— View job


Claude PR Review — Summary

Overall score: 4 / 5 — solid, well-tested feature work with a clean architectural split. A few concrete safety and consistency issues (mostly in connector edges, none blocking for the core skill split). See inline comments for specifics.

What this PR does well

  • Outside-In: the SKILL.md split is driven by what an autonomous agent actually consumes; SKILL_FILE_NAMES makes the managed set the single source of truth, and status/uninstall correctly key off it.
  • Idempotent block management: upsertByteroverBlock / removeByteroverBlock / hasByteroverBlock are well-factored, with the stale-block-as-not-installed semantics that let same-target re-install act as a repair tool. Excellent test coverage in rule-segment-patcher.test.ts and the new connector-manager-attachment.test.ts.
  • OpenClaw faithfulness: agent-path-resolver mirrors OpenClaw's resolveHomeRelativePath / resolveDefaultAgentWorkspaceDir semantics (cwd-relative for bare relative paths, home-based default workspace, no STATE_DIR mixing for the default workspace) and is unit-tested against each edge.
  • Scope inference: defaultScopeForAgent cleanly removes the "global-only agents throw on default install" footgun. Explicit --scope still wins. Good test in hub-install-scope.test.ts and hub-handler.test.ts.

Issues (inline)

  1. src/server/templates/skill/*.md — hardcoded workdir="~/.hermes/byterover/" in 7 sub-skill templates does not follow HERMES_HOME, despite everything else in this PR doing so. Either parameterize at install time or document the decoupling. Most important issue.
  2. yaml-mcp-config-writer.ts:88-101write() silently resets to {} on parse failure of an existing config, which can destroy a user's hand-edited Hermes config. Contradicts the connector's "Non-destructive" docstring guarantee. Suggest backup-or-refuse on invalid YAML.
  3. skill-connector.ts:install — re-install overwrites all sub-skill files unconditionally. Documented behavior, but easy way to lose user edits silently; consider per-file existence checks (matches writeSkillFiles pattern) or a "do not edit" header in generated files.
  4. constants.tsBYTEROVER_BLOCK_MARKERS and BRV_RULE_MARKERS are byte-identical; safe today only because target paths don't overlap. Worth an explicit invariant comment or distinct markers.
  5. hub-handler.ts:defaultScopeForAgentas Record<...> widening cast violates CLAUDE.md's "Avoid as Type assertions"; type-guard refactor in inline.

Nitpicks (inline)

  • SKILL_FILE_NAMES[0] magic indexing in two places — use the exported MAIN_SKILL_FILE_NAME instead.
  • autonomous-agent-attachments.ts:74 — parsing openclaw.json with yamlLoad works but obscures intent; either JSON.parse or document the YAML-superset choice.
  • agent-path-resolver.ts:resolveUserPath — does not handle Windows ~\foo (the OpenClaw-side resolver does); minor cross-platform gap.
  • mcp-connector-config.ts:204 — Hermes configPathResolver doesn't take options; ok for now, asymmetric with Skill connector's pathResolverOptions() plumbing.
  • autonomous-agent-attachments.ts:INVALID_OPENCLAW_ID_CHARS_REg flag is load-bearing for replaceAll; a comment would prevent a future "tidying" regression.

Test coverage

TDD ledger looks healthy:

  • New unit suites: yaml-mcp-config-writer.test.ts (~252 LOC), agent-path-resolver.test.ts, rule-segment-patcher block-mgmt cases, connector-manager-attachment.test.ts, hub-install-scope.test.ts, hub-handler.test.ts scope-inference cases.
  • skill-connector.test.ts expanded with stale-block repair, OpenClaw workspace resolution permutations, Hermes SOUL.md round-trip — covers the trickiest paths.
  • No integration tests added; given the file-system-heavy nature of these helpers and the existing tmpdir()-based unit tests, this is acceptable.

Final checklist

  • Read the PR diff against origin/proj/byterover-tool-mode
  • Review skill connector + sub-skill template changes
  • Review autonomous-agent attachment block (rule-segment-patcher)
  • Review YAML MCP config writer + Hermes wiring
  • Review agent-path-resolver / skill-path-resolver
  • Review hub-install per-agent default scope inference
  • Inline-comment specific issues (9 buffered)
  • Post summary with overall score
    branch feat/ENG-2697

Comment thread src/server/templates/skill/curate.md
Comment thread src/server/infra/transport/handlers/hub-handler.ts
Comment thread src/server/infra/connectors/skill/autonomous-agent-attachments.ts
Comment thread src/server/infra/connectors/shared/constants.ts
Comment thread src/server/infra/connectors/skill/skill-connector.ts
Comment thread src/server/infra/connectors/skill/autonomous-agent-attachments.ts
Comment thread src/server/infra/connectors/shared/agent-path-resolver.ts
Comment thread src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts
Comment thread src/server/infra/connectors/mcp/mcp-connector-config.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Claude finished @DatPham-6996's task in 3m 48s —— View job


Claude PR Review — re-review after sync

Overall score: 4 / 5 — the architectural split and idempotent-block design remain strong; this sync commit was a bulk pull of main v3.14.0 plus a merge — no substantive new feature changes were added to address the prior review. Most of the previously-flagged items are still open in HEAD. Re-flagging the load-bearing ones below.

Since last review (2026-05-18)

  • 8797880 chore: sync main v3.14.0 — bulk reconciliation from main, no targeted fixes to the connector/skill files reviewed previously.
  • 090a942 Merge remote-tracking branch 'origin/proj/byterover-tool-mode' into feat/ENG-2697 — merge only.
  • One template did get scrubbed: the hardcoded workdir="~/.hermes/byterover/" is now in 2 of 7 sub-skill files (curate.md:12, query.md:10) instead of all 7. Net improvement, but still hardcoded.

Status of prior-review findings against current HEAD

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME src/server/templates/skill/curate.md:12, query.md:10 Partially addressed (7→2 files); still hardcoded, double-space typo (at ) still in curate.md:12
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Not addressed — still fail-open destructive on invalid YAML
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Not addressed — still uses 'overwrite'. writeSkillFiles keeps its safer per-file existence check, but install does not
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS (byte-identical) src/server/infra/connectors/shared/constants.ts:22-29 Addressed via documentation — docstring now explains the rationale; markers still identical
defaultScopeForAgent uses as Record<...> widening cast src/server/infra/transport/handlers/hub-handler.ts:95 Not addressed — still violates CLAUDE.md "Avoid as Type assertions"
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 Not addressed~/ only; resolveOpenClawUserPath (l.70) correctly handles both via /^~[\\/]/u — asymmetric
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Not addressed — still () => path.join(resolveHermesHome(), …) with no options
openclaw.json parsed with yamlLoad (intent obscured) src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Not addressed
SKILL_FILE_NAMES[0] magic indexing src/server/infra/connectors/skill/skill-connector.ts:255, 274 Partially addressedMAIN_SKILL_FILE_NAME is now used at line 123 in install(), but uninstall still uses SKILL_FILE_NAMES[0] at lines 255/274
INVALID_OPENCLAW_ID_CHARS_RE g flag intent src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Not addressed — no clarifying comment

Issues (re-flagged in priority order)

  1. yaml-mcp-config-writer.ts:88-101 — silent data destruction on invalid YAML. write() still falls through to data = {} on parse failure and overwrites the entire file with just {mcp_servers: {brv: ...}}. The connector's own header docstring calls itself "Non-destructive" — this still contradicts that claim. IFileService.createBackup exists; suggest backing up or refusing to write on parse failure. Same destructive path runs for both brv hub install --agent Hermes and brv connectors install. Fix this →

  2. skill-connector.ts:126-132 — re-install overwrites user-edited sub-skill files unconditionally. The PR description says re-install "refreshes (no longer short-circuits)" — that is intended, but it silently clobbers query.md/curate.md/etc. and still returns success: true, alreadyInstalled: true with no signal. writeSkillFiles (l. 333-348) already shows the right pattern (per-file existence check). Either match that pattern in install(), gate the refresh behind --force, or add a "Do not edit — regenerated by brv hub install" header to generated files. Fix this →

  3. src/server/templates/skill/curate.md:12 & query.md:10workdir hardcoded, doesn't honor HERMES_HOME. Cleaned up from 7 files to 2, but the remaining two still encode ~/.hermes/byterover/ literally. If a Hermes user sets HERMES_HOME=/opt/hermes, the skill installs under /opt/hermes/skills/byterover/ (resolver honors it) but the template tells the agent to cd ~/.hermes/byterover/. Also: at (double space) in curate.md:12. Either parameterize at install time or reword as (default: ~/.hermes/byterover/, overridable via $HERMES_HOME). Fix this →

  4. hub-handler.ts:95as Type widening cast still violates CLAUDE.md. Same one-liner from the prior review still works:

    private defaultScopeForAgent(agent?: Agent): 'global' | 'project' {
      if (!agent) return 'project'
      if (!(agent in SKILL_CONNECTOR_CONFIGS)) return 'project'
      const config = SKILL_CONNECTOR_CONFIGS[agent as keyof typeof SKILL_CONNECTOR_CONFIGS]
      return config.projectPath ? 'project' : 'global'
    }

    Fix this →

Nitpicks (re-flagged)

  • agent-path-resolver.ts:29 — Windows backslash gap. resolveUserPath (used for Hermes) handles ~/ but not ~\; resolveOpenClawUserPath already handles both via /^~[\\/]/u. Trivial fix: value.startsWith('~/') || value.startsWith('~\\').
  • skill-connector.ts:255 & 274 — still uses SKILL_FILE_NAMES[0]; MAIN_SKILL_FILE_NAME is imported but only used at line 123.
  • mcp-connector-config.ts:205 — Hermes configPathResolver doesn't accept options; asymmetric with the Skill connector's injection seam, makes Hermes tests have to mutate process.env.
  • autonomous-agent-attachments.ts:22g flag on INVALID_OPENCLAW_ID_CHARS_RE is load-bearing for replaceAll; a comment would prevent a future "tidy" regression.
  • autonomous-agent-attachments.ts:83-84 — parsing openclaw.json with yamlLoad: works (YAML ⊃ JSON) but obscures intent.

Tests & build (unchanged from prior review)

  • New unit suites still healthy: yaml-mcp-config-writer.test.ts, agent-path-resolver.test.ts, rule-segment-patcher block-mgmt cases, connector-manager-attachment.test.ts, hub-install-scope.test.ts, hub-handler.test.ts scope-inference cases, plus the expanded skill-connector.test.ts (stale-block repair + HERMES_HOME paths + OpenClaw workspace permutations).
  • Gap: no new test covers (a) the YAML-parse-failure path in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). Adding those would have surfaced issues Feat/init #1 and Feat/refactor structure #2 above as red tests.

Checklist

  • Re-scan diff against origin/proj/byterover-tool-mode
  • Verify prior-review issues against HEAD (f5e92f5 + 8797880 + 090a942)
  • Re-read connector/skill template/path-resolver/hub-handler files
  • Check test coverage for any new fixes
  • Post re-review summary with score
    branch feat/ENG-2697

DatPham-6996 and others added 2 commits May 19, 2026 14:03
Add a post-curate self-review sub-skill and substantially strengthen the
curate authoring guide so saved topics are standalone explainers, not
changelogs.

- New src/server/templates/skill/curate-judgement.md: post-write
  self-review. After `brv curate` reports done, judge the stored,
  rendered topic against curate.md's Quality Bar with a hard cap of one
  enhancement pass (references the rubric instead of restating it to
  avoid drift).
- Register curate-judgement.md in SKILL_FILE_NAMES
  (skill-connector-config.ts) and reference it from SKILL.md (detail
  file list + command reference).
- curate.md: document the JSON envelope contract ({html, meta}
  replaces bare HTML on --response), add the four-dimension Quality
  Bar, decision-flow diagram, rationalizations/red-flags tables, a
  richer worked example exercising all dimensions, and a pre-send
  self-check; expand Required Preservation and Common Mistakes.
- Add unit coverage asserting curate-judgement.md installs as a lean
  self-review guide that points at the Quality Bar, `brv read`, and the
  one-pass --overwrite cap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Claude finished @DatPham-6996's task in 2m 31s —— View job


Claude PR Review — synchronize re-review

Overall score: 4 / 5 — the new curate-judgement sub-skill is a thoughtful, well-bounded addition (post-write self-review, hard one-pass cap, references the Quality Bar rather than restating it — avoids drift). It does not address any of the four open priority issues from the prior re-review, all of which are still present in HEAD.

Since last review (2026-05-19 03:03 UTC)

  • eafd498 feat: [ENG-2697] add curate-judgement sub-skill, harden curate guide — additive: new curate-judgement.md, expanded curate.md (JSON envelope contract, Quality Bar, decision flow, rationalizations/red-flags tables, worked example, pre-send self-check), registered in SKILL_FILE_NAMES, referenced from SKILL.md. Test coverage added for the new sub-skill install.
  • bdfdcd3 Merge branch 'feat/ENG-2697-variant' into feat/ENG-2697 — merge only.
  • No targeted fixes to the connector / template / path-resolver / hub-handler files flagged previously.

Notes on the new curate-judgement.md

  • Good design: the sub-skill references the Quality Bar in curate.md:25 rather than restating it, which is exactly the right call to avoid the two-source drift problem you'd otherwise hit on edits.
  • One-pass cap (curate-judgement.md:30, 34) is explicit and bounded — matches curate's own validation cap. Sensible.
  • Position-1 SKILL_FILE_NAMES invariant still holds (MAIN_SKILL_FILE_NAME is index 0; curate-judgement.md was inserted as index 3 in skill-connector-config.ts:133-143).

Status of prior-review findings against current HEAD

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME src/server/templates/skill/curate.md:12, query.md:10 Not addressed — still hardcoded in both; double-space typo (at ) still present in both
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Not addressed — still fail-open destructive on invalid YAML
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Not addressed — still uses 'overwrite' for every file; writeSkillFiles keeps its safer per-file existence check, but install does not
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation — docstring now states the invariant (legacy detection compat)
defaultScopeForAgent uses as Record<...> widening cast src/server/infra/transport/handlers/hub-handler.ts:95 Not addressed — still violates CLAUDE.md "Avoid as Type assertions"
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 Not addressed~/ only; resolveOpenClawUserPath (line 70-77) correctly handles both via /^~[\\/]/u — asymmetric
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Not addressed — still () => path.join(resolveHermesHome(), 'config.yaml') with no options
openclaw.json parsed with yamlLoad src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Not addressed
SKILL_FILE_NAMES[0] magic indexing in uninstall src/server/infra/connectors/skill/skill-connector.ts:255, 274 Not addressedinstall() uses MAIN_SKILL_FILE_NAME (line 123) but uninstall still uses SKILL_FILE_NAMES[0]
INVALID_OPENCLAW_ID_CHARS_RE g flag intent src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Not addressed — no clarifying comment

Re-flagged in priority order (carried forward, unchanged from prior review)

  1. yaml-mcp-config-writer.ts:88-101 — silent data destruction on invalid YAML. write() still falls through to data = {} on parse failure and overwrites the entire file with just {mcp_servers: {brv: ...}}. Contradicts the connector's own "Non-destructive" header docstring claim. Same destructive path runs for both brv hub install --agent Hermes and brv connectors install. Suggest backup-or-refuse on invalid YAML (IFileService.createBackup is available). Fix this →

  2. skill-connector.ts:126-132 — re-install overwrites user-edited sub-skill files unconditionally. Intended ("re-install refreshes"), but it silently clobbers query.md / curate.md / curate-judgement.md / etc. and still returns success: true, alreadyInstalled: true with no signal. With curate-judgement.md now in the managed set, this risk surface is wider — a user who tweaks their judgement guide loses it on next brv hub install. writeSkillFiles (lines 333-348) already shows the right pattern. Match it in install(), gate the refresh behind --force, or add a "Do not edit — regenerated by brv hub install" header to generated files. Fix this →

  3. src/server/templates/skill/curate.md:12 & query.md:10workdir hardcoded, doesn't honor HERMES_HOME. Skill install root + Hermes MCP config path both honor HERMES_HOME, but the skill content tells the agent to cd ~/.hermes/byterover/. For a Hermes user with HERMES_HOME=/opt/hermes, the skill is installed at /opt/hermes/skills/byterover/SKILL.md but the agent reads "run brv at ~/.hermes/byterover/" — pointing at the non-relocated home. Also still: at (double space) in both files. Either parameterize at install time or reword as (default: ~/.hermes/byterover/, overridable via $HERMES_HOME). Fix this →

  4. hub-handler.ts:93-98as Type widening cast still violates CLAUDE.md. Replace the Record<string, {projectPath: null | string}> cast with an agent in SKILL_CONNECTOR_CONFIGS type guard. Fix this →

Nitpicks (carried forward)

  • agent-path-resolver.ts:29 — Windows backslash gap. resolveUserPath (used for Hermes) handles ~/ but not ~\; resolveOpenClawUserPath (line 70) handles both. Trivial fix: value.startsWith('~/') || value.startsWith('~\\').
  • skill-connector.ts:255 & 274uninstall still uses SKILL_FILE_NAMES[0]; MAIN_SKILL_FILE_NAME is imported but only used at line 123. Easy follow-up to the partial fix already applied.
  • mcp-connector-config.ts:205 — Hermes configPathResolver doesn't accept options, so getConfigPath('Hermes') is not injectable in tests (forces process.env mutation in mcp-connector.test.ts:484). Asymmetric with the Skill connector's pathResolverOptions() plumbing.
  • autonomous-agent-attachments.ts:22g flag on INVALID_OPENCLAW_ID_CHARS_RE is load-bearing for replaceAll; a one-line comment would prevent a future "tidy" regression.
  • autonomous-agent-attachments.ts:83-84 — parsing openclaw.json with yamlLoad: works (YAML ⊃ JSON) but obscures intent.

Tests & build

  • New unit coverage in eafd498 for the curate-judgement.md install path looks healthy (asserts the file installs as a lean self-review guide that points at the Quality Bar, brv read, and the one-pass --overwrite cap).
  • Existing unit suites unchanged and still healthy.
  • Gap (same as prior review): no new test covers (a) the YAML-parse-failure path in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). Adding those would have surfaced issues Feat/init #1 and Feat/refactor structure #2 as red tests.

Todos

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Re-verify status of prior-review findings against current HEAD
  • Read key changed files (yaml-mcp-config-writer, skill-connector, hub-handler, agent-path-resolver, templates, curate-judgement)
  • Check whether any new commits since last review address open issues — they don't
  • Post final summary with overall score

branch feat/ENG-2697

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Claude finished @DatPham-6996's task in 3m 36s —— View job


Claude PR Review — synchronize re-review (4th pass)

Overall score: 4 / 5 — the architectural split, idempotent block management, and OpenClaw-faithful path resolution remain strong. This sync pulled proj/byterover-tool-mode (which itself pulled main) and added a new dream.md sub-skill, but none of the four open priority issues from the prior reviews have been addressed in HEAD. Re-flagging the unresolved items inline.

Since last review (2026-05-19 10:26 UTC)

  • bdfdcd3 Merge branch 'feat/ENG-2697-variant' into feat/ENG-2697 — merge only.
  • 0b98569 Merge branch 'main' into proj/byterover-tool-mode (via the base) — bulk reconciliation from main with conflicts in ai-sdk-content-generator.ts, oclif/commands/curate/index.ts, oclif/commands/query.ts, and the curate/query test files. Outside this PR's review scope.
  • 125d2fe Merge branch 'proj/byterover-tool-mode' into feat/ENG-2697 — the only substantive change vs prior review in scope: a new dream.md sub-skill (added to SKILL_FILE_NAMES, referenced from SKILL.md) covering the three-phase brv dream workflow. Self-contained, does not introduce a hardcoded workdir, no new issues.

No targeted fixes landed for the four open priority issues from the prior reviews.

Status of prior-review findings against current HEAD

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME src/server/templates/skill/curate.md:12, query.md:10 Not addressed — both files still hardcode the literal; double-space typo (at ) still present in both
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Not addressed — still fail-open destructive on invalid YAML
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Not addressed — still uses 'overwrite' for every file; with dream.md and curate-judgement.md now in the managed set the blast radius grew
defaultScopeForAgent uses widening type annotation src/server/infra/transport/handlers/hub-handler.ts:93-98 Not addressed — still violates CLAUDE.md "Avoid as Type assertions"
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 Not addressed~/ only; resolveOpenClawUserPath (l.64-77) correctly handles both
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Not addressed — still () => path.join(resolveHermesHome(), 'config.yaml') with no options
openclaw.json parsed with yamlLoad src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Not addressed
SKILL_FILE_NAMES[0] magic indexing in uninstall src/server/infra/connectors/skill/skill-connector.ts:255, 274 Not addressedinstall() uses MAIN_SKILL_FILE_NAME (l.123) but uninstall still indexes by position
INVALID_OPENCLAW_ID_CHARS_RE g flag intent src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Not addressed
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation

Re-flagged inline (priority order)

  1. yaml-mcp-config-writer.ts:88-101 — silent destruction of hand-edited Hermes config on invalid YAML. Top priority because it's the only one that can lose user content with no warning. See inline comment.
  2. skill-connector.ts:install() — re-install overwrites user-edited sub-skill files unconditionally and returns success: true with no signal. Surface area grew with dream.md and curate-judgement.md. See inline comment.
  3. curate.md:12 & query.md:10 — hardcoded workdir="~/.hermes/byterover/" does not honor HERMES_HOME; the skill on disk and the agent's instructions diverge for any Hermes user that relocates their home. See inline comment.
  4. hub-handler.ts:93-98 — widening type annotation that violates CLAUDE.md. One-liner type-guard fix in the inline comment. See inline comment.

Nitpicks (agent-path-resolver.ts:29 Windows backslash gap also re-flagged inline; the rest carry forward from prior reviews — uninstall magic indexing, Hermes configPathResolver non-injection, openclaw.json via yamlLoad, missing g-flag rationale comment).

Tests & build

  • Unit suites added since the prior review: curate-judgement.md install path (skill-connector.test.ts:expanded from eafd498). Healthy.
  • Persistent gap (3rd time flagged): no new test covers (a) the YAML-parse-failure path in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). Adding either of those would surface the corresponding priority issue as a red test, which is the cleanest way to drive the fix.

Notes on the new dream.md

  • Clean addition: matches the existing sub-skill voice, uses dream.md for the three-phase scan/finalize/undo workflow, references brv dream --help for flags rather than restating them.
  • Does not introduce a hardcoded workdir; the Hermes workdir issue remains confined to curate.md:12 + query.md:10.
  • Position-1 SKILL_FILE_NAMES invariant still holds (MAIN_SKILL_FILE_NAME is index 0).

Checklist

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Verify status of prior-review findings against current HEAD
  • Re-read key changed files (yaml-mcp-config-writer, skill-connector, hub-handler, agent-path-resolver, templates incl. new dream.md)
  • Post inline comments for the unresolved priority issues (4) + Windows-backslash nit
  • Post final summary with overall score
    branch feat/ENG-2697

Comment thread src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts
Comment thread src/server/infra/connectors/skill/skill-connector.ts
Comment thread src/server/templates/skill/curate.md
Comment thread src/server/infra/transport/handlers/hub-handler.ts
Comment thread src/server/infra/connectors/shared/agent-path-resolver.ts
Audited each sub-skill (excluding curate / query) against the actual
`brv <topic> --help` surface and patched the gaps:

- vc.md: added init, clone, config, checkout, merge, fetch, remote;
  added real examples for reset (was only mentioned as "avoid").
  Regrouped Quick Reference by workflow phase (Setup / Inspect /
  Stage+commit / Branch+checkout / Sync / Merge / Undo). Expanded
  Safety + Common Mistakes to cover missing-upstream, missing-config,
  and switching with dirty tree.
- swarm.md: added `brv swarm onboard` (interactive setup wizard) +
  a Setup section explaining when to use it.
- review.md: added the toggle subcommands (`brv review`,
  `--enable`, `--disable`) that the description verb already implied
  but the body missed entirely. Updated frontmatter to include
  enable/disable so the matcher fires on those prompts.
- history.md: surfaced the filter flags that were buried under
  `--help` — `--limit`, `--since`, `--before`, `--status`, `--tier`,
  `--last`, `--format narrative`. Regrouped Quick Reference into
  Curate / Query / Aggregate sections.
- troubleshooting.md: added recovery commands (`brv restart` for
  crash recovery, `brv logout` + `brv login` reset flow, `brv update`
  for stale-CLI mismatch) + `brv connectors` to Quick Diagnosis.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Claude finished @cuongdo-byterover's task in 2m 17s —— View job


Claude PR Review — synchronize re-review (5th pass)

Overall score: 4 / 5 — the architectural split, idempotent block management, and OpenClaw-faithful path resolution remain strong. The new commit since the prior review (f2bbbf3) is a thoughtful, scope-bounded audit of sub-skill command coverage and does not introduce new issues. None of the four open priority items from the prior reviews have been addressed in HEAD.

Since last review (2026-05-20 09:32 UTC)

  • f2bbbf3 fix: [ENG-2697] sub-skill gaps — missing brv commands + examples — only substantive change. Audits each sub-skill (excluding curate / query) against the real brv <topic> --help surface and patches gaps:
    • vc.md — adds init, clone, config, checkout, merge, fetch, remote; adds real reset examples; regroups Quick Reference by workflow phase (Setup / Inspect / Stage+commit / Branch+checkout / Sync / Merge / Undo). Expands Safety + Common Mistakes (missing-upstream, missing-config, dirty-tree switch).
    • swarm.md — adds brv swarm onboard + a Setup section.
    • review.md — adds the toggle subcommands (brv review, --enable, --disable); frontmatter description updated so the matcher fires on enable/disable prompts.
    • history.md — surfaces filter flags previously buried under --help (--limit, --since, --before, --status, --tier, --last, --format narrative); regroups Quick Reference into Curate / Query / Aggregate.
    • troubleshooting.md — adds recovery commands (brv restart, brv logout + brv login, brv update) + brv connectors to Quick Diagnosis.
  • No new tests in this commit — these are content-only edits to sub-skill markdown that are exercised by the existing skill-connector.test.ts install path (SKILL_FILE_NAMES already covers them).
  • This commit does not introduce any new hardcoded workdir references — those remain confined to curate.md:12 and query.md:10 (unchanged for 3 reviews now).

Status of prior-review priority findings against current HEAD

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME (+ double-space typo at ) src/server/templates/skill/curate.md:12, query.md:10 Still unaddressed
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Still unaddressed
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Still unaddressed (with dream.md and curate-judgement.md in the managed set + a richer vc.md/history.md/review.md/troubleshooting.md, the blast radius is wider)
defaultScopeForAgent uses Record<string, …> widening annotation src/server/infra/transport/handlers/hub-handler.ts:93-98 Still unaddressed
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 (nitpick) Still unaddressed
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation

The inline comments from the 4th-pass review (posted 2026-05-20 09:34 UTC) at yaml-mcp-config-writer.ts:101, skill-connector.ts:132, curate.md:12, hub-handler.ts:98, and agent-path-resolver.ts:29 remain the open action items. To avoid noise I'm not re-posting them inline — please refer to the existing inline threads for fix suggestions / "Fix this →" links.

Notes on f2bbbf3 (the only new commit)

The sub-skill audit is a nice piece of follow-up — verifying the skill content actually matches the CLI's --help surface is exactly the kind of consistency check that's easy to skip. A few small observations on the new content, none blocking:

  • vc.md — the new Setup section calls out brv vc config user.name "Your Name" as "required before first commit" without mentioning that brv vc init is project-scoped. If the user is in a worktree pointer (.brv/ as pointer file), brv vc init is the wrong operation — worth a one-liner. Not a regression from this commit.
  • review.md — the new frontmatter description ("enable/disable") will cause the matcher to fire on any prompt containing those words. Consider scoping to brv review enable/disable to avoid false positives from unrelated "enable / disable" mentions.
  • history.md--format narrative is documented; the YAML envelope --format json variant is not. Probably intentional (narrative is the agent-facing one), but worth confirming.

Tests & build

  • Existing unit suites unchanged. The new commit is content-only and exercised by the SKILL_FILE_NAMES install path in skill-connector.test.ts.
  • Persistent gap (4th time flagged): no test covers (a) the YAML-parse-failure branch in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). Adding either of those would surface the corresponding priority issue as a red test, which is the cleanest way to drive the fix.

Checklist

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Verify status of prior-review findings against current HEAD (f2bbbf3)
  • Re-read key changed files (yaml-mcp-config-writer, skill-connector, hub-handler, agent-path-resolver, templates incl. new sub-skill edits)
  • Check whether the new commit addresses any open issues — it doesn't (and isn't intended to; it's scoped to sub-skill content gaps)
  • Avoid re-posting inline comments already filed this morning; reference them from the summary instead
  • Post final summary with overall score
    branch feat/ENG-2697

@cuongdo-byterover cuongdo-byterover changed the title Feat/eng 2697 feat: [ENG-2697] ByteRover skill v2 (Superpowers pattern) + Hermes May 20, 2026
@cuongdo-byterover cuongdo-byterover changed the title feat: [ENG-2697] ByteRover skill v2 (Superpowers pattern) + Hermes feat: [ENG-2697] rewrite ByteRover skill — sub-skill split + Hermes connector May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Claude finished @DatPham-6996's task in 2m 10s —— View job


Claude PR Review — synchronize re-review (6th pass)

Overall score: 4 / 5 — architecture and idempotent-block design remain solid. The only new commit since the 5th-pass review (cda1cd3) is a revert; none of the four open priority issues from the prior reviews have been addressed in HEAD, and the prior-review inline comments at yaml-mcp-config-writer.ts:101, skill-connector.ts:132, curate.md:12, hub-handler.ts:98, and agent-path-resolver.ts:29 are still the live action items.

To avoid further noise I am not re-posting those inline comments — please refer to the existing inline threads (most recently re-filed 2026-05-20 09:34 UTC) for fix suggestions / Fix this → links.

Since last review (2026-05-20 10:25 UTC)

  • cda1cd3 Revert "Merge branch 'feat/ENG-2697-variant' into feat/ENG-2697" — only new commit. Backs out the curate-judgement.md sub-skill and rewinds curate.md to the pre-JSON-envelope version (i.e. --response is bare HTML again, not {"html":…,"meta":…}). Net: SKILL_FILE_NAMES loses one entry; the rest of the connector / template / path-resolver surface is unchanged.

    Worth noting: the JSON-envelope contract that this revert backs out is what proj/byterover-tool-mode's curate-html-direct work (feat/ENG-2837) is converging on. If the intent was to defer that contract until after the tool-mode work lands on main, that ordering makes sense; if not, this is worth a follow-up. Not blocking either way.

Status of prior-review priority findings against current HEAD

Re-verified each against current files; nothing has shifted since the 5th-pass review except for the curate-judgement.md removal.

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME (+ double-space typo at ) src/server/templates/skill/curate.md:12, query.md:10 Still unaddressed (verified l. 12, l. 10)
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Still unaddressed (verified — catch { /* start fresh */ } … overwrite)
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Still unaddressed (verified — still 'overwrite' on every file). With curate-judgement.md reverted out, the managed set is one entry smaller, but dream.md / vc.md / history.md / review.md / troubleshooting.md etc. are all still clobbered
defaultScopeForAgent uses widening type annotation src/server/infra/transport/handlers/hub-handler.ts:95-98 Still unaddressed (verified — Record<string, {projectPath: null | string}> widening)
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 (nitpick) Still unaddressed (verified — ~/ only; resolveOpenClawUserPath at l. 64-77 handles both via /^~[\\/]/u)
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Still unaddressed (verified — still () => path.join(resolveHermesHome(), 'config.yaml') with no options)
SKILL_FILE_NAMES[0] magic indexing in uninstall src/server/infra/connectors/skill/skill-connector.ts:255, 274 Still unaddressed (install() correctly uses MAIN_SKILL_FILE_NAME at l. 123)
openclaw.json parsed with yamlLoad src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Still unaddressed
INVALID_OPENCLAW_ID_CHARS_RE g flag intent comment src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Still unaddressed
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation ✓ (docstring on l. 22-28 explains the legacy-detection invariant)

Tests & build

  • Existing unit suites unchanged in scope; the revert removed the curate-judgement.md-specific test cases added in eafd498 (consistent with reverting the feature).
  • Persistent gap (5th time flagged): no test covers (a) the YAML-parse-failure branch in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). A red test for either would force the corresponding priority issue into the fix queue.

Recommendation

Approve once at least these two top-priority items land — they're the only ones that can lose user content silently:

  1. yaml-mcp-config-writer.ts:88-101 — back up or refuse on invalid YAML.
  2. skill-connector.ts:126-132 — match writeSkillFiles' per-file existence check (or gate behind --force, or add a "Do not edit — regenerated" header).

Items 3 (curate.md/query.md HERMES_HOME consistency) and 4 (hub-handler.ts:95-98 widening cast) are smaller scope and could land in a follow-up if you'd rather keep this PR's diff focused.

Checklist

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Verify status of prior-review findings against current HEAD (cda1cd3)
  • Re-read key changed files (yaml-mcp-config-writer, skill-connector, hub-handler, agent-path-resolver, autonomous-agent-attachments, constants, curate.md, query.md, mcp-connector-config)
  • Check whether the new commit (cda1cd3) addresses any open issues — it doesn't (it's a revert of curate-judgement.md)
  • Avoid re-posting inline comments already filed multiple times; reference them from the summary instead
  • Post final summary with overall score
    branch feat/ENG-2697

wzlng and others added 4 commits May 24, 2026 00:51
Add a guided 90-second onboarding skill that runs when a user asks
"Show me how ByteRover works" (or any semantic equivalent). The tour
captures the user's persona and the pain that brought them to
ByteRover, persists both locally, and demonstrates how ByteRover
ends the re-explain tax — all without an account, API key, or
provider config.

src/server/templates/skill/onboarding.md (new):
- Msg 1: trust opener (no command names) → one-sentence concept
  primer → quick interview (identity + pain in one open question) →
  human-reaction beat before curate → visible artifact with pain
  bullet + sticky label ("re-explain tax") + behavioral commitment
  → 2-beat concept map with visual separation before pause
- Msg 2: named action ("brv query"), one-line retrieval summary,
  conditional bonus-context branch when existing project knowledge
  is found, identity-and-pain reflection, future-self demonstration
  of the pain ending, loop name + cross-session promise
- Msg 3: where memory lives (one sentence, no commands) →
  activation step that detects CLAUDE.md/AGENTS.md/etc. and offers
  to curate as starter project context (or prompts for one rule)
  → done signal with two equal-weight paths (curate more vs.
  resume work) so users exit without homework
- Spec guards: don't manufacture pains, don't overpromise on
  out-of-scope pains, don't turn the artifact into a confirmation,
  don't tailor with hollow phrases, don't auto-fire next message

src/server/templates/skill/SKILL.md:
- Add First-Turn Routing block before the Iron Law that hands off
  to onboarding.md on tour/intro/walkthrough requests
- Update frontmatter description so the skill router activates the
  skill on tour-related phrasings

src/server/infra/connectors/skill/skill-connector-config.ts:
- Add onboarding.md to SKILL_FILE_NAMES so the connector copies it
  during install
feat: [ENG-2536] add ByteRover onboarding tour skill
Msg 1 closes with a teaser line ("Also version-controlled, cloud-syncable,
and shareable across agents — more at the end") so users know more controls
exist without diluting the local-only trust climax. Msg 3 Part 1 delivers
on it with three short bullets covering brv vc, brv vc push/pull, and
connector cross-agent sharing.

Without this, the tour leaves users thinking ByteRover is local-only with
no team or sync story — they discover the full surface area accidentally
or not at all.
- Expand kind action notes (link/merge/prune/synthesize) with thresholds,
  candidate shapes, and accurate `related=` ref convention from curate.md.
- Add sample scan + finalize JSON envelopes with all candidate fields.
- Describe `path-exists` as a writer response on curate continuation
  (kickoff returns generate-html only; validation runs on the submitted HTML).
- Reframe undo: bit-exact restore of content + original mtime + sidecar
  signals; `brv dream undo` takes no arguments.
- Note that `dream sessions` / `dream cancel` JSON envelopes carry a
  `note` field disclosing v1 statelessness.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Claude finished @DatPham-6996's task in 3m 50s —— View job


Claude PR Review — synchronize re-review (7th pass)

Overall score: 3 / 5 — architecture and idempotent-block design remain solid, and the new onboarding.md (3-message guided tour) is a thoughtful, well-bounded addition. But this sync introduced a new regression that ships a broken sub-skill set to every agent, in addition to the four open priority issues from prior reviews still being unaddressed. Dropping a point this pass because the dream.md gap is a status: installed=true lie for every install — a regression that's strictly newer than the long-running disagreement items.

Since last review (2026-05-21 02:46 UTC)

  • cb2cd04 feat: [ENG-2536] add ByteRover onboarding tour skill — adds src/server/templates/skill/onboarding.md (283 lines, three-message tour: learn → demonstrate → wrap), registers it in SKILL_FILE_NAMES, adds a First-Turn Routing block to SKILL.md that hands off to onboarding.md on tour/intro requests, and expands the frontmatter description. Self-contained, well-thought-out content (trust-first opener, no command names in the trust moment, behavioral commitment over feature listing, predictable two-beat concept map).
  • 2baf272 feat: [ENG-2697] surface vc/sync/cross-agent controls in onboarding tour — Msg 1 closing teaser ("Also version-controlled, cloud-syncable, and shareable across agents — more at the end") + Msg 3 Part 1 follow-through with three bullets covering brv vc, brv vc push/pull, and cross-agent connectors. Closes the "leaves users thinking ByteRover is local-only" gap.
  • 6733e84 docs: [ENG-2697] correct dream.md sub-skill to match codebase — corrects dream.md to the v1 stateless behavior (kind action thresholds, candidate shapes, related= ref convention, sample envelopes for scan/finalize, path-exists writer-response semantics, undo is bit-exact with no args).
  • No targeted fixes to the four open priority issues from prior reviews.

New issue introduced by this sync

dream.md is in src/server/templates/skill/ and is referenced from SKILL.md three times (lines 105, 122, 175), but it is NOT in SKILL_FILE_NAMES. Filed inline at skill-connector-config.ts:133-143. Concrete impact:

  1. install() maps over SKILL_FILE_NAMES (skill-connector.ts:127) → dream.md is never written to any agent's skill directory.
  2. hasAllManagedSkillFiles() (skill-connector.ts:363) doesn't check for dream.mdstatus reports installed: true even though the agent is missing one of the guides SKILL.md itself links to.
  3. The agent following SKILL.md:105dream.md finds a dead link.

This looks accidental — f5e92f5 (the original split commit) included dream.md in SKILL_FILE_NAMES; it was dropped during a merge and never re-added, while onboarding.md was added (cb2cd04). Fix is a one-line array entry. Also worth a regression test in skill-connector.test.ts that asserts every *.md under src/server/templates/skill/ is enumerated in SKILL_FILE_NAMES.

Status of prior-review priority findings against current HEAD

Verified each against current files; none of the four open priority items have moved since the 6th-pass review. To avoid noise, not re-posting the inline comments for these — please see the existing inline threads (most recently re-filed 2026-05-20 09:34 UTC) for Fix this → links.

Prior issue File:line Status
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME (+ double-space typo at ) src/server/templates/skill/curate.md:12, query.md:10 Still unaddressed (verified)
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-101 Still unaddressed (verified — catch { /* start fresh */ } … overwrite)
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Still unaddressed (verified — 'overwrite' on every file). With onboarding.md now in the managed set, the blast radius grew again.
defaultScopeForAgent uses widening type annotation src/server/infra/transport/handlers/hub-handler.ts:93-98 Still unaddressed
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 (nitpick) Still unaddressed
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Still unaddressed
SKILL_FILE_NAMES[0] magic indexing in uninstall src/server/infra/connectors/skill/skill-connector.ts:255, 274 Still unaddressed
openclaw.json parsed with yamlLoad src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Still unaddressed
INVALID_OPENCLAW_ID_CHARS_RE g flag intent comment src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Still unaddressed
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation

Notes on the new onboarding.md (cb2cd04 + 2baf272)

  • Genuinely good design. The trust-first opener with the explicit "no command names in the trust moment" rule is the right call — brv vc push in sentence 1 reads like a CLI manual, not a promise. The follow-through in Msg 3 Part 1 (three controls bullets) keeps the local-only climax intact while honestly surfacing the sync/sharing options.
  • First-Turn Routing block in SKILL.md is correctly placed before the Iron Law and explicitly tells the agent not to run brv query before the tour. That's the right ordering — the tour itself demonstrates query, so a pre-tour query would steal the wow.
  • Pain-naming label "re-explain tax" is reusable vocabulary; the spec to not manufacture pains if the user didn't share one is the right guardrail.
  • Minor: onboarding.md:103 tells the agent to render http://localhost:7700 as a fixed URL. The actual port is user-configurable via BRV_WEBUI_PORT or the webui:setPort event (CLAUDE.md confirms 7700 is just the first-run default). For users who relocated to a different port, the URL in the tour artifact will 404. Either query webui:getPort at tour time or reword as default port :7700; check \brv webui --help` if you've changed it`. Not blocking — flagging because the tour leans hard on the "verifiable trust proof" of the URL clicking through. Skipping inline; small enough to bundle with the bigger fixes.
  • Minor: the First-Turn Routing matcher relies on semantic phrase matching ("walk me through ByteRover", "give me a tour", etc.). If the agent fires the tour on a user who thinks they're already past the tour (e.g. "give me a tour of the brv vc commands"), the tour fires inappropriately. Worth a one-line guard: "If the request is a tour of a specific subcommand or feature (brv vc, brv curate, etc.), do NOT run the onboarding tour — answer directly from the relevant detail file." Skipping inline; small.

Tests & build

  • No tests added for the onboarding.md install path. cb2cd04 adds onboarding.md to SKILL_FILE_NAMES but doesn't add a skill-connector.test.ts case asserting onboarding-installed files are present on install/refresh. Given the dream.md regression flagged above — which would have been caught by exactly that kind of test — this gap is now load-bearing. Strongly recommend adding a structural assertion: "every *.md template under src/server/templates/skill/ appears in SKILL_FILE_NAMES."
  • Persistent gap (6th time flagged): no test covers (a) the YAML-parse-failure branch in yaml-mcp-config-writer.write(), or (b) the re-install-clobbers-edited-sub-skill path in skill-connector.install(). Adding either of those would surface the corresponding priority issue as a red test.

Recommendation

Hold approval until at least:

  1. dream.md is added to SKILL_FILE_NAMES (one-line fix, plus an enumeration-coverage regression test).
  2. yaml-mcp-config-writer.ts stops silently overwriting hand-edited YAML on parse failure.
  3. skill-connector.ts:install() stops clobbering user-edited sub-skill files unconditionally (per-file existence check, --force gate, or "Do not edit" header).

Items #4 (curate.md/query.md HERMES_HOME consistency) and #5 (hub-handler.ts:95-98 widening annotation) are smaller scope and could land in a follow-up if you'd rather keep this PR's diff focused.

Checklist

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Verify status of prior-review priority findings against current HEAD
  • Re-read key changed files (yaml-mcp-config-writer, skill-connector, hub-handler, agent-path-resolver, templates incl. new onboarding.md and corrected dream.md)
  • Check whether new commits address any open issues (cb2cd04, 2baf272, 6733e84) — they don't, and cb2cd04 introduced the new dream.md-missing-from-managed-set regression
  • Post inline comment for the new regression
  • Avoid re-posting inline comments already filed multiple times; reference them from the summary instead
  • Post final summary with overall score
    branch feat/ENG-2697

Comment thread src/server/infra/connectors/skill/skill-connector-config.ts
Copy link
Copy Markdown
Collaborator

@cuongdo-byterover cuongdo-byterover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

- Add dream.md to managed ByteRover skill files
- Add regression coverage for skill template enumeration
- Fail YAML MCP writes when existing config is malformed or non-mapping
- Preserve existing YAML bytes instead of overwriting with a fresh config
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Claude finished @DatPham-6996's task in 1m 45s —— View job


Claude PR Review — synchronize re-review (8th pass)

Overall score: 4 / 5 — meaningful forward progress this sync: the new commit (b49d341) addresses the top-priority data-loss issue (YAML config writer) and the dream.md-missing-from-managed-set regression I flagged in the 7th pass. Both fixes ship with the right test coverage. Bumping the score from 3 → 4. Three priority items from prior reviews remain unaddressed, all smaller in scope than the two just landed.

Since last review (2026-05-27 04:53 UTC)

  • b49d341 fix: preserve malformed YAML configs during MCP install — a focused, well-scoped commit that fixes both regressions called out in the 7th pass:
    1. yaml-mcp-config-writer.ts:88-102write() now throws Cannot update YAML MCP config at <path>: <details> instead of silently resetting data = {} and overwriting the file. Parse failure and non-mapping-root both raise — confirmed by reading the new parseYamlAsRecord helper (lines 22-29) and the explicit throw new Error(…) at line 96. A hand-edited ~/.hermes/config.yaml with a typo is now preserved byte-for-byte. New tests in yaml-mcp-config-writer.test.ts cover both failure modes (throws and preserves existing content when YAML is malformed and … when YAML root is not a mapping), asserting both the thrown message and that the file content equals the pre-write bytes.
    2. skill-connector-config.ts:141dream.md is now in SKILL_FILE_NAMES (slotted between vc.md and history.md, matching the order suggested in the inline comment). Crucially, the commit also adds the structural-invariant regression test I suggested:
      it('should enumerate every skill template markdown file', async () => {
        const templateFileNames = (await readdir(path.resolve('src/server/templates/skill')))
          .filter((fileName) => fileName.endsWith('.md')).sort()
        expect([...SKILL_FILE_NAMES].sort()).to.deep.equal(templateFileNames)
      })
      This is exactly the right level — it fails if anyone adds a new *.md template without registering it in the managed set, which is how dream.md got dropped in the first place.

Both fixes are minimal, surgical, and arrive with the corresponding red-test → green-test transition. Nice TDD discipline on the follow-through.

Status of remaining prior-review priority findings against current HEAD

Prior issue File:line Status
YAML config writer silently resets to {} on parse failure src/server/infra/connectors/mcp/yaml-mcp-config-writer.ts:88-102 Fixed ✓ (in b49d341)
dream.md missing from SKILL_FILE_NAMES (regression flagged in 7th pass) src/server/infra/connectors/skill/skill-connector-config.ts:141 Fixed ✓ (in b49d341)
install() overwrites all SKILL_FILE_NAMES unconditionally src/server/infra/connectors/skill/skill-connector.ts:126-132 Still unaddressed (verified — still 'overwrite' on every file). Surface area is now 10 files including dream.md.
Hardcoded workdir="~/.hermes/byterover/" ignoring HERMES_HOME (+ double-space typo at ) src/server/templates/skill/curate.md:12, query.md:10 Still unaddressed (verified)
defaultScopeForAgent uses widening type annotation src/server/infra/transport/handlers/hub-handler.ts:93-98 Still unaddressed (verified — Record<string, {projectPath: null | string}> annotation widens the inferred type)
agent-path-resolver.ts:resolveUserPath Windows ~\foo gap src/server/infra/connectors/shared/agent-path-resolver.ts:29 (nitpick) Still unaddressed
mcp-connector-config.ts Hermes configPathResolver ignores injection src/server/infra/connectors/mcp/mcp-connector-config.ts:205 Still unaddressed
SKILL_FILE_NAMES[0] magic indexing in uninstall src/server/infra/connectors/skill/skill-connector.ts:255, 274 Still unaddressed
openclaw.json parsed with yamlLoad src/server/infra/connectors/skill/autonomous-agent-attachments.ts:83 Still unaddressed
INVALID_OPENCLAW_ID_CHARS_RE g flag intent comment src/server/infra/connectors/skill/autonomous-agent-attachments.ts:22 Still unaddressed
BYTEROVER_BLOCK_MARKERS = BRV_RULE_MARKERS identity src/server/infra/connectors/shared/constants.ts:22-29 Resolved via documentation

To avoid noise I'm not re-posting the inline comments for the still-unaddressed items — see the existing inline threads (most recently re-filed 2026-05-20 09:34 UTC) for Fix this → links and concrete suggestions.

Recommendation

The two most safety-critical items (data loss on hand-edited YAML; dead-linked dream.md for every install) are now resolved. The remaining items are smaller in scope:

  1. skill-connector.ts:126-132 — still the highest-impact unresolved item. Re-install silently clobbers user-edited sub-skill files; writeSkillFiles already shows the right per-file-existence pattern. Picking one of {per-file check, --force gate, "Do not edit" header in generated content} would close this out.
  2. curate.md:12 & query.md:10HERMES_HOME consistency + the double-space typo (at ). The cleanest fix is parameterizing the workdir at install time via SkillContentLoader; the lightweight fix is rewording to mention $HERMES_HOME as override.
  3. hub-handler.ts:95-98 — one-line type-guard refactor (agent in SKILL_CONNECTOR_CONFIGS) to comply with the CLAUDE.md "no as Type widening" rule.

#1 is the only one of the three that can affect user content; #2 and #3 are code-quality / consistency items that could land in a follow-up PR if you'd rather keep this diff focused.

Tests & build

  • New unit coverage in b49d341 (43 lines added to yaml-mcp-config-writer.test.ts, 12 lines added to skill-connector.test.ts) is well-targeted. Both new test cases would have surfaced the bugs they fix as red tests, which is the cleanest signal that the fix actually fixes the thing.
  • Remaining test gap: no test covers the re-install-clobbers-edited-sub-skill path in skill-connector.install(). A red test for that would force priority issue Feat/init #1 above into the fix queue, the same way the YAML writer's new test forced the parse-failure fix.

Checklist

  • Fetch latest branch and diff against origin/proj/byterover-tool-mode
  • Verify status of prior-review priority findings against current HEAD (b49d341)
  • Re-read key changed files (yaml-mcp-config-writer + tests, skill-connector-config + tests, hub-handler, agent-path-resolver, templates)
  • Confirm dream.md regression flagged in 7th pass is resolved
  • Avoid re-posting inline comments already filed multiple times; reference them from the summary instead
  • Post final summary with overall score
    branch feat/ENG-2697

Copy link
Copy Markdown
Collaborator

@cuongdo-byterover cuongdo-byterover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cuongdo-byterover cuongdo-byterover merged commit 34e5594 into proj/byterover-tool-mode May 27, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request May 27, 2026
8 tasks
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.

4 participants