refactor: flatten role folders into single .ts files (develop-sense & develop-workflow) #13

Closed
opened 2026-04-29 12:19:05 +00:00 by xiaoju · 0 comments
Owner

What

Each role under develop-sense/roles/ and develop-workflow/roles/ currently has a folder with index.ts + prompt.ts. The index.ts files are trivially short (6 lines, just schema + type). Merge them into single .ts files and remove the folders.

Current Structure

workflows/develop-sense/roles/
  planner/
    index.ts    # 6 lines: schema + type only
    prompt.ts   # prompt function
  coder/
    index.ts
    prompt.ts
  reviewer/
    index.ts
    prompt.ts
  tester/
    index.ts
    prompt.ts
  committer/
    index.ts    # re-export from _shared

Same structure for develop-workflow/roles/.

Target Structure

workflows/develop-sense/roles/
  planner.ts    # schema + type + prompt function, all in one
  coder.ts
  reviewer.ts
  tester.ts
  committer.ts  # re-export from _shared (stays simple)

Same for develop-workflow/roles/.

Rules

  1. For each role folder (planner, coder, reviewer, tester): merge index.ts and prompt.ts into a single <role>.ts file, then delete the folder.
  2. For committer/: it only has index.ts (re-export from _shared), just move it to committer.ts and delete the folder.
  3. Update all imports in build.ts (and anywhere else that imports from these roles) — change ./roles/planner/index.js./roles/planner.js etc.
  4. Keep all exports identical (schema, type, prompt function) — no API changes.
  5. Run pnpm build at repo root to verify.

Scope

  • workflows/develop-sense/roles/ — 5 roles
  • workflows/develop-workflow/roles/ — 5 roles
  • workflows/develop-sense/build.ts — update imports
  • workflows/develop-workflow/build.ts — update imports
## What Each role under `develop-sense/roles/` and `develop-workflow/roles/` currently has a folder with `index.ts` + `prompt.ts`. The `index.ts` files are trivially short (6 lines, just schema + type). Merge them into single `.ts` files and remove the folders. ## Current Structure ``` workflows/develop-sense/roles/ planner/ index.ts # 6 lines: schema + type only prompt.ts # prompt function coder/ index.ts prompt.ts reviewer/ index.ts prompt.ts tester/ index.ts prompt.ts committer/ index.ts # re-export from _shared ``` Same structure for `develop-workflow/roles/`. ## Target Structure ``` workflows/develop-sense/roles/ planner.ts # schema + type + prompt function, all in one coder.ts reviewer.ts tester.ts committer.ts # re-export from _shared (stays simple) ``` Same for `develop-workflow/roles/`. ## Rules 1. For each role folder (planner, coder, reviewer, tester): merge `index.ts` and `prompt.ts` into a single `<role>.ts` file, then delete the folder. 2. For `committer/`: it only has `index.ts` (re-export from `_shared`), just move it to `committer.ts` and delete the folder. 3. Update all imports in `build.ts` (and anywhere else that imports from these roles) — change `./roles/planner/index.js` → `./roles/planner.js` etc. 4. Keep all exports identical (schema, type, prompt function) — no API changes. 5. Run `pnpm build` at repo root to verify. ## Scope - `workflows/develop-sense/roles/` — 5 roles - `workflows/develop-workflow/roles/` — 5 roles - `workflows/develop-sense/build.ts` — update imports - `workflows/develop-workflow/build.ts` — update imports
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#13
No description provided.