Files
taskbuffer/.serena/memories/code_style_conventions.md

1.2 KiB

Code Style and Conventions for TaskBuffer

File Structure

  • Source code in ts/ directory
  • Tests in test/ directory
  • Compiled output in dist_ts/
  • All filenames must be lowercase

Naming Conventions

  • Interfaces: Prefix with I (e.g., ITaskFunction)
  • Types: Prefix with T (e.g., TPreOrAfterTaskFunction)
  • Classes: PascalCase (e.g., TaskManager)
  • Files: taskbuffer.classes.{classname}.ts pattern
  • Test files: test.{number}.{feature}.ts pattern

TypeScript Conventions

  • Use ES modules (import/export)
  • Avoid ENums when possible
  • Import dependencies through plugins.ts
  • Reference with full path: plugins.myModule.myClass()
  • Use async/await patterns consistently
  • Strong typing throughout

Testing Conventions

  • Import expect from @git.zone/tstest/tapbundle
  • Test files end with export default tap.start()
  • Use descriptive test names with tap.test()
  • Test both browser and node when applicable

Code Quality

  • Make focused, goal-oriented changes
  • Preserve necessary complexity
  • Keep code elegant and maintainable
  • No inline documentation unless requested
  • Complete implementations only (no partial work)