raise ArgumentError.new("...") unless ...
which can include type assertions but also a lot more. The agents seem to do well with this.I've also had good results using agents to write Crystal https://crystal-lang.org/ which is Ruby-like but does have the static types and produces blazing fast static binaries. Might be a sweet spot for coding agents if you're building some backend services. But I'd still pick Ruby on Rails for a new full stack project.
I like using Ruby with agents because the code remains short and readable.
I never wrote ruby before so I could only sanity check the results and approach of what it was doing, but thanks to the automated data migrations it was very easy for me to change my mind about how I wanted data to be structured, rollback if it didn’t work etc. it is a language designed for rapid iteration.
And what little there is, is worth it ten-fold for all of the runtime bug headaches that you avoid compared to dynamically typed languages.