claude-plugin-viban 1.2.0 → 1.2.2
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/.claude-plugin/plugin.json +1 -1
- package/bin/viban +2 -4
- package/commands/parallel-assign.md +21 -0
- package/commands/setup.md +1 -1
- package/docs/CLAUDE.md +3 -3
- package/package.json +1 -1
- package/skills/assign/SKILL.md +1 -2
- package/skills/parallel-assign/SKILL.md +289 -0
- package/skills/setup/SKILL.md +1 -1
package/bin/viban
CHANGED
|
@@ -1047,8 +1047,7 @@ delete_issue() {
|
|
|
1047
1047
|
local repo_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
1048
1048
|
local wt_dir="$VIBAN_DATA_DIR/worktrees/$id"
|
|
1049
1049
|
|
|
1050
|
-
|
|
1051
|
-
local branch="viban-$id"
|
|
1050
|
+
local branch="issue-$id"
|
|
1052
1051
|
local _ext_id=$(get_ext_id "$id")
|
|
1053
1052
|
if [[ -n "$_ext_id" && "$_ext_id" != "null" ]]; then
|
|
1054
1053
|
local _issue_num="${_ext_id##*:}"
|
|
@@ -1519,8 +1518,7 @@ cmd_done() {
|
|
|
1519
1518
|
local repo_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
1520
1519
|
local wt_dir="$VIBAN_DATA_DIR/worktrees/$1"
|
|
1521
1520
|
|
|
1522
|
-
|
|
1523
|
-
local branch="viban-$1"
|
|
1521
|
+
local branch="issue-$1"
|
|
1524
1522
|
local _ext_id=$(get_ext_id "$1")
|
|
1525
1523
|
if [[ -n "$_ext_id" && "$_ext_id" != "null" ]]; then
|
|
1526
1524
|
local _issue_num="${_ext_id##*:}"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Assign and resolve multiple independent backlog issues in parallel — each agent works in its own isolated git worktree"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run `/viban:parallel-assign` to process multiple backlog issues simultaneously.
|
|
6
|
+
|
|
7
|
+
Each issue is resolved in a **separate git worktree**, so agents never interfere with each other's work. Worktrees are automatically cleaned up after PRs are created.
|
|
8
|
+
|
|
9
|
+
Usage: `/viban:parallel-assign [count]`
|
|
10
|
+
|
|
11
|
+
- `count`: Number of issues to process in parallel (default: 3, max: 5)
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
- `/viban:parallel-assign` — resolve up to 3 backlog issues in parallel (each in its own worktree)
|
|
15
|
+
- `/viban:parallel-assign 5` — resolve up to 5 backlog issues in parallel
|
|
16
|
+
|
|
17
|
+
How it works:
|
|
18
|
+
1. Assigns N backlog issues and creates isolated git worktrees (`.viban/worktrees/{id}`)
|
|
19
|
+
2. Spawns one opus agent per issue — each agent works exclusively in its own worktree
|
|
20
|
+
3. Agents analyze, implement, commit, push, and create PRs independently
|
|
21
|
+
4. Coordinator collects results, runs tests, and cleans up worktrees
|
package/commands/setup.md
CHANGED
|
@@ -370,7 +370,7 @@ If build/test fails: fix errors, return to Phase 3.
|
|
|
370
370
|
{AUTO_DETECTED from git history — infer format from existing commits. If Q3 overrides, use that instead.}
|
|
371
371
|
|
|
372
372
|
### Branch Convention
|
|
373
|
-
{AUTO_DETECTED from existing patterns, or `
|
|
373
|
+
{AUTO_DETECTED from existing patterns, or `issue-{id}` as default}
|
|
374
374
|
|
|
375
375
|
### Pull Request
|
|
376
376
|
{FROM Q1:}
|
package/docs/CLAUDE.md
CHANGED
|
@@ -60,16 +60,16 @@ EOF
|
|
|
60
60
|
### 🔴 Worktree 사용 금지
|
|
61
61
|
- **main repo에서 feature branch로 직접 작업**
|
|
62
62
|
- worktree 생성/사용 금지 (사용자 명시적 요청)
|
|
63
|
-
- 브랜치 네이밍: `
|
|
63
|
+
- 브랜치 네이밍: `issue-{ISSUE_ID}` (예: `issue-78`)
|
|
64
64
|
|
|
65
65
|
### Branch-Based Workflow
|
|
66
66
|
```bash
|
|
67
67
|
# 1. main에서 분기
|
|
68
68
|
git checkout main && git pull
|
|
69
|
-
git checkout -b
|
|
69
|
+
git checkout -b issue-{ISSUE_ID}
|
|
70
70
|
|
|
71
71
|
# 2. 작업 후 push
|
|
72
|
-
git push -u origin
|
|
72
|
+
git push -u origin issue-{ISSUE_ID}
|
|
73
73
|
|
|
74
74
|
# 3. PR 생성
|
|
75
75
|
gh pr create --title "..." --body "..."
|
package/package.json
CHANGED
package/skills/assign/SKILL.md
CHANGED
|
@@ -49,8 +49,7 @@ SYNC_ACTIVE=false; EXTERNAL_NUM=""
|
|
|
49
49
|
if [ -n "$EXT_ID" ] && [ "$EXT_ID" != "null" ]; then
|
|
50
50
|
SYNC_ACTIVE=true
|
|
51
51
|
EXTERNAL_NUM="${EXT_ID##*:}" # "github:42" -> "42"
|
|
52
|
-
|
|
53
|
-
git checkout -b "issue-${EXTERNAL_NUM}-${TITLE}"
|
|
52
|
+
git checkout -b "issue-${EXTERNAL_NUM}"
|
|
54
53
|
else
|
|
55
54
|
git checkout -b issue-$ISSUE_ID
|
|
56
55
|
fi
|
|
@@ -0,0 +1,289 @@
|
|
|
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
|
+
BRANCH="issue-${ID}"
|
|
59
|
+
|
|
60
|
+
ISSUES+=("${ID}|${BRANCH}")
|
|
61
|
+
done
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If no issues were assigned: notify user and exit.
|
|
65
|
+
|
|
66
|
+
### 0.5 Create Worktrees
|
|
67
|
+
|
|
68
|
+
For each assigned issue, create an isolated git worktree:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
72
|
+
mkdir -p "$REPO_ROOT/.viban/worktrees"
|
|
73
|
+
|
|
74
|
+
for entry in "${ISSUES[@]}"; do
|
|
75
|
+
ID="${entry%%|*}"
|
|
76
|
+
BRANCH="${entry##*|}"
|
|
77
|
+
# Use issue ID as worktree dir name (matches cmd_done cleanup at .viban/worktrees/{ID})
|
|
78
|
+
WT_DIR="$REPO_ROOT/.viban/worktrees/$ID"
|
|
79
|
+
|
|
80
|
+
git worktree add -b "$BRANCH" "$WT_DIR" origin/main
|
|
81
|
+
done
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 0.6 Sync Status
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
viban sync --push-only
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Phase 1: DISPATCH PARALLEL AGENTS
|
|
93
|
+
|
|
94
|
+
Spawn one **opus** agent per issue using `Task` tool. All agents launch in a single message with `run_in_background: true`.
|
|
95
|
+
|
|
96
|
+
**Agent prompt template** (per issue):
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
You are resolving viban issue #{ID} in an isolated git worktree.
|
|
100
|
+
|
|
101
|
+
## Environment
|
|
102
|
+
- Worktree path: {REPO_ROOT}/.viban/worktrees/{ID}
|
|
103
|
+
- Branch: {BRANCH}
|
|
104
|
+
- Main repo: {REPO_ROOT}
|
|
105
|
+
- ALL file operations must happen inside the worktree path
|
|
106
|
+
|
|
107
|
+
## Workflow
|
|
108
|
+
{paste workflow.md content}
|
|
109
|
+
|
|
110
|
+
## Issue Details
|
|
111
|
+
{paste viban get output}
|
|
112
|
+
|
|
113
|
+
## Plan (if available)
|
|
114
|
+
{paste .viban/plans/{ID}.md content, or "No plan available"}
|
|
115
|
+
|
|
116
|
+
## Instructions
|
|
117
|
+
|
|
118
|
+
You are one of {N} parallel agents working in isolated git worktrees.
|
|
119
|
+
|
|
120
|
+
1. Work ONLY inside your worktree: {REPO_ROOT}/.viban/worktrees/{ID}
|
|
121
|
+
- cd to the worktree before any work
|
|
122
|
+
- All reads, edits, and writes must target files under this path
|
|
123
|
+
|
|
124
|
+
2. Follow the project workflow phases:
|
|
125
|
+
- Analyze: understand the issue, locate code, identify root cause
|
|
126
|
+
- Implement: make focused changes following project conventions
|
|
127
|
+
- Verify: manual verification of the fix
|
|
128
|
+
|
|
129
|
+
3. After implementation, commit on your branch:
|
|
130
|
+
```bash
|
|
131
|
+
cd {REPO_ROOT}/.viban/worktrees/{ID}
|
|
132
|
+
git add <specific files>
|
|
133
|
+
git commit -m "type: description
|
|
134
|
+
|
|
135
|
+
- Root cause: ...
|
|
136
|
+
- Solution: ...
|
|
137
|
+
|
|
138
|
+
Resolves: #{ID}"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
4. Push and create PR:
|
|
142
|
+
```bash
|
|
143
|
+
git push -u origin {BRANCH}
|
|
144
|
+
gh pr create --title "type: title" --body "..." --base main
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
5. Move issue to review:
|
|
148
|
+
```bash
|
|
149
|
+
cd {REPO_ROOT}
|
|
150
|
+
viban review {ID}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
CRITICAL:
|
|
154
|
+
- Always run `viban review {ID}` before finishing, even on errors.
|
|
155
|
+
- Do NOT run the full test suite — the coordinator handles that.
|
|
156
|
+
- Do NOT remove the worktree — the coordinator handles cleanup.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Dispatch Pattern
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
# Pseudo-code for the dispatch
|
|
163
|
+
for each (ID, BRANCH) in ISSUES:
|
|
164
|
+
Task(
|
|
165
|
+
subagent_type="general-purpose",
|
|
166
|
+
model="opus",
|
|
167
|
+
run_in_background=True,
|
|
168
|
+
prompt=filled_template(ID, BRANCH, workflow, issue_json, plan)
|
|
169
|
+
)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Phase 2: MONITOR & COLLECT
|
|
175
|
+
|
|
176
|
+
1. Wait for all background agents to complete (poll via `TaskOutput`)
|
|
177
|
+
2. Collect results — note successes and failures
|
|
178
|
+
3. For any issue where `viban review` was not called, run it now as safety net:
|
|
179
|
+
```bash
|
|
180
|
+
viban review $ID
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Phase 3: TRANSPLANT & CLEANUP
|
|
186
|
+
|
|
187
|
+
After all agents finish, for each issue:
|
|
188
|
+
|
|
189
|
+
### 3.1 Verify Local Branches
|
|
190
|
+
|
|
191
|
+
The local branch already exists (created by `git worktree add -b`). After worktree removal, the branch and its commits remain in the local repo.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
195
|
+
cd "$REPO_ROOT"
|
|
196
|
+
|
|
197
|
+
for entry in "${ISSUES[@]}"; do
|
|
198
|
+
BRANCH="${entry##*|}"
|
|
199
|
+
git log --oneline -3 "$BRANCH"
|
|
200
|
+
done
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 3.2 Remove Worktrees
|
|
204
|
+
|
|
205
|
+
PRs have been created — worktrees are no longer needed:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
for entry in "${ISSUES[@]}"; do
|
|
209
|
+
ID="${entry%%|*}"
|
|
210
|
+
WT_DIR="$REPO_ROOT/.viban/worktrees/$ID"
|
|
211
|
+
git worktree remove "$WT_DIR" --force
|
|
212
|
+
done
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 3.3 Verify PRs Exist
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
for entry in "${ISSUES[@]}"; do
|
|
219
|
+
BRANCH="${entry##*|}"
|
|
220
|
+
gh pr list --head "$BRANCH" --json number,title,url -q '.[0]'
|
|
221
|
+
done
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Phase 4: TEST & REPORT
|
|
227
|
+
|
|
228
|
+
### 4.1 Run Tests
|
|
229
|
+
|
|
230
|
+
Run the full test suite once on main (not per-agent):
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
zsh tests/run_all.zsh
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
If tests fail: identify which agent's changes caused the failure and report.
|
|
237
|
+
|
|
238
|
+
### 4.2 Sync
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
viban sync --push-only
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 4.3 Report
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Parallel Resolution Complete
|
|
248
|
+
|
|
249
|
+
| Issue | Title | Branch | PR | Status |
|
|
250
|
+
|-------|-------|--------|----|--------|
|
|
251
|
+
| #ID | ... | ... | #N | review |
|
|
252
|
+
|
|
253
|
+
Total: N issues processed
|
|
254
|
+
Succeeded: X
|
|
255
|
+
Failed: Y
|
|
256
|
+
|
|
257
|
+
Local branches available:
|
|
258
|
+
- {BRANCH_1}
|
|
259
|
+
- {BRANCH_2}
|
|
260
|
+
...
|
|
261
|
+
|
|
262
|
+
Worktrees cleaned up. All PRs ready for human review.
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Error Handling
|
|
268
|
+
|
|
269
|
+
- **Agent fails mid-work**: coordinator calls `viban review {ID}` as safety net
|
|
270
|
+
- **Worktree creation fails**: skip that issue, log error, continue with others
|
|
271
|
+
- **PR creation fails in agent**: coordinator reports it; local branch still available for manual PR
|
|
272
|
+
- **Test failures**: report which branch likely caused the failure
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## CRITICAL RULES
|
|
277
|
+
|
|
278
|
+
> 1. **NEVER exit with any issue still in `in_progress`.** For every assigned issue, ensure `viban review {ID}` has been called.
|
|
279
|
+
> 2. **ALWAYS clean up worktrees** after PRs are created. Worktree dirs must not linger in `.viban/worktrees/`.
|
|
280
|
+
|
|
281
|
+
## CLI Reference
|
|
282
|
+
|
|
283
|
+
| Command | Description |
|
|
284
|
+
|---------|-------------|
|
|
285
|
+
| `viban list` | Print board |
|
|
286
|
+
| `viban assign [session]` | Assign issue |
|
|
287
|
+
| `viban get <id>` | View issue |
|
|
288
|
+
| `viban review <id>` | Move to review |
|
|
289
|
+
| `viban sync --push-only` | Sync to GitHub |
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -393,7 +393,7 @@ If build/test fails: fix errors, return to Phase 3.
|
|
|
393
393
|
{AUTO_DETECTED from git history — infer format from existing commits. If Q3 overrides, use that instead.}
|
|
394
394
|
|
|
395
395
|
### Branch Convention
|
|
396
|
-
{AUTO_DETECTED from existing patterns, or `
|
|
396
|
+
{AUTO_DETECTED from existing patterns, or `issue-{id}` as default}
|
|
397
397
|
|
|
398
398
|
### Pull Request
|
|
399
399
|
{FROM Q1:}
|