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