🚀 The Universal Google Apps Script Primer

50 views
Skip to first unread message

SMAARTE Group

unread,
Nov 30, 2025, 3:08:48 AM (4 days ago) Nov 30
to google-apps-sc...@googlegroups.com
Hello,

I worked with Gemini to create a "primer" prompt and GS file template that you might find useful.  This was inspired by my own experience moving from session to session due to challenges with the context window, hallucinations, and numerous other issues, as well as a recent article from Anthropic

This concept isn't new, but I haven't seen much discussion about it because most posts focus on specific code or projects instead of a framework for improving the experience of coding with AI.

Please enjoy and happy holidays.


Regards,
Steve Horvath


Michael O'Shaughnessy

unread,
Nov 30, 2025, 6:25:26 PM (3 days ago) Nov 30
to google-apps-sc...@googlegroups.com
Nice work and I am intrigued....  I am growing as a programmer/developer so my projects are getting more complex.  I do use AI as an assistant in my coding and I find myself often having to repeat a lot of "prelimnaries" when I return to an AI for more work.  This "primer prompt" looks promising.  

Could you please give me just a quick overview of your workflow using this approach?  I am curious as to how you start a project, come back to make improvements and ultimately complete it (as if we are ever "truly" done with a project!!!😀).

Thanks,

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/CAMnbTs1OcyeEkOa3JkQhocO8fZfPzW%3DsrS2wtwrGXFHt5U0ZkQ%40mail.gmail.com.

SMAARTE Group

unread,
Nov 30, 2025, 7:04:53 PM (3 days ago) Nov 30
to google-apps-sc...@googlegroups.com
Hi Michael,

I jumped into coding with AI about five months ago. My goal is only to learn enough coding for an AI to handle the heavy lifting.  That works for the most part.  Here's my entire (succinct) thought process when developing GAS projects.

After spending many hours over the past 3 days developing an existing project further—first by using AI summaries from Workspace Flows, then by using Webhooks instead of another data retrieval method and finally by adding persistence for web sessions—I now feel the pain of not having stepped back to plan better for adapting / advancing the project and for failing to apply my own best practices.
  • My general approach when starting a project is to dictate (either typed or spoken) several project requirements.  I might have already created a Google Sheets or Docs or other file that I can upload from Drive so that the AI can review the information and ensure we are using the same terminology, column headers, etc.
  • Split large and/or complex projects into as many as two to three dozen GS files depending on the project's exact nature and complexity level.
  • Deploy every project.  Projects that do not need to be integrated into Google Workspace Flows can be deployed as Web Apps.  Having the history stored at the script level is helpful, but also see the next bullet point.
  • Use the Apps Script Exporter (I don't use a client-based developer tool).  You can search this Google Group for a slightly dated version of that project code that creates nicely formatted Google Docs files of scripts (even bound scripts if you add their IDs).  That runs every day and more often if I want a copy of everything that's changed for a given project.
  • I now use the ProjectBrain.gs as a consistent way to get the AI to summarize where we've been, where we are now and where we're going, along with what should remain unchanged and what should change.  It cuts down on my need to prompt and copy/paste prompts.  The ProjectBrain.gs could even contain the prompts.  That might be my next update to it!
    • Please feel free to share if you find ways to make it even more helpful.
    • I can foresee adding instructions such as, "Always format column headers 14 point, bold and centered vertically and horizontally and freeze the first row on any Google Sheet created by the script."
      • These kinds of repetitive instructions are available with client-side developer tools, but again, I don't use those, nor do I want to use them at this time.  My primary business is not developing code or apps or scripts, but I've taken this on because it helps me accomplish that business.
  • diffchecker.com is my best friend.  The AI often forgets and just generally screws things up (not necessarily hallucinations, just painful regressions for no good reason).  A quick diff check in certain circumstances saves headaches.
  • Don't be afraid to assemble guides for the AI like A Developer’s Guide to Creating Robust Google Workspace Flows with Apps Script.  The AI isn't omniscient.  It makes mistakes.  Reading and writing smartchips in Google Sheets using Chipruns seems to be an Achilles' heel.  Coding for Workspace Flows is another (that's why I created that guide: not for me, but for the AI).  Create guides to help the AI understand HOW to accomplish what you want.  Give the AI a couple examples and it will code correctly most of the time.
    • Don't bloat your AI helper: give it only what it needs.  Understand the limitations of the context window.  When answers become less coherent and errors crop up more often, figure out how to move on to the next converastion with a fresh window.
      • Use ProjectBrain.gs!


Regards,
Steve Horvath



Keith Andersen

unread,
Nov 30, 2025, 11:04:56 PM (3 days ago) Nov 30
to google-apps-sc...@googlegroups.com
In my experience I've found that segmenting my project into small chunks and building layer upon layer of process code works best. 

Giving too many tasks for AI to build gets difficult to manage and consumes much time in fixing mistakes made by AI as its understanding is stretched over too many parameters. 

Layer by small layer works best.

That creates a scenario where you are re-doing functions to adapt to new layer processes...but I find I do much less correcting and recurrent testing. 

This requires some time/thought to break down a project into manageable chunks.

You probably know this already...but it's my 2¢ worth 

Cheers



My website: https://sites.google.com/view/klaweb/
Passions: God, Family, Scriptures, Learning, Data Management, Google Sheets + App Script and much more!

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Michael O'Shaughnessy

unread,
Dec 1, 2025, 6:40:08 PM (2 days ago) Dec 1
to google-apps-sc...@googlegroups.com
Thanks Steve for your description of your process!  I am currently "percolating" on this and finding a way to test it out to see if it fits my work needs.

@Keith - Yes, small layer by layer is my approach as well.  My issue is I may work on a project for an hour or so on Monday and not get a chance to come back to it for over a week.  Trying to remember to document what I did and where I was is difficult.  The brains.gs suggested by Steve seems to be a chance to do some "on the fly" documentation.

I am a big fan of GitHub and I use Google Apps Script GitHub Assistant to keep my projects at least in some kind of version control.  What I am now wondering is there a way to do some automation with GitHub?  Maybe have it update a doc in the repo?  Maybe have it automatically back up the brain.gs?  I am becoming fond of Claude when it comes to programming and I love the ability to add a repo to a prompt.  I don't know.  I just like the idea of the brain.gs to keep track of what was done and where the project is headed.

At any rate, this has given me something to think about!!

Reply all
Reply to author
Forward
0 new messages