appiq-solution
Version:
APPIQ SOLUTION: Flutter Mobile Development Extension for BMAD Method
170 lines (136 loc) โข 6.67 kB
Markdown
# 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!**