Documentation management and task tracking tool, enforces the SSOT (Single Source of Truth) principle, supports GitHub-style Issues and PRs workflows.
Execution Environment
| Path Type | Path | Base Directory |
|---|---|---|
| Skill Directory | ~/.pi/agent/skills/workhub/ |
Fixed Location |
| Main Script | ~/.pi/agent/skills/workhub/lib.ts |
Skill Directory |
| Project Documentation Directory | ./docs/ |
Working Directory (the current directory when executing commands) |
Standard Document Structure
docs/
├── adr/ # 架构决策记录
├── architecture/ # 架构设计文档
├── issues/ # 任务跟踪
│ ├── [模块分类]/ # 可选:按模块分类
│ │ └── yyyymmdd-[描述].md
│ └── yyyymmdd-[描述].md
├── pr/ # 变更记录
│ ├── [模块分类]/
│ │ └── yyyymmdd-[描述].md
│ └── yyyymmdd-[描述].md
└── guides/ # 使用指南
Invocation Commands
# 正确方式:从项目目录执行
cd /path/to/your/project
~/.pi/agent/skills/workhub/lib.ts <command>
Document Operations
1. Initialize (init)
Create the standard document directory structure.
~/.pi/agent/skills/workhub/lib.ts init
2. View Structure (tree)
Display the document directory tree.
~/.pi/agent/skills/workhub/lib.ts tree
3. Audit Compliance (audit)
Check whether the docs/ folder follows the standard specification.
~/.pi/agent/skills/workhub/lib.ts audit
4. Read Document (read)
Read documents by keyword or relative path.
~/.pi/agent/skills/workhub/lib.ts read issues/20250106-添加深色模式.md
5. Create Issue (create issue)
Create a new Issue file, automatically using the template.
~/.pi/agent/skills/workhub/lib.ts create issue "添加深色模式" 前端
6. Create PR (create pr)
Create a new PR file, automatically using the template.
~/.pi/agent/skills/workhub/lib.ts create pr "修复登录bug" 后端
7. List Issues (list issues)
List all Issues and their statuses.
~/.pi/agent/skills/workhub/lib.ts list issues
8. List PRs (list prs)
List all PRs and their statuses.
~/.pi/agent/skills/workhub/lib.ts list prs
9. View Status (status)
Display a status overview of all Issues and PRs.
~/.pi/agent/skills/workhub/lib.ts status
10. Search Content (search)
Search for keywords in Issues and PRs.
~/.pi/agent/skills/workhub/lib.ts search "深色模式"
GitHub-Style Workflow
Issue Workflow
1. 创建 Issue 文件 (使用模板)
→ docs/issues/yyyymmdd-[描述].md
或 docs/issues/[模块分类]/yyyymmdd-[描述].md
2. 填写 Goal、Phases、Acceptance Criteria
3. 执行阶段:
- Read Issue 文件(刷新目标)
- 完成子任务 → 更新复选框 [x]
- 遇到错误 → 记录到 "Errors Encountered"
- 记录 Notes → 保存研究发现
4. 完成后创建 PR 文件
→ docs/pr/yyyymmdd-[描述].md
5. PR 文件关联 Issue 文件名
→ 包含回滚计划、测试验证
PR Workflow
1. 创建 PR 文件 (使用模板)
→ docs/pr/yyyymmdd-[描述].md
或 docs/pr/[模块分类]/yyyymmdd-[描述].md
2. 填写背景、变更内容、测试验证、回滚计划
3. 关联 Issue 文件名
→ 在 "关联 Issue" 中填写完整路径
4. 代码审查和合并
→ 记录审查日志
→ 更新最终状态
Core Principles
1. SSOT (Single Source of Truth)
- Each knowledge domain has only one authoritative document
- Issues are the single source for task tracking
- PRs are the single source for change records
2. The File System Is Memory
- Save large output content to files instead of piling it into context
- Keep only file paths in working memory
- Read via
workhub readwhen needed
3. State Management
- Read the Issue before deciding: refresh goals, maintain focus
- Update the Issue after acting: mark [x], update Status
- Error Logging: record in the Issue's "Errors Encountered"
4. Changes Are Traceable
- Each PR must be linked to an Issue
- Issues record the complete decision-making process
- PRs record change details and rollback plans
Best Practices
Create Issue
# 1. 初始化文档结构(首次)
~/.pi/agent/skills/workhub/lib.ts init
# 2. 创建 Issue 文件
~/.pi/agent/skills/workhub/lib.ts create issue "添加深色模式" 前端
# 3. 编辑文件,填写 Goal、Phases、Acceptance Criteria
Execute Issue
# 1. 读取 Issue(刷新目标)
~/.pi/agent/skills/workhub/lib.ts read issues/前端/20250106-添加深色模式.md
# 2. 完成子任务后更新 Issue
# 编辑文件,标记复选框 [x]
# 3. 遇到错误时记录
# 在 "Errors Encountered" 表格中添加记录
Create PR
# 1. 创建 PR 文件
~/.pi/agent/skills/workhub/lib.ts create pr "添加深色模式" 前端
# 2. 编辑文件,填写变更内容、测试验证、回滚计划
# 3. 关联 Issue 文件名
# 在 "关联 Issue" 中填写完整路径
Error Recovery Patterns
# 1. 读取 Issue
~/.pi/agent/skills/workhub/lib.ts read issues/20250106-添加深色模式.md
# 2. 在 "Errors Encountered" 中记录
| 日期 | 错误 | 解决方案 |
| 2025-01-06 | FileNotFoundError | 创建默认配置 |
# 3. 执行解决方案
# 创建默认配置文件
# 4. 更新 Issue 的 Notes
Quick Reference
| Command | Function | Example |
|---|---|---|
init |
Initialize document structure | ~/.pi/agent/skills/workhub/lib.ts init |
tree |
View document structure | ~/.pi/agent/skills/workhub/lib.ts tree |
audit |
Audit document compliance | ~/.pi/agent/skills/workhub/lib.ts audit |
read |
Read document | ~/.pi/agent/skills/workhub/lib.ts read issues/xxx.md |
create issue |
Create Issue | ~/.pi/agent/skills/workhub/lib.ts create issue "描述" [分类] |
create pr |
Create PR | ~/.pi/agent/skills/workhub/lib.ts create pr "描述" [分类] |
list issues |
List all Issues | ~/.pi/agent/skills/workhub/lib.ts list issues |
list prs |
List all PRs | ~/.pi/agent/skills/workhub/lib.ts list prs |
status |
View overall status | ~/.pi/agent/skills/workhub/lib.ts status |
search |
Search content | ~/.pi/agent/skills/workhub/lib.ts search "关键词" |
Extension plans
Features that may be added in the future:
- Interactively create Issue
- Interactively create PR
- Link Issue and PR