Skip to content

Recurring Tasks: schedule daily/weekly task generation #21

@TheSethRose

Description

@TheSethRose

Summary

Add first-class recurring tasks with automatic generation and visibility in the UI.

Current behavior

  • Tasks are one-off records in the tasks table; there is no recurrence metadata in the schema documented in docs/DATABASE.md.
  • Task creation/update flows are handled through src/app/api/tasks/route.ts and UI in src/app/(dashboard)/tasks/TaskModal.tsx.
  • The existing background worker (scripts/recurring-work.js) syncs GitHub issues and performs git safety pushes, but it does not create recurring tasks.

Proposed behavior

  • Introduce a recurrence model (either a new task_recurrences table or columns on tasks) with fields such as rrule, next_run_at, last_run_at, timezone, enabled, and source_task_id.
  • Add server-side generation that creates the next instance at schedule time and updates next_run_at (cron or worker-friendly).
  • Update the task creation/edit UI to set recurrence rules and show the upcoming run in the task detail view.
  • Ensure the kanban view shows generated instances in the correct status and project.

Scope

  • Database migration for recurrence storage.
  • API: extend POST/PUT to accept recurrence settings; add a lightweight endpoint to compute next run.
  • Worker: scheduled job to create next instance (use existing worker patterns).
  • UI: recurrence picker in TaskModal and display of upcoming run.

Acceptance criteria

  • Recurring tasks can be created/edited with hourly, daily, weekly, monthly, and yearly cadences, as well as custom intervals and timezone support.
  • A scheduled worker creates a new task instance at or after the next run time.
  • Generated instances inherit project, tags, priority, and notes template.
  • Recurring rules can be paused without deleting historical instances.
  • No duplicate generation when the worker runs multiple times (idempotent by (recurrence_id, run_at)).

Open questions

  • What should be the default creation window (exact time vs. start-of-day)?
  • Should recurrence live on the base task or a separate recurrence entity?

References

  • docs/DATABASE.md (task schema)
  • src/app/api/tasks/route.ts (task CRUD)
  • src/app/(dashboard)/tasks/TaskModal.tsx (task form)
  • scripts/recurring-work.js (background worker pattern)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions