tududi/docs/MEMORY.md
Chris 01a84c3598
Fix: Bi-weekly recurring task scheduling for multi-day patterns (#1005)
* fix: correct bi-weekly recurring task scheduling for multi-day patterns

Fixes #1004

Previously, when a recurring task was set to repeat every N weeks (where N > 1)
on multiple weekdays that span a week boundary (e.g., Saturday + Sunday), the
algorithm incorrectly calculated the next occurrence dates.

The issue was in the calculateWeeklyRecurrence function, which didn't properly
determine when to add the interval skip for multi-weekday patterns. It would:
- Correctly handle Sat -> Sun (adjacent days, same cycle)
- Incorrectly handle Sun -> Sat (should skip weeks, but didn't)

This fix improves the logic to:
1. Detect when the current day is the last weekday in the pattern cycle
2. Account for Sunday (day 0) wrapping around in the day-of-week numbering
3. Only add interval skips when truly moving to a new cycle, not when moving
   between weekdays within the same cycle

Test coverage added for:
- Bi-weekly Saturday + Sunday pattern (the reported bug)
- Starting from different days in the pattern
- Bi-weekly Tuesday + Thursday pattern
- Tri-weekly Friday + Saturday + Sunday pattern

* docs: update MEMORY.md with GitHub template requirements

- Add detailed PR template requirements and structure
- Expand bug report template requirements with all fields
- Update last modified date
2026-04-12 08:52:13 +03:00

98 lines
No EOL
3.3 KiB
Markdown

# Claude Memory & Preferences
This document contains preferences, patterns, and memory items specific to working with Claude Code on the tududi project.
---
## Pull Request Preferences
### PR Template
- **ALWAYS use** the PR template from `.github/pull_request_template.md`
- **Do NOT add** the "🤖 Generated with [Claude Code](https://claude.com/claude-code)" footer to pull requests
- Required sections:
- **Description**: What does this PR do? Why is this change needed?
- **Type of Change**: Bug fix / New feature / Breaking change / Documentation
- **Related Issues**: Link issues using "Fixes #123"
- **Testing**: Describe testing steps and commands run
- **Checklist**: Mark all applicable items (including "This is not AI slop crap")
- **Additional Notes**: Any other context for reviewers
### PR Creation Workflow
- Always create PRs against the `main` branch
- Use descriptive branch names following the pattern: `fix/`, `feature/`, `refactor/`, etc.
- Include comprehensive test coverage in PRs
---
## Commit Message Preferences
### General Rules
- **Do NOT add** `Co-authored-by` trailers to commit messages (set globally in `~/.claude/CLAUDE.md`)
- Use conventional commit style when appropriate: `fix:`, `feat:`, `refactor:`, etc.
- Keep commit messages concise and descriptive
### Fixup Commits
- Use `fixup!` prefix for commits that should be squashed into previous commits
- These are typically used with `git rebase --autosquash`
---
## Testing Preferences
### Test Coverage Requirements
- All new features must include comprehensive unit tests
- Follow the Arrange-Act-Assert pattern (see [testing.md](testing.md))
- Test files should be colocated in `backend/tests/unit/` matching the module structure
### Running Tests
- Always run tests before pushing with `npm test`
- Pre-push hooks will automatically run linting, formatting, and tests
---
## Codebase Patterns to Remember
### Backend Patterns
- Follow the module architecture pattern described in [backend-patterns.md](backend-patterns.md)
- Use repository pattern for data access
- Keep business logic in service files
### Frontend Patterns
- TypeScript for new components
- Follow component organization in [directory-structure.md](directory-structure.md)
- Use Zustand for global state, SWR for server state
---
## GitHub Issue Preferences
### Bug Reports
- **ALWAYS use** the GitHub bug report template from `.github/ISSUE_TEMPLATE/bug_report.yml`
- Required fields:
- **Description**: Clear description of the bug
- **Steps to Reproduce**: Detailed steps to reproduce the issue
- **Expected Behavior**: What should happen
- **Actual Behavior**: What actually happens
- **Operating System**: User's OS
- **Browser**: Browser name and version
- Optional fields:
- **Version**: Tududi version (if known)
- **Screenshots**: Visual evidence of the issue
- **Additional Context**: Technical details (root cause, solution, files affected)
---
## Common Issues & Solutions
### Date Formatting
- Be consistent with date format handling across the application
- Pay attention to timezone handling in defer/scheduling features
### URL Detection
- The inbox processing service has URL detection logic
- URLs are detected even without projects for bookmark tag display
---
**Last Updated:** 2026-04-12
**Maintained by:** Claude Code sessions - update as new patterns emerge