@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,228 @@
1
+ # CLI Command Reference
2
+
3
+ **For:** AI agents and developers using the tk (ticket) command-line interface
4
+
5
+ ## Quick Navigation
6
+
7
+ - [Finding Work](#finding-work)
8
+ - [Ticket Lifecycle](#ticket-lifecycle)
9
+ - [Dependencies](#dependencies)
10
+ - [Links](#links)
11
+ - [Notes](#notes)
12
+ - [Listing and Querying](#listing-and-querying)
13
+ - [Escape Hatch](#escape-hatch)
14
+
15
+ ## Finding Work
16
+
17
+ ### Ready Tickets (unblocked)
18
+
19
+ ```bash
20
+ # List open/in_progress tickets with all deps resolved
21
+ tk ready
22
+
23
+ # Filter by assignee or tag
24
+ tk ready -a "Jane Doe"
25
+ tk ready -T backend
26
+ ```
27
+
28
+ Output format (sorted by priority then ID):
29
+ ```
30
+ mp-a3x9 [P1][open] - Implement auth endpoint
31
+ mp-b2y7 [P2][in_progress] - Add input validation
32
+ ```
33
+
34
+ ### Blocked Tickets
35
+
36
+ ```bash
37
+ # List tickets with unresolved deps
38
+ tk blocked
39
+ tk blocked -a "Jane Doe"
40
+ tk blocked -T urgent
41
+ ```
42
+
43
+ Output format:
44
+ ```
45
+ mp-c4z1 [P1][open] - Deploy to prod <- [mp-a3x9, mp-b2y7]
46
+ ```
47
+
48
+ ### Closed Tickets
49
+
50
+ ```bash
51
+ # Recently closed (default 20, sorted by mtime)
52
+ tk closed
53
+ tk closed --limit=5
54
+ tk closed -a "Jane Doe"
55
+ ```
56
+
57
+ ## Ticket Lifecycle
58
+
59
+ ### Create
60
+
61
+ ```bash
62
+ # Basic creation — prints the generated ID
63
+ tk create "Fix login redirect bug"
64
+
65
+ # Full options
66
+ tk create "Implement OAuth flow" \
67
+ -d "Add Google and GitHub OAuth providers" \
68
+ --design "Use passport.js strategy pattern" \
69
+ --acceptance "Users can log in with Google or GitHub" \
70
+ -t feature \
71
+ -p 1 \
72
+ -a "Jane Doe" \
73
+ --tags ui,auth,backend \
74
+ --parent mp-a3x9 \
75
+ --external-ref gh-456
76
+ ```
77
+
78
+ **Create flags:**
79
+
80
+ | Flag | Short | Description | Default |
81
+ |------|-------|-------------|---------|
82
+ | `--description` | `-d` | Description text | — |
83
+ | `--design` | — | Design/implementation notes | — |
84
+ | `--acceptance` | — | Acceptance criteria | — |
85
+ | `--type` | `-t` | `bug\|feature\|task\|epic\|chore` | `task` |
86
+ | `--priority` | `-p` | 0-4, 0=highest | `2` |
87
+ | `--assignee` | `-a` | Assignee name | `git user.name` |
88
+ | `--tags` | — | Comma-separated tags | — |
89
+ | `--parent` | — | Parent ticket ID | — |
90
+ | `--external-ref` | — | External ref (e.g., `gh-123`, `JIRA-456`) | — |
91
+
92
+ ### Status Transitions
93
+
94
+ ```bash
95
+ tk start <id> # open → in_progress
96
+ tk close <id> # any → closed
97
+ tk reopen <id> # closed → open
98
+ tk status <id> <status> # Set to any valid status
99
+ ```
100
+
101
+ Valid statuses: `open`, `in_progress`, `closed`
102
+
103
+ ### Show Ticket
104
+
105
+ ```bash
106
+ tk show <id>
107
+ ```
108
+
109
+ Displays the full ticket markdown plus dynamically computed sections:
110
+ - **## Blockers** — tickets this depends on that are still open
111
+ - **## Blocking** — open tickets that depend on this one
112
+ - **## Children** — tickets with this as parent
113
+ - **## Linked** — symmetrically linked tickets
114
+
115
+ ### Edit Ticket (Plugin, Humans Only)
116
+
117
+ ```bash
118
+ tk edit <id> # Opens in $EDITOR
119
+ ```
120
+
121
+ Agents should modify ticket files directly or use `tk add-note` instead.
122
+
123
+ ## Dependencies
124
+
125
+ ```bash
126
+ # Add dependency: first ticket depends on second
127
+ tk dep mp-a3x9 mp-b2y7
128
+
129
+ # Show dependency tree
130
+ tk dep tree mp-a3x9
131
+ tk dep tree --full mp-a3x9 # Disable dedup for full tree
132
+
133
+ # Find cycles in open tickets
134
+ tk dep cycle
135
+
136
+ # Remove dependency
137
+ tk undep mp-a3x9 mp-b2y7
138
+ ```
139
+
140
+ Dependencies affect `tk ready` — a ticket with unresolved deps is excluded from the ready list.
141
+
142
+ ## Links
143
+
144
+ Links are symmetric/bidirectional and do **not** affect `tk ready`.
145
+
146
+ ```bash
147
+ # Link tickets together
148
+ tk link mp-a3x9 mp-b2y7 mp-c4z1
149
+
150
+ # Remove a link
151
+ tk unlink mp-a3x9 mp-b2y7
152
+ ```
153
+
154
+ ## Notes
155
+
156
+ ```bash
157
+ # Append a timestamped note
158
+ tk add-note mp-a3x9 "Discovered edge case in token refresh"
159
+
160
+ # Pipe note from stdin
161
+ echo "Detailed findings..." | tk add-note mp-a3x9
162
+ ```
163
+
164
+ Notes are appended to the `## Notes` section with an ISO 8601 timestamp header.
165
+
166
+ ## Listing and Querying
167
+
168
+ ### List (Plugin)
169
+
170
+ ```bash
171
+ tk ls # All tickets
172
+ tk ls --status=open # Filter by status
173
+ tk ls -a "Jane Doe" # Filter by assignee
174
+ tk ls -T backend # Filter by tag
175
+ ```
176
+
177
+ Output format:
178
+ ```
179
+ mp-a3x9 [open] - Implement auth endpoint <- [mp-b2y7]
180
+ ```
181
+
182
+ ### Query (Plugin, requires jq)
183
+
184
+ ```bash
185
+ # Output as JSONL
186
+ tk query
187
+
188
+ # With jq filter
189
+ tk query '.status == "open" and .priority <= 1'
190
+ ```
191
+
192
+ ## Escape Hatch
193
+
194
+ ```bash
195
+ # Bypass plugins, run built-in command directly
196
+ tk super <cmd> [args]
197
+ ```
198
+
199
+ Use when a plugin overrides a built-in command and you need the original behavior.
200
+
201
+ ## Filter Flags (Common to ready, blocked, closed, ls)
202
+
203
+ | Flag | Short | Description |
204
+ |------|-------|-------------|
205
+ | `--assignee=X` | `-a X` | Filter by assignee |
206
+ | `--tag=X` | `-T X` | Filter by tag |
207
+ | `--status=X` | — | Filter by status (ls only) |
208
+ | `--limit=N` | — | Limit results (closed only, default 20) |
209
+
210
+ ## Partial ID Matching
211
+
212
+ All commands accepting an ID support partial matching. The shortest unambiguous prefix works:
213
+
214
+ ```bash
215
+ tk show 5c4 # Matches nw-5c46
216
+ tk close a3x # Matches mp-a3x9
217
+ ```
218
+
219
+ If multiple tickets match, tk reports an error asking for a longer prefix.
220
+
221
+ ## Environment Variables
222
+
223
+ | Variable | Purpose |
224
+ |----------|---------|
225
+ | `TICKETS_DIR` | Override `.tickets/` directory location |
226
+ | `TICKET_PAGER` | Pager for `show` (TTY only, falls back to `PAGER`) |
227
+ | `TK_SCRIPT` | Exported to plugins: absolute path to tk script |
228
+ | `EDITOR` | Used by `edit` plugin (falls back to `vi`) |
@@ -0,0 +1,189 @@
1
+ # Dependencies and Links Guide
2
+
3
+ How tk manages relationships between tickets: dependencies (blocking) and links (informational).
4
+
5
+ ## Contents
6
+
7
+ - [Overview](#overview)
8
+ - [Dependencies (Blocking)](#dependencies)
9
+ - [Links (Bidirectional)](#links)
10
+ - [Parent-Child Hierarchy](#parent-child)
11
+ - [Decision Guide](#decision-guide)
12
+ - [Common Mistakes](#common-mistakes)
13
+
14
+ ## Overview {#overview}
15
+
16
+ tk supports three relationship types:
17
+
18
+ | Type | Purpose | Affects `tk ready`? | Storage |
19
+ |------|---------|---------------------|---------|
20
+ | **deps** | Hard blocker | Yes — blocked tickets excluded | `deps:` array in frontmatter |
21
+ | **links** | Informational | No — just context | `links:` array in frontmatter |
22
+ | **parent** | Hierarchy | No — structural only | `parent:` field in frontmatter |
23
+
24
+ **Key insight**: Only `deps` affect what work is ready. Links and parent-child are organizational.
25
+
26
+ ## Dependencies (Blocking) {#dependencies}
27
+
28
+ A dependency means "this ticket cannot proceed until the dependency is resolved."
29
+
30
+ ### When to Use
31
+ - Sequential work: API must exist before UI can call it
32
+ - Prerequisites: Schema migration before data import
33
+ - Build order: Library before consumer
34
+
35
+ ### When NOT to Use
36
+ - Soft preferences ("it would be nice to do X first")
37
+ - Parallel work that happens to be related
38
+ - Informational context
39
+
40
+ ### Creating Dependencies
41
+
42
+ ```bash
43
+ # mp-a3x9 depends on mp-b2y7 (a3x9 blocked until b2y7 is closed)
44
+ tk dep mp-a3x9 mp-b2y7
45
+
46
+ # Check what's blocking
47
+ tk blocked
48
+
49
+ # Show dependency tree
50
+ tk dep tree mp-a3x9
51
+
52
+ # Find cycles (important before adding deps)
53
+ tk dep cycle
54
+
55
+ # Remove dependency
56
+ tk undep mp-a3x9 mp-b2y7
57
+ ```
58
+
59
+ ### Automatic Unblocking
60
+
61
+ When you `tk close mp-b2y7`, any ticket that depended solely on it automatically becomes ready (appears in `tk ready`).
62
+
63
+ ### Dependency Tree
64
+
65
+ ```bash
66
+ $ tk dep tree mp-a3x9
67
+ mp-a3x9 - Deploy to production
68
+ mp-b2y7 - Implement auth endpoint [open]
69
+ mp-c4z1 - Add database migration [closed] ✓
70
+ mp-d6w3 - Write integration tests [open]
71
+ ```
72
+
73
+ The `--full` flag disables deduplication for diamond dependencies.
74
+
75
+ ### Cycle Detection
76
+
77
+ ```bash
78
+ $ tk dep cycle
79
+ CYCLE DETECTED: mp-a3x9 -> mp-b2y7 -> mp-c4z1 -> mp-a3x9
80
+ ```
81
+
82
+ Always check for cycles after adding complex dependency chains.
83
+
84
+ ## Links (Bidirectional) {#links}
85
+
86
+ Links are symmetric — linking A to B also links B to A. They provide context without blocking.
87
+
88
+ ### When to Use
89
+ - Related features that inform each other
90
+ - Research findings relevant to another ticket
91
+ - Parallel work by different team members on connected areas
92
+
93
+ ### Creating Links
94
+
95
+ ```bash
96
+ # Link multiple tickets (all become linked to each other)
97
+ tk link mp-a3x9 mp-b2y7 mp-c4z1
98
+
99
+ # Remove a specific link
100
+ tk unlink mp-a3x9 mp-b2y7
101
+ ```
102
+
103
+ Links appear in `tk show` output under the `## Linked` section.
104
+
105
+ ## Parent-Child Hierarchy {#parent-child}
106
+
107
+ Parent-child relationships organize tickets into epics and subtasks.
108
+
109
+ ### Creating Hierarchies
110
+
111
+ ```bash
112
+ # Create epic
113
+ tk create "Auth System" -t epic -p 1
114
+ # Output: mp-a3x9
115
+
116
+ # Create children
117
+ tk create "Login UI" --parent mp-a3x9 -p 1
118
+ tk create "Backend validation" --parent mp-a3x9 -p 2
119
+ tk create "Integration tests" --parent mp-a3x9 -p 2
120
+ ```
121
+
122
+ Children appear in `tk show mp-a3x9` under the `## Children` section.
123
+
124
+ ### Combining with Dependencies
125
+
126
+ Parent-child is structural. Add deps when order matters:
127
+
128
+ ```bash
129
+ # Create children
130
+ tk create "Schema migration" --parent mp-a3x9 -p 1 # → mp-e1r2
131
+ tk create "API endpoints" --parent mp-a3x9 -p 1 # → mp-f3s4
132
+ tk create "Frontend integration" --parent mp-a3x9 -p 2 # → mp-g5t6
133
+
134
+ # Add sequential deps
135
+ tk dep mp-f3s4 mp-e1r2 # API depends on schema
136
+ tk dep mp-g5t6 mp-f3s4 # Frontend depends on API
137
+ ```
138
+
139
+ ## Decision Guide {#decision-guide}
140
+
141
+ ```
142
+ Is ticket B required before ticket A can start?
143
+ YES → tk dep A B
144
+ NO → Are they related but independent?
145
+ YES → tk link A B
146
+ NO → Is B a subtask of A?
147
+ YES → tk create "B title" --parent A
148
+ NO → No relationship needed
149
+ ```
150
+
151
+ ### Quick Reference by Situation
152
+
153
+ | Situation | Relationship |
154
+ |-----------|-------------|
155
+ | "Can't start until X is done" | `tk dep` |
156
+ | "Related to X, good to know" | `tk link` |
157
+ | "Part of the X epic" | `--parent X` |
158
+ | "We should probably do X first" (soft) | `tk link` (not dep) |
159
+ | "X and Y touch the same code" | `tk link` |
160
+
161
+ ## Common Mistakes {#common-mistakes}
162
+
163
+ ### Using deps for preferences
164
+
165
+ ```bash
166
+ # WRONG — soft preference, not a true blocker
167
+ tk dep mp-tests mp-refactor
168
+
169
+ # RIGHT — link for context, work on tests whenever
170
+ tk link mp-tests mp-refactor
171
+ ```
172
+
173
+ ### Wrong dependency direction
174
+
175
+ ```bash
176
+ # WRONG — says migration depends on API (backwards)
177
+ tk dep mp-migration mp-api
178
+
179
+ # RIGHT — API depends on migration being done first
180
+ tk dep mp-api mp-migration
181
+ ```
182
+
183
+ ### Over-using deps
184
+
185
+ Too many dependencies create long sequential chains. Ask: "Can these actually be done in parallel?" If yes, use links instead.
186
+
187
+ ### Not checking for cycles
188
+
189
+ Always run `tk dep cycle` after adding complex dependency chains. Cycles make tickets permanently blocked.
@@ -0,0 +1,149 @@
1
+ # Integration Patterns with Other Skills
2
+
3
+ How tk integrates with Task tools (TaskCreate, TaskUpdate, TaskList), planning skills, and the RPI workflow.
4
+
5
+ ## Contents
6
+
7
+ - [Task Tools Integration](#task-tools-integration)
8
+ - [RPI Workflow Integration](#rpi-integration)
9
+ - [Cross-Skill Workflows](#cross-skill-workflows)
10
+ - [Decision Framework](#decision-framework)
11
+
12
+ ---
13
+
14
+ ## Task Tools Integration
15
+
16
+ **Both tools complement each other at different timescales:**
17
+
18
+ ### Temporal Layering Pattern
19
+
20
+ **Task tools** (short-term working memory — this hour):
21
+ - Tactical execution: "Review Section 3", "Expand Q&A answers"
22
+ - Marked completed via TaskUpdate as you go
23
+ - Present/future tense ("Review", "Expand", "Create")
24
+ - Ephemeral: Task list resets when session ends
25
+
26
+ **tk tickets** (long-term episodic memory — this week/month):
27
+ - Strategic objectives: "Continue work on strategic planning document"
28
+ - Key decisions and outcomes in notes field
29
+ - Past tense in notes ("COMPLETED", "Discovered", "Blocked by")
30
+ - Persistent: Survives compaction and session boundaries
31
+
32
+ **Key insight**: Task tools = working copy for the current hour. Tickets = project journal for the current month.
33
+
34
+ ### The Handoff Pattern
35
+
36
+ 1. **Session start**: Read ticket → Create tasks via TaskCreate for immediate actions
37
+ 2. **During work**: Mark tasks completed via TaskUpdate as you go
38
+ 3. **Reach milestone**: `tk add-note <id>` with outcomes + context
39
+ 4. **Session end**: Task list resets, ticket survives with enriched notes
40
+
41
+ **After compaction**: Task list is gone, but ticket notes reconstruct what happened.
42
+
43
+ ### Example: Task tools track execution, tk captures meaning
44
+
45
+ **Task tools (ephemeral execution view):**
46
+ ```
47
+ TaskCreate: "Implement login endpoint" (pending)
48
+ TaskCreate: "Add password hashing with bcrypt" (pending)
49
+ TaskCreate: "Create session middleware" (pending)
50
+ Mark completed via TaskUpdate as you go.
51
+ ```
52
+
53
+ **Corresponding ticket notes (persistent context):**
54
+ ```bash
55
+ tk add-note mp-auth "COMPLETED: Login endpoint with bcrypt password
56
+ hashing (12 rounds). KEY DECISION: Using JWT tokens (not sessions) for
57
+ stateless auth - simplifies horizontal scaling. IN PROGRESS: Session
58
+ middleware implementation. NEXT: Need user input on token expiry time
59
+ (1hr vs 24hr trade-off)."
60
+ ```
61
+
62
+ ---
63
+
64
+ ## RPI Workflow Integration {#rpi-integration}
65
+
66
+ tk integrates naturally with the Research-Plan-Implement workflow:
67
+
68
+ ### Research Phase
69
+ - Use tk to track research topics and findings
70
+ - Notes capture what was discovered and what questions remain
71
+
72
+ ### Plan Phase
73
+ - `/plan` creates tk tickets for the decomposed work
74
+ - Epic ticket with child tickets mirrors plan structure
75
+ - Dependencies encode execution order
76
+
77
+ ### Implement Phase
78
+ - `/implement <ticket-id>` reads the ticket for context
79
+ - Agent follows ticket description, design, and acceptance criteria
80
+ - Closes ticket on completion
81
+
82
+ ### Validate Phase
83
+ - `/vibe` can reference ticket context
84
+ - Validation findings linked back to ticket
85
+
86
+ ---
87
+
88
+ ## Cross-Skill Workflows
89
+
90
+ ### /implement + tk
91
+
92
+ ```bash
93
+ # 1. Agent receives: /implement mp-a3x9
94
+ # 2. Agent loads tk skill
95
+ # 3. Agent reads: tk show mp-a3x9
96
+ # 4. Agent implements based on ticket content
97
+ # 5. Agent closes: tk close mp-a3x9
98
+ # 6. Agent reconciles parent if applicable
99
+ ```
100
+
101
+ ### /plan + tk
102
+
103
+ ```bash
104
+ # 1. Agent receives: /plan "Authentication system"
105
+ # 2. Agent decomposes into tickets:
106
+ tk create "Auth System" -t epic -p 1
107
+ tk create "Schema migration" --parent <epic> -p 1
108
+ tk create "Password service" --parent <epic> -p 1
109
+ tk create "API endpoints" --parent <epic> -p 1
110
+ # 3. Agent adds dependencies between children
111
+ # 4. Agent verifies: tk dep cycle (no cycles)
112
+ # 5. Agent reports plan with ticket IDs
113
+ ```
114
+
115
+ ### /crank + tk
116
+
117
+ ```bash
118
+ # 1. /crank reads epic and its children
119
+ # 2. Spawns agents for ready tickets (tk ready within epic)
120
+ # 3. Each agent: implement → close → reconcile
121
+ # 4. Loop until all children closed
122
+ # 5. Close epic
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Decision Framework
128
+
129
+ ### When to Use Which Tool
130
+
131
+ | Scenario | Tool | Why |
132
+ |----------|------|-----|
133
+ | "Fix this function" (5 min) | Task tools only | Too small for a ticket |
134
+ | "Implement auth" (multi-step, 1 session) | Both | Tasks for steps, ticket for persistence |
135
+ | "Build search feature" (multi-session) | Both | Ticket survives between sessions |
136
+ | "Track that we need to refactor X later" | tk only | Future work, no immediate tasks |
137
+ | "What should I work on?" | tk | `tk ready` is the answer |
138
+ | "What did I just finish?" | Task tools | TaskList shows recent completions |
139
+ | "What did I finish last week?" | tk | `tk closed` or read ticket notes |
140
+
141
+ ### Size Heuristic
142
+
143
+ ```
144
+ Will this take more than one session?
145
+ YES → tk ticket (mandatory)
146
+ NO → Is it worth tracking for later reference?
147
+ YES → tk ticket
148
+ NO → Task tools only
149
+ ```