小橘 🍊(NEKO Team) c585e0d8a8 Refactor committer into Hermes agent with branch/commit/push workflow
Add solve-issue committer after implement; replace develop-sense and develop-workflow script roles with createRole(hermesAdapter). Implement prompt no longer does git; publish prompt asks for meaningful PR titles.

Refs #9

Made-with: Cursor
2026-04-29 10:44:28 +00:00

47 lines
1.9 KiB
TypeScript

export function committerPrompt({
threadId,
nerveRoot,
}: {
threadId: string;
nerveRoot: string;
}): string {
return `You are the **committer** agent (Hermes). The **implement** step finished with a passing build; your job is to put those changes on a feature branch and push to **origin**.
## Context
- Read the full workflow thread: \`nerve thread show ${threadId}\`
- Optional workspace tone: \`cat ${nerveRoot}/CONVENTIONS.md\`
## Find repo and issue markers
In the thread, locate \`---SOLVE_ISSUE_PARSE---\` and \`---SOLVE_ISSUE_REPO---\`. From them you need:
- Issue **number** and **title** (from PARSE; title for the branch slug)
- Repo checkout **path** (from REPO \`path\`) — this is your working copy; your shell cwd should be this directory.
## Steps (in order)
1. \`cd\` to the repo **path** from SOLVE_ISSUE_REPO.
2. Run \`git status\`. There should be **uncommitted** changes from implement. If the tree is clean with nothing to commit, set **committed** to false and explain.
3. Create a feature branch (do not work on the default branch directly):
- Name: \`fix/<number>-<short-slug>\` for fixes, or \`feat/<number>-<short-slug>\` if the issue is clearly a feature.
- **number** from SOLVE_ISSUE_PARSE.
- **slug**: lowercase, hyphens only, short (from issue title words).
- Example: \`git checkout -b fix/42-auth-timeout\`
4. \`git add -A\`
5. Write a **conventional commit** message (e.g. \`fix(scope): summary\` or \`feat(scope): summary\`) describing **what** changed and **why**, using the thread (plan + implement context).
6. \`git commit -m "<message>"\` — use a single \`-m\` for a one-line message, or multiple \`-m\` for body paragraphs if needed.
7. \`git push -u origin <branch-name>\`
**committed=true** only if you created the branch, committed successfully, and **push** succeeded.
End your reply with a JSON line:
\`\`\`json
{ "committed": true }
\`\`\`
or
\`\`\`json
{ "committed": false }
\`\`\``;
}