trak_flow 0.1.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.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/.envrc +3 -0
  3. data/CHANGELOG.md +69 -0
  4. data/COMMITS.md +196 -0
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +281 -0
  7. data/README.md +479 -0
  8. data/Rakefile +16 -0
  9. data/bin/tf +6 -0
  10. data/bin/tf_mcp +81 -0
  11. data/docs/.keep +0 -0
  12. data/docs/api/database.md +434 -0
  13. data/docs/api/ruby-library.md +349 -0
  14. data/docs/api/task-model.md +341 -0
  15. data/docs/assets/stylesheets/extra.css +53 -0
  16. data/docs/assets/trak_flow.jpg +0 -0
  17. data/docs/cli/admin-commands.md +369 -0
  18. data/docs/cli/dependency-commands.md +321 -0
  19. data/docs/cli/label-commands.md +222 -0
  20. data/docs/cli/overview.md +163 -0
  21. data/docs/cli/plan-commands.md +344 -0
  22. data/docs/cli/task-commands.md +333 -0
  23. data/docs/core-concepts/dependencies.md +232 -0
  24. data/docs/core-concepts/labels.md +217 -0
  25. data/docs/core-concepts/overview.md +178 -0
  26. data/docs/core-concepts/plans-workflows.md +264 -0
  27. data/docs/core-concepts/tasks.md +205 -0
  28. data/docs/getting-started/configuration.md +120 -0
  29. data/docs/getting-started/installation.md +79 -0
  30. data/docs/getting-started/quick-start.md +245 -0
  31. data/docs/index.md +169 -0
  32. data/docs/mcp/integration.md +302 -0
  33. data/docs/mcp/overview.md +206 -0
  34. data/docs/mcp/resources.md +284 -0
  35. data/docs/mcp/tools.md +457 -0
  36. data/examples/basic_usage.rb +365 -0
  37. data/examples/cli_demo.sh +314 -0
  38. data/examples/mcp/Gemfile +9 -0
  39. data/examples/mcp/Gemfile.lock +226 -0
  40. data/examples/mcp/http_demo.rb +232 -0
  41. data/examples/mcp/stdio_demo.rb +146 -0
  42. data/lib/trak_flow/cli/admin_commands.rb +136 -0
  43. data/lib/trak_flow/cli/config_commands.rb +260 -0
  44. data/lib/trak_flow/cli/dep_commands.rb +71 -0
  45. data/lib/trak_flow/cli/label_commands.rb +76 -0
  46. data/lib/trak_flow/cli/main_commands.rb +386 -0
  47. data/lib/trak_flow/cli/plan_commands.rb +185 -0
  48. data/lib/trak_flow/cli/workflow_commands.rb +133 -0
  49. data/lib/trak_flow/cli.rb +110 -0
  50. data/lib/trak_flow/config/defaults.yml +114 -0
  51. data/lib/trak_flow/config/section.rb +74 -0
  52. data/lib/trak_flow/config.rb +276 -0
  53. data/lib/trak_flow/graph/dependency_graph.rb +288 -0
  54. data/lib/trak_flow/id_generator.rb +52 -0
  55. data/lib/trak_flow/mcp/resources/base_resource.rb +25 -0
  56. data/lib/trak_flow/mcp/resources/dependency_graph.rb +31 -0
  57. data/lib/trak_flow/mcp/resources/label_list.rb +21 -0
  58. data/lib/trak_flow/mcp/resources/plan_by_id.rb +27 -0
  59. data/lib/trak_flow/mcp/resources/plan_list.rb +21 -0
  60. data/lib/trak_flow/mcp/resources/task_by_id.rb +31 -0
  61. data/lib/trak_flow/mcp/resources/task_list.rb +21 -0
  62. data/lib/trak_flow/mcp/resources/task_next.rb +30 -0
  63. data/lib/trak_flow/mcp/resources/workflow_by_id.rb +27 -0
  64. data/lib/trak_flow/mcp/resources/workflow_list.rb +21 -0
  65. data/lib/trak_flow/mcp/server.rb +140 -0
  66. data/lib/trak_flow/mcp/tools/base_tool.rb +29 -0
  67. data/lib/trak_flow/mcp/tools/comment_add.rb +33 -0
  68. data/lib/trak_flow/mcp/tools/dep_add.rb +34 -0
  69. data/lib/trak_flow/mcp/tools/dep_remove.rb +25 -0
  70. data/lib/trak_flow/mcp/tools/label_add.rb +28 -0
  71. data/lib/trak_flow/mcp/tools/label_remove.rb +25 -0
  72. data/lib/trak_flow/mcp/tools/plan_add_step.rb +35 -0
  73. data/lib/trak_flow/mcp/tools/plan_create.rb +33 -0
  74. data/lib/trak_flow/mcp/tools/plan_run.rb +58 -0
  75. data/lib/trak_flow/mcp/tools/plan_start.rb +58 -0
  76. data/lib/trak_flow/mcp/tools/task_block.rb +27 -0
  77. data/lib/trak_flow/mcp/tools/task_close.rb +26 -0
  78. data/lib/trak_flow/mcp/tools/task_create.rb +51 -0
  79. data/lib/trak_flow/mcp/tools/task_defer.rb +27 -0
  80. data/lib/trak_flow/mcp/tools/task_start.rb +25 -0
  81. data/lib/trak_flow/mcp/tools/task_update.rb +36 -0
  82. data/lib/trak_flow/mcp/tools/workflow_discard.rb +28 -0
  83. data/lib/trak_flow/mcp/tools/workflow_summarize.rb +34 -0
  84. data/lib/trak_flow/mcp.rb +38 -0
  85. data/lib/trak_flow/models/comment.rb +71 -0
  86. data/lib/trak_flow/models/dependency.rb +96 -0
  87. data/lib/trak_flow/models/label.rb +90 -0
  88. data/lib/trak_flow/models/task.rb +188 -0
  89. data/lib/trak_flow/storage/database.rb +638 -0
  90. data/lib/trak_flow/storage/jsonl.rb +259 -0
  91. data/lib/trak_flow/time_parser.rb +15 -0
  92. data/lib/trak_flow/version.rb +5 -0
  93. data/lib/trak_flow.rb +100 -0
  94. data/mkdocs.yml +143 -0
  95. metadata +392 -0
@@ -0,0 +1,222 @@
1
+ # Label Commands
2
+
3
+ Commands for managing task labels.
4
+
5
+ ## Add Label
6
+
7
+ Add a label to a task.
8
+
9
+ ```bash
10
+ tf label add TASK_ID LABEL
11
+ ```
12
+
13
+ ### Examples
14
+
15
+ ```bash
16
+ tf label add tf-abc123 "frontend"
17
+ tf label add tf-abc123 "urgent"
18
+ tf label add tf-abc123 "v2.0"
19
+ ```
20
+
21
+ ## Remove Label
22
+
23
+ Remove a label from a task.
24
+
25
+ ```bash
26
+ tf label remove TASK_ID LABEL
27
+ ```
28
+
29
+ ### Examples
30
+
31
+ ```bash
32
+ tf label remove tf-abc123 "urgent"
33
+ ```
34
+
35
+ ## List Labels
36
+
37
+ ### Labels on a Task
38
+
39
+ ```bash
40
+ tf label list TASK_ID
41
+ ```
42
+
43
+ #### Output
44
+
45
+ ```
46
+ Labels for tf-abc123:
47
+ - frontend
48
+ - urgent
49
+ - v2.0
50
+ ```
51
+
52
+ ### All Labels in Project
53
+
54
+ ```bash
55
+ tf label list-all
56
+ ```
57
+
58
+ #### Output
59
+
60
+ ```
61
+ All labels:
62
+ - backend (3 tasks)
63
+ - frontend (5 tasks)
64
+ - urgent (2 tasks)
65
+ - v2.0 (8 tasks)
66
+ ```
67
+
68
+ ## Filter by Label
69
+
70
+ Use `--label` with the list command:
71
+
72
+ ```bash
73
+ # Single label
74
+ tf list --label frontend
75
+ tf list -l urgent
76
+
77
+ # Multiple labels (AND)
78
+ tf list --label frontend --label urgent
79
+ ```
80
+
81
+ Multiple labels shows tasks with ALL specified labels.
82
+
83
+ ## Label Naming
84
+
85
+ ### Conventions
86
+
87
+ Labels are case-sensitive strings. Common conventions:
88
+
89
+ | Category | Examples |
90
+ |----------|----------|
91
+ | Components | `frontend`, `backend`, `api`, `database` |
92
+ | Priority | `urgent`, `quick-win`, `stretch-goal` |
93
+ | Version | `v1.0`, `v2.0`, `next-release` |
94
+ | Team | `team-a`, `team-b`, `platform` |
95
+ | Status | `needs-review`, `blocked-external`, `ready-for-qa` |
96
+ | Type | `tech-debt`, `documentation`, `security` |
97
+
98
+ ### Best Practices
99
+
100
+ 1. **Use lowercase** - `frontend` not `Frontend`
101
+ 2. **Use hyphens** - `needs-review` not `needs_review`
102
+ 3. **Be consistent** - Agree on conventions with your team
103
+ 4. **Keep it simple** - Fewer labels = easier to manage
104
+
105
+ ## Use Cases
106
+
107
+ ### Component Tracking
108
+
109
+ ```bash
110
+ tf label add tf-abc123 "frontend"
111
+ tf label add tf-def456 "backend"
112
+ tf label add tf-ghi789 "api"
113
+
114
+ # Find all frontend tasks
115
+ tf list --label frontend
116
+ ```
117
+
118
+ ### Sprint Planning
119
+
120
+ ```bash
121
+ tf label add tf-abc123 "sprint-42"
122
+ tf label add tf-def456 "sprint-42"
123
+
124
+ # Sprint backlog
125
+ tf list --label sprint-42 --status open
126
+ ```
127
+
128
+ ### Release Management
129
+
130
+ ```bash
131
+ tf label add tf-abc123 "v2.0"
132
+ tf label add tf-def456 "v2.0"
133
+
134
+ # What's in v2.0?
135
+ tf list --label v2.0
136
+
137
+ # What's not done for v2.0?
138
+ tf list --label v2.0 --status open
139
+ ```
140
+
141
+ ### Priority Escalation
142
+
143
+ ```bash
144
+ # Mark as urgent
145
+ tf label add tf-abc123 "urgent"
146
+
147
+ # Find all urgent tasks
148
+ tf list --label urgent
149
+
150
+ # De-escalate
151
+ tf label remove tf-abc123 "urgent"
152
+ ```
153
+
154
+ ### Workflow States
155
+
156
+ Labels can track custom workflow states:
157
+
158
+ ```bash
159
+ tf label add tf-abc123 "needs-review"
160
+ tf label add tf-abc123 "in-qa"
161
+ tf label add tf-abc123 "approved"
162
+
163
+ # Find tasks needing review
164
+ tf list --label needs-review
165
+ ```
166
+
167
+ ## Bulk Operations
168
+
169
+ ### Add Label to Multiple Tasks
170
+
171
+ ```bash
172
+ # Using shell loop
173
+ for id in tf-abc123 tf-def456 tf-ghi789; do
174
+ tf label add $id "sprint-42"
175
+ done
176
+ ```
177
+
178
+ ### Remove Label from All Tasks
179
+
180
+ ```bash
181
+ # Find all tasks with label and remove
182
+ tf list --label old-label --json | \
183
+ jq -r '.[].id' | \
184
+ xargs -I {} tf label remove {} "old-label"
185
+ ```
186
+
187
+ ### Rename a Label
188
+
189
+ ```bash
190
+ # Remove old, add new
191
+ tf list --label old-name --json | \
192
+ jq -r '.[].id' | \
193
+ while read id; do
194
+ tf label remove $id "old-name"
195
+ tf label add $id "new-name"
196
+ done
197
+ ```
198
+
199
+ ## Labels vs Other Features
200
+
201
+ | Use Case | Use Labels | Use Dependencies | Use Priority |
202
+ |----------|------------|------------------|--------------|
203
+ | Grouping | Yes | No | No |
204
+ | Blocking work | No | Yes | No |
205
+ | Filtering | Yes | Limited | Yes |
206
+ | Order/sequence | No | Yes | Yes |
207
+ | Urgency | Maybe | No | Yes |
208
+ | Categories | Yes | No | No |
209
+
210
+ ### When to Use Labels
211
+
212
+ - Categorization without blocking
213
+ - Cross-cutting concerns
214
+ - Temporary states
215
+ - Filtering/search
216
+ - Organizing by component, team, or version
217
+
218
+ ### When NOT to Use Labels
219
+
220
+ - Representing task priority (use priority field)
221
+ - Blocking relationships (use dependencies)
222
+ - Hierarchical organization (use parent_id)
@@ -0,0 +1,163 @@
1
+ # CLI Overview
2
+
3
+ TrakFlow provides a powerful command-line interface (`tf`) for managing tasks, plans, workflows, and dependencies.
4
+
5
+ ## Basic Usage
6
+
7
+ ```bash
8
+ tf COMMAND [SUBCOMMAND] [OPTIONS]
9
+ ```
10
+
11
+ ## Getting Help
12
+
13
+ ```bash
14
+ # List all commands
15
+ tf help
16
+
17
+ # Help for a specific command
18
+ tf help create
19
+ tf help plan
20
+
21
+ # Subcommand help
22
+ tf plan help start
23
+ ```
24
+
25
+ ## Command Categories
26
+
27
+ | Category | Command | Description |
28
+ |----------|---------|-------------|
29
+ | **Tasks** | `tf create` | Create new tasks |
30
+ | | `tf list` | List tasks with filters |
31
+ | | `tf show` | Show task details |
32
+ | | `tf update` | Modify task properties |
33
+ | | `tf start` | Begin working on a task |
34
+ | | `tf close` | Complete a task |
35
+ | | `tf block` | Mark task as blocked |
36
+ | | `tf defer` | Postpone a task |
37
+ | | `tf reopen` | Reopen a closed task |
38
+ | **Plans** | `tf plan create` | Create a Plan blueprint |
39
+ | | `tf plan add` | Add step to a Plan |
40
+ | | `tf plan show` | View Plan details |
41
+ | | `tf plan start` | Create persistent Workflow |
42
+ | | `tf plan execute` | Create ephemeral Workflow |
43
+ | **Workflows** | `tf workflow list` | List Workflows |
44
+ | | `tf workflow show` | View Workflow progress |
45
+ | | `tf workflow summarize` | Summarize and close |
46
+ | | `tf workflow discard` | Discard ephemeral Workflow |
47
+ | | `tf workflow gc` | Garbage collect |
48
+ | **Dependencies** | `tf dep add` | Add dependency |
49
+ | | `tf dep remove` | Remove dependency |
50
+ | | `tf dep tree` | Show dependency tree |
51
+ | | `tf ready` | Find ready tasks |
52
+ | **Labels** | `tf label add` | Add label to task |
53
+ | | `tf label remove` | Remove label |
54
+ | | `tf label list` | List labels on task |
55
+ | | `tf label list-all` | List all labels |
56
+ | **Comments** | `tf comment add` | Add comment to task |
57
+ | | `tf comment list` | List task comments |
58
+ | **Admin** | `tf admin init` | Initialize TrakFlow |
59
+ | | `tf admin export` | Export to JSONL |
60
+ | | `tf admin import` | Import from JSONL |
61
+ | | `tf admin graph` | Generate dependency graph |
62
+ | | `tf admin analyze` | Analyze project |
63
+
64
+ ## Common Options
65
+
66
+ Most commands support these options:
67
+
68
+ | Option | Description |
69
+ |--------|-------------|
70
+ | `--json` | Output in JSON format |
71
+ | `--quiet`, `-q` | Suppress non-essential output |
72
+ | `--verbose`, `-v` | Show detailed output |
73
+ | `--help`, `-h` | Show command help |
74
+
75
+ ## Task ID Format
76
+
77
+ TrakFlow uses hash-based IDs:
78
+
79
+ ```
80
+ tf-a1b2c3d4
81
+ ```
82
+
83
+ You can use partial IDs if unique:
84
+
85
+ ```bash
86
+ tf show tf-a1b # Works if only one ID starts with tf-a1b
87
+ tf show a1b # Also works without the tf- prefix
88
+ ```
89
+
90
+ ## Output Formats
91
+
92
+ ### Default (Human-Readable)
93
+
94
+ ```bash
95
+ tf list
96
+ ```
97
+
98
+ ```
99
+ ID Title Status Priority
100
+ tf-abc123 Fix login bug in_progress high
101
+ tf-def456 Add OAuth support open medium
102
+ tf-ghi789 Update documentation open low
103
+ ```
104
+
105
+ ### JSON Output
106
+
107
+ ```bash
108
+ tf list --json
109
+ ```
110
+
111
+ ```json
112
+ [
113
+ {"id": "tf-abc123", "title": "Fix login bug", "status": "in_progress", "priority": 1},
114
+ {"id": "tf-def456", "title": "Add OAuth support", "status": "open", "priority": 2}
115
+ ]
116
+ ```
117
+
118
+ ## Environment Variables
119
+
120
+ | Variable | Description | Default |
121
+ |----------|-------------|---------|
122
+ | `TRAK_FLOW_DIR` | Data directory location | `.trak_flow` |
123
+ | `TRAK_FLOW_DEBUG` | Enable debug output | `false` |
124
+ | `TRAK_FLOW_COLOR` | Color output | `true` |
125
+
126
+ ## Shell Completion
127
+
128
+ ### Bash
129
+
130
+ ```bash
131
+ # Add to ~/.bashrc
132
+ eval "$(tf completion bash)"
133
+ ```
134
+
135
+ ### Zsh
136
+
137
+ ```bash
138
+ # Add to ~/.zshrc
139
+ eval "$(tf completion zsh)"
140
+ ```
141
+
142
+ ### Fish
143
+
144
+ ```bash
145
+ # Add to ~/.config/fish/config.fish
146
+ tf completion fish | source
147
+ ```
148
+
149
+ ## Exit Codes
150
+
151
+ | Code | Meaning |
152
+ |------|---------|
153
+ | 0 | Success |
154
+ | 1 | General error |
155
+ | 2 | Invalid arguments |
156
+ | 3 | Task not found |
157
+ | 4 | Validation error |
158
+
159
+ ## Next Steps
160
+
161
+ - [Task Commands](task-commands.md) - Create and manage tasks
162
+ - [Plan Commands](plan-commands.md) - Work with Plans and Workflows
163
+ - [Dependency Commands](dependency-commands.md) - Manage task relationships
@@ -0,0 +1,344 @@
1
+ # Plan & Workflow Commands
2
+
3
+ Commands for creating and managing Plans (blueprints) and Workflows (running instances).
4
+
5
+ ## Plan Commands
6
+
7
+ ### Create Plan
8
+
9
+ Create a new Plan blueprint.
10
+
11
+ ```bash
12
+ tf plan create TITLE [OPTIONS]
13
+ ```
14
+
15
+ #### Options
16
+
17
+ | Option | Short | Description |
18
+ |--------|-------|-------------|
19
+ | `--description` | `-d` | Plan description |
20
+
21
+ #### Examples
22
+
23
+ ```bash
24
+ tf plan create "Deploy to Production"
25
+
26
+ tf plan create "Release Checklist" -d "Standard release process"
27
+ ```
28
+
29
+ ### Add Step to Plan
30
+
31
+ Add a task definition to a Plan.
32
+
33
+ ```bash
34
+ tf plan add PLAN_ID STEP_TITLE [OPTIONS]
35
+ ```
36
+
37
+ #### Options
38
+
39
+ | Option | Short | Description |
40
+ |--------|-------|-------------|
41
+ | `--description` | `-d` | Step description |
42
+ | `--type` | `-t` | Step type |
43
+ | `--priority` | `-p` | Step priority |
44
+
45
+ #### Examples
46
+
47
+ ```bash
48
+ tf plan add tf-plan1 "Run test suite"
49
+ tf plan add tf-plan1 "Build Docker image"
50
+ tf plan add tf-plan1 "Deploy to staging"
51
+ tf plan add tf-plan1 "Run smoke tests"
52
+ tf plan add tf-plan1 "Deploy to production"
53
+ ```
54
+
55
+ ### Show Plan
56
+
57
+ Display Plan details and steps.
58
+
59
+ ```bash
60
+ tf plan show PLAN_ID
61
+ ```
62
+
63
+ #### Output
64
+
65
+ ```
66
+ Plan: Deploy to Production [tf-plan1]
67
+ Status: open (blueprint)
68
+ Steps: 5
69
+
70
+ [ ] Run test suite
71
+ [ ] Build Docker image
72
+ [ ] Deploy to staging
73
+ [ ] Run smoke tests
74
+ [ ] Deploy to production
75
+ ```
76
+
77
+ ### List Plans
78
+
79
+ List all Plan blueprints.
80
+
81
+ ```bash
82
+ tf plan list [OPTIONS]
83
+ ```
84
+
85
+ #### Options
86
+
87
+ | Option | Short | Description |
88
+ |--------|-------|-------------|
89
+ | `--json` | | Output as JSON |
90
+
91
+ ### Convert Task to Plan
92
+
93
+ Convert an existing task into a Plan.
94
+
95
+ ```bash
96
+ tf plan convert TASK_ID
97
+ ```
98
+
99
+ This sets `plan: true` on the task, making it a reusable blueprint.
100
+
101
+ ### Start Workflow (Persistent)
102
+
103
+ Create a persistent Workflow from a Plan.
104
+
105
+ ```bash
106
+ tf plan start PLAN_ID [OPTIONS]
107
+ ```
108
+
109
+ #### Options
110
+
111
+ | Option | Short | Description |
112
+ |--------|-------|-------------|
113
+ | `--title` | `-t` | Custom Workflow title |
114
+
115
+ #### Examples
116
+
117
+ ```bash
118
+ tf plan start tf-plan1
119
+
120
+ tf plan start tf-plan1 --title "Deploy v1.2.0"
121
+ ```
122
+
123
+ Persistent Workflows:
124
+ - Are exported to JSONL
125
+ - Appear in `tf workflow list`
126
+ - Kept after completion for history
127
+
128
+ ### Execute Workflow (Ephemeral)
129
+
130
+ Create an ephemeral Workflow from a Plan.
131
+
132
+ ```bash
133
+ tf plan execute PLAN_ID [OPTIONS]
134
+ ```
135
+
136
+ #### Options
137
+
138
+ | Option | Short | Description |
139
+ |--------|-------|-------------|
140
+ | `--title` | `-t` | Custom Workflow title |
141
+
142
+ #### Examples
143
+
144
+ ```bash
145
+ tf plan execute tf-plan1
146
+
147
+ tf plan execute tf-plan1 --title "Quick deploy"
148
+ ```
149
+
150
+ Ephemeral Workflows:
151
+ - NOT exported to JSONL
152
+ - Auto-cleaned after completion
153
+ - For temporary operations
154
+
155
+ ## Workflow Commands
156
+
157
+ ### List Workflows
158
+
159
+ List all Workflows.
160
+
161
+ ```bash
162
+ tf workflow list [OPTIONS]
163
+ ```
164
+
165
+ #### Options
166
+
167
+ | Option | Short | Description |
168
+ |--------|-------|-------------|
169
+ | `--ephemeral` | `-e` | Only ephemeral Workflows |
170
+ | `--persistent` | `-p` | Only persistent Workflows |
171
+ | `--status` | `-s` | Filter by status |
172
+ | `--plan` | | Filter by source Plan |
173
+ | `--json` | | Output as JSON |
174
+
175
+ #### Examples
176
+
177
+ ```bash
178
+ # All Workflows
179
+ tf workflow list
180
+
181
+ # Only ephemeral
182
+ tf workflow list -e
183
+
184
+ # Only in-progress
185
+ tf workflow list -s in_progress
186
+
187
+ # From a specific Plan
188
+ tf workflow list --plan tf-plan1
189
+ ```
190
+
191
+ ### Show Workflow
192
+
193
+ Display Workflow details and progress.
194
+
195
+ ```bash
196
+ tf workflow show WORKFLOW_ID
197
+ ```
198
+
199
+ #### Output
200
+
201
+ ```
202
+ Workflow: Deploy v1.2.0 [tf-wf1]
203
+ Source Plan: tf-plan1
204
+ Type: Persistent
205
+ Status: in_progress
206
+
207
+ [x] Run test suite
208
+ [x] Build Docker image
209
+ [~] Deploy to staging
210
+ [ ] Run smoke tests
211
+ [ ] Deploy to production
212
+
213
+ Progress: 2/5 completed
214
+ ```
215
+
216
+ Legend:
217
+ - `[x]` - Completed
218
+ - `[~]` - In progress
219
+ - `[ ]` - Open
220
+ - `[!]` - Blocked
221
+
222
+ ### Summarize Workflow
223
+
224
+ Add a summary and close a Workflow.
225
+
226
+ ```bash
227
+ tf workflow summarize WORKFLOW_ID --summary "SUMMARY"
228
+ ```
229
+
230
+ #### Examples
231
+
232
+ ```bash
233
+ tf workflow summarize tf-wf1 --summary "Deployed v1.2.0 successfully"
234
+
235
+ tf workflow summarize tf-wf1 -s "Failed: staging smoke tests"
236
+ ```
237
+
238
+ This:
239
+ 1. Adds the summary to Workflow notes
240
+ 2. Closes the Workflow
241
+ 3. Records completion timestamp
242
+
243
+ ### Discard Workflow
244
+
245
+ Delete an ephemeral Workflow.
246
+
247
+ ```bash
248
+ tf workflow discard WORKFLOW_ID
249
+ ```
250
+
251
+ !!! note
252
+ Only ephemeral Workflows can be discarded.
253
+
254
+ ### Garbage Collect
255
+
256
+ Clean up old ephemeral Workflows.
257
+
258
+ ```bash
259
+ tf workflow gc [OPTIONS]
260
+ ```
261
+
262
+ #### Options
263
+
264
+ | Option | Description |
265
+ |--------|-------------|
266
+ | `--older-than` | Age threshold (default: 7d) |
267
+ | `--dry-run` | Show what would be deleted |
268
+
269
+ #### Examples
270
+
271
+ ```bash
272
+ # Default cleanup
273
+ tf workflow gc
274
+
275
+ # Clean Workflows older than 24 hours
276
+ tf workflow gc --older-than 24h
277
+
278
+ # Preview without deleting
279
+ tf workflow gc --dry-run
280
+ ```
281
+
282
+ ## Example: Complete Workflow
283
+
284
+ ### 1. Create a Plan
285
+
286
+ ```bash
287
+ tf plan create "Code Review Process"
288
+ tf plan add tf-plan1 "Check code style"
289
+ tf plan add tf-plan1 "Review logic"
290
+ tf plan add tf-plan1 "Check test coverage"
291
+ tf plan add tf-plan1 "Security review"
292
+ tf plan add tf-plan1 "Approve or request changes"
293
+ ```
294
+
295
+ ### 2. Start a Workflow
296
+
297
+ ```bash
298
+ tf plan start tf-plan1 --title "Review PR #42"
299
+ ```
300
+
301
+ ### 3. Work Through Tasks
302
+
303
+ ```bash
304
+ # Start first task
305
+ tf start tf-task1
306
+ tf close tf-task1
307
+
308
+ # Continue with remaining tasks
309
+ tf start tf-task2
310
+ tf close tf-task2
311
+
312
+ # ... etc
313
+ ```
314
+
315
+ ### 4. Complete the Workflow
316
+
317
+ ```bash
318
+ tf workflow summarize tf-wf1 --summary "Approved with minor suggestions"
319
+ ```
320
+
321
+ ## Use Case: Release Process
322
+
323
+ ```bash
324
+ # Create the Plan once
325
+ tf plan create "Release Process"
326
+ tf plan add tf-release "Update version in package.json"
327
+ tf plan add tf-release "Update CHANGELOG.md"
328
+ tf plan add tf-release "Run full test suite"
329
+ tf plan add tf-release "Build release artifacts"
330
+ tf plan add tf-release "Create GitHub release"
331
+ tf plan add tf-release "Deploy to production"
332
+ tf plan add tf-release "Announce on social media"
333
+
334
+ # For each release, start a Workflow
335
+ tf plan start tf-release --title "Release v2.0.0"
336
+
337
+ # Work through the checklist
338
+ tf start tf-task1
339
+ tf close tf-task1
340
+ # ...
341
+
342
+ # Summarize when done
343
+ tf workflow summarize tf-wf1 --summary "Released v2.0.0"
344
+ ```