RL ROLAND LOPEZ
// 4 min read

How I code with AI

Can I automate myself out of code?

Only if your solutioning is “AI compatible”

The difference is whether your problem is shaped for AI agents

Here is what happens if you are not aligned with the machines:

It has no concept of failure

For the AI, every error is bad, so it deletes them.

But 404 or a 500 it’s one system telling another what happened.

How can you see bugs if they are none existing?

They wont’t apear in any of your dahsboards now.

You are part of system.

It has no concept of production

A line is a line.

Code is just text that has strong grammar.

It writes in production like in a laptop, with no sense that code is runing.

Be my guest, ssh into your server and type claude code, try to debug something.

It like mock you

It invents fake objects & responses in tests, just to turn the bar green.

The test passes.

It just created it’s own reality and you bielived it.

It likes to make you feel clever

Give it a constraint and it tries to hack and you feel that it’s smart.

It added caching to a search page query… (and created it’s own lib)

Maybe boring discipline is productivity

It has no concept of a system

I design apps like video games and that follow stories.

Your character is on brand because he performs a set of behavior that the player expect.

The product for me should be a set of methods applied to a model so that we can save the state.

Like 3D design, if you move a gear you can see what else has moved.

What to do?

A 3D printer is not clever. It repeats one motion. That’s why it is fast and precise.

AI codes the same way.

Same shape every time and it goes much further than you because you stop.

He does not.

The real game…

Imagine AI is a RC car.

How fast can take a turn without flipping the car?

Learn what move AI is good at then save that trick it and research more moves.

Like a magician bending reality.

Compression is intelligence

One way to save. One way to test. One way to show.

It can only use known-good bricks that I define.

And repeating the same execution over and over.

Because I don’t want to go insane.

I keep the meaning. It does the boring part. We are productive.

💡

Maybe the unlock was never to be smarter. But maintaining boring discipline.

Cost of change does not exist if you apply the same method.

And good softwares are defined by their ability to change.

How it looks like

I use Ruby On Rails.

Not because it’s easy for agents to follow it’s grammar.

But because ActiveRecord has solved product.

The model (the how to save)

Essentially the business unit saved in a smart spreadsheet

# app/models/subscription.rb
class Subscription < ApplicationRecord
  belongs_to :account

  enum :status, { trialing: 0, active: 1, past_due: 2, canceled: 3 }

  scope :billable, -> { where(status: [:active, :past_due]) }
  scope :due_on, ->(date) { billable.where(renews_on: date) }

  CannotRenew = Class.new(StandardError)

  def renew!
    raise CannotRenew, "subscription is canceled" if canceled?
    update!(status: :active, renews_on: renews_on.next_month)
  end

  def in_grace_period?
    past_due? && renews_on.after?(3.days.ago)
  end
end

The controller

Gets the data from the model to present it later

# app/controllers/subscriptions_controller.rb
class SubscriptionsController < ApplicationController
  def index
    @subscriptions = current_account.subscriptions.billable.order(:renews_on)
  end
end

The view

Just loop through the data listed using code to assemble a txt file

<%# app/views/subscriptions/index.html.erb %>
<% @subscriptions.each do |subscription| %>
  <article>
    <h3><%= subscription.account.name %></h3>
    <p>Renews <%= subscription.renews_on.to_fs(:long) %></p>
    <% if subscription.in_grace_period? %>
      <span class="badge">In grace</span>
    <% end %>
  </article>
<% end %>

You should be able to read these 3 files.

And understand the gist of this blog.

Softwares is compressing the world into models

Agent Skynet is trying to compress the world into models an agent can run.

The more predictable the model, the further the agent gets on its own.

PS: Compressing implies loss. Meaning that not everything can make it to the models. Keep the bare minimum to articulate the solution. Cutting out what causes the problems.

Roland Lopez
Written by
Roland Lopez

Technical founder & AI crack-head

Built by Agent Skynet See the agency