Refactor FlowAPI code following project patterns and conventions. Use for restructuring code, extracting patterns, improving type safety, or modernizing implementations.
Refactor: $ARGUMENTS
Before writing code, document:
Follow these strictly during refactoring:
Naming:
createXNode() — never export classes*Config (YAML/static), *Options (runtime)[ServiceArea][Action]NodeImports:
@chimpanze/flowapi/services../errors/types../../packages/X/src/...Exports:
index.ts files when moving/renaming exportsRuntime:
sql.unsafe() returns rows directly (not { rows })sql.begin() for transactionsBun.password instead of bcryptBun.S3Client instead of minioCode Style:
_ only if truly needed)After refactoring, update all consumers:
tests/packages/examples/docs/Run the quality gates:
bunx biome check . # Lint
npx tsc --noEmit # Typecheck
bun tests/runner.ts # Tests
All three must pass before considering the refactor complete.