# Sync Linear to Git **Linear:** MAN-22 — https://linear.app/manglasabang/issue/MAN-22/sync-linear-to-git **Status:** Done **Project:** junwonhome ## Description ## Goal Automate the one-way sync from Linear issues to repo task folders. Linear is the source of truth; the repo is a local mirror. ## IMPORTANT: No Git Commits **linear-sync must NEVER make git commits.** It writes files to disk only. Junwon commits manually when ready. This was learned the hard way — linear-sync was auto-committing and polluted git history with noise commits that had to be reverted. ## Scope **Direction:** Linear → Git (one-way). Linear overwrites local — no merge, no conflict resolution. **What syncs:** 1. **Task folders** across three directories under `secretariat/tasks-synced-from-linear-to-git/` 2. **Task .md files** inside those folders (fully overwritten each sync) 3. **active-tasks.csv** — the at-a-glance tracker ## Task Folder Structure ``` secretariat/tasks-synced-from-linear-to-git/ active/ ← currently being worked on inactive-todo/ ← not started yet inactive-done/ ← completed or canceled ``` Folders move between these three dirs based on Linear status. ## Folder & File Naming Use Linear's auto-generated `branchName` field directly. ## Which Issues Qualify Sync issues that belong to a domain project (junwonHOME, junwonCOMPANY, palaceFUND, palaceAPP, palaceLAB). ## State Mapping | Linear Status | Folder | | -- | -- | | Backlog, Check Monthly/Weekly/Daily, Todo, Next Up | `inactive-todo/` | | Ace is working on this, Blocked, Junwon must unblock, Waiting | `active/` | | Ready for Junwon Review, Done, Canceled | `inactive-done/` | ## Architecture Runs via `channels/linear/index.ts` daemon. Sync loop runs once per hour. 1. Poll all qualifying issues by project 2. Diff against local state 3. Apply changes — create/move/overwrite folders and CSV 4. **No git operations** — files are written to disk only