Blog
/3 min read

AI Workflows I Actually Use In Production

How I use AI to write code without breaking things: schema generation, test-first development, and automated reviews.

AIAutomationDeveloper ToolsProductivity

Everyone is trying to sell you an AI tool that writes your whole codebase for you. I've tried most of them, and reality is a lot messier. Large Language Models guess what comes next. They are incredibly good at writing code that looks right, but "looks right" is where all the worst bugs live.

I don't let AI write my core logic anymore. But I do use it every single day for transformations.

The Secret: Transformation, Not Creation

AI is bad at making architectural decisions from scratch. But it is incredible at translating data from one format to another.

1. Schema-Driven Generation

I write my TypeScript types by hand. They are the source of truth. Then, I let the AI generate everything else that depends on them:

  • Zod validation schemas
  • SQL migration scripts
  • Boilerplate form components

Because it has a strict input (the TS type) and a clear output contract, the AI rarely hallucinates. It's just doing the mechanical translation that used to take me hours.

2. Test-First Implementation

I hated Test-Driven Development (TDD) until AI came along. Now, it's my favorite workflow.

I write the test suite myself. This forces me to define exactly what the edge cases are. Then, I highlight the empty function and tell the AI to "make the tests pass."

typescript
describe('calculateShippingCost', () => {
  it('applies free shipping above threshold', () => {
    expect(calculateShippingCost({ subtotal: 100, weight: 2 })).toBe(0);
  });

  it('calculates weight-based cost below threshold', () => {
    expect(calculateShippingCost({ subtotal: 30, weight: 2 })).toBe(5.98);
  });
});

If the AI hallucinates, the tests fail. It iterates until it gets it right. I get the implementation without writing the logic, but I still have absolute proof that it works.

3. The Pre-Reviewer

The highest ROI I've found is using AI as a pre-reviewer on my PRs. It doesn't replace human review, but it catches the stupid stuff—missing error handling, inconsistent variable naming, forgotten console logs. It cleans up the PR so my human reviewers can actually focus on the architecture.

What I Keep The AI Away From

I never use AI for:

  • Core architecture decisions
  • Security and auth flows
  • Payment processing logic

If it touches money or passwords, a human writes it and a human reviews it.

AI isn't replacing us anytime soon. But if you treat it like a really fast junior developer who is great at typing but needs strict supervision, it is an incredible tool.

erginos.io — 2026