- planner: { ready }, coder: { done }, tester: { passed }, committer: { success }
- planner/coder: createCursorRole, tester: createHermesRole
- committer: direct spawn, output to .log file
- moderator: coder loop (max 5), committer fail → coder
- bundle 24kb → 8.7kb
Fixes #5
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
export function coderPrompt({ threadId }: { threadId: string }): string {
|
|
return `Read the workflow thread to get the planner's design and any tester feedback: \`nerve thread ${threadId}\`
|
|
Read the nerve-dev skill for workflow file structure and conventions: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
|
Also look at existing workflows in the \`workflows/\` directory for patterns.
|
|
|
|
Implement the workflow the planner designed. If there is tester feedback in the thread, fix the issues it identified.
|
|
|
|
Required files for each workflow:
|
|
- \`workflows/<name>/index.ts\` — WorkflowDefinition default export
|
|
- \`workflows/<name>/package.json\` — with esbuild build script
|
|
- \`workflows/<name>/tsconfig.json\` — TypeScript config
|
|
- Update \`nerve.yaml\` with \`workflows.<name>\`
|
|
|
|
Rules:
|
|
- Keep the WorkflowDefinition<WorkflowMeta> pattern
|
|
- No dynamic import()
|
|
- Use types (not interfaces)
|
|
- Include retry-aware moderator routing
|
|
- Write compile-ready TypeScript
|
|
|
|
After creating all files, run inside the workflow directory:
|
|
\`\`\`
|
|
pnpm install --no-cache && pnpm build
|
|
\`\`\`
|
|
|
|
End your response with a JSON block:
|
|
\`\`\`json
|
|
{ "done": true }
|
|
\`\`\`
|
|
if build succeeded, or:
|
|
\`\`\`json
|
|
{ "done": false }
|
|
\`\`\`
|
|
if there were errors.`;
|
|
}
|