ticket
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTicket Management with tk
使用tk进行工单管理
Installation
安装
bash
go install github.com/wedow/ticket/cmd/tk@latestTickets stored as markdown in . Works from any subdirectory.
.tickets/bash
go install github.com/wedow/ticket/cmd/tk@latest工单以Markdown格式存储在目录下,可在任意子目录中使用。
.tickets/What Makes a Complete Ticket
什么是完整的工单
A ticket MUST have ALL of:
-
Clear Acceptance Criteria — Specific, testable "done" conditions
- ✅ "User can login with email/password and receives JWT"
- ❌ "Login works"
-
Clear Requirements — What exactly to build
- ✅ "POST /api/login accepts {email, password}, returns {token, expiresAt}"
- ❌ "Add login endpoint"
-
Design/UI Info (if applicable) — Visual specs, layouts
- ✅ "Login form: email input, password input, submit button. Error in red below form."
-
Atomic + Actionable — One focused task, can start immediately
- ✅ "Implement password reset email"
- ❌ "Improve auth system"
-
Testing Requirements — What to test
- ✅ "Test: valid login→200+token, invalid→401, missing fields→400"
Ask yourself: Can someone implement this without clarifying questions?
一份完整的工单必须包含以下所有内容:
-
清晰的验收标准 — 具体、可测试的“完成”条件
- ✅ “用户可通过邮箱/密码登录并获取JWT”
- ❌ “登录功能可用”
-
明确的需求 — 具体要开发的内容
- ✅ “POST /api/login接口接收{email, password}参数,返回{token, expiresAt}”
- ❌ “添加登录接口”
-
设计/UI信息(如适用)— 视觉规范、布局
- ✅ “登录表单:邮箱输入框、密码输入框、提交按钮。表单下方显示红色错误提示。”
-
原子性+可执行性 — 聚焦单个任务,可立即启动
- ✅ “实现密码重置邮件功能”
- ❌ “改进认证系统”
-
测试要求 — 需要测试的内容
- ✅ “测试场景:有效登录→返回200状态码+token,无效凭证→401,字段缺失→400”
自问: 其他人是否无需进一步询问即可完成该任务?
Quick Reference
快速参考
| Command | Purpose |
|---|---|
| Create ticket |
| List all |
| Ready to work (deps resolved) |
| Waiting on deps |
| View details |
| Open in $EDITOR |
| Change status |
| Add dependency |
| Show dep tree |
| Remove dep |
| Link related |
| Append note |
Supports partial ID matching: matches .
tk show 5c4nw-5c46| 命令 | 用途 |
|---|---|
| 创建工单 |
| 列出所有工单 |
| 查看可开始的任务(依赖已解决) |
| 标记任务为阻塞(等待依赖) |
| 查看工单详情 |
| 在$EDITOR中打开编辑 |
| 修改工单状态 |
| 添加依赖关系 |
| 查看依赖树 |
| 移除依赖关系 |
| 关联相关工单 |
| 添加备注 |
支持ID部分匹配: 可匹配 。
tk show 5c4nw-5c46Creating Complete Tickets
创建完整工单
bash
tk create "Implement JWT login" -t feature -p 1 \
--description "POST /api/login validates creds, returns JWT with 24h expiry" \
--acceptance "- Valid creds → 200 + {token, expiresAt}
- Invalid password → 401
- Missing fields → 400
- Token expires in 24h" \
--tags backend,authOptions: type (bug/feature/task/epic/chore), priority (0-4), description, , , assignee, ,
-t-p-d--acceptance--design-a--parent--tagsbash
tk create "Implement JWT login" -t feature -p 1 \
--description "POST /api/login validates creds, returns JWT with 24h expiry" \
--acceptance "- Valid creds → 200 + {token, expiresAt}
- Invalid password → 401
- Missing fields → 400
- Token expires in 24h" \
--tags backend,auth可选参数: 类型(bug/feature/task/epic/chore), 优先级(0-4), 描述, 验收标准, 设计信息, 经办人, 父工单, 标签
-t-p-d--acceptance--design-a--parent--tagsDependencies
依赖管理
bash
tk dep ticket-a ticket-b # a depends on b
tk dep tree ticket-a # view tree
tk undep ticket-a ticket-b # remove
tk dep cycle # find cyclesbash
tk dep ticket-a ticket-b # 工单a依赖工单b
tk dep tree ticket-a # 查看依赖树
tk undep ticket-a ticket-b # 移除依赖
tk dep cycle # 查找循环依赖Workflow
工作流示例
bash
tk create "Auth system" -t epic # auth-7f3a
tk create "Design schema" --parent auth-7f3a # sch-2b1c
tk create "Login endpoint" --parent auth-7f3a \
--acceptance "POST /login returns JWT" # log-9d4e
tk dep log-9d4e sch-2b1c # login depends on schema
tk ready # shows sch-2b1c
tk close sch-2b1c
tk ready # now shows log-9d4ebash
tk create "Auth system" -t epic # 生成auth-7f3a
tk create "Design schema" --parent auth-7f3a # 生成sch-2b1c
tk create "Login endpoint" --parent auth-7f3a \
--acceptance "POST /login returns JWT" # 生成log-9d4e
tk dep log-9d4e sch-2b1c # 登录工单依赖 schema 工单
tk ready # 显示可处理的sch-2b1c
tk close sch-2b1c
tk ready # 现在显示可处理的log-9d4e