Skip to content

Instantly share code, notes, and snippets.

@mohamedrashad102
Created February 26, 2026 09:17
Show Gist options
  • Select an option

  • Save mohamedrashad102/fee0e0c274bba11c607f7a91c270d3ee to your computer and use it in GitHub Desktop.

Select an option

Save mohamedrashad102/fee0e0c274bba11c607f7a91c270d3ee to your computer and use it in GitHub Desktop.
Prompt template to auto-generate Flutter lib/core reference documentation using AI assistants like Claude or OpenCode.

Prompt Template: Generate Core Reference Documentation

Use this prompt with an AI coding assistant to generate a core library reference document for any Flutter project.


Prompt

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.

Example Output

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

Tips for Best Results

  1. Be specific about the project: "This is a skating club management app in Arabic"
  2. Mention language: "The app uses Arabic (RTL) localization"
  3. Note special requirements: "We need to document payment methods and session types"
  4. Check existing patterns: Look for how core is already used in the presentation layer

Customization Options

For Large Projects

Add to prompt:

Also document:
- Navigation system (GoRouter setup)
- State management patterns (Riverpod/BLoC providers)
- Network layer (API clients, interceptors)
- Local storage utilities

For Design System Focused

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

For Feature-Focused

Add to prompt:

Prioritize documenting:
- Domain models and entities
- Use cases
- Repository interfaces
- Error handling patterns

Usage Example

# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment