8 daily ways I use AI as an Engineering Manager to Level Up my work
No BS practical everyday ways I use Ai for coding, planning, incidents, docs, complex queries, writing unit tests, debugging, and more
One of the crazy things about being an engineering manager or senior/staff/principal engineer is the breadth of skills required to be effective at your job.
One minute you are leading a standup call, then next leading a Sev 2 incident across a couple teams, the next having a 1:1 career coaching conversation, then next writing out some missing docs for your onboarding engineers, and on and on.
Oh, not to mention the 3-6 hrs of back to back meetings ๐
Ai has been a new unlock for me in my day to day work. It has taken over my job, but itโs definitely helped me save time, reduce exhaustion, level up my skills, and help accelerate the growth of my team, our products, and my career.
I hope some of these ways Iโve found it usefule sparks ideas of ways you can use it to be more productive as well as grow as an engineer/leader.
fyi: My favorite ai tools/partners are currently Claude 4.0, and Gemini 2.5 Pro.
Letโs goo! ๐๐ผ๐
Writing SQL queries
Pretty much every day Iโm querying one of our many databases to look up a user, check why a marketing message failed, remember what the table structure is, etc. 70% of those queries are pretty basic and straightforward.
Whatโs harder for me is building out reporting that spans multiple tables and answers product and business questions for stakeholders. Ai is super helpful for building Snowflake dashboards โ or any kind of SQL backed reporting dashboards or queries.
Hereโs a real example chat I had with Claude:
how can I make a week over week graph for this query?
select count(delivered_at) from loyalty_campaigns_history history join loyalty_campaigns campaigns on campaigns.id = history.campaign_id
where history.created_at = :daterange // snowflake date range
and campaigns.brand_id = :customer_brand // snowflake brand dropdown
Claude spit out a new query using DATE_TRUNC to group the number of loyalty offers sent to guests week over week โย however it was super messy and didnโt quite do what I wanted.
I dug around in snowflake and found a nice week over week graph I liked and fed that as context to claude:
I have another query listed here that does what I want, can you convert it to use a similar format?
<my-other-graphs-query>
Bingo. It spit out a query that looked decent as well as instructions on how to add a graph in snowflake.
Next step was a few tweaks to formatting so it would read better for stakeholders.
awesome, that got me this: <screenshot-from-snowflake>. anyway to format those numbers?
Claude spit back:
WITH WeeklyData AS (
SELECT
DATE_TRUNC('WEEK', history.sent_at) AS week_start,
COUNT(sent_at) AS delivery_count,
p.program_name as "Program"
FROM loyalty_campaign_history history
JOIN loyalty_campaigns campaigns
ON campaigns.id = history.campaign_id
JOIN brands b
ON campaigns.brand_id = p.program_id
WHERE
history.sent_at BETWEEN DATEADD(WEEK, -12, DATE_TRUNC('WEEK', CURRENT_DATE())) AND CURRENT_DATE()
AND campaigns.brand_id = :brand
GROUP BY week_start, brand_name
ORDER BY week_start
)
SELECT
week_start AS "Week Starting",
TO_VARCHAR(delivery_count, '999,999,999') AS "Delivered Count",
delivery_count AS "Value For Chart",
"Brand"
FROM WeeklyData
ORDER BY week_start
Now hereโs the part I recommend to everyone. Donโt stop here!
Whenever ai spits out something new you donโt quite understand, ask it about it โย just like if you are googling around and find some code, take time to understand it!
can you help me understand some more about <DATE_TRUNC>, and <DATEADD> parts of this? I feel comfortable writing all of this sql and understanding everything except for that part.
DATE_TRUNC and DATEADD are powerful date manipulation functions in Snowflake that can be very useful for time-based analysis.
DATE_TRUNC Function
DATE_TRUNC('WEEK', history.created_at) takes two parameters:
The time unit to truncate to ('WEEK' in this case)
The timestamp you want to truncate
What it does: It rounds down a timestamp to the beginning of the specified time unit. For example:
// bunch of examples for DATE_TRUNC, and then continues on with DATEADD
Ok cool โย way less magic than before. The next time I need to build one of these graphs, I can probably just write it out by hand if needed, and/or actually understand how the query works and why ai spit it out.
Excel/Sheets formulas
Last week we had an issue where a client mentioned that they had provided a list of 120k phone numbers, but only 90k had been uploaded into our system. We got the csv and I immediately noticed a few issues.
We had a column named โmobileโ and a column named โphoneโ
Mobile was using +1 syntax, and phone wasnโt
There were some duplicates between the columns
There were rows that had both mobile and phone, and some that only had one or the other
I couldnโt remember all the formulas off the top of my head, but I knew what I wanted to do, so I fired up Gemini.
First I asked Gemini to help me remove all the +1s from the phone column. It quickly gave me instructions to find and replace/remove them with a regular expression.
Next I wanted to merge the โphoneโ and โmobileโ columns and remove nulls:
for an advanced null calculation, how can I count non null between two columns, and no duplicates between columns?
A: =COUNTA(UNIQUE(FLATTEN(A:A, B:B)))
I kept working back and forth with Gemini on a bunch of different find/replace/remove-duplicates/compare lists and got our client the answer within 30 mins or so.
Without Gemini, I would have been googling for hrs, and likely taking hrs writing a custom script that would have taken much longer to figure out.
Here are some fun things I learned that I now have bookmarked for future investigations:
How to count non nulls in this column starting at row 5
=COUNTA(B5:B)
How to join up two columns of phone numbers and count non-null unique values between them
=COUNTA(UNIQUE(FLATTEN(E:E, F:F)))
How to check the email and phone and mobile columns and figure out null rows that have neither
=SUM(ARRAYFORMULA((ISBLANK(B:B))*(ISBLANK(E:E)*(ISBLANK(F:F)))))
How to find all the members in list A that donโt match a phone or email in list B
=FILTER(MainList!B:E, ISNA(MATCH(TRIM(MainList!B:B), TRIM(SubSetList!D:D), 0)) + ISNA(MATCH(TRIM(MainList!E:E), TRIM(SubSetList!C:C), 0)))
Gemini + sheets is ๐ช for all kinds of things like this!
Debugging
I had made a few modifications to a Vue component that was well tested with Jest unit tests and some of them started failing even though I hadnโt seemingly modified the areas they were testing.
I worked on it for a while myself between various meetings, but couldnโt seem to figure out what was going wrong. I spun up Gemini and gave it this:
I have an error about a failing test:
<output from `yarn test`>
Here is the vue file code:
<vue component code>
Here is my unit test file:
<jest unit test file>
At first it sent me on a wild goose chase with this answer:
It looks like you're running into a classic Vue anti-pattern that's causing unpredictable behavior in your tests. The issue stems from directly mutating a prop, which can lead to state inconsistencies.
Try removing the prop mutation and it should fix the issue.
Tried that didnโt work. โ๐ซ I think this is where some people would just give up and say โai doesnโt work for meโ.
Thatโs where you need to take a step back and go back to your core debugging skills. Break things down smaller or think about it from a different angle and come back.
I had the idea to use `it.only` on my failing test to see what was up. Suddenly it passed. I removed that `.only` and it failed again.
I had an inkling that there was either a race condition or state modification in another test. Next, I went one by one through the tests and used `.skip` on them until my failing test passed. Bingo, skipping two of them fixed it.
I brought the jest output back into Gemini and gave it the new information.
if I skip these two tests, the failing ones pass:
<jest pass/fail output>
<skipped tests code>
A:
That's the key piece of information we needed! The fact that skipping those two tests makes the others pass confirms the problem is state leakage between your tests.
Your two tests are modifying the shared mockedList object. Since this object is not reset between tests, the other tests run with this "polluted" data, causing them to fail.
Here is the fix:
// Create a DEEP COPY of the mock data to ensure isolation
const mockedListClone = structuredClone(mockedList.at(0));
By using structuredClone() (or JSON.parse(JSON.stringify())), you ensure that no test can affect the data used by another, making your test suite reliable and predictable.
Bingo, my hunch was correct and gemini was able to pin point the exact line the issue was happening on!
What would have take me 30-60 mins of combing my code during some focus time the next day was something I was able to tackle in between meetings without deep focus time and get my unit tests fixed up and ready for review + deployment by my team.
Refactoring legacy code
One of the thing that LLMs are great at is pattern recognition. Often times in our codebases Iโve found we have a bunch of legacy code that needs updating to our new patterns and libraries. If you have a good example of what the new code/style/libraries look like, LLMs can really speed up the refactoring work.
In my example I had an newer version of our email campaigns ui/apis that had all the latest and greatest ui components, pagination, sorting, searching, built in. Our sms tool was built yrs ago and hadnโt been updated with those features/components.
I knew I could manually refactor everything over, but refactoring a whole tool with 3-4 large vue components, a large controller, a service file, and a bunch of tests would take me 3-5 days of focus time โ something neither I nor my team had.
I spun up Gemini and got to work:
I need to refactor my sms campaigns file to use my new Table component like the email campaigns list does.
<sms campaigns list component>
Hereโs my email campaigns list component:
<email campaigns list component using our new Table component>
You are working with Vue 2.6.
Gemini spit out a bunch of code and reasoning behind the refactor for my sms list component, but something wasnโt fully working.
is the bottom of the component cut off?
----
Yes, it appears the previous code block for the sms campaigns list was indeed cut off. My apologies for that!
Here's the completed and corrected version of the sms campaigns list component, refactored to use your new Table component similarly to your email campaigns component. This version includes the missing methods, proper closing tags, and considerations for type safety and event emissions.
Ok perfect, now I need to do this parent component.
Hereโs the parent page for email campaigns list:
<vue component code>
Hereโs my current sms campaigns list parent component:
<vue component code>
It gave me changes that were 90% there. There was definitely some โai written methodsโ that I already had utility functions / components in our codebase I could re-use, but honestly it got me pretty far.
Within an hr I had gotten it ready to go for the team to review. I had the thought to use Gemini to help me craft the PR summary.
Can you summarize the changes weโve made for a PR iโm creating for my team to review?
---
<Massive ai output that would make my team glaze their eyes over>
I need a much shorter summary that captures the why and overview product wise
---
<much better draft summary I could use, and just needed to skim to make sure all the key changes were captured>
Next up were the backend APIs and service files. Those took me another couple hrs of back and forth with gemini and manually reviewing and tweaking code.
Could I have done this on my own โ absolutely.
Could I have done it in between meetings without throwing off our sprint and my normal workload โ doubtful. Iโd probably have shoved it off into the backlog until even more clients were in a broken state and someone on our team had time to focus on it.
Writing unit tests
How many times have you had good intentions to do TDD or even add tests to your code but just ran out of time and said youโd come back later only to never do so? Me too. When time is tight, unit tests are unfortunately one of the first things to go.
With LLMs helping, this doesnโt need to be the case any more.
Hereโs a quick example of how I used Gemini/Claude to help quickly add unit tests to a new function / piece of functionality I had added to our app.
can you write me a jest unit test suite for this?
<new code I just wrote>
hereโs the existing test file I need to add this test to
<existing jest file>
Before you write the tests show the different use-cases youโll cover in the testing so I can review it and make sure everything is covered.
Gemini spits out a few test ideas, and we iterate on it a little.
Ok looks good, please generate the tests.
Gemini spits back the tests but I noticed it missed several typescript interfaces I didnโt give it context on, and so manually created objects with a type of any.
this is my interface you are missing for the mock object:
<typescript interface>
I tried running the tests again, but something was failing because of another missing type or interface. I prompted Gemini with the error output and the interface I thought it might be missing context on.
Boom. Issue fixed and I was able to add the new functionality to our app with through unit tests, much quicker than if I had written them by hand!
Building mermaid diagrams
We had just got off a 55 min meeting going over a production issue between four different internal teams, and one external provider we were integrated with.
We had our ai meeting summary, and I took personal notes, but it was so hard to keep everything straight exactly where things were breaking down and affecting customers.
Not to mention I was going to have to repeat it back to our PMs and engineers later to figure out how to address the issue.
It was 5:35 pm, and we needed to jump on this issue tomorrowโฆ
Thatโs it I thought, lemme type up a quick doc outlining the problem and an idea I had for a solution + a diagram to make it clear where the issue is between all the systems.
Ooo, I bet AI can give me a big headstart on that. Letโs ask ai a dumb question to start:
Can you create diagrams for like a user flow or system flow?
Oh sweet, it can do mermaid diagrams and then I can dump it into the mermaid playground to finalize and tweak it!
Ok, letโs try a mermaid diagram for this:
<brain dump of everything I know about the problem and where the issue is>
<hereโs an example user experience where users are reporting the issue>
This diagram illustrates the problematic flow you described. The key issue is highlighted in red.
The diagram shows:
Blue sections: Your team related actions
Orange sections: Team X related actions
Red section: The problem that occurs
Green section: How it should work when members complete the flow successfully
There were a couple weird steps in the flow, so I told it to remove a step or two and tweak another one.
I then took it into Mermaid and polished it up. Later I realized I was missing a third entry point into the system, so I took the code from Mermaid back to Claude and told it about the new user flow.
Ok hereโs my current diagram
<mermaid code>
I want to add a new 3rd section with something like:
<dummy mermaid code / bullets>
-----
Perfect! I've added the third section showing your proposed solution flow. The diagram now has three distinct paths:
Back to Mermaid โ oops, syntax error. Back to claude with the errorโฆ
Boom fixed. Back to Mermaid for final edits and text tweaks and exporting to share in my new doc with the team tomorrow.
The whole thing took me probably 10 mins of back and forth, and really helped give a clear picture of where the issue is to other engineers/product teams as well as clarify my own understanding of the problem.
Incident management
I stumbled across this use-case during a recent large incident I was helping my team run point on. We had started investigation in slack after an alert popped off and were 59 messages deep with screenshots, links, logs, and ideas before we realized โ shit โ this is a big deal.
We spun up an incident and stakeholders start pouring in.
In the past Iโve known how important it is to get folks quickly up to speed so Iโve worked to summarize my understanding of the issue, what weโve tried, whoโs impacted, and what our next steps are.
That usually takes me 5+ mins to type up a really good summary which takes time away from helping the team get the system back up, and stakeholders knowing how to inform customers and who they should call in for backup.
Whatโs been super helpful is to literally do a select all on the slack thread, paste it into Gemini and prompt it with something like:
Can you summarize these slack notes for me for an incident tldr that can help devops and stakeholders get up to speed quickly?
Whatโs the issue? What weโve tried, whoโs impacted, next steps, etc.
In 10 seconds it spit out a 98% good enough message that I was able to paste into our incident channel and quickly get all our teams & stakeholders joining up to speed.
It gave me something like:
Incident TLDR: Payment Processing Delays Due to Database Connection Pool Exhaustion
What happened? Our monitoring alerts picked up a spike in payment processing timeouts. Customer support also reported users complaining about failed checkout attempts.
When? March 15, 2025 - 2:47 PM PST
Impact: ~15% of payment transactions failing, affecting approximately 1,200 customers during afternoon hours across US and EU timezones.
Troubleshooting Steps Taken:
- Checked payment gateway status (Stripe) - all systems operational
- Reviewed application logs - found connection timeout errors to primary database
- Analyzed database performance metrics - CPU and memory within normal ranges
- Investigated network connectivity between app servers and database
- Discovered connection pool was exhausted (max 100 connections, all in use)
Current Status & Next Steps:
We've are working towards a fix to increase the connection pool size to 200 and kill off the long-running queries. That should get payment processing back online.
For Stakeholders: Customer Success needs to be notified to proactively reach out to affected customers with comms. We could use support from another DBRE engineer to make sure the connection pool is the only issue.
Being able to use Gemini to reduce the time for everyone to get up to speed helped us get our systems back up and running more quickly and ultimately serve our customers better.
Writing docs
Iโve heard of a bunch of different devs using LLMs to write docs, but havenโt often read how theyโve done it, or tips to create better docs.
Saying something like: โhey gemini can you write me a doc for this component / apiโ is likely to give you a decent start, but will probably result in some ai-slop that isnโt 100% accurate and way too verbose for your team/customers.
Hereโs a few tips I like to use to get better output:
Give LLMs as much code context as you can if you are generating docs for an api, component, or tool.
Give them a brain dump of your own thoughts on things the docs should include (either written or audio)
Keep a library of really well written docs and asked the LLM to write the new doc in a similar style.
Donโt accept what it outputs on the first try. Read through it, trim out areas that arenโt important, ask it to expound of certain sections, etc. Treat it like an editing partner or junior writer.
Hereโs what that might look like practically:
I need to start developing some docs for our online-survey product.
Here are some of our existing docs that I really like and find valuable. Please model your off them in style, and general overview.
<insert pdf or text of docs you like>
Hereโs what I know about our online survey product:
Our surveys use this library under the hood:
<link to library>
They use this code:
<insert code here>
We have some incomplete docs / fragments here:
<legacy docs / slack messages>
I want to make sure the new docs cover these key features:
<list of things>
What other context do you need or questions do you have before starting a draft of this new doc?
Then work back and forth with the LLM answering questions, providing context, expanding on areas, removing bits that donโt really matter, etc.
This should give you a much more complete doc that sounds like your style, and help you craft something in 1/2 the time it would have taken to write it all by hand!
Whew โ that was a lot! But thatโs not all โย Iโve used ai to help me with soo many more things including:
Troubleshooting why redis might be OOMing
Systems architecture / design brainstorming for scaling issues
Writing a developer setup script in bash to reduce our engineer onboarding time
Helping me write better RFCs and prep for other solution ideas, pushback, etc.
Complex git rebasing/merge conflict issues
Brainstorming new product ideas
It doesnโt do my job for me โย not even close, but slowly but surely itโs become a great pairing-partner that helps me level up in my skills, and serve my team and our customers better.
If thereโs one thing I would leave you with itโs this:
The LLMs we use today are the worst they are ever going to be. If they canโt quite do what they need you to, keep trying, trying different approaches, break things down smaller, and try new things every few months.
I think youโll be pleasantly surprised โ like I have โ in the ways it helps you do your day-to-day job better!
Well, thatโs all for this week.
If these tips were helpful, please like and share with a friend โ letโs help each other level up in our ai-powered engineering skills ๐
Until next week ๐๐ผ
Catch me daily on LinkedIn where I talk about everything software engineering, startups, and growing in your engineering soft skills.
โ Caleb
P.S Iโd love to hear which one was your favorite, or if I missed interesting use-cases you would add. Let me know in the comments. ๐โโ๏ธ๐โโ๏ธ
Curious why no mention of Copilot...?
Great set of use cases, Caleb. We have so much overlap on how we use AI ๐