Context Summary for Large AIP Coding Projects with Gemini AI

Master the art of Context Distillation to keep your AI development workflow smooth and efficient

Here is your Reboot Kit to use for any current or future project.


Part 1: The Generic "Distillation" Prompt

Paste this into any long-running, laggy, or complex chat when you are ready to start fresh.

Prompt:

"This chat is becoming too long to manage. Please provide a Technical Handover Summary that I can paste into a new session.

Please structure the response as follows:

  1. Project Identity: A 2-sentence summary of the app's purpose and the tech stack.
  2. Current Source of Truth: The most recent, working versions of the core files we are actively editing (provide full code for [insert file names]).
  3. Database Schema: A summary of the current tables and key relationships.
  4. Resolved Logic: A list of features that are 100% finished and do not need to be discussed again.
  5. The 'Active Front': A clear description of the current task we are in the middle of and any specific bugs we are currently fighting.

Ensure the code blocks are clean and labeled so I can copy them easily."


Part 2: The Simple Guide to "Rebooting" a Project

Follow these 4 steps to keep your development workflow smooth:

1 Step 1: The "Freeze"

When the browser starts to lag or you finish a major feature:

  • Stop coding.
  • Use the Distillation Prompt above in the current chat.
  • Important: Do not scroll up! Wait for Gemini to finish generating the summary at the bottom.
2 Step 2: The "Vault"
  • Open your local code editor (like VS Code or Notepad++).
  • Copy the "Source of Truth" code blocks Gemini just gave you.
  • Save them as your latest local versions. This ensures that even if the browser tab crashes during the copy-paste, your work is safe on your hard drive.
3 Step 3: The "Launch"
  • Start a brand new chat.
  • Rename it immediately (e.g., "PROJECT NAME - Phase 2" or "PROJECT NAME - [Date]").
  • Pin the new chat and unpin the old one. (You can keep the old one for reference, but don't type in it anymore).
4 Step 4: The "Injection"
  • Paste the Technical Handover Summary into the first message of the new chat.
  • Add one final line: "Do you understand the current state of the project? If so, let's begin with [Next Task]."

Why This Works for Your Specific Style

No More "Search & Scroll"

Since the new chat only has one message (the summary), the scroll bar is huge and easy to move.

Better "Instruction Following"

Gemini's "attention" is limited. In a 50-message chat, it loses focus. In a 1-message chat, it follows your logic perfectly.

Crash Prevention

Your RAM usage will drop from Gigabytes back down to Megabytes instantly.


Phase 2 Roadmap: drsergio.tl (Medical Portal)

This project is a perfect candidate for the "Reboot" method because medical apps require very high precision—you don't want old, buggy code fragments interfering with vital sign tracking or medication schedules.

The "Reboot" Injection

To move this project from Phase 1 (Core Setup) to Phase 2 (Advanced Features), use the Distillation Prompt we discussed. Focus on the Vital Signs Schema and the Consultation Form logic as your "Source of Truth."

Core Development Pillars for Phase 2

Once the new chat is active, focus on these three specific upgrades:

Interactive Health Trends (Visuals):
  • Transition from just storing vital signs to visualizing them.
  • Task: Integrate a lightweight library (like Chart.js) to show a patient's blood pressure or glucose levels over time.
Dynamic Prescription PDF Generator:
  • Task: Create a backend script that takes the doctor's input and generates a clean, printable PDF prescription with a unique QR code for pharmacy verification (linking back to your Aimoruk project logic).
Security & Privacy Hardening:
  • Task: Implement "Row Level Security" or strict session checks to ensure patients can only see their own data, and doctors can only see their assigned patients.
Suggested "Next Step" Prompt for the New Chat

"The core patient registration and vital sign database are now stable. For Phase 2, I want to focus on the Doctor's Dashboard. Please help me design a view where the doctor sees a list of 'Alerts' (patients with abnormal vital signs) at the top, followed by a daily consultation schedule."


How to Apply This to Your Other Projects

Project Phase 2 Focus (The "Clean" Start)
Aimoruk (Pharmacy) Integrating the Rider Tracking system and real-time order status updates.
ID Registration Batch processing: Allowing an admin to generate 10+ ID cards at once in a printable PDF grid.
Lawyer Website The Document Vault: A secure area where clients upload legal evidence for review.