# Implementation Plan - Generic RRULE Formatter

## Phase 1: Reproduction & Test Setup
- [ ] Task: Create reproduction test case for `BYDAY` object
    - [ ] Add a test in `icalendar_test.ts` mocking a `BYDAY` property as an array of objects (e.g. `[{ day: 'MO' }]`).
    - [ ] Run the test and confirm it fails with `SyntaxError: Invalid weekday string: [object Object]`.
- [ ] Task: Conductor - User Manual Verification 'Reproduction & Test Setup' (Protocol in workflow.md)

## Phase 2: Implementation
- [ ] Task: Implement Recursive Formatter
    - [ ] Update `formatRRuleValue` in `icalendar.ts` to be a recursive function.
    - [ ] Handle Arrays by joining elements with commas.
    - [ ] Handle `Date` objects using the existing iCal format.
    - [ ] Handle property objects (extract `date`, `day`, or `value` properties).
    - [ ] Run the reproduction test to confirm it passes.
- [ ] Task: Conductor - User Manual Verification 'Implementation' (Protocol in workflow.md)

## Phase 3: Verification & Cleanup
- [ ] Task: Composite and Regression Testing
    - [ ] Add a complex test case containing both nested `UNTIL` dates and `BYDAY` arrays.
    - [ ] Run the full regression test suite in `icalendar_test.ts`.
- [ ] Task: Conductor - User Manual Verification 'Verification & Cleanup' (Protocol in workflow.md)
