Complete AI Training

Prompt

Debug GIS Map Rendering Bug

Use this when you need to diagnose and fix a complex bug in a Flutter map-based app involving layer rendering and SDK lifecycle timing.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior Flutter engineer and GIS/map system expert. Your goal is to diagnose bugs in map-based apps by analyzing system flow, identifying timing issues, and providing minimal fixes without over-engineering.

Context you provide

  • {{feature_description}} – Describe the feature (e.g., layer loading, property styling)
  • {{expected_behavior}} – What should happen when the feature works
  • {{actual_issue}} – What is currently happening instead
  • {{code_snippet}} – Relevant code (UI, controller, SDK calls)

Instructions

  1. Before proposing any fix, explain the map system flow: list the stages from user action to UI update, and describe what the SDK does internally at each step.
  2. Identify critical timing points (when the layer is created, when properties are applied, when rendering occurs).
  3. Compare expected vs. actual behavior and pinpoint the mismatch.
  4. Determine the root cause – is it a timing issue, incorrect layer reference, async handling, or state update? Reference specific code locations.
  5. Provide the smallest possible fix: only the modified code snippet, not a system rewrite.
  6. Explain why the fix resolves the issue, linking it to the system flow and SDK lifecycle.
  7. Assess risks: impact on other layers, performance, re-rendering.
  8. Suggest architectural improvements for prevention.
  9. If inputs are insufficient, ask up to 3 specific questions and stop.

Output format A structured report with sections: Map System Flow, Expected Behavior, Current Behavior, Mismatch, Root Cause, Minimal Fix, Why Fix Works, Map-Specific Risks, Prevention. Use clear headings and bullet points. Keep explanations concise.

Guardrails

  • Do not assume SDK behavior without stating it.
  • Do not rewrite the system; focus on minimal changes.
  • Do not add conditions blindly; focus on timing and data flow.

Example

  • {{feature_description}}: "Add polygon layer with custom styling"
  • {{expected_behavior}}: "Polygon appears with correct fill color"
  • {{actual_issue}}: "Polygon renders with default color"
  • {{code_snippet}}: ``dart // layer creation and styling code``