lite-kits 0.1.0__py3-none-any.whl → 0.1.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.
- lite_kits/__init__.py +9 -9
- lite_kits/cli.py +170 -155
- lite_kits/core/__init__.py +13 -0
- lite_kits/core/banner.py +160 -0
- lite_kits/{installer.py → core/installer.py} +47 -27
- lite_kits/core/manifest.py +146 -0
- lite_kits/kits/README.md +9 -10
- lite_kits/kits/dev/README.md +241 -0
- lite_kits/kits/dev/claude/commands/audit.md +143 -0
- lite_kits/kits/dev/claude/commands/cleanup.md +361 -0
- lite_kits/kits/dev/claude/commands/commit.md +612 -0
- lite_kits/kits/dev/claude/commands/orient.md +146 -0
- lite_kits/kits/dev/claude/commands/pr.md +593 -0
- lite_kits/kits/dev/claude/commands/review.md +202 -0
- lite_kits/kits/dev/claude/commands/stats.md +162 -0
- lite_kits/kits/dev/github/prompts/audit.prompt.md +143 -0
- lite_kits/kits/dev/github/prompts/cleanup.prompt.md +382 -0
- lite_kits/kits/dev/github/prompts/commit.prompt.md +591 -0
- lite_kits/kits/dev/github/prompts/orient.prompt.md +150 -0
- lite_kits/kits/dev/github/prompts/pr.prompt.md +603 -0
- lite_kits/kits/dev/github/prompts/review.prompt.md +202 -0
- lite_kits/kits/dev/github/prompts/stats.prompt.md +163 -0
- lite_kits/kits/git/README.md +59 -68
- lite_kits/kits/git/claude/commands/review.md +202 -0
- lite_kits/kits/git/github/prompts/review.prompt.md +202 -0
- lite_kits/kits/kits.yaml +180 -0
- lite_kits/kits/multiagent/README.md +26 -15
- lite_kits/kits/multiagent/memory/pr-workflow-guide.md +1 -7
- lite_kits/kits/project/README.md +6 -22
- lite_kits/kits/project/claude/commands/audit.md +143 -0
- lite_kits/kits/project/claude/commands/orient.md +29 -46
- lite_kits/kits/project/claude/commands/review.md +112 -0
- lite_kits/kits/project/claude/commands/stats.md +162 -0
- lite_kits/kits/project/github/prompts/audit.prompt.md +143 -0
- lite_kits/kits/project/github/prompts/orient.prompt.md +33 -46
- lite_kits/kits/project/github/prompts/review.prompt.md +112 -0
- lite_kits/kits/project/github/prompts/stats.prompt.md +163 -0
- {lite_kits-0.1.0.dist-info → lite_kits-0.1.1.dist-info}/METADATA +98 -66
- lite_kits-0.1.1.dist-info/RECORD +58 -0
- lite_kits-0.1.0.dist-info/RECORD +0 -31
- {lite_kits-0.1.0.dist-info → lite_kits-0.1.1.dist-info}/WHEEL +0 -0
- {lite_kits-0.1.0.dist-info → lite_kits-0.1.1.dist-info}/entry_points.txt +0 -0
- {lite_kits-0.1.0.dist-info → lite_kits-0.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,143 @@
|
|
1
|
+
---
|
2
|
+
description: Perform security analysis on dependencies and code patterns
|
3
|
+
---
|
4
|
+
|
5
|
+
# Security Audit Helper
|
6
|
+
|
7
|
+
**Purpose**: Quick security analysis for AI agents working on features involving authentication, data handling, or external dependencies.
|
8
|
+
|
9
|
+
## Execution Steps
|
10
|
+
|
11
|
+
Execute the following steps to perform a security audit:
|
12
|
+
|
13
|
+
### 1. Detect Project Type and Dependencies
|
14
|
+
|
15
|
+
```powershell
|
16
|
+
# Check for Python dependencies
|
17
|
+
Get-ChildItem -Path . -Include requirements.txt,pyproject.toml,setup.py -Recurse -ErrorAction SilentlyContinue
|
18
|
+
|
19
|
+
# Check for Node.js dependencies
|
20
|
+
Get-ChildItem -Path . -Include package.json,package-lock.json -Recurse -ErrorAction SilentlyContinue
|
21
|
+
|
22
|
+
# Check for Rust dependencies
|
23
|
+
Get-ChildItem -Path . -Include Cargo.toml,Cargo.lock -Recurse -ErrorAction SilentlyContinue
|
24
|
+
|
25
|
+
# Check for Go dependencies
|
26
|
+
Get-ChildItem -Path . -Include go.mod,go.sum -Recurse -ErrorAction SilentlyContinue
|
27
|
+
```
|
28
|
+
|
29
|
+
### 2. Run Dependency Vulnerability Scan
|
30
|
+
|
31
|
+
**Python projects**:
|
32
|
+
```powershell
|
33
|
+
# Check if pip-audit is available
|
34
|
+
Get-Command pip-audit -ErrorAction SilentlyContinue
|
35
|
+
|
36
|
+
# If available, run scan
|
37
|
+
pip-audit
|
38
|
+
|
39
|
+
# If not available, suggest installation
|
40
|
+
Write-Host "Install pip-audit: pip install pip-audit"
|
41
|
+
```
|
42
|
+
|
43
|
+
**Node.js projects**:
|
44
|
+
```powershell
|
45
|
+
# npm audit is built-in
|
46
|
+
npm audit
|
47
|
+
|
48
|
+
# Or use yarn
|
49
|
+
yarn audit
|
50
|
+
```
|
51
|
+
|
52
|
+
**Other languages**: Suggest appropriate tools (cargo audit, go list, etc.)
|
53
|
+
|
54
|
+
### 3. Scan for Common Security Anti-Patterns
|
55
|
+
|
56
|
+
Check source code for security issues:
|
57
|
+
|
58
|
+
```powershell
|
59
|
+
# Look for potential hardcoded secrets
|
60
|
+
Select-String -Path src\* -Pattern "API_KEY\s*=\s*['""]" -Recurse | Select-Object -First 5
|
61
|
+
Select-String -Path src\* -Pattern "PASSWORD\s*=\s*['""]" -Recurse | Select-Object -First 5
|
62
|
+
Select-String -Path src\* -Pattern "SECRET\s*=\s*['""]" -Recurse | Select-Object -First 5
|
63
|
+
|
64
|
+
# Look for weak crypto patterns (Python)
|
65
|
+
Select-String -Path src\* -Pattern "md5|sha1" -Recurse | Select-Object -First 5
|
66
|
+
|
67
|
+
# Look for SQL injection risks
|
68
|
+
Select-String -Path src\* -Pattern "execute.*%|execute.*\+" -Recurse | Select-Object -First 5
|
69
|
+
```
|
70
|
+
|
71
|
+
**Common patterns to flag**:
|
72
|
+
- Hardcoded API keys, passwords, tokens
|
73
|
+
- Weak cryptographic algorithms (MD5, SHA1)
|
74
|
+
- SQL string concatenation
|
75
|
+
- Eval/exec with user input
|
76
|
+
- Insecure file permissions
|
77
|
+
|
78
|
+
### 4. Generate Concise Report
|
79
|
+
|
80
|
+
Provide analysis in this format (~150 words max):
|
81
|
+
|
82
|
+
```markdown
|
83
|
+
## Security Audit
|
84
|
+
|
85
|
+
**Dependencies**: N scanned, M vulnerabilities found
|
86
|
+
|
87
|
+
**Vulnerabilities** (if any):
|
88
|
+
- package-name==version: [SEVERITY] - Brief description
|
89
|
+
- Link to advisory for details
|
90
|
+
|
91
|
+
**Code Patterns** (if any):
|
92
|
+
- file.py:line: [PATTERN] - Recommendation
|
93
|
+
|
94
|
+
**Next Action**: [Fix CVE-XXXX / Update package / Review auth code]
|
95
|
+
```
|
96
|
+
|
97
|
+
## Important Notes
|
98
|
+
|
99
|
+
- **Graceful fallbacks**: If audit tools not installed, do basic pattern checks only
|
100
|
+
- **Be concise**: Target <150 words total output
|
101
|
+
- **Prioritize**: Show highest severity issues first
|
102
|
+
- **Avoid false positives**: Note that manual review may be needed
|
103
|
+
- **No dependencies**: Report "No dependencies to audit" gracefully
|
104
|
+
- **Cross-platform**: Use commands available on Windows, macOS, Linux
|
105
|
+
|
106
|
+
## Edge Cases
|
107
|
+
|
108
|
+
- **No dependency files**: "No dependencies found. This appears to be a dependency-free project."
|
109
|
+
- **Tool not installed**: Provide installation command, run basic grep checks
|
110
|
+
- **No vulnerabilities**: "✅ No known vulnerabilities found! Consider reviewing auth/data handling patterns."
|
111
|
+
- **Too many issues**: Sample top 5, note total count
|
112
|
+
|
113
|
+
## Example Output
|
114
|
+
|
115
|
+
```markdown
|
116
|
+
## Security Audit
|
117
|
+
|
118
|
+
**Dependencies**: 12 scanned, 2 vulnerabilities found
|
119
|
+
|
120
|
+
**Vulnerabilities**:
|
121
|
+
- requests==2.25.0: MEDIUM - CVE-2023-32681 (Proxy-Auth header leak)
|
122
|
+
Update to: requests>=2.31.0
|
123
|
+
|
124
|
+
**Code Patterns**:
|
125
|
+
- src/auth.py:42: Hardcoded API key detected
|
126
|
+
- src/db.py:103: SQL string concatenation (injection risk)
|
127
|
+
|
128
|
+
**Next Action**: Update requests package, move API key to environment variables, use parameterized queries
|
129
|
+
```
|
130
|
+
|
131
|
+
```markdown
|
132
|
+
## Security Audit
|
133
|
+
|
134
|
+
**Dependencies**: pip-audit not installed
|
135
|
+
|
136
|
+
**Tool Not Available**:
|
137
|
+
Install pip-audit for vulnerability scanning:
|
138
|
+
`pip install pip-audit`
|
139
|
+
|
140
|
+
**Code Patterns**: Basic grep checks performed, no obvious issues found
|
141
|
+
|
142
|
+
**Next Action**: Install pip-audit and re-run for comprehensive dependency scan
|
143
|
+
```
|
@@ -15,19 +15,12 @@ Execute the following steps to gather orientation information:
|
|
15
15
|
Check for kit marker files to determine what's installed:
|
16
16
|
|
17
17
|
```powershell
|
18
|
-
#
|
19
|
-
$
|
20
|
-
$
|
21
|
-
$
|
22
|
-
|
23
|
-
|
24
|
-
if (Test-Path .github/prompts/review.prompt.md) { $PROJECT_KIT = $true }
|
25
|
-
|
26
|
-
# Check for git-kit markers
|
27
|
-
if (Test-Path .github/prompts/commit.prompt.md) { $GIT_KIT = $true }
|
28
|
-
|
29
|
-
# Check for multiagent-kit markers
|
30
|
-
if (Test-Path .specify/memory/pr-workflow-guide.md) { $MULTIAGENT_KIT = $true }
|
18
|
+
# Check all kits in one efficient operation
|
19
|
+
$KITS_INSTALLED = @()
|
20
|
+
if (Test-Path .github/prompts/orient.prompt.md) { $KITS_INSTALLED += "project" }
|
21
|
+
if (Test-Path .github/prompts/commit.prompt.md) { $KITS_INSTALLED += "git" }
|
22
|
+
if (Test-Path .specify/memory/pr-workflow-guide.md) { $KITS_INSTALLED += "multiagent" }
|
23
|
+
$KITS_LIST = if ($KITS_INSTALLED.Count -gt 0) { $KITS_INSTALLED -join ", " } else { "vanilla only" }
|
31
24
|
```
|
32
25
|
|
33
26
|
### 2. Determine Agent Role
|
@@ -58,17 +51,12 @@ Extract:
|
|
58
51
|
### 4. Check Git State
|
59
52
|
|
60
53
|
```powershell
|
61
|
-
#
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
git log --oneline -
|
66
|
-
|
67
|
-
# Uncommitted changes
|
68
|
-
git status --short
|
69
|
-
|
70
|
-
# Untracked files count
|
71
|
-
(git ls-files --others --exclude-standard).Count
|
54
|
+
# Efficient single-command git status check
|
55
|
+
# Get branch, recent commits, and changes in one go
|
56
|
+
$CURRENT_BRANCH = git branch --show-current 2>$null
|
57
|
+
if (-not $CURRENT_BRANCH) { $CURRENT_BRANCH = "not in git repo" }
|
58
|
+
$RECENT_COMMITS = (git log --oneline -3 2>$null | Select-Object -First 1)
|
59
|
+
$CHANGES = (git status --short 2>$null | Measure-Object).Count
|
72
60
|
```
|
73
61
|
|
74
62
|
### 5. Check Active Work
|
@@ -76,29 +64,28 @@ git status --short
|
|
76
64
|
Look for active feature work:
|
77
65
|
|
78
66
|
```powershell
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
$
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
67
|
+
# Check if current branch matches a spec directory
|
68
|
+
if ($CURRENT_BRANCH -match '^\d+' -or $CURRENT_BRANCH -match '^dev/\d+') {
|
69
|
+
# Extract spec number from branch name
|
70
|
+
$SPEC_NUM = if ($CURRENT_BRANCH -match '\d+') { $Matches[0] } else { $null }
|
71
|
+
if ($SPEC_NUM) {
|
72
|
+
$SPEC_DIR = Get-ChildItem -Path "specs/$SPEC_NUM-*" -Directory -ErrorAction SilentlyContinue | Select-Object -First 1
|
73
|
+
if ($SPEC_DIR) {
|
74
|
+
$SPEC_FILES = @("spec.md", "plan.md", "tasks.md") | Where-Object { Test-Path "$($SPEC_DIR.FullName)/$_" }
|
75
|
+
}
|
76
|
+
}
|
89
77
|
}
|
90
78
|
```
|
91
79
|
|
92
80
|
### 6. Check Multi-Agent Coordination (if multiagent-kit installed)
|
93
81
|
|
94
|
-
If `$MULTIAGENT_KIT -eq $true`:
|
95
|
-
|
96
82
|
```powershell
|
97
|
-
#
|
98
|
-
(
|
99
|
-
|
100
|
-
|
101
|
-
Get-ChildItem -Path specs/*/collaboration/active/decisions/ -Filter handoff-*.md -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
|
83
|
+
# Only check if multiagent kit is installed
|
84
|
+
if ($KITS_INSTALLED -contains "multiagent") {
|
85
|
+
# Efficient check for collaboration activity
|
86
|
+
$ACTIVE_SESSIONS = (Get-ChildItem -Path specs/*/collaboration/active/sessions/ -Filter *.md -Recurse -ErrorAction SilentlyContinue).Count
|
87
|
+
$PENDING_HANDOFF = Get-ChildItem -Path specs/*/collaboration/active/decisions/ -Filter handoff-*.md -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
|
88
|
+
}
|
102
89
|
```
|
103
90
|
|
104
91
|
### 7. Generate Concise Output
|
@@ -108,15 +95,15 @@ Provide a **concise summary** (~150 words max) in this format:
|
|
108
95
|
```
|
109
96
|
## Orientation Complete
|
110
97
|
|
111
|
-
**Installed Kits**: [
|
98
|
+
**Installed Kits**: [$KITS_LIST]
|
112
99
|
|
113
100
|
**I am**: [$AGENT_ROLE from step 2]
|
114
101
|
**Project**: [project name from docs]
|
115
102
|
**Stack**: [main technologies]
|
116
|
-
**Branch**: [
|
117
|
-
**Recent work**: [
|
118
|
-
**Uncommitted changes**: [count
|
119
|
-
**Active feature**: [current spec if
|
103
|
+
**Branch**: [$CURRENT_BRANCH]
|
104
|
+
**Recent work**: [$RECENT_COMMITS - just the message]
|
105
|
+
**Uncommitted changes**: [$CHANGES count]
|
106
|
+
**Active feature**: [current spec if $SPEC_FILES exists]
|
120
107
|
**Coordination**: [solo work / handoff pending / etc]
|
121
108
|
|
122
109
|
**Next suggested action**: [based on state analysis below]
|
@@ -0,0 +1,112 @@
|
|
1
|
+
---
|
2
|
+
description: Analyze code quality for uncommitted changes or recent commits
|
3
|
+
---
|
4
|
+
|
5
|
+
# Code Review Helper
|
6
|
+
|
7
|
+
**Purpose**: Provide quick code quality analysis and actionable suggestions for AI agents before committing.
|
8
|
+
|
9
|
+
## Execution Steps
|
10
|
+
|
11
|
+
Execute the following steps to analyze code changes:
|
12
|
+
|
13
|
+
### 1. Check for Uncommitted Changes
|
14
|
+
|
15
|
+
```powershell
|
16
|
+
# Get status of modified and staged files
|
17
|
+
git status --short
|
18
|
+
```
|
19
|
+
|
20
|
+
**Analyze the output**:
|
21
|
+
- Lines starting with `M ` or `A ` = Staged files
|
22
|
+
- Lines starting with ` M` = Modified but not staged
|
23
|
+
- Lines starting with `??` = Untracked files
|
24
|
+
- Lines starting with `MM` = Staged and modified again
|
25
|
+
|
26
|
+
### 2. Analyze Changes
|
27
|
+
|
28
|
+
If changes exist:
|
29
|
+
```powershell
|
30
|
+
# Show unstaged changes
|
31
|
+
git diff
|
32
|
+
|
33
|
+
# Show staged changes
|
34
|
+
git diff --cached
|
35
|
+
```
|
36
|
+
|
37
|
+
**Review each file**:
|
38
|
+
- Check for code quality issues
|
39
|
+
- Look for potential bugs or edge cases
|
40
|
+
- Verify naming conventions
|
41
|
+
- Check for TODO/FIXME comments
|
42
|
+
|
43
|
+
If no changes:
|
44
|
+
```powershell
|
45
|
+
# Suggest reviewing recent commit
|
46
|
+
git log -1 --stat
|
47
|
+
```
|
48
|
+
|
49
|
+
### 3. Check for Linting Configuration
|
50
|
+
|
51
|
+
```powershell
|
52
|
+
# Look for common linting config files
|
53
|
+
Get-ChildItem -Path . -Include .ruff.toml,.pylintrc,pyproject.toml,.eslintrc* -Recurse -ErrorAction SilentlyContinue
|
54
|
+
```
|
55
|
+
|
56
|
+
**If linting configs found**:
|
57
|
+
- Python: Suggest `ruff check .` or `pylint <files>`
|
58
|
+
- JavaScript: Suggest `eslint <files>`
|
59
|
+
- TypeScript: Suggest `tsc --noEmit`
|
60
|
+
|
61
|
+
### 4. Generate Concise Output
|
62
|
+
|
63
|
+
Provide analysis in this format (~150 words max):
|
64
|
+
|
65
|
+
```markdown
|
66
|
+
## Code Review
|
67
|
+
|
68
|
+
**Changes**: N files modified (M staged, K unstaged)
|
69
|
+
|
70
|
+
- **file1.py**: Brief assessment of changes
|
71
|
+
- **file2.ts**: Brief assessment of changes
|
72
|
+
- **file3.md**: Brief assessment of changes
|
73
|
+
|
74
|
+
**Suggestions**:
|
75
|
+
- Actionable suggestion 1
|
76
|
+
- Actionable suggestion 2
|
77
|
+
- Actionable suggestion 3
|
78
|
+
|
79
|
+
**Next Action**: [Run linter / Commit changes / Review specific pattern]
|
80
|
+
```
|
81
|
+
|
82
|
+
## Important Notes
|
83
|
+
|
84
|
+
- **Be concise**: Target <150 words total output
|
85
|
+
- **Be actionable**: Every suggestion should be specific and doable
|
86
|
+
- **Handle edge cases gracefully**:
|
87
|
+
- No changes → Suggest reviewing recent commits or starting new work
|
88
|
+
- Too many files (>20) → Sample most recently modified, note total count
|
89
|
+
- Binary files → Skip analysis, just report count
|
90
|
+
- Linter not installed → Suggest installation but don't error
|
91
|
+
|
92
|
+
- **Cross-platform**: Use git commands (available everywhere)
|
93
|
+
- **Focus on quick wins**: Highlight obvious improvements, not deep analysis
|
94
|
+
|
95
|
+
## Example Output
|
96
|
+
|
97
|
+
```markdown
|
98
|
+
## Code Review
|
99
|
+
|
100
|
+
**Changes**: 3 files modified (2 staged, 1 unstaged)
|
101
|
+
|
102
|
+
- **src/commands/review.md**: New command template, follows /orient pattern well
|
103
|
+
- **src/prompts/review.prompt.md**: Copilot version, mirrors Claude structure
|
104
|
+
- **README.md**: Added /review to command list (unstaged)
|
105
|
+
|
106
|
+
**Suggestions**:
|
107
|
+
- Add example output section to both templates
|
108
|
+
- Stage README.md with the template changes
|
109
|
+
- Consider running spell check on documentation
|
110
|
+
|
111
|
+
**Next Action**: Add examples, stage all files, then run /commit
|
112
|
+
```
|
@@ -0,0 +1,163 @@
|
|
1
|
+
---
|
2
|
+
description: Generate concise project metrics for AI agent orientation
|
3
|
+
---
|
4
|
+
|
5
|
+
# Project Statistics
|
6
|
+
|
7
|
+
**Purpose**: Provide quick project overview metrics for AI agents joining a project or assessing scope.
|
8
|
+
|
9
|
+
## Execution Steps
|
10
|
+
|
11
|
+
Execute the following steps to gather project statistics:
|
12
|
+
|
13
|
+
### 1. Count Lines of Code
|
14
|
+
|
15
|
+
**Preferred method** (if tokei installed):
|
16
|
+
```powershell
|
17
|
+
# Check if tokei is available
|
18
|
+
Get-Command tokei -ErrorAction SilentlyContinue
|
19
|
+
|
20
|
+
# If available, use tokei for fast, accurate counts
|
21
|
+
tokei --output json
|
22
|
+
```
|
23
|
+
|
24
|
+
**Fallback method** (if tokei not available):
|
25
|
+
```powershell
|
26
|
+
# Python
|
27
|
+
(Get-ChildItem -Recurse -Filter *.py | Get-Content | Measure-Object -Line).Lines
|
28
|
+
|
29
|
+
# JavaScript/TypeScript
|
30
|
+
(Get-ChildItem -Recurse -Include *.js,*.ts | Get-Content | Measure-Object -Line).Lines
|
31
|
+
|
32
|
+
# Markdown
|
33
|
+
(Get-ChildItem -Recurse -Filter *.md | Get-Content | Measure-Object -Line).Lines
|
34
|
+
|
35
|
+
# All files combined
|
36
|
+
(Get-ChildItem -Recurse -File | Get-Content | Measure-Object -Line).Lines
|
37
|
+
```
|
38
|
+
|
39
|
+
### 2. Count Files and Directories
|
40
|
+
|
41
|
+
```powershell
|
42
|
+
# Count files (excluding hidden)
|
43
|
+
(Get-ChildItem -Recurse -File | Where-Object { -not $_.FullName.Contains('\.') }).Count
|
44
|
+
|
45
|
+
# Count directories (excluding hidden)
|
46
|
+
(Get-ChildItem -Recurse -Directory | Where-Object { -not $_.FullName.Contains('\.') }).Count
|
47
|
+
```
|
48
|
+
|
49
|
+
### 3. Get Git History Summary
|
50
|
+
|
51
|
+
```powershell
|
52
|
+
# Total commits
|
53
|
+
(git log --oneline | Measure-Object).Count
|
54
|
+
|
55
|
+
# Contributor count
|
56
|
+
(git log --format='%aN' | Sort-Object -Unique).Count
|
57
|
+
|
58
|
+
# Recent activity
|
59
|
+
git log --oneline -5
|
60
|
+
```
|
61
|
+
|
62
|
+
If not a git repository, skip this section.
|
63
|
+
|
64
|
+
### 4. Check for Test Coverage
|
65
|
+
|
66
|
+
Look for common coverage report files:
|
67
|
+
```powershell
|
68
|
+
# Python coverage files
|
69
|
+
Get-ChildItem -Path . -Include .coverage,coverage.xml -Recurse -ErrorAction SilentlyContinue
|
70
|
+
Get-ChildItem -Path htmlcov -Directory -ErrorAction SilentlyContinue
|
71
|
+
|
72
|
+
# JavaScript coverage
|
73
|
+
Get-ChildItem -Path coverage,.nyc_output -Directory -ErrorAction SilentlyContinue
|
74
|
+
|
75
|
+
# If coverage files exist, try to extract percentage
|
76
|
+
# Python: coverage report | Select-String TOTAL
|
77
|
+
# JavaScript: Get-Content coverage/coverage-summary.json | ConvertFrom-Json
|
78
|
+
```
|
79
|
+
|
80
|
+
### 5. Generate Concise Table Output
|
81
|
+
|
82
|
+
Provide stats in this format (~20 lines max):
|
83
|
+
|
84
|
+
```markdown
|
85
|
+
## Project Statistics
|
86
|
+
|
87
|
+
**Code**:
|
88
|
+
- Language1: X,XXX LOC (NN%)
|
89
|
+
- Language2: XXX LOC (NN%)
|
90
|
+
- Language3: XX LOC (NN%)
|
91
|
+
|
92
|
+
**Structure**:
|
93
|
+
- NN files, NN directories
|
94
|
+
- NNN commits, N contributors
|
95
|
+
|
96
|
+
**Testing**:
|
97
|
+
- Coverage: NN% (or N/A)
|
98
|
+
- Tests: NN files (or N/A)
|
99
|
+
|
100
|
+
**Next Action**: [Explore src/ / Review tests / Check docs]
|
101
|
+
```
|
102
|
+
|
103
|
+
## Important Notes
|
104
|
+
|
105
|
+
- **Be concise**: Keep output under 20 lines
|
106
|
+
- **Use tables**: Well-formatted markdown tables or lists
|
107
|
+
- **Handle missing tools**:
|
108
|
+
- No tokei → Use Get-ChildItem/Measure-Object fallback, note "Basic LOC count"
|
109
|
+
- Not a git repo → Skip git section, note "No git history"
|
110
|
+
- No coverage → Show "N/A" gracefully
|
111
|
+
|
112
|
+
- **Percentages**: Calculate language percentages from total LOC
|
113
|
+
- **Large repos**: If >100k LOC, note "Large project" and consider sampling
|
114
|
+
- **Speed**: Target <5 second execution time
|
115
|
+
|
116
|
+
## Edge Cases
|
117
|
+
|
118
|
+
- **No git repository**: Skip git section, show file/LOC stats only
|
119
|
+
- **No test coverage reports**: Show "Coverage: N/A"
|
120
|
+
- **Tokei not installed**: Use PowerShell fallback, note in output
|
121
|
+
- **Very large repo (1M+ LOC)**: Sample or provide high-level summary only
|
122
|
+
- **No code files**: "Appears to be a documentation-only or data project"
|
123
|
+
|
124
|
+
## Example Output
|
125
|
+
|
126
|
+
```markdown
|
127
|
+
## Project Statistics
|
128
|
+
|
129
|
+
**Code**:
|
130
|
+
- Python: 2,453 LOC (87%)
|
131
|
+
- Markdown: 342 LOC (12%)
|
132
|
+
- YAML: 28 LOC (1%)
|
133
|
+
- Total: 2,823 LOC
|
134
|
+
|
135
|
+
**Structure**:
|
136
|
+
- 45 files, 12 directories
|
137
|
+
- 127 commits, 3 contributors
|
138
|
+
|
139
|
+
**Testing**:
|
140
|
+
- Coverage: 78% (via pytest-cov)
|
141
|
+
- Tests: 23 test files
|
142
|
+
|
143
|
+
**Next Action**: Explore src/ directory to understand core modules
|
144
|
+
```
|
145
|
+
|
146
|
+
```markdown
|
147
|
+
## Project Statistics
|
148
|
+
|
149
|
+
**Code** (tokei not available, using basic count):
|
150
|
+
- Python: ~1,200 lines
|
151
|
+
- Markdown: ~400 lines
|
152
|
+
- Total: ~1,600 lines (approximate)
|
153
|
+
|
154
|
+
**Structure**:
|
155
|
+
- 32 files, 8 directories
|
156
|
+
- Not a git repository
|
157
|
+
|
158
|
+
**Testing**:
|
159
|
+
- Coverage: N/A
|
160
|
+
- Tests: N/A
|
161
|
+
|
162
|
+
**Next Action**: Check if this is a standalone library or tool
|
163
|
+
```
|