planflow-plugin 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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/bin/cli.js +169 -0
  4. package/bin/postinstall.js +87 -0
  5. package/commands/pfActivity/SKILL.md +725 -0
  6. package/commands/pfAssign/SKILL.md +623 -0
  7. package/commands/pfCloudLink/SKILL.md +192 -0
  8. package/commands/pfCloudList/SKILL.md +222 -0
  9. package/commands/pfCloudNew/SKILL.md +187 -0
  10. package/commands/pfCloudUnlink/SKILL.md +152 -0
  11. package/commands/pfComment/SKILL.md +227 -0
  12. package/commands/pfComments/SKILL.md +159 -0
  13. package/commands/pfConnectionStatus/SKILL.md +433 -0
  14. package/commands/pfDiscord/SKILL.md +740 -0
  15. package/commands/pfGithubBranch/SKILL.md +672 -0
  16. package/commands/pfGithubIssue/SKILL.md +963 -0
  17. package/commands/pfGithubLink/SKILL.md +859 -0
  18. package/commands/pfGithubPr/SKILL.md +1335 -0
  19. package/commands/pfGithubUnlink/SKILL.md +401 -0
  20. package/commands/pfLive/SKILL.md +185 -0
  21. package/commands/pfLogin/SKILL.md +249 -0
  22. package/commands/pfLogout/SKILL.md +155 -0
  23. package/commands/pfMyTasks/SKILL.md +198 -0
  24. package/commands/pfNotificationSettings/SKILL.md +619 -0
  25. package/commands/pfNotifications/SKILL.md +420 -0
  26. package/commands/pfNotificationsClear/SKILL.md +421 -0
  27. package/commands/pfReact/SKILL.md +232 -0
  28. package/commands/pfSlack/SKILL.md +659 -0
  29. package/commands/pfSyncPull/SKILL.md +210 -0
  30. package/commands/pfSyncPush/SKILL.md +299 -0
  31. package/commands/pfSyncStatus/SKILL.md +212 -0
  32. package/commands/pfTeamInvite/SKILL.md +161 -0
  33. package/commands/pfTeamList/SKILL.md +253 -0
  34. package/commands/pfTeamRemove/SKILL.md +115 -0
  35. package/commands/pfTeamRole/SKILL.md +160 -0
  36. package/commands/pfTestWebhooks/SKILL.md +722 -0
  37. package/commands/pfUnassign/SKILL.md +134 -0
  38. package/commands/pfWhoami/SKILL.md +258 -0
  39. package/commands/pfWorkload/SKILL.md +219 -0
  40. package/commands/planExportCsv/SKILL.md +106 -0
  41. package/commands/planExportGithub/SKILL.md +222 -0
  42. package/commands/planExportJson/SKILL.md +159 -0
  43. package/commands/planExportSummary/SKILL.md +158 -0
  44. package/commands/planNew/SKILL.md +641 -0
  45. package/commands/planNext/SKILL.md +1200 -0
  46. package/commands/planSettingsAutoSync/SKILL.md +199 -0
  47. package/commands/planSettingsLanguage/SKILL.md +201 -0
  48. package/commands/planSettingsReset/SKILL.md +237 -0
  49. package/commands/planSettingsShow/SKILL.md +482 -0
  50. package/commands/planSpec/SKILL.md +929 -0
  51. package/commands/planUpdate/SKILL.md +2518 -0
  52. package/commands/team/SKILL.md +740 -0
  53. package/locales/en.json +1499 -0
  54. package/locales/ka.json +1499 -0
  55. package/package.json +48 -0
  56. package/templates/PROJECT_PLAN.template.md +157 -0
  57. package/templates/backend-api.template.md +562 -0
  58. package/templates/frontend-spa.template.md +610 -0
  59. package/templates/fullstack.template.md +397 -0
  60. package/templates/ka/backend-api.template.md +562 -0
  61. package/templates/ka/frontend-spa.template.md +610 -0
  62. package/templates/ka/fullstack.template.md +397 -0
  63. package/templates/sections/architecture.md +21 -0
  64. package/templates/sections/overview.md +15 -0
  65. package/templates/sections/tasks.md +22 -0
  66. package/templates/sections/tech-stack.md +19 -0
@@ -0,0 +1,420 @@
1
+ ---
2
+ name: pfNotifications
3
+ description: View and manage notifications in the current PlanFlow project
4
+ ---
5
+
6
+ # PlanFlow Notifications
7
+
8
+ View and manage your notifications in the linked cloud project.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ /pfNotifications # Show all notifications (unread first)
14
+ /pfNotifications --unread # Show only unread notifications
15
+ /pfNotifications --limit 20 # Show more entries (default: 10)
16
+ /pfNotifications --type mention # Filter by notification type
17
+ ```
18
+
19
+ ## Process
20
+
21
+ ### Step 0: Load Configuration & Translations
22
+
23
+ **CRITICAL: Execute this step FIRST, before any output!**
24
+
25
+ ```javascript
26
+ // Merge global and local configs
27
+ function getMergedConfig() {
28
+ let globalConfig = {}
29
+ let localConfig = {}
30
+
31
+ const globalPath = expandPath("~/.config/claude/plan-plugin-config.json")
32
+ if (fileExists(globalPath)) {
33
+ try { globalConfig = JSON.parse(readFile(globalPath)) } catch (e) {}
34
+ }
35
+
36
+ if (fileExists("./.plan-config.json")) {
37
+ try { localConfig = JSON.parse(readFile("./.plan-config.json")) } catch (e) {}
38
+ }
39
+
40
+ return {
41
+ ...globalConfig,
42
+ ...localConfig,
43
+ cloud: {
44
+ ...(globalConfig.cloud || {}),
45
+ ...(localConfig.cloud || {})
46
+ }
47
+ }
48
+ }
49
+
50
+ const config = getMergedConfig()
51
+ const language = config.language || "en"
52
+ const cloudConfig = config.cloud || {}
53
+ const isAuthenticated = !!cloudConfig.apiToken
54
+ const projectId = cloudConfig.projectId
55
+ const apiUrl = cloudConfig.apiUrl || "https://api.planflow.tools"
56
+
57
+ // Load translations
58
+ const t = JSON.parse(readFile(`locales/${language}.json`))
59
+ ```
60
+
61
+ ### Step 1: Check Authentication
62
+
63
+ If not authenticated, show error:
64
+
65
+ ```
66
+ ╭──────────────────────────────────────────────────────────────────────────────╮
67
+ │ ❌ ERROR │
68
+ ├──────────────────────────────────────────────────────────────────────────────┤
69
+ │ │
70
+ │ {t.commands.sync.notAuthenticated} │
71
+ │ │
72
+ │ 💡 Run /pfLogin to authenticate first. │
73
+ │ │
74
+ ╰──────────────────────────────────────────────────────────────────────────────╯
75
+ ```
76
+
77
+ If no project linked, show error:
78
+
79
+ ```
80
+ ╭──────────────────────────────────────────────────────────────────────────────╮
81
+ │ ❌ ERROR │
82
+ ├──────────────────────────────────────────────────────────────────────────────┤
83
+ │ │
84
+ │ {t.commands.sync.notLinked} │
85
+ │ │
86
+ │ 💡 Run /pfCloudLink to link a project first. │
87
+ │ │
88
+ ╰──────────────────────────────────────────────────────────────────────────────╯
89
+ ```
90
+
91
+ ### Step 2: Show Usage Card (if --help)
92
+
93
+ ```
94
+ ╭──────────────────────────────────────────────────────────────────────────────╮
95
+ │ 🔔 Notifications │
96
+ ├──────────────────────────────────────────────────────────────────────────────┤
97
+ │ │
98
+ │ ── {t.commands.notifications.usage} ────────────────────────────────────── │
99
+ │ │
100
+ │ /pfNotifications Show all notifications │
101
+ │ /pfNotifications --unread Show only unread notifications │
102
+ │ /pfNotifications --limit <n> Show more entries (default: 10) │
103
+ │ /pfNotifications --type <type> Filter by notification type │
104
+ │ │
105
+ │ ── {t.commands.notifications.types} ────────────────────────────────────── │
106
+ │ │
107
+ │ mention - When someone @mentions you │
108
+ │ assignment - When you're assigned to a task │
109
+ │ task - Task status changes you're watching │
110
+ │ comment - New comments on tasks you're involved in │
111
+ │ │
112
+ │ ── {t.commands.notifications.example} ──────────────────────────────────── │
113
+ │ │
114
+ │ /pfNotifications --unread --type mention │
115
+ │ │
116
+ ╰──────────────────────────────────────────────────────────────────────────────╯
117
+ ```
118
+
119
+ ### Step 3: Fetch Notifications from API
120
+
121
+ **API Endpoint:** `GET /projects/{projectId}/notifications`
122
+
123
+ **Query Parameters:**
124
+ - `unread` (boolean) - Filter to unread only
125
+ - `type` (string) - Filter by type: mention, assignment, task, comment
126
+ - `limit` (number) - Max items to return (default: 10, max: 50)
127
+
128
+ **Bash Implementation:**
129
+
130
+ ```bash
131
+ API_URL="https://api.planflow.tools"
132
+ TOKEN="$API_TOKEN"
133
+ PROJECT_ID="$PROJECT_ID"
134
+ LIMIT="10"
135
+ UNREAD_ONLY="" # or "true"
136
+ TYPE_FILTER="" # or "mention", "assignment", "task", "comment"
137
+
138
+ # Build query string
139
+ QUERY="limit=${LIMIT}"
140
+ if [ -n "$UNREAD_ONLY" ]; then
141
+ QUERY="${QUERY}&unread=true"
142
+ fi
143
+ if [ -n "$TYPE_FILTER" ]; then
144
+ QUERY="${QUERY}&type=${TYPE_FILTER}"
145
+ fi
146
+
147
+ # Fetch notifications
148
+ RESPONSE=$(curl -s -w "\n%{http_code}" \
149
+ --connect-timeout 5 \
150
+ --max-time 10 \
151
+ -X GET \
152
+ -H "Accept: application/json" \
153
+ -H "Authorization: Bearer $TOKEN" \
154
+ "${API_URL}/projects/${PROJECT_ID}/notifications?${QUERY}")
155
+
156
+ HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
157
+ BODY=$(echo "$RESPONSE" | sed '$d')
158
+
159
+ if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
160
+ # Parse notifications from response
161
+ echo "$BODY"
162
+ else
163
+ echo "Error: HTTP $HTTP_CODE"
164
+ fi
165
+ ```
166
+
167
+ **Expected Response:**
168
+
169
+ ```json
170
+ {
171
+ "success": true,
172
+ "data": {
173
+ "notifications": [
174
+ {
175
+ "id": "notif-uuid-1",
176
+ "type": "mention",
177
+ "read": false,
178
+ "createdAt": "2026-02-10T08:55:00Z",
179
+ "actor": {
180
+ "name": "Jane Smith",
181
+ "email": "jane@company.com"
182
+ },
183
+ "task": {
184
+ "taskId": "T2.1",
185
+ "name": "Implement login API"
186
+ },
187
+ "preview": "@john please review the changes",
188
+ "priority": "high"
189
+ },
190
+ {
191
+ "id": "notif-uuid-2",
192
+ "type": "assignment",
193
+ "read": false,
194
+ "createdAt": "2026-02-10T07:00:00Z",
195
+ "actor": {
196
+ "name": "Jane Smith",
197
+ "email": "jane@company.com"
198
+ },
199
+ "task": {
200
+ "taskId": "T3.2",
201
+ "name": "Add validation"
202
+ },
203
+ "priority": "medium"
204
+ },
205
+ {
206
+ "id": "notif-uuid-3",
207
+ "type": "task",
208
+ "read": false,
209
+ "createdAt": "2026-02-10T06:00:00Z",
210
+ "actor": {
211
+ "name": "Bob Wilson",
212
+ "email": "bob@company.com"
213
+ },
214
+ "task": {
215
+ "taskId": "T2.3",
216
+ "name": "Error handling"
217
+ },
218
+ "action": "completed",
219
+ "priority": "low"
220
+ },
221
+ {
222
+ "id": "notif-uuid-4",
223
+ "type": "comment",
224
+ "read": true,
225
+ "createdAt": "2026-02-10T05:00:00Z",
226
+ "actor": {
227
+ "name": "Jane Smith",
228
+ "email": "jane@company.com"
229
+ },
230
+ "task": {
231
+ "taskId": "T2.1",
232
+ "name": "Implement login API"
233
+ },
234
+ "preview": "Looks good!",
235
+ "priority": "low"
236
+ }
237
+ ],
238
+ "unreadCount": 3,
239
+ "total": 4
240
+ }
241
+ }
242
+ ```
243
+
244
+ ### Step 4: Display Notifications Card
245
+
246
+ **Main Notifications Card (with notifications):**
247
+
248
+ ```
249
+ ╭──────────────────────────────────────────────────────────────────────────────╮
250
+ │ 🔔 {t.commands.notifications.title} ({unreadCount} unread) │
251
+ ├──────────────────────────────────────────────────────────────────────────────┤
252
+ │ │
253
+ │ 📁 Project: {projectName} │
254
+ │ │
255
+ │ ── Notifications ───────────────────────────────────────────────────────── │
256
+ │ │
257
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
258
+ │ │ 🔴 Jane mentioned you in T2.1 5 min ago │ │
259
+ │ │ "@john please review the changes" │ │
260
+ │ │ 📋 Implement login API │ │
261
+ │ └────────────────────────────────────────────────────────────────────────┘ │
262
+ │ │
263
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
264
+ │ │ 🟡 You were assigned to T3.2 1 hour ago │ │
265
+ │ │ Assigned by: Jane Smith │ │
266
+ │ │ 📋 Add validation │ │
267
+ │ └────────────────────────────────────────────────────────────────────────┘ │
268
+ │ │
269
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
270
+ │ │ 🟢 T2.3 was completed 2 hours ago │ │
271
+ │ │ Completed by: Bob Wilson │ │
272
+ │ │ 📋 Error handling │ │
273
+ │ └────────────────────────────────────────────────────────────────────────┘ │
274
+ │ │
275
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
276
+ │ │ ○ New comment on T2.1 3 hours ago │ │
277
+ │ │ Jane: "Looks good!" │ │
278
+ │ │ 📋 Implement login API │ │
279
+ │ └────────────────────────────────────────────────────────────────────────┘ │
280
+ │ │
281
+ │ 📄 Showing {shown} of {total} notifications │
282
+ │ │
283
+ ├──────────────────────────────────────────────────────────────────────────────┤
284
+ │ │
285
+ │ 💡 {t.ui.labels.quickActions} │
286
+ │ • /pfNotificationsClear {t.commands.notifications.markAllRead} │
287
+ │ • /pfNotificationsClear T2.1 {t.commands.notifications.markTaskRead}│
288
+ │ • /pfComments T2.1 {t.commands.notifications.viewTask} │
289
+ │ │
290
+ ╰──────────────────────────────────────────────────────────────────────────────╯
291
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
292
+ ```
293
+
294
+ ### Step 5: No Notifications Card
295
+
296
+ ```
297
+ ╭──────────────────────────────────────────────────────────────────────────────╮
298
+ │ 🔔 {t.commands.notifications.title} │
299
+ ├──────────────────────────────────────────────────────────────────────────────┤
300
+ │ │
301
+ │ 📁 Project: {projectName} │
302
+ │ │
303
+ │ ╭─────────────────────────────────────────────────────────────────────╮ │
304
+ │ │ │ │
305
+ │ │ 📭 {t.commands.notifications.noNotifications} │ │
306
+ │ │ │ │
307
+ │ ╰─────────────────────────────────────────────────────────────────────╯ │
308
+ │ │
309
+ │ {t.commands.notifications.noNotificationsHint} │
310
+ │ • When someone @mentions you in a comment │
311
+ │ • When you're assigned to a task │
312
+ │ • When tasks you're watching are updated │
313
+ │ • When someone comments on your tasks │
314
+ │ │
315
+ ╰──────────────────────────────────────────────────────────────────────────────╯
316
+ ```
317
+
318
+ ## Notification Priority & Icons
319
+
320
+ | Priority | Icon | When Used |
321
+ |----------|------|-----------|
322
+ | high (unread) | 🔴 | @mentions |
323
+ | medium (unread) | 🟡 | Task assignments |
324
+ | low (unread) | 🟢 | Task updates, comments |
325
+ | read | ○ | All read notifications |
326
+
327
+ ## Notification Type Messages
328
+
329
+ | Type | Message Template |
330
+ |------|------------------|
331
+ | mention | "{actor} mentioned you in {taskId}" |
332
+ | assignment | "You were assigned to {taskId}" |
333
+ | task | "{taskId} was {action}" (completed/started/blocked) |
334
+ | comment | "New comment on {taskId}" |
335
+
336
+ ## Time Formatting
337
+
338
+ Use relative time formatting:
339
+ - "just now" - < 1 minute
340
+ - "{n} min ago" - < 60 minutes
341
+ - "{n} hours ago" - < 24 hours
342
+ - "{n} days ago" - >= 24 hours
343
+
344
+ ## Error Handling
345
+
346
+ **Network Error Card:**
347
+
348
+ ```
349
+ ╭──────────────────────────────────────────────────────────────────────────────╮
350
+ │ ❌ ERROR │
351
+ ├──────────────────────────────────────────────────────────────────────────────┤
352
+ │ │
353
+ │ {t.commands.notifications.networkError} │
354
+ │ │
355
+ │ {t.commands.notifications.tryAgain} │
356
+ │ │
357
+ ╰──────────────────────────────────────────────────────────────────────────────╯
358
+ ```
359
+
360
+ **Invalid Type Filter Card:**
361
+
362
+ ```
363
+ ╭──────────────────────────────────────────────────────────────────────────────╮
364
+ │ ❌ ERROR │
365
+ ├──────────────────────────────────────────────────────────────────────────────┤
366
+ │ │
367
+ │ {t.commands.notifications.invalidType} │
368
+ │ │
369
+ │ {t.commands.notifications.validTypes} │
370
+ │ mention, assignment, task, comment │
371
+ │ │
372
+ ╰──────────────────────────────────────────────────────────────────────────────╯
373
+ ```
374
+
375
+ ## Translation Keys Required
376
+
377
+ ```json
378
+ {
379
+ "commands": {
380
+ "notifications": {
381
+ "title": "Notifications",
382
+ "usage": "Usage",
383
+ "types": "Notification Types",
384
+ "example": "Example",
385
+ "unread": "unread",
386
+ "noNotifications": "No notifications.",
387
+ "noNotificationsHint": "You'll be notified when:",
388
+ "showing": "Showing {shown} of {total} notifications",
389
+ "mentionedYou": "{actor} mentioned you in {taskId}",
390
+ "assignedToYou": "You were assigned to {taskId}",
391
+ "assignedBy": "Assigned by: {actor}",
392
+ "taskUpdated": "{taskId} was {action}",
393
+ "completedBy": "Completed by: {actor}",
394
+ "startedBy": "Started by: {actor}",
395
+ "blockedBy": "Blocked by: {actor}",
396
+ "newComment": "New comment on {taskId}",
397
+ "markAllRead": "Mark all as read",
398
+ "markTaskRead": "Mark task notifications read",
399
+ "viewTask": "View task comments",
400
+ "invalidType": "Invalid notification type.",
401
+ "validTypes": "Valid types:",
402
+ "networkError": "Could not fetch notifications.",
403
+ "tryAgain": "Please check your connection and try again.",
404
+ "justNow": "just now",
405
+ "minutesAgo": "{count} min ago",
406
+ "hoursAgo": "{count} hours ago",
407
+ "daysAgo": "{count} days ago"
408
+ }
409
+ }
410
+ }
411
+ ```
412
+
413
+ ## Notes
414
+
415
+ - Notifications are sorted by date (newest first)
416
+ - Unread notifications appear before read ones
417
+ - @mentions have highest priority (🔴)
418
+ - Preview text is truncated at ~50 characters
419
+ - Maximum 50 notifications returned per request
420
+ - Use --unread flag for quick check of what needs attention