@php-workx/skill-tk 0.1.0

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.
@@ -0,0 +1,233 @@
1
+ # Troubleshooting
2
+
3
+ Common issues and solutions when using tk.
4
+
5
+ ## Contents
6
+
7
+ - [Installation Issues](#installation)
8
+ - [Command Errors](#command-errors)
9
+ - [ID and Matching Issues](#id-issues)
10
+ - [Dependency Issues](#dependency-issues)
11
+ - [Plugin Issues](#plugin-issues)
12
+ - [Git Integration Issues](#git-issues)
13
+
14
+ ---
15
+
16
+ ## Installation Issues {#installation}
17
+
18
+ ### tk command not found
19
+
20
+ **Symptom**: `command not found: tk`
21
+
22
+ **Causes and fixes**:
23
+ 1. Not installed: `brew install ticket`
24
+ 2. Not in PATH: Check `which ticket` — if found, add alias `alias tk=ticket`
25
+ 3. Shell not refreshed: `source ~/.zshrc` or open new terminal
26
+
27
+ ### Missing dependencies
28
+
29
+ **Symptom**: Plugin errors about missing commands
30
+
31
+ | Plugin | Requires | Install |
32
+ |--------|----------|---------|
33
+ | `tk query` | `jq` | `brew install jq` |
34
+ | `tk migrate-beads` | `jq` | `brew install jq` |
35
+ | `tk edit` | `$EDITOR` | Set `export EDITOR=vim` |
36
+
37
+ ---
38
+
39
+ ## Command Errors {#command-errors}
40
+
41
+ ### "No .tickets directory found"
42
+
43
+ **Symptom**: tk can't find the tickets directory
44
+
45
+ **Fix**: Create it manually or run `tk create` which auto-creates `.tickets/`:
46
+
47
+ ```bash
48
+ mkdir .tickets
49
+ # or
50
+ tk create "First ticket" # Auto-creates .tickets/
51
+ ```
52
+
53
+ **Note**: tk walks parent directories looking for `.tickets/`. You can also set `TICKETS_DIR`:
54
+
55
+ ```bash
56
+ export TICKETS_DIR=/path/to/.tickets
57
+ ```
58
+
59
+ ### "Not a valid status"
60
+
61
+ **Symptom**: `tk status <id> <status>` rejects the value
62
+
63
+ **Valid statuses**: `open`, `in_progress`, `closed`
64
+
65
+ ```bash
66
+ # WRONG
67
+ tk status mp-a3x9 done
68
+ tk status mp-a3x9 wip
69
+
70
+ # CORRECT
71
+ tk status mp-a3x9 closed
72
+ tk status mp-a3x9 in_progress
73
+ ```
74
+
75
+ ### Empty output from tk ready
76
+
77
+ **Symptom**: `tk ready` returns nothing
78
+
79
+ **Possible causes**:
80
+ 1. All tickets are closed: `tk ls` to check
81
+ 2. All open tickets are blocked: `tk blocked` to see blockers
82
+ 3. No tickets exist: `tk ls` returns nothing
83
+ 4. Dependency cycle: `tk dep cycle` to check
84
+
85
+ ---
86
+
87
+ ## ID and Matching Issues {#id-issues}
88
+
89
+ ### Partial ID matches multiple tickets
90
+
91
+ **Symptom**: `tk show a3` returns error about ambiguous match
92
+
93
+ **Fix**: Provide more characters:
94
+
95
+ ```bash
96
+ # Ambiguous
97
+ tk show a3
98
+
99
+ # Specific enough
100
+ tk show a3x9
101
+ # or
102
+ tk show mp-a3x9
103
+ ```
104
+
105
+ ### Ticket ID format unexpected
106
+
107
+ **Symptom**: IDs don't match expected prefix
108
+
109
+ **Explanation**: The prefix is derived from the directory name where `.tickets/` was created:
110
+ - `my-project/` → prefix `mp`
111
+ - `api-server/` → prefix `as`
112
+ - `backend/` → prefix `bac`
113
+
114
+ Single-segment names use first 3 characters. Multi-segment names use first letter of each segment.
115
+
116
+ ---
117
+
118
+ ## Dependency Issues {#dependency-issues}
119
+
120
+ ### Ticket stuck in blocked state
121
+
122
+ **Symptom**: Ticket doesn't appear in `tk ready` even though its deps seem resolved
123
+
124
+ **Diagnosis**:
125
+
126
+ ```bash
127
+ # Check what's blocking it
128
+ tk show <id> # Look at ## Blockers section
129
+
130
+ # Check dep tree
131
+ tk dep tree <id>
132
+
133
+ # Verify blocker is actually closed
134
+ tk show <blocker-id> # status should be "closed"
135
+ ```
136
+
137
+ **Common cause**: Blocker ticket has status `open` or `in_progress`, not `closed`.
138
+
139
+ ### Dependency cycle
140
+
141
+ **Symptom**: Multiple tickets never become ready
142
+
143
+ **Diagnosis and fix**:
144
+
145
+ ```bash
146
+ # Find the cycle
147
+ tk dep cycle
148
+ # Output: CYCLE DETECTED: mp-a -> mp-b -> mp-c -> mp-a
149
+
150
+ # Break the cycle by removing one dependency
151
+ tk undep mp-c mp-a # Remove the weakest link
152
+ ```
153
+
154
+ ### Wrong dependency direction
155
+
156
+ **Symptom**: The wrong ticket is blocked
157
+
158
+ ```bash
159
+ # If mp-api should wait for mp-migration:
160
+ # WRONG — blocks migration until API is done
161
+ tk dep mp-migration mp-api
162
+
163
+ # CORRECT — blocks API until migration is done
164
+ tk dep mp-api mp-migration
165
+ ```
166
+
167
+ Read as: "First argument **depends on** second argument."
168
+
169
+ ---
170
+
171
+ ## Plugin Issues {#plugin-issues}
172
+
173
+ ### Plugin not discovered
174
+
175
+ **Symptom**: `tk <plugin-cmd>` says "unknown command"
176
+
177
+ **Checklist**:
178
+ 1. Correct naming: `tk-<cmd>` or `ticket-<cmd>`
179
+ 2. File is executable: `chmod +x tk-<cmd>`
180
+ 3. File is in PATH: `which tk-<cmd>`
181
+ 4. No name collision: `tk help` to see all discovered plugins
182
+
183
+ ### Plugin overrides built-in
184
+
185
+ **Symptom**: Built-in command behaves differently than expected
186
+
187
+ **Fix**: Use `super` to bypass plugins:
188
+
189
+ ```bash
190
+ tk super <cmd> [args] # Always runs built-in
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Git Integration Issues {#git-issues}
196
+
197
+ ### Merge conflicts in .tickets/
198
+
199
+ **Symptom**: Git merge conflicts in ticket files
200
+
201
+ **Resolution approach**:
202
+ 1. Since each ticket is a separate file, conflicts are usually in different files
203
+ 2. If same ticket was modified on both branches, resolve by keeping the more recent version
204
+ 3. Check dependency consistency after resolution: `tk dep cycle`
205
+
206
+ ### Large .tickets/ directory
207
+
208
+ **Symptom**: Hundreds of old ticket files
209
+
210
+ **Cleanup**:
211
+ ```bash
212
+ # See how many closed tickets exist
213
+ tk closed --limit=1000 | wc -l
214
+
215
+ # Consider archiving old closed tickets
216
+ mkdir .tickets/archive
217
+ # Move old closed tickets manually
218
+ ```
219
+
220
+ **Note**: tk does not currently have a built-in archive command. This is a manual process.
221
+
222
+ ### .tickets/ not tracked by git
223
+
224
+ **Symptom**: Tickets lost after checkout or clone
225
+
226
+ **Fix**: Ensure `.tickets/` is committed to git:
227
+
228
+ ```bash
229
+ git add .tickets/
230
+ git commit -m "tk: track tickets in git"
231
+ ```
232
+
233
+ Check that `.gitignore` doesn't exclude `.tickets/`.
@@ -0,0 +1,289 @@
1
+ # Workflows and Checklists
2
+
3
+ Step-by-step workflows for common tk usage patterns.
4
+
5
+ ## Contents
6
+
7
+ - [Session Start Workflow](#session-start)
8
+ - [Compaction Survival](#compaction-survival)
9
+ - [Discovery and Ticket Creation](#discovery)
10
+ - [Status Maintenance](#status-maintenance)
11
+ - [Epic Planning](#epic-planning)
12
+ - [Broad Parent Handling](#broad-parent-handling)
13
+ - [Parent/Child Reconciliation](#parent-child-reconciliation)
14
+ - [Side Quest Handling](#side-quests)
15
+ - [Multi-Session Resume](#resume)
16
+ - [Integration with Task Tools](#integration-with-task-tools)
17
+ - [Checklist Templates](#checklist-templates)
18
+
19
+ ## Session Start Workflow {#session-start}
20
+
21
+ **tk is available when**: `.tickets/` directory exists in the project or any parent directory.
22
+
23
+ **Automatic checklist at session start:**
24
+
25
+ ```
26
+ Session Start (when tk is available):
27
+ - [ ] Run tk ready
28
+ - [ ] Report: "X tickets ready to work on: [summary]"
29
+ - [ ] If none ready, check tk blocked
30
+ - [ ] Suggest next action based on findings
31
+ ```
32
+
33
+ **Pattern**: Always run `tk ready` when starting work. Report status immediately to establish shared context.
34
+
35
+ **Directory discovery**: tk walks parent directories upward from `$PWD` looking for `.tickets/`. The `TICKETS_DIR` env var overrides this search.
36
+
37
+ ---
38
+
39
+ ## Compaction Survival {#compaction-survival}
40
+
41
+ **Critical**: After compaction events, conversation history is deleted but tickets persist in `.tickets/`. Tickets are your persistent memory.
42
+
43
+ **Post-compaction recovery checklist:**
44
+
45
+ ```
46
+ After Compaction:
47
+ - [ ] Run tk ls --status=in_progress to see active work
48
+ - [ ] Run tk ready to see what's actionable
49
+ - [ ] Read notes on in-progress tickets for context
50
+ - [ ] Resume work based on ticket state
51
+ ```
52
+
53
+ **Why this works**: Tickets are plain markdown files in git. They survive compaction, session boundaries, and even machine changes.
54
+
55
+ ---
56
+
57
+ ## Discovery and Ticket Creation {#discovery}
58
+
59
+ **During implementation**, you'll discover bugs, technical debt, and follow-up work. Capture it immediately.
60
+
61
+ ### Capture Pattern
62
+
63
+ ```bash
64
+ # Bug found during feature work
65
+ tk create "Fix: null check missing in auth middleware" -t bug -p 1 --tags auth
66
+
67
+ # Follow-up work identified
68
+ tk create "Refactor: extract validation into shared module" -t chore -p 3
69
+
70
+ # Link discovered work to current ticket
71
+ tk link mp-current mp-discovered
72
+ ```
73
+
74
+ ### Blocker Found
75
+
76
+ ```bash
77
+ # Create the blocker
78
+ tk create "Schema migration needed for new fields" -t task -p 1
79
+ # Output: mp-e1r2
80
+
81
+ # Add dependency from current work
82
+ tk dep mp-current mp-e1r2
83
+
84
+ # Current ticket now shows as blocked until migration is done
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Status Maintenance {#status-maintenance}
90
+
91
+ Keep ticket statuses current to maintain trust in `tk ready` and `tk blocked`.
92
+
93
+ ```
94
+ Status Transition Rules:
95
+ - Starting work → tk start <id>
96
+ - Work complete → tk close <id>
97
+ - Need to reopen → tk reopen <id>
98
+ - Before session end → update notes on in-progress tickets
99
+ ```
100
+
101
+ **Critical**: If you `tk start` a ticket, either `tk close` it or update its notes before the session ends. Stale `in_progress` tickets poison the queue.
102
+
103
+ ---
104
+
105
+ ## Epic Planning {#epic-planning}
106
+
107
+ ### Decompose into Execution-Ready Children
108
+
109
+ ```bash
110
+ # Create the epic
111
+ tk create "User Authentication System" -t epic -p 1
112
+ # Output: mp-a3x9
113
+
114
+ # Create children with dependencies
115
+ tk create "Database schema for users table" --parent mp-a3x9 -t task -p 1
116
+ # Output: mp-b2y7
117
+
118
+ tk create "Password hashing service" --parent mp-a3x9 -t task -p 1
119
+ # Output: mp-c4z1
120
+
121
+ tk create "Login/register API endpoints" --parent mp-a3x9 -t task -p 1
122
+ # Output: mp-d6w3
123
+
124
+ tk create "JWT token middleware" --parent mp-a3x9 -t task -p 2
125
+ # Output: mp-e1r2
126
+
127
+ # Add sequential dependencies
128
+ tk dep mp-c4z1 mp-b2y7 # Hashing needs schema
129
+ tk dep mp-d6w3 mp-b2y7 # Endpoints need schema
130
+ tk dep mp-d6w3 mp-c4z1 # Endpoints need hashing
131
+ tk dep mp-e1r2 mp-d6w3 # Middleware needs endpoints
132
+ ```
133
+
134
+ **Result**: `tk ready` returns `mp-b2y7` first. As children close, the next ones unlock.
135
+
136
+ ---
137
+
138
+ ## Broad Parent Handling {#broad-parent-handling}
139
+
140
+ **Scenario**: `tk ready` surfaces a parent ticket that is too broad to implement directly.
141
+
142
+ **Pattern**:
143
+ 1. Read the parent with `tk show <parent-id>`
144
+ 2. Identify what specific gap remains
145
+ 3. Create a focused child ticket for that gap
146
+ 4. Implement the child
147
+ 5. Reconcile the parent (see below)
148
+
149
+ ```bash
150
+ # Read the broad parent
151
+ tk show mp-a3x9
152
+
153
+ # Create focused child for remaining work
154
+ tk create "Add rate limiting to upload endpoint (100 req/min)" \
155
+ --parent mp-a3x9 -t task -p 2
156
+
157
+ # Implement the child, then close it
158
+ tk close mp-new-child
159
+
160
+ # Reconcile parent — is there more work?
161
+ tk show mp-a3x9 # Check children status
162
+ tk close mp-a3x9 # If all gaps are filled
163
+ ```
164
+
165
+ ---
166
+
167
+ ## Parent/Child Reconciliation {#parent-child-reconciliation}
168
+
169
+ After closing a child, always check the parent:
170
+
171
+ ```
172
+ Reconciliation Checklist:
173
+ - [ ] tk show <parent-id> — read current state
174
+ - [ ] Are all children closed?
175
+ - YES → tk close <parent-id>
176
+ - NO → Update parent notes with remaining work
177
+ - [ ] Do parent notes reflect current reality?
178
+ - NO → tk add-note <parent-id> "Updated: child X closed, remaining: Y, Z"
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Side Quest Handling {#side-quests}
184
+
185
+ When you discover unrelated work during a task:
186
+
187
+ ### Quick Assessment
188
+
189
+ ```
190
+ Is this a blocker for current work?
191
+ YES → Create ticket, add dep, switch to it
192
+ NO → Create ticket, link it, continue current work
193
+ ```
194
+
195
+ ### Capture Without Context Switch
196
+
197
+ ```bash
198
+ # Capture the side quest
199
+ tk create "Found: API returns 500 on empty payload" -t bug -p 1 --tags api
200
+
201
+ # Link to current work for context
202
+ tk link mp-current mp-side-quest
203
+
204
+ # Continue current work — side quest is tracked for later
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Multi-Session Resume {#resume}
210
+
211
+ Returning after days/weeks away:
212
+
213
+ ```bash
214
+ # 1. What's in progress?
215
+ tk ls --status=in_progress
216
+
217
+ # 2. Read notes on active tickets
218
+ tk show <each-in-progress-id>
219
+
220
+ # 3. What's ready to pick up?
221
+ tk ready
222
+
223
+ # 4. What's blocked?
224
+ tk blocked
225
+
226
+ # 5. Start working from tk ready list
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Integration with Task Tools {#integration-with-task-tools}
232
+
233
+ **Both tools complement each other at different timescales:**
234
+
235
+ ### Temporal Layering Pattern
236
+
237
+ **Task tools** (short-term, this hour):
238
+ - Tactical execution: "Review Section 3", "Add test for edge case"
239
+ - Marked completed via TaskUpdate as you go
240
+ - Ephemeral: resets when session ends
241
+
242
+ **tk tickets** (long-term, this week/month):
243
+ - Strategic objectives: "Implement OAuth flow"
244
+ - Key decisions and outcomes in notes
245
+ - Persistent: survives compaction and session boundaries
246
+
247
+ **Key insight**: Task tools = working copy for the current hour. Tickets = project journal for the current month.
248
+
249
+ ### The Handoff Pattern
250
+
251
+ 1. **Session start**: Read ticket → Create tasks for immediate actions
252
+ 2. **During work**: Mark tasks completed as you go
253
+ 3. **Reach milestone**: `tk add-note <id>` with outcomes + context
254
+ 4. **Session end**: Tasks reset, ticket notes survive with enriched state
255
+
256
+ ---
257
+
258
+ ## Checklist Templates {#checklist-templates}
259
+
260
+ ### Starting Any Work Session
261
+
262
+ ```
263
+ - [ ] tk ready — see what's actionable
264
+ - [ ] Pick highest-priority ready ticket
265
+ - [ ] tk show <id> — read full context and notes
266
+ - [ ] tk start <id> — mark as in progress
267
+ - [ ] Create session tasks from ticket description
268
+ ```
269
+
270
+ ### Completing Work
271
+
272
+ ```
273
+ - [ ] Verify acceptance criteria met
274
+ - [ ] tk add-note <id> "COMPLETED: <what was done>"
275
+ - [ ] tk close <id>
276
+ - [ ] Reconcile parent if this was a child ticket
277
+ - [ ] git add .tickets/ && git commit -m "tk: close <id>"
278
+ ```
279
+
280
+ ### Planning Complex Features
281
+
282
+ ```
283
+ - [ ] Create epic ticket (-t epic)
284
+ - [ ] Decompose into 3-7 child tickets
285
+ - [ ] Add dependencies between children
286
+ - [ ] tk dep cycle — verify no cycles
287
+ - [ ] tk ready — verify first ticket(s) are unblocked
288
+ - [ ] git add .tickets/ && git commit -m "tk: plan <epic-title>"
289
+ ```