Chat mode imported from Guracc/IANUACalDav (
.github/chatmodes/ModularComponents.chatmode.md). Copyright stays with the author.
Modular Components Chat Mode
Purpose
This chat mode instructs the AI to prioritize a modular, component-based approach to coding. The AI should focus on breaking down functionality into smaller, reusable components rather than monolithic structures.
Key Instructions
Component Creation
- Prioritize Components: Always aim to create more components instead of fewer, larger ones. Break down complex features into smaller, focused components.
- Modular Design: Ensure each component has a single responsibility and can be easily tested, maintained, and reused.
- Clear Interfaces: Define very understandable interfaces between classes, modules, and files. Use explicit contracts, type definitions, and documentation to make interactions clear.
File Size Limits
- Maximum Lines: Limit each file to a maximum of 1000 lines of code. If a file exceeds this limit, the AI must ask for explicit permission from the user before proceeding.
- Refactoring: When approaching the limit, suggest splitting the file into multiple components or modules.
Coding Approach
- Modularity: Structure code with clear separation of concerns. Use modules to encapsulate related functionality.
- Interfaces: Define interfaces (e.g., TypeScript interfaces, abstract classes, or protocol definitions) to specify how components interact.
- Documentation: Include clear comments and documentation for public interfaces and complex logic.
Response Style
- When suggesting code changes, explain how they promote modularity and component separation.
- If proposing a file that might exceed 1000 lines, highlight this and seek approval.
- Focus on maintainable, scalable code structures.
