claude-code-templates 1.14.12 → 1.14.14
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/bin/create-claude-config.js +1 -0
- package/package.json +1 -2
- package/src/file-operations.js +239 -36
- package/src/index.js +347 -9
- package/templates/common/.claude/commands/git-workflow.md +0 -239
- package/templates/common/.claude/commands/project-setup.md +0 -316
- package/templates/common/.mcp.json +0 -41
- package/templates/common/CLAUDE.md +0 -109
- package/templates/common/README.md +0 -96
- package/templates/go/.mcp.json +0 -78
- package/templates/go/README.md +0 -25
- package/templates/javascript-typescript/.claude/commands/api-endpoint.md +0 -51
- package/templates/javascript-typescript/.claude/commands/debug.md +0 -52
- package/templates/javascript-typescript/.claude/commands/lint.md +0 -48
- package/templates/javascript-typescript/.claude/commands/npm-scripts.md +0 -48
- package/templates/javascript-typescript/.claude/commands/refactor.md +0 -55
- package/templates/javascript-typescript/.claude/commands/test.md +0 -61
- package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +0 -51
- package/templates/javascript-typescript/.claude/settings.json +0 -142
- package/templates/javascript-typescript/.mcp.json +0 -80
- package/templates/javascript-typescript/CLAUDE.md +0 -185
- package/templates/javascript-typescript/README.md +0 -259
- package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +0 -63
- package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +0 -62
- package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +0 -46
- package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +0 -56
- package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -61
- package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -57
- package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -102
- package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -29
- package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -44
- package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +0 -45
- package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -81
- package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +0 -530
- package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +0 -295
- package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +0 -46
- package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +0 -51
- package/templates/python/.claude/commands/lint.md +0 -111
- package/templates/python/.claude/commands/test.md +0 -73
- package/templates/python/.claude/settings.json +0 -153
- package/templates/python/.mcp.json +0 -78
- package/templates/python/CLAUDE.md +0 -276
- package/templates/python/examples/django-app/.claude/commands/admin.md +0 -264
- package/templates/python/examples/django-app/.claude/commands/django-model.md +0 -124
- package/templates/python/examples/django-app/.claude/commands/views.md +0 -222
- package/templates/python/examples/django-app/CLAUDE.md +0 -313
- package/templates/python/examples/django-app/agents/django-api-security.md +0 -642
- package/templates/python/examples/django-app/agents/django-database-optimization.md +0 -752
- package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +0 -513
- package/templates/python/examples/fastapi-app/.claude/commands/auth.md +0 -775
- package/templates/python/examples/fastapi-app/.claude/commands/database.md +0 -657
- package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +0 -160
- package/templates/python/examples/fastapi-app/.claude/commands/testing.md +0 -927
- package/templates/python/examples/fastapi-app/CLAUDE.md +0 -229
- package/templates/python/examples/flask-app/.claude/commands/app-factory.md +0 -384
- package/templates/python/examples/flask-app/.claude/commands/blueprint.md +0 -243
- package/templates/python/examples/flask-app/.claude/commands/database.md +0 -410
- package/templates/python/examples/flask-app/.claude/commands/deployment.md +0 -620
- package/templates/python/examples/flask-app/.claude/commands/flask-route.md +0 -217
- package/templates/python/examples/flask-app/.claude/commands/testing.md +0 -559
- package/templates/python/examples/flask-app/CLAUDE.md +0 -391
- package/templates/ruby/.claude/commands/model.md +0 -360
- package/templates/ruby/.claude/commands/test.md +0 -480
- package/templates/ruby/.claude/settings.json +0 -146
- package/templates/ruby/.mcp.json +0 -83
- package/templates/ruby/CLAUDE.md +0 -284
- package/templates/ruby/examples/rails-app/.claude/commands/authentication.md +0 -490
- package/templates/ruby/examples/rails-app/CLAUDE.md +0 -376
- package/templates/rust/.mcp.json +0 -78
- package/templates/rust/README.md +0 -26
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
# Django Project Configuration
|
|
2
|
-
|
|
3
|
-
This file provides specific guidance for Django web application development using Claude Code.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
This is a Django web application project optimized for scalable web development with the Django framework. The project follows Django best practices and conventions.
|
|
8
|
-
|
|
9
|
-
## Django-Specific Development Commands
|
|
10
|
-
|
|
11
|
-
### Project Management
|
|
12
|
-
- `django-admin startproject myproject` - Create new Django project
|
|
13
|
-
- `python manage.py startapp myapp` - Create new Django app
|
|
14
|
-
- `python manage.py runserver` - Start development server
|
|
15
|
-
- `python manage.py runserver 0.0.0.0:8000` - Start server accessible from network
|
|
16
|
-
|
|
17
|
-
### Database Management
|
|
18
|
-
- `python manage.py makemigrations` - Create database migrations
|
|
19
|
-
- `python manage.py migrate` - Apply database migrations
|
|
20
|
-
- `python manage.py showmigrations` - Show migration status
|
|
21
|
-
- `python manage.py sqlmigrate app_name migration_name` - Show SQL for migration
|
|
22
|
-
- `python manage.py dbshell` - Open database shell
|
|
23
|
-
|
|
24
|
-
### User Management
|
|
25
|
-
- `python manage.py createsuperuser` - Create admin superuser
|
|
26
|
-
- `python manage.py changepassword username` - Change user password
|
|
27
|
-
- `python manage.py shell` - Open Django shell
|
|
28
|
-
|
|
29
|
-
### Static Files & Media
|
|
30
|
-
- `python manage.py collectstatic` - Collect static files for production
|
|
31
|
-
- `python manage.py findstatic filename` - Find static file location
|
|
32
|
-
|
|
33
|
-
### Testing & Quality
|
|
34
|
-
- `python manage.py test` - Run Django tests
|
|
35
|
-
- `python manage.py test app_name` - Run tests for specific app
|
|
36
|
-
- `python manage.py test --keepdb` - Run tests keeping test database
|
|
37
|
-
- `coverage run --source='.' manage.py test` - Run tests with coverage
|
|
38
|
-
|
|
39
|
-
### Development Tools
|
|
40
|
-
- `python manage.py check` - Check for Django issues
|
|
41
|
-
- `python manage.py validate` - Validate models
|
|
42
|
-
- `python manage.py inspectdb` - Generate models from existing database
|
|
43
|
-
- `python manage.py dumpdata app_name` - Export data
|
|
44
|
-
- `python manage.py loaddata fixture.json` - Import data
|
|
45
|
-
|
|
46
|
-
## Django Project Structure
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
myproject/
|
|
50
|
-
├── manage.py # Django management script
|
|
51
|
-
├── myproject/ # Project configuration
|
|
52
|
-
│ ├── __init__.py
|
|
53
|
-
│ ├── settings/ # Settings modules
|
|
54
|
-
│ │ ├── __init__.py
|
|
55
|
-
│ │ ├── base.py # Base settings
|
|
56
|
-
│ │ ├── development.py # Development settings
|
|
57
|
-
│ │ ├── production.py # Production settings
|
|
58
|
-
│ │ └── testing.py # Testing settings
|
|
59
|
-
│ ├── urls.py # URL configuration
|
|
60
|
-
│ ├── wsgi.py # WSGI configuration
|
|
61
|
-
│ └── asgi.py # ASGI configuration
|
|
62
|
-
├── apps/ # Django applications
|
|
63
|
-
│ ├── users/ # User management app
|
|
64
|
-
│ ├── blog/ # Blog app example
|
|
65
|
-
│ └── api/ # API app
|
|
66
|
-
├── static/ # Static files
|
|
67
|
-
├── media/ # User uploaded files
|
|
68
|
-
├── templates/ # Django templates
|
|
69
|
-
├── requirements/ # Requirements files
|
|
70
|
-
│ ├── base.txt
|
|
71
|
-
│ ├── development.txt
|
|
72
|
-
│ └── production.txt
|
|
73
|
-
└── tests/ # Test files
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Django Settings Configuration
|
|
77
|
-
|
|
78
|
-
### Base Settings (settings/base.py)
|
|
79
|
-
```python
|
|
80
|
-
import os
|
|
81
|
-
from pathlib import Path
|
|
82
|
-
|
|
83
|
-
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
84
|
-
|
|
85
|
-
# Security
|
|
86
|
-
SECRET_KEY = os.environ.get('SECRET_KEY')
|
|
87
|
-
DEBUG = False
|
|
88
|
-
ALLOWED_HOSTS = []
|
|
89
|
-
|
|
90
|
-
# Application definition
|
|
91
|
-
DJANGO_APPS = [
|
|
92
|
-
'django.contrib.admin',
|
|
93
|
-
'django.contrib.auth',
|
|
94
|
-
'django.contrib.contenttypes',
|
|
95
|
-
'django.contrib.sessions',
|
|
96
|
-
'django.contrib.messages',
|
|
97
|
-
'django.contrib.staticfiles',
|
|
98
|
-
]
|
|
99
|
-
|
|
100
|
-
THIRD_PARTY_APPS = [
|
|
101
|
-
'rest_framework',
|
|
102
|
-
'django_extensions',
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
LOCAL_APPS = [
|
|
106
|
-
'apps.users',
|
|
107
|
-
'apps.blog',
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
|
111
|
-
|
|
112
|
-
# Database
|
|
113
|
-
DATABASES = {
|
|
114
|
-
'default': {
|
|
115
|
-
'ENGINE': 'django.db.backends.postgresql',
|
|
116
|
-
'NAME': os.environ.get('DB_NAME'),
|
|
117
|
-
'USER': os.environ.get('DB_USER'),
|
|
118
|
-
'PASSWORD': os.environ.get('DB_PASSWORD'),
|
|
119
|
-
'HOST': os.environ.get('DB_HOST', 'localhost'),
|
|
120
|
-
'PORT': os.environ.get('DB_PORT', '5432'),
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
# Internationalization
|
|
125
|
-
LANGUAGE_CODE = 'en-us'
|
|
126
|
-
TIME_ZONE = 'UTC'
|
|
127
|
-
USE_I18N = True
|
|
128
|
-
USE_TZ = True
|
|
129
|
-
|
|
130
|
-
# Static files
|
|
131
|
-
STATIC_URL = '/static/'
|
|
132
|
-
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
|
133
|
-
STATICFILES_DIRS = [BASE_DIR / 'static']
|
|
134
|
-
|
|
135
|
-
# Media files
|
|
136
|
-
MEDIA_URL = '/media/'
|
|
137
|
-
MEDIA_ROOT = BASE_DIR / 'media'
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Django Best Practices
|
|
141
|
-
|
|
142
|
-
### Models
|
|
143
|
-
- Use descriptive model names (singular)
|
|
144
|
-
- Add `__str__` methods for better admin interface
|
|
145
|
-
- Use `related_name` for foreign keys
|
|
146
|
-
- Implement `get_absolute_url` method
|
|
147
|
-
- Add proper Meta class with ordering
|
|
148
|
-
|
|
149
|
-
### Views
|
|
150
|
-
- Use class-based views for complex logic
|
|
151
|
-
- Implement proper error handling
|
|
152
|
-
- Add pagination for list views
|
|
153
|
-
- Use `select_related` and `prefetch_related` for optimization
|
|
154
|
-
- Implement proper permission checks
|
|
155
|
-
|
|
156
|
-
### URLs
|
|
157
|
-
- Use app namespaces
|
|
158
|
-
- Use descriptive URL names
|
|
159
|
-
- Group related URLs in separate files
|
|
160
|
-
- Use slug fields for SEO-friendly URLs
|
|
161
|
-
|
|
162
|
-
### Templates
|
|
163
|
-
- Extend base templates
|
|
164
|
-
- Use template inheritance effectively
|
|
165
|
-
- Create reusable template tags
|
|
166
|
-
- Implement proper CSRF protection
|
|
167
|
-
- Use Django's built-in template filters
|
|
168
|
-
|
|
169
|
-
### Forms
|
|
170
|
-
- Use Django forms for validation
|
|
171
|
-
- Implement custom form validation
|
|
172
|
-
- Use ModelForms when appropriate
|
|
173
|
-
- Add proper error handling
|
|
174
|
-
- Implement CSRF protection
|
|
175
|
-
|
|
176
|
-
## Security Considerations
|
|
177
|
-
|
|
178
|
-
### Django Security Settings
|
|
179
|
-
```python
|
|
180
|
-
# Security settings for production
|
|
181
|
-
SECURE_BROWSER_XSS_FILTER = True
|
|
182
|
-
SECURE_CONTENT_TYPE_NOSNIFF = True
|
|
183
|
-
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
|
184
|
-
SECURE_HSTS_PRELOAD = True
|
|
185
|
-
SECURE_HSTS_SECONDS = 31536000
|
|
186
|
-
SECURE_REDIRECT_EXEMPT = []
|
|
187
|
-
SECURE_SSL_REDIRECT = True
|
|
188
|
-
SESSION_COOKIE_SECURE = True
|
|
189
|
-
CSRF_COOKIE_SECURE = True
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### User Authentication
|
|
193
|
-
- Use Django's built-in authentication
|
|
194
|
-
- Implement proper password policies
|
|
195
|
-
- Add two-factor authentication if needed
|
|
196
|
-
- Use Django's permission system
|
|
197
|
-
- Implement proper session management
|
|
198
|
-
|
|
199
|
-
## Testing Strategy
|
|
200
|
-
|
|
201
|
-
### Test Organization
|
|
202
|
-
```python
|
|
203
|
-
# tests/test_models.py
|
|
204
|
-
from django.test import TestCase
|
|
205
|
-
from django.contrib.auth import get_user_model
|
|
206
|
-
from apps.blog.models import Post
|
|
207
|
-
|
|
208
|
-
User = get_user_model()
|
|
209
|
-
|
|
210
|
-
class PostModelTest(TestCase):
|
|
211
|
-
def setUp(self):
|
|
212
|
-
self.user = User.objects.create_user(
|
|
213
|
-
username='testuser',
|
|
214
|
-
email='test@example.com',
|
|
215
|
-
password='testpass123'
|
|
216
|
-
)
|
|
217
|
-
|
|
218
|
-
def test_post_creation(self):
|
|
219
|
-
post = Post.objects.create(
|
|
220
|
-
title='Test Post',
|
|
221
|
-
content='Test content',
|
|
222
|
-
author=self.user
|
|
223
|
-
)
|
|
224
|
-
self.assertEqual(post.title, 'Test Post')
|
|
225
|
-
self.assertEqual(str(post), 'Test Post')
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Test Types
|
|
229
|
-
- **Unit tests** for models and utilities
|
|
230
|
-
- **Integration tests** for views and forms
|
|
231
|
-
- **Functional tests** for user workflows
|
|
232
|
-
- **API tests** for REST endpoints
|
|
233
|
-
|
|
234
|
-
## Deployment Considerations
|
|
235
|
-
|
|
236
|
-
### Production Settings
|
|
237
|
-
- Use environment variables for sensitive data
|
|
238
|
-
- Configure proper logging
|
|
239
|
-
- Set up static file serving
|
|
240
|
-
- Configure database connection pooling
|
|
241
|
-
- Implement proper caching strategy
|
|
242
|
-
|
|
243
|
-
### Docker Configuration
|
|
244
|
-
```dockerfile
|
|
245
|
-
FROM python:3.11-slim
|
|
246
|
-
|
|
247
|
-
WORKDIR /app
|
|
248
|
-
|
|
249
|
-
COPY requirements.txt .
|
|
250
|
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
251
|
-
|
|
252
|
-
COPY . .
|
|
253
|
-
|
|
254
|
-
EXPOSE 8000
|
|
255
|
-
|
|
256
|
-
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "myproject.wsgi:application"]
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Performance Optimization
|
|
260
|
-
|
|
261
|
-
### Database Optimization
|
|
262
|
-
- Use `select_related()` for foreign keys
|
|
263
|
-
- Use `prefetch_related()` for many-to-many
|
|
264
|
-
- Add database indexes for frequent queries
|
|
265
|
-
- Implement database connection pooling
|
|
266
|
-
- Use database query optimization tools
|
|
267
|
-
|
|
268
|
-
### Caching Strategy
|
|
269
|
-
- Implement Redis/Memcached for session storage
|
|
270
|
-
- Use template fragment caching
|
|
271
|
-
- Implement view-level caching
|
|
272
|
-
- Add database query caching
|
|
273
|
-
- Use CDN for static files
|
|
274
|
-
|
|
275
|
-
## Common Django Patterns
|
|
276
|
-
|
|
277
|
-
### Custom User Model
|
|
278
|
-
```python
|
|
279
|
-
from django.contrib.auth.models import AbstractUser
|
|
280
|
-
from django.db import models
|
|
281
|
-
|
|
282
|
-
class User(AbstractUser):
|
|
283
|
-
email = models.EmailField(unique=True)
|
|
284
|
-
first_name = models.CharField(max_length=30)
|
|
285
|
-
last_name = models.CharField(max_length=30)
|
|
286
|
-
|
|
287
|
-
USERNAME_FIELD = 'email'
|
|
288
|
-
REQUIRED_FIELDS = ['username', 'first_name', 'last_name']
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
### Custom Managers
|
|
292
|
-
```python
|
|
293
|
-
class PublishedManager(models.Manager):
|
|
294
|
-
def get_queryset(self):
|
|
295
|
-
return super().get_queryset().filter(status='published')
|
|
296
|
-
|
|
297
|
-
class Post(models.Model):
|
|
298
|
-
title = models.CharField(max_length=200)
|
|
299
|
-
status = models.CharField(max_length=20, default='draft')
|
|
300
|
-
|
|
301
|
-
objects = models.Manager() # Default manager
|
|
302
|
-
published = PublishedManager() # Custom manager
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
## Django Extensions & Tools
|
|
306
|
-
|
|
307
|
-
### Useful Third-Party Packages
|
|
308
|
-
- **Django REST Framework** - API development
|
|
309
|
-
- **Celery** - Asynchronous task processing
|
|
310
|
-
- **Django Debug Toolbar** - Development debugging
|
|
311
|
-
- **Django Extensions** - Additional management commands
|
|
312
|
-
- **Pillow** - Image processing
|
|
313
|
-
- **psycopg2-binary** - PostgreSQL adapter
|