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.
- package/LICENSE +21 -0
- package/README.md +93 -0
- package/bin/cli.js +169 -0
- package/bin/postinstall.js +87 -0
- package/commands/pfActivity/SKILL.md +725 -0
- package/commands/pfAssign/SKILL.md +623 -0
- package/commands/pfCloudLink/SKILL.md +192 -0
- package/commands/pfCloudList/SKILL.md +222 -0
- package/commands/pfCloudNew/SKILL.md +187 -0
- package/commands/pfCloudUnlink/SKILL.md +152 -0
- package/commands/pfComment/SKILL.md +227 -0
- package/commands/pfComments/SKILL.md +159 -0
- package/commands/pfConnectionStatus/SKILL.md +433 -0
- package/commands/pfDiscord/SKILL.md +740 -0
- package/commands/pfGithubBranch/SKILL.md +672 -0
- package/commands/pfGithubIssue/SKILL.md +963 -0
- package/commands/pfGithubLink/SKILL.md +859 -0
- package/commands/pfGithubPr/SKILL.md +1335 -0
- package/commands/pfGithubUnlink/SKILL.md +401 -0
- package/commands/pfLive/SKILL.md +185 -0
- package/commands/pfLogin/SKILL.md +249 -0
- package/commands/pfLogout/SKILL.md +155 -0
- package/commands/pfMyTasks/SKILL.md +198 -0
- package/commands/pfNotificationSettings/SKILL.md +619 -0
- package/commands/pfNotifications/SKILL.md +420 -0
- package/commands/pfNotificationsClear/SKILL.md +421 -0
- package/commands/pfReact/SKILL.md +232 -0
- package/commands/pfSlack/SKILL.md +659 -0
- package/commands/pfSyncPull/SKILL.md +210 -0
- package/commands/pfSyncPush/SKILL.md +299 -0
- package/commands/pfSyncStatus/SKILL.md +212 -0
- package/commands/pfTeamInvite/SKILL.md +161 -0
- package/commands/pfTeamList/SKILL.md +253 -0
- package/commands/pfTeamRemove/SKILL.md +115 -0
- package/commands/pfTeamRole/SKILL.md +160 -0
- package/commands/pfTestWebhooks/SKILL.md +722 -0
- package/commands/pfUnassign/SKILL.md +134 -0
- package/commands/pfWhoami/SKILL.md +258 -0
- package/commands/pfWorkload/SKILL.md +219 -0
- package/commands/planExportCsv/SKILL.md +106 -0
- package/commands/planExportGithub/SKILL.md +222 -0
- package/commands/planExportJson/SKILL.md +159 -0
- package/commands/planExportSummary/SKILL.md +158 -0
- package/commands/planNew/SKILL.md +641 -0
- package/commands/planNext/SKILL.md +1200 -0
- package/commands/planSettingsAutoSync/SKILL.md +199 -0
- package/commands/planSettingsLanguage/SKILL.md +201 -0
- package/commands/planSettingsReset/SKILL.md +237 -0
- package/commands/planSettingsShow/SKILL.md +482 -0
- package/commands/planSpec/SKILL.md +929 -0
- package/commands/planUpdate/SKILL.md +2518 -0
- package/commands/team/SKILL.md +740 -0
- package/locales/en.json +1499 -0
- package/locales/ka.json +1499 -0
- package/package.json +48 -0
- package/templates/PROJECT_PLAN.template.md +157 -0
- package/templates/backend-api.template.md +562 -0
- package/templates/frontend-spa.template.md +610 -0
- package/templates/fullstack.template.md +397 -0
- package/templates/ka/backend-api.template.md +562 -0
- package/templates/ka/frontend-spa.template.md +610 -0
- package/templates/ka/fullstack.template.md +397 -0
- package/templates/sections/architecture.md +21 -0
- package/templates/sections/overview.md +15 -0
- package/templates/sections/tasks.md +22 -0
- package/templates/sections/tech-stack.md +19 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pfSyncPull
|
|
3
|
+
description: Pull plan from PlanFlow cloud to local PROJECT_PLAN.md
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PlanFlow Sync Pull
|
|
7
|
+
|
|
8
|
+
Pull plan from PlanFlow cloud to local PROJECT_PLAN.md with progress animation.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/pfSyncPull # Pull cloud → local
|
|
14
|
+
/pfSyncPull --force # Overwrite local without confirmation
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Step 0: Load Configuration
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
function getConfig() {
|
|
21
|
+
const localConfigPath = "./.plan-config.json"
|
|
22
|
+
let localConfig = {}
|
|
23
|
+
if (fileExists(localConfigPath)) {
|
|
24
|
+
try { localConfig = JSON.parse(readFile(localConfigPath)) } catch {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const globalConfigPath = expandPath("~/.config/claude/plan-plugin-config.json")
|
|
28
|
+
let globalConfig = {}
|
|
29
|
+
if (fileExists(globalConfigPath)) {
|
|
30
|
+
try { globalConfig = JSON.parse(readFile(globalConfigPath)) } catch {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return { ...globalConfig, ...localConfig }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const config = getConfig()
|
|
37
|
+
const language = config.language || "en"
|
|
38
|
+
const cloudConfig = config.cloud || {}
|
|
39
|
+
const isAuthenticated = !!cloudConfig.apiToken
|
|
40
|
+
const projectId = cloudConfig.projectId
|
|
41
|
+
const apiUrl = cloudConfig.apiUrl || "https://api.planflow.tools"
|
|
42
|
+
|
|
43
|
+
const t = JSON.parse(readFile(`locales/${language}.json`))
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Step 1: Parse Arguments
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
const args = commandArgs.trim().split(/\s+/)
|
|
50
|
+
const forceFlag = args.includes("--force")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Step 2: Validate Prerequisites
|
|
54
|
+
|
|
55
|
+
**Not authenticated card:**
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
59
|
+
│ ❌ ERROR │
|
|
60
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
61
|
+
│ │
|
|
62
|
+
│ {t.commands.sync.notAuthenticated} │
|
|
63
|
+
│ │
|
|
64
|
+
│ You must be logged in to pull from cloud. │
|
|
65
|
+
│ │
|
|
66
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
67
|
+
│ • /pfLogin Sign in to PlanFlow │
|
|
68
|
+
│ │
|
|
69
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Not linked card:**
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
76
|
+
│ ❌ ERROR │
|
|
77
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
78
|
+
│ │
|
|
79
|
+
│ {t.commands.sync.notLinked} │
|
|
80
|
+
│ │
|
|
81
|
+
│ This project is not linked to any cloud project. │
|
|
82
|
+
│ │
|
|
83
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
84
|
+
│ • /pfCloudLink Link to a cloud project │
|
|
85
|
+
│ │
|
|
86
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Step 3: Pull from Cloud
|
|
90
|
+
|
|
91
|
+
**Loading Card (during pull):**
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
95
|
+
│ ☁️ Pull from Cloud │
|
|
96
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
97
|
+
│ │
|
|
98
|
+
│ ⠹ {t.ui.labels.downloading} │
|
|
99
|
+
│ │
|
|
100
|
+
│ Progress: ████████████████████░░░░░░░░░░ 66% │
|
|
101
|
+
│ │
|
|
102
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
1. GET plan from API
|
|
106
|
+
2. Show diff if local exists (unless --force)
|
|
107
|
+
3. Write to PROJECT_PLAN.md
|
|
108
|
+
|
|
109
|
+
**API Call:**
|
|
110
|
+
```bash
|
|
111
|
+
curl -s \
|
|
112
|
+
-H "Authorization: Bearer {TOKEN}" \
|
|
113
|
+
"https://api.planflow.tools/projects/{PROJECT_ID}/plan"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Step 4: Show Diff Card (if local exists and differs)
|
|
117
|
+
|
|
118
|
+
**If local exists and differs (without --force):**
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
122
|
+
│ ⚠️ Confirm Overwrite │
|
|
123
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
124
|
+
│ │
|
|
125
|
+
│ {t.commands.sync.localChanges} │
|
|
126
|
+
│ │
|
|
127
|
+
│ Local PROJECT_PLAN.md has changes that will be overwritten. │
|
|
128
|
+
│ │
|
|
129
|
+
│ ── Changes ───────────────────────────────────────────────────────────── │
|
|
130
|
+
│ │
|
|
131
|
+
│ Local → Cloud differences: │
|
|
132
|
+
│ - T1.1: IN_PROGRESS → DONE (local) │
|
|
133
|
+
│ + T1.2: Added description (cloud) │
|
|
134
|
+
│ ~ T2.1: Status differs │
|
|
135
|
+
│ │
|
|
136
|
+
│ ───────────────────────────────────────────────────────────────────────── │
|
|
137
|
+
│ │
|
|
138
|
+
│ [1] Pull and overwrite local │
|
|
139
|
+
│ [2] Cancel │
|
|
140
|
+
│ │
|
|
141
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use AskUserQuestion to confirm.
|
|
145
|
+
|
|
146
|
+
## Step 5: Show Success Card
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
150
|
+
│ ✅ SUCCESS │
|
|
151
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
152
|
+
│ │
|
|
153
|
+
│ {t.commands.sync.pullSuccess} │
|
|
154
|
+
│ │
|
|
155
|
+
│ ── Download Details ──────────────────────────────────────────────────── │
|
|
156
|
+
│ │
|
|
157
|
+
│ 📁 File: PROJECT_PLAN.md │
|
|
158
|
+
│ ☁️ From: {projectName} │
|
|
159
|
+
│ 📊 Tasks: {tasksCount} │
|
|
160
|
+
│ ✅ Completed: {completedCount} │
|
|
161
|
+
│ │
|
|
162
|
+
│ Progress: ████████████████████░░░░░░░░░░ {progress}% │
|
|
163
|
+
│ │
|
|
164
|
+
│ ╭────────────────────╮ │
|
|
165
|
+
│ │ ✓ Downloaded │ at {timestamp} │
|
|
166
|
+
│ ╰────────────────────╯ │
|
|
167
|
+
│ │
|
|
168
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
169
|
+
│ │
|
|
170
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
171
|
+
│ • /planNext Get next task recommendation │
|
|
172
|
+
│ • /planUpdate Update task status │
|
|
173
|
+
│ │
|
|
174
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
175
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Error Handling
|
|
179
|
+
|
|
180
|
+
**Network Error card:**
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
184
|
+
│ ❌ ERROR │
|
|
185
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
186
|
+
│ │
|
|
187
|
+
│ Network error. Could not connect to PlanFlow API. │
|
|
188
|
+
│ │
|
|
189
|
+
│ Please check your internet connection and try again. │
|
|
190
|
+
│ │
|
|
191
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Project not found card:**
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
198
|
+
│ ❌ ERROR │
|
|
199
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
200
|
+
│ │
|
|
201
|
+
│ Project not found on cloud. │
|
|
202
|
+
│ │
|
|
203
|
+
│ The linked project may have been deleted. │
|
|
204
|
+
│ │
|
|
205
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
206
|
+
│ • /pfCloudList View available projects │
|
|
207
|
+
│ • /pfCloudLink Link to a different project │
|
|
208
|
+
│ │
|
|
209
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
210
|
+
```
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pfSyncPush
|
|
3
|
+
description: Push local PROJECT_PLAN.md to PlanFlow cloud
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PlanFlow Sync Push
|
|
7
|
+
|
|
8
|
+
Push local PROJECT_PLAN.md to PlanFlow cloud with progress animation.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/pfSyncPush # Push local → cloud
|
|
14
|
+
/pfSyncPush --force # Overwrite cloud without confirmation
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Step 0: Load Configuration
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
function getConfig() {
|
|
21
|
+
const localConfigPath = "./.plan-config.json"
|
|
22
|
+
let localConfig = {}
|
|
23
|
+
if (fileExists(localConfigPath)) {
|
|
24
|
+
try { localConfig = JSON.parse(readFile(localConfigPath)) } catch {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const globalConfigPath = expandPath("~/.config/claude/plan-plugin-config.json")
|
|
28
|
+
let globalConfig = {}
|
|
29
|
+
if (fileExists(globalConfigPath)) {
|
|
30
|
+
try { globalConfig = JSON.parse(readFile(globalConfigPath)) } catch {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return { ...globalConfig, ...localConfig }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const config = getConfig()
|
|
37
|
+
const language = config.language || "en"
|
|
38
|
+
const cloudConfig = config.cloud || {}
|
|
39
|
+
const isAuthenticated = !!cloudConfig.apiToken
|
|
40
|
+
const projectId = cloudConfig.projectId
|
|
41
|
+
const apiUrl = cloudConfig.apiUrl || "https://api.planflow.tools"
|
|
42
|
+
|
|
43
|
+
const t = JSON.parse(readFile(`locales/${language}.json`))
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Step 1: Parse Arguments
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
const args = commandArgs.trim().split(/\s+/)
|
|
50
|
+
const forceFlag = args.includes("--force")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Step 2: Validate Prerequisites
|
|
54
|
+
|
|
55
|
+
**Not authenticated card:**
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
59
|
+
│ ❌ ERROR │
|
|
60
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
61
|
+
│ │
|
|
62
|
+
│ {t.commands.sync.notAuthenticated} │
|
|
63
|
+
│ │
|
|
64
|
+
│ You must be logged in to push to cloud. │
|
|
65
|
+
│ │
|
|
66
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
67
|
+
│ • /pfLogin Sign in to PlanFlow │
|
|
68
|
+
│ │
|
|
69
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Not linked card:**
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
76
|
+
│ ❌ ERROR │
|
|
77
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
78
|
+
│ │
|
|
79
|
+
│ {t.commands.sync.notLinked} │
|
|
80
|
+
│ │
|
|
81
|
+
│ This project is not linked to any cloud project. │
|
|
82
|
+
│ │
|
|
83
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
84
|
+
│ • /pfCloudLink Link to a cloud project │
|
|
85
|
+
│ • /pfCloudNew Create a new cloud project │
|
|
86
|
+
│ │
|
|
87
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 3: Push to Cloud
|
|
91
|
+
|
|
92
|
+
**IMPORTANT: Follow these steps exactly!**
|
|
93
|
+
|
|
94
|
+
1. Read PROJECT_PLAN.md using the Read tool
|
|
95
|
+
2. Create JSON payload using Bash with jq
|
|
96
|
+
3. Make API call and parse response
|
|
97
|
+
4. Show task count from response
|
|
98
|
+
5. Update lastSyncedAt in config
|
|
99
|
+
|
|
100
|
+
**Loading Card (during push):**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
104
|
+
│ ☁️ Push to Cloud │
|
|
105
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
106
|
+
│ │
|
|
107
|
+
│ ⠹ {t.ui.labels.uploading} │
|
|
108
|
+
│ │
|
|
109
|
+
│ Progress: ████████████████████░░░░░░░░░░ 66% │
|
|
110
|
+
│ │
|
|
111
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Step 3a: Create JSON payload**
|
|
115
|
+
```bash
|
|
116
|
+
cat PROJECT_PLAN.md > /tmp/plan_content.txt
|
|
117
|
+
jq -n --rawfile plan /tmp/plan_content.txt '{"plan": $plan}' > /tmp/payload.json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Step 3b: Make API call**
|
|
121
|
+
```bash
|
|
122
|
+
RESPONSE=$(curl -s -w "\n%{http_code}" -X PUT \
|
|
123
|
+
-H "Content-Type: application/json" \
|
|
124
|
+
-H "Authorization: Bearer {TOKEN}" \
|
|
125
|
+
-d @/tmp/payload.json \
|
|
126
|
+
"https://api.planflow.tools/projects/{PROJECT_ID}/plan")
|
|
127
|
+
|
|
128
|
+
# Separate body and status code
|
|
129
|
+
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
|
130
|
+
BODY=$(echo "$RESPONSE" | sed '$d')
|
|
131
|
+
|
|
132
|
+
echo "HTTP Status: $HTTP_CODE"
|
|
133
|
+
echo "Response: $BODY"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Step 3c: Parse response - CRITICAL!**
|
|
137
|
+
|
|
138
|
+
**IMPORTANT**: You MUST parse the JSON response to extract and display the task count!
|
|
139
|
+
|
|
140
|
+
The API returns:
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"success": true,
|
|
144
|
+
"data": {
|
|
145
|
+
"projectId": "uuid",
|
|
146
|
+
"projectName": "My Project",
|
|
147
|
+
"tasksCount": 15,
|
|
148
|
+
"completedCount": 3,
|
|
149
|
+
"progress": 20
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Use jq or manual parsing to extract values:**
|
|
155
|
+
```bash
|
|
156
|
+
# Extract values from response
|
|
157
|
+
TASKS_COUNT=$(echo "$BODY" | jq -r '.data.tasksCount')
|
|
158
|
+
COMPLETED_COUNT=$(echo "$BODY" | jq -r '.data.completedCount')
|
|
159
|
+
PROGRESS=$(echo "$BODY" | jq -r '.data.progress')
|
|
160
|
+
PROJECT_NAME=$(echo "$BODY" | jq -r '.data.projectName')
|
|
161
|
+
|
|
162
|
+
echo "Tasks: $TASKS_COUNT, Completed: $COMPLETED_COUNT, Progress: $PROGRESS%"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Step 4: Show Success Card
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
169
|
+
│ ✅ SUCCESS │
|
|
170
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
171
|
+
│ │
|
|
172
|
+
│ {t.commands.sync.pushSuccess} │
|
|
173
|
+
│ │
|
|
174
|
+
│ ── Sync Details ──────────────────────────────────────────────────────── │
|
|
175
|
+
│ │
|
|
176
|
+
│ 📁 Project: {projectName} │
|
|
177
|
+
│ 📊 Tasks synced: {tasksCount} │
|
|
178
|
+
│ ✅ Completed: {completedCount} │
|
|
179
|
+
│ │
|
|
180
|
+
│ Progress: ████████████████████░░░░░░░░░░ {progress}% │
|
|
181
|
+
│ │
|
|
182
|
+
│ ╭─────────────────╮ │
|
|
183
|
+
│ │ ✓ Synced │ at {timestamp} │
|
|
184
|
+
│ ╰─────────────────╯ │
|
|
185
|
+
│ │
|
|
186
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
187
|
+
│ │
|
|
188
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
189
|
+
│ • /pfSyncStatus View sync status │
|
|
190
|
+
│ • /planNext Get next task recommendation │
|
|
191
|
+
│ │
|
|
192
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
193
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**If tasksCount is 0 or null, show warning card:**
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
200
|
+
│ ⚠️ WARNING │
|
|
201
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
202
|
+
│ │
|
|
203
|
+
│ No tasks were parsed from the plan. │
|
|
204
|
+
│ │
|
|
205
|
+
│ This could mean: │
|
|
206
|
+
│ • The plan format is not recognized │
|
|
207
|
+
│ • Tasks should use format: #### T1.1: Task Name │
|
|
208
|
+
│ • Or table format: | T1.1 | Task Name | Low | TODO | - | │
|
|
209
|
+
│ │
|
|
210
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
211
|
+
│ • /planNext Verify your plan format │
|
|
212
|
+
│ │
|
|
213
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Step 5: Update Local Config
|
|
217
|
+
|
|
218
|
+
After successful sync, update `.plan-config.json` with the sync timestamp:
|
|
219
|
+
|
|
220
|
+
```javascript
|
|
221
|
+
// Read current config
|
|
222
|
+
const configPath = "./.plan-config.json"
|
|
223
|
+
let config = {}
|
|
224
|
+
if (fileExists(configPath)) {
|
|
225
|
+
config = JSON.parse(readFile(configPath))
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Update lastSyncedAt
|
|
229
|
+
if (!config.cloud) config.cloud = {}
|
|
230
|
+
config.cloud.lastSyncedAt = new Date().toISOString()
|
|
231
|
+
|
|
232
|
+
// Write back
|
|
233
|
+
writeFile(configPath, JSON.stringify(config, null, 2))
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Error Handling
|
|
237
|
+
|
|
238
|
+
**No PROJECT_PLAN.md card:**
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
242
|
+
│ ❌ ERROR │
|
|
243
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
244
|
+
│ │
|
|
245
|
+
│ {t.commands.sync.noPlan} │
|
|
246
|
+
│ │
|
|
247
|
+
│ No PROJECT_PLAN.md found in current directory. │
|
|
248
|
+
│ │
|
|
249
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
250
|
+
│ • /planNew Create a new plan first │
|
|
251
|
+
│ │
|
|
252
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**HTTP 401 - Unauthorized card:**
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
259
|
+
│ ❌ ERROR │
|
|
260
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
261
|
+
│ │
|
|
262
|
+
│ Authentication failed. Your token may have expired. │
|
|
263
|
+
│ │
|
|
264
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
265
|
+
│ • /pfLogin Re-authenticate │
|
|
266
|
+
│ │
|
|
267
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**HTTP 404 - Project not found card:**
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
274
|
+
│ ❌ ERROR │
|
|
275
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
276
|
+
│ │
|
|
277
|
+
│ Project not found on cloud. │
|
|
278
|
+
│ │
|
|
279
|
+
│ The linked project may have been deleted. │
|
|
280
|
+
│ │
|
|
281
|
+
│ 💡 {t.ui.labels.nextSteps} │
|
|
282
|
+
│ • /pfCloudLink Link to a different project │
|
|
283
|
+
│ │
|
|
284
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Network Error card:**
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
291
|
+
│ ❌ ERROR │
|
|
292
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
293
|
+
│ │
|
|
294
|
+
│ Network error. Could not connect to PlanFlow API. │
|
|
295
|
+
│ │
|
|
296
|
+
│ Please check your internet connection and try again. │
|
|
297
|
+
│ │
|
|
298
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
299
|
+
```
|