cc-sidebar 0.1.4 → 0.1.7
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/README.md +17 -5
- package/package.json +3 -2
- package/scripts/statusline.sh +61 -0
- package/skills/clarify/SKILL.md +320 -0
- package/skills/prioritize/SKILL.md +132 -0
- package/src/cli.ts +1 -1
- package/src/components/RawSidebar.tsx +2 -41
- package/src/persistence/store.ts +1 -1
package/README.md
CHANGED
|
@@ -122,17 +122,29 @@ Keep it simple - if no clear match, don't move anything. User can manually mark
|
|
|
122
122
|
```
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
### 2.
|
|
125
|
+
### 2. Install Skills (Recommended)
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
cc-sidebar includes skills that integrate with Claude Code:
|
|
128
|
+
|
|
129
|
+
| Skill | Trigger | What it does |
|
|
130
|
+
|-------|---------|--------------|
|
|
131
|
+
| `/clarify` | `/clarify` | Interview to clarify tasks, creates plan + todos (works for new or existing tasks) |
|
|
132
|
+
| `/prioritize` | `/prioritize` | Re-prioritize all sidebar tasks as a staff engineer |
|
|
133
|
+
| `sidebar-awareness` | (always on) | Gives Claude context about sidebar data files |
|
|
134
|
+
|
|
135
|
+
Install all skills:
|
|
128
136
|
|
|
129
137
|
```bash
|
|
130
|
-
# Copy the skill to your Claude skills directory
|
|
131
138
|
mkdir -p ~/.claude/skills
|
|
132
|
-
cp -r ~/.bun/install/global/node_modules/cc-sidebar/skills
|
|
139
|
+
cp -r ~/.bun/install/global/node_modules/cc-sidebar/skills/* ~/.claude/skills/
|
|
133
140
|
```
|
|
134
141
|
|
|
135
|
-
|
|
142
|
+
Or install individually:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cp -r ~/.bun/install/global/node_modules/cc-sidebar/skills/clarify ~/.claude/skills/
|
|
146
|
+
cp -r ~/.bun/install/global/node_modules/cc-sidebar/skills/prioritize ~/.claude/skills/
|
|
147
|
+
```
|
|
136
148
|
|
|
137
149
|
## Commands
|
|
138
150
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-sidebar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Visual sidebar for managing todos, tasks, and context alongside Claude Code",
|
|
5
5
|
"author": "Tyler Nishida",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"src",
|
|
26
26
|
"skills",
|
|
27
|
-
"commands"
|
|
27
|
+
"commands",
|
|
28
|
+
"scripts"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"start": "bun run src/cli.ts",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Claude Code statusline script for claude-sidebar
|
|
3
|
+
# Receives JSON from Claude Code via stdin, extracts key metrics, writes to shared file
|
|
4
|
+
#
|
|
5
|
+
# Install: Add to ~/.claude/settings.json:
|
|
6
|
+
# { "statusline": { "script": "/path/to/claude-sidebar/scripts/statusline.sh" } }
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
# Read JSON from stdin
|
|
11
|
+
input=$(cat)
|
|
12
|
+
|
|
13
|
+
# Extract context window data
|
|
14
|
+
CTX_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // 200000')
|
|
15
|
+
USAGE=$(echo "$input" | jq -r '.context_window.current_usage // {}')
|
|
16
|
+
INPUT_TOKENS=$(echo "$USAGE" | jq -r '(.input_tokens // 0) + (.cache_creation_input_tokens // 0) + (.cache_read_input_tokens // 0)')
|
|
17
|
+
OUTPUT_TOKENS=$(echo "$input" | jq -r '.context_window.current_usage.output_tokens // 0')
|
|
18
|
+
|
|
19
|
+
# Calculate context percentage (input + output tokens)
|
|
20
|
+
TOTAL_TOKENS=$((INPUT_TOKENS + OUTPUT_TOKENS))
|
|
21
|
+
if [ "$CTX_SIZE" -gt 0 ]; then
|
|
22
|
+
CTX_PERCENT=$((TOTAL_TOKENS * 100 / CTX_SIZE))
|
|
23
|
+
else
|
|
24
|
+
CTX_PERCENT=0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Extract cost and duration
|
|
28
|
+
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
|
|
29
|
+
DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')
|
|
30
|
+
DURATION_MIN=$((DURATION_MS / 60000))
|
|
31
|
+
|
|
32
|
+
# Extract model
|
|
33
|
+
MODEL=$(echo "$input" | jq -r '.model.display_name // "Unknown"')
|
|
34
|
+
|
|
35
|
+
# Get project directory and git info
|
|
36
|
+
PROJECT_DIR=$(echo "$input" | jq -r '.workspace.project_dir // ""')
|
|
37
|
+
BRANCH=""
|
|
38
|
+
REPO=""
|
|
39
|
+
if [ -n "$PROJECT_DIR" ] && [ -d "$PROJECT_DIR" ]; then
|
|
40
|
+
cd "$PROJECT_DIR" 2>/dev/null || true
|
|
41
|
+
BRANCH=$(git branch --show-current 2>/dev/null || echo "")
|
|
42
|
+
REPO=$(basename "$PROJECT_DIR")
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# Ensure directory exists
|
|
46
|
+
mkdir -p ~/.claude-sidebar
|
|
47
|
+
|
|
48
|
+
# Write processed data
|
|
49
|
+
cat > ~/.claude-sidebar/statusline.json << EOF
|
|
50
|
+
{
|
|
51
|
+
"contextPercent": $CTX_PERCENT,
|
|
52
|
+
"contextTokens": $TOTAL_TOKENS,
|
|
53
|
+
"contextSize": $CTX_SIZE,
|
|
54
|
+
"costUsd": $COST,
|
|
55
|
+
"durationMin": $DURATION_MIN,
|
|
56
|
+
"model": "$MODEL",
|
|
57
|
+
"branch": "$BRANCH",
|
|
58
|
+
"repo": "$REPO",
|
|
59
|
+
"updatedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
60
|
+
}
|
|
61
|
+
EOF
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clarify
|
|
3
|
+
description: |
|
|
4
|
+
Clarify tasks through conversation - works for new ideas or existing sidebar tasks.
|
|
5
|
+
|
|
6
|
+
Use when: (1) You have thoughts/ideas that need clarification before becoming actionable,
|
|
7
|
+
(2) You want to clarify a single task through conversation,
|
|
8
|
+
(3) The sidebar sends a task for clarification (via `c` key).
|
|
9
|
+
|
|
10
|
+
Triggers: "/clarify", "clarify this", "let me explain this task".
|
|
11
|
+
|
|
12
|
+
Requires: Claude Code sidebar for todo integration, Atomic Plans for plan output.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Clarify Skill
|
|
16
|
+
|
|
17
|
+
Clarify tasks through structured conversation. Works for both new ideas (creates todos) and existing sidebar tasks (updates them).
|
|
18
|
+
|
|
19
|
+
## Invocation
|
|
20
|
+
|
|
21
|
+
- `/clarify` - Start interviewing from scratch
|
|
22
|
+
- `/clarify [text]` - Clarify provided text (single task or many)
|
|
23
|
+
- `/clarify --task-id <id> [task content]` - Clarify existing sidebar task (sent by sidebar `c` key)
|
|
24
|
+
|
|
25
|
+
## Process
|
|
26
|
+
|
|
27
|
+
Follow these steps in order:
|
|
28
|
+
|
|
29
|
+
### 1. Detect Mode
|
|
30
|
+
|
|
31
|
+
Check if invoked with `--task-id`:
|
|
32
|
+
- **With task ID**: Updating an existing sidebar task
|
|
33
|
+
- **Without task ID**: Creating new todo(s) from scratch
|
|
34
|
+
|
|
35
|
+
### 2. Locate Configuration
|
|
36
|
+
|
|
37
|
+
Check the project's CLAUDE.md for the Atomic Plans folder path. Look for a section like:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
## Clarify Configuration
|
|
41
|
+
Plan folder: /path/to/plans
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or check if Atomic Plans is already configured:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
## Project Planning
|
|
48
|
+
/atomic-plans /path/to/folder
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**If no path is found:**
|
|
52
|
+
1. Ask the user: "Where should I save plans for this project?"
|
|
53
|
+
2. After they provide a path, ask: "Would you like me to add this to CLAUDE.md so I remember next time?"
|
|
54
|
+
3. If yes, append the configuration to CLAUDE.md
|
|
55
|
+
|
|
56
|
+
### 3. Interview Phase
|
|
57
|
+
|
|
58
|
+
The goal is to fully understand the task(s) through conversation.
|
|
59
|
+
|
|
60
|
+
**IMPORTANT: Never short-circuit the process.** Whether the user provides one clear task or a chaotic mess of ideas, always interview to clarify. A "single clear task" still benefits from clarification - edge cases, implementation approach, constraints, etc.
|
|
61
|
+
|
|
62
|
+
**If the user provided text with the command** (`/clarify [text]`):
|
|
63
|
+
- Skip the opening question - they already told you what's on their mind
|
|
64
|
+
- Go straight to AskUserQuestion to clarify specifics:
|
|
65
|
+
- Ambiguous parts that need clarification
|
|
66
|
+
- Implementation approach (if relevant)
|
|
67
|
+
- Edge cases or constraints
|
|
68
|
+
- Missing context: priorities, dependencies
|
|
69
|
+
- Anything else you need to fully understand the task(s)
|
|
70
|
+
|
|
71
|
+
**If no text was provided** (`/clarify` alone):
|
|
72
|
+
- Start with a plain text invitation (NOT AskUserQuestion):
|
|
73
|
+
|
|
74
|
+
"What's on your mind? Tell me everything - tasks, concerns, ideas,
|
|
75
|
+
whatever's floating around. I'll help clarify and organize it."
|
|
76
|
+
|
|
77
|
+
- Let the user ramble freely in their response
|
|
78
|
+
- THEN use AskUserQuestion to clarify specifics about what they said
|
|
79
|
+
|
|
80
|
+
**Interview guidelines:**
|
|
81
|
+
- Don't ask obvious questions - if something is clear from the task description, skip it
|
|
82
|
+
- Be thorough - keep interviewing until you have complete clarity
|
|
83
|
+
- Always include "Anything else I should know?" as a final question
|
|
84
|
+
|
|
85
|
+
**Key questions to consider** (use AskUserQuestion for these):
|
|
86
|
+
- What's the most important thing here?
|
|
87
|
+
- Are there dependencies between these tasks?
|
|
88
|
+
- What constraints should I know about?
|
|
89
|
+
- Is there anything blocking progress on any of these?
|
|
90
|
+
|
|
91
|
+
**Scope filtering:**
|
|
92
|
+
If the user mentions things unrelated to the current project (personal tasks, other projects), ask:
|
|
93
|
+
"Some of this seems unrelated to [current project]. Should I include those tasks anyway, or focus only on [project]-related work?"
|
|
94
|
+
|
|
95
|
+
### 4. Create Plan
|
|
96
|
+
|
|
97
|
+
Create a new plan in the Atomic Plans folder with:
|
|
98
|
+
|
|
99
|
+
**Filename:** `NNN-clarify-[topic].md` where NNN is the next number in sequence.
|
|
100
|
+
|
|
101
|
+
**Content:**
|
|
102
|
+
```markdown
|
|
103
|
+
---
|
|
104
|
+
plan: NNN
|
|
105
|
+
title: [Topic]
|
|
106
|
+
state: active
|
|
107
|
+
created: YYYY-MM-DD
|
|
108
|
+
updated: YYYY-MM-DD
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
# [Topic]
|
|
112
|
+
|
|
113
|
+
## Intent
|
|
114
|
+
[Summary of what the user wants to accomplish]
|
|
115
|
+
|
|
116
|
+
## Specs
|
|
117
|
+
[Detailed specifications gathered during interview]
|
|
118
|
+
|
|
119
|
+
## Context
|
|
120
|
+
[Key decisions, constraints, and context gathered during interview]
|
|
121
|
+
|
|
122
|
+
## Next
|
|
123
|
+
- [ ] Execute the task(s)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 5. Update or Create Todos
|
|
127
|
+
|
|
128
|
+
**If updating existing task** (has `--task-id`):
|
|
129
|
+
|
|
130
|
+
Update the existing task in the sidebar:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
node << 'SCRIPT'
|
|
134
|
+
const fs = require('fs');
|
|
135
|
+
const crypto = require('crypto');
|
|
136
|
+
const path = require('path');
|
|
137
|
+
const sidebarDir = path.join(require('os').homedir(), '.claude-sidebar');
|
|
138
|
+
const hash = crypto.createHash('sha256').update(process.cwd()).digest('hex').slice(0, 12);
|
|
139
|
+
const tasksPath = path.join(sidebarDir, 'projects', hash, 'tasks.json');
|
|
140
|
+
let tasks = JSON.parse(fs.readFileSync(tasksPath, 'utf-8'));
|
|
141
|
+
const task = tasks.find(t => t.id === 'TASK_ID_HERE'); // REPLACE with actual task ID
|
|
142
|
+
if (task) {
|
|
143
|
+
task.clarified = true;
|
|
144
|
+
task.planPath = 'PLAN_FILENAME.md'; // REPLACE with actual plan filename
|
|
145
|
+
fs.writeFileSync(tasksPath, JSON.stringify(tasks, null, 2));
|
|
146
|
+
console.log('Task clarified and linked to plan');
|
|
147
|
+
}
|
|
148
|
+
SCRIPT
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**If creating new todos** (no `--task-id`):
|
|
152
|
+
|
|
153
|
+
Extract discrete, actionable tasks from the interview. Each todo should be:
|
|
154
|
+
- **Specific**: Clear what needs to be done
|
|
155
|
+
- **Actionable**: Can be worked on independently
|
|
156
|
+
- **Scoped**: Relevant to the current project (unless user said otherwise)
|
|
157
|
+
|
|
158
|
+
**Act as a staff engineer to prioritize:**
|
|
159
|
+
Assign each task a numeric priority (1 = most important). Consider:
|
|
160
|
+
- **Dependencies**: Blockers come first
|
|
161
|
+
- **Urgency**: Bugs, deadlines, user-facing issues
|
|
162
|
+
- **Impact**: High-value features over nice-to-haves
|
|
163
|
+
- **Effort**: Quick wins can be prioritized to build momentum
|
|
164
|
+
|
|
165
|
+
Mark the top 3 most important tasks as "recommended" (shown with star in sidebar).
|
|
166
|
+
|
|
167
|
+
Write todos to the **project-specific** tasks file:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
node << 'SCRIPT'
|
|
171
|
+
const fs = require('fs');
|
|
172
|
+
const crypto = require('crypto');
|
|
173
|
+
const path = require('path');
|
|
174
|
+
|
|
175
|
+
const sidebarDir = path.join(require('os').homedir(), '.claude-sidebar');
|
|
176
|
+
const hash = crypto.createHash('sha256').update(process.cwd()).digest('hex').slice(0, 12);
|
|
177
|
+
const projectDir = path.join(sidebarDir, 'projects', hash);
|
|
178
|
+
const tasksPath = path.join(projectDir, 'tasks.json');
|
|
179
|
+
|
|
180
|
+
// Ensure directory exists
|
|
181
|
+
fs.mkdirSync(projectDir, { recursive: true });
|
|
182
|
+
|
|
183
|
+
// Read existing todos
|
|
184
|
+
let existing = [];
|
|
185
|
+
try { existing = JSON.parse(fs.readFileSync(tasksPath, 'utf-8')); } catch {}
|
|
186
|
+
|
|
187
|
+
// Plan filename (just the filename, not full path)
|
|
188
|
+
const planPath = "NNN-clarify-topic.md"; // REPLACE with actual plan filename
|
|
189
|
+
|
|
190
|
+
// New todos - REPLACE THIS ARRAY with extracted tasks
|
|
191
|
+
// Each task needs: content, priority (1=highest), recommended (true for top 3)
|
|
192
|
+
const newTodos = [
|
|
193
|
+
{ content: "Task 1 here", priority: 1, recommended: true },
|
|
194
|
+
{ content: "Task 2 here", priority: 2, recommended: true },
|
|
195
|
+
{ content: "Task 3 here", priority: 3, recommended: true },
|
|
196
|
+
{ content: "Task 4 here", priority: 4, recommended: false }
|
|
197
|
+
].map(task => ({
|
|
198
|
+
id: crypto.randomUUID(),
|
|
199
|
+
content: task.content,
|
|
200
|
+
createdAt: new Date().toISOString(),
|
|
201
|
+
clarified: true, // Clarify IS the clarification process
|
|
202
|
+
priority: task.priority, // Numeric priority (1 = most important)
|
|
203
|
+
recommended: task.recommended, // Top 3 get star indicator
|
|
204
|
+
planPath: planPath // Links task to the plan file
|
|
205
|
+
}));
|
|
206
|
+
|
|
207
|
+
// Append and write
|
|
208
|
+
const combined = [...existing, ...newTodos];
|
|
209
|
+
fs.writeFileSync(tasksPath, JSON.stringify(combined, null, 2));
|
|
210
|
+
console.log('Added ' + newTodos.length + ' todos to sidebar');
|
|
211
|
+
SCRIPT
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### 6. Present and Prompt
|
|
215
|
+
|
|
216
|
+
After creating/updating todos and plan:
|
|
217
|
+
|
|
218
|
+
1. Show a summary of what was created/updated
|
|
219
|
+
2. Ask: **"Execute this task now, or save for later?"**
|
|
220
|
+
- If execute → work on the task immediately
|
|
221
|
+
- If save → confirm the task is clarified and stop
|
|
222
|
+
|
|
223
|
+
**Example for existing task:**
|
|
224
|
+
```
|
|
225
|
+
Clarified your task and created plan 007-auth-refactor.md
|
|
226
|
+
|
|
227
|
+
Task: Refactor authentication module
|
|
228
|
+
Specs: JWT-based, 24hr expiry, refresh tokens...
|
|
229
|
+
|
|
230
|
+
Execute this task now, or save for later?
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Example for new tasks:**
|
|
234
|
+
```
|
|
235
|
+
Created 3 todos in your sidebar and plan 008-api-improvements.md
|
|
236
|
+
|
|
237
|
+
Your todos:
|
|
238
|
+
1. Add rate limiting to API endpoints
|
|
239
|
+
2. Implement request validation
|
|
240
|
+
3. Add API documentation
|
|
241
|
+
|
|
242
|
+
Execute the first task now, or save for later?
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Relationship to Other Features
|
|
246
|
+
|
|
247
|
+
| Feature | Purpose | When to Use |
|
|
248
|
+
|---------|---------|-------------|
|
|
249
|
+
| `/clarify` | Interview and clarify task(s) | When you need to think through a task before doing it |
|
|
250
|
+
| Sidebar `c` key | Invokes `/clarify --task-id` | Quick way to clarify a queued task |
|
|
251
|
+
| `/prioritize` | Re-evaluate and reorder all tasks | When context changes or you want fresh prioritization |
|
|
252
|
+
| Ralph-loop | Batch process todos autonomously | After clarifying, to work through all todos |
|
|
253
|
+
|
|
254
|
+
## Example Sessions
|
|
255
|
+
|
|
256
|
+
### From Sidebar (existing task)
|
|
257
|
+
```
|
|
258
|
+
[User presses 'c' on task "Add user authentication"]
|
|
259
|
+
|
|
260
|
+
Sidebar sends: /clarify --task-id abc123 Add user authentication
|
|
261
|
+
|
|
262
|
+
Claude: [Uses AskUserQuestion]
|
|
263
|
+
- What auth method? (JWT, session, OAuth?)
|
|
264
|
+
- Any specific security requirements?
|
|
265
|
+
- Which routes need protection?
|
|
266
|
+
|
|
267
|
+
User: [Answers]
|
|
268
|
+
|
|
269
|
+
Claude: [Creates plan, updates task with clarified=true]
|
|
270
|
+
|
|
271
|
+
Clarified your task and created plan 005-user-auth.md
|
|
272
|
+
|
|
273
|
+
Execute this task now, or save for later?
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### From Chat (new task)
|
|
277
|
+
```
|
|
278
|
+
User: /clarify I need to add shift+enter support for multiline input
|
|
279
|
+
|
|
280
|
+
Claude: [Uses AskUserQuestion]
|
|
281
|
+
- Which input modes need this? (adding new todos, editing existing, both?)
|
|
282
|
+
- Should Enter still submit, with Shift+Enter for newlines?
|
|
283
|
+
|
|
284
|
+
User: [Answers]
|
|
285
|
+
|
|
286
|
+
Claude: [Creates todo, writes to sidebar, creates plan]
|
|
287
|
+
|
|
288
|
+
Created 1 todo in your sidebar and plan 009-multiline-input.md
|
|
289
|
+
|
|
290
|
+
Execute this task now, or save for later?
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### From Chat (multiple tasks)
|
|
294
|
+
```
|
|
295
|
+
User: /clarify
|
|
296
|
+
|
|
297
|
+
Claude: What's on your mind? Tell me everything.
|
|
298
|
+
|
|
299
|
+
User: ugh so much. the auth is a mess, we're using like 3 different
|
|
300
|
+
patterns. also need to update the docs. oh and there's that bug with
|
|
301
|
+
the session timeout.
|
|
302
|
+
|
|
303
|
+
Claude: [Uses AskUserQuestion]
|
|
304
|
+
- Which auth pattern should we standardize on?
|
|
305
|
+
- Is the session timeout bug blocking anything?
|
|
306
|
+
|
|
307
|
+
User: [Answers]
|
|
308
|
+
|
|
309
|
+
Claude: [Creates todos, writes to sidebar, creates plan]
|
|
310
|
+
|
|
311
|
+
Created 4 todos in your sidebar and plan 010-auth-cleanup.md
|
|
312
|
+
|
|
313
|
+
Your todos:
|
|
314
|
+
1. Standardize auth on JWT pattern
|
|
315
|
+
2. Fix session timeout bug
|
|
316
|
+
3. Update auth documentation
|
|
317
|
+
4. Remove deprecated OAuth1 code
|
|
318
|
+
|
|
319
|
+
Execute the first task now, or save for later?
|
|
320
|
+
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prioritize
|
|
3
|
+
description: |
|
|
4
|
+
Re-prioritize all tasks in the sidebar as a staff engineer.
|
|
5
|
+
|
|
6
|
+
Use when: (1) You want Claude to review and reorder your task list,
|
|
7
|
+
(2) After adding new tasks that might change priorities,
|
|
8
|
+
(3) When context has changed and you need fresh prioritization.
|
|
9
|
+
|
|
10
|
+
Triggers: "/prioritize", "prioritize my tasks", "reorder tasks"
|
|
11
|
+
|
|
12
|
+
Requires: Claude Code sidebar for task management.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Prioritize Skill
|
|
16
|
+
|
|
17
|
+
Act as a staff engineer to review and prioritize all tasks in the sidebar.
|
|
18
|
+
|
|
19
|
+
## Invocation
|
|
20
|
+
|
|
21
|
+
- `/prioritize` - Review all tasks and assign priorities
|
|
22
|
+
- `/prioritize [context]` - Prioritize with specific context in mind
|
|
23
|
+
|
|
24
|
+
## Process
|
|
25
|
+
|
|
26
|
+
### 1. Read Current Tasks
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
node << 'SCRIPT'
|
|
30
|
+
const fs = require('fs');
|
|
31
|
+
const crypto = require('crypto');
|
|
32
|
+
const path = require('path');
|
|
33
|
+
const sidebarDir = path.join(require('os').homedir(), '.claude-sidebar');
|
|
34
|
+
const hash = crypto.createHash('sha256').update(process.cwd()).digest('hex').slice(0, 12);
|
|
35
|
+
const tasksPath = path.join(sidebarDir, 'projects', hash, 'tasks.json');
|
|
36
|
+
try {
|
|
37
|
+
const tasks = JSON.parse(fs.readFileSync(tasksPath, 'utf-8'));
|
|
38
|
+
console.log(JSON.stringify(tasks, null, 2));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
console.log('No tasks found');
|
|
41
|
+
}
|
|
42
|
+
SCRIPT
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Evaluate and Prioritize
|
|
46
|
+
|
|
47
|
+
As a staff engineer, evaluate each task considering:
|
|
48
|
+
|
|
49
|
+
- **Dependencies**: What blocks other work? Blockers come first.
|
|
50
|
+
- **Urgency**: Bugs, deadlines, user-facing issues take priority.
|
|
51
|
+
- **Impact**: High-value features over nice-to-haves.
|
|
52
|
+
- **Effort**: Quick wins can build momentum; large tasks may need breakdown.
|
|
53
|
+
- **Context**: If user provided context, weight it heavily.
|
|
54
|
+
|
|
55
|
+
Assign each task:
|
|
56
|
+
- `priority`: Numeric (1 = most important, higher = less important)
|
|
57
|
+
- `recommended`: `true` for the top 3 most important tasks (shown with star)
|
|
58
|
+
|
|
59
|
+
### 3. Write Updated Tasks
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node << 'SCRIPT'
|
|
63
|
+
const fs = require('fs');
|
|
64
|
+
const crypto = require('crypto');
|
|
65
|
+
const path = require('path');
|
|
66
|
+
const sidebarDir = path.join(require('os').homedir(), '.claude-sidebar');
|
|
67
|
+
const hash = crypto.createHash('sha256').update(process.cwd()).digest('hex').slice(0, 12);
|
|
68
|
+
const tasksPath = path.join(sidebarDir, 'projects', hash, 'tasks.json');
|
|
69
|
+
|
|
70
|
+
// REPLACE this array with the re-prioritized tasks
|
|
71
|
+
// Keep all original fields, just update priority and recommended
|
|
72
|
+
const tasks = [
|
|
73
|
+
// Example - replace with actual tasks:
|
|
74
|
+
// { ...originalTask, priority: 1, recommended: true },
|
|
75
|
+
// { ...originalTask, priority: 2, recommended: true },
|
|
76
|
+
// { ...originalTask, priority: 3, recommended: true },
|
|
77
|
+
// { ...originalTask, priority: 4, recommended: false },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
fs.writeFileSync(tasksPath, JSON.stringify(tasks, null, 2));
|
|
81
|
+
console.log('Tasks re-prioritized');
|
|
82
|
+
SCRIPT
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. Present Results
|
|
86
|
+
|
|
87
|
+
Show the user the new priority order:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Re-prioritized your tasks:
|
|
91
|
+
|
|
92
|
+
Recommended (do first):
|
|
93
|
+
1. [task content]
|
|
94
|
+
2. [task content]
|
|
95
|
+
3. [task content]
|
|
96
|
+
|
|
97
|
+
Other tasks:
|
|
98
|
+
4. [task content]
|
|
99
|
+
5. [task content]
|
|
100
|
+
...
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Example Session
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
User: /prioritize
|
|
107
|
+
|
|
108
|
+
Claude: [Reads current tasks]
|
|
109
|
+
|
|
110
|
+
I see 6 tasks. Let me evaluate them as a staff engineer...
|
|
111
|
+
|
|
112
|
+
Based on dependencies and impact:
|
|
113
|
+
|
|
114
|
+
Recommended (do first):
|
|
115
|
+
1. Fix authentication bug (blocking users)
|
|
116
|
+
2. Add input validation (security concern)
|
|
117
|
+
3. Update API documentation (unblocks other team)
|
|
118
|
+
|
|
119
|
+
Other tasks:
|
|
120
|
+
4. Refactor CSS (nice-to-have)
|
|
121
|
+
5. Add dark mode (feature request)
|
|
122
|
+
6. Update dependencies (maintenance)
|
|
123
|
+
|
|
124
|
+
Tasks have been re-prioritized in your sidebar.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- This skill reads and modifies the sidebar's tasks.json directly
|
|
130
|
+
- It preserves all existing task fields (id, content, clarified, planPath, etc.)
|
|
131
|
+
- Only updates `priority` and `recommended` fields
|
|
132
|
+
- Can be run anytime - safe to run multiple times
|
package/src/cli.ts
CHANGED
|
@@ -711,47 +711,8 @@ export class RawSidebar {
|
|
|
711
711
|
const sortedTasks = this.getSortedTasks();
|
|
712
712
|
const task = sortedTasks[this.state.selectedIndex];
|
|
713
713
|
if (task) {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
TASK ID: ${task.id}
|
|
717
|
-
TASK: ${task.content}
|
|
718
|
-
|
|
719
|
-
Interview me about this task using AskUserQuestion. Ask about anything relevant: technical implementation, UI/UX, edge cases, concerns, tradeoffs, constraints, dependencies, etc.
|
|
720
|
-
|
|
721
|
-
Guidelines:
|
|
722
|
-
- Don't ask obvious questions - if something is clear from the task description, don't ask about it
|
|
723
|
-
- Be thorough - keep interviewing until you have complete clarity
|
|
724
|
-
- Always include "Anything else I should know?" as a final question
|
|
725
|
-
|
|
726
|
-
After the interview:
|
|
727
|
-
1. Write specs to an Atomic Plan file (check project CLAUDE.md for plan folder path)
|
|
728
|
-
2. Update the task in the sidebar using this script:
|
|
729
|
-
|
|
730
|
-
\`\`\`bash
|
|
731
|
-
node << 'SCRIPT'
|
|
732
|
-
const fs = require('fs');
|
|
733
|
-
const crypto = require('crypto');
|
|
734
|
-
const path = require('path');
|
|
735
|
-
const sidebarDir = path.join(require('os').homedir(), '.claude-sidebar');
|
|
736
|
-
const hash = crypto.createHash('sha256').update(process.cwd()).digest('hex').slice(0, 12);
|
|
737
|
-
const tasksPath = path.join(sidebarDir, 'projects', hash, 'tasks.json');
|
|
738
|
-
let tasks = JSON.parse(fs.readFileSync(tasksPath, 'utf-8'));
|
|
739
|
-
const task = tasks.find(t => t.id === '${task.id}');
|
|
740
|
-
if (task) {
|
|
741
|
-
task.clarified = true;
|
|
742
|
-
task.planPath = 'PLAN_FILENAME.md'; // REPLACE with actual plan filename
|
|
743
|
-
fs.writeFileSync(tasksPath, JSON.stringify(tasks, null, 2));
|
|
744
|
-
console.log('Task updated with clarified=true and planPath');
|
|
745
|
-
}
|
|
746
|
-
SCRIPT
|
|
747
|
-
\`\`\`
|
|
748
|
-
|
|
749
|
-
3. Ask me: "Execute this task now, or save for later?"
|
|
750
|
-
- If I say execute → work on the task
|
|
751
|
-
- If I say save → just confirm the task is clarified and stop`;
|
|
752
|
-
|
|
753
|
-
sendToClaudePane(clarifyPrompt);
|
|
754
|
-
// Don't activate - let the task stay in queue until user decides
|
|
714
|
+
// Invoke the clarify skill with task ID
|
|
715
|
+
sendToClaudePane(`/clarify --task-id ${task.id} ${task.content}`);
|
|
755
716
|
this.render();
|
|
756
717
|
focusClaudePane();
|
|
757
718
|
}
|
package/src/persistence/store.ts
CHANGED
|
@@ -52,7 +52,7 @@ export interface Task {
|
|
|
52
52
|
id: string;
|
|
53
53
|
content: string;
|
|
54
54
|
createdAt: string;
|
|
55
|
-
clarified?: boolean; // Was this task clarified via
|
|
55
|
+
clarified?: boolean; // Was this task clarified via /clarify skill?
|
|
56
56
|
priority?: number; // Sort order (lower = higher priority, 1 = most important)
|
|
57
57
|
recommended?: boolean; // Claude's top picks (shown with star)
|
|
58
58
|
planPath?: string; // Filename of associated Atomic Plan
|