UNPKG

appiq-solution

Version:

APPIQ SOLUTION: Flutter Mobile Development Extension for BMAD Method

170 lines (136 loc) โ€ข 6.67 kB
# MANDATORY DEVELOPMENT RULES ## THESE RULES MUST ALWAYS BE FOLLOWED - NO EXCEPTIONS! This file provides mandatory guidance that MUST be followed by ALL agents when working with code in ANY repository. ## ๐Ÿšจ CRITICAL: Standard Workflow (ALWAYS FOLLOW!) ### MANDATORY 8-Step Process: 1. **THINK**: First think through the problem, read the codebase for relevant files 2. **PLAN**: Write a detailed plan to `tasks/todo.md` with checkable items 3. **VERIFY**: Check in with user - get plan approval before starting 4. **WORK**: Work on todo items, marking them complete as you go 5. **EXPLAIN**: Give high-level explanation of changes at every step 6. **SIMPLE**: Make every change as simple as possible - impact minimal code 7. **REVIEW**: Add review section to `todo.md` with summary of changes 8. **COMMIT**: After every fully finished task - make git commit with proper message ### MANDATORY Workflow Rules: - โœ… **NEVER start coding without a verified plan** - โœ… **ALWAYS check existing code before creating new code** - โœ… **ALWAYS extend existing code instead of duplicating** - โœ… **ALWAYS use existing patterns and folder structure** - โœ… **ALWAYS check if functionality already exists** - โœ… **ALWAYS make git commits after completed tasks** ## ๐ŸŽฏ MANDATORY Quality Criteria (ALL 5 MUST PASS!) ### 1. ๐Ÿงน DRY (Don't Repeat Yourself) - โœ… **NO code duplication allowed** - โœ… **ALWAYS reuse existing functions/classes/components** - โœ… **ALWAYS extract common functionality into shared utilities** - โœ… **ALWAYS check if similar code exists before writing new code** ### 2. ๐Ÿ“– Readable - โœ… **Code MUST be self-documenting with clear naming** - โœ… **Methods MUST be small and focused (max 20 lines)** - โœ… **Classes MUST have single responsibility** - โœ… **Comments MUST explain WHY, not WHAT** ### 3. ๐Ÿ”ง Maintainable - โœ… **MUST follow Clean Architecture with proper layer separation** - โœ… **MUST use dependency injection** - โœ… **MUST have modular design** - โœ… **MUST follow existing folder/file structure** ### 4. โšก Performant - โœ… **MUST avoid redundant API calls** - โœ… **MUST use efficient algorithms** - โœ… **MUST optimize resource usage** - โœ… **MUST follow existing performance patterns** ### 5. ๐Ÿงช Testable - โœ… **ALL business logic MUST be unit tested** - โœ… **ALL UI components MUST be widget tested** - โœ… **MUST use dependency injection for testability** - โœ… **MUST follow existing testing patterns** ## ๐Ÿ“ฑ MANDATORY Flutter-Specific Rules ### Architecture Compliance (ALWAYS!) - โœ… **MUST follow Clean Architecture (Presentation โ†’ Domain โ† Data)** - โœ… **MUST use Cubit for state management** - โœ… **MUST implement Repository pattern** - โœ… **MUST use GetIt for dependency injection** ### Localization (ALWAYS!) - โœ… **NO static text allowed - EVER!** - โœ… **ALL user-facing text MUST use AppLocalizations** - โœ… **ALL localization keys MUST be descriptive** - โœ… **MUST add keys to ALL supported ARB files** ### Code Structure (ALWAYS!) - โœ… **MUST follow existing folder structure** - โœ… **MUST use snake_case for files** - โœ… **MUST use PascalCase for classes** - โœ… **MUST use camelCase for methods/variables** ### Integration Rules (ALWAYS!) - โœ… **BEFORE creating new files**: Check if similar exists - โœ… **BEFORE new widgets**: Review `lib/shared/widgets/` - โœ… **BEFORE new services**: Check `lib/shared/services/` - โœ… **BEFORE new utilities**: Review `lib/shared/utils/` ## ๐Ÿ› ๏ธ MANDATORY MCP Tool Usage ### When to Use MCPs (ALWAYS check these!): - โœ… **sequential-thinking**: For complex problem analysis - โœ… **context7**: For up-to-date library documentation - โœ… **memory**: For storing important decisions/patterns - โœ… **puppeteer**: For web scraping/testing needs - โœ… **fetcher**: For external API data retrieval ## ๐Ÿ” MANDATORY Pre-Development Checklist ### Before ANY coding (ALWAYS!): - [ ] **Read existing codebase** for similar functionality - [ ] **Check shared components** for reusable parts - [ ] **Review existing patterns** in similar features - [ ] **Verify architecture compliance** with existing structure - [ ] **Plan minimal impact changes** - avoid massive refactors - [ ] **Ensure localization keys** are planned - [ ] **Identify testing requirements** early ### During Development (ALWAYS!): - [ ] **Follow existing naming conventions** exactly - [ ] **Use existing error handling patterns** - [ ] **Reuse existing validation logic** - [ ] **Follow existing state management patterns** - [ ] **Use existing navigation patterns** - [ ] **Follow existing styling/theming** ### After Development (ALWAYS!): - [ ] **Run all tests** and ensure they pass - [ ] **Check code coverage** meets minimum requirements - [ ] **Verify localization** works for all languages - [ ] **Test on different screen sizes** - [ ] **Review code** against all 5 quality criteria - [ ] **Make proper git commit** with descriptive message ## ๐Ÿšจ CRITICAL VALIDATION RULES ### Code Review Criteria (ALL MUST PASS!): 1. โœ… **Architecture**: Follows Clean Architecture with proper layer separation 2. โœ… **Localization**: All text supports multi-language 3. โœ… **Quality**: Passes all 5 quality criteria (DRY, Readable, Maintainable, Performant, Testable) 4. โœ… **Documentation**: Code is properly documented with examples 5. โœ… **Consistency**: Code style matches existing patterns ### Failure Conditions (NEVER ALLOWED!): - โŒ **Static text in UI** - Immediate failure - โŒ **Code duplication** - Immediate failure - โŒ **Breaking existing patterns** - Immediate failure - โŒ **Missing tests** - Immediate failure - โŒ **Poor performance** - Immediate failure ## ๐Ÿ“‹ MANDATORY Commit Message Format ``` type(scope): brief description - Detailed explanation of changes - Why the changes were made - What patterns were followed - What tests were added Quality Checklist: โœ… DRY: No code duplication โœ… Readable: Clear naming and structure โœ… Maintainable: Modular design โœ… Performant: Optimized implementation โœ… Testable: Comprehensive test coverage ``` ## ๐ŸŽฏ REMEMBER: Consistency is King! > **When in doubt, ALWAYS follow existing patterns in the codebase.** > **NEVER create new patterns without explicit approval.** > **ALWAYS prefer extending existing code over creating new code.** --- ## โš ๏ธ ENFORCEMENT NOTICE **These rules are MANDATORY and MUST be followed by:** - โœ… All BMAD agents (dev, flutter-ui-agent, flutter-cubit-agent, etc.) - โœ… All development workflows - โœ… All IDE integrations (Cursor, Claude Code, etc.) - โœ… All automated processes **NO EXCEPTIONS! NO SHORTCUTS! NO COMPROMISES!**