- Fixed requirement coverage for CAL-03 (view calendar events in weekly view) - Reduced tasks in Plan 01 from 4 to 2 to improve scoping - Added new Plan 03 for calendar event display functionality - Updated must_haves to reflect new task structure
105 lines
3.9 KiB
Markdown
105 lines
3.9 KiB
Markdown
---
|
|
phase: 03-calendar-integration
|
|
plan: 02
|
|
type: execute
|
|
wave: 1
|
|
depends_on: []
|
|
files_modified: [src/lib/calendar-sync.ts, src/app/api/calendar/sync/route.ts]
|
|
autonomous: true
|
|
must_haves:
|
|
truths:
|
|
- "User can manage calendar connection settings from the application"
|
|
- "User's tasks and calendar events are synchronized bidirectionally"
|
|
artifacts:
|
|
- path: "src/lib/calendar-sync.ts"
|
|
provides: "Bidirectional synchronization logic for calendars and tasks"
|
|
min_lines: 30
|
|
- path: "src/app/api/calendar/sync/route.ts"
|
|
provides: "API endpoint for triggering calendar synchronization"
|
|
exports: ["POST"]
|
|
key_links:
|
|
- from: "src/app/api/calendar/sync/route.ts"
|
|
to: "src/lib/calendar-sync.ts"
|
|
via: "import and use"
|
|
pattern: "import.*calendar-sync"
|
|
---
|
|
|
|
<objective>
|
|
Implement calendar synchronization features enabling bidirectional syncing of calendar events and tasks.
|
|
|
|
Purpose: Allow seamless integration of calendar events with weekly task view and enable users to manage calendar connections.
|
|
Output: Bidirectional synchronization logic, sync API endpoint, and calendar settings UI.
|
|
</objective>
|
|
|
|
<execution_context>
|
|
@~/.config/opencode/get-shit-done/workflows/execute-plan.md
|
|
@~/.config/opencode/get-shit-done/templates/summary.md
|
|
</execution_context>
|
|
|
|
<context>
|
|
@.planning/PROJECT.md
|
|
@.planning/ROADMAP.md
|
|
@.planning/STATE.md
|
|
@.planning/REQUIREMENTS.md
|
|
|
|
# Relevant context from previous phases
|
|
@.planning/phases/01-setup-and-authentication/01-01-PLAN.md
|
|
@.planning/phases/01-setup-and-authentication/01-02-PLAN.md
|
|
@.planning/phases/02-task-management/02-01-PLAN.md
|
|
@.planning/phases/03-calendar-integration/03-01-PLAN.md
|
|
</context>
|
|
|
|
<tasks>
|
|
|
|
<task type="auto">
|
|
<name>Implement Bidirectional Sync Logic</name>
|
|
<files>src/lib/calendar-sync.ts</files>
|
|
<action>Create a TypeScript module that implements the core synchronization logic:
|
|
- Determine which calendars are connected and active
|
|
- Fetch events from calendar APIs
|
|
- Identify tasks that need to be imported from calendars
|
|
- Identify calendar events that need to be converted to tasks
|
|
- Handle conflicts in naming, dates, or other attributes
|
|
- Handle updates and deletions from both sides
|
|
|
|
Reference calendar data structures from Phase 2 and API patterns from Phase 1.</action>
|
|
<verify>npm test passes and the module exports syncCalendarEvents and syncCalendarTasks functions without error</verify>
|
|
<done>Module exports syncCalendarEvents and syncCalendarTasks functions that handle bidirectional sync</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Create Calendar Sync API Endpoint</name>
|
|
<files>src/app/api/calendar/sync/route.ts</files>
|
|
<action>Create a POST API endpoint that:
|
|
- Validates user authentication
|
|
- Triggers the calendar synchronization process
|
|
- Calls the sync logic from calendar-sync.ts
|
|
- Returns appropriate status codes and responses
|
|
- Handles errors gracefully with appropriate messaging
|
|
|
|
Follow the API endpoint pattern established in Phase 2 and authentication flow from Phase 1.</action>
|
|
<verify>curl -X POST http://localhost:3000/api/calendar/sync returns 200 with successful sync status</verify>
|
|
<done>Endpoint successfully triggers sync process and returns status JSON</done>
|
|
</task>
|
|
|
|
</tasks>
|
|
|
|
<verification>
|
|
Verify that all components work in concert:
|
|
1. Manual sync button triggers the sync API endpoint
|
|
2. Sync process retrieves events from calendars
|
|
3. Events are properly imported as tasks (when applicable)
|
|
4. Tasks can be exported to calendars (when configured)
|
|
5. Settings persist between sessions
|
|
</verification>
|
|
|
|
<success_criteria>
|
|
- Users can manage calendar connections and sync settings from UI
|
|
- Bidirectional synchronization works between calendar events and tasks
|
|
- Events are properly imported from calendars to tasks
|
|
- Tasks can be created from calendar events when configured
|
|
</success_criteria>
|
|
|
|
<output>
|
|
After completion, create `.planning/phases/03-calendar-integration/03-02-SUMMARY.md`
|
|
</output> |