claude-code-templates 1.8.0 → 1.8.2
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.
- package/README.md +246 -0
- package/package.json +26 -12
- package/src/analytics/core/ConversationAnalyzer.js +754 -0
- package/src/analytics/core/FileWatcher.js +285 -0
- package/src/analytics/core/ProcessDetector.js +242 -0
- package/src/analytics/core/SessionAnalyzer.js +631 -0
- package/src/analytics/core/StateCalculator.js +190 -0
- package/src/analytics/data/DataCache.js +550 -0
- package/src/analytics/notifications/NotificationManager.js +448 -0
- package/src/analytics/notifications/WebSocketServer.js +526 -0
- package/src/analytics/utils/PerformanceMonitor.js +455 -0
- package/src/analytics-web/assets/js/main.js +312 -0
- package/src/analytics-web/components/Charts.js +114 -0
- package/src/analytics-web/components/ConversationTable.js +437 -0
- package/src/analytics-web/components/Dashboard.js +573 -0
- package/src/analytics-web/components/SessionTimer.js +596 -0
- package/src/analytics-web/index.html +882 -49
- package/src/analytics-web/index.html.original +1939 -0
- package/src/analytics-web/services/DataService.js +357 -0
- package/src/analytics-web/services/StateService.js +276 -0
- package/src/analytics-web/services/WebSocketService.js +523 -0
- package/src/analytics.js +641 -2311
- package/src/analytics.log +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/claude-code-templates)
|
|
2
|
+
[](https://www.npmjs.com/package/claude-code-templates)
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://opensource.org/)
|
|
5
|
+
[](https://github.com/davila7/claude-code-templates/blob/main/CONTRIBUTING.md)
|
|
6
|
+
[](https://github.com/davila7/claude-code-templates)
|
|
7
|
+
|
|
8
|
+
# Claude Code Templates
|
|
9
|
+
|
|
10
|
+
**CLI tool for configuring and monitoring Claude Code** - Quick setup for any project with framework-specific commands and real-time monitoring dashboard. Open source and runs locally.
|
|
11
|
+
|
|
12
|
+
## 📋 Quick Start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Run the tool (no installation required!)
|
|
16
|
+
npx claude-code-templates@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Core Features
|
|
20
|
+
|
|
21
|
+
### 📊 Real-time Analytics Dashboard
|
|
22
|
+
Monitor and optimize your Claude Code agents with our comprehensive analytics dashboard:
|
|
23
|
+
- **Live Session Tracking**: See active conversations and their status in real-time
|
|
24
|
+
- **Real-time State Detection**: "Claude Code working...", "User typing...", "Awaiting user input..."
|
|
25
|
+
- **Usage Statistics**: Total sessions, tokens, and project activity with interactive charts
|
|
26
|
+
- **Conversation History**: Complete session logs with export capabilities (CSV/JSON)
|
|
27
|
+
- **Browser Notifications**: Get notified when Claude is waiting for your input
|
|
28
|
+
- **Performance Monitoring**: Track Claude Code agent performance and optimization opportunities
|
|
29
|
+
- **Web Interface**: Clean, terminal-style dashboard at `http://localhost:3333`
|
|
30
|
+
|
|
31
|
+
### 📋 Smart Project Setup
|
|
32
|
+
Intelligent project configuration with framework-specific commands:
|
|
33
|
+
- **Auto-Detection**: Automatically detect your project type and suggest optimal configurations
|
|
34
|
+
- **Quick Setup**: Framework-specific commands for testing, linting, building, debugging, and deployment
|
|
35
|
+
- **Optimized Workflows**: Pre-configured commands tailored to your development stack
|
|
36
|
+
- **Best Practices**: Industry-standard configurations and development patterns
|
|
37
|
+
|
|
38
|
+
## What Gets Installed
|
|
39
|
+
|
|
40
|
+
### Core Files
|
|
41
|
+
- **`CLAUDE.md`** - Main configuration file with language-specific best practices
|
|
42
|
+
- **`.claude/settings.json`** - Automation hooks and Claude Code settings
|
|
43
|
+
- **`.claude/commands/`** - Custom commands for common development tasks
|
|
44
|
+
- **`.mcp.json`** - Model Context Protocol server configurations
|
|
45
|
+
|
|
46
|
+
## Supported Languages & Frameworks
|
|
47
|
+
|
|
48
|
+
| Language | Frameworks | Status | Commands | Hooks | MCP |
|
|
49
|
+
|----------|------------|---------|----------|--------|-----|
|
|
50
|
+
| **JavaScript/TypeScript** | React, Vue, Angular, Node.js | ✅ Ready | 7+ | 9+ | 4+ |
|
|
51
|
+
| **Python** | Django, Flask, FastAPI | ✅ Ready | 5+ | 8+ | 4+ |
|
|
52
|
+
| **Common** | Universal | ✅ Ready | 2+ | 1+ | 4+ |
|
|
53
|
+
| **Go** | Gin, Echo, Fiber | 🚧 Coming Soon | - | - | - |
|
|
54
|
+
| **Rust** | Axum, Warp, Actix | 🚧 Coming Soon | - | - | - |
|
|
55
|
+
|
|
56
|
+
## Usage Examples
|
|
57
|
+
|
|
58
|
+
### Interactive Setup (Recommended)
|
|
59
|
+
```bash
|
|
60
|
+
cd my-react-app
|
|
61
|
+
npx claude-code-templates
|
|
62
|
+
# Choose between Analytics Dashboard or Project Setup
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Analytics Dashboard
|
|
66
|
+
```bash
|
|
67
|
+
# Launch real-time analytics dashboard
|
|
68
|
+
npx claude-code-templates --analytics
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Framework-Specific Quick Setup
|
|
72
|
+
```bash
|
|
73
|
+
# React + TypeScript project
|
|
74
|
+
npx claude-code-templates --language javascript-typescript --framework react --yes
|
|
75
|
+
|
|
76
|
+
# Python + Django project
|
|
77
|
+
npx claude-code-templates --language python --framework django --yes
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Analysis Tools
|
|
81
|
+
```bash
|
|
82
|
+
# Analyze existing commands
|
|
83
|
+
npx claude-code-templates --commands-stats
|
|
84
|
+
|
|
85
|
+
# Analyze automation hooks
|
|
86
|
+
npx claude-code-templates --hooks-stats
|
|
87
|
+
|
|
88
|
+
# Analyze MCP server configurations
|
|
89
|
+
npx claude-code-templates --mcps-stats
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Alternative Commands
|
|
93
|
+
All these commands work exactly the same way:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx claude-code-templates # ✅ Recommended (package name)
|
|
97
|
+
npx cct # ⚡ Super short (3 letters)
|
|
98
|
+
npx claude-setup # Setup-style command
|
|
99
|
+
npx create-claude-config # Create-style command
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## CLI Options
|
|
103
|
+
|
|
104
|
+
| Option | Description | Example |
|
|
105
|
+
|--------|-------------|---------|
|
|
106
|
+
| `-l, --language` | Specify programming language | `--language python` |
|
|
107
|
+
| `-f, --framework` | Specify framework | `--framework react` |
|
|
108
|
+
| `-d, --directory` | Target directory | `--directory /path/to/project` |
|
|
109
|
+
| `-y, --yes` | Skip prompts and use defaults | `--yes` |
|
|
110
|
+
| `--dry-run` | Show what would be installed | `--dry-run` |
|
|
111
|
+
| `--analytics` | Launch real-time analytics dashboard | `--analytics` |
|
|
112
|
+
| `--commands-stats` | Analyze existing commands | `--commands-stats` |
|
|
113
|
+
| `--hooks-stats` | Analyze automation hooks | `--hooks-stats` |
|
|
114
|
+
| `--mcps-stats` | Analyze MCP server configurations | `--mcps-stats` |
|
|
115
|
+
| `--help` | Show help information | `--help` |
|
|
116
|
+
|
|
117
|
+
## 🏗️ Modular Architecture
|
|
118
|
+
|
|
119
|
+
The analytics dashboard is built with a modern, scalable modular architecture designed for performance and maintainability.
|
|
120
|
+
|
|
121
|
+
### Backend Architecture
|
|
122
|
+
|
|
123
|
+
#### Core Modules
|
|
124
|
+
- **`StateCalculator`** - Advanced conversation state detection with real-time analysis
|
|
125
|
+
- **`ProcessDetector`** - Running process detection and conversation linking
|
|
126
|
+
- **`ConversationAnalyzer`** - Message parsing, token counting, and conversation analysis
|
|
127
|
+
- **`FileWatcher`** - Real-time file system monitoring with efficient change detection
|
|
128
|
+
- **`DataCache`** - Multi-level caching system with smart invalidation strategies
|
|
129
|
+
|
|
130
|
+
#### Data Layer
|
|
131
|
+
- **`DataCache`** - Intelligent caching with file content, parsed data, and computation result caching
|
|
132
|
+
- **Performance Monitoring** - Request tracking, memory monitoring, and system health metrics
|
|
133
|
+
|
|
134
|
+
#### Notification System
|
|
135
|
+
- **`WebSocketServer`** - Real-time WebSocket communication with client management
|
|
136
|
+
- **`NotificationManager`** - Event-driven notification system with subscription management
|
|
137
|
+
- **Real-time Updates** - Live conversation state changes and data refresh notifications
|
|
138
|
+
|
|
139
|
+
#### Performance & Monitoring
|
|
140
|
+
- **`PerformanceMonitor`** - Comprehensive performance tracking and system health monitoring
|
|
141
|
+
- **Express Middleware** - Request timing, error tracking, and API performance metrics
|
|
142
|
+
- **WebSocket Monitoring** - Connection tracking, message metrics, and client health monitoring
|
|
143
|
+
|
|
144
|
+
### Frontend Architecture
|
|
145
|
+
|
|
146
|
+
#### Modular Components
|
|
147
|
+
- **`Dashboard`** - Main orchestration component with state management integration
|
|
148
|
+
- **`ConversationTable`** - Interactive conversation display with real-time status updates
|
|
149
|
+
- **`Charts`** - Dynamic data visualization with Chart.js integration
|
|
150
|
+
- **`StateService`** - Reactive state management with subscriber patterns
|
|
151
|
+
- **`DataService`** - API communication with intelligent caching and real-time integration
|
|
152
|
+
- **`WebSocketService`** - Real-time communication with automatic reconnection
|
|
153
|
+
|
|
154
|
+
#### Real-time Features
|
|
155
|
+
- **Live State Detection** - Real-time conversation status: "Claude working...", "User typing...", "Awaiting input..."
|
|
156
|
+
- **Auto-refresh** - Smart polling with WebSocket fallback for seamless data updates
|
|
157
|
+
- **Browser Notifications** - Desktop notifications for important state changes
|
|
158
|
+
- **Responsive Design** - Mobile-friendly interface with real-time data synchronization
|
|
159
|
+
|
|
160
|
+
### Performance Optimizations
|
|
161
|
+
|
|
162
|
+
#### Caching Strategy
|
|
163
|
+
- **File Content Cache** - Reduces disk I/O with timestamp-based invalidation
|
|
164
|
+
- **Parsed Data Cache** - Stores analyzed conversation data with dependency tracking
|
|
165
|
+
- **API Response Cache** - Client-side caching with TTL and smart refresh
|
|
166
|
+
- **Computation Cache** - Caches expensive calculations with automatic invalidation
|
|
167
|
+
|
|
168
|
+
#### Real-time Efficiency
|
|
169
|
+
- **WebSocket Integration** - Eliminates polling overhead for live updates
|
|
170
|
+
- **Smart Refresh** - Only updates changed data with differential loading
|
|
171
|
+
- **Process Detection** - Efficient system process monitoring without performance impact
|
|
172
|
+
- **Memory Management** - Automatic cleanup of old metrics and cached data
|
|
173
|
+
|
|
174
|
+
### Testing Framework
|
|
175
|
+
|
|
176
|
+
#### Comprehensive Test Suite
|
|
177
|
+
- **Unit Tests** - Individual module testing with 80%+ coverage requirement
|
|
178
|
+
- **Integration Tests** - End-to-end system testing with real data scenarios
|
|
179
|
+
- **Performance Tests** - Load testing and performance regression detection
|
|
180
|
+
- **WebSocket Tests** - Real-time communication testing with mock clients
|
|
181
|
+
|
|
182
|
+
#### Test Coverage
|
|
183
|
+
- **Backend Modules**: StateCalculator, DataCache, WebSocketServer, PerformanceMonitor
|
|
184
|
+
- **Frontend Services**: DataService, StateService, WebSocketService
|
|
185
|
+
- **Integration Testing**: Complete analytics system with real conversation data
|
|
186
|
+
- **Performance Testing**: Concurrent operations, memory usage, and response times
|
|
187
|
+
|
|
188
|
+
### Development Benefits
|
|
189
|
+
|
|
190
|
+
#### Scalability
|
|
191
|
+
- **Modular Design** - Easy to extend with new features and integrations
|
|
192
|
+
- **Dependency Injection** - Loose coupling for flexible testing and development
|
|
193
|
+
- **Event-driven Architecture** - Scalable notification system for future enhancements
|
|
194
|
+
|
|
195
|
+
#### Maintainability
|
|
196
|
+
- **Separation of Concerns** - Clear boundaries between data, business logic, and presentation
|
|
197
|
+
- **Comprehensive Logging** - Detailed performance and error tracking for debugging
|
|
198
|
+
- **Type Safety** - Consistent error handling and data validation throughout
|
|
199
|
+
|
|
200
|
+
#### Performance
|
|
201
|
+
- **Multi-level Caching** - Optimized data access patterns with intelligent invalidation
|
|
202
|
+
- **Real-time Updates** - WebSocket-based communication eliminates polling overhead
|
|
203
|
+
- **Memory Optimization** - Automatic cleanup and configurable memory thresholds
|
|
204
|
+
- **Request Monitoring** - Complete visibility into system performance and bottlenecks
|
|
205
|
+
|
|
206
|
+
## Safety Features
|
|
207
|
+
|
|
208
|
+
- **Automatic Backups**: Existing files are backed up before changes
|
|
209
|
+
- **Confirmation Required**: Always asks before making changes (unless `--yes` flag)
|
|
210
|
+
- **Dry Run Mode**: Preview installation with `--dry-run`
|
|
211
|
+
- **Cancel Anytime**: Press Ctrl+C or answer 'No' to cancel
|
|
212
|
+
|
|
213
|
+
## What Makes This Special?
|
|
214
|
+
|
|
215
|
+
### Before (Manual Setup)
|
|
216
|
+
- Hours of configuration research
|
|
217
|
+
- Manual CLAUDE.md creation
|
|
218
|
+
- Framework-specific command setup
|
|
219
|
+
- Automation hook configuration
|
|
220
|
+
- MCP server integration
|
|
221
|
+
|
|
222
|
+
### After (With Templates)
|
|
223
|
+
```bash
|
|
224
|
+
npx claude-code-templates --language javascript-typescript --framework react --yes
|
|
225
|
+
# ✅ Done in 30 seconds!
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 🤝 Contributing
|
|
229
|
+
|
|
230
|
+
We welcome contributions from the open source community!
|
|
231
|
+
|
|
232
|
+
**See our [GitHub repository](https://github.com/davila7/claude-code-templates) for detailed guidelines**
|
|
233
|
+
|
|
234
|
+
## 📄 License
|
|
235
|
+
|
|
236
|
+
This project is licensed under the MIT License.
|
|
237
|
+
|
|
238
|
+
## 📞 Support
|
|
239
|
+
|
|
240
|
+
- **🐛 Issues**: [Report bugs or request features](https://github.com/davila7/claude-code-templates/issues)
|
|
241
|
+
- **💬 Discussions**: [Join community discussions](https://github.com/davila7/claude-code-templates/discussions)
|
|
242
|
+
- **📖 Documentation**: [Claude Code Official Docs](https://docs.anthropic.com/en/docs/claude-code)
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
**⭐ Found this useful? Give us a star on [GitHub](https://github.com/davila7/claude-code-templates) to support the project!**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-templates",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,16 +15,25 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"start": "node bin/create-claude-config.js",
|
|
18
|
-
"test": "
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:watch": "jest --watch",
|
|
20
|
+
"test:coverage": "jest --coverage",
|
|
21
|
+
"test:unit": "jest tests/unit",
|
|
22
|
+
"test:integration": "jest tests/integration",
|
|
23
|
+
"test:e2e": "jest tests/e2e",
|
|
24
|
+
"test:analytics": "jest --testPathPattern=analytics",
|
|
25
|
+
"test:commands": "./test-commands.sh",
|
|
19
26
|
"test:detailed": "./test-detailed.sh",
|
|
20
27
|
"test:react": "make test-react",
|
|
21
28
|
"test:vue": "make test-vue",
|
|
22
29
|
"test:node": "make test-node",
|
|
23
|
-
"test:all": "make test",
|
|
30
|
+
"test:all": "npm run test:coverage && make test",
|
|
24
31
|
"dev:link": "npm link",
|
|
25
32
|
"dev:unlink": "npm unlink -g claude-code-templates",
|
|
26
|
-
"pretest": "npm run dev:link",
|
|
27
|
-
"prepublishOnly": "echo 'Skipping tests for
|
|
33
|
+
"pretest:commands": "npm run dev:link",
|
|
34
|
+
"prepublishOnly": "echo 'Skipping tests for emergency hotfix'",
|
|
35
|
+
"analytics:start": "node src/analytics.js",
|
|
36
|
+
"analytics:test": "npm run test:analytics"
|
|
28
37
|
},
|
|
29
38
|
"keywords": [
|
|
30
39
|
"claude",
|
|
@@ -52,15 +61,16 @@
|
|
|
52
61
|
"author": "Claude Code Templates",
|
|
53
62
|
"license": "MIT",
|
|
54
63
|
"dependencies": {
|
|
55
|
-
"
|
|
64
|
+
"boxen": "^5.1.2",
|
|
56
65
|
"chalk": "^4.1.2",
|
|
57
|
-
"
|
|
66
|
+
"chokidar": "^3.5.3",
|
|
58
67
|
"commander": "^11.1.0",
|
|
59
|
-
"ora": "^5.4.1",
|
|
60
|
-
"boxen": "^5.1.2",
|
|
61
68
|
"express": "^4.18.2",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
69
|
+
"fs-extra": "^11.1.1",
|
|
70
|
+
"inquirer": "^8.2.6",
|
|
71
|
+
"open": "^8.4.2",
|
|
72
|
+
"ora": "^5.4.1",
|
|
73
|
+
"ws": "^8.18.3"
|
|
64
74
|
},
|
|
65
75
|
"engines": {
|
|
66
76
|
"node": ">=14.0.0"
|
|
@@ -78,5 +88,9 @@
|
|
|
78
88
|
"src/",
|
|
79
89
|
"templates/",
|
|
80
90
|
"README.md"
|
|
81
|
-
]
|
|
91
|
+
],
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"jest": "^30.0.4",
|
|
94
|
+
"jest-watch-typeahead": "^2.2.2"
|
|
95
|
+
}
|
|
82
96
|
}
|