team-toon-tack 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/README.zh-TW.md +28 -28
- package/bin/cli.ts +4 -4
- package/package.json +3 -2
- package/scripts/sync.ts +2 -2
- package/scripts/utils.ts +2 -2
package/README.md
CHANGED
|
@@ -88,9 +88,9 @@ After `ttt init`, your project will have:
|
|
|
88
88
|
|
|
89
89
|
```
|
|
90
90
|
your-project/
|
|
91
|
-
├── config.
|
|
92
|
-
├── local.
|
|
93
|
-
└── cycle.
|
|
91
|
+
├── config.ttt # Team configuration (gitignore recommended)
|
|
92
|
+
├── local.ttt # Personal settings (gitignore)
|
|
93
|
+
└── cycle.ttt # Current cycle data (gitignore, auto-generated)
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Custom Config Directory
|
|
@@ -104,7 +104,7 @@ export TOON_DIR=./team
|
|
|
104
104
|
ttt sync
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
### config.
|
|
107
|
+
### config.ttt
|
|
108
108
|
|
|
109
109
|
Team-wide configuration (fetched from Linear):
|
|
110
110
|
|
|
@@ -130,7 +130,7 @@ current_cycle:
|
|
|
130
130
|
name: Cycle #1
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
### local.
|
|
133
|
+
### local.ttt
|
|
134
134
|
|
|
135
135
|
Personal settings:
|
|
136
136
|
|
|
@@ -142,7 +142,7 @@ exclude_assignees[1]: bob
|
|
|
142
142
|
|
|
143
143
|
| Field | Description |
|
|
144
144
|
|-------|-------------|
|
|
145
|
-
| `current_user` | Your user key from config.
|
|
145
|
+
| `current_user` | Your user key from config.ttt |
|
|
146
146
|
| `label` | Filter issues by label (optional) |
|
|
147
147
|
| `exclude_assignees` | Hide issues from these users (optional) |
|
|
148
148
|
|
package/README.zh-TW.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
|
21
|
-
│ Linear │────▶│ ttt sync │────▶│ cycle.
|
|
21
|
+
│ Linear │────▶│ ttt sync │────▶│ cycle.ttt │
|
|
22
22
|
│ (雲端) │ │ │ │ (本地) │
|
|
23
23
|
└─────────────┘ └──────────────┘ └─────────────┘
|
|
24
24
|
│
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
|
|
34
34
|
1. **同步 (sync)**
|
|
35
35
|
- 從 Linear API 抓取當前 Cycle 的任務
|
|
36
|
-
- 根據 `local.
|
|
37
|
-
- 寫入 `cycle.
|
|
36
|
+
- 根據 `local.ttt` 設定過濾(標籤、排除指派人)
|
|
37
|
+
- 寫入 `cycle.ttt`,包含完整任務資訊
|
|
38
38
|
|
|
39
39
|
2. **開始任務 (work-on)**
|
|
40
|
-
- 讀取 `cycle.
|
|
40
|
+
- 讀取 `cycle.ttt` 中的待處理任務
|
|
41
41
|
- 更新本地狀態為 `in-progress`
|
|
42
42
|
- 同步更新 Linear 狀態為 "In Progress"
|
|
43
43
|
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
### 檔案結構與用途
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
.
|
|
54
|
-
├── config.
|
|
53
|
+
.ttt/ # 配置目錄(建議 gitignore)
|
|
54
|
+
├── config.ttt # 團隊配置
|
|
55
55
|
│ ├── teams # Linear 團隊 ID 映射
|
|
56
56
|
│ ├── users # 成員 ID/email 映射
|
|
57
57
|
│ ├── labels # 標籤 ID 映射
|
|
58
58
|
│ ├── statuses # 狀態定義
|
|
59
59
|
│ └── current_cycle # 當前 Cycle 資訊
|
|
60
60
|
│
|
|
61
|
-
├── local.
|
|
61
|
+
├── local.ttt # 個人設定(必須 gitignore)
|
|
62
62
|
│ ├── current_user # 你的 user key
|
|
63
63
|
│ ├── label # 過濾標籤
|
|
64
64
|
│ └── exclude_assignees # 排除的指派人
|
|
65
65
|
│
|
|
66
|
-
└── cycle.
|
|
66
|
+
└── cycle.ttt # 任務資料(自動產生)
|
|
67
67
|
├── cycleId # Cycle UUID
|
|
68
68
|
├── cycleName # Cycle 名稱
|
|
69
69
|
├── updatedAt # 最後同步時間
|
|
@@ -98,7 +98,7 @@ bun add -g team-toon-tack
|
|
|
98
98
|
export LINEAR_API_KEY="lin_api_xxxxx"
|
|
99
99
|
|
|
100
100
|
# 2. 初始化(會從 Linear 抓取團隊資料)
|
|
101
|
-
mkdir .
|
|
101
|
+
mkdir .ttt && cd .ttt
|
|
102
102
|
ttt init
|
|
103
103
|
|
|
104
104
|
# 3. 同步任務
|
|
@@ -114,13 +114,13 @@ ttt work-on
|
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
116
|
# 早上開始工作前,同步最新任務
|
|
117
|
-
ttt sync -d .
|
|
117
|
+
ttt sync -d .ttt
|
|
118
118
|
|
|
119
119
|
# 查看待處理任務並選擇一個開始
|
|
120
|
-
ttt work-on -d .
|
|
120
|
+
ttt work-on -d .ttt
|
|
121
121
|
|
|
122
122
|
# Claude Code 現在可以讀取任務內容
|
|
123
|
-
# 在 .
|
|
123
|
+
# 在 .ttt/cycle.ttt 中找到任務描述、附件等
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
### 情境 2:搭配 Claude Code 自動化
|
|
@@ -137,14 +137,14 @@ description: Sync Linear issues to local TOON file
|
|
|
137
137
|
|
|
138
138
|
# Sync Linear Issues
|
|
139
139
|
|
|
140
|
-
Fetch current cycle's issues from Linear to `.
|
|
140
|
+
Fetch current cycle's issues from Linear to `.ttt/cycle.ttt`.
|
|
141
141
|
|
|
142
142
|
## Process
|
|
143
143
|
|
|
144
144
|
### 1. Run Sync
|
|
145
145
|
|
|
146
146
|
\`\`\`bash
|
|
147
|
-
ttt sync -d .
|
|
147
|
+
ttt sync -d .ttt
|
|
148
148
|
\`\`\`
|
|
149
149
|
|
|
150
150
|
### 2. Review Output
|
|
@@ -179,7 +179,7 @@ Select a task and update status to "In Progress" on both local and Linear.
|
|
|
179
179
|
### 1. Run Command
|
|
180
180
|
|
|
181
181
|
\`\`\`bash
|
|
182
|
-
ttt work-on -d .
|
|
182
|
+
ttt work-on -d .ttt $ARGUMENTS
|
|
183
183
|
\`\`\`
|
|
184
184
|
|
|
185
185
|
### 2. Review Issue Details
|
|
@@ -216,7 +216,7 @@ Mark a task as done and update Linear with commit details.
|
|
|
216
216
|
|
|
217
217
|
### 1. Determine Issue ID
|
|
218
218
|
|
|
219
|
-
Check `.
|
|
219
|
+
Check `.ttt/cycle.ttt` for tasks with `localStatus: in-progress`.
|
|
220
220
|
|
|
221
221
|
### 2. Write Fix Summary
|
|
222
222
|
|
|
@@ -228,7 +228,7 @@ Prepare a concise summary (1-3 sentences) covering:
|
|
|
228
228
|
### 3. Run Command
|
|
229
229
|
|
|
230
230
|
\`\`\`bash
|
|
231
|
-
ttt done -d .
|
|
231
|
+
ttt done -d .ttt $ARGUMENTS -m "修復說明"
|
|
232
232
|
\`\`\`
|
|
233
233
|
|
|
234
234
|
## What It Does
|
|
@@ -236,7 +236,7 @@ ttt done -d .toon $ARGUMENTS -m "修復說明"
|
|
|
236
236
|
- Linear issue status → "Done"
|
|
237
237
|
- Adds comment with commit hash, message, and diff summary
|
|
238
238
|
- Parent issue (if exists) → "Testing"
|
|
239
|
-
- Local status → `completed` in `.
|
|
239
|
+
- Local status → `completed` in `.ttt/cycle.ttt`
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
#### 使用方式
|
|
@@ -263,7 +263,7 @@ Claude Code 會自動:
|
|
|
263
263
|
git add . && git commit -m "feat: implement feature X"
|
|
264
264
|
|
|
265
265
|
# 標記任務完成,會自動在 Linear 新增留言
|
|
266
|
-
ttt done -d .
|
|
266
|
+
ttt done -d .ttt -m "實作了 X 功能,修改了 Y 元件"
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
Linear 上會自動新增留言:
|
|
@@ -287,7 +287,7 @@ Linear 上會自動新增留言:
|
|
|
287
287
|
|
|
288
288
|
前端工程師只想看前端任務:
|
|
289
289
|
```toon
|
|
290
|
-
# local.
|
|
290
|
+
# local.ttt
|
|
291
291
|
current_user: alice
|
|
292
292
|
label: Frontend
|
|
293
293
|
exclude_assignees[1]: bob # 排除後端同事的任務
|
|
@@ -296,7 +296,7 @@ exclude_assignees[2]: charlie
|
|
|
296
296
|
|
|
297
297
|
後端工程師的設定:
|
|
298
298
|
```toon
|
|
299
|
-
# local.
|
|
299
|
+
# local.ttt
|
|
300
300
|
current_user: bob
|
|
301
301
|
label: Backend
|
|
302
302
|
```
|
|
@@ -306,12 +306,12 @@ label: Backend
|
|
|
306
306
|
```bash
|
|
307
307
|
# 專案 A
|
|
308
308
|
cd project-a
|
|
309
|
-
ttt sync -d .
|
|
309
|
+
ttt sync -d .ttt
|
|
310
310
|
|
|
311
311
|
# 專案 B(不同 Linear 團隊)
|
|
312
312
|
cd ../project-b
|
|
313
|
-
ttt init -d .
|
|
314
|
-
ttt sync -d .
|
|
313
|
+
ttt init -d .ttt # 初始化不同的配置
|
|
314
|
+
ttt sync -d .ttt
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
### 情境 6:CI/CD 整合
|
|
@@ -328,11 +328,11 @@ jobs:
|
|
|
328
328
|
steps:
|
|
329
329
|
- uses: actions/checkout@v4
|
|
330
330
|
- run: npm install -g team-toon-tack
|
|
331
|
-
- run: ttt sync -d .
|
|
331
|
+
- run: ttt sync -d .ttt
|
|
332
332
|
env:
|
|
333
333
|
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
|
|
334
334
|
- run: |
|
|
335
|
-
git add .
|
|
335
|
+
git add .ttt/cycle.ttt
|
|
336
336
|
git commit -m "chore: sync linear tasks" || true
|
|
337
337
|
git push
|
|
338
338
|
```
|
|
@@ -411,7 +411,7 @@ TOON 是一種人類可讀的資料格式,類似 YAML 但更簡潔。相比 JS
|
|
|
411
411
|
- 支援註解
|
|
412
412
|
- AI 助手更容易理解
|
|
413
413
|
|
|
414
|
-
### Q: config.
|
|
414
|
+
### Q: config.ttt 可以提交到 Git 嗎?
|
|
415
415
|
|
|
416
416
|
可以,但建議 gitignore。因為包含:
|
|
417
417
|
- 團隊成員的 email
|
|
@@ -421,7 +421,7 @@ TOON 是一種人類可讀的資料格式,類似 YAML 但更簡潔。相比 JS
|
|
|
421
421
|
|
|
422
422
|
### Q: 如何處理衝突?
|
|
423
423
|
|
|
424
|
-
`cycle.
|
|
424
|
+
`cycle.ttt` 是自動產生的,直接用 `ttt sync` 重新同步即可。
|
|
425
425
|
|
|
426
426
|
### Q: 支援哪些 Linear 功能?
|
|
427
427
|
|
package/bin/cli.ts
CHANGED
|
@@ -19,19 +19,19 @@ USAGE:
|
|
|
19
19
|
|
|
20
20
|
COMMANDS:
|
|
21
21
|
init Initialize config files in current directory
|
|
22
|
-
sync Sync issues from Linear to local cycle.
|
|
22
|
+
sync Sync issues from Linear to local cycle.ttt
|
|
23
23
|
work-on Start working on a task (interactive or by ID)
|
|
24
24
|
done Mark current task as completed
|
|
25
25
|
help Show this help message
|
|
26
26
|
version Show version
|
|
27
27
|
|
|
28
28
|
GLOBAL OPTIONS:
|
|
29
|
-
-d, --dir <path> Config directory (default:
|
|
29
|
+
-d, --dir <path> Config directory (default: .ttt)
|
|
30
30
|
Can also set via TOON_DIR environment variable
|
|
31
31
|
|
|
32
32
|
EXAMPLES:
|
|
33
|
-
ttt init # Initialize
|
|
34
|
-
ttt init -d ./
|
|
33
|
+
ttt init # Initialize .ttt directory
|
|
34
|
+
ttt init -d ./custom # Initialize in custom directory
|
|
35
35
|
ttt sync # Sync from Linear
|
|
36
36
|
ttt work-on # Interactive task selection
|
|
37
37
|
ttt work-on MP-123 # Work on specific issue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-toon-tack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Linear task sync & management CLI with TOON format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "bun bin/cli.ts",
|
|
22
22
|
"build": "bun build bin/cli.ts --outdir dist --target node",
|
|
23
|
-
"prepublishOnly": "bun run build"
|
|
23
|
+
"prepublishOnly": "bun run build",
|
|
24
|
+
"release": "npm config set //registry.npmjs.org/:_authToken=$NPM_PUBLISH_KEY && npm publish"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@linear/sdk": "^29.0.0",
|
package/scripts/sync.ts
CHANGED
|
@@ -7,7 +7,7 @@ async function sync() {
|
|
|
7
7
|
if (args.includes('--help') || args.includes('-h')) {
|
|
8
8
|
console.log(`Usage: ttt sync
|
|
9
9
|
|
|
10
|
-
Sync issues from Linear to local cycle.
|
|
10
|
+
Sync issues from Linear to local cycle.ttt file.
|
|
11
11
|
|
|
12
12
|
What it does:
|
|
13
13
|
- Fetches active cycle from Linear
|
|
@@ -17,7 +17,7 @@ What it does:
|
|
|
17
17
|
|
|
18
18
|
Examples:
|
|
19
19
|
ttt sync # Sync in current directory
|
|
20
|
-
ttt sync -d .
|
|
20
|
+
ttt sync -d .ttt # Sync using .ttt directory`);
|
|
21
21
|
process.exit(0);
|
|
22
22
|
}
|
|
23
23
|
|
package/scripts/utils.ts
CHANGED
|
@@ -15,8 +15,8 @@ function getBaseDir(): string {
|
|
|
15
15
|
return path.resolve(process.env.LINEAR_TOON_DIR);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// 3. Default: current working directory
|
|
19
|
-
return process.cwd();
|
|
18
|
+
// 3. Default: .ttt directory in current working directory
|
|
19
|
+
return path.join(process.cwd(), '.ttt');
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const BASE_DIR = getBaseDir();
|