claude-queue 1.0.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,157 @@
1
+ ---
2
+ name: queue
3
+ description: Watch the queue board and work through tasks autonomously. Use this when starting a coding session with the queue board.
4
+ ---
5
+
6
+ # Queue Board
7
+
8
+ Work through tasks or plan new ones for a queue board.
9
+
10
+ ## Argument Validation
11
+
12
+ FIRST, check the arguments passed to this skill:
13
+
14
+ 1. **If no arguments provided** (just `/queue` with nothing after):
15
+ - Call `queue_list_projects` to get available projects
16
+ - Display the result to the user and stop
17
+
18
+ 2. **If arguments start with `plan`** but no project ID after it (just `/queue plan`):
19
+ - Call `queue_list_projects` to get available projects
20
+ - Display: "Missing project ID. Available projects:" followed by the list
21
+ - Stop
22
+
23
+ 3. **If a project ID is provided**, proceed to Mode Detection below. If `queue_watch` fails with a "not found" error:
24
+ - Call `queue_list_projects` to get available projects
25
+ - Display: "Project not found. Available projects:" followed by the list
26
+ - Stop
27
+
28
+ ---
29
+
30
+ ## Mode Detection
31
+
32
+ Check the arguments passed to this skill:
33
+ - If arguments start with `plan` (e.g., `/queue plan kbn-xxxx`), follow **Planning Mode** below
34
+ - Otherwise (e.g., `/queue kbn-xxxx`), follow **Work Mode** (Main Loop) below
35
+
36
+ ---
37
+
38
+ ## Planning Mode
39
+
40
+ When invoked with `/queue plan <project-id>`:
41
+
42
+ 1. **Connect**: Call `queue_watch` with the project ID
43
+ 2. **Ask for input**: Ask the user "What would you like to plan?"
44
+ 3. **Generate tasks**: Based on the description, propose a breakdown:
45
+ - List each task with a title and brief description
46
+ - Keep tasks focused and actionable
47
+ - Order them logically (dependencies first if relevant)
48
+ 4. **Refine**: Ask if they want to adjust anything
49
+ 5. **Confirm destination**: Ask "Add to ready (default) or backlog?"
50
+ 6. **Create tasks**: Call `queue_create_task` for each task with the chosen status
51
+ 7. **Done**: Summarize what was created (count and column)
52
+
53
+ ### Example Planning Flow
54
+
55
+ ```
56
+ User: /queue plan kbn-a3x9
57
+ Claude: What would you like to plan?
58
+ User: User authentication with email/password
59
+ Claude: Here's my proposed breakdown:
60
+
61
+ 1. **Create auth database schema** - users table with email, password_hash, created_at
62
+ 2. **Implement registration endpoint** - POST /auth/register with validation
63
+ 3. **Implement login endpoint** - POST /auth/login returning JWT
64
+ 4. **Add auth middleware** - Verify JWT on protected routes
65
+ 5. **Create React auth context** - Login state and token management
66
+
67
+ Want me to adjust anything? If not, should I add these to ready (default) or backlog?
68
+ User: Looks good, add to ready
69
+ Claude: ✓ Created 5 tasks in ready column for kbn-a3x9
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Work Mode
75
+
76
+ Work through tasks autonomously.
77
+
78
+ ## Setup
79
+
80
+ 1. Call `queue_watch` with the project ID to connect to the board
81
+ 2. The project ID is in the format `kbn-xxxx` (check the URL or run `claude-queue list`)
82
+
83
+ ## Main Loop
84
+
85
+ Repeat continuously:
86
+
87
+ 1. **Check for tasks**: Call `queue_get_tasks` with status "ready"
88
+ 2. **If no ready tasks**:
89
+ - Poll every 30 seconds for up to 3 minutes (6 polls)
90
+ - If still no tasks after 3 minutes, inform user and stop
91
+ 3. **Claim task immediately**: When a ready task is found, IMMEDIATELY claim it to prevent the user from making changes while you prepare:
92
+ - Run `git rev-parse --is-inside-work-tree 2>/dev/null && git rev-parse HEAD` in a single command to check if git repo and get commit hash
93
+ - Call `queue_claim_task` with the task ID AND the starting_commit (use empty string "" if not a git repo)
94
+ - This moves the task to in_progress right away so user sees it's being worked on
95
+ 4. **Read existing comments**: Call `queue_check_comments` to see any context or instructions the user may have already added
96
+ 5. **Work on the task**:
97
+ - Update activity with `queue_update_activity` as you work
98
+ - Do the actual work - write code, fix bugs, etc.
99
+ - **Check for user feedback**: Call `queue_check_comments` periodically (before major steps) to see if user left new comments
100
+ - If there are new comments, read them and accommodate the feedback in your work
101
+ 6. **If blocked**:
102
+ - Call `queue_set_blocked` with your question
103
+ - Call `queue_wait_for_reply` to wait for response
104
+ - If `{ "deleted": true }` and this is a git repo, run `git reset --hard <starting_commit>` (the commit you passed in step 3) and go to step 1
105
+ - If `{ "deleted": true }` and NOT a git repo, just go to step 1 (changes cannot be auto-reverted)
106
+ - If `{ "timeout": true }`, call `queue_wait_for_reply` again
107
+ 7. **Final check**: Before completing, call `queue_check_comments` one last time to ensure no new feedback was left during your work
108
+ 8. **Commit** (git repos only): Commit changes before marking the task as complete
109
+ 9. **Add summary** (REQUIRED): ALWAYS add a completion summary using `queue_add_comment` BEFORE calling complete. Example: "✅ Completed: Added X feature to Y component. Modified files: A.ts, B.tsx. Key changes: implemented Z logic."
110
+ 10. **Complete**: Call `queue_complete_task` to move the task to Done (the comment from step 9 must already be added)
111
+ 11. **Repeat** from step 1
112
+
113
+ ## Rules
114
+
115
+ - Only work on ONE task at a time
116
+ - Always update activity so user knows what you're doing
117
+ - If task deleted while working and this is a git repo, discard all changes including commits with `git reset --hard <starting_commit>` (use the commit hash you passed when claiming)
118
+ - Commit before completing a task (git repos only), not after
119
+ - If user asks to "defer" or "skip" a task, move it to **backlog** (not ready) so it won't be picked up again automatically
120
+
121
+ ## Non-Git Directories
122
+
123
+ This skill works for both git repositories and non-git directories:
124
+ - **Git repos**: Full functionality including commits and the ability to reset/cancel changes
125
+ - **Non-git directories**: All queue features work, but without commits or change tracking
126
+ - When not in a git repo, skip all git commands (`git rev-parse`, `git reset`, `git add`, `git commit`, etc.)
127
+
128
+ ## Planning/Discussion Tasks
129
+
130
+ Some tasks are not direct implementation requests but rather planning, discussion, or feedback requests. Examples:
131
+ - "What do you think about X approach?"
132
+ - "Can you plan how to implement Y?"
133
+ - "Should we use A or B for this feature?"
134
+ - "Review and suggest improvements for Z"
135
+ - Tasks asking for your opinion, recommendation, or analysis
136
+
137
+ For these tasks:
138
+ 1. **Don't complete immediately** - Don't just provide your answer and move to Done
139
+ 2. **Mark as blocked**: After providing your analysis/plan/recommendation, call `queue_set_blocked` with something like "Waiting for your feedback on the proposed approach"
140
+ 3. **Wait for reply**: Call `queue_wait_for_reply` to let the user respond
141
+ 4. **Then complete**: Once user confirms or provides direction, complete the task
142
+
143
+ This ensures the user gets a chance to review and respond to your suggestions before the task is considered done.
144
+
145
+ ## Action Comments
146
+
147
+ User can trigger actions via the UI that leave special comments. When checking comments, look for these patterns:
148
+
149
+ - `[ACTION:RESET]` - User wants to reset all changes. If in a git repo, run `git reset --hard <starting_commit>` to undo all changes including commits, then start the task fresh from the beginning. If not in a git repo, just start fresh (previous changes cannot be auto-reverted).
150
+ - `[ACTION:CANCEL]` - User wants to cancel the task. If in a git repo, run `git reset --hard <starting_commit>` to undo all changes including commits. Then move the task to backlog status using the move API. If not in a git repo, just move to backlog (changes cannot be auto-reverted).
151
+
152
+ **Note**: The `starting_commit` is stored in the task when you claim it (step 3). For in-progress tasks, it's also returned by `queue_get_tasks` in the task's `starting_commit` field. This will be empty for non-git directories.
153
+
154
+ ## Note
155
+
156
+ This uses the production MCP server (claude-queue) on port 3333.
157
+ Make sure the queue server is running (`npx claude-queue` or `make start`).