storage-taskwarrior
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent Purpose: Manage Taskwarrior tasks using the current project's git repository remote URL as a project ID.
Project ID Generation: Automatically slugified from git remote URL
- Example: →
git@github.com:zenobi-us/dotfiles.gitzenobi-us-dotfiles - Stored in Taskwarrior attribute for easy filtering
project
Agent用途: 以当前项目Git仓库的远程URL作为项目ID,管理Taskwarrior任务。
项目ID生成: 自动将Git远程URL转换为短格式标识符
- 示例:→
git@github.com:zenobi-us/dotfiles.gitzenobi-us-dotfiles - 存储在Taskwarrior的属性中,便于筛选
project
Core Capabilities
核心功能
1. Automatic Project ID Resolution
1. 自动解析项目ID
The agent automatically:
- Detects the git repository remote URL:
git config --get remote.origin.url - Extracts owner and repo: →
github.com:{owner}/{repo}.git{owner}-{repo} - Uses this as the filter for all task commands
project - Allows manual override via environment variable:
TASK_PROJECT_ID
该Agent会自动执行以下操作:
- 检测Git仓库的远程URL:
git config --get remote.origin.url - 提取所有者和仓库名:→
github.com:{owner}/{repo}.git{owner}-{repo} - 将此作为所有任务命令的筛选条件
project - 允许通过环境变量手动覆盖
TASK_PROJECT_ID
2. Task Listing & Search
2. 任务列表与搜索
List all tasks for this project:
bash
task project:$PROJECT_ID listSearch tasks by tags:
bash
task project:$PROJECT_ID +tag listFilter by status:
bash
task project:$PROJECT_ID status:pending list
task project:$PROJECT_ID status:completed listFilter by priority:
bash
task project:$PROJECT_ID priority:H list
task project:$PROJECT_ID priority:L listComplex filtering:
bash
task project:$PROJECT_ID +bug priority:H status:pending list列出当前项目的所有任务:
bash
task project:$PROJECT_ID list按标签搜索任务:
bash
task project:$PROJECT_ID +tag list按状态筛选:
bash
task project:$PROJECT_ID status:pending list
task project:$PROJECT_ID status:completed list按优先级筛选:
bash
task project:$PROJECT_ID priority:H list
task project:$PROJECT_ID priority:L list复杂筛选:
bash
task project:$PROJECT_ID +bug priority:H status:pending list3. Task CRUD Operations
3. 任务CRUD操作
Add a new task:
bash
task project:$PROJECT_ID add "Task description" +tag priority:HCreate task with full attributes:
bash
task project:$PROJECT_ID add "Implementation task" project:$PROJECT_ID +feature +backend priority:MUpdate existing task:
bash
task project:$PROJECT_ID 5 modify priority:H +urgent
task project:$PROJECT_ID 5 modify "New description" -old-tag +new-tagDelete task:
bash
task project:$PROJECT_ID 5 deleteMark task as done:
bash
task project:$PROJECT_ID 5 done添加新任务:
bash
task project:$PROJECT_ID add "Task description" +tag priority:H创建包含完整属性的任务:
bash
task project:$PROJECT_ID add "Implementation task" project:$PROJECT_ID +feature +backend priority:M更新现有任务:
bash
task project:$PROJECT_ID 5 modify priority:H +urgent
task project:$PROJECT_ID 5 modify "New description" -old-tag +new-tag删除任务:
bash
task project:$PROJECT_ID 5 delete标记任务为已完成:
bash
task project:$PROJECT_ID 5 done4. Task Analysis & Reporting
4. 任务分析与报告
View task statistics:
bash
task project:$PROJECT_ID statsShow task summary by status:
bash
task project:$PROJECT_ID summaryList active tasks:
bash
task project:$PROJECT_ID active list查看任务统计信息:
bash
task project:$PROJECT_ID stats按状态显示任务摘要:
bash
task project:$PROJECT_ID summary列出活跃任务:
bash
task project:$PROJECT_ID active list5. Export & Import
5. 导出与导入
Export tasks to JSON:
bash
task project:$PROJECT_ID export > backup.jsonImport tasks from JSON:
bash
task import backup.json将任务导出为JSON:
bash
task project:$PROJECT_ID export > backup.json从JSON导入任务:
bash
task import backup.jsonImplementation Guidelines
实施指南
When implementing commands that use this agent:
-
Always extract project ID first:
- Run:
git config --get remote.origin.url | sed -E 's/.*[:/]([^/]+)\/([^/.]+)(\.git)?$/\1-\2/' - Store in variable
$PROJECT_ID - Allow override:
${TASK_PROJECT_ID:-$PROJECT_ID}
- Run:
-
All task operations must include project filter:
- Use:
task project:$PROJECT_ID [filter] [command] - Never run without project filter in automated scripts
task [command]
- Use:
-
Handle edge cases:
- No tasks found: Return empty list gracefully
- Invalid project ID: Validate format (alphanumeric + dash only)
- Missing .task directory: Initialize with
task config report.next.labels ''
-
Provide human-readable output:
- Parse JSON export for programmatic use
- Format list output with clear columns and highlighting
- Show task counts in summaries
在实现使用该Agent的命令时:
-
始终先提取项目ID:
- 执行:
git config --get remote.origin.url | sed -E 's/.*[:/]([^/]+)\/([^/.]+)(\.git)?$/\1-\2/' - 存储在变量中
$PROJECT_ID - 允许覆盖:
${TASK_PROJECT_ID:-$PROJECT_ID}
- 执行:
-
所有任务操作必须包含项目筛选条件:
- 使用:
task project:$PROJECT_ID [filter] [command] - 在自动化脚本中,切勿在不带项目筛选条件的情况下运行
task [command]
- 使用:
-
处理边缘情况:
- 未找到任务:优雅地返回空列表
- 无效项目ID:验证格式(仅允许字母数字和连字符)
- 缺少.task目录:使用初始化
task config report.next.labels ''
-
提供易读的输出:
- 解析JSON导出内容以用于程序化调用
- 格式化列表输出,使用清晰的列和高亮显示
- 在摘要中显示任务数量
Command Examples
命令示例
Search with Multiple Filters
多条件搜索
bash
undefinedbash
undefinedFind urgent bugs with high priority
查找高优先级的紧急Bug
task project:zenobi-us-dotfiles +bug priority:H list
task project:zenobi-us-dotfiles +bug priority:H list
Find pending tasks with high priority
查找高优先级的待处理任务
task project:zenobi-us-dotfiles status:pending priority:H +important list
undefinedtask project:zenobi-us-dotfiles status:pending priority:H +important list
undefinedBatch Operations
批量操作
bash
undefinedbash
undefinedMark all overdue tasks as waiting
将所有逾期任务标记为等待状态
task project:zenobi-us-dotfiles overdue modify +waiting
task project:zenobi-us-dotfiles overdue modify +waiting
Add same tag to multiple tasks
为多个任务添加相同标签
task project:zenobi-us-dotfiles 1,2,3 modify +reviewed
undefinedtask project:zenobi-us-dotfiles 1,2,3 modify +reviewed
undefinedComplex Filtering
复杂筛选
bash
undefinedbash
undefinedFind tasks matching pattern
查找描述中包含Bug的任务
task project:zenobi-us-dotfiles 'description~Bug' list
task project:zenobi-us-dotfiles 'description~Bug' list
Combine filters with AND/OR
使用AND/OR组合筛选条件
task project:zenobi-us-dotfiles '(priority:H or status:pending)' list
undefinedtask project:zenobi-us-dotfiles '(priority:H or status:pending)' list
undefinedIntegration Points
集成点
This agent works with:
- Taskwarrior: Primary task management backend
- Git: Automatic project ID from repository metadata
- OpenCode Commands: workflow integration
/project:do:task - Bash/Scripts: Export/import for CI/CD automation
该Agent可与以下工具集成:
- Taskwarrior:主要任务管理后端
- Git:从仓库元数据自动获取项目ID
- OpenCode Commands:与工作流集成
/project:do:task - Bash/Scripts:通过导出/导入实现CI/CD自动化
Reference
参考资料
- Taskwarrior Documentation: https://taskwarrior.org
- Project filtering:
task help | grep project - Full filter syntax: or
man taskfiltertask help usage
- Taskwarrior文档:https://taskwarrior.org
- 项目筛选:
task help | grep project - 完整筛选语法:或
man taskfiltertask help usage