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,185 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- This is a JavaScript/TypeScript project optimized for modern web development. The project uses industry-standard tools and follows best practices for scalable application development.
8
-
9
- ## Development Commands
10
-
11
- ### Package Management
12
- - `npm install` or `yarn install` - Install dependencies
13
- - `npm ci` or `yarn install --frozen-lockfile` - Install dependencies for CI/CD
14
- - `npm update` or `yarn upgrade` - Update dependencies
15
-
16
- ### Build Commands
17
- - `npm run build` - Build the project for production
18
- - `npm run dev` or `npm start` - Start development server
19
- - `npm run preview` - Preview production build locally
20
-
21
- ### Testing Commands
22
- - `npm test` or `npm run test` - Run all tests
23
- - `npm run test:watch` - Run tests in watch mode
24
- - `npm run test:coverage` - Run tests with coverage report
25
- - `npm run test:unit` - Run unit tests only
26
- - `npm run test:integration` - Run integration tests only
27
- - `npm run test:e2e` - Run end-to-end tests
28
-
29
- ### Code Quality Commands
30
- - `npm run lint` - Run ESLint for code linting
31
- - `npm run lint:fix` - Run ESLint with auto-fix
32
- - `npm run format` - Format code with Prettier
33
- - `npm run format:check` - Check code formatting
34
- - `npm run typecheck` - Run TypeScript type checking
35
-
36
- ### Development Tools
37
- - `npm run storybook` - Start Storybook (if available)
38
- - `npm run analyze` - Analyze bundle size
39
- - `npm run clean` - Clean build artifacts
40
-
41
- ## Technology Stack
42
-
43
- ### Core Technologies
44
- - **JavaScript/TypeScript** - Primary programming languages
45
- - **Node.js** - Runtime environment
46
- - **npm/yarn** - Package management
47
-
48
- ### Common Frameworks
49
- - **React** - UI library with hooks and functional components
50
- - **Vue.js** - Progressive framework for building user interfaces
51
- - **Angular** - Full-featured framework for web applications
52
- - **Express.js** - Web application framework for Node.js
53
- - **Next.js** - React framework with SSR/SSG capabilities
54
-
55
- ### Build Tools
56
- - **Vite** - Fast build tool and development server
57
- - **Webpack** - Module bundler
58
- - **Rollup** - Module bundler for libraries
59
- - **esbuild** - Extremely fast JavaScript bundler
60
-
61
- ### Testing Framework
62
- - **Jest** - JavaScript testing framework
63
- - **Vitest** - Fast unit test framework
64
- - **Testing Library** - Simple and complete testing utilities
65
- - **Cypress** - End-to-end testing framework
66
- - **Playwright** - Cross-browser testing
67
-
68
- ### Code Quality Tools
69
- - **ESLint** - JavaScript/TypeScript linter
70
- - **Prettier** - Code formatter
71
- - **TypeScript** - Static type checking
72
- - **Husky** - Git hooks
73
-
74
- ## Project Structure Guidelines
75
-
76
- ### File Organization
77
- ```
78
- src/
79
- ├── components/ # Reusable UI components
80
- ├── pages/ # Page components or routes
81
- ├── hooks/ # Custom React hooks
82
- ├── utils/ # Utility functions
83
- ├── services/ # API calls and external services
84
- ├── types/ # TypeScript type definitions
85
- ├── constants/ # Application constants
86
- ├── styles/ # Global styles and themes
87
- └── tests/ # Test files
88
- ```
89
-
90
- ### Naming Conventions
91
- - **Files**: Use kebab-case for file names (`user-profile.component.ts`)
92
- - **Components**: Use PascalCase for component names (`UserProfile`)
93
- - **Functions**: Use camelCase for function names (`getUserData`)
94
- - **Constants**: Use UPPER_SNAKE_CASE for constants (`API_BASE_URL`)
95
- - **Types/Interfaces**: Use PascalCase with descriptive names (`UserData`, `ApiResponse`)
96
-
97
- ## TypeScript Guidelines
98
-
99
- ### Type Safety
100
- - Enable strict mode in `tsconfig.json`
101
- - Use explicit types for function parameters and return values
102
- - Prefer interfaces over types for object shapes
103
- - Use union types for multiple possible values
104
- - Avoid `any` type - use `unknown` when type is truly unknown
105
-
106
- ### Best Practices
107
- - Use type guards for runtime type checking
108
- - Leverage utility types (`Partial`, `Pick`, `Omit`, etc.)
109
- - Create custom types for domain-specific data
110
- - Use enums for finite sets of values
111
- - Document complex types with JSDoc comments
112
-
113
- ## Code Quality Standards
114
-
115
- ### ESLint Configuration
116
- - Use recommended ESLint rules for JavaScript/TypeScript
117
- - Enable React-specific rules if using React
118
- - Configure import/export rules for consistent module usage
119
- - Set up accessibility rules for inclusive development
120
-
121
- ### Prettier Configuration
122
- - Use consistent indentation (2 spaces recommended)
123
- - Set maximum line length (80-100 characters)
124
- - Use single quotes for strings
125
- - Add trailing commas for better git diffs
126
-
127
- ### Testing Standards
128
- - Aim for 80%+ test coverage
129
- - Write unit tests for utilities and business logic
130
- - Use integration tests for component interactions
131
- - Implement e2e tests for critical user flows
132
- - Follow AAA pattern (Arrange, Act, Assert)
133
-
134
- ## Performance Optimization
135
-
136
- ### Bundle Optimization
137
- - Use code splitting for large applications
138
- - Implement lazy loading for routes and components
139
- - Optimize images and assets
140
- - Use tree shaking to eliminate dead code
141
- - Analyze bundle size regularly
142
-
143
- ### Runtime Performance
144
- - Implement proper memoization (React.memo, useMemo, useCallback)
145
- - Use virtualization for large lists
146
- - Optimize re-renders in React applications
147
- - Implement proper error boundaries
148
- - Use web workers for heavy computations
149
-
150
- ## Security Guidelines
151
-
152
- ### Dependencies
153
- - Regularly audit dependencies with `npm audit`
154
- - Keep dependencies updated
155
- - Use lock files (`package-lock.json`, `yarn.lock`)
156
- - Avoid dependencies with known vulnerabilities
157
-
158
- ### Code Security
159
- - Sanitize user inputs
160
- - Use HTTPS for API calls
161
- - Implement proper authentication and authorization
162
- - Store sensitive data securely (environment variables)
163
- - Use Content Security Policy (CSP) headers
164
-
165
- ## Development Workflow
166
-
167
- ### Before Starting
168
- 1. Check Node.js version compatibility
169
- 2. Install dependencies with `npm install`
170
- 3. Copy environment variables from `.env.example`
171
- 4. Run type checking with `npm run typecheck`
172
-
173
- ### During Development
174
- 1. Use TypeScript for type safety
175
- 2. Run linter frequently to catch issues early
176
- 3. Write tests for new features
177
- 4. Use meaningful commit messages
178
- 5. Review code changes before committing
179
-
180
- ### Before Committing
181
- 1. Run full test suite: `npm test`
182
- 2. Check linting: `npm run lint`
183
- 3. Verify formatting: `npm run format:check`
184
- 4. Run type checking: `npm run typecheck`
185
- 5. Test production build: `npm run build`
@@ -1,259 +0,0 @@
1
- # JavaScript/TypeScript Templates
2
-
3
- **Claude Code configuration template optimized for modern JavaScript and TypeScript development**
4
-
5
- This folder contains a comprehensive Claude Code template specifically designed for JavaScript and TypeScript projects, supporting popular frameworks like React, Vue.js, Angular, and Node.js.
6
-
7
- ## 📁 What's in This Folder
8
-
9
- This template provides the foundation for JavaScript/TypeScript development with Claude Code:
10
-
11
- ### 📄 Files Included
12
- - **`CLAUDE.md`** - Complete JavaScript/TypeScript development guidance for Claude Code
13
- - **`README.md`** - This documentation file
14
-
15
- ### 🎯 Template Features
16
- When you use this template with the installer, it automatically creates:
17
- - **`.claude/settings.json`** - Optimized settings for JS/TS projects
18
- - **`.claude/commands/`** - Ready-to-use commands for common tasks
19
-
20
- ## 🚀 How to Use This Template
21
-
22
- ### Option 1: Automated Installation (Recommended)
23
- Use the CLI installer to automatically set up this template in your project:
24
-
25
- ```bash
26
- cd your-javascript-project
27
- npx claude-code-templates --language javascript-typescript
28
- ```
29
-
30
- The installer will:
31
- - Copy the `CLAUDE.md` file to your project
32
- - Auto-detect your framework (React, Vue, Node.js, etc.)
33
- - Create appropriate `.claude/` configuration files
34
- - Set up framework-specific commands
35
- - Configure development workflows
36
-
37
- ### Option 2: Manual Installation
38
- Copy the template manually for more control:
39
-
40
- ```bash
41
- # Clone the repository
42
- git clone https://github.com/davila7/claude-code-templates.git
43
-
44
- # Copy the JavaScript/TypeScript template
45
- cp claude-code-templates/javascript-typescript/CLAUDE.md your-project/
46
-
47
- # Then use the CLI to complete the setup
48
- cd your-project
49
- npx claude-code-templates --language javascript-typescript
50
- ```
51
-
52
- ## 🎨 Framework Support
53
-
54
- This template automatically configures Claude Code for:
55
-
56
- ### Frontend Frameworks
57
- - **React** - Components, hooks, JSX, testing with React Testing Library
58
- - **Vue.js** - Composition API, single-file components, state management
59
- - **Angular** - TypeScript-first development, RxJS patterns, CLI integration
60
- - **Svelte** - Compile-time optimizations, modern JavaScript patterns
61
-
62
- ### Backend Frameworks
63
- - **Express.js** - RESTful APIs, middleware, error handling
64
- - **Fastify** - High-performance Node.js applications
65
- - **NestJS** - Enterprise-grade TypeScript framework
66
- - **Next.js** - Full-stack React applications with SSR/SSG
67
-
68
- ### Build Tools & Testing
69
- - **Vite, Webpack, esbuild** - Modern build tool configurations
70
- - **Jest, Vitest, Cypress** - Testing framework optimization
71
- - **ESLint, Prettier, TypeScript** - Code quality and formatting
72
-
73
- ## 🛠️ Commands Created by the Template
74
-
75
- When installed, this template provides commands for:
76
-
77
- ### 🧪 Testing & Quality
78
- - **`/test`** - Run tests with Jest, Vitest, or other frameworks
79
- - **`/lint`** - ESLint with auto-fix capabilities
80
- - **`/typescript-migrate`** - Convert JavaScript files to TypeScript
81
-
82
- ### 🔧 Development Tools
83
- - **`/debug`** - Debug Node.js applications and browser code
84
- - **`/refactor`** - AI-assisted code refactoring
85
- - **`/npm-scripts`** - Manage and execute npm/yarn scripts
86
-
87
- ### ⚡ Framework-Specific Commands
88
- - **`/react-component`** - Generate React components (React projects)
89
- - **`/api-endpoint`** - Create Express.js endpoints (Node.js projects)
90
- - **`/route`** - Create API routes (Node.js projects)
91
- - **`/component`** - Create components (React/Vue projects)
92
-
93
- ## 🎯 What Happens When You Install
94
-
95
- ### Step 1: Framework Detection
96
- The installer analyzes your project to detect:
97
- - Package.json dependencies
98
- - Project structure
99
- - Framework type (React, Vue, Angular, Node.js)
100
-
101
- ### Step 2: Template Configuration
102
- Based on detection, it creates:
103
- ```
104
- your-project/
105
- ├── CLAUDE.md # Copied from this template
106
- ├── .claude/
107
- │ ├── settings.json # Framework-specific settings
108
- │ └── commands/ # Commands for your framework
109
- │ ├── test.md
110
- │ ├── lint.md
111
- │ ├── debug.md
112
- │ └── [framework-specific commands]
113
- ```
114
-
115
- ### Step 3: Framework Customization
116
- For specific frameworks, additional commands are added:
117
-
118
- **React Projects:**
119
- - Component generation with TypeScript support
120
- - React hooks creation and management
121
- - Testing with React Testing Library patterns
122
-
123
- **Node.js Projects:**
124
- - RESTful API endpoint creation
125
- - Middleware development patterns
126
- - Database integration helpers
127
-
128
- **Vue.js Projects:**
129
- - Single-file component templates
130
- - Composition API patterns
131
- - Vue 3 best practices
132
-
133
- ## 📚 What's in the CLAUDE.md File
134
-
135
- The `CLAUDE.md` file in this folder contains comprehensive guidance for:
136
-
137
- ### Development Commands
138
- - Package management (npm, yarn, pnpm)
139
- - Build commands (dev, build, preview)
140
- - Testing commands (unit, integration, e2e)
141
- - Code quality commands (lint, format, typecheck)
142
-
143
- ### Technology Stack Guidelines
144
- - JavaScript/TypeScript best practices
145
- - Framework-specific patterns (React, Vue, Angular, Node.js)
146
- - Build tools configuration (Vite, Webpack, esbuild)
147
- - Testing frameworks (Jest, Vitest, Cypress, Playwright)
148
-
149
- ### Project Structure Recommendations
150
- - File organization patterns
151
- - Naming conventions
152
- - TypeScript configuration
153
- - Code quality standards
154
-
155
- ### Performance & Security
156
- - Bundle optimization strategies
157
- - Runtime performance tips
158
- - Security best practices
159
- - Dependency management
160
-
161
- ## 🚀 Getting Started
162
-
163
- 1. **Navigate to your JavaScript/TypeScript project:**
164
- ```bash
165
- cd your-project
166
- ```
167
-
168
- 2. **Run the installer:**
169
- ```bash
170
- npx claude-code-templates --language javascript-typescript
171
- ```
172
-
173
- 3. **Start Claude Code:**
174
- ```bash
175
- claude
176
- ```
177
-
178
- 4. **Try the commands:**
179
- ```bash
180
- /test # Run your tests
181
- /lint # Check code quality
182
- /component # Create components (React/Vue)
183
- /route # Create API routes (Node.js)
184
- ```
185
-
186
- ## 🔧 Customization
187
-
188
- After installation, you can customize the setup:
189
-
190
- ### Modify Commands
191
- Edit files in `.claude/commands/` to match your workflow:
192
- ```bash
193
- # Edit the test command
194
- vim .claude/commands/test.md
195
-
196
- # Add a custom command
197
- echo "# Deploy Command" > .claude/commands/deploy.md
198
- ```
199
-
200
- ### Adjust Settings
201
- Update `.claude/settings.json` for your project:
202
- ```json
203
- {
204
- "framework": "react",
205
- "testFramework": "jest",
206
- "packageManager": "npm",
207
- "buildTool": "vite"
208
- }
209
- ```
210
-
211
- ### Add Framework Features
212
- The template adapts to your specific framework needs automatically.
213
-
214
- ## 📖 Learn More
215
-
216
- - **Main Project**: [Claude Code Templates](../README.md)
217
- - **Common Templates**: [Universal patterns](../common/README.md)
218
- - **Python Templates**: [Python development](../python/README.md)
219
- - **CLI Tool**: [Automated installer](../cli-tool/README.md)
220
-
221
- ## 💡 Why Use This Template?
222
-
223
- ### Before (Manual Setup)
224
- ```bash
225
- # Create CLAUDE.md from scratch
226
- # Research JS/TS best practices
227
- # Configure commands manually
228
- # Set up linting and testing
229
- # Configure TypeScript
230
- # ... hours of setup
231
- ```
232
-
233
- ### After (With This Template)
234
- ```bash
235
- npx claude-code-templates --language javascript-typescript
236
- # ✅ Everything configured in 30 seconds!
237
- ```
238
-
239
- ### Benefits
240
- - **Instant Setup** - Get started immediately with proven configurations
241
- - **Framework-Aware** - Automatically adapts to React, Vue, Node.js, etc.
242
- - **Best Practices** - Uses industry-standard patterns and tools
243
- - **TypeScript Ready** - Full TypeScript support out of the box
244
- - **Testing Included** - Pre-configured for Jest, Vitest, and more
245
-
246
- ## 🤝 Contributing
247
-
248
- Help improve this JavaScript/TypeScript template:
249
-
250
- 1. Test the template with different JS/TS projects
251
- 2. Report issues or suggest improvements
252
- 3. Add support for new frameworks or tools
253
- 4. Share your customizations and best practices
254
-
255
- Your contributions make this template better for the entire JavaScript/TypeScript community!
256
-
257
- ---
258
-
259
- **Ready to supercharge your JavaScript/TypeScript development?** Run `npx claude-code-templates --language javascript-typescript` in your project now!
@@ -1,63 +0,0 @@
1
- # Angular Components
2
-
3
- Create Angular components for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create or optimize Angular components based on the requirements:
8
-
9
- 1. **Analyze existing components**: Check current component patterns, naming conventions, and folder organization
10
- 2. **Examine Angular setup**: Review project structure, module organization, and TypeScript configuration
11
- 3. **Identify component type**: Determine the component category:
12
- - Presentation components (dumb/pure components)
13
- - Container components (smart components with state)
14
- - Feature components (business logic components)
15
- - Shared/UI components (reusable across features)
16
- - Layout components (structural components)
17
- 4. **Check dependencies**: Review existing components and shared modules to avoid duplication
18
- 5. **Implement component**: Create component with proper TypeScript types and lifecycle hooks
19
- 6. **Add inputs/outputs**: Define @Input and @Output properties with proper typing
20
- 7. **Create template**: Build HTML template with proper Angular directives and bindings
21
- 8. **Add styles**: Implement component styles following project's styling approach
22
- 9. **Create tests**: Write comprehensive unit tests with TestBed and proper mocking
23
- 10. **Update module**: Register component in appropriate Angular module
24
-
25
- ## Implementation Requirements
26
-
27
- - Follow project's Angular architecture and naming conventions
28
- - Use proper component lifecycle hooks (OnInit, OnDestroy, etc.)
29
- - Include comprehensive TypeScript interfaces for inputs and outputs
30
- - Implement proper change detection strategy (OnPush when possible)
31
- - Add proper subscription management with takeUntil or async pipe
32
- - Follow Angular style guide and project coding standards
33
- - Consider component performance and memory management
34
-
35
- ## Component Patterns to Consider
36
-
37
- Based on the request:
38
- - **Smart Components**: Container components that manage state and services
39
- - **Dumb Components**: Presentation components that only receive inputs
40
- - **Feature Components**: Components specific to business features
41
- - **Shared Components**: Reusable UI components across the application
42
- - **Form Components**: Reactive forms with validation and custom controls
43
- - **Data Display**: Components for tables, lists, cards with proper data binding
44
-
45
- ## Angular-Specific Implementation
46
-
47
- - **Template Syntax**: Proper use of Angular directives (*ngFor, *ngIf, etc.)
48
- - **Data Binding**: Property binding, event binding, two-way binding
49
- - **Change Detection**: OnPush strategy for performance optimization
50
- - **Lifecycle Management**: Proper use of lifecycle hooks
51
- - **Dependency Injection**: Service injection in component constructors
52
- - **Testing**: TestBed configuration with proper mocking and spies
53
-
54
- ## Important Notes
55
-
56
- - ALWAYS examine existing components first to understand project patterns
57
- - Use the same styling approach and class naming as existing components
58
- - Follow project's folder structure for components (usually feature-based)
59
- - Don't install new dependencies without asking
60
- - Consider component reusability and single responsibility principle
61
- - Add proper TypeScript types for all component properties and methods
62
- - Use trackBy functions for performance in *ngFor loops
63
- - Implement proper unsubscription patterns to prevent memory leaks
@@ -1,62 +0,0 @@
1
- # Angular Services
2
-
3
- Create Angular services for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create or optimize Angular services based on the requirements:
8
-
9
- 1. **Analyze existing services**: Check current service patterns, naming conventions, and folder organization
10
- 2. **Examine Angular setup**: Review project structure, dependency injection patterns, and TypeScript configuration
11
- 3. **Identify service type**: Determine the service category:
12
- - Data services (HTTP API calls, state management)
13
- - Utility services (validation, formatting, helpers)
14
- - Business logic services (calculations, workflows)
15
- - Infrastructure services (logging, authentication, error handling)
16
- - Feature services (component-specific logic)
17
- 4. **Check dependencies**: Review existing services and shared modules to avoid duplication
18
- 5. **Implement service**: Create service with proper dependency injection and TypeScript types
19
- 6. **Add error handling**: Include comprehensive error handling with RxJS operators
20
- 7. **Create tests**: Write unit tests with proper mocking following project patterns
21
- 8. **Update module registration**: Register service in appropriate Angular modules
22
-
23
- ## Implementation Requirements
24
-
25
- - Follow project's Angular architecture and naming conventions (usually .service.ts)
26
- - Use proper dependency injection with @Injectable decorator
27
- - Include comprehensive TypeScript interfaces and types
28
- - Implement proper RxJS patterns (observables, operators, error handling)
29
- - Add proper error handling and logging integration
30
- - Follow single responsibility principle for service design
31
- - Consider service lifecycle and singleton patterns
32
-
33
- ## Service Patterns to Consider
34
-
35
- Based on the request:
36
- - **HTTP Data Services**: API calls with proper error handling and caching
37
- - **State Management**: Services for sharing data between components
38
- - **Authentication**: User authentication, token management, guards
39
- - **Business Logic**: Complex calculations, workflows, validations
40
- - **Utility Services**: Reusable functions, formatters, validators
41
- - **Feature Services**: Component-specific logic extraction
42
- - **Infrastructure**: Logging, monitoring, configuration services
43
-
44
- ## Angular-Specific Implementation
45
-
46
- - **Dependency Injection**: Proper use of @Injectable and providedIn
47
- - **RxJS Integration**: Observables, subjects, operators for reactive programming
48
- - **HTTP Client**: Angular HttpClient for API communication
49
- - **Error Handling**: Global error handling and user-friendly error messages
50
- - **Testing**: TestBed, jasmine, karma for comprehensive unit testing
51
- - **Module Organization**: Feature modules, shared modules, core modules
52
-
53
- ## Important Notes
54
-
55
- - ALWAYS examine existing services first to understand project patterns
56
- - Use the same error handling and response patterns as existing services
57
- - Follow project's folder structure for services (usually /services or /core)
58
- - Don't install new dependencies without asking
59
- - Consider service performance and memory management
60
- - Add proper RxJS subscription management to prevent memory leaks
61
- - Use Angular's built-in services (HttpClient, Router) rather than external libraries
62
- - Include proper TypeScript types for all service methods and properties
@@ -1,46 +0,0 @@
1
- # API Endpoint Generator
2
-
3
- Generate a complete API endpoint for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create a new API endpoint with all necessary components:
8
-
9
- 1. **Analyze project architecture**: Examine existing API structure, patterns, and conventions
10
- 2. **Identify framework**: Determine if using Express, Fastify, NestJS, Next.js API routes, or other framework
11
- 3. **Check authentication**: Review existing auth patterns and middleware usage
12
- 4. **Examine data layer**: Identify database/ORM patterns (Prisma, TypeORM, Mongoose, etc.)
13
- 5. **Create endpoint structure**: Generate route, controller, validation, and service layers
14
- 6. **Implement business logic**: Add core functionality with proper error handling
15
- 7. **Add validation**: Include input validation using project's validation library
16
- 8. **Create tests**: Write unit and integration tests following project patterns
17
- 9. **Update documentation**: Add endpoint documentation (OpenAPI/Swagger if used)
18
-
19
- ## Implementation Requirements
20
-
21
- - Follow project's TypeScript conventions and interfaces
22
- - Use existing middleware patterns for auth, validation, logging
23
- - Include proper HTTP status codes and error responses
24
- - Add comprehensive input validation and sanitization
25
- - Implement proper logging and monitoring
26
- - Consider rate limiting and security headers
27
- - Follow project's database transaction patterns
28
-
29
- ## Framework-Specific Patterns
30
-
31
- I'll adapt to your project's framework:
32
- - **Express**: Routes, controllers, middleware
33
- - **Fastify**: Routes, handlers, schemas, plugins
34
- - **NestJS**: Controllers, services, DTOs, guards
35
- - **Next.js**: API routes with proper HTTP methods
36
- - **tRPC**: Procedures with input/output validation
37
- - **GraphQL**: Resolvers with proper type definitions
38
-
39
- ## Important Notes
40
-
41
- - ALWAYS examine existing endpoints first to understand project patterns
42
- - Use the same error handling and response format as existing endpoints
43
- - Follow project's folder structure and naming conventions
44
- - Don't install new dependencies without asking
45
- - Consider backward compatibility if modifying existing endpoints
46
- - Add proper database migrations if schema changes are needed
@@ -1,56 +0,0 @@
1
- # Database Operations
2
-
3
- Set up database operations for $ARGUMENTS following project conventions.
4
-
5
- ## Task
6
-
7
- Create or optimize database operations based on the requirements:
8
-
9
- 1. **Analyze existing database setup**: Check current database configuration, ORM/ODM, and connection patterns
10
- 2. **Identify database type**: Determine if using MongoDB, PostgreSQL, MySQL, or other database
11
- 3. **Examine ORM/ODM**: Check for Prisma, TypeORM, Mongoose, Sequelize, or raw SQL patterns
12
- 4. **Review existing models**: Understand current schema patterns and relationships
13
- 5. **Check migration system**: Identify migration tools and patterns in use
14
- 6. **Implement operations**: Create models, repositories, or services following project architecture
15
- 7. **Add validation**: Include proper schema validation and constraints
16
- 8. **Create tests**: Write database operation tests following project patterns
17
- 9. **Update migrations**: Add necessary database migrations if schema changes required
18
-
19
- ## Implementation Requirements
20
-
21
- - Follow project's database architecture patterns
22
- - Use existing ORM/ODM configuration and connection setup
23
- - Include proper TypeScript types for all database operations
24
- - Add comprehensive error handling and transaction management
25
- - Implement proper indexing for performance
26
- - Follow project's naming conventions for tables/collections and fields
27
- - Consider data validation at both application and database levels
28
-
29
- ## Database Patterns to Consider
30
-
31
- Based on your project setup:
32
- - **Repository Pattern**: Separate data access logic from business logic
33
- - **Active Record**: Models with built-in database operations
34
- - **Data Mapper**: Separate domain models from database schema
35
- - **Query Builder**: Fluent interface for building database queries
36
- - **Raw SQL**: Direct database queries for complex operations
37
-
38
- ## Operation Types
39
-
40
- Common database operations to implement:
41
- - **CRUD operations**: Create, Read, Update, Delete
42
- - **Bulk operations**: Batch inserts, updates, deletes
43
- - **Aggregation**: Complex queries with grouping and calculations
44
- - **Relationships**: Managing foreign keys and joins
45
- - **Transactions**: Ensuring data consistency
46
- - **Migrations**: Schema changes and data transformations
47
-
48
- ## Important Notes
49
-
50
- - ALWAYS examine existing database setup first to understand project patterns
51
- - Use the same connection configuration and environment variables
52
- - Follow project's folder structure for models/schemas
53
- - Don't install new database dependencies without asking
54
- - Consider performance implications (indexes, query optimization)
55
- - Add proper database connection pooling if not already configured
56
- - Include proper cleanup and connection closing in tests