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,421 @@
1
+ ---
2
+ name: pfNotificationsClear
3
+ description: Mark notifications as read in the current PlanFlow project
4
+ ---
5
+
6
+ # PlanFlow Clear Notifications
7
+
8
+ Mark notifications as read in the linked cloud project.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ /pfNotificationsClear # Mark all notifications as read
14
+ /pfNotificationsClear T2.1 # Mark notifications for specific task as read
15
+ ```
16
+
17
+ ## Process
18
+
19
+ ### Step 0: Load Configuration & Translations
20
+
21
+ **CRITICAL: Execute this step FIRST, before any output!**
22
+
23
+ ```javascript
24
+ // Merge global and local configs
25
+ function getMergedConfig() {
26
+ let globalConfig = {}
27
+ let localConfig = {}
28
+
29
+ const globalPath = expandPath("~/.config/claude/plan-plugin-config.json")
30
+ if (fileExists(globalPath)) {
31
+ try { globalConfig = JSON.parse(readFile(globalPath)) } catch (e) {}
32
+ }
33
+
34
+ if (fileExists("./.plan-config.json")) {
35
+ try { localConfig = JSON.parse(readFile("./.plan-config.json")) } catch (e) {}
36
+ }
37
+
38
+ return {
39
+ ...globalConfig,
40
+ ...localConfig,
41
+ cloud: {
42
+ ...(globalConfig.cloud || {}),
43
+ ...(localConfig.cloud || {})
44
+ }
45
+ }
46
+ }
47
+
48
+ const config = getMergedConfig()
49
+ const language = config.language || "en"
50
+ const cloudConfig = config.cloud || {}
51
+ const isAuthenticated = !!cloudConfig.apiToken
52
+ const projectId = cloudConfig.projectId
53
+ const apiUrl = cloudConfig.apiUrl || "https://api.planflow.tools"
54
+
55
+ // Load translations
56
+ const t = JSON.parse(readFile(`locales/${language}.json`))
57
+ ```
58
+
59
+ ### Step 1: Check Authentication
60
+
61
+ If not authenticated, show error:
62
+
63
+ ```
64
+ ╭──────────────────────────────────────────────────────────────────────────────╮
65
+ │ ❌ ERROR │
66
+ ├──────────────────────────────────────────────────────────────────────────────┤
67
+ │ │
68
+ │ {t.commands.sync.notAuthenticated} │
69
+ │ │
70
+ │ 💡 Run /pfLogin to authenticate first. │
71
+ │ │
72
+ ╰──────────────────────────────────────────────────────────────────────────────╯
73
+ ```
74
+
75
+ If no project linked, show error:
76
+
77
+ ```
78
+ ╭──────────────────────────────────────────────────────────────────────────────╮
79
+ │ ❌ ERROR │
80
+ ├──────────────────────────────────────────────────────────────────────────────┤
81
+ │ │
82
+ │ {t.commands.sync.notLinked} │
83
+ │ │
84
+ │ 💡 Run /pfCloudLink to link a project first. │
85
+ │ │
86
+ ╰──────────────────────────────────────────────────────────────────────────────╯
87
+ ```
88
+
89
+ ### Step 2: Parse Arguments
90
+
91
+ Check if a task ID was provided:
92
+
93
+ ```javascript
94
+ const args = commandArgs.trim()
95
+ const taskIdMatch = args.match(/^(T\d+\.\d+)$/i)
96
+ const taskId = taskIdMatch ? taskIdMatch[1].toUpperCase() : null
97
+
98
+ // Mode: "all" or "task"
99
+ const mode = taskId ? "task" : "all"
100
+ ```
101
+
102
+ ### Step 3: Mark Notifications as Read
103
+
104
+ **API Endpoint:** `POST /projects/{projectId}/notifications/mark-read`
105
+
106
+ **Request Body:**
107
+ - For all notifications: `{}`
108
+ - For task-specific: `{"taskId": "T2.1"}`
109
+
110
+ **Bash Implementation:**
111
+
112
+ ```bash
113
+ API_URL="https://api.planflow.tools"
114
+ TOKEN="$API_TOKEN"
115
+ PROJECT_ID="$PROJECT_ID"
116
+ TASK_ID="" # Optional: specific task ID like "T2.1"
117
+
118
+ # Build request body
119
+ if [ -n "$TASK_ID" ]; then
120
+ BODY="{\"taskId\": \"$TASK_ID\"}"
121
+ else
122
+ BODY="{}"
123
+ fi
124
+
125
+ # Mark notifications as read
126
+ RESPONSE=$(curl -s -w "\n%{http_code}" \
127
+ --connect-timeout 5 \
128
+ --max-time 10 \
129
+ -X POST \
130
+ -H "Content-Type: application/json" \
131
+ -H "Accept: application/json" \
132
+ -H "Authorization: Bearer $TOKEN" \
133
+ -d "$BODY" \
134
+ "${API_URL}/projects/${PROJECT_ID}/notifications/mark-read")
135
+
136
+ HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
137
+ BODY=$(echo "$RESPONSE" | sed '$d')
138
+
139
+ if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
140
+ # Parse response
141
+ echo "$BODY"
142
+ else
143
+ echo "Error: HTTP $HTTP_CODE"
144
+ fi
145
+ ```
146
+
147
+ **Expected Response:**
148
+
149
+ ```json
150
+ {
151
+ "success": true,
152
+ "data": {
153
+ "markedCount": 4,
154
+ "message": "Notifications marked as read"
155
+ }
156
+ }
157
+ ```
158
+
159
+ ### Step 4: Display Success Card
160
+
161
+ **All Notifications Cleared:**
162
+
163
+ ```
164
+ ╭──────────────────────────────────────────────────────────────────────────────╮
165
+ │ ✅ {t.commands.notifications.clearSuccess} │
166
+ ├──────────────────────────────────────────────────────────────────────────────┤
167
+ │ │
168
+ │ {t.commands.notifications.clearedCount} → {count} notifications │
169
+ │ │
170
+ │ 📁 Project: {projectName} │
171
+ │ │
172
+ ├──────────────────────────────────────────────────────────────────────────────┤
173
+ │ │
174
+ │ 💡 {t.ui.labels.quickActions} │
175
+ │ • /pfNotifications View all notifications │
176
+ │ • /pfNotifications --unread Check for new notifications │
177
+ │ │
178
+ ╰──────────────────────────────────────────────────────────────────────────────╯
179
+ ```
180
+
181
+ **Task-Specific Notifications Cleared:**
182
+
183
+ ```
184
+ ╭──────────────────────────────────────────────────────────────────────────────╮
185
+ │ ✅ {t.commands.notifications.clearTaskSuccess} │
186
+ ├──────────────────────────────────────────────────────────────────────────────┤
187
+ │ │
188
+ │ 📋 Task: {taskId} │
189
+ │ {t.commands.notifications.clearedCount} → {count} notifications │
190
+ │ │
191
+ │ 📁 Project: {projectName} │
192
+ │ │
193
+ ├──────────────────────────────────────────────────────────────────────────────┤
194
+ │ │
195
+ │ 💡 {t.ui.labels.quickActions} │
196
+ │ • /pfComments {taskId} View task comments │
197
+ │ • /pfNotifications View all notifications │
198
+ │ │
199
+ ╰──────────────────────────────────────────────────────────────────────────────╯
200
+ ```
201
+
202
+ ### Step 5: No Unread Notifications
203
+
204
+ When there are no unread notifications to clear:
205
+
206
+ ```
207
+ ╭──────────────────────────────────────────────────────────────────────────────╮
208
+ │ ℹ️ {t.commands.notifications.nothingToClear} │
209
+ ├──────────────────────────────────────────────────────────────────────────────┤
210
+ │ │
211
+ │ All notifications are already read. │
212
+ │ │
213
+ │ 📁 Project: {projectName} │
214
+ │ │
215
+ ├──────────────────────────────────────────────────────────────────────────────┤
216
+ │ │
217
+ │ 💡 {t.ui.labels.quickActions} │
218
+ │ • /pfNotifications View all notifications │
219
+ │ • /pfActivity View recent project activity │
220
+ │ │
221
+ ╰──────────────────────────────────────────────────────────────────────────────╯
222
+ ```
223
+
224
+ ## Error Handling
225
+
226
+ **Invalid Task ID:**
227
+
228
+ If a task ID is provided but doesn't match the pattern:
229
+
230
+ ```
231
+ ╭──────────────────────────────────────────────────────────────────────────────╮
232
+ │ ❌ ERROR │
233
+ ├──────────────────────────────────────────────────────────────────────────────┤
234
+ │ │
235
+ │ {t.commands.comments.invalidTaskId} │
236
+ │ │
237
+ │ {t.commands.comments.taskIdExample} │
238
+ │ Example: T1.1, T2.3, T10.5 │
239
+ │ │
240
+ │ ── {t.commands.notifications.usage} ────────────────────────────────────── │
241
+ │ │
242
+ │ /pfNotificationsClear Mark all as read │
243
+ │ /pfNotificationsClear T2.1 Mark task notifications as read │
244
+ │ │
245
+ ╰──────────────────────────────────────────────────────────────────────────────╯
246
+ ```
247
+
248
+ **Task Not Found:**
249
+
250
+ ```
251
+ ╭──────────────────────────────────────────────────────────────────────────────╮
252
+ │ ❌ ERROR │
253
+ ├──────────────────────────────────────────────────────────────────────────────┤
254
+ │ │
255
+ │ {t.commands.comments.taskNotFound} │
256
+ │ │
257
+ │ Task {taskId} was not found in this project. │
258
+ │ │
259
+ │ {t.commands.comments.checkTaskId} │
260
+ │ │
261
+ ╰──────────────────────────────────────────────────────────────────────────────╯
262
+ ```
263
+
264
+ **Network Error:**
265
+
266
+ ```
267
+ ╭──────────────────────────────────────────────────────────────────────────────╮
268
+ │ ❌ ERROR │
269
+ ├──────────────────────────────────────────────────────────────────────────────┤
270
+ │ │
271
+ │ {t.commands.notifications.networkError} │
272
+ │ │
273
+ │ {t.commands.notifications.tryAgain} │
274
+ │ │
275
+ ╰──────────────────────────────────────────────────────────────────────────────╯
276
+ ```
277
+
278
+ ## Full Example Flow
279
+
280
+ ### Example 1: Clear All Notifications
281
+
282
+ ```bash
283
+ User: /pfNotificationsClear
284
+
285
+ # Claude reads configs
286
+ # Claude makes API call: POST /projects/{id}/notifications/mark-read
287
+ # Response: {"success": true, "data": {"markedCount": 4}}
288
+
289
+ Output:
290
+ ╭──────────────────────────────────────────────────────────────────────────────╮
291
+ │ ✅ Notifications marked as read! │
292
+ ├──────────────────────────────────────────────────────────────────────────────┤
293
+ │ │
294
+ │ 4 notifications marked as read │
295
+ │ │
296
+ │ 📁 Project: Plan Flow Plugin │
297
+ │ │
298
+ ├──────────────────────────────────────────────────────────────────────────────┤
299
+ │ │
300
+ │ 💡 Quick Actions: │
301
+ │ • /pfNotifications View all notifications │
302
+ │ • /pfNotifications --unread Check for new notifications │
303
+ │ │
304
+ ╰──────────────────────────────────────────────────────────────────────────────╯
305
+ ```
306
+
307
+ ### Example 2: Clear Task-Specific Notifications
308
+
309
+ ```bash
310
+ User: /pfNotificationsClear T2.1
311
+
312
+ # Claude reads configs
313
+ # Claude makes API call: POST /projects/{id}/notifications/mark-read
314
+ # Body: {"taskId": "T2.1"}
315
+ # Response: {"success": true, "data": {"markedCount": 2}}
316
+
317
+ Output:
318
+ ╭──────────────────────────────────────────────────────────────────────────────╮
319
+ │ ✅ Notifications for T2.1 marked as read │
320
+ ├──────────────────────────────────────────────────────────────────────────────┤
321
+ │ │
322
+ │ 📋 Task: T2.1 │
323
+ │ 2 notifications marked as read │
324
+ │ │
325
+ │ 📁 Project: Plan Flow Plugin │
326
+ │ │
327
+ ├──────────────────────────────────────────────────────────────────────────────┤
328
+ │ │
329
+ │ 💡 Quick Actions: │
330
+ │ • /pfComments T2.1 View task comments │
331
+ │ • /pfNotifications View all notifications │
332
+ │ │
333
+ ╰──────────────────────────────────────────────────────────────────────────────╯
334
+ ```
335
+
336
+ ### Example 3: No Unread Notifications
337
+
338
+ ```bash
339
+ User: /pfNotificationsClear
340
+
341
+ # API returns markedCount: 0
342
+
343
+ Output:
344
+ ╭──────────────────────────────────────────────────────────────────────────────╮
345
+ │ ℹ️ No unread notifications to clear. │
346
+ ├──────────────────────────────────────────────────────────────────────────────┤
347
+ │ │
348
+ │ All notifications are already read. │
349
+ │ │
350
+ │ 📁 Project: Plan Flow Plugin │
351
+ │ │
352
+ ├──────────────────────────────────────────────────────────────────────────────┤
353
+ │ │
354
+ │ 💡 Quick Actions: │
355
+ │ • /pfNotifications View all notifications │
356
+ │ • /pfActivity View recent project activity │
357
+ │ │
358
+ ╰──────────────────────────────────────────────────────────────────────────────╯
359
+ ```
360
+
361
+ ### Example 4: Georgian Language
362
+
363
+ ```bash
364
+ User: /pfNotificationsClear
365
+
366
+ Output:
367
+ ╭──────────────────────────────────────────────────────────────────────────────╮
368
+ │ ✅ შეტყობინებები წაკითხულად მოინიშნა! │
369
+ ├──────────────────────────────────────────────────────────────────────────────┤
370
+ │ │
371
+ │ 4 შეტყობინება წაკითხულად მოინიშნა │
372
+ │ │
373
+ │ 📁 პროექტი: Plan Flow Plugin │
374
+ │ │
375
+ ├──────────────────────────────────────────────────────────────────────────────┤
376
+ │ │
377
+ │ 💡 სწრაფი მოქმედებები: │
378
+ │ • /pfNotifications ყველა შეტყობინების ნახვა │
379
+ │ • /pfNotifications --unread ახალი შეტყობინებების შემოწმება │
380
+ │ │
381
+ ╰──────────────────────────────────────────────────────────────────────────────╯
382
+ ```
383
+
384
+ ## Translation Keys Used
385
+
386
+ ```json
387
+ {
388
+ "commands": {
389
+ "notifications": {
390
+ "clearSuccess": "Notifications marked as read!",
391
+ "clearedCount": "{count} notifications marked as read",
392
+ "clearTaskSuccess": "Notifications for {taskId} marked as read",
393
+ "nothingToClear": "No unread notifications to clear.",
394
+ "networkError": "Could not fetch notifications.",
395
+ "tryAgain": "Please check your connection and try again."
396
+ },
397
+ "comments": {
398
+ "invalidTaskId": "Invalid task ID format.",
399
+ "taskIdExample": "Task ID should be like: T1.1, T2.3, T10.5",
400
+ "taskNotFound": "Task not found.",
401
+ "checkTaskId": "Make sure the task exists. Run /pfSyncPush to sync your local tasks."
402
+ },
403
+ "sync": {
404
+ "notAuthenticated": "Not authenticated. Run /pfLogin first.",
405
+ "notLinked": "Project not linked to cloud. Run /pfCloudLink first."
406
+ }
407
+ },
408
+ "ui": {
409
+ "labels": {
410
+ "quickActions": "Quick Actions:"
411
+ }
412
+ }
413
+ }
414
+ ```
415
+
416
+ ## Notes
417
+
418
+ - Marking notifications as read is idempotent (safe to call multiple times)
419
+ - Task-specific clearing only affects notifications related to that task
420
+ - Already-read notifications are not affected
421
+ - API returns the count of notifications that were actually marked as read