claude-code-templates 1.16.1 → 1.17.1

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 (101) hide show
  1. package/README.md +7 -7
  2. package/bin/create-claude-config.js +17 -8
  3. package/package.json +2 -3
  4. package/src/analytics/core/AgentAnalyzer.js +17 -3
  5. package/src/analytics/core/ProcessDetector.js +23 -7
  6. package/src/analytics/core/StateCalculator.js +102 -33
  7. package/src/analytics/data/DataCache.js +7 -7
  8. package/src/analytics-web/chats_mobile.html +2590 -0
  9. package/src/analytics-web/components/App.js +10 -10
  10. package/src/analytics-web/components/SessionTimer.js +1 -1
  11. package/src/analytics-web/components/Sidebar.js +5 -14
  12. package/src/analytics-web/index.html +932 -78
  13. package/src/analytics.js +263 -5
  14. package/src/chats-mobile.js +682 -0
  15. package/src/claude-api-proxy.js +460 -0
  16. package/src/file-operations.js +239 -36
  17. package/src/health-check.js +310 -0
  18. package/src/index.js +1256 -36
  19. package/src/tracking-service.js +31 -34
  20. package/components/agents/api-security-audit.md +0 -92
  21. package/components/agents/database-optimization.md +0 -94
  22. package/components/agents/react-performance-optimization.md +0 -64
  23. package/components/commands/check-file.md +0 -53
  24. package/components/commands/generate-tests.md +0 -68
  25. package/components/mcps/deepgraph-nextjs.json +0 -12
  26. package/components/mcps/deepgraph-react.json +0 -12
  27. package/components/mcps/deepgraph-typescript.json +0 -12
  28. package/components/mcps/deepgraph-vue.json +0 -12
  29. package/components/mcps/filesystem-access.json +0 -12
  30. package/components/mcps/github-integration.json +0 -11
  31. package/components/mcps/memory-integration.json +0 -8
  32. package/components/mcps/mysql-integration.json +0 -11
  33. package/components/mcps/postgresql-integration.json +0 -11
  34. package/components/mcps/web-fetch.json +0 -8
  35. package/src/analytics-web/components/AgentsPage.js +0 -4761
  36. package/templates/common/.claude/commands/git-workflow.md +0 -239
  37. package/templates/common/.claude/commands/project-setup.md +0 -316
  38. package/templates/common/.mcp.json +0 -41
  39. package/templates/common/CLAUDE.md +0 -109
  40. package/templates/common/README.md +0 -96
  41. package/templates/go/.mcp.json +0 -78
  42. package/templates/go/README.md +0 -25
  43. package/templates/javascript-typescript/.claude/commands/api-endpoint.md +0 -51
  44. package/templates/javascript-typescript/.claude/commands/debug.md +0 -52
  45. package/templates/javascript-typescript/.claude/commands/lint.md +0 -48
  46. package/templates/javascript-typescript/.claude/commands/npm-scripts.md +0 -48
  47. package/templates/javascript-typescript/.claude/commands/refactor.md +0 -55
  48. package/templates/javascript-typescript/.claude/commands/test.md +0 -61
  49. package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +0 -51
  50. package/templates/javascript-typescript/.claude/settings.json +0 -142
  51. package/templates/javascript-typescript/.mcp.json +0 -80
  52. package/templates/javascript-typescript/CLAUDE.md +0 -185
  53. package/templates/javascript-typescript/README.md +0 -259
  54. package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +0 -63
  55. package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +0 -62
  56. package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +0 -46
  57. package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +0 -56
  58. package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -61
  59. package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -57
  60. package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -102
  61. package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -29
  62. package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -44
  63. package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +0 -45
  64. package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -81
  65. package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +0 -530
  66. package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +0 -295
  67. package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +0 -46
  68. package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +0 -51
  69. package/templates/python/.claude/commands/lint.md +0 -111
  70. package/templates/python/.claude/commands/test.md +0 -73
  71. package/templates/python/.claude/settings.json +0 -153
  72. package/templates/python/.mcp.json +0 -78
  73. package/templates/python/CLAUDE.md +0 -276
  74. package/templates/python/examples/django-app/.claude/commands/admin.md +0 -264
  75. package/templates/python/examples/django-app/.claude/commands/django-model.md +0 -124
  76. package/templates/python/examples/django-app/.claude/commands/views.md +0 -222
  77. package/templates/python/examples/django-app/CLAUDE.md +0 -313
  78. package/templates/python/examples/django-app/agents/django-api-security.md +0 -642
  79. package/templates/python/examples/django-app/agents/django-database-optimization.md +0 -752
  80. package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +0 -513
  81. package/templates/python/examples/fastapi-app/.claude/commands/auth.md +0 -775
  82. package/templates/python/examples/fastapi-app/.claude/commands/database.md +0 -657
  83. package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +0 -160
  84. package/templates/python/examples/fastapi-app/.claude/commands/testing.md +0 -927
  85. package/templates/python/examples/fastapi-app/CLAUDE.md +0 -229
  86. package/templates/python/examples/flask-app/.claude/commands/app-factory.md +0 -384
  87. package/templates/python/examples/flask-app/.claude/commands/blueprint.md +0 -243
  88. package/templates/python/examples/flask-app/.claude/commands/database.md +0 -410
  89. package/templates/python/examples/flask-app/.claude/commands/deployment.md +0 -620
  90. package/templates/python/examples/flask-app/.claude/commands/flask-route.md +0 -217
  91. package/templates/python/examples/flask-app/.claude/commands/testing.md +0 -559
  92. package/templates/python/examples/flask-app/CLAUDE.md +0 -391
  93. package/templates/ruby/.claude/commands/model.md +0 -360
  94. package/templates/ruby/.claude/commands/test.md +0 -480
  95. package/templates/ruby/.claude/settings.json +0 -146
  96. package/templates/ruby/.mcp.json +0 -83
  97. package/templates/ruby/CLAUDE.md +0 -284
  98. package/templates/ruby/examples/rails-app/.claude/commands/authentication.md +0 -490
  99. package/templates/ruby/examples/rails-app/CLAUDE.md +0 -376
  100. package/templates/rust/.mcp.json +0 -78
  101. package/templates/rust/README.md +0 -26
@@ -1,217 +0,0 @@
1
- # Flask Route Generator
2
-
3
- Create Flask routes with proper structure and error handling.
4
-
5
- ## Purpose
6
-
7
- This command helps you quickly create Flask routes with validation, error handling, and best practices.
8
-
9
- ## Usage
10
-
11
- ```
12
- /flask-route
13
- ```
14
-
15
- ## What this command does
16
-
17
- 1. **Creates route functions** with proper decorators
18
- 2. **Adds request validation** and error handling
19
- 3. **Includes JSON responses** and status codes
20
- 4. **Implements authentication** if needed
21
- 5. **Follows Flask conventions** and best practices
22
-
23
- ## Example Output
24
-
25
- ```python
26
- # routes.py or app.py
27
- from flask import Flask, request, jsonify, abort
28
- from flask_sqlalchemy import SQLAlchemy
29
- from werkzeug.exceptions import BadRequest
30
-
31
- app = Flask(__name__)
32
-
33
- @app.route('/users', methods=['GET'])
34
- def get_users():
35
- """Get all users with optional pagination."""
36
- try:
37
- page = request.args.get('page', 1, type=int)
38
- per_page = request.args.get('per_page', 10, type=int)
39
-
40
- users = User.query.paginate(
41
- page=page,
42
- per_page=per_page,
43
- error_out=False
44
- )
45
-
46
- return jsonify({
47
- 'users': [user.to_dict() for user in users.items],
48
- 'total': users.total,
49
- 'pages': users.pages,
50
- 'current_page': page
51
- }), 200
52
-
53
- except Exception as e:
54
- return jsonify({'error': 'Failed to fetch users'}), 500
55
-
56
- @app.route('/users/<int:user_id>', methods=['GET'])
57
- def get_user(user_id):
58
- """Get a specific user by ID."""
59
- try:
60
- user = User.query.get_or_404(user_id)
61
- return jsonify(user.to_dict()), 200
62
-
63
- except Exception as e:
64
- return jsonify({'error': 'User not found'}), 404
65
-
66
- @app.route('/users', methods=['POST'])
67
- def create_user():
68
- """Create a new user."""
69
- try:
70
- data = request.get_json()
71
-
72
- if not data:
73
- return jsonify({'error': 'No data provided'}), 400
74
-
75
- # Validate required fields
76
- required_fields = ['name', 'email']
77
- for field in required_fields:
78
- if field not in data:
79
- return jsonify({'error': f'{field} is required'}), 400
80
-
81
- # Check if email already exists
82
- if User.query.filter_by(email=data['email']).first():
83
- return jsonify({'error': 'Email already exists'}), 409
84
-
85
- # Create new user
86
- user = User(
87
- name=data['name'],
88
- email=data['email'],
89
- phone=data.get('phone'),
90
- address=data.get('address')
91
- )
92
-
93
- db.session.add(user)
94
- db.session.commit()
95
-
96
- return jsonify(user.to_dict()), 201
97
-
98
- except BadRequest:
99
- return jsonify({'error': 'Invalid JSON data'}), 400
100
- except Exception as e:
101
- db.session.rollback()
102
- return jsonify({'error': 'Failed to create user'}), 500
103
-
104
- @app.route('/users/<int:user_id>', methods=['PUT'])
105
- def update_user(user_id):
106
- """Update an existing user."""
107
- try:
108
- user = User.query.get_or_404(user_id)
109
- data = request.get_json()
110
-
111
- if not data:
112
- return jsonify({'error': 'No data provided'}), 400
113
-
114
- # Update fields
115
- if 'name' in data:
116
- user.name = data['name']
117
- if 'email' in data:
118
- # Check if new email already exists
119
- existing_user = User.query.filter_by(email=data['email']).first()
120
- if existing_user and existing_user.id != user_id:
121
- return jsonify({'error': 'Email already exists'}), 409
122
- user.email = data['email']
123
- if 'phone' in data:
124
- user.phone = data['phone']
125
- if 'address' in data:
126
- user.address = data['address']
127
-
128
- db.session.commit()
129
-
130
- return jsonify(user.to_dict()), 200
131
-
132
- except BadRequest:
133
- return jsonify({'error': 'Invalid JSON data'}), 400
134
- except Exception as e:
135
- db.session.rollback()
136
- return jsonify({'error': 'Failed to update user'}), 500
137
-
138
- @app.route('/users/<int:user_id>', methods=['DELETE'])
139
- def delete_user(user_id):
140
- """Delete a user."""
141
- try:
142
- user = User.query.get_or_404(user_id)
143
-
144
- db.session.delete(user)
145
- db.session.commit()
146
-
147
- return jsonify({'message': 'User deleted successfully'}), 200
148
-
149
- except Exception as e:
150
- db.session.rollback()
151
- return jsonify({'error': 'Failed to delete user'}), 500
152
-
153
- # Error handlers
154
- @app.errorhandler(404)
155
- def not_found(error):
156
- return jsonify({'error': 'Resource not found'}), 404
157
-
158
- @app.errorhandler(400)
159
- def bad_request(error):
160
- return jsonify({'error': 'Bad request'}), 400
161
-
162
- @app.errorhandler(500)
163
- def internal_error(error):
164
- return jsonify({'error': 'Internal server error'}), 500
165
- ```
166
-
167
- ## Route Patterns Supported
168
-
169
- ### Basic Routes
170
- ```python
171
- @app.route('/')
172
- @app.route('/users')
173
- @app.route('/users/<int:user_id>')
174
- ```
175
-
176
- ### HTTP Methods
177
- ```python
178
- @app.route('/users', methods=['GET', 'POST'])
179
- @app.route('/users/<int:id>', methods=['GET', 'PUT', 'DELETE'])
180
- ```
181
-
182
- ### URL Parameters
183
- ```python
184
- @app.route('/users/<int:user_id>')
185
- @app.route('/posts/<string:slug>')
186
- @app.route('/files/<path:filename>')
187
- ```
188
-
189
- ## Best Practices Included
190
-
191
- - **Input validation** for all user data
192
- - **Proper HTTP status codes** (200, 201, 400, 404, 500)
193
- - **JSON responses** with consistent structure
194
- - **Error handling** with try/catch blocks
195
- - **Database rollback** on errors
196
- - **RESTful conventions** for URL design
197
- - **Documentation strings** for each route
198
- - **Request data validation** before processing
199
-
200
- ## Common Response Patterns
201
-
202
- ```python
203
- # Success with data
204
- return jsonify({'data': result}), 200
205
-
206
- # Created resource
207
- return jsonify({'data': new_resource, 'id': new_id}), 201
208
-
209
- # Validation error
210
- return jsonify({'error': 'Field is required'}), 400
211
-
212
- # Not found
213
- return jsonify({'error': 'Resource not found'}), 404
214
-
215
- # Server error
216
- return jsonify({'error': 'Internal server error'}), 500
217
- ```