@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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ronny Unger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # tk
2
+
3
+ Git-native ticket tracking skill for Claude Code and Codex. Track issues as plain markdown files alongside your code — no databases, no daemons, just files in `.tickets/`.
4
+
5
+ ## Why Use This?
6
+
7
+ - **Plain markdown**: Tickets are markdown files with YAML frontmatter, directly readable by AI agents without JSON parsing
8
+ - **Git-native**: Tickets live alongside code, tracked by git, survive compaction and session boundaries
9
+ - **Dependency graphs**: Track blockers with cycle detection; `tk ready` shows only unblocked work
10
+ - **IDE-friendly**: Ticket IDs double as filenames — Ctrl+Click on `nw-5c46` in git log opens the ticket
11
+ - **Plugin-extensible**: Drop `tk-<cmd>` executables in PATH to extend functionality
12
+
13
+ ## Quick Start
14
+
15
+ ```text
16
+ tk ready # what's unblocked and ready to work on
17
+ tk create "Fix login bug" -t bug -p 1
18
+ tk show mp-a3x9 # full ticket with computed context
19
+ tk start mp-a3x9 # mark as in progress
20
+ tk close mp-a3x9 # done
21
+ ```
22
+
23
+ ## Install
24
+
25
+ **Prerequisites**: [ticket CLI](https://github.com/wedow/ticket) installed (`brew install ticket`).
26
+
27
+ ```bash
28
+ # Via installer script
29
+ git clone --depth 1 https://github.com/php-workx/skill-tk.git
30
+ cd skill-tk && bash scripts/install-tk-skill.sh
31
+
32
+ # Via OpenSkills
33
+ npx openskills install php-workx/skill-tk
34
+ ```
35
+
36
+ After install, restart Claude/Codex so the new skill is loaded.
37
+
38
+ ## What It Does
39
+
40
+ The skill teaches Claude/Codex how to use `tk` for persistent issue tracking:
41
+
42
+ 1. **Session start**: `tk ready` shows actionable work
43
+ 2. **During work**: Create, update, and close tickets as context changes
44
+ 3. **Session end**: Ticket notes preserve state across sessions
45
+ 4. **After compaction**: Tickets survive — they're files in git, not conversation memory
46
+
47
+ ## Documentation
48
+
49
+ | Document | Purpose |
50
+ |----------|---------|
51
+ | [`CLI_REFERENCE.md`](skills/tk/references/CLI_REFERENCE.md) | All commands, flags, environment variables |
52
+ | [`TICKET_CREATION.md`](skills/tk/references/TICKET_CREATION.md) | When/how to create tickets, file format |
53
+ | [`DEPENDENCIES.md`](skills/tk/references/DEPENDENCIES.md) | Dependencies, links, parent-child hierarchy |
54
+ | [`WORKFLOWS.md`](skills/tk/references/WORKFLOWS.md) | Session start, epic planning, checklists |
55
+ | [`PATTERNS.md`](skills/tk/references/PATTERNS.md) | Knowledge work, resume, side quests |
56
+ | [`INTEGRATION_PATTERNS.md`](skills/tk/references/INTEGRATION_PATTERNS.md) | Task tools layering, RPI workflow |
57
+ | [`PLUGIN_SYSTEM.md`](skills/tk/references/PLUGIN_SYSTEM.md) | Using and creating plugins |
58
+ | [`ANTI_PATTERNS.md`](skills/tk/references/ANTI_PATTERNS.md) | Common mistakes and how to avoid them |
59
+ | [`TROUBLESHOOTING.md`](skills/tk/references/TROUBLESHOOTING.md) | Fixing common issues |
60
+
61
+ ## Development
62
+
63
+ ```bash
64
+ bash scripts/validate.sh # validate skill structure
65
+ just check # full local quality gate
66
+ ```
67
+
68
+ ## License
69
+
70
+ See [LICENSE](LICENSE).
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@php-workx/skill-tk",
3
+ "version": "0.1.0",
4
+ "description": "Git-native ticket tracking skill for Claude Code and Codex. Plain markdown tickets with YAML frontmatter, dependency graphs, and plugin system.",
5
+ "keywords": [
6
+ "skill",
7
+ "claude",
8
+ "codex",
9
+ "ticket",
10
+ "issue-tracker",
11
+ "ai-agent",
12
+ "openskills",
13
+ "git-native",
14
+ "markdown"
15
+ ],
16
+ "scripts": {
17
+ "validate": "bash scripts/validate.sh",
18
+ "test": "npm run validate",
19
+ "prepublishOnly": "npm run validate"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public",
23
+ "registry": "https://registry.npmjs.org"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/php-workx/skill-tk.git"
28
+ },
29
+ "license": "MIT",
30
+ "files": [
31
+ "skills/",
32
+ "scripts/install-tk-skill.sh",
33
+ "README.md",
34
+ "LICENSE"
35
+ ]
36
+ }
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5
+ SKILL_NAME="tk"
6
+
7
+ SRC_SKILL="$REPO_ROOT/skills/tk"
8
+
9
+ if [[ ! -d "$SRC_SKILL" ]]; then
10
+ echo "error: missing source skill directory at $SRC_SKILL" >&2
11
+ exit 1
12
+ fi
13
+
14
+ if [[ -d "$HOME/.claude/skills" ]]; then
15
+ DEST_CLAUDE_BASE="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}"
16
+ else
17
+ DEST_CLAUDE_BASE="${CLAUDE_SKILLS_DIR:-$HOME/.agents/skills}"
18
+ fi
19
+ DEST_CODEX_BASE="${CODEX_SKILLS_DIR:-$HOME/.codex/skills}"
20
+
21
+ DEST_CLAUDE="$DEST_CLAUDE_BASE/$SKILL_NAME"
22
+ DEST_CODEX="$DEST_CODEX_BASE/$SKILL_NAME"
23
+
24
+ mkdir -p "$DEST_CLAUDE_BASE" "$DEST_CODEX_BASE"
25
+
26
+ # Atomic install: copy to temp dirs first, then move into place so a failed
27
+ # copy never leaves the destination in a broken state.
28
+ DEST_CLAUDE_TMP="${DEST_CLAUDE}.installing"
29
+ DEST_CODEX_TMP="${DEST_CODEX}.installing"
30
+ rm -rf "$DEST_CLAUDE_TMP" "$DEST_CODEX_TMP"
31
+
32
+ cp -R "$SRC_SKILL" "$DEST_CLAUDE_TMP" || {
33
+ echo "error: failed to copy skill to Claude destination" >&2
34
+ rm -rf "$DEST_CLAUDE_TMP"
35
+ exit 1
36
+ }
37
+ cp -R "$SRC_SKILL" "$DEST_CODEX_TMP" || {
38
+ echo "error: failed to copy skill to Codex destination" >&2
39
+ rm -rf "$DEST_CLAUDE_TMP" "$DEST_CODEX_TMP"
40
+ exit 1
41
+ }
42
+
43
+ rm -rf "$DEST_CLAUDE" "$DEST_CODEX"
44
+ mv "$DEST_CLAUDE_TMP" "$DEST_CLAUDE"
45
+ mv "$DEST_CODEX_TMP" "$DEST_CODEX"
46
+
47
+ # Make all scripts executable
48
+ for dest in "$DEST_CLAUDE" "$DEST_CODEX"; do
49
+ for pat in "$dest/scripts/"*.sh; do
50
+ if compgen -G "$pat" >/dev/null 2>&1; then
51
+ chmod +x "$pat" || {
52
+ echo "error: failed to chmod +x $pat" >&2
53
+ exit 1
54
+ }
55
+ fi
56
+ done
57
+ done
58
+
59
+ cat <<EOF
60
+ Installed $SKILL_NAME:
61
+ - Claude: $DEST_CLAUDE
62
+ - Codex: $DEST_CODEX
63
+ EOF
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: tk
3
+ description: 'Manages git-backed issue tracking using the tk (ticket) CLI: creates tickets as markdown files with YAML frontmatter in .tickets/, tracks dependencies and links, routes work by priority and assignee, and organizes tickets hierarchically with parent-child relationships. Tickets are plain markdown files, searchable by AI agents without JSON parsing. Use when: "track tickets", "create ticket", "show blockers", "what''s ready to work on", "ticket dependencies", "add note to ticket", or git-based issue tracking with tk.'
4
+ user-invocable: true
5
+ skill_api_version: 1
6
+ context:
7
+ window: fork
8
+ intent:
9
+ mode: task
10
+ sections:
11
+ exclude: [HISTORY]
12
+ intel_scope: topic
13
+ metadata:
14
+ tier: library
15
+ dependencies: []
16
+ internal: false
17
+ ---
18
+
19
+ # tk - Git-Native Ticket Tracking for AI Agents
20
+
21
+ Plain-markdown ticket tracker that lives alongside your code.
22
+
23
+ ## Overview
24
+
25
+ **tk (ticket)** stores tickets as markdown files with YAML frontmatter in a `.tickets/` directory. No databases, no daemons — just files tracked by git.
26
+
27
+ **Key Distinction**:
28
+ - **tk**: Multi-session work, dependencies, survives compaction, git-backed, plain markdown
29
+ - **Task tools (TaskCreate/TaskUpdate/TaskList)**: Single-session tasks, status tracking, conversation-scoped
30
+
31
+ **Decision Rule**: If resuming in 2 weeks would be hard without tk, use tk.
32
+
33
+ **Why tk over beads?** Tickets are plain markdown files, directly readable by AI agents without JSON parsing. Ticket IDs double as filenames for IDE navigation (Ctrl+Click on `nw-5c46` in git log opens the ticket).
34
+
35
+ ## Operating Rules
36
+
37
+ - Treat live `tk` reads as authoritative. Use `tk show`, `tk ready`, `tk ls`, and `tk query` to inspect current tracker state. The `.tickets/` directory contains the canonical data as markdown files.
38
+ - After closing or materially updating a child ticket, reconcile the open parent in the same session. Close the parent when the child resolved the parent's last real gap.
39
+ - If `tk ready` returns a broad umbrella ticket, do not implement directly against vague parent wording. First narrow the remaining gap into an execution-ready child ticket, then land the child and reconcile the parent.
40
+ - Always commit `.tickets/` changes to git after mutations to maintain history.
41
+ - Use this post-mutation sequence when tracker state changes:
42
+
43
+ ```bash
44
+ tk ... # mutate tracker state
45
+ git add .tickets/
46
+ git commit -m "tk: <description>" # commit ticket changes
47
+ ```
48
+
49
+ ## Prerequisites
50
+
51
+ - **tk CLI**: Installed and in PATH (alias for `ticket`)
52
+ - **Git Repository**: Current directory must be within a git repo
53
+ - **Initialization**: `tk create` auto-creates `.tickets/` if not present, or create it manually
54
+
55
+ ## Ticket ID Format
56
+
57
+ IDs are auto-generated as `<prefix>-<4-char-random>`:
58
+ - Prefix derived from directory name segments (e.g., `my-project` → `mp`, `plan` → `pla`)
59
+ - Random suffix is 4 lowercase alphanumeric characters
60
+ - Examples: `mp-a3x9`, `nw-5c46`, `pla-k2m8`
61
+ - All commands support **partial ID matching** (e.g., `tk show 5c4` matches `nw-5c46`)
62
+
63
+ ## Quick Reference
64
+
65
+ ```bash
66
+ # Find work
67
+ tk ready # Open tickets with all deps resolved
68
+ tk blocked # Tickets with unresolved deps
69
+ tk ls # List all tickets (plugin)
70
+ tk closed # Recently closed tickets
71
+
72
+ # Ticket lifecycle
73
+ tk create "Title" [options] # Create ticket, prints ID
74
+ tk start <id> # Set status → in_progress
75
+ tk close <id> # Set status → closed
76
+ tk reopen <id> # Set status → open
77
+ tk show <id> # Display ticket with context
78
+
79
+ # Dependencies and links
80
+ tk dep <id> <dep-id> # Add dependency (first depends on second)
81
+ tk dep tree <id> # Show dependency tree
82
+ tk dep cycle # Find cycles in open tickets
83
+ tk undep <id> <dep-id> # Remove dependency
84
+ tk link <id> <id> [id...] # Bidirectional link between tickets
85
+ tk unlink <id> <target-id> # Remove link
86
+
87
+ # Notes
88
+ tk add-note <id> "text" # Append timestamped note
89
+
90
+ # Escape hatch
91
+ tk super <cmd> [args] # Bypass plugins, run built-in directly
92
+ ```
93
+
94
+ ## Examples
95
+
96
+ ### Skill Loading from /vibe
97
+
98
+ **User says:** `/vibe`
99
+
100
+ **What happens:**
101
+ 1. Agent loads tk skill automatically via dependency
102
+ 2. Agent calls `tk show <id>` to read ticket metadata
103
+ 3. Agent links validation findings to the ticket being checked
104
+ 4. Output references ticket ID in validation report
105
+
106
+ **Result:** Validation report includes ticket context, no manual tk lookups needed.
107
+
108
+ ### Skill Loading from /implement
109
+
110
+ **User says:** `/implement mp-a3x9`
111
+
112
+ **What happens:**
113
+ 1. Agent loads tk skill to understand ticket structure
114
+ 2. Agent calls `tk show mp-a3x9` to read ticket body
115
+ 3. Agent checks dependencies with `tk dep tree mp-a3x9`
116
+ 4. Agent closes ticket with `tk close mp-a3x9` after completion
117
+
118
+ **Result:** Ticket lifecycle managed automatically during implementation.
119
+
120
+ ## Troubleshooting
121
+
122
+ | Problem | Cause | Solution |
123
+ |---------|-------|----------|
124
+ | tk command not found | tk CLI not installed or not in PATH | Install via `brew install ticket` or add to PATH |
125
+ | "No .tickets directory found" | `.tickets/` directory missing | Run `tk create` to auto-create, or `mkdir .tickets` |
126
+ | Partial ID matches multiple | Ambiguous short ID | Provide more characters of the ID |
127
+ | Plugin not found | Plugin not in PATH or wrong naming | Name as `tk-<cmd>` or `ticket-<cmd>`, ensure executable |
128
+
129
+ ## Reference Documents
130
+
131
+ - [references/CLI_REFERENCE.md](references/CLI_REFERENCE.md)
132
+ - [references/TICKET_CREATION.md](references/TICKET_CREATION.md)
133
+ - [references/DEPENDENCIES.md](references/DEPENDENCIES.md)
134
+ - [references/WORKFLOWS.md](references/WORKFLOWS.md)
135
+ - [references/PATTERNS.md](references/PATTERNS.md)
136
+ - [references/INTEGRATION_PATTERNS.md](references/INTEGRATION_PATTERNS.md)
137
+ - [references/PLUGIN_SYSTEM.md](references/PLUGIN_SYSTEM.md)
138
+ - [references/ANTI_PATTERNS.md](references/ANTI_PATTERNS.md)
139
+ - [references/TROUBLESHOOTING.md](references/TROUBLESHOOTING.md)
@@ -0,0 +1,202 @@
1
+ # Anti-Patterns
2
+
3
+ Hard-won lessons from production tk usage. Avoid these mistakes.
4
+
5
+ ---
6
+
7
+ ## Critical Anti-Patterns
8
+
9
+ ### 1. Modifying Frontmatter Manually Without Understanding Format
10
+
11
+ **DON'T**: Edit YAML frontmatter with arbitrary formatting
12
+
13
+ ```yaml
14
+ # WRONG — missing brackets, inconsistent formatting
15
+ deps: mp-a3x9, mp-b2y7
16
+ tags: ui backend
17
+ ```
18
+
19
+ **DO**: Follow the exact YAML format tk expects
20
+
21
+ ```yaml
22
+ # CORRECT
23
+ deps: [mp-a3x9, mp-b2y7]
24
+ tags: [ui, backend]
25
+ ```
26
+
27
+ **Why it breaks**: tk parses frontmatter with sed/awk. Non-standard YAML formatting causes parse errors or silent data loss.
28
+
29
+ ---
30
+
31
+ ### 2. Creating Tickets Outside tk
32
+
33
+ **DON'T**: Manually create markdown files in `.tickets/`
34
+
35
+ ```bash
36
+ # WRONG — ID may collide, frontmatter may be malformed
37
+ echo "---\nid: my-ticket\n---\n# Title" > .tickets/my-ticket.md
38
+ ```
39
+
40
+ **DO**: Always use `tk create`
41
+
42
+ ```bash
43
+ # CORRECT — generates unique ID, proper frontmatter
44
+ tk create "My ticket title" -d "Description"
45
+ ```
46
+
47
+ **Why it breaks**: tk generates IDs based on the directory prefix and random suffix. Manual IDs may not match the expected format, breaking `tk ready`, `tk blocked`, and dependency resolution.
48
+
49
+ ---
50
+
51
+ ### 3. Implementing Directly Against Broad Parent Tickets
52
+
53
+ **DON'T**: Pick up an epic or broad parent ticket and start coding
54
+
55
+ ```bash
56
+ $ tk ready
57
+ mp-epic1 [P1][open] - API Overhaul
58
+ # Agent starts implementing "API Overhaul" directly
59
+ ```
60
+
61
+ **DO**: Narrow into a focused child ticket first
62
+
63
+ ```bash
64
+ # CORRECT
65
+ tk show mp-epic1 # Read what's left
66
+ tk create "Migrate /users endpoint to v2" --parent mp-epic1 -t task -p 1
67
+ # Implement the specific child
68
+ ```
69
+
70
+ **Why it breaks**: Broad tickets lead to unfocused implementation, scope creep, and incomplete work that's hard to resume.
71
+
72
+ ---
73
+
74
+ ### 4. Forgetting to Reconcile Parents
75
+
76
+ **DON'T**: Close child tickets without checking the parent
77
+
78
+ ```bash
79
+ tk close mp-child1
80
+ tk close mp-child2
81
+ # Parent mp-epic1 left open with stale notes
82
+ ```
83
+
84
+ **DO**: Reconcile parent after each child closure
85
+
86
+ ```bash
87
+ tk close mp-child1
88
+ tk show mp-epic1 # Check remaining children
89
+ tk add-note mp-epic1 "child1 done, remaining: child2, child3"
90
+ # ... later, after all children:
91
+ tk close mp-epic1
92
+ ```
93
+
94
+ **Why it breaks**: Stale parent tickets poison `tk ready` with work that's actually done.
95
+
96
+ ---
97
+
98
+ ### 5. Using Dependencies for Soft Preferences
99
+
100
+ **DON'T**: Add deps when it's "nice to have" ordering
101
+
102
+ ```bash
103
+ # WRONG — tests don't truly need to wait for the refactor
104
+ tk dep mp-tests mp-refactor
105
+ ```
106
+
107
+ **DO**: Use links for related-but-not-blocking work
108
+
109
+ ```bash
110
+ # CORRECT — linked for context, both can proceed independently
111
+ tk link mp-tests mp-refactor
112
+ ```
113
+
114
+ **Why it breaks**: Over-constraining deps creates unnecessary sequential chains, reducing parallelism and making `tk ready` return fewer results.
115
+
116
+ ---
117
+
118
+ ### 6. Leaving Tickets In-Progress Without Notes
119
+
120
+ **DON'T**: `tk start` a ticket and end the session without context
121
+
122
+ ```bash
123
+ tk start mp-a3x9
124
+ # ... work for a while ...
125
+ # Session ends with no notes added
126
+ ```
127
+
128
+ **DO**: Always leave breadcrumbs
129
+
130
+ ```bash
131
+ tk start mp-a3x9
132
+ # ... work for a while ...
133
+ tk add-note mp-a3x9 "COMPLETED: Schema migration written.
134
+ IN PROGRESS: Endpoint handler for /api/users.
135
+ BLOCKER: Need to decide on pagination strategy (offset vs cursor)."
136
+ ```
137
+
138
+ **Why it breaks**: Without notes, the next session (or post-compaction) has no context. The ticket title alone isn't enough to resume complex work.
139
+
140
+ ---
141
+
142
+ ### 7. Silently Skipping Stale Tickets
143
+
144
+ **DON'T**: See a stale ticket in `tk ready` and just ignore it
145
+
146
+ ```bash
147
+ $ tk ready
148
+ mp-old1 [P2][open] - Update deployment script # Seems outdated?
149
+ # Agent skips it without action
150
+ ```
151
+
152
+ **DO**: Normalize or close stale tickets
153
+
154
+ ```bash
155
+ # Option A: Ticket is still relevant but needs updating
156
+ tk add-note mp-old1 "Ticket still valid. Deployment moved to GitHub Actions.
157
+ Updated scope: migrate deploy.sh to .github/workflows/deploy.yml"
158
+
159
+ # Option B: Ticket is no longer relevant
160
+ tk add-note mp-old1 "No longer needed — deployment was automated in PR #234"
161
+ tk close mp-old1
162
+ ```
163
+
164
+ **Why it breaks**: Ignored stale tickets accumulate, making `tk ready` unreliable.
165
+
166
+ ---
167
+
168
+ ### 8. Cycle-Creating Dependency Chains
169
+
170
+ **DON'T**: Add dependencies without checking for cycles
171
+
172
+ ```bash
173
+ tk dep mp-a mp-b
174
+ tk dep mp-b mp-c
175
+ tk dep mp-c mp-a # Creates cycle! All three permanently blocked
176
+ ```
177
+
178
+ **DO**: Check for cycles after complex dependency changes
179
+
180
+ ```bash
181
+ tk dep mp-a mp-b
182
+ tk dep mp-b mp-c
183
+ tk dep cycle # Verify no cycles before proceeding
184
+ ```
185
+
186
+ **Why it breaks**: Cycles make all involved tickets permanently blocked. They never appear in `tk ready`.
187
+
188
+ ---
189
+
190
+ ## Moderate Anti-Patterns
191
+
192
+ ### 9. Giant Ticket Descriptions
193
+
194
+ Keep descriptions focused. Long descriptions with implementation details, code snippets, and extensive research belong in notes or linked documents, not the initial description.
195
+
196
+ ### 10. Too Many Tags
197
+
198
+ Tags are useful for filtering, but don't over-tag. 1-3 tags per ticket is ideal. More than 5 reduces signal-to-noise.
199
+
200
+ ### 11. Priority 0 for Everything
201
+
202
+ Priority 0 means "drop everything." If everything is P0, nothing is. Reserve P0 for genuine emergencies. Default to P2.