linear-data-handling
Data synchronization, backup, and consistency patterns for Linear. Use when implementing data sync, creating backups, or ensuring data consistency across systems. Trigger with phrases like "linear data sync", "backup linear", "linear data consistency", "sync linear issues", "linear data export".
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- linear-data-handling
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Data synchronization, backup, and consistency patterns for Linear. Use when implementing data sync, creating backups, or ensuring data consistency across systems. Trigger with phrases like "linear data sync", "backup linear", "linear data consistency", "sync linear issues", "linear data export".
- allowed-tools
- Read, Write, Edit, Grep, Bash(node:*)
- compatible-with
- claude-code, codex, openclaw
02 资源文件 1
- 参考文档references/implementation.md8.6 KB
03 SKILL.md 正文
Linear Data Handling
Contents
Overview
Implement reliable data synchronization, backup, and consistency for Linear integrations using full sync, incremental webhooks, export/backup, consistency checks, and conflict resolution.
Prerequisites
- Linear API access
- Database for local storage (Drizzle ORM recommended)
- Understanding of eventual consistency
Instructions
Step 1: Data Model Mapping
Define Zod schemas for core Linear entities (LinearIssueSchema, LinearProjectSchema) covering all fields: id, identifier, title, description, priority, estimate, stateId/stateName, teamId/teamKey, assigneeId, projectId, cycleId, timestamps. Use z.infer for type exports.
Step 2: Full Sync Implementation
Build fullSync() that paginates through all issues (100 per page), maps each to the local schema (resolving state/team relations), then runs a database transaction to upsert new/updated issues and soft-delete removed ones. Track stats: total, created, updated, deleted, errors.
Step 3: Incremental Sync with Webhooks
Create processWebhookSync() that handles Linear webhook events (create/update/remove) for Issue entities, performing the corresponding database insert, update, or soft-delete with a syncedAt timestamp.
Step 4: Data Export/Backup
Build createBackup() that exports teams, projects, cycles, and all issues (with optional comments) via paginated API calls, writing to JSON or CSV format. Include metadata (exportedAt, version).
Step 5: Data Consistency Checks
Implement checkConsistency() that samples remote issues and compares against local state, detecting missing, stale, and orphaned records. Schedule via daily cron; auto-trigger full sync when thresholds are exceeded.
Step 6: Conflict Resolution
Create resolveConflict() supporting four strategies: remote-wins, local-wins, merge (field-level), and manual (throws ConflictError). Allow configurable merge fields.
See detailed implementation for complete Zod schemas, full sync with pagination, webhook handler, backup exporter, consistency checker, and conflict resolution code.
Output
- Zod-validated data model schemas
- Full sync with pagination and transactions
- Incremental webhook sync handler
- Data export/backup utility
- Consistency check with scheduled monitoring
- Configurable conflict resolution
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Sync timeout | Too many records | Use smaller batches |
| Conflict detected | Concurrent edits | Apply conflict resolution strategy |
| Stale data | Missed webhooks | Trigger full sync |
| Export failed | API rate limit | Add delays between requests |
Examples
Basic usage: Apply linear data handling to a standard project setup with default configuration options.
Advanced scenario: Customize linear data handling for production environments with multiple constraints and team-specific requirements.
Resources
Next Steps
Implement enterprise RBAC with linear-enterprise-rbac.
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
zustand-store-creator
Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
zapier-integration-helper
Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.
zai-cli
Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.
yt-research
Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.