Codex must respond to the user in Japanese.
- Explanations, plans, summaries, review comments, and questions should be written in Japanese.
- Source code, identifiers, file names, API names, test names, and commit-like technical terms may remain in English.
- If a task is ambiguous, ask concise clarification questions in Japanese.
- If work is partially completed, summarize what was done and what remains in Japanese.
This repository contains PicChronoImporter, a macOS SwiftUI app for importing photos and videos from an SD card or selected folder.
The app scans source files, resolves capture dates from metadata, groups imported files into destination folders by capture date, and provides a review screen where users can filter, sort, select, and resolve conflicts before import.
Primary workflow:
- Select source volume or folder.
- Select scan scope.
- Select destination root.
- Select folder naming template.
- Scan files.
- Review detected files.
- Select files to import.
- Resolve conflicts before execution.
- Import files.
- Review result summary.
Expected structure:
PicChronoImporter/
AGENTS.md
docs/
SPEC.md
IMPLEMENTATION_PLAN.md
code_review.md
.agents/
skills/
picchrono-fixture-authoring/
SKILL.md
picchrono-phase-implementation/
SKILL.md
picchrono-code-review/
SKILL.md
MacApp/
PicChronoImporter/
Packages/
PhotoImportCore/
PhotoImportPlatformMac/
PicChronoImporter.xcodeproj
Before implementation tasks, read:
docs/SPEC.mddocs/IMPLEMENTATION_PLAN.md
For code review tasks, also read:
docs/code_review.md
When the task matches a project skill, use the relevant skill:
- Fixture work:
picchrono-fixture-authoring - Phase-by-phase implementation:
picchrono-phase-implementation - Code review:
picchrono-code-review
Use a SOLID-oriented design.
Keep responsibilities separated:
Core contains:
- Domain models
- Use cases
- Services
- Protocols
- Testable business rules
Core must not depend on:
- SwiftUI
- AppKit
- ImageIO
- UniformTypeIdentifiers
- FileManager direct usage
- SQLite direct usage unless hidden behind a protocol abstraction
Core must depend on protocols, not platform implementations.
PlatformMac contains macOS-specific implementations:
- File system implementation
- Metadata provider implementation
- SQLite cache implementation
- Application Support path helpers
PlatformMac may depend on:
- Foundation
- ImageIO
- UniformTypeIdentifiers
- SQLite-related APIs or libraries
PhotoImportCore
The app target contains:
- SwiftUI views
- ViewModels
- Navigation
- Composition Root
- Live/Test/Preview assemblies
- App resources
- UI test fixtures
Do not move business rules into SwiftUI views.
Use explicit dependency injection.
The app target contains the Composition Root:
MacApp/PicChronoImporter/Composition/
AppConfiguration.swift
DependencyContainer.swift
LiveAssembly.swift
TestAssembly.swift
PreviewAssembly.swift
Use AppConfiguration to switch modes:
- Live mode
- UI test mode
- SwiftUI preview mode
UI tests should launch with arguments such as:
-uiTestMode 1 -fixture has_conflicts
Treat each file as an independent import item.
Do not assume a strict RAW+JPEG pair model.
Classify files into:
rawImagecompressedImagevideosidecarother
Folder templates are limited to year, month, and day.
If capture date cannot be resolved, always use:
UnknownDate
Use two-stage duplicate detection:
- Fast candidate detection.
- Strict content-hash confirmation.
Default conflict action is skip.
Conflicts should be resolved before import.
During import, re-check destination state before each file operation.
v1 supports only one active import session at a time.
Do not implement full destination folder indexing in v1.
Prefer Swift Testing for Core unit tests.
Use XCUITest for UI tests.
Testing priorities:
- Core unit tests
- Core integration tests with fake dependencies
- PlatformMac tests for macOS-specific behavior
- UI tests using JSON fixtures and TestAssembly
Automated tests must not require:
- a real SD card
- a real user photo library
- manual file selection
- network access
Prefer simple, explicit Swift.
Prefer value types for domain models.
Use actors for mutable shared state when appropriate.
Use Sendable where appropriate.
Avoid global mutable state.
Keep public APIs small.
Keep Core platform-independent.
Before making broad changes:
- Inspect existing structure.
- Read required docs.
- Make small, reviewable changes.
- Add or update tests where practical.
- Run relevant tests.
- Avoid unrelated refactors.
- Report results in Japanese.
If project decisions conflict with implementation details, preserve the documented architecture and ask for clarification in Japanese.
When the user corrects an architectural or product assumption, update AGENTS.md or the relevant document so future sessions inherit the correction.