Refactor workflow-generator: multi-file DIP + Role Factory + esbuild bundle #3
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
sense-generatorhas been refactored to use the Role Factory pattern with separate role directories, DIP, and esbuild bundle todist/.workflow-generatoris still a ~500-line monolith in a singleindex.tsusing old APIs.Tasks
1. Split into multi-file structure
Target structure (matching sense-generator):
2. Use Role Factory pattern
createLlmRole(uses DashScope for structured extraction)createCursorRole(writes code)createCursorRole(dry-run review in ask mode)createHermesRole(git commit + push)Reference
sense-generatorfor the exact factory API.3. Clean up old APIs
Remove usage of:
readNerveYaml()— not needed, let agents read it themselvesnerveAgentContext— same, delegate to skillcfgGet()— useprocess.envdirectlyisDryRun()— factories handle this internallybuildSenseGeneratorReference()— let agents read files themselves4. esbuild bundle to dist/
dist/index.jsdist/index.js5. Prompt files
Each role prompt.ts exports a pure function returning a string. Move all prompt construction out of the role logic.
6. DIP — dependencies injected
index.tsreads env vars and throws if missing, then callsbuildWorkflowGenerator({ provider, cwd })which constructs all roles.Reference
workflows/sense-generator/@uncaged/nerve-workflow-utils(createCursorRole,createLlmRole,createHermesRole)Non-goals
xiaoju referenced this issue2026-04-28 08:48:45 +00:00