claude-plugin-viban 1.1.2 → 1.2.1

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.
@@ -5,71 +5,64 @@ description: "Assign and resolve first backlog issue from viban board through to
5
5
 
6
6
  # /assign
7
7
 
8
- Workflow: First backlog issue -> Resolve -> PR completion
8
+ First backlog issue Resolve PR completion
9
9
 
10
- > **No direct `viban.json` access** - CLI only
11
- > **No Worktree** - Work directly on branch in main repo
12
- > **Workflow**: Read `.viban/workflow.md` first, then CLAUDE.md fallback
10
+ > **CLI only** (no direct viban.json access) | **No worktree** (branch in main repo)
13
11
 
14
12
  ---
15
13
 
16
- ## Phase 0: CONTEXT & SETUP
14
+ ## Phase 0: SETUP
17
15
 
18
- ### 0.1 Read Project Workflow (CRITICAL)
16
+ ### 0.1 Read Workflow (CRITICAL)
19
17
 
20
- Before any work, read the project's workflow configuration. Check in priority order:
21
-
22
- **Priority 1: `.viban/workflow.md`** (dedicated workflow file)
23
-
24
- ```bash
25
- [ -f ".viban/workflow.md" ] && cat ".viban/workflow.md"
26
- ```
27
-
28
- **Priority 2: CLAUDE.md** (legacy fallback)
29
-
30
- Only if `.viban/workflow.md` does NOT exist:
18
+ Check in priority order first match wins, follow it exactly:
31
19
 
20
+ 1. `.viban/workflow.md` → `[ -f ".viban/workflow.md" ] && cat ".viban/workflow.md"`
21
+ 2. CLAUDE.md (legacy, only if no workflow.md):
32
22
  ```bash
33
23
  for path in "./CLAUDE.md" "./.claude/CLAUDE.md" "../CLAUDE.md"; do
34
24
  [ -f "$path" ] && cat "$path"
35
25
  done
36
26
  ```
27
+ Look for `Issue Resolution Workflow` or `Workflow` section.
28
+ 3. Default workflow (Phase 1 below)
37
29
 
38
- Look for: `Issue Resolution Workflow` or `Workflow` section.
30
+ ### 0.2 Git Setup & Assign
39
31
 
40
- **Priority 3: Default workflow** (Phase 1 below)
32
+ ```bash
33
+ # Check uncommitted changes → AskUserQuestion if dirty
34
+ [ -n "$(git status --porcelain)" ] && echo "Warning: Uncommitted changes"
41
35
 
42
- IMPORTANT:
43
- - If `.viban/workflow.md` exists -> MUST follow it exactly (all phases)
44
- - Else if CLAUDE.md has a workflow section -> MUST follow it exactly
45
- - If no workflow found -> Use default workflow (Phase 1 below)
36
+ git checkout main && git fetch origin main && git reset --hard origin/main
46
37
 
47
- ### 0.2 Git Setup
38
+ ISSUE_ID=$(viban assign 2>&1 | tail -1)
39
+ [[ -z "$ISSUE_ID" || "$ISSUE_ID" == "No backlog" ]] && echo "No issues in backlog" && exit 0
40
+ ```
41
+
42
+ ### 0.3 Detect Sync & Create Branch
48
43
 
49
44
  ```bash
50
- # 1. Check for uncommitted changes
51
- if [ -n "$(git status --porcelain)" ]; then
52
- echo "Warning: Uncommitted changes detected"
53
- # Ask user whether to commit (use AskUserQuestion)
45
+ ISSUE_JSON=$(viban get $ISSUE_ID)
46
+ EXT_ID=$(echo "$ISSUE_JSON" | jq -r '.external_id // ""')
47
+ SYNC_ACTIVE=false; EXTERNAL_NUM=""
48
+
49
+ if [ -n "$EXT_ID" ] && [ "$EXT_ID" != "null" ]; then
50
+ SYNC_ACTIVE=true
51
+ EXTERNAL_NUM="${EXT_ID##*:}" # "github:42" -> "42"
52
+ TITLE=$(echo "$ISSUE_JSON" | jq -r '.title' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | head -c 40)
53
+ git checkout -b "issue-${EXTERNAL_NUM}-${TITLE}"
54
+ else
55
+ git checkout -b issue-$ISSUE_ID
54
56
  fi
57
+ ```
55
58
 
56
- # 2. Switch to main branch and sync
57
- git checkout main
58
- git fetch origin main
59
- git reset --hard origin/main
60
-
61
- # 3. Assign issue
62
- ISSUE_ID=$(viban assign 2>&1 | tail -1)
63
- if [ -z "$ISSUE_ID" ] || [ "$ISSUE_ID" = "No backlog" ]; then
64
- echo "No issues in backlog"
65
- exit 0
66
- fi
59
+ ### 0.4 Load Plan (if available)
67
60
 
68
- # 4. Create new branch
69
- git checkout -b viban-$ISSUE_ID
61
+ ```bash
62
+ [ -f ".viban/plans/${ISSUE_ID}.md" ] && cat ".viban/plans/${ISSUE_ID}.md"
70
63
  ```
71
64
 
72
- If backlog is empty: Notify user and exit
65
+ If plan exists: use as primary guide for Phase 1, skip redundant analysis, but verify plan is still current.
73
66
 
74
67
  ---
75
68
 
@@ -79,102 +72,105 @@ If backlog is empty: Notify user and exit
79
72
  viban get $ISSUE_ID
80
73
  ```
81
74
 
82
- ### If Project Workflow Exists (from `.viban/workflow.md` or CLAUDE.md):
83
-
84
- Follow the project's exact steps.
85
-
86
- ### Default Workflow (if no project workflow):
87
-
88
- 1. **Understand**: Read the issue, understand the problem
89
- 2. **Locate**: Find relevant code files
90
- 3. **Analyze**: Determine root cause
91
- 4. **Implement**: Make minimal, focused changes
75
+ **With project workflow**: follow its exact steps.
76
+ **Default** (no workflow): Understand → Locate → Analyze root cause → Implement minimal changes.
92
77
 
93
78
  ---
94
79
 
95
80
  ## Phase 2: VERIFY
96
81
 
97
- Manual verification using available tools. Do NOT run build/test here - save that for Phase 3.
98
-
99
- ### Verification Methods (use what's appropriate):
82
+ Manual verification do NOT run build/test here (Phase 3).
100
83
 
101
- | Type | Tool | Usage |
102
- |------|------|-------|
103
- | Web UI | Playwright MCP | `browser_navigate`, `browser_snapshot`, `browser_click` |
104
- | API | WebFetch | Fetch endpoints, check responses |
105
- | CLI | Bash | Run the CLI command, check output |
106
- | Visual | Read | Read screenshot files if provided |
107
- | Browser | Chrome DevTools MCP | `take_snapshot`, `navigate_page`, `click` |
84
+ | Type | Tool |
85
+ |------|------|
86
+ | Web UI | Playwright MCP (`browser_navigate`, `browser_snapshot`, `browser_click`) |
87
+ | API | WebFetch |
88
+ | CLI | Bash |
89
+ | Visual | Read (screenshot files) |
90
+ | Browser | Chrome DevTools MCP |
108
91
 
109
- ### Verification Steps:
92
+ Steps: identify what proves the fix → execute → confirm behavior → document evidence.
110
93
 
111
- 1. **Identify verification target**: What proves this fix works?
112
- 2. **Execute verification**: Use appropriate tool from above
113
- 3. **Confirm result**: Does the actual behavior match expected?
114
- 4. **Document evidence**: Note what was verified and how
94
+ Examples:
95
+ - Web feature: navigate to page, take snapshot, verify element exists
96
+ - API fix: fetch endpoint, check response status and body
97
+ - CLI change: run command, verify output format
98
+ - UI bug: navigate, interact, confirm no error
115
99
 
116
- Example verifications:
117
- - Web feature: Navigate to page, take snapshot, verify element exists
118
- - API fix: Fetch endpoint, check response status and body
119
- - CLI change: Run command, verify output format
120
- - UI bug: Navigate, interact, confirm no error
121
-
122
- If verification fails: Return to Phase 1, fix the issue, re-verify.
100
+ If verification fails: return to Phase 1.
123
101
 
124
102
  ---
125
103
 
126
104
  ## Phase 3: SHIP
127
105
 
128
- ### 3.1 Run Build & Tests
106
+ ### 3.1 Build & Test
129
107
 
130
- ```bash
131
- # Run project's build/test commands
132
- # Example: npm run build && npm test
133
- # Example: pytest
134
- # Example: cargo build && cargo test
135
- ```
136
-
137
- If build/test fails: Fix errors, return to Phase 2 for re-verification.
108
+ Run project's build/test commands. If fail: fix → return to Phase 2.
138
109
 
139
110
  ### 3.2 Rebase
140
111
 
141
112
  ```bash
142
- git fetch origin main
143
- git rebase origin/main
113
+ git fetch origin main && git rebase origin/main
144
114
  # On conflict: resolve -> git add -> git rebase --continue
145
115
  ```
146
116
 
147
117
  ### 3.3 Commit & Push
148
118
 
149
119
  ```bash
120
+ BRANCH=$(git branch --show-current)
150
121
  git add -A
151
- git commit -m "fix: issue title summary
122
+
123
+ # Sync mode: "Closes #NUM" | Default: "Resolves: viban-ID"
124
+ if [ "$SYNC_ACTIVE" = true ]; then
125
+ git commit -m "fix: issue title summary
126
+
127
+ - Root cause: ...
128
+ - Solution: ...
129
+
130
+ Closes #$EXTERNAL_NUM"
131
+ else
132
+ git commit -m "fix: issue title summary
152
133
 
153
134
  - Root cause: ...
154
135
  - Solution: ...
155
136
 
156
- Resolves: viban-$ISSUE_ID"
137
+ Resolves: #$ISSUE_ID"
138
+ fi
157
139
 
158
- git push -u origin viban-$ISSUE_ID
140
+ git push -u origin "$BRANCH"
159
141
  ```
160
142
 
161
143
  ### 3.4 Create PR
162
144
 
163
145
  ```bash
164
- EXISTING_PR=$(gh pr list --head viban-$ISSUE_ID --json number -q '.[0].number')
165
- [ -z "$EXISTING_PR" ] && gh pr create \
166
- --title "viban-$ISSUE_ID: title" \
167
- --body "## Changes
146
+ EXISTING_PR=$(gh pr list --head "$BRANCH" --json number -q '.[0].number')
147
+
148
+ if [ -z "$EXISTING_PR" ]; then
149
+ if [ "$SYNC_ACTIVE" = true ]; then
150
+ gh pr create --title "fix: title" \
151
+ --body "## Changes
152
+ - ...
153
+
154
+ Closes #$EXTERNAL_NUM
155
+
156
+ ## Verification
157
+ - [ ] Manual verification completed
158
+ - [ ] Build passing
159
+ - [ ] Tests passing (if applicable)" --base main
160
+ else
161
+ gh pr create --title "fix: title" \
162
+ --body "## Changes
168
163
  - ...
169
164
 
170
165
  ## Verification
171
166
  - [ ] Manual verification completed
172
167
  - [ ] Build passing
173
- - [ ] Tests passing (if applicable)" \
174
- --base main
168
+ - [ ] Tests passing (if applicable)" --base main
169
+ fi
170
+ fi
175
171
  ```
176
172
 
177
- ### 3.5 Issue -> review
173
+ ### 3.5 Move to Review
178
174
 
179
175
  ```bash
180
176
  viban review $ISSUE_ID
@@ -185,18 +181,9 @@ viban review $ISSUE_ID
185
181
  ## Phase 4: HANDOFF
186
182
 
187
183
  ```
188
- Human Review Required
189
-
190
- Issue #$ISSUE_ID -> review status
191
-
192
- PR: gh pr view viban-$ISSUE_ID --web
193
-
194
- Verification complete:
195
- - Manual verification done with available tools
196
- - Build passing
197
- - Project workflow followed
198
-
199
- After approval: Delete issue from viban TUI
184
+ Issue #$ISSUE_ID → review | PR: gh pr view --web
185
+ Verification: manual + build + workflow followed
186
+ After approval: delete issue from viban TUI
200
187
  ```
201
188
 
202
189
  ---
@@ -205,7 +192,7 @@ After approval: Delete issue from viban TUI
205
192
 
206
193
  ```
207
194
  [ ] Read .viban/workflow.md (or CLAUDE.md fallback) for project workflow
208
- [ ] Working on viban-$ISSUE_ID branch
195
+ [ ] Working on issue-$ISSUE_ID branch
209
196
  [ ] Implementation complete
210
197
  [ ] Manual verification passed (using appropriate tools)
211
198
  [ ] Build & tests passing
@@ -218,13 +205,7 @@ After approval: Delete issue from viban TUI
218
205
 
219
206
  ## CRITICAL: Status Transition Rule
220
207
 
221
- > **NEVER end this skill with the issue still in `in_progress`.**
222
- >
223
- > Before exiting — whether you completed all phases or stopped early due to errors:
224
- > ```bash
225
- > viban review $ISSUE_ID
226
- > ```
227
- > This is MANDATORY. If you skip this, the board becomes stale and misleading.
208
+ > **NEVER exit with issue still in `in_progress`.** Always run `viban review $ISSUE_ID` before exiting — whether completed or stopped early.
228
209
 
229
210
  ## CLI Reference
230
211
 
@@ -0,0 +1,297 @@
1
+ ---
2
+ name: parallel-assign
3
+ description: "Assign and resolve multiple independent backlog issues in parallel using git worktrees and coordinated agents"
4
+ ---
5
+
6
+ # /parallel-assign
7
+
8
+ Parallel resolution of independent backlog issues via git worktrees.
9
+
10
+ > **CLI only** (no direct viban.json access) | **Opus sub-agents** in isolated worktrees
11
+
12
+ **Input**: `$ARGUMENTS` (optional: number of issues, default 3)
13
+
14
+ ---
15
+
16
+ ## Phase 0: SETUP
17
+
18
+ ### 0.1 Read Workflow
19
+
20
+ ```bash
21
+ [ -f ".viban/workflow.md" ] && cat ".viban/workflow.md"
22
+ ```
23
+
24
+ Fallback to CLAUDE.md, then default. Same as `/viban:assign` Phase 0.1.
25
+
26
+ ### 0.2 Parse Arguments
27
+
28
+ Extract count from `$ARGUMENTS`:
29
+ - Number provided (e.g. `/viban:parallel-assign 5`) → use that number
30
+ - No number → default to 3
31
+ - Maximum: 5
32
+
33
+ ### 0.3 Check Backlog & Git State
34
+
35
+ ```bash
36
+ viban list
37
+ ```
38
+
39
+ Count available backlog issues. Adjust N down if fewer available.
40
+ If backlog is empty: notify user and exit.
41
+
42
+ ```bash
43
+ [ -n "$(git status --porcelain)" ] && echo "Warning: Uncommitted changes"
44
+ git checkout main && git fetch origin main && git reset --hard origin/main
45
+ ```
46
+
47
+ ### 0.4 Assign Issues
48
+
49
+ Assign N issues, each with a unique session ID. Determine branch names per workflow convention:
50
+
51
+ ```bash
52
+ ISSUES=() # Array of "ID|BRANCH" pairs
53
+ for i in $(seq 1 $N); do
54
+ SESSION=$(echo "${RANDOM}${i}" | md5 | head -c 8)
55
+ ID=$(viban assign "$SESSION" 2>&1 | tail -1)
56
+ [[ -z "$ID" || "$ID" == "No backlog" ]] && break
57
+
58
+ # Determine branch name (same logic as /viban:assign Phase 0.3)
59
+ ISSUE_JSON=$(viban get "$ID")
60
+ EXT_ID=$(echo "$ISSUE_JSON" | jq -r '.external_id // ""')
61
+ if [ -n "$EXT_ID" ] && [ "$EXT_ID" != "null" ]; then
62
+ EXTERNAL_NUM="${EXT_ID##*:}"
63
+ TITLE=$(echo "$ISSUE_JSON" | jq -r '.title' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | head -c 40)
64
+ BRANCH="issue-${EXTERNAL_NUM}-${TITLE}"
65
+ else
66
+ BRANCH="issue-${ID}"
67
+ fi
68
+
69
+ ISSUES+=("${ID}|${BRANCH}")
70
+ done
71
+ ```
72
+
73
+ If no issues were assigned: notify user and exit.
74
+
75
+ ### 0.5 Create Worktrees
76
+
77
+ For each assigned issue, create an isolated git worktree:
78
+
79
+ ```bash
80
+ REPO_ROOT=$(git rev-parse --show-toplevel)
81
+ mkdir -p "$REPO_ROOT/.viban/worktrees"
82
+
83
+ for entry in "${ISSUES[@]}"; do
84
+ ID="${entry%%|*}"
85
+ BRANCH="${entry##*|}"
86
+ WT_DIR="$REPO_ROOT/.viban/worktrees/$BRANCH"
87
+
88
+ git worktree add -b "$BRANCH" "$WT_DIR" origin/main
89
+ done
90
+ ```
91
+
92
+ ### 0.6 Sync Status
93
+
94
+ ```bash
95
+ viban sync --push-only
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Phase 1: DISPATCH PARALLEL AGENTS
101
+
102
+ Spawn one **opus** agent per issue using `Task` tool. All agents launch in a single message with `run_in_background: true`.
103
+
104
+ **Agent prompt template** (per issue):
105
+
106
+ ```
107
+ You are resolving viban issue #{ID} in an isolated git worktree.
108
+
109
+ ## Environment
110
+ - Worktree path: {REPO_ROOT}/.viban/worktrees/{BRANCH}
111
+ - Branch: {BRANCH}
112
+ - Main repo: {REPO_ROOT}
113
+ - ALL file operations must happen inside the worktree path
114
+
115
+ ## Workflow
116
+ {paste workflow.md content}
117
+
118
+ ## Issue Details
119
+ {paste viban get output}
120
+
121
+ ## Plan (if available)
122
+ {paste .viban/plans/{ID}.md content, or "No plan available"}
123
+
124
+ ## Instructions
125
+
126
+ You are one of {N} parallel agents working in isolated git worktrees.
127
+
128
+ 1. Work ONLY inside your worktree: {REPO_ROOT}/.viban/worktrees/{BRANCH}
129
+ - cd to the worktree before any work
130
+ - All reads, edits, and writes must target files under this path
131
+
132
+ 2. Follow the project workflow phases:
133
+ - Analyze: understand the issue, locate code, identify root cause
134
+ - Implement: make focused changes following project conventions
135
+ - Verify: manual verification of the fix
136
+
137
+ 3. After implementation, commit on your branch:
138
+ ```bash
139
+ cd {REPO_ROOT}/.viban/worktrees/{BRANCH}
140
+ git add <specific files>
141
+ git commit -m "type: description
142
+
143
+ - Root cause: ...
144
+ - Solution: ...
145
+
146
+ Resolves: #{ID}"
147
+ ```
148
+
149
+ 4. Push and create PR:
150
+ ```bash
151
+ git push -u origin {BRANCH}
152
+ gh pr create --title "type: title" --body "..." --base main
153
+ ```
154
+
155
+ 5. Move issue to review:
156
+ ```bash
157
+ cd {REPO_ROOT}
158
+ viban review {ID}
159
+ ```
160
+
161
+ CRITICAL:
162
+ - Always run `viban review {ID}` before finishing, even on errors.
163
+ - Do NOT run the full test suite — the coordinator handles that.
164
+ - Do NOT remove the worktree — the coordinator handles cleanup.
165
+ ```
166
+
167
+ ### Dispatch Pattern
168
+
169
+ ```python
170
+ # Pseudo-code for the dispatch
171
+ for each (ID, BRANCH) in ISSUES:
172
+ Task(
173
+ subagent_type="general-purpose",
174
+ model="opus",
175
+ run_in_background=True,
176
+ prompt=filled_template(ID, BRANCH, workflow, issue_json, plan)
177
+ )
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Phase 2: MONITOR & COLLECT
183
+
184
+ 1. Wait for all background agents to complete (poll via `TaskOutput`)
185
+ 2. Collect results — note successes and failures
186
+ 3. For any issue where `viban review` was not called, run it now as safety net:
187
+ ```bash
188
+ viban review $ID
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Phase 3: TRANSPLANT & CLEANUP
194
+
195
+ After all agents finish, for each issue:
196
+
197
+ ### 3.1 Verify Local Branches
198
+
199
+ The local branch already exists (created by `git worktree add -b`). After worktree removal, the branch and its commits remain in the local repo.
200
+
201
+ ```bash
202
+ REPO_ROOT=$(git rev-parse --show-toplevel)
203
+ cd "$REPO_ROOT"
204
+
205
+ for entry in "${ISSUES[@]}"; do
206
+ BRANCH="${entry##*|}"
207
+ git log --oneline -3 "$BRANCH"
208
+ done
209
+ ```
210
+
211
+ ### 3.2 Remove Worktrees
212
+
213
+ PRs have been created — worktrees are no longer needed:
214
+
215
+ ```bash
216
+ for entry in "${ISSUES[@]}"; do
217
+ BRANCH="${entry##*|}"
218
+ WT_DIR="$REPO_ROOT/.viban/worktrees/$BRANCH"
219
+ git worktree remove "$WT_DIR" --force
220
+ done
221
+ ```
222
+
223
+ ### 3.3 Verify PRs Exist
224
+
225
+ ```bash
226
+ for entry in "${ISSUES[@]}"; do
227
+ BRANCH="${entry##*|}"
228
+ gh pr list --head "$BRANCH" --json number,title,url -q '.[0]'
229
+ done
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Phase 4: TEST & REPORT
235
+
236
+ ### 4.1 Run Tests
237
+
238
+ Run the full test suite once on main (not per-agent):
239
+
240
+ ```bash
241
+ zsh tests/run_all.zsh
242
+ ```
243
+
244
+ If tests fail: identify which agent's changes caused the failure and report.
245
+
246
+ ### 4.2 Sync
247
+
248
+ ```bash
249
+ viban sync --push-only
250
+ ```
251
+
252
+ ### 4.3 Report
253
+
254
+ ```
255
+ Parallel Resolution Complete
256
+
257
+ | Issue | Title | Branch | PR | Status |
258
+ |-------|-------|--------|----|--------|
259
+ | #ID | ... | ... | #N | review |
260
+
261
+ Total: N issues processed
262
+ Succeeded: X
263
+ Failed: Y
264
+
265
+ Local branches available:
266
+ - {BRANCH_1}
267
+ - {BRANCH_2}
268
+ ...
269
+
270
+ Worktrees cleaned up. All PRs ready for human review.
271
+ ```
272
+
273
+ ---
274
+
275
+ ## Error Handling
276
+
277
+ - **Agent fails mid-work**: coordinator calls `viban review {ID}` as safety net
278
+ - **Worktree creation fails**: skip that issue, log error, continue with others
279
+ - **PR creation fails in agent**: coordinator reports it; local branch still available for manual PR
280
+ - **Test failures**: report which branch likely caused the failure
281
+
282
+ ---
283
+
284
+ ## CRITICAL RULES
285
+
286
+ > 1. **NEVER exit with any issue still in `in_progress`.** For every assigned issue, ensure `viban review {ID}` has been called.
287
+ > 2. **ALWAYS clean up worktrees** after PRs are created. Worktree dirs must not linger in `.viban/worktrees/`.
288
+
289
+ ## CLI Reference
290
+
291
+ | Command | Description |
292
+ |---------|-------------|
293
+ | `viban list` | Print board |
294
+ | `viban assign [session]` | Assign issue |
295
+ | `viban get <id>` | View issue |
296
+ | `viban review <id>` | Move to review |
297
+ | `viban sync --push-only` | Sync to GitHub |