claudesavvy 2.0.0__tar.gz
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.
- claudesavvy-2.0.0/CHANGELOG.md +163 -0
- claudesavvy-2.0.0/CONTRIBUTING.md +306 -0
- claudesavvy-2.0.0/LICENSE +21 -0
- claudesavvy-2.0.0/MANIFEST.in +7 -0
- claudesavvy-2.0.0/PKG-INFO +323 -0
- claudesavvy-2.0.0/README.md +307 -0
- claudesavvy-2.0.0/pyproject.toml +30 -0
- claudesavvy-2.0.0/requirements.txt +5 -0
- claudesavvy-2.0.0/setup.cfg +4 -0
- claudesavvy-2.0.0/setup.py +31 -0
- claudesavvy-2.0.0/src/claudesavvy/__init__.py +5 -0
- claudesavvy-2.0.0/src/claudesavvy/__main__.py +6 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/__init__.py +0 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/configuration.py +176 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/features.py +140 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/integrations.py +70 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/project_analyzer.py +817 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/tokens.py +320 -0
- claudesavvy-2.0.0/src/claudesavvy/analyzers/usage.py +136 -0
- claudesavvy-2.0.0/src/claudesavvy/cli.py +110 -0
- claudesavvy-2.0.0/src/claudesavvy/models/__init__.py +329 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/__init__.py +0 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/configuration_scanner.py +712 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/debug.py +152 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/files.py +195 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/history.py +157 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/sessions.py +474 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/skills.py +254 -0
- claudesavvy-2.0.0/src/claudesavvy/parsers/tools.py +248 -0
- claudesavvy-2.0.0/src/claudesavvy/utils/__init__.py +0 -0
- claudesavvy-2.0.0/src/claudesavvy/utils/paths.py +108 -0
- claudesavvy-2.0.0/src/claudesavvy/utils/time_filter.py +148 -0
- claudesavvy-2.0.0/src/claudesavvy/web/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/app.py +203 -0
- claudesavvy-2.0.0/src/claudesavvy/web/routes/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/routes/api.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/routes/charts.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/routes/dashboard.py +887 -0
- claudesavvy-2.0.0/src/claudesavvy/web/services/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/services/chart_service.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/services/dashboard_service.py +1331 -0
- claudesavvy-2.0.0/src/claudesavvy/web/static/css/.gitkeep +0 -0
- claudesavvy-2.0.0/src/claudesavvy/web/static/js/.gitkeep +0 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/base.html +66 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/components/card.html +99 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/components/table.html +183 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/layouts/app.html +122 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/configuration.html +157 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/dashboard.html +90 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/error.html +78 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/features.html +65 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/files.html +62 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/integrations.html +65 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/projects.html +71 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/pages/tokens.html +72 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/__init__.py +1 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/cost_trend_charts.html +218 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/dashboard_charts.html +150 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/dashboard_content.html +174 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/agent_detail.html +122 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/command_detail.html +95 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/hook_detail.html +124 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/mcp_detail.html +105 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/plugin_detail.html +74 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/details/skill_detail.html +92 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/feature_list.html +240 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/features_content.html +124 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/files_content.html +104 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/integrations_content.html +94 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/project_analysis_modal.html +314 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/projects_content.html +106 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/time_filter.html +47 -0
- claudesavvy-2.0.0/src/claudesavvy/web/templates/partials/tokens_content.html +137 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/PKG-INFO +323 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/SOURCES.txt +79 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/dependency_links.txt +1 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/entry_points.txt +2 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/requires.txt +5 -0
- claudesavvy-2.0.0/src/claudesavvy.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ClaudeSavvy will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [2.0.0] - 2025-12-29
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **BREAKING**: Major rebrand from "Claude Monitor" to "ClaudeSavvy"
|
|
9
|
+
- **BREAKING**: Package name changed from `claude-monitor` to `claudesavvy` on PyPI
|
|
10
|
+
- **BREAKING**: Command changed from `claude-monitor` to `claudesavvy`
|
|
11
|
+
- Repository name remains as `claude_monitor` for historical reasons
|
|
12
|
+
- Updated all documentation to reflect new brand name
|
|
13
|
+
- Refreshed README with new branding, tagline, and visual identity
|
|
14
|
+
- Updated package description to emphasize "dashboard" functionality
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Reorganized dashboard page layout for better navigation (see #18)
|
|
18
|
+
- Updated all references in documentation and configuration files
|
|
19
|
+
|
|
20
|
+
### Migration Guide
|
|
21
|
+
|
|
22
|
+
If you were using Claude Monitor v1.x:
|
|
23
|
+
|
|
24
|
+
**Before (v1.x):**
|
|
25
|
+
```bash
|
|
26
|
+
pip install claude-monitor
|
|
27
|
+
claude-monitor
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Now (v2.0.0):**
|
|
31
|
+
```bash
|
|
32
|
+
pip install claudesavvy
|
|
33
|
+
claudesavvy
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To upgrade from v1.x to v2.0.0:
|
|
37
|
+
```bash
|
|
38
|
+
pip uninstall claude-monitor
|
|
39
|
+
pip install claudesavvy
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Note: Your data files remain unchanged. Only the package name and command have changed.
|
|
43
|
+
|
|
44
|
+
## [1.0.1] - 2025-12-27
|
|
45
|
+
|
|
46
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
47
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
48
|
+
|
|
49
|
+
## [1.0.1] - 2025-12-27
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- Automated PyPI publishing via GitHub Actions
|
|
53
|
+
- Cross-platform binary builds (macOS, Linux, Windows) using PyInstaller
|
|
54
|
+
- Pre-built executable distribution through GitHub Releases
|
|
55
|
+
- Complete release infrastructure and documentation
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
- Installation now supports three methods: PyPI, pre-built binaries, and from source
|
|
59
|
+
- Updated README with installation instructions for all distribution methods
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
- Security: Fixed 8 instances of empty except blocks with specific exception handling
|
|
63
|
+
- Cross-platform compatibility in PyInstaller spec file
|
|
64
|
+
- Improved dependency handling for web components (Flask templates and static assets)
|
|
65
|
+
|
|
66
|
+
## [1.0.0] - 2025-12-20
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
- Web-based dashboard interface with Flask
|
|
70
|
+
- Multiple dedicated metric pages:
|
|
71
|
+
- Dashboard: Overview of all metrics
|
|
72
|
+
- Tokens: Detailed token usage and cost breakdown
|
|
73
|
+
- Projects: Per-project analytics
|
|
74
|
+
- Files: File operation statistics
|
|
75
|
+
- Integrations: MCP server usage
|
|
76
|
+
- Features: Tool usage and sub-agent statistics
|
|
77
|
+
- Data export functionality (CSV and JSON formats)
|
|
78
|
+
- Health check endpoint for monitoring
|
|
79
|
+
- HTMX-powered dynamic content updates
|
|
80
|
+
- Time period filtering (today, week, month, all-time)
|
|
81
|
+
- Responsive web UI with modern styling
|
|
82
|
+
- Production-ready documentation (LICENSE, CONTRIBUTING, CHANGELOG)
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
- **BREAKING**: Removed CLI dashboard interface entirely
|
|
86
|
+
- **BREAKING**: `claude-monitor` command now launches web server directly (no subcommand required)
|
|
87
|
+
- Updated entry point from dual-mode (CLI/web) to web-only
|
|
88
|
+
- Standardized dependency versions across all configuration files
|
|
89
|
+
- Updated project description to "Web-based usage monitoring tool for Claude Code"
|
|
90
|
+
- Bumped version to 1.0.0 to reflect major interface change
|
|
91
|
+
|
|
92
|
+
### Removed
|
|
93
|
+
- **BREAKING**: CLI interactive menu and dashboard views
|
|
94
|
+
- **BREAKING**: CLI-specific options: `--today`, `--week`, `--month`, `--quarter`, `--year`, `--focus`, `--interactive`
|
|
95
|
+
- Entire `display/` module (dashboard, menu, tables, cards, formatter)
|
|
96
|
+
- CLI time filtering and project filtering flags
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
- Added Flask>=3.0.0 and Jinja2>=3.1.0 to setup.py (previously missing)
|
|
100
|
+
- Standardized Flask version to 3.0.0 across setup.py, pyproject.toml, and requirements.txt
|
|
101
|
+
- Fixed installation via `pip install .` which previously failed to install web dependencies
|
|
102
|
+
|
|
103
|
+
### Migration Guide
|
|
104
|
+
|
|
105
|
+
If you were using the CLI dashboard (v0.1.0):
|
|
106
|
+
|
|
107
|
+
**Before (v0.1.0):**
|
|
108
|
+
```bash
|
|
109
|
+
claude-monitor # CLI dashboard
|
|
110
|
+
claude-monitor --week # CLI with time filter
|
|
111
|
+
claude-monitor web # Web server
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Now (v1.0.0):**
|
|
115
|
+
```bash
|
|
116
|
+
claude-monitor # Web server (default)
|
|
117
|
+
claude-monitor --port 8080 # Web server on custom port
|
|
118
|
+
claude-monitor --debug # Web server in debug mode
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
To continue using the CLI dashboard, stay on version 0.1.0:
|
|
122
|
+
```bash
|
|
123
|
+
git checkout v0.1.0
|
|
124
|
+
pip install -e .
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## [0.1.0] - 2025-12-19
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
- Initial release with CLI dashboard interface
|
|
131
|
+
- Interactive menu with logo and navigation
|
|
132
|
+
- Usage metrics tracking (sessions, commands, projects)
|
|
133
|
+
- Token usage and cost calculations
|
|
134
|
+
- Prompt cache efficiency monitoring
|
|
135
|
+
- Project breakdown analytics
|
|
136
|
+
- File modification tracking
|
|
137
|
+
- MCP integration statistics
|
|
138
|
+
- Model usage breakdown
|
|
139
|
+
- Time-based filtering (today, week, month, quarter, year, custom dates)
|
|
140
|
+
- Rich terminal UI with tables and color-coded output
|
|
141
|
+
- Support for custom Claude data directory
|
|
142
|
+
- Web interface as optional subcommand
|
|
143
|
+
|
|
144
|
+
### Data Sources
|
|
145
|
+
- Reads from `~/.claude/` directory
|
|
146
|
+
- Parses history.jsonl for command history
|
|
147
|
+
- Analyzes session files for token usage
|
|
148
|
+
- Processes debug logs for MCP activity
|
|
149
|
+
- Tracks file editing history
|
|
150
|
+
|
|
151
|
+
### Requirements
|
|
152
|
+
- Python 3.9+
|
|
153
|
+
- click>=8.1.0
|
|
154
|
+
- rich>=13.0.0
|
|
155
|
+
- python-dateutil>=2.8.0
|
|
156
|
+
- Flask>=2.3.0 (for web mode)
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Version History
|
|
161
|
+
|
|
162
|
+
- **1.0.0** (2025-12-20): Web-only release with production polish
|
|
163
|
+
- **0.1.0** (2025-12-19): Initial release with dual CLI/web interface
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Contributing to ClaudeSavvy
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to ClaudeSavvy! This document provides guidelines and instructions for contributing to the project.
|
|
4
|
+
|
|
5
|
+
## Welcome
|
|
6
|
+
|
|
7
|
+
We welcome contributions of all kinds:
|
|
8
|
+
- Bug fixes
|
|
9
|
+
- Feature enhancements
|
|
10
|
+
- Documentation improvements
|
|
11
|
+
- Performance optimizations
|
|
12
|
+
- Code quality improvements
|
|
13
|
+
|
|
14
|
+
## Code of Conduct
|
|
15
|
+
|
|
16
|
+
Be respectful and constructive in all interactions. We're all here to build something useful together.
|
|
17
|
+
|
|
18
|
+
## Getting Started
|
|
19
|
+
|
|
20
|
+
### 1. Clone and Set Up
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Clone the repository
|
|
24
|
+
git clone https://github.com/allannapier/claude_monitor.git
|
|
25
|
+
cd claude_monitor
|
|
26
|
+
|
|
27
|
+
# Create a virtual environment (recommended)
|
|
28
|
+
python3 -m venv venv
|
|
29
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
30
|
+
|
|
31
|
+
# Install in development mode
|
|
32
|
+
pip install -e .
|
|
33
|
+
|
|
34
|
+
# Or install with requirements
|
|
35
|
+
pip install -r requirements.txt
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Run Locally
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Start the web server
|
|
42
|
+
claudesavvy
|
|
43
|
+
|
|
44
|
+
# Or run directly
|
|
45
|
+
python3 -m src.claudesavvy.cli
|
|
46
|
+
|
|
47
|
+
# Enable debug mode for development
|
|
48
|
+
claudesavvy --debug
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The web interface will be available at http://localhost:5000
|
|
52
|
+
|
|
53
|
+
## Development Workflow
|
|
54
|
+
|
|
55
|
+
### Branch Naming
|
|
56
|
+
|
|
57
|
+
- `feature/description` - New features
|
|
58
|
+
- `fix/description` - Bug fixes
|
|
59
|
+
- `docs/description` - Documentation changes
|
|
60
|
+
- `refactor/description` - Code refactoring
|
|
61
|
+
|
|
62
|
+
### Commit Messages
|
|
63
|
+
|
|
64
|
+
Write clear, descriptive commit messages:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Add export functionality for CSV format
|
|
68
|
+
|
|
69
|
+
- Implement CSV export route
|
|
70
|
+
- Add download headers
|
|
71
|
+
- Include all dashboard metrics
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Pull Request Process
|
|
75
|
+
|
|
76
|
+
1. **Create a branch** from `main`:
|
|
77
|
+
```bash
|
|
78
|
+
git checkout -b feature/my-new-feature
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. **Make your changes** with clear, focused commits
|
|
82
|
+
|
|
83
|
+
3. **Test your changes**:
|
|
84
|
+
- Verify the web server starts successfully
|
|
85
|
+
- Test all affected routes and functionality
|
|
86
|
+
- Check for Python errors and warnings
|
|
87
|
+
|
|
88
|
+
4. **Update documentation** if needed:
|
|
89
|
+
- Update README.md for user-facing changes
|
|
90
|
+
- Add docstrings for new functions/classes
|
|
91
|
+
- Update CHANGELOG.md with your changes
|
|
92
|
+
|
|
93
|
+
5. **Submit a pull request**:
|
|
94
|
+
- Describe what changes you made and why
|
|
95
|
+
- Link to any related issues
|
|
96
|
+
- Include screenshots for UI changes
|
|
97
|
+
|
|
98
|
+
## Project Structure
|
|
99
|
+
|
|
100
|
+
Understanding the architecture will help you contribute effectively:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
src/claudesavvy/
|
|
104
|
+
├── cli.py # Entry point - launches web server
|
|
105
|
+
├── parsers/ # Data parsers (read Claude Code files)
|
|
106
|
+
│ ├── history.py # Command history parser
|
|
107
|
+
│ ├── sessions.py # Session and token data parser
|
|
108
|
+
│ ├── debug.py # MCP server logs parser
|
|
109
|
+
│ ├── files.py # File editing history parser
|
|
110
|
+
│ ├── tools.py # Tool usage parser
|
|
111
|
+
│ └── skills.py # Skills and config parser
|
|
112
|
+
├── analyzers/ # Data analysis layer
|
|
113
|
+
│ ├── usage.py # Usage statistics analyzer
|
|
114
|
+
│ ├── tokens.py # Token usage and cost analyzer
|
|
115
|
+
│ ├── integrations.py # MCP integration analyzer
|
|
116
|
+
│ └── features.py # Features analyzer
|
|
117
|
+
├── web/ # Flask web application
|
|
118
|
+
│ ├── app.py # Flask app factory
|
|
119
|
+
│ ├── routes/ # Route handlers
|
|
120
|
+
│ │ └── dashboard.py # Main dashboard routes
|
|
121
|
+
│ ├── services/ # Business logic
|
|
122
|
+
│ │ └── dashboard_service.py
|
|
123
|
+
│ ├── templates/ # Jinja2 HTML templates
|
|
124
|
+
│ │ ├── pages/ # Full page templates
|
|
125
|
+
│ │ ├── partials/ # Reusable components
|
|
126
|
+
│ │ └── components/ # UI components
|
|
127
|
+
│ └── static/ # CSS, JS, images
|
|
128
|
+
└── utils/ # Shared utilities
|
|
129
|
+
├── paths.py # Path management
|
|
130
|
+
└── time_filter.py # Time-based filtering
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Adding Features
|
|
134
|
+
|
|
135
|
+
### Adding a New Metric
|
|
136
|
+
|
|
137
|
+
1. **Create/modify a parser** in `parsers/` to extract the data
|
|
138
|
+
2. **Create/modify an analyzer** in `analyzers/` to process the data
|
|
139
|
+
3. **Add to web service** in `web/services/dashboard_service.py`
|
|
140
|
+
4. **Create a route** in `web/routes/dashboard.py`
|
|
141
|
+
5. **Create a template** in `web/templates/pages/`
|
|
142
|
+
6. **Update navigation** in `web/templates/base.html`
|
|
143
|
+
|
|
144
|
+
### Adding a New Parser
|
|
145
|
+
|
|
146
|
+
Parsers read Claude Code data files:
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from pathlib import Path
|
|
150
|
+
from typing import List
|
|
151
|
+
|
|
152
|
+
class MyParser:
|
|
153
|
+
def __init__(self, file_path: Path):
|
|
154
|
+
self.file_path = file_path
|
|
155
|
+
|
|
156
|
+
def parse(self) -> List[dict]:
|
|
157
|
+
"""Parse the file and return structured data."""
|
|
158
|
+
# Your parsing logic here
|
|
159
|
+
pass
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Adding a New Analyzer
|
|
163
|
+
|
|
164
|
+
Analyzers process parsed data:
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from .parsers.my_parser import MyParser
|
|
168
|
+
from .utils.time_filter import TimeFilter
|
|
169
|
+
|
|
170
|
+
class MyAnalyzer:
|
|
171
|
+
def __init__(self, parser: MyParser, time_filter: TimeFilter):
|
|
172
|
+
self.parser = parser
|
|
173
|
+
self.time_filter = time_filter
|
|
174
|
+
|
|
175
|
+
def get_summary(self):
|
|
176
|
+
"""Analyze data and return summary."""
|
|
177
|
+
# Your analysis logic here
|
|
178
|
+
pass
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Adding a New Web Page
|
|
182
|
+
|
|
183
|
+
1. **Add route** in `web/routes/dashboard.py`:
|
|
184
|
+
```python
|
|
185
|
+
@dashboard_bp.route('/my-page')
|
|
186
|
+
def my_page():
|
|
187
|
+
data = dashboard_service.get_my_data()
|
|
188
|
+
return render_template('pages/my_page.html', data=data)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. **Create template** in `web/templates/pages/my_page.html`:
|
|
192
|
+
```html
|
|
193
|
+
{% extends "base.html" %}
|
|
194
|
+
{% block content %}
|
|
195
|
+
<!-- Your page content -->
|
|
196
|
+
{% endblock %}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Testing
|
|
200
|
+
|
|
201
|
+
Currently, testing is manual. When making changes:
|
|
202
|
+
|
|
203
|
+
### Manual Testing Checklist
|
|
204
|
+
|
|
205
|
+
- [ ] Web server starts without errors
|
|
206
|
+
- [ ] All existing pages load correctly
|
|
207
|
+
- [ ] New functionality works as expected
|
|
208
|
+
- [ ] No Python exceptions in console
|
|
209
|
+
- [ ] Data displays correctly with real Claude data
|
|
210
|
+
- [ ] Export functionality works (if modified)
|
|
211
|
+
- [ ] Browser console has no errors
|
|
212
|
+
- [ ] Responsive design works (if UI changes)
|
|
213
|
+
|
|
214
|
+
### Test in Multiple Scenarios
|
|
215
|
+
|
|
216
|
+
- Test with minimal Claude usage data
|
|
217
|
+
- Test with extensive Claude usage data
|
|
218
|
+
- Test with missing/incomplete data files
|
|
219
|
+
- Test edge cases (no sessions, no projects, etc.)
|
|
220
|
+
|
|
221
|
+
## Style Guide
|
|
222
|
+
|
|
223
|
+
### Python Style
|
|
224
|
+
|
|
225
|
+
- Follow PEP 8 conventions
|
|
226
|
+
- Use type hints where helpful:
|
|
227
|
+
```python
|
|
228
|
+
def calculate_cost(tokens: int) -> float:
|
|
229
|
+
return tokens / 1_000_000 * 3.0
|
|
230
|
+
```
|
|
231
|
+
- Write descriptive variable names
|
|
232
|
+
- Add docstrings for public functions:
|
|
233
|
+
```python
|
|
234
|
+
def get_summary(self) -> dict:
|
|
235
|
+
"""
|
|
236
|
+
Get usage summary statistics.
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
dict: Summary statistics including sessions, commands, and projects
|
|
240
|
+
"""
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### HTML/Jinja2 Style
|
|
244
|
+
|
|
245
|
+
- Use semantic HTML elements
|
|
246
|
+
- Keep templates DRY (Don't Repeat Yourself)
|
|
247
|
+
- Use partials for reusable components
|
|
248
|
+
- Include helpful comments in complex templates
|
|
249
|
+
|
|
250
|
+
### Code Organization
|
|
251
|
+
|
|
252
|
+
- Keep functions focused and single-purpose
|
|
253
|
+
- Avoid deep nesting (max 3-4 levels)
|
|
254
|
+
- Extract complex logic into helper functions
|
|
255
|
+
- Group related functionality together
|
|
256
|
+
|
|
257
|
+
## Submitting Pull Requests
|
|
258
|
+
|
|
259
|
+
### Before Submitting
|
|
260
|
+
|
|
261
|
+
- [ ] Code follows project style guidelines
|
|
262
|
+
- [ ] All manual tests pass
|
|
263
|
+
- [ ] Documentation is updated
|
|
264
|
+
- [ ] Commit messages are clear
|
|
265
|
+
- [ ] No commented-out code or debug statements
|
|
266
|
+
- [ ] No secrets or personal data in code
|
|
267
|
+
|
|
268
|
+
### PR Description Template
|
|
269
|
+
|
|
270
|
+
```markdown
|
|
271
|
+
## Description
|
|
272
|
+
Brief description of what this PR does
|
|
273
|
+
|
|
274
|
+
## Type of Change
|
|
275
|
+
- [ ] Bug fix
|
|
276
|
+
- [ ] New feature
|
|
277
|
+
- [ ] Documentation update
|
|
278
|
+
- [ ] Refactoring
|
|
279
|
+
- [ ] Performance improvement
|
|
280
|
+
|
|
281
|
+
## Changes Made
|
|
282
|
+
- Bullet point list of changes
|
|
283
|
+
|
|
284
|
+
## Testing Done
|
|
285
|
+
- How you tested these changes
|
|
286
|
+
|
|
287
|
+
## Screenshots (if UI changes)
|
|
288
|
+
[Add screenshots here]
|
|
289
|
+
|
|
290
|
+
## Related Issues
|
|
291
|
+
Closes #123
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Questions or Issues?
|
|
295
|
+
|
|
296
|
+
- Open an issue on GitHub for bugs or feature requests
|
|
297
|
+
- Start a discussion for questions or ideas
|
|
298
|
+
- Check existing issues before creating new ones
|
|
299
|
+
|
|
300
|
+
## License
|
|
301
|
+
|
|
302
|
+
By contributing to ClaudeSavvy, you agree that your contributions will be licensed under the MIT License.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
Thank you for contributing to ClaudeSavvy! 🚀
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Allan Napier
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|