toenobu-agent 0.1.2 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toenobu-agent",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "toenobu's pi coding agent skills and extensions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -91,6 +91,6 @@ After all tasks complete and verified:
91
91
 
92
92
  **Required workflow skills:**
93
93
 
94
- - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
95
- - **superpowers:writing-plans** - Creates the plan this skill executes
96
- - **superpowers:finishing-a-development-branch** - Complete development after all tasks
94
+ - **using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
95
+ - **writing-plans** - Creates the plan this skill executes
96
+ - **finishing-a-development-branch** - Complete development after all tasks
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: finishing-a-development-branch
3
+ description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
4
+ ---
5
+
6
+ # Finishing a Development Branch
7
+
8
+ ## Overview
9
+
10
+ Guide completion of development work by presenting clear options and handling chosen workflow.
11
+
12
+ **Core principle:** Verify tests → Present options → Execute choice → Clean up.
13
+
14
+ **Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
15
+
16
+ ## The Process
17
+
18
+ ### Step 1: Verify Tests
19
+
20
+ **Before presenting options, verify tests pass:**
21
+
22
+ ```bash
23
+ # Run project's test suite
24
+ npm test / cargo test / pytest / go test ./...
25
+ ```
26
+
27
+ **If tests fail:**
28
+
29
+ ```
30
+ Tests failing (<N> failures). Must fix before completing:
31
+ [Show failures]
32
+
33
+ Cannot proceed with merge/PR until tests pass.
34
+ ```
35
+
36
+ Stop. Don't proceed to Step 2.
37
+
38
+ **If tests pass:** Continue to Step 2.
39
+
40
+ ### Step 2: Determine Base Branch
41
+
42
+ ```bash
43
+ # Try common base branches
44
+ git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
45
+ ```
46
+
47
+ Or ask: "This branch split from main - is that correct?"
48
+
49
+ ### Step 3: Present Options
50
+
51
+ Present exactly these 4 options:
52
+
53
+ ```
54
+ Implementation complete. What would you like to do?
55
+
56
+ 1. Merge back to <base-branch> locally
57
+ 2. Push and create a Pull Request
58
+ 3. Keep the branch as-is (I'll handle it later)
59
+ 4. Discard this work
60
+
61
+ Which option?
62
+ ```
63
+
64
+ **Don't add explanation** - keep options concise.
65
+
66
+ ### Step 4: Execute Choice
67
+
68
+ #### Option 1: Merge Locally
69
+
70
+ ```bash
71
+ # Switch to base branch
72
+ git checkout <base-branch>
73
+
74
+ # Pull latest
75
+ git pull
76
+
77
+ # Merge feature branch
78
+ git merge <feature-branch>
79
+
80
+ # Verify tests on merged result
81
+ <test command>
82
+
83
+ # If tests pass
84
+ git branch -d <feature-branch>
85
+ ```
86
+
87
+ Then: Cleanup worktree (Step 5)
88
+
89
+ #### Option 2: Push and Create PR
90
+
91
+ ```bash
92
+ # Push branch
93
+ git push -u origin <feature-branch>
94
+
95
+ # Create PR
96
+ gh pr create --title "<title>" --body "$(cat <<'EOF'
97
+ ## Summary
98
+ <2-3 bullets of what changed>
99
+
100
+ ## Test Plan
101
+ - [ ] <verification steps>
102
+ EOF
103
+ )"
104
+ ```
105
+
106
+ Then: Cleanup worktree (Step 5)
107
+
108
+ #### Option 3: Keep As-Is
109
+
110
+ Report: "Keeping branch <name>. Worktree preserved at <path>."
111
+
112
+ **Don't cleanup worktree.**
113
+
114
+ #### Option 4: Discard
115
+
116
+ **Confirm first:**
117
+
118
+ ```
119
+ This will permanently delete:
120
+ - Branch <name>
121
+ - All commits: <commit-list>
122
+ - Worktree at <path>
123
+
124
+ Type 'discard' to confirm.
125
+ ```
126
+
127
+ Wait for exact confirmation. If confirmed:
128
+
129
+ ```bash
130
+ git checkout <base-branch>
131
+ git branch -D <feature-branch>
132
+ ```
133
+
134
+ Then: Cleanup worktree (Step 5)
135
+
136
+ ### Step 5: Cleanup Worktree
137
+
138
+ **For Options 1, 2, 4:**
139
+
140
+ Check if in worktree:
141
+
142
+ ```bash
143
+ git worktree list | grep $(git branch --show-current)
144
+ ```
145
+
146
+ If yes:
147
+
148
+ ```bash
149
+ git worktree remove <worktree-path>
150
+ ```
151
+
152
+ **For Option 3:** Keep worktree.
153
+
154
+ ## Quick Reference
155
+
156
+ | Option | Merge | Push | Keep Worktree | Cleanup Branch |
157
+ |--------|-------|------|---------------|----------------|
158
+ | 1. Merge locally | ✓ | - | - | ✓ |
159
+ | 2. Create PR | - | ✓ | ✓ | - |
160
+ | 3. Keep as-is | - | - | ✓ | - |
161
+ | 4. Discard | - | - | - | ✓ (force) |
162
+
163
+ ## Common Mistakes
164
+
165
+ **Skipping test verification**
166
+ - **Problem:** Merge broken code, create failing PR
167
+ - **Fix:** Always verify tests before offering options
168
+
169
+ **Open-ended questions**
170
+ - **Problem:** "What should I do next?" → ambiguous
171
+ - **Fix:** Present exactly 4 structured options
172
+
173
+ **Automatic worktree cleanup**
174
+ - **Problem:** Remove worktree when might need it (Option 2, 3)
175
+ - **Fix:** Only cleanup for Options 1 and 4
176
+
177
+ **No confirmation for discard**
178
+ - **Problem:** Accidentally delete work
179
+ - **Fix:** Require typed "discard" confirmation
180
+
181
+ ## Red Flags
182
+
183
+ **Never:**
184
+ - Proceed with failing tests
185
+ - Merge without verifying tests on result
186
+ - Delete work without confirmation
187
+ - Force-push without explicit request
188
+
189
+ **Always:**
190
+ - Verify tests before offering options
191
+ - Present exactly 4 options
192
+ - Get typed confirmation for Option 4
193
+ - Clean up worktree for Options 1 & 4 only
194
+
195
+ ## Integration
196
+
197
+ **Called by:**
198
+ - **subagent-driven-development** (Step 7) - After all tasks complete
199
+ - **executing-plans** (Step 5) - After all batches complete
200
+
201
+ **Pairs with:**
202
+ - **using-git-worktrees** - Cleans up worktree created by that skill
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
4
+ ---
5
+
6
+ # Using Git Worktrees
7
+
8
+ ## Overview
9
+
10
+ Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
11
+
12
+ **Core principle:** Systematic directory selection + safety verification = reliable isolation.
13
+
14
+ **Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
15
+
16
+ ## Directory Selection Process
17
+
18
+ Follow this priority order:
19
+
20
+ ### 1. Check Existing Directories
21
+
22
+ ```bash
23
+ # Check in priority order
24
+ ls -d .worktrees 2>/dev/null # Preferred (hidden)
25
+ ls -d worktrees 2>/dev/null # Alternative
26
+ ```
27
+
28
+ **If found:** Use that directory. If both exist, `.worktrees` wins.
29
+
30
+ ### 2. Check CLAUDE.md
31
+
32
+ ```bash
33
+ grep -i "worktree.*director" CLAUDE.md 2>/dev/null
34
+ ```
35
+
36
+ **If preference specified:** Use it without asking.
37
+
38
+ ### 3. Ask User
39
+
40
+ If no directory exists and no CLAUDE.md preference:
41
+
42
+ ```
43
+ No worktree directory found. Where should I create worktrees?
44
+
45
+ 1. .worktrees/ (project-local, hidden)
46
+ 2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
47
+
48
+ Which would you prefer?
49
+ ```
50
+
51
+ ## Safety Verification
52
+
53
+ ### For Project-Local Directories (.worktrees or worktrees)
54
+
55
+ **MUST verify directory is ignored before creating worktree:**
56
+
57
+ ```bash
58
+ # Check if directory is ignored (respects local, global, and system gitignore)
59
+ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
60
+ ```
61
+
62
+ **If NOT ignored:** Per Jesse's rule "Fix broken things immediately":
63
+
64
+ 1. Add appropriate line to .gitignore
65
+ 2. Commit the change
66
+ 3. Proceed with worktree creation
67
+
68
+ **Why critical:** Prevents accidentally committing worktree contents to repository.
69
+
70
+ ### For Global Directory (~/.config/superpowers/worktrees)
71
+
72
+ No .gitignore verification needed - outside project entirely.
73
+
74
+ ## Creation Steps
75
+
76
+ ### 1. Detect Project Name
77
+
78
+ ```bash
79
+ project=$(basename "$(git rev-parse --show-toplevel)")
80
+ ```
81
+
82
+ ### 2. Create Worktree
83
+
84
+ ```bash
85
+ # Determine full path
86
+ case $LOCATION in
87
+ .worktrees|worktrees)
88
+ path="$LOCATION/$BRANCH_NAME"
89
+ ;;
90
+ ~/.config/superpowers/worktrees/*)
91
+ path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
92
+ ;;
93
+ esac
94
+
95
+ # Create worktree with new branch
96
+ git worktree add "$path" -b "$BRANCH_NAME"
97
+ cd "$path"
98
+ ```
99
+
100
+ ### 3. Run Project Setup
101
+
102
+ Auto-detect and run appropriate setup:
103
+
104
+ ```bash
105
+ # Node.js
106
+ if [ -f package.json ]; then npm install; fi
107
+
108
+ # Rust
109
+ if [ -f Cargo.toml ]; then cargo build; fi
110
+
111
+ # Python
112
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
113
+ if [ -f pyproject.toml ]; then poetry install; fi
114
+
115
+ # Go
116
+ if [ -f go.mod ]; then go mod download; fi
117
+ ```
118
+
119
+ ### 4. Verify Clean Baseline
120
+
121
+ Run tests to ensure worktree starts clean:
122
+
123
+ ```bash
124
+ # Examples - use project-appropriate command
125
+ npm test
126
+ cargo test
127
+ pytest
128
+ go test ./...
129
+ ```
130
+
131
+ **If tests fail:** Report failures, ask whether to proceed or investigate.
132
+
133
+ **If tests pass:** Report ready.
134
+
135
+ ### 5. Report Location
136
+
137
+ ```
138
+ Worktree ready at <full-path>
139
+ Tests passing (<N> tests, 0 failures)
140
+ Ready to implement <feature-name>
141
+ ```
142
+
143
+ ## Quick Reference
144
+
145
+ | Situation | Action |
146
+ |-----------|--------|
147
+ | `.worktrees/` exists | Use it (verify ignored) |
148
+ | `worktrees/` exists | Use it (verify ignored) |
149
+ | Both exist | Use `.worktrees/` |
150
+ | Neither exists | Check CLAUDE.md → Ask user |
151
+ | Directory not ignored | Add to .gitignore + commit |
152
+ | Tests fail during baseline | Report failures + ask |
153
+ | No package.json/Cargo.toml | Skip dependency install |
154
+
155
+ ## Common Mistakes
156
+
157
+ ### Skipping ignore verification
158
+
159
+ - **Problem:** Worktree contents get tracked, pollute git status
160
+ - **Fix:** Always use `git check-ignore` before creating project-local worktree
161
+
162
+ ### Assuming directory location
163
+
164
+ - **Problem:** Creates inconsistency, violates project conventions
165
+ - **Fix:** Follow priority: existing > CLAUDE.md > ask
166
+
167
+ ### Proceeding with failing tests
168
+
169
+ - **Problem:** Can't distinguish new bugs from pre-existing issues
170
+ - **Fix:** Report failures, get explicit permission to proceed
171
+
172
+ ### Hardcoding setup commands
173
+
174
+ - **Problem:** Breaks on projects using different tools
175
+ - **Fix:** Auto-detect from project files (package.json, etc.)
176
+
177
+ ## Example Workflow
178
+
179
+ ```
180
+ You: I'm using the using-git-worktrees skill to set up an isolated workspace.
181
+
182
+ [Check .worktrees/ - exists]
183
+ [Verify ignored - git check-ignore confirms .worktrees/ is ignored]
184
+ [Create worktree: git worktree add .worktrees/auth -b feature/auth]
185
+ [Run npm install]
186
+ [Run npm test - 47 passing]
187
+
188
+ Worktree ready at /Users/jesse/myproject/.worktrees/auth
189
+ Tests passing (47 tests, 0 failures)
190
+ Ready to implement auth feature
191
+ ```
192
+
193
+ ## Red Flags
194
+
195
+ **Never:**
196
+
197
+ - Create worktree without verifying it's ignored (project-local)
198
+ - Skip baseline test verification
199
+ - Proceed with failing tests without asking
200
+ - Assume directory location when ambiguous
201
+ - Skip CLAUDE.md check
202
+
203
+ **Always:**
204
+
205
+ - Follow directory priority: existing > CLAUDE.md > ask
206
+ - Verify directory is ignored for project-local
207
+ - Auto-detect and run project setup
208
+ - Verify clean test baseline
209
+
210
+ ## Integration
211
+
212
+ **Called by:**
213
+
214
+ - **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
215
+ - **subagent-driven-development** - REQUIRED before executing any tasks
216
+ - **executing-plans** - REQUIRED before executing any tasks
217
+ - Any skill needing isolated workspace
218
+
219
+ **Pairs with:**
220
+
221
+ - **finishing-a-development-branch** - REQUIRED for cleanup after work complete