claude-code-templates 1.3.2 → 1.3.4

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 (60) hide show
  1. package/README.md +132 -20
  2. package/package.json +3 -2
  3. package/src/command-scanner.js +1 -1
  4. package/src/file-operations.js +1 -1
  5. package/src/hook-scanner.js +2 -2
  6. package/templates/common/.claude/commands/git-workflow.md +239 -0
  7. package/templates/common/.claude/commands/project-setup.md +316 -0
  8. package/templates/common/.mcp.json +41 -0
  9. package/templates/common/CLAUDE.md +109 -0
  10. package/templates/common/README.md +96 -0
  11. package/templates/go/.mcp.json +78 -0
  12. package/templates/go/README.md +25 -0
  13. package/templates/javascript-typescript/.claude/commands/api-endpoint.md +51 -0
  14. package/templates/javascript-typescript/.claude/commands/debug.md +52 -0
  15. package/templates/javascript-typescript/.claude/commands/lint.md +48 -0
  16. package/templates/javascript-typescript/.claude/commands/npm-scripts.md +48 -0
  17. package/templates/javascript-typescript/.claude/commands/refactor.md +55 -0
  18. package/templates/javascript-typescript/.claude/commands/test.md +61 -0
  19. package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +51 -0
  20. package/templates/javascript-typescript/.claude/settings.json +142 -0
  21. package/templates/javascript-typescript/.mcp.json +80 -0
  22. package/templates/javascript-typescript/CLAUDE.md +185 -0
  23. package/templates/javascript-typescript/README.md +259 -0
  24. package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +63 -0
  25. package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +62 -0
  26. package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +46 -0
  27. package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +56 -0
  28. package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +61 -0
  29. package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +57 -0
  30. package/templates/javascript-typescript/examples/node-api/CLAUDE.md +102 -0
  31. package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +29 -0
  32. package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +44 -0
  33. package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +45 -0
  34. package/templates/javascript-typescript/examples/react-app/CLAUDE.md +81 -0
  35. package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +46 -0
  36. package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +51 -0
  37. package/templates/python/.claude/commands/lint.md +111 -0
  38. package/templates/python/.claude/commands/test.md +73 -0
  39. package/templates/python/.claude/settings.json +153 -0
  40. package/templates/python/.mcp.json +78 -0
  41. package/templates/python/CLAUDE.md +276 -0
  42. package/templates/python/examples/django-app/.claude/commands/admin.md +264 -0
  43. package/templates/python/examples/django-app/.claude/commands/django-model.md +124 -0
  44. package/templates/python/examples/django-app/.claude/commands/views.md +222 -0
  45. package/templates/python/examples/django-app/CLAUDE.md +313 -0
  46. package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +513 -0
  47. package/templates/python/examples/fastapi-app/.claude/commands/auth.md +775 -0
  48. package/templates/python/examples/fastapi-app/.claude/commands/database.md +657 -0
  49. package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +160 -0
  50. package/templates/python/examples/fastapi-app/.claude/commands/testing.md +927 -0
  51. package/templates/python/examples/fastapi-app/CLAUDE.md +229 -0
  52. package/templates/python/examples/flask-app/.claude/commands/app-factory.md +384 -0
  53. package/templates/python/examples/flask-app/.claude/commands/blueprint.md +243 -0
  54. package/templates/python/examples/flask-app/.claude/commands/database.md +410 -0
  55. package/templates/python/examples/flask-app/.claude/commands/deployment.md +620 -0
  56. package/templates/python/examples/flask-app/.claude/commands/flask-route.md +217 -0
  57. package/templates/python/examples/flask-app/.claude/commands/testing.md +559 -0
  58. package/templates/python/examples/flask-app/CLAUDE.md +391 -0
  59. package/templates/rust/.mcp.json +78 -0
  60. package/templates/rust/README.md +26 -0
@@ -0,0 +1,61 @@
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
@@ -0,0 +1,57 @@
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
@@ -0,0 +1,102 @@
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
@@ -0,0 +1,29 @@
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
@@ -0,0 +1,44 @@
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
@@ -0,0 +1,45 @@
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
@@ -0,0 +1,81 @@
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
@@ -0,0 +1,46 @@
1
+ # Vue Components
2
+
3
+ Create Vue Single File Components for $ARGUMENTS following project conventions.
4
+
5
+ ## Task
6
+
7
+ Create or optimize Vue components based on the requirements:
8
+
9
+ 1. **Analyze project structure**: Check existing Vue components to understand patterns, conventions, and file organization
10
+ 2. **Examine Vue setup**: Identify Vue version (2/3), TypeScript usage, and Composition/Options API preference
11
+ 3. **Check styling approach**: Determine if using CSS modules, SCSS, styled-components, or other styling methods
12
+ 4. **Review testing patterns**: Check existing component tests to understand testing framework and conventions
13
+ 5. **Create component structure**: Generate SFC with template, script, and style sections
14
+ 6. **Implement component**: Write TypeScript interfaces, props, emits, and component logic
15
+ 7. **Add accessibility**: Include proper ARIA attributes and semantic HTML
16
+ 8. **Create tests**: Write comprehensive component tests following project patterns
17
+ 9. **Add documentation**: Include JSDoc comments and usage examples
18
+
19
+ ## Component Requirements
20
+
21
+ - Follow project's TypeScript conventions and interfaces
22
+ - Use existing component patterns and naming conventions
23
+ - Implement proper props validation and typing
24
+ - Add appropriate event emissions with TypeScript signatures
25
+ - Include scoped styles following project's styling approach
26
+ - Add proper accessibility attributes (ARIA, semantic HTML)
27
+ - Consider responsive design if applicable
28
+
29
+ ## Vue Patterns to Consider
30
+
31
+ Based on the component type:
32
+ - **Composition API**: For Vue 3 projects with `<script setup>`
33
+ - **Options API**: For Vue 2 or legacy Vue 3 projects
34
+ - **Composables**: Extract reusable logic into composables
35
+ - **Provide/Inject**: For deep component communication
36
+ - **Slots**: For flexible component content
37
+ - **Teleport**: For portal-like functionality (Vue 3)
38
+
39
+ ## Important Notes
40
+
41
+ - ALWAYS examine existing components first to understand project patterns
42
+ - Use the same Vue API style (Composition vs Options) as the project
43
+ - Follow project's folder structure for components
44
+ - Don't install new dependencies without asking
45
+ - Consider component performance (v-memo, computed properties)
46
+ - Add proper TypeScript types for all props and emits
@@ -0,0 +1,51 @@
1
+ # Vue Composables
2
+
3
+ Create Vue composables for $ARGUMENTS following project conventions.
4
+
5
+ ## Task
6
+
7
+ Create or optimize Vue composables based on the requirements:
8
+
9
+ 1. **Analyze existing composables**: Check project for existing composable patterns, naming conventions, and file organization
10
+ 2. **Examine Vue setup**: Verify Vue 3 Composition API usage and TypeScript configuration
11
+ 3. **Identify composable type**: Determine the composable category:
12
+ - State management (reactive data, computed properties)
13
+ - API/HTTP operations (data fetching, mutations)
14
+ - DOM interactions (event listeners, element refs)
15
+ - Utility functions (validation, formatting, storage)
16
+ - Lifecycle management (cleanup, watchers)
17
+ 4. **Check dependencies**: Review existing composables to avoid duplication
18
+ 5. **Implement composable**: Create composable with proper TypeScript types and reactivity
19
+ 6. **Add lifecycle management**: Include proper cleanup with onUnmounted when needed
20
+ 7. **Create tests**: Write comprehensive unit tests for composable logic
21
+ 8. **Add documentation**: Include JSDoc comments and usage examples
22
+
23
+ ## Implementation Requirements
24
+
25
+ - Follow project's TypeScript conventions and interfaces
26
+ - Use appropriate Vue reactivity APIs (ref, reactive, computed, watch)
27
+ - Include proper error handling and loading states
28
+ - Add cleanup for side effects (event listeners, timers, subscriptions)
29
+ - Make composables reusable and focused on single responsibility
30
+ - Consider performance implications (shallow vs deep reactivity)
31
+
32
+ ## Common Composable Patterns
33
+
34
+ Based on the request:
35
+ - **Data fetching**: API calls with loading/error states
36
+ - **Form handling**: Input management, validation, submission
37
+ - **State management**: Local state, persistence, computed values
38
+ - **DOM utilities**: Element refs, event handling, intersection observer
39
+ - **Storage**: localStorage, sessionStorage, IndexedDB
40
+ - **Authentication**: User state, token management, permissions
41
+ - **UI utilities**: Dark mode, responsive breakpoints, modals
42
+
43
+ ## Important Notes
44
+
45
+ - ALWAYS examine existing composables first to understand project patterns
46
+ - Use proper Vue 3 Composition API patterns
47
+ - Follow project's folder structure for composables (usually /composables)
48
+ - Don't install new dependencies without asking
49
+ - Consider composable composition (using other composables within composables)
50
+ - Add proper TypeScript return types and generic constraints
51
+ - Include proper reactivity patterns (avoid losing reactivity)
@@ -0,0 +1,111 @@
1
+ # Python Linter
2
+
3
+ Run Python code linting and formatting tools.
4
+
5
+ ## Purpose
6
+
7
+ This command helps you maintain code quality using Python's best linting and formatting tools.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /lint
13
+ ```
14
+
15
+ ## What this command does
16
+
17
+ 1. **Runs multiple linters** (flake8, pylint, black, isort)
18
+ 2. **Provides detailed feedback** on code quality issues
19
+ 3. **Auto-fixes formatting** where possible
20
+ 4. **Checks type hints** if mypy is configured
21
+
22
+ ## Example Commands
23
+
24
+ ### Black (code formatting)
25
+ ```bash
26
+ # Format all Python files
27
+ black .
28
+
29
+ # Check formatting without changing files
30
+ black --check .
31
+
32
+ # Format specific file
33
+ black src/main.py
34
+ ```
35
+
36
+ ### flake8 (style guide enforcement)
37
+ ```bash
38
+ # Check all Python files
39
+ flake8 .
40
+
41
+ # Check specific directory
42
+ flake8 src/
43
+
44
+ # Check with specific rules
45
+ flake8 --max-line-length=88 .
46
+ ```
47
+
48
+ ### isort (import sorting)
49
+ ```bash
50
+ # Sort imports in all files
51
+ isort .
52
+
53
+ # Check import sorting
54
+ isort --check-only .
55
+
56
+ # Sort imports in specific file
57
+ isort src/main.py
58
+ ```
59
+
60
+ ### pylint (comprehensive linting)
61
+ ```bash
62
+ # Run pylint on all files
63
+ pylint src/
64
+
65
+ # Run with specific score threshold
66
+ pylint --fail-under=8.0 src/
67
+
68
+ # Generate detailed report
69
+ pylint --output-format=html src/ > pylint_report.html
70
+ ```
71
+
72
+ ### mypy (type checking)
73
+ ```bash
74
+ # Check types in all files
75
+ mypy .
76
+
77
+ # Check specific module
78
+ mypy src/models.py
79
+
80
+ # Check with strict mode
81
+ mypy --strict src/
82
+ ```
83
+
84
+ ## Configuration Files
85
+
86
+ Most projects benefit from configuration files:
87
+
88
+ ### .flake8
89
+ ```ini
90
+ [flake8]
91
+ max-line-length = 88
92
+ exclude = .git,__pycache__,venv
93
+ ignore = E203,W503
94
+ ```
95
+
96
+ ### pyproject.toml
97
+ ```toml
98
+ [tool.black]
99
+ line-length = 88
100
+
101
+ [tool.isort]
102
+ profile = "black"
103
+ ```
104
+
105
+ ## Best Practices
106
+
107
+ - Run linters before committing code
108
+ - Use consistent formatting across the project
109
+ - Fix linting issues promptly
110
+ - Configure linters to match your team's style
111
+ - Use type hints for better code documentation