<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kartik Koul</title>
    <description>The latest articles on DEV Community by Kartik Koul (@kartik_koul_).</description>
    <link>https://dev.to/kartik_koul_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3970125%2F85a060c1-22c4-41ea-a4b0-143e9c8c2940.jpg</url>
      <title>DEV Community: Kartik Koul</title>
      <link>https://dev.to/kartik_koul_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kartik_koul_"/>
    <language>en</language>
    <item>
      <title>Kiro for Ruby: Generating Rails Controllers and Models</title>
      <dc:creator>Kartik Koul</dc:creator>
      <pubDate>Mon, 06 Jul 2026 10:32:02 +0000</pubDate>
      <link>https://dev.to/kartik_koul_/kiro-for-ruby-generating-rails-controllers-and-models-1coj</link>
      <guid>https://dev.to/kartik_koul_/kiro-for-ruby-generating-rails-controllers-and-models-1coj</guid>
      <description>&lt;p&gt;You want to add a new resource to your Rails app. You know the drill — &lt;code&gt;rails generate&lt;/code&gt;, tweak the migration, add validations, write the controller actions, set up strong parameters, configure routes. It's not hard, but it's fifteen minutes of mechanical work before you get to the interesting part.&lt;/p&gt;

&lt;p&gt;Kiro handles that scaffolding for you. But unlike a basic generator, it understands Rails conventions — RESTful routing, ActiveRecord patterns, strong parameters — and produces code that follows them idiomatically. You describe what you want in natural language, and Kiro generates the model, migration, controller, and routes that a senior Rails dev would write by hand.&lt;/p&gt;

&lt;p&gt;In this post, we'll walk through generating a complete &lt;code&gt;Article&lt;/code&gt; resource with Kiro — a blog post with title, body, author, publication status, and a few metadata fields. Then we'll ask Kiro to layer on validations and scopes. The goal: show how Kiro respects Rails' convention-over-configuration philosophy rather than fighting it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;Kiro supports Ruby as one of its &lt;a href="https://kiro.dev/faq/" rel="noopener noreferrer"&gt;officially listed programming languages&lt;/a&gt;. It's built on VS Code, so your existing Ruby and Rails extensions, themes, and keybindings carry over. Open your Rails project in Kiro and you're ready to go.&lt;/p&gt;

&lt;p&gt;Kiro offers two session types: &lt;strong&gt;Vibe&lt;/strong&gt; sessions for conversational coding, and &lt;strong&gt;Spec&lt;/strong&gt; sessions for structured development (requirements, design, then implementation tasks). For generating a straightforward resource like this, a Vibe session works well. For a more complex feature — say, a full publishing workflow with drafts, scheduling, and notifications — you'd use a Spec session to plan before implementing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Generating the Resource
&lt;/h2&gt;

&lt;p&gt;In a Vibe session, you describe what you want:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create an Article resource for a blog application. The article should have: title (string), body (text), author_name (string), published (boolean, default false), slug (string), view_count (integer, default 0), and published_at (datetime, nullable). Generate the model, migration, controller with full RESTful actions, and routes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Kiro reads your existing project structure — your Gemfile, existing models, route file, controller patterns — and generates code that fits. It doesn't produce code in a vacuum; it matches the conventions already in your codebase.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Migration
&lt;/h2&gt;

&lt;p&gt;Kiro generates a migration that follows Rails naming conventions — timestamped filename, &lt;code&gt;create_&lt;/code&gt; prefix, plural table name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# db/migrate/20260706120000_create_articles.rb&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CreateArticles&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Migration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;7.1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;change&lt;/span&gt;
    &lt;span class="n"&gt;create_table&lt;/span&gt; &lt;span class="ss"&gt;:articles&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boolean&lt;/span&gt; &lt;span class="ss"&gt;:published&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;default: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;integer&lt;/span&gt; &lt;span class="ss"&gt;:view_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;default: &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;datetime&lt;/span&gt; &lt;span class="ss"&gt;:published_at&lt;/span&gt;

      &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="n"&gt;add_index&lt;/span&gt; &lt;span class="ss"&gt;:articles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;unique: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
    &lt;span class="n"&gt;add_index&lt;/span&gt; &lt;span class="ss"&gt;:articles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:published&lt;/span&gt;
    &lt;span class="n"&gt;add_index&lt;/span&gt; &lt;span class="ss"&gt;:articles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:published_at&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Null constraints on required fields.&lt;/strong&gt; Rails developers know that database-level constraints complement model validations. Kiro adds &lt;code&gt;null: false&lt;/code&gt; where it makes sense — &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, &lt;code&gt;author_name&lt;/code&gt; shouldn't be blank at the database level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Defaults for boolean and integer fields.&lt;/strong&gt; A &lt;code&gt;published&lt;/code&gt; column without a default creates a three-state boolean (true, false, nil), which causes headaches with ActiveRecord's &lt;code&gt;where(published: false)&lt;/code&gt; queries. Setting &lt;code&gt;default: false&lt;/code&gt; avoids that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indexes on query-heavy columns.&lt;/strong&gt; The &lt;code&gt;slug&lt;/code&gt; gets a unique index (since you'll look up articles by slug). &lt;code&gt;published&lt;/code&gt; and &lt;code&gt;published_at&lt;/code&gt; get indexes because you'll filter and sort on them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;published_at&lt;/code&gt; is nullable.&lt;/strong&gt; A draft has no publication date. Kiro infers this from the presence of the &lt;code&gt;published&lt;/code&gt; boolean — if there's a separate "is published?" flag, the timestamp should be optional.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the kind of migration a developer with a few years of Rails experience would write. Not the bare minimum, but not over-engineered either.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app/models/article.rb&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationRecord&lt;/span&gt;
  &lt;span class="c1"&gt;# Validations&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;uniqueness: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;format: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;with: &lt;/span&gt;&lt;span class="sr"&gt;/\A[a-z0-9\-]+\z/&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:view_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;numericality: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;only_integer: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;greater_than_or_equal_to: &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# Callbacks&lt;/span&gt;
  &lt;span class="n"&gt;before_validation&lt;/span&gt; &lt;span class="ss"&gt;:generate_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;on: :create&lt;/span&gt;

  &lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_slug&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parameterize&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This model demonstrates several ActiveRecord conventions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Validations mirror the database constraints.&lt;/strong&gt; The &lt;code&gt;presence: true&lt;/code&gt; validations on &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, and &lt;code&gt;author_name&lt;/code&gt; match the &lt;code&gt;null: false&lt;/code&gt; in the migration. Belt and suspenders — the database constraint catches anything that slips past the model layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Length limits are explicit.&lt;/strong&gt; Without &lt;code&gt;length: { maximum: 255 }&lt;/code&gt;, a user could submit a 10,000-character title. The &lt;code&gt;string&lt;/code&gt; column type in most databases truncates at 255 characters anyway, so the validation makes the limit visible in Ruby.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The slug format uses a regex.&lt;/strong&gt; The &lt;code&gt;/\A[a-z0-9\-]+\z/&lt;/code&gt; pattern ensures slugs are URL-safe: lowercase letters, numbers, and hyphens only. &lt;code&gt;\A&lt;/code&gt; and &lt;code&gt;\z&lt;/code&gt; anchor to the actual string boundaries (not line boundaries like &lt;code&gt;^&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The callback generates the slug from the title.&lt;/strong&gt; &lt;code&gt;String#parameterize&lt;/code&gt; is a Rails method that converts "My First Blog Post" into "my-first-blog-post". The callback only fires on create, and only if &lt;code&gt;slug&lt;/code&gt; is blank — so you can still set a custom slug if you want.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Controller
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app/controllers/articles_controller.rb&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ArticlesController&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationController&lt;/span&gt;
  &lt;span class="n"&gt;before_action&lt;/span&gt; &lt;span class="ss"&gt;:set_article&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;only: &lt;/span&gt;&lt;span class="sx"&gt;%i[show edit update destroy]&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;
    &lt;span class="vi"&gt;@articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;created_at: :desc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;show&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;new&lt;/span&gt;
    &lt;span class="vi"&gt;@article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create&lt;/span&gt;
    &lt;span class="vi"&gt;@article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;article_params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;
      &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;notice: &lt;/span&gt;&lt;span class="s2"&gt;"Article was successfully created."&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;status: :unprocessable_entity&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;edit&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;article_params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;notice: &lt;/span&gt;&lt;span class="s2"&gt;"Article was successfully updated."&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:edit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;status: :unprocessable_entity&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;destroy&lt;/span&gt;
    &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;destroy&lt;/span&gt;
    &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="n"&gt;articles_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;notice: &lt;/span&gt;&lt;span class="s2"&gt;"Article was successfully destroyed."&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_article&lt;/span&gt;
    &lt;span class="vi"&gt;@article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;article_params&lt;/span&gt;
    &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:article&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;permit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:published&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:published_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down what Rails conventions are at work here:&lt;/p&gt;

&lt;h3&gt;
  
  
  RESTful Routing
&lt;/h3&gt;

&lt;p&gt;The controller has exactly seven actions: &lt;code&gt;index&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;new&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;edit&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, &lt;code&gt;destroy&lt;/code&gt;. These map to the standard HTTP verbs and URL patterns that &lt;code&gt;resources :articles&lt;/code&gt; generates in Rails:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;HTTP Verb&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;index&lt;/td&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;/articles&lt;/td&gt;
&lt;td&gt;List all articles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;show&lt;/td&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;/articles/:id&lt;/td&gt;
&lt;td&gt;Show one article&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;new&lt;/td&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;/articles/new&lt;/td&gt;
&lt;td&gt;Render create form&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;create&lt;/td&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;/articles&lt;/td&gt;
&lt;td&gt;Save new article&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;edit&lt;/td&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;/articles/:id/edit&lt;/td&gt;
&lt;td&gt;Render edit form&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;update&lt;/td&gt;
&lt;td&gt;PATCH/PUT&lt;/td&gt;
&lt;td&gt;/articles/:id&lt;/td&gt;
&lt;td&gt;Update article&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;destroy&lt;/td&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;/articles/:id&lt;/td&gt;
&lt;td&gt;Delete article&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No custom actions, no non-RESTful routes. This is Rails' convention-over-configuration in its purest form.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Parameters
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;article_params&lt;/code&gt; method uses &lt;code&gt;params.require(:article).permit(...)&lt;/code&gt; to whitelist exactly which attributes can be mass-assigned. This is Rails' defense against mass-assignment vulnerabilities. Notice that &lt;code&gt;view_count&lt;/code&gt; is deliberately excluded — it shouldn't be user-settable through a form submission. Only &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, &lt;code&gt;author_name&lt;/code&gt;, &lt;code&gt;slug&lt;/code&gt;, &lt;code&gt;published&lt;/code&gt;, and &lt;code&gt;published_at&lt;/code&gt; are permitted.&lt;/p&gt;

&lt;h3&gt;
  
  
  before_action and DRY
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;set_article&lt;/code&gt; callback runs before &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;edit&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, and &lt;code&gt;destroy&lt;/code&gt; — the four actions that operate on an existing record. This avoids repeating &lt;code&gt;@article = Article.find(params[:id])&lt;/code&gt; in each action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Status Codes on Render
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;render :new, status: :unprocessable_entity&lt;/code&gt; on validation failure returns HTTP 422. This is important for Turbo (Hotwire) in Rails 7+ — Turbo expects a 422 status to know that it should replace the form with the re-rendered version showing validation errors.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Routes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# config/routes.rb (addition)&lt;/span&gt;
&lt;span class="n"&gt;resources&lt;/span&gt; &lt;span class="ss"&gt;:articles&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One line. That's it. &lt;code&gt;resources :articles&lt;/code&gt; generates all seven RESTful routes mapping to the seven controller actions. This is the convention-over-configuration payoff — because the controller follows the naming convention (&lt;code&gt;ArticlesController&lt;/code&gt; with standard action names), and the model follows its convention (&lt;code&gt;Article&lt;/code&gt; mapping to the &lt;code&gt;articles&lt;/code&gt; table), one line of routing config wires everything together.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding Validations
&lt;/h2&gt;

&lt;p&gt;Now let's ask Kiro to add more business logic. In the same Vibe session:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add a validation that ensures published_at is set when published is true. Also add a validation that the title is unique within the scope of the author_name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Kiro updates the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app/models/article.rb&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationRecord&lt;/span&gt;
  &lt;span class="c1"&gt;# Validations&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;uniqueness: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;scope: :author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                   &lt;span class="ss"&gt;message: &lt;/span&gt;&lt;span class="s2"&gt;"has already been used by this author"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;uniqueness: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;format: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;with: &lt;/span&gt;&lt;span class="sr"&gt;/\A[a-z0-9\-]+\z/&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:view_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;numericality: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;only_integer: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;greater_than_or_equal_to: &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validate&lt;/span&gt; &lt;span class="ss"&gt;:published_at_required_when_published&lt;/span&gt;

  &lt;span class="c1"&gt;# Callbacks&lt;/span&gt;
  &lt;span class="n"&gt;before_validation&lt;/span&gt; &lt;span class="ss"&gt;:generate_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;on: :create&lt;/span&gt;

  &lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_slug&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parameterize&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;published_at_required_when_published&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;published?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;published_at&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
      &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:published_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"must be set when article is published"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things to highlight:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scoped uniqueness.&lt;/strong&gt; &lt;code&gt;uniqueness: { scope: :author_name }&lt;/code&gt; means two different authors can both have an article titled "Getting Started," but the same author can't. The scope creates a compound uniqueness check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom validation method.&lt;/strong&gt; The &lt;code&gt;published_at_required_when_published&lt;/code&gt; method uses &lt;code&gt;validate&lt;/code&gt; (no &lt;code&gt;s&lt;/code&gt;) instead of &lt;code&gt;validates&lt;/code&gt; — that's the Rails API for custom validation logic. It calls &lt;code&gt;errors.add&lt;/code&gt; to attach an error message to a specific field. The &lt;code&gt;published?&lt;/code&gt; method is automatically generated by ActiveRecord for boolean columns.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding Scopes
&lt;/h2&gt;

&lt;p&gt;Next request:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add scopes to the Article model: published (where published is true, ordered by published_at descending), drafts (where published is false), and by_author(author_name) that filters by author.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Kiro adds the scopes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app/models/article.rb&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationRecord&lt;/span&gt;
  &lt;span class="c1"&gt;# Scopes&lt;/span&gt;
  &lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:published&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;published: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;published_at: :desc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:drafts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;published: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:by_author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;author_name: &lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;# Validations&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;uniqueness: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;scope: :author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                   &lt;span class="ss"&gt;message: &lt;/span&gt;&lt;span class="s2"&gt;"has already been used by this author"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;length: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;maximum: &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;presence: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;uniqueness: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;format: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;with: &lt;/span&gt;&lt;span class="sr"&gt;/\A[a-z0-9\-]+\z/&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validates&lt;/span&gt; &lt;span class="ss"&gt;:view_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;numericality: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;only_integer: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;greater_than_or_equal_to: &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;validate&lt;/span&gt; &lt;span class="ss"&gt;:published_at_required_when_published&lt;/span&gt;

  &lt;span class="c1"&gt;# Callbacks&lt;/span&gt;
  &lt;span class="n"&gt;before_validation&lt;/span&gt; &lt;span class="ss"&gt;:generate_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;on: :create&lt;/span&gt;

  &lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_slug&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parameterize&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;published_at_required_when_published&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;published?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;published_at&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
      &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:published_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"must be set when article is published"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scopes in Rails are class-level methods that return &lt;code&gt;ActiveRecord::Relation&lt;/code&gt; objects. Because they return relations, they're chainable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Find published articles by a specific author&lt;/span&gt;
&lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;published&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;by_author&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Jane Smith"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Find draft articles, most recent first&lt;/span&gt;
&lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drafts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;created_at: :desc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Count published articles&lt;/span&gt;
&lt;span class="no"&gt;Article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;published&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kiro uses the lambda syntax (&lt;code&gt;-&amp;gt; { ... }&lt;/code&gt;) which is standard Rails practice for scopes. The &lt;code&gt;by_author&lt;/code&gt; scope takes an argument, so its lambda accepts a parameter. All three scopes produce SQL that hits the indexes we defined in the migration (&lt;code&gt;published&lt;/code&gt; and &lt;code&gt;published_at&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  What Kiro Understands About Rails Conventions
&lt;/h2&gt;

&lt;p&gt;Through this example, Kiro demonstrated awareness of several Rails conventions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Naming conventions.&lt;/strong&gt; Model name &lt;code&gt;Article&lt;/code&gt; (singular, CamelCase) maps to table &lt;code&gt;articles&lt;/code&gt; (plural, snake_case), controller &lt;code&gt;ArticlesController&lt;/code&gt; (plural), and route &lt;code&gt;resources :articles&lt;/code&gt;. Kiro doesn't need you to specify these mappings — it infers them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File placement.&lt;/strong&gt; Models go in &lt;code&gt;app/models/&lt;/code&gt;, controllers in &lt;code&gt;app/controllers/&lt;/code&gt;, migrations in &lt;code&gt;db/migrate/&lt;/code&gt;. The migration filename includes a timestamp. These are non-negotiable in Rails, and Kiro follows them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RESTful design.&lt;/strong&gt; Seven standard actions, no custom routes for basic CRUD. If you need non-RESTful behavior, you'd ask for it — but the default is the conventional seven.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strong parameters.&lt;/strong&gt; Whitelisting at the controller level, excluding fields that shouldn't be mass-assigned (&lt;code&gt;view_count&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;, timestamps).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database-level safety.&lt;/strong&gt; Null constraints, defaults, and indexes in the migration complement the model validations. Kiro treats the database schema as a contract, not just a storage mechanism.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Validation API.&lt;/strong&gt; Using &lt;code&gt;validates&lt;/code&gt; for declarative validations, &lt;code&gt;validate&lt;/code&gt; for custom methods, &lt;code&gt;uniqueness: { scope: ... }&lt;/code&gt; for compound uniqueness, and &lt;code&gt;format: { with: ... }&lt;/code&gt; for regex patterns.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using Steering for Team Conventions
&lt;/h2&gt;

&lt;p&gt;If your team has specific Rails conventions — say you always use UUIDs as primary keys, or you prefer &lt;code&gt;frozen_string_literal&lt;/code&gt; comments at the top of every file, or you use &lt;code&gt;pundit&lt;/code&gt; for authorization — you can codify those in a Kiro &lt;a href="https://kiro.dev/docs/steering/" rel="noopener noreferrer"&gt;steering file&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Create a file at &lt;code&gt;.kiro/steering/rails-conventions.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Rails Conventions&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Use UUID primary keys for all new models (&lt;span class="sb"&gt;`id: :uuid`&lt;/span&gt;)
&lt;span class="p"&gt;-&lt;/span&gt; Add &lt;span class="sb"&gt;`# frozen_string_literal: true`&lt;/span&gt; to the top of every Ruby file
&lt;span class="p"&gt;-&lt;/span&gt; Controllers that require authentication should include &lt;span class="sb"&gt;`before_action :authenticate_user!`&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use &lt;span class="sb"&gt;`pundit`&lt;/span&gt; for authorization: include &lt;span class="sb"&gt;`authorize @resource`&lt;/span&gt; in show, edit, update, destroy
&lt;span class="p"&gt;-&lt;/span&gt; Prefer &lt;span class="sb"&gt;`find_by!`&lt;/span&gt; over &lt;span class="sb"&gt;`find`&lt;/span&gt; when looking up by slug
&lt;span class="p"&gt;-&lt;/span&gt; Always add database indexes for foreign keys and columns used in &lt;span class="sb"&gt;`where`&lt;/span&gt; clauses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this steering file in place, Kiro will follow these conventions in every session without you repeating them. The next time you ask it to generate a resource, it'll use UUIDs, add the frozen string literal pragma, and include Pundit authorization checks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using Hooks for Automatic Quality Checks
&lt;/h2&gt;

&lt;p&gt;Kiro's &lt;a href="https://kiro.dev/docs/hooks/" rel="noopener noreferrer"&gt;hooks&lt;/a&gt; let you automate checks that run when specific events occur. For a Rails project, you might set up a hook that runs RuboCop after any file save in &lt;code&gt;app/&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"RuboCop on Save"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"trigger"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PostFileSave"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"app/.*&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.rb$"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bundle exec rubocop --format simple"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or a hook that reminds the agent to add model specs when creating a new model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Remind model specs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"trigger"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PostFileCreate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"app/models/.*&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.rb$"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"agent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"A new model was created. Ensure a corresponding RSpec model spec exists in spec/models/ with tests for validations and scopes."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These hooks act like a team lead reviewing your work in real-time — catching things that slip through when you're focused on the feature logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  When to Use Spec Mode
&lt;/h2&gt;

&lt;p&gt;For this blog post example, a Vibe session was plenty. But for larger features — think a full commenting system with nested replies, moderation, and notifications — Kiro's Spec workflow is more appropriate. It would:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate requirements&lt;/strong&gt; — Define what the commenting system should do (EARS notation): "When a user submits a comment, the system shall associate it with the parent article and notify the article author."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Produce a design&lt;/strong&gt; — Map out the &lt;code&gt;Comment&lt;/code&gt; model, its associations (&lt;code&gt;belongs_to :article&lt;/code&gt;, &lt;code&gt;belongs_to :user&lt;/code&gt;, self-referential &lt;code&gt;has_many :replies&lt;/code&gt;), the controller actions, and the notification mechanism.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Break into tasks&lt;/strong&gt; — Create ordered implementation steps: migration first, then model with associations, then controller, then notification job, then views.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each task is implemented and verified before moving to the next. This prevents the "generate everything at once and debug for an hour" problem that happens with complex features.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kiro generates idiomatic Rails code.&lt;/strong&gt; It follows naming conventions, file placement, RESTful design, and the ActiveRecord API without being told to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;It understands the relationship between layers.&lt;/strong&gt; Database constraints complement model validations. Indexes match query patterns. Strong parameters exclude sensitive fields.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Iterative refinement works naturally.&lt;/strong&gt; Generate the base resource, then ask for validations, scopes, callbacks, or associations. Each addition builds on what's already there.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Steering files codify team standards.&lt;/strong&gt; Your UUID preference, your authorization library, your testing conventions — write them once and Kiro follows them in every session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hooks automate quality gates.&lt;/strong&gt; Run RuboCop on save, prompt for specs on new models, lint migrations before committing. The tooling works with your existing Ruby ecosystem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Convention over configuration cuts both ways.&lt;/strong&gt; Rails gives you conventions. Kiro respects them. The result is less time configuring and more time building the parts of your application that are actually unique.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rails developers already benefit from a framework that makes decisions for them. Kiro extends that philosophy into the development workflow itself — you describe what you need, and it generates code that follows the conventions you'd follow by hand, just faster.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>productivity</category>
      <category>rails</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Why Python 3.14 Is Worth the Upgrade (and How AWS Transform Custom Does the Heavy Lifting)</title>
      <dc:creator>Kartik Koul</dc:creator>
      <pubDate>Fri, 05 Jun 2026 15:52:38 +0000</pubDate>
      <link>https://dev.to/kartik_koul_/why-python-314-is-worth-the-upgrade-and-how-aws-transform-custom-does-the-heavy-lifting-2io0</link>
      <guid>https://dev.to/kartik_koul_/why-python-314-is-worth-the-upgrade-and-how-aws-transform-custom-does-the-heavy-lifting-2io0</guid>
      <description>&lt;p&gt;Python 3.14 landed on October 7, 2025, and it's the rare release that's both a quiet quality-of-life upgrade and a genuine peek at where the language is heading. The catch, as always, is the upgrade itself. Bumping one script is easy. Bumping forty repositories that nobody has touched since a developer who left two years ago wrote them? That's the part people quietly avoid until a runtime deprecation notice forces their hand.&lt;/p&gt;

&lt;p&gt;This post does two things. First, it walks through a few Python 3.14 benefits that actually justify the move. Second, it shows how AWS Transform custom (ATX) can carry the tedious parts of the upgrade so you can do it early instead of in a panic. There's a bit of humor along the way, because version upgrades are dry enough without it.&lt;/p&gt;

&lt;p&gt;A quick honesty note up front: everything here is checked against the official AWS Transform custom documentation and the Python 3.14 release notes. Where the docs and the marketing dream diverge, I'll tell you. That happens once, and it's important, so stick around for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, a Genuinely Silly Detail
&lt;/h2&gt;

&lt;p&gt;Before the serious benefits, the Python core team hid a tiny joke in 3.14. When you create a virtual environment on Unix, you get a bonus alias: &lt;code&gt;𝜋thon&lt;/code&gt;. Yes, the actual Greek letter. It's a one-release-only tribute to π, whose rounded value 3.14 we all memorized in school and promptly forgot everything after.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;𝜋thon
Python 3.14.0 &lt;span class="o"&gt;(&lt;/span&gt;main, Oct  7 2025, 17:32:06&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;GCC 14.2.0] on linux
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It does nothing useful. It is exclusive to 3.14. It is the most on-brand thing a group of mathematically-minded engineers has ever shipped. Moving on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Benefits Worth Upgrading For
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A REPL That Finally Feels Modern
&lt;/h3&gt;

&lt;p&gt;Python 3.13 adopted a new REPL based on PyREPL. Python 3.14 builds on it with real-time syntax highlighting and autocompletion for &lt;code&gt;import&lt;/code&gt; statements. Type &lt;code&gt;import dat&lt;/code&gt;, hit Tab, and it'll narrow to &lt;code&gt;dataclasses&lt;/code&gt; and &lt;code&gt;datetime&lt;/code&gt; instead of leaving you to remember the exact module name. The color even reaches standard-library tools: &lt;code&gt;argparse&lt;/code&gt; help, the &lt;code&gt;calendar&lt;/code&gt; module, &lt;code&gt;json&lt;/code&gt; pretty-printing, and &lt;code&gt;unittest&lt;/code&gt; failure output all gained color.&lt;/p&gt;

&lt;p&gt;It won't change how your code runs, but it makes the interactive shell feel like a tool from this decade rather than a relic you tolerate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Error Messages That Stop Playing Hard to Get
&lt;/h3&gt;

&lt;p&gt;Python has spent several releases making error messages friendlier, and 3.14 continues the streak. A typo in a keyword now gets a suggestion instead of a shrug:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;forr&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;python-input-0&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;forr&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="o"&gt;^^^^&lt;/span&gt;
&lt;span class="nb"&gt;SyntaxError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;invalid&lt;/span&gt; &lt;span class="n"&gt;syntax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Did&lt;/span&gt; &lt;span class="n"&gt;you&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="err"&gt;?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare that to 3.13, which pointed at the variable &lt;code&gt;i&lt;/code&gt; and said "invalid syntax" like an unhelpful colleague who's technically correct and zero help. The 3.14 interpreter also explains unterminated strings, incompatible string prefixes, and &lt;code&gt;elif&lt;/code&gt; blocks that wandered in after an &lt;code&gt;else&lt;/code&gt;. Beginners benefit most, but so does anyone debugging at 5pm on a Friday.&lt;/p&gt;

&lt;h3&gt;
  
  
  Template Strings (T-Strings)
&lt;/h3&gt;

&lt;p&gt;This is the headline syntax addition. T-strings look almost exactly like f-strings but use a &lt;code&gt;t&lt;/code&gt; prefix, and instead of immediately producing a string, they evaluate to a &lt;code&gt;Template&lt;/code&gt; object you can inspect and process before anything is rendered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;string.templatelib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Template&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;find_users_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT * FROM users WHERE name = &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{name}&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The point is safety. Because the values are intercepted before they're merged into the final string, you get a real opportunity to sanitize or parameterize them — the kind of thing that turns an SQL injection into a harmless quoted literal. One quirky catch worth knowing: Python now ships two unrelated classes both named &lt;code&gt;Template&lt;/code&gt; (the old &lt;code&gt;string.Template&lt;/code&gt; from Python 2.4 and the new &lt;code&gt;string.templatelib.Template&lt;/code&gt;), so naming a variable &lt;code&gt;template&lt;/code&gt; and importing the wrong one is a fresh way to confuse yourself. Also, as of 3.14 you have to write your own template processor — the standard library defines the syntax but doesn't yet include consumers. Bring your own logic for now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Type Hints That Stop Tripping Over Forward References
&lt;/h3&gt;

&lt;p&gt;Python 3.14 adopts PEP 649: deferred evaluation of annotations. The classic problem — a class that references another class defined further down the file, raising &lt;code&gt;NameError&lt;/code&gt; — just goes away. Annotations are now evaluated lazily, only when something actually asks for them, and then cached.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@dataclass&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LinkedList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;          &lt;span class="c1"&gt;# No NameError, even though Node is defined below
&lt;/span&gt;
&lt;span class="nd"&gt;@dataclass&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;
    &lt;span class="nb"&gt;next&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No more wrapping types in string quotes to dodge the import order. Faster startup, fewer circular-import headaches, and a cleaner mental model. This is the one most existing codebases will quietly appreciate without noticing why everything got easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concurrency Grows Up
&lt;/h3&gt;

&lt;p&gt;Two big items here. Parallel subinterpreters are now usable from pure Python through &lt;code&gt;InterpreterPoolExecutor&lt;/code&gt; in &lt;code&gt;concurrent.futures&lt;/code&gt;, giving you a middle ground between threads (cheap, but GIL-bound) and processes (true parallelism, but heavy). And free-threaded Python — the GIL-free build — reached officially supported status under PEP 779.&lt;/p&gt;

&lt;p&gt;The honest tradeoff, straight from the release notes: free-threaded builds carry roughly a 10–15% single-thread performance penalty and up to about 20% more memory use, and the GIL is still enabled by default. So this is a foundation for the future, not a free speed boost you flip on today. Worth experimenting with, not worth betting production on this afternoon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smaller Things That Add Up
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Safer live debugging (PEP 768):&lt;/strong&gt; attach &lt;code&gt;pdb&lt;/code&gt; to a running process with &lt;code&gt;python -m pdb -p &amp;lt;PID&amp;gt;&lt;/code&gt;. Both processes need to be on 3.14.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exceptions without parentheses (PEP 758):&lt;/strong&gt; &lt;code&gt;except ValueError, TypeError:&lt;/code&gt; is now valid when you're not binding with &lt;code&gt;as&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Warnings in &lt;code&gt;try…finally&lt;/code&gt; (PEP 765):&lt;/strong&gt; a &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, or &lt;code&gt;continue&lt;/code&gt; inside a &lt;code&gt;finally&lt;/code&gt; block now triggers a &lt;code&gt;SyntaxWarning&lt;/code&gt;, because silently swallowing exceptions was a footgun for years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incremental garbage collector:&lt;/strong&gt; cycle collection is spread across smaller steps, so latency-sensitive code sees shorter pauses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Part Everyone Dreads: Actually Upgrading
&lt;/h2&gt;

&lt;p&gt;Here's where AWS Transform custom comes in. ATX uses agentic AI to perform large-scale code modernization — language version upgrades, SDK migrations, framework transitions, and more. The thing that sets it apart from pointing a generic AI assistant at each repo is &lt;strong&gt;continual learning&lt;/strong&gt;: each execution captures patterns, fixes, and edge cases as reusable knowledge items, so the transformation gets more reliable the more you run it.&lt;/p&gt;

&lt;p&gt;For Python version bumps, there's an AWS-managed transformation called &lt;code&gt;AWS/python-version-upgrade&lt;/code&gt;. You run it through the &lt;code&gt;atx&lt;/code&gt; CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;atx custom def &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; AWS/python-version-upgrade &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-p&lt;/span&gt; ./my-python-repo &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"pytest"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="s2"&gt;"additionalPlanContext='Upgrade this project to the latest supported Python version'"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-x&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The flags, per the command reference: &lt;code&gt;-p&lt;/code&gt; is the repo path, &lt;code&gt;-c&lt;/code&gt; is your build or validation command, &lt;code&gt;-n&lt;/code&gt; names the transformation, &lt;code&gt;-x&lt;/code&gt; runs it non-interactively, and &lt;code&gt;-t&lt;/code&gt; trusts all tool executions so you aren't prompted. You can wrap that in a shell loop across dozens of repos, which is exactly the "forty untouched repositories" scenario from the intro.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fact-Check You Were Promised
&lt;/h3&gt;

&lt;p&gt;Here's the honest bit. The official docs for &lt;code&gt;AWS/python-version-upgrade&lt;/code&gt; say it migrates Python projects from &lt;strong&gt;3.8/3.9 to 3.11/3.12/3.13&lt;/strong&gt;. As written, Python 3.14 is not listed as a validated target.&lt;/p&gt;

&lt;p&gt;So what does "early upgrade to 3.14" actually mean in practice? Two real, documented options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Get current first.&lt;/strong&gt; Using ATX to move legacy 3.8/3.9 code up to a modern 3.13 baseline is the fully-supported step that gets you most of the way and removes the scariest deprecation risk. The docs state the managed transformation ensures "compatibility with the latest Python features, security updates, and runtime while maintaining functionality and performance." The last hop to 3.14 from a clean, well-tested 3.13 codebase is small.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guide it with &lt;code&gt;additionalPlanContext&lt;/code&gt;.&lt;/strong&gt; The docs explicitly state you can specify your desired target Python version either through interactive chat with the agent or by passing &lt;code&gt;additionalPlanContext&lt;/code&gt;. That's the supported mechanism for steering the target. Give it a solid validation command like &lt;code&gt;pytest&lt;/code&gt;, review the diff, and let continual learning absorb whatever it learns. Just go in knowing 3.14 is ahead of the documented validated range, so the validation command isn't optional — it's your safety net.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's the difference between encouraging an early upgrade and overselling one. ATX makes the journey to a modern Python dramatically cheaper; it doesn't magically certify a target the docs haven't certified yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Couple of ATX Quirks Worth a Smile
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows users, brace yourselves.&lt;/strong&gt; The getting-started docs note that AWS Transform custom detects a native Windows environment and exits with an error message. The official remedy is to install WSL. The tool would simply rather not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It learns from you, unless you tell it not to.&lt;/strong&gt; There's a &lt;code&gt;-d&lt;/code&gt; (&lt;code&gt;--do-not-learn&lt;/code&gt;) flag to opt a run out of knowledge extraction. Most of the time you want learning on — that's the whole value — but it's there for the repos you'd rather keep to yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It tracks agent minutes.&lt;/strong&gt; You can check the accumulated agent minutes for the current session with &lt;code&gt;/usage&lt;/code&gt;, and cap a run with &lt;code&gt;--limit&lt;/code&gt;, which sets an Agent Minutes budget limit. Think of it as a parking meter for your tech debt.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A Sensible Rollout
&lt;/h2&gt;

&lt;p&gt;The Python core team's own advice is measured: if you're on 3.13, moving to 3.14 is an easy win for daily development, but you don't need to rush, especially if you lean on C extensions or compiled wheels that need time to catch up. Many large shops wait for the first maintenance release (3.14.1) before a fleet-wide rollout.&lt;/p&gt;

&lt;p&gt;That maps cleanly onto how ATX is meant to be used — the docs describe a four-phase workflow: define the transformation, run a pilot on a sample repo, scale execution across many repos via the CLI, then monitor and approve the knowledge items it learned. So a reasonable plan looks like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pilot &lt;code&gt;AWS/python-version-upgrade&lt;/code&gt; on one representative repo with a real test command.&lt;/li&gt;
&lt;li&gt;Review the diff and the proposed changes like you would any pull request.&lt;/li&gt;
&lt;li&gt;Scale across the rest once the pilot looks clean.&lt;/li&gt;
&lt;li&gt;Approve the knowledge items so the next batch goes smoother.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Python 3.14 is a quietly strong release: a friendlier REPL, error messages that actually help, t-strings for safer interpolation, lazy annotations that fix a decade-old papercut, and a maturing concurrency story. None of that matters if your code is stuck three versions back. AWS Transform custom is built precisely for that gap — and its continual learning means the upgrade gets cheaper every time you run it.&lt;/p&gt;

&lt;p&gt;Be honest about the target: ATX's managed Python transformation officially validates up to 3.13, with &lt;code&gt;additionalPlanContext&lt;/code&gt; to steer further. Use it to get current now, ride the supported path to a clean 3.13 baseline, and the final step to 3.14 stops being a project and becomes a Tuesday.&lt;/p&gt;

&lt;p&gt;And if you do upgrade, run &lt;code&gt;𝜋thon&lt;/code&gt; once in a fresh venv. You've earned the dumb little joke.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>aws</category>
      <category>python</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
