Linear 议题归档同步
ltui-linear-issue-archive-sync
通过 ltui 将本地 markdown 议题归档同步到 Linear,随后将本地文件改写为指向 Linear 议题的弃用镜像。
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 5
- Forks
- 4
01 前言 Front Matter
- name
- ltui-linear-issue-archive-sync
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "Linear", "ltui", "markdown", "migration", "issue-tracking" ] } }
- description
- Sync a local markdown issue archive into Linear via ltui, then rewrite local files as deprecated mirrors pointing to the Linear issues.
- prerequisites
- { "commands": [ "ltui", "python3" ] }
03 SKILL.md 正文
ltui Linear issue-archive sync
Use this when a repo has a directory of local markdown issue docs that must become Linear issues, while preserving the local docs as deprecated archival mirrors.
When to use
- A repo has many
*.mdissue files in a local folder - Each file should map to one Linear issue
- The Linear issue should become the source of truth
- The local file should be rewritten with a Linear link and deprecation metadata
Important tool findings
ltuimay work through its configured auth profile even whenLINEAR_API_KEYis not present in the shell environment. Checkltui auth listbefore assuming Linear access is unavailable.ltuiglobal flags must go before the subcommand:- good:
ltui --format json --limit 250 issues list --project <id> - bad:
ltui issues list --project <id> --format json
- good:
ltui projects listdoes not accept--formatafter the subcommand; use the global form.ltui issues createreturns a full JSON object withidentifier,url,project, etc. This is enough to update local files immediately.ltuisupports issue create/update/comment/link, plus dependency helpers:ltui issues relate <child> --parent <parent>for parent/child structureltui issues block <child> --blocked-by <parent>for execution-order blocking
ltuimay not support deletion. For accidental test issues, prefer canceling and renaming them.- Network calls to Linear can intermittently timeout (
ETIMEDOUT/EHOSTUNREACH) even when auth is valid. For bulk updates, use a script with retries/backoff. - For large migrations or bulk rewrites, use a script rather than one tool call per issue.
Recommended workflow
-
Inspect the archive directory
- Enumerate
*.mdfiles. - Exclude non-issue files like
README.md. - Sample a few issue files to confirm frontmatter shape and title extraction rules.
- Enumerate
-
Confirm Linear access and discover target project
- Run
ltui auth list - Run
ltui projects listorltui --format json projects list - Identify the target project ID/key and team key
- Run
-
Check for existing Linear representation
- List current issues in the target project:
ltui --format json --limit 250 issues list --project <project-id> - Build a title -> issue map before creating anything
- Paginate if needed using the global
--cursor
- List current issues in the target project:
-
Create missing Linear issues
- Extract the markdown H1 as the Linear title
- Preserve key frontmatter fields in the description, e.g.:
- source file
- created
- priority
- review_area
- category
- original local status
- Pass descriptions via a temp file using
--description @/tmp/file.md - Map local priorities if useful (e.g. critical→1, high→2, medium→3, low→4)
-
Rewrite local files as deprecated mirrors Update frontmatter with fields like:
status: deprecated original_status: open deprecated: true deprecated_in_favor_of: linear source_of_truth: linear linear_issue: NOD-123 linear_url: https://linear.app/...Add a top-of-file callout like:
> [!IMPORTANT] > Deprecated local mirror. Canonical tracking now lives in Linear: [NOD-123](https://linear.app/...). > Keep this file only for archival context; update the Linear issue instead. -
Sync structural relationships if the archive has a hierarchy
- If the archive contains an index/tree (for example a README section like
Related concern tree), treat that as the source of truth for dependency structure. - For each parent -> child pair, apply both:
ltui issues relate <child> --parent <parent> ltui issues block <child> --blocked-by <parent> - Use parent/child to preserve conceptual grouping.
- Use
blocked-bywhen the parent must be fixed first and is expected to resolve or subsume the child issue.
- If the archive contains an index/tree (for example a README section like
-
Normalize severity ranking in Linear
- Linear only has 4 priority buckets, so if the local archive has more nuance than that, define an explicit mapping before bulk updates.
- A good pattern when the archive has a curated shortlist is:
- top curated issues ->
1(Urgent) - remaining local
critical->2(High) - local
high->3(Medium) - local
medium/low->4(Low)
- top curated issues ->
- For a curated top list, parse it from the archive index rather than inferring it later.
- Bulk-apply priorities with a retrying script, since
ltuicalls may intermittently time out.
-
Verify all files and Linear issue shape
- Confirm every local issue file contains the new Linear metadata
- Confirm every file is marked
status: deprecated - Sample created issues with
ltui --format json issues view <id> - For relationship migrations, confirm representative children were updated after
relate/block - For priority migrations, sample one issue from each bucket to confirm the mapping landed
Suggested automation pattern
For 20+ issues, write a short Python script that:
- enumerates files
- parses frontmatter + H1 title
- fetches existing project issues once (with pagination)
- creates only missing issues
- rewrites each local file
- optionally parses an archive index / README tree into parent-child dependency pairs
- optionally bulk-applies
relate+blockrelationships in Linear - optionally bulk-normalizes priorities from local severity + curated top lists
- retries
ltuicommands with backoff on transient network errors - verifies required markers are present
- prints a concise migration summary
This is faster and more reliable than manual per-issue CLI calls.
Example commands
List projects:
ltui projects list
List project issues as JSON:
ltui --format json --limit 250 issues list --project <project-id>
Create an issue:
ltui --format json issues create \
--team <team-key> \
--project <project-id> \
--title "Issue title" \
--description @/tmp/issue.md \
--priority 2
Update an issue if needed:
ltui --format json issues update <issue-id-or-key> --state Canceled --title "[test] accidental issue"
Pitfalls
- Do not rely only on
LINEAR_API_KEY;ltuiprofile auth can still be valid. - Put
--format/--limitbefore the subcommand. - Avoid creating test issues unless necessary; if you do, cancel and clearly rename them.
- If the local archive contains non-issue files (indexes, notes, open-question docs), decide explicitly whether they should become Linear issues before bulk creation.
- Verify title uniqueness assumptions before using title-based deduplication.
Good final report
Report:
- how many local files were processed
- how many Linear issues were created vs reused
- what deprecation markers were added locally
- any accidental test artifacts or cleanup items remaining
04 同仓库更多 Skills
网页抓取受阻恢复
blocked-page-recovery
当抓取失败时使用:403/429 状态码、付费墙(paywall)、WAF、机器人验证墙(bot wall)。
软件实施计划编写
writing-plans
在创建或更新可执行的软件计划时使用。除非用户明确要求将计划注册到 Doct,否则请将计划保留为本地文件。
测试驱动开发
test-driven-development
TDD:强制执行「红-绿-重构」(RED-GREEN-REFACTOR)循环,先写测试再写代码。
系统化根因调试
systematic-debugging
四阶段根因调试:先理解缺陷,再着手修复。
技术预研验证
spike
在正式构建前,通过一次性(可丢弃的)实验来验证某个想法。
代码变更并行清理精简
simplify-code
并行使用 3 个智能体(agent)对近期代码变更进行清理精简。