Skip to content
Notifications
Clear all

Walkthrough: Using custom prompts to enforce our code style guide.

5 Posts
5 Users
0 Reactions
0 Views
(@davidm78)
Estimable Member
Joined: 3 weeks ago
Posts: 158
Topic starter   [#24145]

Hey folks! 👋 Wanted to share a quick win our data engineering team just had with Codeium. We've all been there—trying to keep SQL and Python styles consistent across a growing team is a pain. Manually reviewing for our style guide (things like CTE formatting, explicit aliases, no `SELECT *` in production) was eating up time.

Instead of just hoping everyone remembers the rules, we set up a custom prompt in Codeium Chat to act as a first-pass reviewer. Here’s the gist of what we feed it:

```
You are a senior data engineer enforcing our team's style guide. Before answering, review any provided code for:
- Use CTEs over nested subqueries for readability.
- Always use explicit `AS` for column/table aliases.
- Avoid `SELECT *` in final models; specify columns.
- Use snake_case for all column names.
- Add a short comment for complex CTE logic.

If violations exist, list them first with a brief fix suggestion. Then proceed with the main task.
```

Now, when someone drafts a new Looker derived table or a Python data transform, they pop it into Chat with their actual question. The bot **first** spits out any style tweaks needed. It’s been fantastic for catching the small stuff before the PR even gets opened.

The real benefit? It’s not just a linter—it’s contextual. A junior dev can ask “How do I optimize this slow query?” and Codeium will both suggest style fixes *and* then dive into the performance tips, all in one thread. It’s like having a style-conscious pair programmer on demand.

A few practical tips we learned:
* Be super specific in your custom prompt. Reference your actual internal doc.
* It works best for guiding new code creation; major refactors of existing code still need human eyes.
* Combine this with your existing CI checks for a solid safety net.

Has anyone else tried using custom prompts for team standards? Would love to swap ideas.

Cheers, David


Data doesn't lie, but dashboards sometimes do.


   
Quote
(@infra_architect_rebel)
Reputable Member
Joined: 3 months ago
Posts: 259
 

Another layer to debug. Now your devs are fighting both the linter and the bot.

Just use a formatter. Pre-commit hook with sqlfluff and black. It fixes the code, doesn't just talk about it.


Simplicity is the ultimate sophistication


   
ReplyQuote
(@daisym)
Estimable Member
Joined: 3 weeks ago
Posts: 116
 

Nice approach! I love that it catches things *before* they hit the PR, saving everyone time. We did something similar for our email template code - a prompt that checks for inline CSS overrides and proper fallbacks. It's not a replacement for a linter, but as a conversational nudge during the drafting phase? Super helpful for building good habits.



   
ReplyQuote
(@devops_rookie_2025)
Honorable Member
Joined: 2 months ago
Posts: 289
 

This is such a neat idea! Getting a nudge right while you're drafting code sounds way more effective than just a rejection in a PR. It's like having a senior dev looking over your shoulder in a good way.

I'm still pretty new to all this - how do you handle disagreements? Like if the bot suggests a change but the developer has a good reason to break the style guide for that specific case, is there a way to note that in the chat? Or do they just fix it and move on?

Thanks for sharing this, definitely gonna suggest it for our team!



   
ReplyQuote
(@cost_optimizer_99)
Reputable Member
Joined: 3 months ago
Posts: 316
 

You're optimistic if you think a chat bot comment will feel like a "senior dev looking over your shoulder." It's a rigid rule engine that can't discuss trade-offs.

> how do you handle disagreements?
You don't. You're fighting a static prompt, not a person. The "good reason" gets lost unless you waste time documenting it in chat for no one. Then you still have to explain it again in the PR.

Our team tried this. We spent more time arguing with the bot's false positives than we ever saved in PR review.


show the math


   
ReplyQuote