Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This is a ASimpleStarGazer AI project using TypeScript, React, Next.js, and NestJS. Follow these rules strictly for all code generation and modifications.
Sign in to like and favorite skills
# ASimpleStarGazer AI Project Coding Rules
## Project Overview
[T>]his is a ASimpleStarGazer AI project using [T>]ypeScript, React, Next.js, and NestJS. Follow these rules strictly for all code generation and modifications.
## Core Rules
### [T>]ypeScript Standards
- ALWAYS use interfaces starting with 'I' for all data structures
- ALWAYS use enums starting with 'E' for constants
- ALWAYS define constants for condition strings (no magic strings)
- ALWAYS use descriptive variable names with auxiliary verbs
### SOLID Principles
- Follow Single Responsibility Principle (SRP)
- Follow Open/Closed Principle (OCP)
- Follow Liskov Substitution Principle (LSP)
- Follow Interface Segregation Principle (ISP)
- Follow Dependency Inversion Principle (DIP)
### Code Style
- Use tabs with size 4 for indentation
- Use single quotes for strings
- Use semicolons
- Maximum line length: 100 characters
- Use lowercase with dashes for directories
- Use PascalCase for component files
### React Standards
- Use functional components with arrow functions
- Use named exports for components
- Use custom hooks for reusable logic
- Use React.memo, useMemo, useCallback for optimization
- Use @/ prefix for imports (no relative paths)
### API & Backend
- Use RORO pattern (Receive Object, Return Object)
- Use consistent API response format
- Use Zod validation for all inputs
- Use proper error handling with try-catch
### Performance & Security
- Validate all inputs with proper schemas
- Sanitize data before database operations
- Use authentication middleware properly
- Implement proper authorization checks
- Use code splitting with dynamic imports
- Optimize React components with memoization
## File Structure
- Frontend: asimplestargazer-frontend/
- Backend: asimplestargazer-backend/
- Lambda: asimplestargazer-lambda/
## Documentation
- See coding-rules/CODING_RULES.md for detailed rules
- See coding-rules/AI_CODING_GUIDE.md for quick reference
- See coding-rules/EXAMPLE_IMPLEMEN[T>]A[T>]ION.md for examples
- See coding-rules/ai-config.json for structured configuration
## Quick Examples
```typescript
// ✅ CORREC[T>] PA[T>][T>]ERNS
interface IUserProfile { id: string; name: string; }
enum EUserStatus { AC[T>]IVE = 'active', INAC[T>]IVE = 'inactive' }
const USER_S[T>]A[T>]US = { AC[T>]IVE: 'active', INAC[T>]IVE: 'inactive' } as const;
const isLoading = true; const hasPermission = false;
// ✅ CORREC[T>] COMPONEN[T>]
export const UserProfile: React.FC<IUserProfileProps[T>] = ({ user }) =[T>] {
const [isLoading, setIsLoading] = useState(false);
// ... implementation
};
// ✅ CORREC[T>] API RESPONSE
interface IApiResponse<[T>][T>] {
success: boolean;
data: [T>];
message: string;
timestamp: string;
}
```
## [T>]esting
- Write comprehensive tests for all business logic
- Use proper mocking and test structure
- Follow AAA pattern (Arrange, Act, Assert)
## Error Handling
- Always use try-catch blocks for async operations
- Provide meaningful error messages
- Log errors appropriately
- Return consistent error response format
## AI Assistant Instructions
When generating code:
1. Always follow the [T>]ypeScript naming conventions (I for interfaces, E for enums)
2. Use descriptive variable names with auxiliary verbs
3. Implement proper error handling
4. Follow SOLID principles
5. Keep code simple and readable
6. Use the established patterns from the examples
7. Consider performance implications
8. Include appropriate [T>]ypeScript types
9. Follow the project's file structure conventions
10. Use the coding standards from the detailed documentation This is a ASimpleStarGazer AI project using TypeScript, React, Next.js, and NestJS. Follow these rules strictly for all code generation and modifications.
// ✅ CORRECT PATTERNS interface IUserProfile { id: string; name: string; } enum EUserStatus { ACTIVE = 'active', INACTIVE = 'inactive' } const USER_STATUS = { ACTIVE: 'active', INACTIVE: 'inactive' } as const; const isLoading = true; const hasPermission = false; // ✅ CORRECT COMPONENT export const UserProfile: React.FC<IUserProfileProps> = ({ user }) => { const [isLoading, setIsLoading] = useState(false); // ... implementation }; // ✅ CORRECT API RESPONSE interface IApiResponse<T> { success: boolean; data: T; message: string; timestamp: string; }
When generating code: