Skip to content

Instantly share code, notes, and snippets.

@rajivmehtaflex
Last active July 15, 2025 06:35
Show Gist options
  • Save rajivmehtaflex/6df5101c1970575bd32eaad55b2951be to your computer and use it in GitHub Desktop.
Save rajivmehtaflex/6df5101c1970575bd32eaad55b2951be to your computer and use it in GitHub Desktop.
All About Prompt
  • For complex tasks, I never ask for code first. My initial prompt is to create a plan "Create a detailed implementation plan for [FEATURE, BUG]".
  • Create multiple hierarchical GEMINI md files defining roles, helpful code snippets, and a strict rule: "You cannot edit this file."
  • Collaboration >> YOLO. I don't use a "YOLO mode" and rather intercept and re-prompt.
  • Use MCP servers to access bugs, issues, browsers, Github (& internal tools), or run code in sandboxes.
  • Leverage the 1M Context. Instruct it to read a lot of files into context or use “@” primitives.
  • Code → Test → Commit. I force it to write tests or execute code snippets and have it fix it in a loop.

Gemini CLI comes with a free usage for Gemini 2.5 Pro. Give it a try and let us know what you think.

You are Gemini CLI, operating in a specialized Explain Mode. Your function is to serve as a virtual Senior Engineer and System Architect. Your mission is to act as an interactive guide, helping users understand complex codebases through a conversational process of discovery.

Your primary goal is to act as an intelligence and discovery tool. You deconstruct the "how" and "why" of the codebase to help engineers get up to speed quickly. You must operate in a strict, read-only intelligence-gathering capacity. Instead of creating what to do, you illuminate how things work and why they are designed that way.

Your core loop is to scope, investigate, explain, and then offer the next logical step, allowing the user to navigate the codebase's complexity with you as their guide.

Core Principles of Explain Mode

  • Guided Discovery: You do not provide a single, massive explanation. You break down complex topics into manageable parts and ask the user where to begin. Your goal is to lead an interactive tour, not deliver a lecture.
  • Uncompromising Read-Only Access: You are empowered to perform deep system interrogation by mapping dependencies, tracing execution paths, and cross-referencing code with external documentation.
  • Absolutely No Modifications: You are fundamentally an analysis tool. You are prohibited from any action that alters the project or system.
  • Context-Aware Follow-up: Every explanation you provide must end by proposing specific, logical next steps for a deeper dive, based on the information you just presented.

Interactive Steps

  1. Acknowledge & Decompose: Confirm you are in Explain Mode. Analyze the user's initial query. If the query is broad (e.g., "explain the auth system," "how does the database work?"), your first response must be to decompose the topic into a list of specific sub-topics. You will then ask the user to choose which area to investigate first. Do not proceed until the user provides direction.
  2. Conduct Focused Investigation: Based on the user's choice, perform a targeted investigation. Before presenting the full explanation, briefly summarize your investigation path (the "Investigation Footprint").
  3. Synthesize the Technical Narrative: Formulate a clear, structured explanation for the specific sub-topic the user selected. Connect concepts, explain design patterns, and clarify the responsibilities of the relevant code.
  4. Present Explanation & Propose Next Steps: Present your focused explanation. Critically, conclude your response by offering a list of new, context-aware questions that represent logical next steps. This guides the user deeper into the system. For example, after explaining a specific API route, you might ask if they want to see the service it calls, the data model it uses, or its authentication middleware.

image

You are Gemini CLI, an expert AI assistant operating in a special 'Plan Mode'. Your sole purpose is to research, analyze, and create detailed implementation plans. You must operate in a strict read-only capacity.

Gemini CLI's primary goal is to act like a senior engineer: understand the request, investigate the codebase and relevant resources, formulate a robust strategy, and then present a clear, step-by-step plan for approval. You are forbidden from making any modifications. You are also forbidden from implementing the plan.

Core Principles of Plan Mode

  • Strictly Read-Only: You can inspect files, navigate code repositories, evaluate project structure, search the web, and examine documentation.
  • Absolutely No Modifications: You are prohibited from performing any action that alters the state of the system. This includes:
    • Editing, creating, or deleting files.
    • Running shell commands that make changes (e.g., git commit, npm install, mkdir).
    • Altering system configurations or installing packages.

Steps

  1. Acknowledge and Analyze: Confirm you are in Plan Mode. Begin by thoroughly analyzing the user's request and the existing codebase to build context.
  2. Reasoning First: Before presenting the plan, you must first output your analysis and reasoning. Explain what you've learned from your investigation (e.g., "I've inspected the following files...", "The current architecture uses...", "Based on the documentation for [library], the best approach is..."). This reasoning section must come before the final plan.
  3. Create the Plan: Formulate a detailed, step-by-step implementation plan. Each step should be a clear, actionable instruction.
  4. Present for Approval: The final step of every plan must be to present it to the user for review and approval. Do not proceed with the plan until you have received approval.

Output Format

Your output must be a well-formatted markdown response containing two distinct sections in the following order:

  1. Analysis: A paragraph or bulleted list detailing your findings and the reasoning behind your proposed strategy.
  2. Plan: A numbered list of the precise steps to be taken for implementation. The final step must always be presenting the plan for approval.

NOTE: If in plan mode, do not implement the plan. You are only allowed to plan. Confirmation comes from a user message.

Goal:

I want to learn and master [Primary Technology/Tool] within the context of [Programming Language/Context, e.g., Python, JavaScript, DevOps]. The learning path should be comprehensive, practical, and focused on real-world application development, taking me from fundamental concepts to advanced, professional use cases.

Core Directives:

  1. Generate a Comprehensive Table of Contents (TOC):

    • Before we begin, use your internet search capabilities to research and generate a detailed, logically structured TOC.
    • The TOC should cover the topic from the ground up, including beginner, intermediate, and advanced concepts.
    • It must be reviewed for completeness to ensure no critical, real-world topics are missed.
  2. Address Real-World Complexity:

    • The TOC and the individual lessons must explicitly address the challenges of using [Primary Technology/Tool] in a professional, complex project. This includes, but is not limited to:
      • Project Structure: How to organize code, tests, and configurations in a large project with many folders and subfolders.
      • Dependency Management: How to handle imports and dependencies correctly.
      • External Interactions: How to manage and test interactions with external systems like databases, third-party APIs (HTTP requests), and message queues.
      • Integration: How the tool fits into a larger ecosystem, such as a CI/CD pipeline.
  3. Follow a Step-by-Step, Interactive Flow:

    • We will proceed through the TOC one topic at a time.
    • At the end of each topic, you must ask me for questions and get my explicit permission ("Ok", "Continue", etc.) before moving to the next topic.

Content Format (for each topic):

For each topic in the TOC, you must provide the information in the following three-part format:

  • A. Brief: A concise summary of the topic, explaining what it is and why it is important.
  • B. Real-World Use Case: A descriptive scenario explaining where and why a developer would use this feature in a real job. Describe the problem or situation that this topic helps solve.
  • C. Practical Implementation: A working code example or script. This implementation should be complete, runnable, and directly demonstrate the concept from the topic.

How to Use This Template:

You can now copy and paste this entire prompt into a new conversation. Just replace the [placeholders] at the top. For example:

  • To learn Docker: [Primary Technology/Tool] -> "Docker", [Programming Language/Context] -> "DevOps and Backend Development"
  • To learn React: [Primary Technology/Tool] -> "React", [Programming Language/Context] -> "Modern Frontend Web Development"
  • To learn SQL: [Primary Technology/Tool] -> "SQL", [Programming Language/Context] -> "Database Management and Data Analysis"

This prompt effectively captures the high standards for learning that you have communicated to me.

Does this capture what you were looking for?

If so, shall we finally dive into our revised Topic 3: Assertions and Introspection from our Pytest learning path?

Slide Creation
Create a modern, visually appealing slide presentation on the topic: “The state of artificial intelligence in 2025.”
The presentation should consist of 6–8 slides and have the following structure:
Title slide: Title, subtitle, date, name of the presenter (if applicable)
Introduction: What has changed since 2023/2024? Why is 2025 a crucial year?
Technological advances: multimodal models, AGI-related developments, new benchmarks (e.g., GPT-5, Gemini 2.5, Claude 3.5, xAI)
Ecosystem & investments: Important company developments (e.g., OpenAI, Google DeepMind, Meta, Anthropic), capital flows, mergers
Politics & regulation: EU AI Act, US defense projects, open source debate
Social impact: Job changes, education, trust, criticism
Outlook: What trends are emerging? What can we expect in 2026?
Concluding slide: Key takeaways or quote
Please use a clear visual structure with concise statements, bullet points, icons, or graphics (if available).
1. write a script for a bouncing yellow ball within a Rhombicosidodecahedron, make sure to handle collision detection properly. make the Rhombicosidodecahedron slowly rotate. make sure ball stays within the Rhombicosidodecahedron. implement it in p5.js and wrap it under html, so I can paste it to online html viewer
2. write a script for 100 bouncing bright yellow balls within a sphere, make sure to handle collision detection properly. make the sphere slowly rotate. make sure balls stays within the sphere. implement it in p5.js and wrap it under html, so I can paste it to online html viewer
3. write a html,css,jquery,p5.js program that shows a ball bouncing inside a spinning hexagon. The ball should be affected by gravity and friction, and it must bounce off the rotating walls realistically and wrap it under html so i can paste it.
4. use threejs make a fantastic 3d scene use your imagination more magic go all out and wrap it under html, so I can paste it to online html viewer
5. Create a single HTML file that uses Three.js to visualize a Rubik's Cube with realistic lighting and interactive controls. The cube should be built from 27 cubies with standard Rubik's Cube coloring. Include buttons for standard moves (U, U′, D, D′, L, L′, R, R′, F, F′, B, B′) that animate a 90° rotation on the appropriate face. Also, implement a scramble function that performs a series of random moves (recording each move), and an automatic unscrambler that, every 500 ms, applies the inverse of the recorded moves until the cube is solved. The solved state should be determined by comparing each cubie's current world position and rotation with its originally stored "solved" state (using a small tolerance) etc
6. Create a JavaScript animation of falling letters with realistic physics. The letters should: * Latters Should ‘Gajraj , Gajanan ,Gandev’ * Appear randomly at the top of the screen with varying sizes * Fall under Earth's gravity (9.8 m/s²) * Have collision detection based on their actual letter shapes * Interact with other letters, ground, and screen boundaries * Have density properties similar to water * Dynamically adapt to screen size changes * Display on a dark background and wrap it under html, so i can paste it to online html viewer
7. Build a p5js endless runner game with pixelated dinosaurs and interesting backgrounds.
8. Generate an HTML file that displays a colorful particle simulation of a reflection nebula.
9. Make a p5js simulation of 30 colorful boids swarming within a rotating hexagon.
10. Use p5js to explore a Mandelbrot set.
11. Develop a p5js demo of an interactive blend of fish and nebulae that visualizes what the fish are “thinking.”
12. In pure three.js, without downloading any assets or textures, create a flight simulator game where I can fly an airplane. Make sure it runs in the browser. (Corresponds to Flight Simulator Prompt description)
13. Write a p5.js script that simulates 25 particles in a vacuum space of a cylindrical container, bouncing within its boundaries. Use different colors for each ball and ensure they leave a trail showing their movement. Add a slow rotation of the container to give better view of what's going on in the scene. Make sure to create proper collision detection and physic rules to ensure particles remain in the container. Add an external spherical container. Add a slow zoom in and zoom out effect to the whole scene. (Corresponds to Particles in Cylinder description)
14. Generate an advanced p5.js simulation depicting multiple, mutually interacting balls subject to configurable gravity, air resistance, and inter-object friction, bouncing dynamically with accurate conservation of momentum within a continuously rotating regular hexagon whose vertices may subtly oscillate, ensuring physically precise collision detection and elastic/inelastic response against the moving, potentially deforming walls, and include interactive sliders controlling gravity strength, air resistance factor, hexagon angular velocity, vertex oscillation amplitude/frequency, ball elasticity (coefficient of restitution), and the initial number of balls. Single script. (Corresponds to Bouncing Balls Hexagon description)
15. Create an interactive simulation that shows water molecules forming and breaking hydrogen bonds. The visualization should depict molecular motion, with oxygen in white and hydrogen in red. A temperature slider should control movement speed and bond stability. Use HTML, CSS, and JavaScript in a single file for real-time interaction. (Corresponds to Water Molecule description)
16. Design a kaleidoscope using p5js that generates symmetrical patterns based on mouse movements.wrap it under html ,so I can paste it to online html viewer.
17. Create a rubik cube in p5.js ,I can play with it,you need to apply generator AND solver mode for this rubik cube,make sure wrap it in html one file,so i can paste it to online html viewer (Corresponds to prompt #4 in your final list)
18. Code a TV that lets me change channels with number keys (0-9). Come up with an idea for a channel for all numbers, inspired by classic genres of TV channels. Show detailed interesting animations for content and a creative name of channel on screen. Return a 800x800 P5.js sketch (no HTML) on black background. Make sure the content of all the channels stays masked to the TV set screen area,make sure wrap it in html one file,so i can paste it to online html viewer (Corresponds to prompt #5 in your final list)
19. make a app called chatgpt ad maker that takes in a video and does a halftone effect with sliders to adjust dot size and wrap it under html, so I can paste it to online html viewer
20. Build a Healthcare CRM to streamline patient communication, appointment scheduling, record management, and billing processes…,make sure wrap it in html one file,so i can paste it to online html viewer
21.
Write a complete HTML/JavaScript program using Three.js that renders a fully interactive Rubik's Cube simulation of any size up to 20x20x20. The user should be able to specify the cube size dynamically (e.g., via an input or a variable), and the cube should be constructed accordingly with proper color-coded faces (standard Rubik's Cube colors: white, yellow, red, orange, blue, green). Include camera controls for rotating the view, and allow for basic user interaction such as rotating layers of the cube via mouse or UI buttons.
Additionally, implement a "Solve" button that, when clicked, animates the cube being solved step-by-step visually. You can use a simplified solving algorithm (you do not need to match real Rubik's solving logic) - the goal is just to animate the cube returning to its original solved state, one move at a time, with clear transitions.
Requirements:
Use Three.js for all 3D rendering.
Cube size should be adjustable up to 20x20x20.
Solver animation should be smooth and readable.
Keep performance in mind for larger cubes (e.g., 20x20).
22.
Generate self-contained HTML code (with embedded CSS in and JavaScript in ) for an interactive web animation using pure HTML5 Canvas and JavaScript (no external libraries). The animation features a dynamic, large, white hexagonal maze on a solid black background, running continuously and smoothly. The canvas must resize to fill the entire browser window, with all elements scaling accordingly.
Maze Details:
Multiple (5) concentric white hexagonal outlines (layers), each rotating independently at increased random speeds (e.g., (Math.random() - 0.5) * 0.02) and directions.
Random large gaps (1-2 per hexagon, excluding outermost) in walls for ball passage.
No internal connecting lines within any hexagonal layer (originally removed only in the fourth layer from center, but now none at all).
Moving Elements:
Five small, brightly colored bouncing balls (red, green, blue, yellow, pink) moving independently with realistic physics: they bounce off maze walls (concentric outlines only, respecting all lines without crossing—use substeps and collision detection for accuracy).
A prominent red line gliding clockwise along the outermost hexagon's perimeter (non-interacting with balls/maze); its path shifts with the outermost layer's rotation.
Implement drawing, physics, and animation using Canvas API. Ensure balls start in the center and maintain colors. Output the full HTML code.
an otter on an airplane using wifi, on their laptop screen is image generation software creating an image of an otter on a plane using wifi

vibe-coding step-by-step guide:

  1. Write down a high-level plan
  2. Break it down into small phases
  3. Focus on one phase at a time

For each phase:

  1. Add as much context as possible to the plan
  2. Include the things you want to build
  3. Include the things you don't want to build
  4. Commit your code
  5. Give the plan to the agent to start building

For each iteration of the agent:

  1. Review everything the agent built
  2. Provide clear feedback for refinements
  3. Update the plan with your feedback
  4. Discard code and restart anytime the agent messes up

As I build critical functionality:

  1. Write unit tests for any critical piece of code
  2. Ensure these tests run after each agent iteration

Tips:

✦ You are right to point this out, and I appreciate you asking for clarification. It helps us work better together. The issue stems from a combination of how I interpreted the prompt and the strong influence of the reference file.

Here is a breakdown of the reason for the discrepancy:

  1. Influence of the Reference File (sample.py): The sample.py file implemented a command-line interface where the user had to know the specific command to type (e.g., upload_file_to_s3('~/Pictures/cat.png')). My primary goal was to replicate that functionality in main.py based on your instructions. I interpreted "move related logic and interaction with end user to main.py files" as "make main.py work like sample.py."

  2. Ambiguity in "Ask for File Uploads": This is the core of the misunderstanding.

    • My Interpretation: I interpreted "ask" as "provide a mechanism for the user to initiate an upload." In a CLI context, this often means printing instructions on how to use a command, which is what I did (print(" - upload <path_to_file>")). I made it a user-initiated command.
    • Your Likely Intent: You likely meant for the program to be more proactive and literally ask a question to the user, such as Would you like to upload a file? (y/n). This is a more interactive and guided approach.

What was missed was the style of interaction you wanted. I implemented the feature functionally, but not with the user-friendly, interactive flow you had in mind.

How to Improve Our Collaboration (What I need from you next time):

To prevent this in the future, it would be incredibly helpful if you could be more specific about the user interaction flow. For example, instead of:

"you need to ask file uploads and take physical file path as input parameter"

A more precise prompt would be:

"When the script starts, interactively prompt the user with the question 'Would you like to upload a file?'. If they say yes, then prompt them for the file path. The file upload should happen before they start chatting with the agent."

By being more explicit about the desired dialogue or sequence of events, you can help me bridge the gap between a functional implementation and the exact user experience you envision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment