claude-plugin-viban 1.0.20 → 1.0.22

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/bin/viban CHANGED
@@ -3,6 +3,9 @@
3
3
  # Requires: gum (brew install gum), jq
4
4
  setopt EXTENDED_GLOB
5
5
 
6
+ # Store script directory at startup (before any function changes $0)
7
+ VIBAN_SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8
+
6
9
  # ============================================================
7
10
  # Dependency Check (Early exit with helpful messages)
8
11
  # ============================================================
@@ -95,7 +98,7 @@ EOF
95
98
 
96
99
  # Auto-initialize for commands that need data (not help/init)
97
100
  case "$1" in
98
- help|--help|-h|init) ;;
101
+ help|--help|-h|--version|-v|init) ;;
99
102
  *) init_viban_json ;;
100
103
  esac
101
104
 
@@ -1072,20 +1075,27 @@ cmd_priority() {
1072
1075
 
1073
1076
  cmd_add() {
1074
1077
  init_json
1075
- [[ -z "$1" ]] && { echo "Usage: viban add \"title\" [\"description\"] [priority] [type]"; exit 1; }
1078
+ [[ -z "$1" ]] && { echo "Usage: viban add \"title\" [\"description\"] [priority] [type] [attachments...]"; exit 1; }
1076
1079
  local id=$(get_next_id) now=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
1077
1080
  local desc="${2:-}"
1078
1081
  local priority="${3:-P3}"
1079
1082
  local issue_type="${4:-}"
1083
+ shift 4 2>/dev/null || shift $#
1084
+ local attachments=("$@")
1080
1085
  # Validate priority
1081
1086
  [[ ! "$priority" =~ ^P[0-3]$ ]] && priority="P3"
1082
1087
  # Validate type (bug, feat, chore, refactor)
1083
1088
  [[ -n "$issue_type" && ! "$issue_type" =~ ^(bug|feat|chore|refactor)$ ]] && issue_type=""
1089
+ # Build attachments JSON array
1090
+ local attachments_json="[]"
1091
+ if [[ ${#attachments[@]} -gt 0 ]]; then
1092
+ attachments_json=$(printf '%s\n' "${attachments[@]}" | jq -R . | jq -s .)
1093
+ fi
1084
1094
  # New cards don't have order - they follow priority-based sorting
1085
1095
  # Order is only assigned when manually moved
1086
1096
  local tmpjson=$(mktemp)
1087
1097
  printf '%s' "$desc" > "$tmpjson"
1088
- jq --arg id "$id" --arg title "$1" --rawfile desc "$tmpjson" --arg priority "$priority" --arg issue_type "$issue_type" --arg now "$now" '
1098
+ jq --arg id "$id" --arg title "$1" --rawfile desc "$tmpjson" --arg priority "$priority" --arg issue_type "$issue_type" --argjson attachments "$attachments_json" --arg now "$now" '
1089
1099
  .next_id = ((.next_id // 0) + 1) |
1090
1100
  .issues += [{
1091
1101
  id:($id|tonumber),
@@ -1094,6 +1104,7 @@ cmd_add() {
1094
1104
  status:"backlog",
1095
1105
  priority:$priority,
1096
1106
  type:(if $issue_type == "" then null else $issue_type end),
1107
+ attachments:$attachments,
1097
1108
  assigned_to:null,
1098
1109
  created_at:$now,
1099
1110
  updated_at:$now
@@ -1101,7 +1112,9 @@ cmd_add() {
1101
1112
  rm -f "$tmpjson"
1102
1113
  local type_info=""
1103
1114
  [[ -n "$issue_type" ]] && type_info=" [$issue_type]"
1104
- echo "✓ #$id added ($priority)$type_info"
1115
+ local attach_info=""
1116
+ [[ ${#attachments[@]} -gt 0 ]] && attach_info=" +${#attachments[@]} files"
1117
+ echo "✓ #$id added ($priority)$type_info$attach_info"
1105
1118
  }
1106
1119
 
1107
1120
  cmd_assign() {
@@ -1162,6 +1175,32 @@ cmd_done() {
1162
1175
 
1163
1176
  cmd_get() { init_json; jq --argjson id "$1" '.issues[]|select((.id|tonumber)==$id)' "$VIBAN_JSON"; }
1164
1177
 
1178
+ cmd_attach() {
1179
+ init_json
1180
+ [[ -z "$1" || -z "$2" ]] && { echo "Usage: viban attach <id> <file1> [file2...]"; exit 1; }
1181
+ local id="$1"
1182
+ shift
1183
+ local files=("$@")
1184
+
1185
+ # Check if issue exists
1186
+ local exists=$(jq --argjson id "$id" '[.issues[]|select((.id|tonumber)==$id)]|length' "$VIBAN_JSON")
1187
+ [[ "$exists" == "0" ]] && { echo "Error: Issue #$id not found"; exit 1; }
1188
+
1189
+ # Build new attachments array
1190
+ local new_attachments=$(printf '%s\n' "${files[@]}" | jq -R . | jq -s .)
1191
+ local now=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
1192
+
1193
+ # Merge with existing attachments
1194
+ jq --argjson id "$id" --argjson new "$new_attachments" --arg now "$now" '
1195
+ (.issues[] | select((.id|tonumber)==$id)) |= . + {
1196
+ attachments: ((.attachments // []) + $new | unique),
1197
+ updated_at: $now
1198
+ }
1199
+ ' "$VIBAN_JSON" > "$VIBAN_JSON.tmp" && mv "$VIBAN_JSON.tmp" "$VIBAN_JSON"
1200
+
1201
+ echo "✓ #$id: ${#files[@]} file(s) attached"
1202
+ }
1203
+
1165
1204
  cmd_migrate() {
1166
1205
  init_json
1167
1206
  echo "Migrating issues..."
@@ -1228,7 +1267,8 @@ main() {
1228
1267
  init_json
1229
1268
  case "${1:-}" in
1230
1269
  list) cmd_list;;
1231
- add) cmd_add "$2" "$3" "$4" "$5";;
1270
+ add) shift; cmd_add "$@";;
1271
+ attach) shift; cmd_attach "$@";;
1232
1272
  assign) cmd_assign "$2";;
1233
1273
  review) cmd_review "$2";;
1234
1274
  done) cmd_done "$2";;
@@ -1236,17 +1276,27 @@ main() {
1236
1276
  edit) [[ -z "$2" ]] && { echo "Usage: viban edit <id>"; exit 1; }; edit_issue "$2";;
1237
1277
  priority) cmd_priority "$2" "$3";;
1238
1278
  migrate) cmd_migrate;;
1279
+ --version|-v)
1280
+ # Get version from package.json
1281
+ if [[ -f "$VIBAN_SCRIPT_DIR/package.json" ]]; then
1282
+ grep '"version"' "$VIBAN_SCRIPT_DIR/package.json" | sed 's/.*: *"\([^"]*\)".*/\1/'
1283
+ else
1284
+ echo "unknown"
1285
+ fi
1286
+ ;;
1239
1287
  help|--help|-h)
1240
1288
  echo "viban - Vibe Kanban"
1241
1289
  echo ""
1242
1290
  echo " viban TUI"
1243
1291
  echo " viban list Show board"
1244
- echo " viban add \"title\" [\"desc\"] [P0-P3] [type] Add task"
1292
+ echo " viban add \"title\" [\"desc\"] [P0-P3] [type] [files...] Add task"
1293
+ echo " viban attach <id> <file1> [file2...] Attach files to task"
1245
1294
  echo " viban priority <id> <P0-P3> Set priority"
1246
1295
  echo " viban assign Assign first backlog (by priority)"
1247
1296
  echo " viban review → Human Review"
1248
1297
  echo " viban done <id> Complete & remove"
1249
1298
  echo " viban edit <id> Edit task in editor"
1299
+ echo " viban get <id> Get task details (JSON)"
1250
1300
  echo " viban migrate Migrate: extract type from title"
1251
1301
  echo ""
1252
1302
  echo " Priority: P0=CRITICAL, P1=HIGH, P2=MEDIUM, P3=LOW"
package/commands/task.md CHANGED
@@ -95,7 +95,7 @@ Error log or stack trace
95
95
  ### Step 4: Register viban Issue
96
96
 
97
97
  ```bash
98
- viban add "{short_title}" "$'## Symptoms\n...(body)'" {priority} {type}
98
+ viban add "{short_title}" "$'## Symptoms\n...(body)'" {priority} {type} [attachments...]
99
99
  ```
100
100
 
101
101
  **Parameters**:
@@ -103,6 +103,7 @@ viban add "{short_title}" "$'## Symptoms\n...(body)'" {priority} {type}
103
103
  - `description`: Issue body (Markdown)
104
104
  - `priority`: P0, P1, P2, P3 (default: P3)
105
105
  - `type`: bug, feat, chore, refactor
106
+ - `attachments`: (optional) File paths to attach (screenshots, logs, etc.)
106
107
 
107
108
  **Examples**:
108
109
  ```bash
@@ -114,8 +115,42 @@ viban add "Dark mode support" "$'## Symptoms\n...'" P2 feat
114
115
 
115
116
  # REFACTOR issue
116
117
  viban add "Separate auth logic" "$'## Symptoms\n...'" P3 refactor
118
+
119
+ # With screenshot attachments
120
+ viban add "Layout broken on mobile" "$'## Symptoms\n...'" P1 bug ./screenshots/mobile-bug.png
121
+
122
+ # With multiple attachments
123
+ viban add "Chart rendering issue" "$'## Symptoms\n...'" P1 bug ./error.png ./console-log.txt
117
124
  ```
118
125
 
126
+ ### Step 4a: Attaching Screenshots (Recommended for Visual Issues)
127
+
128
+ For visual bugs (layout issues, UI glitches, rendering problems), attaching screenshots significantly helps:
129
+
130
+ 1. **Take a screenshot** of the problem:
131
+ - macOS: `Cmd + Shift + 4` (selection) or `Cmd + Shift + 3` (full screen)
132
+ - Save to project directory: `./screenshots/` or `./.viban/attachments/`
133
+
134
+ 2. **Attach during creation**:
135
+ ```bash
136
+ viban add "Button misaligned on dashboard" "$'## Symptoms\n...'" P1 bug ./screenshots/button-issue.png
137
+ ```
138
+
139
+ 3. **Or attach to existing issue**:
140
+ ```bash
141
+ viban attach {issue_id} ./screenshots/screenshot1.png ./screenshots/screenshot2.png
142
+ ```
143
+
144
+ 4. **View attachments**:
145
+ ```bash
146
+ viban get {issue_id}
147
+ ```
148
+
149
+ > **Why attach screenshots?**
150
+ > - Claude Code can read image files and understand visual context
151
+ > - The assignee can see exactly what the problem looks like
152
+ > - Reduces back-and-forth clarification
153
+
119
154
  ### Step 5: Report Results
120
155
 
121
156
  After registration, report to user:
@@ -183,3 +218,31 @@ Location: src/pages/backtest/results.tsx
183
218
  viban list
184
219
  ```
185
220
  - **Accurate Priority**: P0 only for system-down level, avoid over-estimation
221
+
222
+ ## Final Step: Version Check & Update Prompt
223
+
224
+ After completing issue registration, check for viban updates:
225
+
226
+ ```bash
227
+ CURRENT_VERSION=$(viban --version 2>/dev/null || echo "unknown")
228
+ LATEST_VERSION=$(npm show claude-plugin-viban version 2>/dev/null || echo "unknown")
229
+ ```
230
+
231
+ If `CURRENT_VERSION` != `LATEST_VERSION`:
232
+
233
+ ```
234
+ 📦 viban update available: {CURRENT_VERSION} → {LATEST_VERSION}
235
+ ```
236
+
237
+ Use AskUserQuestion to ask:
238
+ - "Update viban now?" with options: "Yes, update" / "Skip for now"
239
+
240
+ If user chooses to update:
241
+ ```bash
242
+ npm update -g claude-plugin-viban
243
+ ```
244
+
245
+ Then confirm:
246
+ ```
247
+ ✓ viban updated to {LATEST_VERSION}
248
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-plugin-viban",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Terminal Kanban TUI for AI-human collaborative issue tracking",
5
5
  "main": "bin/viban",
6
6
  "bin": {