refactor: committer → agent role with proper branch/commit/PR workflow #9

Open
opened 2026-04-29 10:41:21 +00:00 by xiaoju · 0 comments
Owner

Problem

Current committer is a hand-written script Role that does blind git add/commit/push. This causes:

  1. implement commits to master — cursor-agent can't git commit in sandbox, so changes land on master working tree. publish then creates a branch from master that already has the changes → empty PR diff
  2. PR title/description are meaningless — committer doesn't read thread context, generates generic titles
  3. No intelligent commit messages — just timestamps or generic text

Solution

Replace the script committer with an agent role (hermesAdapter + createRole). The agent can read thread history and produce proper git workflow.

Revised role responsibilities:

implement (cursor adapter):

  • Only writes code, runs build
  • Does NOT create branches or commit
  • Sets done: true when code changes are ready

committer (hermes adapter, NEW):

  • Reads thread context (issue, plan, implement output, review feedback)
  • Creates feature branch: fix/<number>-<slug> or feat/<number>-<slug>
  • Writes meaningful commit message from thread context
  • Commits and pushes

publish (hermes adapter):

  • Creates PR with meaningful title and structured description
  • Reads thread context for What/Why/Changes/Ref sections
  • References the issue (Fixes #N)

Key change:

// Before: hand-written script
committer: buildCommitterRole({ nerveRoot })

// After: agent role
committer: createRole(hermesAdapter, committerPrompt, committerSchema, extract)

Also fix

  • Remove branch creation from implement prompt
  • publish prompt should generate structured PR description (What/Why/Changes/Ref)

小橘 🍊(NEKO Team)

## Problem Current committer is a hand-written script Role that does blind git add/commit/push. This causes: 1. **implement commits to master** — cursor-agent can't git commit in sandbox, so changes land on master working tree. publish then creates a branch from master that already has the changes → empty PR diff 2. **PR title/description are meaningless** — committer doesn't read thread context, generates generic titles 3. **No intelligent commit messages** — just timestamps or generic text ## Solution Replace the script committer with an **agent role** (hermesAdapter + createRole). The agent can read thread history and produce proper git workflow. ### Revised role responsibilities: **implement** (cursor adapter): - Only writes code, runs build - Does NOT create branches or commit - Sets `done: true` when code changes are ready **committer** (hermes adapter, NEW): - Reads thread context (issue, plan, implement output, review feedback) - Creates feature branch: `fix/<number>-<slug>` or `feat/<number>-<slug>` - Writes meaningful commit message from thread context - Commits and pushes **publish** (hermes adapter): - Creates PR with meaningful title and structured description - Reads thread context for What/Why/Changes/Ref sections - References the issue (`Fixes #N`) ### Key change: ```ts // Before: hand-written script committer: buildCommitterRole({ nerveRoot }) // After: agent role committer: createRole(hermesAdapter, committerPrompt, committerSchema, extract) ``` ## Also fix - Remove branch creation from implement prompt - publish prompt should generate structured PR description (What/Why/Changes/Ref) 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: xiaoju/nerve-workspace#9
No description provided.