lite-kits 0.1.0__py3-none-any.whl

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.
Files changed (31) hide show
  1. lite_kits/__init__.py +9 -0
  2. lite_kits/cli.py +481 -0
  3. lite_kits/installer.py +417 -0
  4. lite_kits/kits/README.md +191 -0
  5. lite_kits/kits/git/README.md +374 -0
  6. lite_kits/kits/git/claude/commands/cleanup.md +361 -0
  7. lite_kits/kits/git/claude/commands/commit.md +612 -0
  8. lite_kits/kits/git/claude/commands/pr.md +593 -0
  9. lite_kits/kits/git/github/prompts/cleanup.prompt.md +382 -0
  10. lite_kits/kits/git/github/prompts/commit.prompt.md +591 -0
  11. lite_kits/kits/git/github/prompts/pr.prompt.md +603 -0
  12. lite_kits/kits/git/scripts/bash/get-git-context.sh +208 -0
  13. lite_kits/kits/git/scripts/powershell/Get-GitContext.ps1 +242 -0
  14. lite_kits/kits/multiagent/README.md +395 -0
  15. lite_kits/kits/multiagent/claude/commands/sync.md +331 -0
  16. lite_kits/kits/multiagent/github/prompts/sync.prompt.md +331 -0
  17. lite_kits/kits/multiagent/memory/git-worktrees-protocol.md +370 -0
  18. lite_kits/kits/multiagent/memory/parallel-work-protocol.md +536 -0
  19. lite_kits/kits/multiagent/memory/pr-workflow-guide.md +281 -0
  20. lite_kits/kits/multiagent/templates/collaboration-structure/README.md +166 -0
  21. lite_kits/kits/multiagent/templates/decision.md +79 -0
  22. lite_kits/kits/multiagent/templates/handoff.md +95 -0
  23. lite_kits/kits/multiagent/templates/session-log.md +68 -0
  24. lite_kits/kits/project/README.md +244 -0
  25. lite_kits/kits/project/claude/commands/orient.md +163 -0
  26. lite_kits/kits/project/github/prompts/orient.prompt.md +163 -0
  27. lite_kits-0.1.0.dist-info/METADATA +415 -0
  28. lite_kits-0.1.0.dist-info/RECORD +31 -0
  29. lite_kits-0.1.0.dist-info/WHEEL +4 -0
  30. lite_kits-0.1.0.dist-info/entry_points.txt +2 -0
  31. lite_kits-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,361 @@
1
+ ---
2
+ description: Clean up merged branches
3
+ ---
4
+
5
+ # Branch Cleanup
6
+
7
+ **Purpose**: Safely delete local branches that have been merged, keeping your workspace clean.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ /cleanup # Clean up local branches only
13
+ /cleanup --remote # Also delete from remote
14
+ /cleanup --include-current # Include current branch if PR merged
15
+ ```
16
+
17
+ ## Prerequisites
18
+
19
+ - Git repository
20
+ - On a safe branch (not the branch you want to delete, unless using --include-current)
21
+
22
+ ## Execution Steps
23
+
24
+ ### 1. Get Current Branch and Base Branch
25
+
26
+ ```bash
27
+ # Get current branch
28
+ CURRENT_BRANCH=$(git branch --show-current)
29
+
30
+ # Determine base branch (develop or main)
31
+ for base in develop main master; do
32
+ if git show-ref --verify --quiet refs/heads/$base; then
33
+ BASE_BRANCH=$base
34
+ break
35
+ fi
36
+ done
37
+
38
+ echo "Current branch: $CURRENT_BRANCH"
39
+ echo "Base branch: $BASE_BRANCH"
40
+ ```
41
+
42
+ ### 1a. Check if Current Branch Should Be Included
43
+
44
+ **If `--include-current` flag is present OR current branch is merged with no uncommitted work**:
45
+
46
+ ```bash
47
+ # Check if current branch is merged into base
48
+ if git merge-base --is-ancestor HEAD origin/$BASE_BRANCH 2>/dev/null; then
49
+ # Check if there are any commits ahead of base
50
+ COMMITS_AHEAD=$(git rev-list --count origin/$BASE_BRANCH..HEAD)
51
+
52
+ if [ $COMMITS_AHEAD -eq 0 ]; then
53
+ # PR was merged, current branch is fully in base
54
+ echo "✓ Current branch PR appears to be merged (no commits ahead of $BASE_BRANCH)"
55
+
56
+ # Check for uncommitted changes
57
+ if git diff-index --quiet HEAD --; then
58
+ INCLUDE_CURRENT=true
59
+ echo "⚠️ Current branch can be deleted (will switch to $BASE_BRANCH first)"
60
+ else
61
+ echo "⚠️ Current branch has uncommitted changes - won't auto-delete"
62
+ INCLUDE_CURRENT=false
63
+ fi
64
+ fi
65
+ fi
66
+ ```
67
+
68
+ **If current branch should be included**:
69
+ ```
70
+ ⚠️ Your current branch (dev/004-cleanup-command) appears to be merged!
71
+
72
+ The PR has been merged into develop with no additional commits.
73
+
74
+ Include current branch in cleanup?
75
+ - Will switch to develop first
76
+ - Then delete dev/004-cleanup-command
77
+
78
+ Include? (y/n): _____
79
+ ```
80
+
81
+ **Safety check**:
82
+ ```
83
+ ⚠️ Currently on: dev/004-cleanup-command
84
+
85
+ Cleanup will check branches merged into: develop
86
+
87
+ Continue? (y/n): _____
88
+ ```
89
+
90
+ ### 2. Find Merged Branches
91
+
92
+ ```bash
93
+ # Get all merged branches (excluding current, base, and protected branches)
94
+ git branch --merged $BASE_BRANCH | \
95
+ grep -v "^\*" | \
96
+ grep -v "$BASE_BRANCH" | \
97
+ grep -v "main" | \
98
+ grep -v "master" | \
99
+ grep -v "develop"
100
+ ```
101
+
102
+ **If no merged branches found**:
103
+ ```
104
+ ✓ No merged branches to clean up.
105
+
106
+ All branches are either:
107
+ - Currently active
108
+ - Protected (main/develop/master)
109
+ - Unmerged
110
+
111
+ Workspace is clean!
112
+ ```
113
+
114
+ **If merged branches found**, analyze each:
115
+ ```bash
116
+ # For each merged branch, get last commit info
117
+ for branch in $MERGED_BRANCHES; do
118
+ LAST_COMMIT=$(git log -1 --format="%ar by %an" $branch)
119
+ LAST_HASH=$(git log -1 --format="%h" $branch)
120
+ echo "$branch | $LAST_HASH | $LAST_COMMIT"
121
+ done
122
+ ```
123
+
124
+ ### 3. Present Branches for Cleanup
125
+
126
+ Show branches in a code block with clear formatting:
127
+
128
+ ```
129
+ **🧹 Merged Branches Available for Cleanup:**
130
+
131
+ **Base branch:** develop
132
+
133
+ **Merged branches:**
134
+
135
+ 1. dev/001-starter-kits
136
+ Last commit: 5b1ad35 (2 days ago by tmorgan181)
137
+
138
+ 2. dev/002-installer-polish
139
+ Last commit: 9cd3690 (1 day ago by tmorgan181)
140
+
141
+ 3. feature/old-experiment
142
+ Last commit: abc1234 (2 weeks ago by tmorgan181)
143
+
144
+ **Protected branches** (will NOT be deleted):
145
+ - develop
146
+ - main
147
+ - dev/004-cleanup-command (current)
148
+
149
+ ===========================================================
150
+ ```
151
+
152
+ **Ask for confirmation**:
153
+ - **y** - Delete all listed branches
154
+ - **n** - Cancel cleanup
155
+ - **e** - Select specific branches (reply with numbers: e.g., "1 3")
156
+
157
+ ### 4. Execute Cleanup
158
+
159
+ **If current branch should be deleted, switch first**:
160
+ ```bash
161
+ if [ "$INCLUDE_CURRENT" = true ]; then
162
+ echo "Switching to $BASE_BRANCH..."
163
+ git checkout $BASE_BRANCH
164
+ git pull origin $BASE_BRANCH
165
+
166
+ # Add current branch to cleanup list
167
+ MERGED_BRANCHES="$MERGED_BRANCHES
168
+ $CURRENT_BRANCH"
169
+ fi
170
+ ```
171
+
172
+ **If user selects specific branches (e.g., "1 3")**:
173
+ ```bash
174
+ # Parse selection
175
+ SELECTED="1 3"
176
+
177
+ # Delete selected branches
178
+ for num in $SELECTED; do
179
+ # Get branch name from list
180
+ BRANCH=$(echo "$MERGED_BRANCHES" | sed -n "${num}p")
181
+
182
+ # Delete local branch
183
+ git branch -d $BRANCH
184
+
185
+ if [ $? -eq 0 ]; then
186
+ echo "✓ Deleted local: $BRANCH"
187
+
188
+ # If --remote flag, also delete from remote
189
+ if [ "$DELETE_REMOTE" = true ]; then
190
+ if git ls-remote --heads origin $BRANCH | grep -q $BRANCH; then
191
+ git push origin --delete $BRANCH
192
+ if [ $? -eq 0 ]; then
193
+ echo "✓ Deleted remote: $BRANCH"
194
+ else
195
+ echo "✗ Failed to delete remote: $BRANCH"
196
+ fi
197
+ fi
198
+ fi
199
+ else
200
+ echo "✗ Failed to delete: $BRANCH"
201
+ fi
202
+ done
203
+ ```
204
+
205
+ **If user confirms all (y)**:
206
+ ```bash
207
+ # Delete all merged branches
208
+ for branch in $MERGED_BRANCHES; do
209
+ # Delete local branch
210
+ git branch -d $branch
211
+
212
+ if [ $? -eq 0 ]; then
213
+ echo "✓ Deleted local: $branch"
214
+
215
+ # If --remote flag, also delete from remote
216
+ if [ "$DELETE_REMOTE" = true ]; then
217
+ if git ls-remote --heads origin $branch | grep -q $branch; then
218
+ git push origin --delete $branch
219
+ if [ $? -eq 0 ]; then
220
+ echo "✓ Deleted remote: $branch"
221
+ else
222
+ echo "✗ Failed to delete remote: $branch"
223
+ fi
224
+ fi
225
+ fi
226
+ else
227
+ echo "✗ Failed to delete: $branch"
228
+ fi
229
+ done
230
+ ```
231
+
232
+ ### 5. Show Summary
233
+
234
+ After cleanup, show what was done:
235
+
236
+ ```
237
+ ===========================================================
238
+ ✓ Cleanup Complete
239
+ ===========================================================
240
+
241
+ **Deleted branches:**
242
+ ✓ dev/001-starter-kits
243
+ ✓ dev/002-installer-polish
244
+
245
+ **Kept branches:**
246
+ - develop (protected)
247
+ - main (protected)
248
+ - dev/004-cleanup-command (current)
249
+ - feature/in-progress (unmerged)
250
+
251
+ **Workspace status:**
252
+ - 2 branches deleted
253
+ - 4 branches remaining
254
+
255
+ ===========================================================
256
+ ```
257
+
258
+ ## Important Notes
259
+
260
+ **Safety Features**:
261
+ - Never deletes current branch (unless `--include-current` and PR is merged)
262
+ - Never deletes base branches (main, develop, master)
263
+ - Only deletes branches that are fully merged
264
+ - Uses `git branch -d` (safe delete, will fail if unmerged changes)
265
+ - Always asks for confirmation before deletion
266
+ - Remote deletion is opt-in with `--remote` flag
267
+
268
+ **Protected Branches** (never deleted automatically):
269
+ - Current branch (unless `--include-current` and PR merged with no new commits)
270
+ - `main`, `master`, `develop` (common base branches)
271
+ - Any branch that hasn't been merged
272
+
273
+ **Flags**:
274
+ - `--remote`: Also delete branches from remote repository
275
+ - `--include-current`: Allow deletion of current branch if PR is merged
276
+
277
+ **Error Handling**:
278
+ ```bash
279
+ # If branch has unmerged changes
280
+ if git branch -d $branch 2>&1 | grep -q "not fully merged"; then
281
+ echo "⚠️ Branch '$branch' has unmerged changes"
282
+ echo " Use 'git branch -D $branch' to force delete (destructive!)"
283
+ echo " Skipping..."
284
+ fi
285
+ ```
286
+
287
+ ## Example Workflow
288
+
289
+ ```bash
290
+ # User: /cleanup
291
+
292
+ # Agent checks current state
293
+ $ git branch --show-current
294
+ dev/004-cleanup-command
295
+
296
+ # Agent finds merged branches
297
+ $ git branch --merged develop
298
+ dev/001-starter-kits
299
+ dev/002-installer-polish
300
+ dev/003-git-kit-enhancements
301
+
302
+ # Agent presents options
303
+ Merged branches available for cleanup:
304
+ 1. dev/001-starter-kits (2 days ago)
305
+ 2. dev/002-installer-polish (1 day ago)
306
+ 3. dev/003-git-kit-enhancements (2 hours ago)
307
+
308
+ Delete which branches? (y/n/e): e
309
+
310
+ # User selects
311
+ Selection: 1 2
312
+
313
+ # Agent deletes
314
+ $ git branch -d dev/001-starter-kits
315
+ Deleted branch dev/001-starter-kits (was 5b1ad35)
316
+
317
+ $ git branch -d dev/002-installer-polish
318
+ Deleted branch dev/002-installer-polish (was 9cd3690)
319
+
320
+ ✓ Cleanup complete: 2 branches deleted
321
+ ```
322
+
323
+ ## Multi-Agent Considerations
324
+
325
+ When working with multiple agents:
326
+
327
+ 1. **Check collaboration status** (if multiagent-kit installed):
328
+ ```bash
329
+ # Don't delete branches with active collaboration
330
+ if [ -d "specs/*/collaboration/active" ]; then
331
+ # Check for active sessions on branches
332
+ echo "⚠️ Multi-agent project detected"
333
+ echo " Checking for active collaboration..."
334
+ fi
335
+ ```
336
+
337
+ 2. **Warn about shared branches**:
338
+ ```
339
+ ⚠️ Branch 'feature/shared' may be used by other agents.
340
+
341
+ Check collaboration status before deleting.
342
+ Safe to delete? (y/n): _____
343
+ ```
344
+
345
+ 3. **Preserve handoff branches**:
346
+ - Branches with recent handoff documents shouldn't be auto-deleted
347
+ - Warn user if collaboration files exist
348
+
349
+ ## When NOT to Use
350
+
351
+ **Don't use /cleanup for**:
352
+ - Deleting unmerged branches (use `git branch -D` manually with caution)
353
+ - Deleting remote branches (use `git push origin --delete`)
354
+ - Deleting branches with uncommitted work (stash or commit first)
355
+ - Cleaning up worktrees (that's a multiagent-kit feature)
356
+
357
+ **Use /cleanup for**:
358
+ - ✅ Removing local branches after PR merge
359
+ - ✅ Cleaning up old feature branches
360
+ - ✅ Keeping workspace tidy
361
+ - ✅ Safe, confirmed deletions only