## 1. Script Skeleton and Concurrency - [x] 1.1 Create `kanban-project-sync` script with argument parsing (`--project`, `--board`, `--background`), usage help, and exit code constants - [x] 1.2 Implement `flock`-based locking with pending flag file and re-run loop - [x] 1.3 Implement `--background` mode (re-exec self detached with output to log file) - [x] 1.4 Add connectivity check (`pcli status`) with exit code 2 on failure ## 2. Bootstrap Phase - [x] 2.1 Implement find-or-create project by name - [x] 2.2 Implement find-or-create board by name within project - [x] 2.3 Implement find-or-create lists (Backlog, To Do, Planning, In Progress, Review, Done) with correct positions - [x] 2.4 Implement find-or-create `agent` label on the board ## 3. Reconciliation Phases - [x] 3.1 Gather OpenSpec state — list active changes, parse artifact completion and task checkbox state - [x] 3.2 Determine target list for each change based on OpenSpec state (Planning / In Progress / Review) - [x] 3.3 Gather existing Planka agent-labelled cards and build name→card map - [x] 3.4 Create missing cards (new OpenSpec changes without a Planka card) with agent label - [x] 3.5 Move cards to correct list when current list doesn't match target - [x] 3.6 Sync task checklists — create/update task lists and tasks on cards from `tasks.md` - [x] 3.7 Move orphaned agent cards (no matching active change) to Done ## 4. Reporting and Summary - [x] 4.1 Add summary output — infrastructure created, cards created/moved, tasks synced, errors ## 5. Skill and Documentation Updates - [x] 5.1 Simplify `.claude/commands/kanban-sync.md` to invoke `kanban-project-sync --background` - [x] 5.2 Update `CLAUDE.md` Planka Sync section to reference the script