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,208 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # get-git-context.sh
5
+ # Gathers comprehensive git repository context for AI agents
6
+
7
+ show_help() {
8
+ cat << EOF
9
+ Usage: get-git-context.sh [OPTIONS]
10
+
11
+ Gathers git status, branch information, recent commits, and change statistics
12
+ in a structured format suitable for AI agent orientation and commit workflows.
13
+
14
+ OPTIONS:
15
+ -c, --commits NUM Number of recent commits to include (default: 5)
16
+ -f, --format FORMAT Output format: text, json (default: text)
17
+ -n, --no-diff Exclude diff statistics
18
+ -h, --help Show this help message
19
+
20
+ EXAMPLES:
21
+ get-git-context.sh
22
+ get-git-context.sh --commits 10
23
+ get-git-context.sh --format json
24
+ EOF
25
+ }
26
+
27
+ # Default options
28
+ INCLUDE_COMMITS=5
29
+ FORMAT="text"
30
+ INCLUDE_DIFF=true
31
+
32
+ # Parse arguments
33
+ while [[ $# -gt 0 ]]; do
34
+ case $1 in
35
+ -c|--commits)
36
+ INCLUDE_COMMITS="$2"
37
+ shift 2
38
+ ;;
39
+ -f|--format)
40
+ FORMAT="$2"
41
+ shift 2
42
+ ;;
43
+ -n|--no-diff)
44
+ INCLUDE_DIFF=false
45
+ shift
46
+ ;;
47
+ -h|--help)
48
+ show_help
49
+ exit 0
50
+ ;;
51
+ *)
52
+ echo "Unknown option: $1"
53
+ show_help
54
+ exit 1
55
+ ;;
56
+ esac
57
+ done
58
+
59
+ # Check if we're in a git repository
60
+ if ! git rev-parse --git-dir >/dev/null 2>&1; then
61
+ echo "Error: Not a git repository" >&2
62
+ exit 1
63
+ fi
64
+
65
+ # Gather git context
66
+ BRANCH=$(git branch --show-current)
67
+ COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "")
68
+
69
+ # Count file statuses
70
+ STAGED_COUNT=0
71
+ UNSTAGED_COUNT=0
72
+ UNTRACKED_COUNT=0
73
+
74
+ while IFS= read -r line; do
75
+ if [[ -n "$line" ]]; then
76
+ STATUS="${line:0:2}"
77
+
78
+ # Staged files (first character)
79
+ if [[ "${STATUS:0:1}" =~ [MADRC] ]]; then
80
+ ((STAGED_COUNT++))
81
+ fi
82
+
83
+ # Unstaged files (second character)
84
+ if [[ "${STATUS:1:1}" =~ [MD] ]]; then
85
+ ((UNSTAGED_COUNT++))
86
+ fi
87
+
88
+ # Untracked files
89
+ if [[ "$STATUS" == "??" ]]; then
90
+ ((UNTRACKED_COUNT++))
91
+ fi
92
+ fi
93
+ done < <(git status --porcelain)
94
+
95
+ # Get remote tracking info
96
+ TRACKING=$(git rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>/dev/null || echo "")
97
+ AHEAD=0
98
+ BEHIND=0
99
+
100
+ if [[ -n "$TRACKING" ]]; then
101
+ # Get ahead/behind counts
102
+ AHEAD_BEHIND=$(git rev-list --left-right --count "$TRACKING"..HEAD 2>/dev/null || echo "0 0")
103
+ AHEAD=$(echo "$AHEAD_BEHIND" | awk '{print $1}')
104
+ BEHIND=$(echo "$AHEAD_BEHIND" | awk '{print $2}')
105
+ fi
106
+
107
+ # Get remote URL
108
+ REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "")
109
+
110
+ # Get diff statistics
111
+ INSERTIONS=0
112
+ DELETIONS=0
113
+ FILES_CHANGED=0
114
+
115
+ if [[ "$INCLUDE_DIFF" == true ]] && [[ $STAGED_COUNT -gt 0 ]]; then
116
+ while IFS= read -r line; do
117
+ if [[ -n "$line" ]]; then
118
+ INS=$(echo "$line" | awk '{print $1}')
119
+ DEL=$(echo "$line" | awk '{print $2}')
120
+
121
+ # Handle binary files (-)
122
+ [[ "$INS" != "-" ]] && INSERTIONS=$((INSERTIONS + INS))
123
+ [[ "$DEL" != "-" ]] && DELETIONS=$((DELETIONS + DEL))
124
+ ((FILES_CHANGED++))
125
+ fi
126
+ done < <(git diff --cached --numstat)
127
+ fi
128
+
129
+ # Output based on format
130
+ if [[ "$FORMAT" == "json" ]]; then
131
+ # JSON output
132
+ cat << EOF
133
+ {
134
+ "branch": "$BRANCH",
135
+ "commitHash": "$COMMIT_HASH",
136
+ "status": {
137
+ "counts": {
138
+ "staged": $STAGED_COUNT,
139
+ "unstaged": $UNSTAGED_COUNT,
140
+ "untracked": $UNTRACKED_COUNT
141
+ }
142
+ },
143
+ "remote": {
144
+ "tracking": "$TRACKING",
145
+ "url": "$REMOTE_URL",
146
+ "ahead": $AHEAD,
147
+ "behind": $BEHIND
148
+ },
149
+ "stats": {
150
+ "filesChanged": $FILES_CHANGED,
151
+ "insertions": $INSERTIONS,
152
+ "deletions": $DELETIONS
153
+ }
154
+ }
155
+ EOF
156
+ else
157
+ # Text output
158
+ echo "==============================================================="
159
+ echo "📊 Git Status (on: $BRANCH):"
160
+ echo "==============================================================="
161
+ echo "Staged: $STAGED_COUNT files"
162
+ echo "Unstaged: $UNSTAGED_COUNT files"
163
+ echo "Untracked: $UNTRACKED_COUNT files"
164
+
165
+ if [[ -n "$TRACKING" ]]; then
166
+ echo ""
167
+ echo "Remote: $TRACKING"
168
+ if [[ $AHEAD -gt 0 ]]; then
169
+ echo " Ahead by $AHEAD commit(s)"
170
+ fi
171
+ if [[ $BEHIND -gt 0 ]]; then
172
+ echo " Behind by $BEHIND commit(s)"
173
+ fi
174
+ fi
175
+
176
+ if [[ $STAGED_COUNT -gt 0 ]]; then
177
+ echo ""
178
+ echo "Staged files:"
179
+ git status --porcelain | grep '^[MADRC]' | while IFS= read -r line; do
180
+ echo " ${line:0:2} ${line:3}"
181
+ done
182
+ fi
183
+
184
+ if [[ $UNSTAGED_COUNT -gt 0 ]]; then
185
+ echo ""
186
+ echo "Unstaged files:"
187
+ git status --porcelain | grep '^ [MD]' | while IFS= read -r line; do
188
+ echo " ${line:0:2} ${line:3}"
189
+ done
190
+ fi
191
+
192
+ if [[ $UNTRACKED_COUNT -gt 0 ]]; then
193
+ echo ""
194
+ echo "Untracked files:"
195
+ git status --porcelain | grep '^??' | while IFS= read -r line; do
196
+ echo " ${line:0:2} ${line:3}"
197
+ done
198
+ fi
199
+
200
+ if [[ $INCLUDE_COMMITS -gt 0 ]]; then
201
+ echo ""
202
+ echo "Recent commits:"
203
+ git log -n "$INCLUDE_COMMITS" --pretty=format:' %h %s (%ar)' --abbrev-commit
204
+ echo ""
205
+ fi
206
+
207
+ echo "==============================================================="
208
+ fi
@@ -0,0 +1,242 @@
1
+ #Requires -Version 5.1
2
+
3
+ <#
4
+ .SYNOPSIS
5
+ Gathers comprehensive git repository context for AI agents.
6
+
7
+ .DESCRIPTION
8
+ Collects git status, branch information, recent commits, and change statistics
9
+ in a structured format suitable for AI agent orientation and commit workflows.
10
+
11
+ .PARAMETER IncludeCommits
12
+ Number of recent commits to include (default: 5)
13
+
14
+ .PARAMETER IncludeDiff
15
+ Include file diff statistics (default: true)
16
+
17
+ .PARAMETER Format
18
+ Output format: Object, Json, or Text (default: Object)
19
+
20
+ .EXAMPLE
21
+ Get-GitContext
22
+ Returns git context as PowerShell object
23
+
24
+ .EXAMPLE
25
+ Get-GitContext -Format Text | Write-Host
26
+ Displays formatted text output
27
+
28
+ .EXAMPLE
29
+ Get-GitContext -IncludeCommits 10 -Format Json
30
+ Returns last 10 commits as JSON
31
+ #>
32
+
33
+ [CmdletBinding()]
34
+ param(
35
+ [Parameter()]
36
+ [int]$IncludeCommits = 5,
37
+
38
+ [Parameter()]
39
+ [switch]$IncludeDiff,
40
+
41
+ [Parameter()]
42
+ [ValidateSet('Object', 'Json', 'Text')]
43
+ [string]$Format = 'Object'
44
+ )
45
+
46
+ # Check if we're in a git repository
47
+ if (-not (git rev-parse --git-dir 2>$null)) {
48
+ Write-Error "Not a git repository"
49
+ return
50
+ }
51
+
52
+ # Gather git context
53
+ $context = [PSCustomObject]@{
54
+ Branch = $null
55
+ CommitHash = $null
56
+ Status = @{
57
+ Staged = @()
58
+ Unstaged = @()
59
+ Untracked = @()
60
+ Counts = @{
61
+ Staged = 0
62
+ Unstaged = 0
63
+ Untracked = 0
64
+ }
65
+ }
66
+ RecentCommits = @()
67
+ Remote = @{
68
+ Url = $null
69
+ Ahead = 0
70
+ Behind = 0
71
+ Tracking = $null
72
+ }
73
+ Stats = @{
74
+ TotalFiles = 0
75
+ Insertions = 0
76
+ Deletions = 0
77
+ }
78
+ }
79
+
80
+ # Get current branch
81
+ $context.Branch = git branch --show-current
82
+
83
+ # Get current commit hash
84
+ $context.CommitHash = git rev-parse --short HEAD 2>$null
85
+
86
+ # Get git status
87
+ $statusLines = git status --porcelain
88
+
89
+ foreach ($line in $statusLines) {
90
+ if ($line) {
91
+ $statusCode = $line.Substring(0, 2)
92
+ $filePath = $line.Substring(3)
93
+
94
+ # Staged files (first character)
95
+ if ($statusCode[0] -match '[MADRC]') {
96
+ $context.Status.Staged += [PSCustomObject]@{
97
+ Status = $statusCode[0]
98
+ Path = $filePath
99
+ }
100
+ $context.Status.Counts.Staged++
101
+ }
102
+
103
+ # Unstaged files (second character)
104
+ if ($statusCode[1] -match '[MD]') {
105
+ $context.Status.Unstaged += [PSCustomObject]@{
106
+ Status = $statusCode[1]
107
+ Path = $filePath
108
+ }
109
+ $context.Status.Counts.Unstaged++
110
+ }
111
+
112
+ # Untracked files
113
+ if ($statusCode -eq '??') {
114
+ $context.Status.Untracked += [PSCustomObject]@{
115
+ Path = $filePath
116
+ }
117
+ $context.Status.Counts.Untracked++
118
+ }
119
+ }
120
+ }
121
+
122
+ # Get remote tracking info
123
+ $tracking = git rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>$null
124
+ if ($tracking) {
125
+ $context.Remote.Tracking = $tracking
126
+
127
+ # Get ahead/behind counts
128
+ $aheadBehind = git rev-list --left-right --count HEAD...$tracking 2>$null
129
+ if ($aheadBehind) {
130
+ $parts = $aheadBehind -split '\s+'
131
+ $context.Remote.Ahead = [int]$parts[0]
132
+ $context.Remote.Behind = [int]$parts[1]
133
+ }
134
+ }
135
+
136
+ # Get remote URL
137
+ $remoteUrl = git remote get-url origin 2>$null
138
+ if ($remoteUrl) {
139
+ $context.Remote.Url = $remoteUrl
140
+ }
141
+
142
+ # Get recent commits
143
+ if ($IncludeCommits -gt 0) {
144
+ $commitFormat = '%H%x00%h%x00%an%x00%ae%x00%ad%x00%s'
145
+ $commitLines = git log -n $IncludeCommits --pretty=format:$commitFormat --date=relative
146
+
147
+ foreach ($line in $commitLines) {
148
+ if ($line) {
149
+ $parts = $line -split "`0", 6
150
+ $context.RecentCommits += [PSCustomObject]@{
151
+ Hash = $parts[0]
152
+ ShortHash = $parts[1]
153
+ Author = $parts[2]
154
+ Email = $parts[3]
155
+ Date = $parts[4]
156
+ Subject = $parts[5]
157
+ }
158
+ }
159
+ }
160
+ }
161
+
162
+ # Get diff statistics
163
+ if ($IncludeDiff -and $context.Status.Counts.Staged -gt 0) {
164
+ $diffStat = git diff --cached --numstat
165
+
166
+ foreach ($line in $diffStat) {
167
+ if ($line) {
168
+ $parts = $line -split '\s+', 3
169
+ $insertions = if ($parts[0] -eq '-') { 0 } else { [int]$parts[0] }
170
+ $deletions = if ($parts[1] -eq '-') { 0 } else { [int]$parts[1] }
171
+
172
+ $context.Stats.Insertions += $insertions
173
+ $context.Stats.Deletions += $deletions
174
+ $context.Stats.TotalFiles++
175
+ }
176
+ }
177
+ }
178
+
179
+ # Output based on format
180
+ switch ($Format) {
181
+ 'Json' {
182
+ $context | ConvertTo-Json -Depth 10
183
+ }
184
+ 'Text' {
185
+ # Formatted text output
186
+ Write-Output "==============================================================="
187
+ Write-Output "📊 Git Status (on: $($context.Branch)):"
188
+ Write-Output "==============================================================="
189
+ Write-Output "Staged: $($context.Status.Counts.Staged) files"
190
+ Write-Output "Unstaged: $($context.Status.Counts.Unstaged) files"
191
+ Write-Output "Untracked: $($context.Status.Counts.Untracked) files"
192
+
193
+ if ($context.Remote.Tracking) {
194
+ Write-Output ""
195
+ Write-Output "Remote: $($context.Remote.Tracking)"
196
+ if ($context.Remote.Ahead -gt 0) {
197
+ Write-Output " Ahead by $($context.Remote.Ahead) commit(s)"
198
+ }
199
+ if ($context.Remote.Behind -gt 0) {
200
+ Write-Output " Behind by $($context.Remote.Behind) commit(s)"
201
+ }
202
+ }
203
+
204
+ if ($context.Status.Staged.Count -gt 0) {
205
+ Write-Output ""
206
+ Write-Output "Staged files:"
207
+ foreach ($file in $context.Status.Staged) {
208
+ Write-Output " $($file.Status) $($file.Path)"
209
+ }
210
+ }
211
+
212
+ if ($context.Status.Unstaged.Count -gt 0) {
213
+ Write-Output ""
214
+ Write-Output "Unstaged files:"
215
+ foreach ($file in $context.Status.Unstaged) {
216
+ Write-Output " $($file.Status) $($file.Path)"
217
+ }
218
+ }
219
+
220
+ if ($context.Status.Untracked.Count -gt 0) {
221
+ Write-Output ""
222
+ Write-Output "Untracked files:"
223
+ foreach ($file in $context.Status.Untracked) {
224
+ Write-Output " ?? $($file.Path)"
225
+ }
226
+ }
227
+
228
+ if ($context.RecentCommits.Count -gt 0) {
229
+ Write-Output ""
230
+ Write-Output "Recent commits:"
231
+ foreach ($commit in $context.RecentCommits) {
232
+ Write-Output " $($commit.ShortHash) $($commit.Subject) ($($commit.Date))"
233
+ }
234
+ }
235
+
236
+ Write-Output "==============================================================="
237
+ }
238
+ default {
239
+ # Return PowerShell object
240
+ $context
241
+ }
242
+ }