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
lite_kits/kits/project/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
**Status**: ✅ Recommended (Default)
|
4
4
|
|
5
|
-
Essential project-level utilities and enhancements for vanilla spec-kit. Includes agent orientation,
|
5
|
+
Essential project-level utilities and enhancements for vanilla spec-kit. Includes agent orientation, quality checks, and enhanced feature creation scripts.
|
6
6
|
|
7
7
|
## What It Adds
|
8
8
|
|
@@ -11,7 +11,6 @@ Essential project-level utilities and enhancements for vanilla spec-kit. Include
|
|
11
11
|
| Command | Claude Code | GitHub Copilot | Description |
|
12
12
|
|---------|-------------|----------------|-------------|
|
13
13
|
| `/orient` | ✅ | ✅ | Agent orientation protocol (most essential!) |
|
14
|
-
| `/review` | 🚧 | 🚧 | Code review helper |
|
15
14
|
| `/audit` | 🚧 | 🚧 | Security & quality audit |
|
16
15
|
| `/stats` | 🚧 | 🚧 | Project statistics |
|
17
16
|
|
@@ -41,12 +40,10 @@ lite-kits install -Kit project
|
|
41
40
|
your-project/
|
42
41
|
├── .claude/commands/ # If Claude Code detected
|
43
42
|
│ ├── orient.md # ✅ Essential!
|
44
|
-
│ ├── review.md # 🚧 Coming Soon
|
45
43
|
│ ├── audit.md # 🚧 Coming Soon
|
46
44
|
│ └── stats.md # 🚧 Coming Soon
|
47
45
|
├── .github/prompts/ # If GitHub Copilot detected
|
48
46
|
│ ├── orient.prompt.md # ✅ Essential!
|
49
|
-
│ ├── review.prompt.md # 🚧 Coming Soon
|
50
47
|
│ ├── audit.prompt.md # 🚧 Coming Soon
|
51
48
|
│ └── stats.prompt.md # 🚧 Coming Soon
|
52
49
|
└── .specify/scripts/ # Enhanced vanilla scripts
|
@@ -102,19 +99,6 @@ your-project/
|
|
102
99
|
|
103
100
|
---
|
104
101
|
|
105
|
-
### `/review` - Code Review (Coming Soon)
|
106
|
-
|
107
|
-
**Purpose**: Review code changes against project constitution and best practices.
|
108
|
-
|
109
|
-
**What it will do**:
|
110
|
-
- Check staged changes against constitution principles
|
111
|
-
- Identify common code smells
|
112
|
-
- Suggest improvements
|
113
|
-
- Verify test coverage
|
114
|
-
- Check documentation completeness
|
115
|
-
|
116
|
-
---
|
117
|
-
|
118
102
|
### `/audit` - Security & Quality Audit (Coming Soon)
|
119
103
|
|
120
104
|
**Purpose**: Scan for security issues and quality problems.
|
@@ -180,11 +164,11 @@ your-project/
|
|
180
164
|
|
181
165
|
### Team with Multiple Agents
|
182
166
|
**Install**: `--recommended` + `--kit=multiagent`
|
183
|
-
**Use**: `/orient`
|
167
|
+
**Use**: `/orient` at start of every session
|
184
168
|
|
185
169
|
### Security-Focused Project
|
186
170
|
**Install**: `--recommended`
|
187
|
-
**Use**: `/audit` regularly
|
171
|
+
**Use**: `/audit` regularly for security scans
|
188
172
|
|
189
173
|
### Custom Workflow Needs
|
190
174
|
**Install**: `--kit=project`
|
@@ -206,7 +190,7 @@ No configuration needed - works out of the box.
|
|
206
190
|
|
207
191
|
**None** - project-kit is standalone.
|
208
192
|
|
209
|
-
**Note**:
|
193
|
+
**Note**: Works great with git-kit for complete workflow automation.
|
210
194
|
|
211
195
|
---
|
212
196
|
|
@@ -226,8 +210,8 @@ lite-kits remove -Kit project
|
|
226
210
|
```
|
227
211
|
|
228
212
|
Removes:
|
229
|
-
- `.claude/commands/{orient,
|
230
|
-
- `.github/prompts/{orient,
|
213
|
+
- `.claude/commands/{orient,audit,stats}.md`
|
214
|
+
- `.github/prompts/{orient,audit,stats}.prompt.md`
|
231
215
|
- `.specify/scripts/{bash,powershell}/create-feature-enhanced.{sh,ps1}`
|
232
216
|
|
233
217
|
---
|
@@ -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
|
+
```bash
|
16
|
+
# Check for Python dependencies
|
17
|
+
ls requirements.txt pyproject.toml setup.py 2>/dev/null
|
18
|
+
|
19
|
+
# Check for Node.js dependencies
|
20
|
+
ls package.json package-lock.json 2>/dev/null
|
21
|
+
|
22
|
+
# Check for Rust dependencies
|
23
|
+
ls Cargo.toml Cargo.lock 2>/dev/null
|
24
|
+
|
25
|
+
# Check for Go dependencies
|
26
|
+
ls go.mod go.sum 2>/dev/null
|
27
|
+
```
|
28
|
+
|
29
|
+
### 2. Run Dependency Vulnerability Scan
|
30
|
+
|
31
|
+
**Python projects**:
|
32
|
+
```bash
|
33
|
+
# Check if pip-audit is available
|
34
|
+
command -v pip-audit >/dev/null 2>&1
|
35
|
+
|
36
|
+
# If available, run scan
|
37
|
+
pip-audit
|
38
|
+
|
39
|
+
# If not available, suggest installation
|
40
|
+
echo "Install pip-audit: pip install pip-audit"
|
41
|
+
```
|
42
|
+
|
43
|
+
**Node.js projects**:
|
44
|
+
```bash
|
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
|
+
```bash
|
59
|
+
# Look for potential hardcoded secrets
|
60
|
+
grep -r "API_KEY\s*=\s*['\"]" src/ 2>/dev/null | head -5
|
61
|
+
grep -r "PASSWORD\s*=\s*['\"]" src/ 2>/dev/null | head -5
|
62
|
+
grep -r "SECRET\s*=\s*['\"]" src/ 2>/dev/null | head -5
|
63
|
+
|
64
|
+
# Look for weak crypto patterns (Python)
|
65
|
+
grep -r "md5\|sha1" src/ 2>/dev/null | head -5
|
66
|
+
|
67
|
+
# Look for SQL injection risks
|
68
|
+
grep -r "execute.*%\|execute.*+" src/ 2>/dev/null | head -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
|
```bash
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
[ -f .claude/commands/review.md ] && PROJECT_KIT=true
|
25
|
-
|
26
|
-
# Check for git-kit markers
|
27
|
-
[ -f .claude/commands/commit.md ] && GIT_KIT=true
|
28
|
-
|
29
|
-
# Check for multiagent-kit markers
|
30
|
-
[ -f .specify/memory/pr-workflow-guide.md ] && MULTIAGENT_KIT=true
|
18
|
+
# Check all kits in one command
|
19
|
+
KITS_INSTALLED=""
|
20
|
+
[ -f .claude/commands/orient.md ] && KITS_INSTALLED="${KITS_INSTALLED}project "
|
21
|
+
[ -f .claude/commands/commit.md ] && KITS_INSTALLED="${KITS_INSTALLED}git "
|
22
|
+
[ -f .specify/memory/pr-workflow-guide.md ] && KITS_INSTALLED="${KITS_INSTALLED}multiagent "
|
23
|
+
KITS_INSTALLED="${KITS_INSTALLED:-vanilla only}"
|
31
24
|
```
|
32
25
|
|
33
26
|
### 2. Determine Agent Role
|
@@ -58,17 +51,11 @@ Extract:
|
|
58
51
|
### 4. Check Git State
|
59
52
|
|
60
53
|
```bash
|
61
|
-
#
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
git
|
66
|
-
|
67
|
-
# Uncommitted changes
|
68
|
-
git status --short
|
69
|
-
|
70
|
-
# Untracked files count
|
71
|
-
git ls-files --others --exclude-standard | wc -l
|
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>/dev/null || echo "(not in git repo)")
|
57
|
+
RECENT_COMMITS=$(git log --oneline -3 2>/dev/null | head -1 || echo "(no commits)")
|
58
|
+
CHANGES=$(git status --short 2>/dev/null | wc -l || echo "0")
|
72
59
|
```
|
73
60
|
|
74
61
|
### 5. Check Active Work
|
@@ -76,29 +63,25 @@ git ls-files --others --exclude-standard | wc -l
|
|
76
63
|
Look for active feature work:
|
77
64
|
|
78
65
|
```bash
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
SPEC_DIR
|
86
|
-
[ -f "$SPEC_DIR/spec.md" ] && echo "✓ Spec exists"
|
87
|
-
[ -f "$SPEC_DIR/plan.md" ] && echo "✓ Plan exists"
|
88
|
-
[ -f "$SPEC_DIR/tasks.md" ] && echo "✓ Tasks exist"
|
66
|
+
# Check if current branch matches a spec directory
|
67
|
+
if [[ "$CURRENT_BRANCH" =~ ^[0-9]+ ]] || [[ "$CURRENT_BRANCH" =~ ^dev/[0-9]+ ]]; then
|
68
|
+
# Extract spec number from branch name
|
69
|
+
SPEC_NUM=$(echo "$CURRENT_BRANCH" | grep -oE '[0-9]+' | head -1)
|
70
|
+
SPEC_DIR="specs/$SPEC_NUM-*"
|
71
|
+
# Check for spec files efficiently
|
72
|
+
SPEC_FILES=$(ls -1 $SPEC_DIR/{spec,plan,tasks}.md 2>/dev/null | wc -l)
|
89
73
|
fi
|
90
74
|
```
|
91
75
|
|
92
76
|
### 6. Check Multi-Agent Coordination (if multiagent-kit installed)
|
93
77
|
|
94
|
-
If `MULTIAGENT_KIT=true`:
|
95
|
-
|
96
78
|
```bash
|
97
|
-
#
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
find specs/*/collaboration/active/decisions/ -name "handoff-*.md" 2>/dev/null | head -1
|
79
|
+
# Only check if multiagent kit is installed
|
80
|
+
if [[ "$KITS_INSTALLED" == *"multiagent"* ]]; then
|
81
|
+
# Efficient check for collaboration activity
|
82
|
+
ACTIVE_SESSIONS=$(find specs/*/collaboration/active/sessions/ -name "*.md" 2>/dev/null | wc -l)
|
83
|
+
PENDING_HANDOFF=$(find specs/*/collaboration/active/decisions/ -name "handoff-*.md" 2>/dev/null | head -1)
|
84
|
+
fi
|
102
85
|
```
|
103
86
|
|
104
87
|
### 7. Generate Concise Output
|
@@ -108,15 +91,15 @@ Provide a **concise summary** (~150 words max) in this format:
|
|
108
91
|
```
|
109
92
|
## Orientation Complete
|
110
93
|
|
111
|
-
**Installed Kits**: [
|
94
|
+
**Installed Kits**: [KITS_INSTALLED]
|
112
95
|
|
113
96
|
**I am**: [AGENT_ROLE from step 2]
|
114
97
|
**Project**: [project name from docs]
|
115
98
|
**Stack**: [main technologies]
|
116
|
-
**Branch**: [
|
117
|
-
**Recent work**: [
|
118
|
-
**Uncommitted changes**: [count
|
119
|
-
**Active feature**: [current spec if
|
99
|
+
**Branch**: [CURRENT_BRANCH]
|
100
|
+
**Recent work**: [RECENT_COMMITS - just the message]
|
101
|
+
**Uncommitted changes**: [CHANGES count]
|
102
|
+
**Active feature**: [current spec if SPEC_FILES > 0]
|
120
103
|
**Coordination**: [solo work / handoff pending / etc]
|
121
104
|
|
122
105
|
**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
|
+
```bash
|
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
|
+
```bash
|
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
|
+
```bash
|
45
|
+
# Suggest reviewing recent commit
|
46
|
+
git log -1 --stat
|
47
|
+
```
|
48
|
+
|
49
|
+
### 3. Check for Linting Configuration
|
50
|
+
|
51
|
+
```bash
|
52
|
+
# Look for common linting config files
|
53
|
+
ls .ruff.toml .pylintrc pyproject.toml .eslintrc* 2>/dev/null
|
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,162 @@
|
|
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
|
+
```bash
|
17
|
+
# Check if tokei is available
|
18
|
+
command -v tokei >/dev/null 2>&1
|
19
|
+
|
20
|
+
# If available, use tokei for fast, accurate counts
|
21
|
+
tokei --output json
|
22
|
+
```
|
23
|
+
|
24
|
+
**Fallback method** (if tokei not available):
|
25
|
+
```bash
|
26
|
+
# Python
|
27
|
+
find . -name "*.py" -type f | xargs wc -l 2>/dev/null | tail -1
|
28
|
+
|
29
|
+
# JavaScript/TypeScript
|
30
|
+
find . -name "*.js" -o -name "*.ts" | xargs wc -l 2>/dev/null | tail -1
|
31
|
+
|
32
|
+
# Markdown
|
33
|
+
find . -name "*.md" -type f | xargs wc -l 2>/dev/null | tail -1
|
34
|
+
|
35
|
+
# All files combined
|
36
|
+
find . -type f -not -path "*/\.*" | xargs wc -l 2>/dev/null | tail -1
|
37
|
+
```
|
38
|
+
|
39
|
+
### 2. Count Files and Directories
|
40
|
+
|
41
|
+
```bash
|
42
|
+
# Count files (excluding hidden)
|
43
|
+
find . -type f -not -path "*/\.*" | wc -l
|
44
|
+
|
45
|
+
# Count directories (excluding hidden)
|
46
|
+
find . -type d -not -path "*/\.*" | wc -l
|
47
|
+
```
|
48
|
+
|
49
|
+
### 3. Get Git History Summary
|
50
|
+
|
51
|
+
```bash
|
52
|
+
# Total commits
|
53
|
+
git log --oneline | wc -l
|
54
|
+
|
55
|
+
# Contributor count
|
56
|
+
git log --format='%aN' | sort -u | wc -l
|
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
|
+
```bash
|
68
|
+
# Python coverage files
|
69
|
+
ls .coverage coverage.xml htmlcov/ 2>/dev/null
|
70
|
+
|
71
|
+
# JavaScript coverage
|
72
|
+
ls coverage/ .nyc_output/ 2>/dev/null
|
73
|
+
|
74
|
+
# If coverage files exist, try to extract percentage
|
75
|
+
# Python: coverage report | grep TOTAL
|
76
|
+
# JavaScript: cat coverage/coverage-summary.json
|
77
|
+
```
|
78
|
+
|
79
|
+
### 5. Generate Concise Table Output
|
80
|
+
|
81
|
+
Provide stats in this format (~20 lines max):
|
82
|
+
|
83
|
+
```markdown
|
84
|
+
## Project Statistics
|
85
|
+
|
86
|
+
**Code**:
|
87
|
+
- Language1: X,XXX LOC (NN%)
|
88
|
+
- Language2: XXX LOC (NN%)
|
89
|
+
- Language3: XX LOC (NN%)
|
90
|
+
|
91
|
+
**Structure**:
|
92
|
+
- NN files, NN directories
|
93
|
+
- NNN commits, N contributors
|
94
|
+
|
95
|
+
**Testing**:
|
96
|
+
- Coverage: NN% (or N/A)
|
97
|
+
- Tests: NN files (or N/A)
|
98
|
+
|
99
|
+
**Next Action**: [Explore src/ / Review tests / Check docs]
|
100
|
+
```
|
101
|
+
|
102
|
+
## Important Notes
|
103
|
+
|
104
|
+
- **Be concise**: Keep output under 20 lines
|
105
|
+
- **Use tables**: Well-formatted markdown tables or lists
|
106
|
+
- **Handle missing tools**:
|
107
|
+
- No tokei → Use find/wc fallback, note "Basic LOC count"
|
108
|
+
- Not a git repo → Skip git section, note "No git history"
|
109
|
+
- No coverage → Show "N/A" gracefully
|
110
|
+
|
111
|
+
- **Percentages**: Calculate language percentages from total LOC
|
112
|
+
- **Large repos**: If >100k LOC, note "Large project" and consider sampling
|
113
|
+
- **Speed**: Target <5 second execution time
|
114
|
+
|
115
|
+
## Edge Cases
|
116
|
+
|
117
|
+
- **No git repository**: Skip git section, show file/LOC stats only
|
118
|
+
- **No test coverage reports**: Show "Coverage: N/A"
|
119
|
+
- **Tokei not installed**: Use find/wc fallback, note in output
|
120
|
+
- **Very large repo (1M+ LOC)**: Sample or provide high-level summary only
|
121
|
+
- **No code files**: "Appears to be a documentation-only or data project"
|
122
|
+
|
123
|
+
## Example Output
|
124
|
+
|
125
|
+
```markdown
|
126
|
+
## Project Statistics
|
127
|
+
|
128
|
+
**Code**:
|
129
|
+
- Python: 2,453 LOC (87%)
|
130
|
+
- Markdown: 342 LOC (12%)
|
131
|
+
- YAML: 28 LOC (1%)
|
132
|
+
- Total: 2,823 LOC
|
133
|
+
|
134
|
+
**Structure**:
|
135
|
+
- 45 files, 12 directories
|
136
|
+
- 127 commits, 3 contributors
|
137
|
+
|
138
|
+
**Testing**:
|
139
|
+
- Coverage: 78% (via pytest-cov)
|
140
|
+
- Tests: 23 test files
|
141
|
+
|
142
|
+
**Next Action**: Explore src/ directory to understand core modules
|
143
|
+
```
|
144
|
+
|
145
|
+
```markdown
|
146
|
+
## Project Statistics
|
147
|
+
|
148
|
+
**Code** (tokei not available, using basic count):
|
149
|
+
- Python: ~1,200 lines
|
150
|
+
- Markdown: ~400 lines
|
151
|
+
- Total: ~1,600 lines (approximate)
|
152
|
+
|
153
|
+
**Structure**:
|
154
|
+
- 32 files, 8 directories
|
155
|
+
- Not a git repository
|
156
|
+
|
157
|
+
**Testing**:
|
158
|
+
- Coverage: N/A
|
159
|
+
- Tests: N/A
|
160
|
+
|
161
|
+
**Next Action**: Check if this is a standalone library or tool
|
162
|
+
```
|