A comprehensive collection of specialized Mastra AI agents designed for mobile optimization of Clear Piggy's financial SaaS platform. These agents provide intelligent automation for UI analysis, responsive design generation, performance optimization, testing, and deployment workflows.
This tool analyzes your Clear Piggy React components and provides detailed mobile optimization recommendations, focusing on:
- Touch Target Compliance - Ensures 44px minimum touch targets
- Responsive Design - Identifies Tailwind CSS mobile-first gaps
- Layout Complexity - Flags complex layouts needing mobile redesign
- Navigation Patterns - Validates mobile navigation best practices
- Financial UX - Specialized patterns for financial app components
- π€ AI-Powered Analysis using Claude Sonnet 4
- π± Mobile-First Focus with financial SaaS expertise
- π― Component-Level Insights with detailed scoring
- π Comprehensive Reports in JSON and HTML formats
- π§ Actionable Recommendations with implementation guidance
- π° Financial UX Patterns for transactions, budgets, and dashboards
Copy the environment file and configure:
cp .env.example .envEdit .env and set your configuration:
# Required: Your Anthropic API key
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Path to your Clear Piggy project
CLEAR_PIGGY_PROJECT_PATH=/path/to/your/clear-piggy/project
CLEAR_PIGGY_COMPONENTS_PATH=src/components
# Analysis configuration
ANALYSIS_OUTPUT_DIR=./analysis-reports
MIN_TOUCH_TARGET_SIZE=44
MOBILE_BREAKPOINT=768npm installFull Analysis (recommended first run):
npm run analyzeQuick Assessment (fast critical issues check):
npm run quickFinancial Components Only:
npm run financialPattern-Based Analysis:
npm start pattern Button # Analyze all Button components
npm start pattern transaction # Analyze transaction-related components| Command | Description |
|---|---|
npm run analyze |
Complete mobile optimization analysis |
npm run quick |
Quick assessment of critical issues |
npm run financial |
Focus on financial components only |
npm start pattern <name> |
Analyze components matching pattern |
npm run build |
Build TypeScript to JavaScript |
npm run lint |
Run ESLint |
npm run format |
Format code with Prettier |
Real-time analysis progress with:
- Overall mobile optimization score (0-100)
- Critical and high-priority issue counts
- Component-level scores and priorities
- Immediate action recommendations
- JSON Report:
./analysis-reports/clear-piggy-mobile-report-YYYY-MM-DD.json - HTML Report:
./analysis-reports/clear-piggy-mobile-report-YYYY-MM-DD.html
π Starting Clear Piggy mobile optimization analysis...
π Found 47 React components
π Analyzing component 1/47: TransactionList
π Analysis Results:
Overall Mobile Score: 73/100
Critical Issues: 3
High Priority Issues: 8
Components Needing Work: 12/47
π― Top Issue Categories:
β’ Touch Target Issues
β’ Responsive Design Gaps
β’ Navigation Issues
π¨ Immediate Actions Required:
β’ Fix 3 components with critical mobile issues
β’ Address touch target size violations (minimum 44px)
β’ Fix navigation accessibility issues- All
.tsx,.ts,.jsx,.jsfiles in your components directory - Automatic React component identification
- Financial component pattern recognition
- Identifies interactive elements smaller than 44px
- Checks buttons, links, form controls
- Provides size recommendations
- Scans for missing responsive breakpoints
- Identifies mobile-first design violations
- Suggests responsive class improvements
- Measures component nesting depth
- Analyzes Flexbox and Grid complexity
- Scores mobile compatibility
- Validates mobile navigation best practices
- Checks for hamburger menus and accessibility
- Identifies responsive navigation issues
- Transaction Lists: Virtualization, swipe actions, loading states
- Budget Charts: Touch interactions, mobile sizing, responsive design
- Dashboard Cards: Stacking patterns, progressive disclosure
- Forms: Input types, validation, mobile keyboards
| Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY |
required | Your Anthropic API key |
CLEAR_PIGGY_PROJECT_PATH |
./clear-piggy-project |
Path to your React project |
CLEAR_PIGGY_COMPONENTS_PATH |
src/components |
Components directory |
ANALYSIS_OUTPUT_DIR |
./analysis-reports |
Report output directory |
MIN_TOUCH_TARGET_SIZE |
44 |
Minimum touch target size in pixels |
MOBILE_BREAKPOINT |
768 |
Mobile breakpoint in pixels |
TABLET_BREAKPOINT |
1024 |
Tablet breakpoint in pixels |
Your Clear Piggy project should follow this structure:
clear-piggy/
βββ src/
β βββ components/
β β βββ ui/
β β βββ forms/
β β βββ charts/
β β βββ navigation/
β βββ pages/
β βββ types/
βββ package.json
βββ tailwind.config.js
- β Virtualization for performance
- β Swipe actions for quick operations
- β Pull-to-refresh functionality
- β Loading and skeleton states
- β Touch-interactive elements
- β Responsive sizing
- β Mobile-friendly tooltips
- β Accessible color schemes
- β Vertical stacking on mobile
- β Tap-to-expand functionality
- β Progressive disclosure
- β Quick action buttons
- β Appropriate input types
- β Real-time formatting
- β Mobile keyboard optimization
- β Touch-friendly validation
Each component receives scores (0-100) for:
- Touch Target Score: Interactive element compliance
- Responsive Score: Mobile-first design implementation
- Layout Score: Component complexity and mobile compatibility
- Navigation Score: Mobile navigation patterns
- Financial UX Score: Financial app-specific patterns
- Overall Score: Weighted average of all categories
- Critical: Touch target violations, navigation failures
- High: Poor overall score (<50), missing responsive patterns
- Medium: Layout complexity, minor UX issues
- Low: Good score with minor improvements possible
- β React 18 + TypeScript
- β Tailwind CSS + Framer Motion
- β Supabase integration analysis
- β Plaid API pattern detection
Add to your GitHub Actions workflow:
- name: Mobile Optimization Analysis
run: |
npm install -g clear-piggy-mobile-optimizer
clear-piggy-mobile analyze
# Upload reports as artifacts"No components found"
- Check
CLEAR_PIGGY_PROJECT_PATHpoints to correct directory - Ensure components directory exists with
.tsxfiles
"ANTHROPIC_API_KEY required"
- Set your API key in
.envfile - Get API key from Anthropic Console
"Failed to analyze component"
- Component may have syntax errors
- Check for unsupported React patterns
Enable detailed logging:
ENABLE_DETAILED_LOGGING=true npm run analyze- Fork the repository
- Create feature branch:
git checkout -b feature/new-analysis - Make changes and test thoroughly
- Submit pull request with clear description
- Add rule to
src/analyzers/mobile-optimizer.ts - Update TypeScript interfaces in
src/types/analysis.ts - Add tests for new functionality
- Update documentation
MIT License - see LICENSE file for details.
- π§ Email: support@clearpiggy.com
- π¬ Discord: Clear Piggy Developers
- π Issues: GitHub Issues
Built with β€οΈ for the Clear Piggy financial SaaS platform