Use this prompt with an AI coding assistant to generate a core library reference document for any Flutter project.
Explore and document the lib/core/ directory of this Flutter project to create a quick reference guide for the presentation layer.
1. Explore lib/core/ thoroughly and identify all:
- Design system tokens (spacing, colors, typography, radius, shadows)
- Reusable widgets (buttons, inputs, cards, status indicators, etc.)
- UI components (dialogs, modals, sheets)
- Constants and enums
- Utility functions (validators, date utils, assets)
2. For each category, provide:
- File path
- Key classes/functions available
- Code examples showing how to use them
3. Create a markdown file (docs/core_reference.md) with:
- Design system section (AppSpacing, AppColors, AppTextStyles, AppRadius)
- Core widgets section with usage examples
- UI components section
- Constants/enums section
- Utilities section
- Quick reference for replacing hardcoded values
- File structure overview
Focus on presentation layer needs - styling, widgets, dialogs, and common patterns.
The generated file should include:
- Design System: All spacing constants, color palette, text styles, border radii
- Widgets: StatusBadge, LoadingWidget, CommonElevatedButton, AppTextField, DashboardCard, etc.
- Dialogs: Delete dialog, confirmation dialog, custom dialog scaffolding
- Constants: Any project-specific enums (UserRole, SessionStatus, etc.)
- Utilities: Validators, date formatters, asset paths
- Be specific about the project: "This is a skating club management app in Arabic"
- Mention language: "The app uses Arabic (RTL) localization"
- Note special requirements: "We need to document payment methods and session types"
- Check existing patterns: Look for how core is already used in the presentation layer
Add to prompt:
Also document:
- Navigation system (GoRouter setup)
- State management patterns (Riverpod/BLoC providers)
- Network layer (API clients, interceptors)
- Local storage utilities
Add to prompt:
Focus heavily on:
- All color variants and their usage
- Typography scale and font families
- Spacing grid system
- Animation utilities
- Responsive design helpers
Add to prompt:
Prioritize documenting:
- Domain models and entities
- Use cases
- Repository interfaces
- Error handling patterns
# With Claude Code
claude "Explore and document the lib/core/ directory - create docs/core_reference.md with usage examples for all design system tokens, widgets, and utilities"
# With OpenCode
Use the prompt above with the explore agent