feat(linear-tools): rename from linear-pick-one and add recently-done feature#20
feat(linear-tools): rename from linear-pick-one and add recently-done feature#20
Conversation
uta8a
commented
Feb 11, 2026
- Rename linear-pick-one to linear-tools
- Add fetch:recently-done command to fetch completed tasks within N days (default 7)
- Update CI workflow and documentation (AGENTS.md, copilot-instructions.md, renovate.json5)
- Add completedAt field to Task interface
- Add filterTasksCompletedWithinDays function for date-based filtering
… feature - Rename linear-pick-one to linear-tools - Add fetch:recently-done command to fetch completed tasks within N days (default 7) - Update CI workflow and documentation (AGENTS.md, copilot-instructions.md, renovate.json5) - Add completedAt field to Task interface - Add filterTasksCompletedWithinDays function for date-based filtering
There was a problem hiding this comment.
Pull request overview
linear-pick-one を linear-tools にリネームし、直近完了タスク(Recently Done)を日数指定で取得・保存できる CLI コマンドを追加するPRです。
Changes:
linear-toolsへのリネーム(README/CI/Renovate/ガイド類の更新)fetch:recently-doneコマンド追加と、完了日時 (completedAt) を扱う機能追加- 完了日フィルタ(直近N日)と Recently Done 用 Markdown 出力/保存機能の追加
Reviewed changes
Copilot reviewed 9 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| linear-tools/src/fetch-tasks.ts | completedAt 追加、Recently Done 用整形/保存、直近N日フィルタ等を追加 |
| linear-tools/src/fetch-tasks.test.ts | 新機能(フィルタ/Markdown整形)のテストを追加 |
| linear-tools/src/fetch-recently-done.ts | fetch:recently-done のCLIエントリポイントを新規追加 |
| linear-tools/package.json | パッケージ名変更と fetch:recently-done スクリプト追加 |
| linear-tools/README.md | ツール名変更と Recently Done の使い方/出力形式を追記 |
| AGENTS.md | モジュール名の表記更新 |
| .github/workflows/linear-tools.yml | CI対象パス/表示名を linear-tools に更新 |
| .github/renovate.json5 | Renovate の対象パス/グループ名を linear-tools に更新 |
| .github/copilot-instructions.md | ツール名・利用手順(Recently Done 追加)に合わせて更新 |
| if (import.meta.url === `file://${process.argv[1]}`) { | ||
| main(); | ||
| } |
There was a problem hiding this comment.
pnpm fetch:recently-done は tsx src/fetch-recently-done.ts のように相対パスで起動されるため、import.meta.url(絶対file URL)と file://${process.argv[1]}(相対っぽいURL) が一致せず main() が実行されない可能性が高いです。fileURLToPath(import.meta.url) と path.resolve(process.argv[1]) を比較する(または pathToFileURL を使って argv[1] を正規化する)方式に変更してください。
| tasks: Task[], | ||
| days: number, | ||
| now = new Date() | ||
| ): Task[] { |
There was a problem hiding this comment.
filterTasksCompletedWithinDays が export されている一方で、days <= 0 や NaN のときに暗黙に「常に空配列」になりやすい挙動です(windowMs が 0/負になるため)。APIとしては days を正の整数に制約し、条件を満たさない場合は例外を投げる/明示的にエラーにする/関数コメントで仕様を明記する、のいずれかに寄せるのがおすすめです。
| ): Task[] { | |
| ): Task[] { | |
| if ( | |
| !Number.isFinite(days) || | |
| !Number.isInteger(days) || | |
| days <= 0 | |
| ) { | |
| throw new Error( | |
| `days must be a positive integer, but got: ${String(days)}` | |
| ); | |
| } |
| if (tasks.length === 0) { | ||
| return `# Linear Recently Done Tasks (Last ${days} Days)\n\nNo tasks found.\n`; | ||
| } |
There was a problem hiding this comment.
追加関数に分岐があるものの、テストで未カバーの経路があります。具体的に、(1) formatRecentlyDoneTasksToMarkdown([]) の空配列ケース、(2) formatRecentlyDoneTasksToMarkdown で completedAt: null のときに Unknown になるケース、(3) normalizeCompletedAt の不正値(invalid date文字列等)が null になるケースを Vitest で追加すると回帰を防げます。