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.
Files changed (70) hide show
  1. package/bin/create-claude-config.js +1 -0
  2. package/package.json +1 -2
  3. package/src/file-operations.js +239 -36
  4. package/src/index.js +347 -9
  5. package/templates/common/.claude/commands/git-workflow.md +0 -239
  6. package/templates/common/.claude/commands/project-setup.md +0 -316
  7. package/templates/common/.mcp.json +0 -41
  8. package/templates/common/CLAUDE.md +0 -109
  9. package/templates/common/README.md +0 -96
  10. package/templates/go/.mcp.json +0 -78
  11. package/templates/go/README.md +0 -25
  12. package/templates/javascript-typescript/.claude/commands/api-endpoint.md +0 -51
  13. package/templates/javascript-typescript/.claude/commands/debug.md +0 -52
  14. package/templates/javascript-typescript/.claude/commands/lint.md +0 -48
  15. package/templates/javascript-typescript/.claude/commands/npm-scripts.md +0 -48
  16. package/templates/javascript-typescript/.claude/commands/refactor.md +0 -55
  17. package/templates/javascript-typescript/.claude/commands/test.md +0 -61
  18. package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +0 -51
  19. package/templates/javascript-typescript/.claude/settings.json +0 -142
  20. package/templates/javascript-typescript/.mcp.json +0 -80
  21. package/templates/javascript-typescript/CLAUDE.md +0 -185
  22. package/templates/javascript-typescript/README.md +0 -259
  23. package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +0 -63
  24. package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +0 -62
  25. package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +0 -46
  26. package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +0 -56
  27. package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -61
  28. package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -57
  29. package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -102
  30. package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -29
  31. package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -44
  32. package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +0 -45
  33. package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -81
  34. package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +0 -530
  35. package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +0 -295
  36. package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +0 -46
  37. package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +0 -51
  38. package/templates/python/.claude/commands/lint.md +0 -111
  39. package/templates/python/.claude/commands/test.md +0 -73
  40. package/templates/python/.claude/settings.json +0 -153
  41. package/templates/python/.mcp.json +0 -78
  42. package/templates/python/CLAUDE.md +0 -276
  43. package/templates/python/examples/django-app/.claude/commands/admin.md +0 -264
  44. package/templates/python/examples/django-app/.claude/commands/django-model.md +0 -124
  45. package/templates/python/examples/django-app/.claude/commands/views.md +0 -222
  46. package/templates/python/examples/django-app/CLAUDE.md +0 -313
  47. package/templates/python/examples/django-app/agents/django-api-security.md +0 -642
  48. package/templates/python/examples/django-app/agents/django-database-optimization.md +0 -752
  49. package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +0 -513
  50. package/templates/python/examples/fastapi-app/.claude/commands/auth.md +0 -775
  51. package/templates/python/examples/fastapi-app/.claude/commands/database.md +0 -657
  52. package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +0 -160
  53. package/templates/python/examples/fastapi-app/.claude/commands/testing.md +0 -927
  54. package/templates/python/examples/fastapi-app/CLAUDE.md +0 -229
  55. package/templates/python/examples/flask-app/.claude/commands/app-factory.md +0 -384
  56. package/templates/python/examples/flask-app/.claude/commands/blueprint.md +0 -243
  57. package/templates/python/examples/flask-app/.claude/commands/database.md +0 -410
  58. package/templates/python/examples/flask-app/.claude/commands/deployment.md +0 -620
  59. package/templates/python/examples/flask-app/.claude/commands/flask-route.md +0 -217
  60. package/templates/python/examples/flask-app/.claude/commands/testing.md +0 -559
  61. package/templates/python/examples/flask-app/CLAUDE.md +0 -391
  62. package/templates/ruby/.claude/commands/model.md +0 -360
  63. package/templates/ruby/.claude/commands/test.md +0 -480
  64. package/templates/ruby/.claude/settings.json +0 -146
  65. package/templates/ruby/.mcp.json +0 -83
  66. package/templates/ruby/CLAUDE.md +0 -284
  67. package/templates/ruby/examples/rails-app/.claude/commands/authentication.md +0 -490
  68. package/templates/ruby/examples/rails-app/CLAUDE.md +0 -376
  69. package/templates/rust/.mcp.json +0 -78
  70. package/templates/rust/README.md +0 -26
@@ -1,61 +0,0 @@
1
- # Express Middleware
2
-
3
- Create Express middleware for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create or optimize Express middleware based on the requirements:
8
-
9
- 1. **Analyze existing middleware**: Check current middleware patterns, naming conventions, and file organization
10
- 2. **Examine Express setup**: Review app configuration, middleware stack order, and TypeScript usage
11
- 3. **Identify middleware type**: Determine the middleware category:
12
- - Authentication/Authorization (JWT, sessions, role-based)
13
- - Validation (request body, params, query validation)
14
- - Logging (request/response logging, audit trails)
15
- - Error handling (global error handlers, custom errors)
16
- - Security (CORS, rate limiting, helmet)
17
- - Utility (parsing, compression, static files)
18
- 4. **Check dependencies**: Review existing middleware dependencies to avoid duplication
19
- 5. **Implement middleware**: Create middleware with proper TypeScript types and error handling
20
- 6. **Test middleware**: Write unit and integration tests following project patterns
21
- 7. **Update middleware stack**: Integrate middleware into Express app configuration
22
- 8. **Add documentation**: Include JSDoc comments and usage examples
23
-
24
- ## Implementation Requirements
25
-
26
- - Follow project's TypeScript conventions and interfaces
27
- - Use existing error handling patterns and response formats
28
- - Include proper request/response typing with custom interfaces
29
- - Add comprehensive error handling and logging
30
- - Consider middleware execution order and dependencies
31
- - Implement proper async/await patterns for async middleware
32
- - Follow project's folder structure for middleware files
33
-
34
- ## Middleware Patterns to Consider
35
-
36
- Based on the request:
37
- - **Authentication**: JWT verification, session management, API key validation
38
- - **Authorization**: Role-based access control, permission checking
39
- - **Validation**: Schema validation with Joi/Zod, sanitization
40
- - **Logging**: Request logging, performance monitoring, audit trails
41
- - **Error Handling**: Global error handlers, custom error classes
42
- - **Security**: CORS configuration, rate limiting, input sanitization
43
- - **Utility**: Request parsing, response formatting, caching
44
-
45
- ## Integration Considerations
46
-
47
- - **Middleware order**: Ensure proper execution sequence in Express app
48
- - **Error propagation**: Handle errors correctly with next() function
49
- - **Request enhancement**: Add properties to request object with proper typing
50
- - **Response modification**: Modify response objects while maintaining type safety
51
- - **Performance**: Consider middleware performance impact on request processing
52
-
53
- ## Important Notes
54
-
55
- - ALWAYS examine existing middleware first to understand project patterns
56
- - Use the same error handling and response format as existing middleware
57
- - Follow project's folder structure for middleware (usually /middleware)
58
- - Don't install new dependencies without asking
59
- - Consider middleware performance and request processing impact
60
- - Add proper TypeScript types for enhanced request/response objects
61
- - Test middleware in isolation and integration contexts
@@ -1,57 +0,0 @@
1
- # Route Creator
2
-
3
- Create API routes for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create or optimize API routes based on the requirements:
8
-
9
- 1. **Analyze project structure**: Check existing route patterns, folder organization, and framework setup
10
- 2. **Examine framework**: Identify if using Express, Fastify, NestJS, or other Node.js framework
11
- 3. **Review existing routes**: Understand current routing patterns, validation, and error handling
12
- 4. **Check authentication**: Review existing auth middleware and protection patterns
13
- 5. **Define route structure**: Determine HTTP methods, path parameters, and request/response schemas
14
- 6. **Implement routes**: Create route handlers with proper validation and error handling
15
- 7. **Add middleware**: Include authentication, validation, and logging middleware as needed
16
- 8. **Create tests**: Write route tests following project testing patterns
17
- 9. **Update route registration**: Integrate new routes into main router configuration
18
-
19
- ## Implementation Requirements
20
-
21
- - Follow project's routing architecture and naming conventions
22
- - Use existing validation libraries (Joi, Zod, class-validator, etc.)
23
- - Include proper TypeScript types for request/response objects
24
- - Add comprehensive error handling with appropriate HTTP status codes
25
- - Implement proper authentication/authorization if required
26
- - Follow RESTful conventions unless project uses different patterns
27
- - Add proper logging and monitoring integration
28
-
29
- ## Route Patterns to Consider
30
-
31
- Based on the request:
32
- - **CRUD operations**: Create, Read, Update, Delete for resources
33
- - **RESTful endpoints**: GET, POST, PUT, PATCH, DELETE with proper semantics
34
- - **Nested resources**: Parent/child resource relationships
35
- - **Batch operations**: Bulk create, update, delete operations
36
- - **Search/filtering**: Query parameters for filtering and pagination
37
- - **File uploads**: Multipart form handling for file operations
38
- - **Webhook endpoints**: External service integration points
39
-
40
- ## Framework-Specific Implementation
41
-
42
- Adapt to your project's framework:
43
- - **Express**: Router instances, middleware chains, route handlers
44
- - **Fastify**: Route plugins, schema validation, hooks
45
- - **NestJS**: Controllers, decorators, DTOs, guards, interceptors
46
- - **Koa**: Router middleware, context handling
47
- - **Next.js API**: API route handlers with proper HTTP methods
48
-
49
- ## Important Notes
50
-
51
- - ALWAYS examine existing routes first to understand project patterns
52
- - Use the same validation and error handling patterns as existing routes
53
- - Follow project's folder structure for routes (usually /routes or /controllers)
54
- - Don't install new dependencies without asking
55
- - Consider route performance and database query optimization
56
- - Add proper OpenAPI/Swagger documentation if project uses it
57
- - Include rate limiting for public endpoints where appropriate
@@ -1,102 +0,0 @@
1
- # CLAUDE.md - Node.js API
2
-
3
- This file provides guidance to Claude Code when working with Node.js API applications using TypeScript.
4
-
5
- ## Project Type
6
-
7
- This is a Node.js API application with TypeScript and Express.js support.
8
-
9
- ## Development Commands
10
-
11
- ### API Development
12
- - **`/route`** - Create API routes and endpoints
13
- - **`/middleware`** - Create and manage Express middleware
14
- - **`/api-endpoint`** - Generate complete API endpoints
15
- - **`/database`** - Set up database operations and models
16
-
17
- ### Testing and Quality
18
- - **`/test`** - Run tests and create test files
19
- - **`/lint`** - Run linting and fix code style issues
20
- - **`/typescript-migrate`** - Migrate JavaScript files to TypeScript
21
-
22
- ### Development Workflow
23
- - **`/npm-scripts`** - Run npm scripts and package management
24
- - **`/debug`** - Debug Node.js applications
25
- - **`/refactor`** - Refactor and optimize code
26
-
27
- ## Framework-Specific Guidelines
28
-
29
- ### Express.js Best Practices
30
- - Use middleware for cross-cutting concerns
31
- - Implement proper error handling
32
- - Follow RESTful API design principles
33
- - Use proper HTTP status codes
34
-
35
- ### Database Integration
36
- - Use TypeORM, Prisma, or Mongoose for database operations
37
- - Implement proper connection pooling
38
- - Use migrations for database schema changes
39
- - Follow repository pattern for data access
40
-
41
- ### Security Considerations
42
- - Implement authentication and authorization
43
- - Use HTTPS in production
44
- - Validate and sanitize input data
45
- - Implement rate limiting and CORS
46
-
47
- ### Error Handling
48
- - Use centralized error handling middleware
49
- - Implement proper logging
50
- - Return consistent error responses
51
- - Handle async errors properly
52
-
53
- ## TypeScript Configuration
54
-
55
- The project uses strict TypeScript configuration:
56
- - Strict type checking enabled
57
- - Proper interface definitions for requests/responses
58
- - Generic type support for database models
59
- - Integration with Express types
60
-
61
- ## API Design Patterns
62
-
63
- ### RESTful Routes
64
- ```
65
- GET /api/users - Get all users
66
- GET /api/users/:id - Get user by ID
67
- POST /api/users - Create new user
68
- PUT /api/users/:id - Update user
69
- DELETE /api/users/:id - Delete user
70
- ```
71
-
72
- ### Request/Response Structure
73
- - Use consistent JSON response format
74
- - Implement proper status codes
75
- - Include metadata in responses
76
- - Handle pagination properly
77
-
78
- ## Testing Strategy
79
-
80
- - Unit tests with Jest
81
- - Integration tests for API endpoints
82
- - Database testing with test databases
83
- - Load testing for performance validation
84
-
85
- ## File Naming Conventions
86
-
87
- - Routes: `routeName.routes.ts` (e.g., `user.routes.ts`)
88
- - Controllers: `ControllerName.controller.ts`
89
- - Models: `ModelName.model.ts`
90
- - Middleware: `middlewareName.middleware.ts`
91
- - Services: `ServiceName.service.ts`
92
- - Tests: `fileName.test.ts`
93
-
94
- ## Recommended Libraries
95
-
96
- - **Framework**: Express.js, Fastify, Koa.js
97
- - **Database**: Prisma, TypeORM, Mongoose
98
- - **Authentication**: Passport.js, JWT, Auth0
99
- - **Validation**: Joi, Yup, Zod
100
- - **Testing**: Jest, Supertest, Artillery
101
- - **Documentation**: Swagger/OpenAPI, Postman
102
- - **Monitoring**: Winston, Morgan, Prometheus
@@ -1,29 +0,0 @@
1
- # React Component Generator
2
-
3
- Create a React component named $ARGUMENTS following project conventions.
4
-
5
- ## Steps
6
-
7
- 1. **Analyze project structure**: Check existing components to understand file organization, naming conventions, and patterns
8
- 2. **Examine styling approach**: Identify CSS/SCSS modules, styled-components, Tailwind, or other styling methods used
9
- 3. **Review testing patterns**: Check existing test files to understand testing framework and conventions
10
- 4. **Create component structure**: Generate appropriate files (component, styles, tests, index)
11
- 5. **Implement component**: Write TypeScript/JavaScript with proper props interface and logic
12
- 6. **Add tests**: Write comprehensive tests following project patterns
13
- 7. **Verify integration**: Ensure component works with existing project setup
14
-
15
- ## Requirements
16
-
17
- - Follow existing project file structure and naming conventions
18
- - Use TypeScript if project uses it
19
- - Include proper accessibility attributes
20
- - Add responsive design considerations
21
- - Write tests that match project testing patterns
22
- - Include usage examples in component documentation
23
-
24
- ## Important Notes
25
-
26
- - ALWAYS examine existing components first to understand project patterns
27
- - Use the same styling approach as the rest of the project
28
- - Follow the project's TypeScript conventions for props and interfaces
29
- - Don't install new dependencies without asking first
@@ -1,44 +0,0 @@
1
- # React Hooks
2
-
3
- Create or optimize React hooks for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Analyze the request and create appropriate React hooks:
8
-
9
- 1. **Examine existing hooks**: Check project for existing custom hooks patterns and conventions
10
- 2. **Identify hook type**: Determine if creating new custom hook, optimizing existing hook, or implementing specific hook pattern
11
- 3. **Check TypeScript usage**: Verify if project uses TypeScript and follow typing conventions
12
- 4. **Implement hook**: Create hook with proper:
13
- - Naming convention (use prefix)
14
- - TypeScript types and interfaces
15
- - Proper dependency arrays
16
- - Error handling
17
- - Performance optimizations
18
- 5. **Add tests**: Create comprehensive unit tests using project's testing framework
19
- 6. **Add documentation**: Include JSDoc comments and usage examples
20
-
21
- ## Common Hook Patterns
22
-
23
- When creating hooks, consider these patterns based on the request:
24
- - **Data fetching**: API calls, loading states, error handling
25
- - **State management**: Local state, derived state, state persistence
26
- - **Side effects**: Event listeners, timers, subscriptions
27
- - **Context consumption**: Theme, auth, app state
28
- - **Form handling**: Input management, validation, submission
29
- - **Performance**: Memoization, debouncing, throttling
30
-
31
- ## Requirements
32
-
33
- - Follow existing project hook conventions
34
- - Use TypeScript if project uses it
35
- - Include proper cleanup in useEffect
36
- - Add error boundaries where appropriate
37
- - Write tests that cover all hook functionality
38
- - IMPORTANT: Always check existing hooks first to understand project patterns
39
-
40
- ## Notes
41
-
42
- - Ask for clarification if the hook requirements are ambiguous
43
- - Suggest optimizations for existing hooks if relevant
44
- - Consider accessibility implications for UI-related hooks
@@ -1,45 +0,0 @@
1
- # React State Management
2
-
3
- Implement state management solution for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Set up or optimize state management based on the requirements:
8
-
9
- 1. **Analyze current setup**: Check existing state management approach and project structure
10
- 2. **Determine solution**: Based on requirements, choose appropriate state management:
11
- - Context API for simple, localized state
12
- - Redux Toolkit for complex, global state
13
- - Zustand for lightweight global state
14
- - Custom hooks for component-level state
15
- 3. **Examine dependencies**: Check package.json for existing state management libraries
16
- 4. **Implement solution**: Create store, providers, and hooks with proper TypeScript types
17
- 5. **Set up middleware**: Add devtools, persistence, or other middleware as needed
18
- 6. **Create typed hooks**: Generate properly typed selectors and dispatch hooks
19
- 7. **Add tests**: Write unit tests for state logic and reducers
20
- 8. **Update providers**: Integrate with app's provider hierarchy
21
-
22
- ## Implementation Requirements
23
-
24
- - Follow project's TypeScript conventions
25
- - Use existing state management patterns if present
26
- - Create proper type definitions for state shape
27
- - Include error handling and loading states
28
- - Add proper debugging setup (devtools)
29
- - Consider performance optimizations (selectors, memoization)
30
-
31
- ## State Management Selection Guide
32
-
33
- Choose based on complexity:
34
- - **Simple state**: React hooks + Context API
35
- - **Medium complexity**: Zustand or custom hooks
36
- - **Complex state**: Redux Toolkit with RTK Query
37
- - **Form state**: React Hook Form or Formik
38
-
39
- ## Important Notes
40
-
41
- - ALWAYS check existing state management first
42
- - Don't install new dependencies without asking
43
- - Follow project's folder structure for state files
44
- - Consider server state vs client state separation
45
- - Add proper TypeScript types for all state interfaces
@@ -1,81 +0,0 @@
1
- # CLAUDE.md - React Application
2
-
3
- This file provides guidance to Claude Code when working with React applications using TypeScript.
4
-
5
- ## Project Type
6
-
7
- This is a React application with TypeScript support.
8
-
9
- ## Development Commands
10
-
11
- ### Component Development
12
- - **`/component`** - Create React components with TypeScript
13
- - **`/hooks`** - Create and manage React hooks
14
- - **`/state-management`** - Implement state management solutions
15
-
16
- ### Testing and Quality
17
- - **`/test`** - Run tests and create test files
18
- - **`/lint`** - Run linting and fix code style issues
19
- - **`/typescript-migrate`** - Migrate JavaScript files to TypeScript
20
-
21
- ### Development Workflow
22
- - **`/npm-scripts`** - Run npm scripts and package management
23
- - **`/debug`** - Debug React applications
24
- - **`/refactor`** - Refactor and optimize code
25
-
26
- ## Framework-Specific Guidelines
27
-
28
- ### React Best Practices
29
- - Use functional components with hooks
30
- - Implement proper TypeScript typing for props and state
31
- - Follow React performance optimization patterns
32
- - Use proper component composition patterns
33
-
34
- ### State Management
35
- - Use useState for local component state
36
- - Consider useContext for shared state
37
- - Implement Redux Toolkit for complex state management
38
- - Use Zustand for lightweight state management
39
-
40
- ### Component Architecture
41
- - Keep components small and focused
42
- - Use custom hooks for reusable logic
43
- - Implement proper prop drilling prevention
44
- - Follow component testing best practices
45
-
46
- ### Performance Optimization
47
- - Use React.memo for expensive components
48
- - Implement proper dependency arrays in useEffect
49
- - Use useMemo and useCallback judiciously
50
- - Optimize bundle size with code splitting
51
-
52
- ## TypeScript Configuration
53
-
54
- The project uses strict TypeScript configuration:
55
- - Strict type checking enabled
56
- - Proper interface definitions for props
57
- - Generic type support for reusable components
58
- - Integration with React's built-in types
59
-
60
- ## Testing Strategy
61
-
62
- - Unit tests with Jest and React Testing Library
63
- - Component testing with proper mocking
64
- - Integration tests for complex workflows
65
- - E2E tests for critical user journeys
66
-
67
- ## File Naming Conventions
68
-
69
- - Components: `PascalCase.tsx` (e.g., `UserCard.tsx`)
70
- - Hooks: `use` prefix in `camelCase` (e.g., `useApiData.ts`)
71
- - Types: `types.ts` or inline interfaces
72
- - Tests: `ComponentName.test.tsx`
73
-
74
- ## Recommended Libraries
75
-
76
- - **State Management**: Redux Toolkit, Zustand, Context API
77
- - **Styling**: Styled-components, Emotion, Tailwind CSS
78
- - **Forms**: React Hook Form, Formik
79
- - **Routing**: React Router v6
80
- - **HTTP Client**: Axios, SWR, React Query
81
- - **Testing**: Jest, React Testing Library, Cypress