<?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>Forem: Vladimir Grichina</title>
    <description>The latest articles on Forem by Vladimir Grichina (@vgrichina).</description>
    <link>https://forem.com/vgrichina</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F381084%2F21bdedaf-2c5a-4fd0-b701-03d4c32339e2.png</url>
      <title>Forem: Vladimir Grichina</title>
      <link>https://forem.com/vgrichina</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vgrichina"/>
    <language>en</language>
    <item>
      <title>Vibe Coding a Web Pong Game with poorcoder and Grok</title>
      <dc:creator>Vladimir Grichina</dc:creator>
      <pubDate>Sat, 22 Mar 2025 02:57:05 +0000</pubDate>
      <link>https://forem.com/vgrichina/vibe-coding-a-web-pong-game-with-poorcoder-and-grok-o17</link>
      <guid>https://forem.com/vgrichina/vibe-coding-a-web-pong-game-with-poorcoder-and-grok-o17</guid>
      <description>&lt;p&gt;I'm Vlad, creator of &lt;code&gt;poorcoder&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This tool streamlines AI-assisted development for terminal-centric workflows. It's a collection of lightweight Bash scripts that integrate with LLM services like Grok.&lt;/p&gt;

&lt;p&gt;In this guide, we'll build a web-based Pong game using &lt;code&gt;poorcoder&lt;/code&gt; and Grok. We'll demonstrate iterative development through the terminal with minimal manual file editing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Grab &lt;code&gt;poorcoder&lt;/code&gt; and set it up in a fresh project dir:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/vgrichina/poorcoder.git
&lt;span class="nb"&gt;cd &lt;/span&gt;poorcoder
&lt;span class="nb"&gt;mkdir&lt;/span&gt; ../pong-game
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; context apply-md git-context autocommit prompts ../pong-game/
&lt;span class="nb"&gt;cd&lt;/span&gt; ../pong-game/
git init
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial setup with poorcoder tools"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We've got &lt;code&gt;context&lt;/code&gt; to gather code, &lt;code&gt;apply-md&lt;/code&gt; to apply Grok's output, &lt;code&gt;git-context&lt;/code&gt; for commits, and &lt;code&gt;autocommit&lt;/code&gt; for automated commit messages. Since it's a new project, there's no code yet—Grok will handle that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools Overview
&lt;/h3&gt;

&lt;p&gt;Here's what each tool does:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;context&lt;/code&gt; - Gathers your project files for sending to Grok&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apply-md&lt;/code&gt; - Applies code from Grok's markdown response to your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git-context&lt;/code&gt; - Prepares git changes for commit message generation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;autocommit&lt;/code&gt; - Automated AI commit message generator using the &lt;code&gt;llm&lt;/code&gt; CLI tool (&lt;a href="https://llm.datasette.io/" rel="noopener noreferrer"&gt;setup instructions here&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1: Kickstarting Pong
&lt;/h2&gt;

&lt;p&gt;Let's get a basic Pong game going. First, run &lt;code&gt;context&lt;/code&gt; to grab the (empty) project state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./context | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the dir's empty, this just gives Grok the default prompt from &lt;code&gt;prompts/context_prompt.txt&lt;/code&gt;. Now, in Grok's interface, add a specific request to build a Pong game before pasting the context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I want to build a simple web-based Pong game using HTML, JavaScript, and CSS. Let's start with only one paddle controlled by player.

Put everything into src/ folder. Split into index.html, script.js and style.css.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then paste the context from your clipboard and send the message. Grok should output markdown with code blocks for new files (&lt;code&gt;src/index.html&lt;/code&gt;, &lt;code&gt;src/script.js&lt;/code&gt;, and &lt;code&gt;src/style.css&lt;/code&gt;). Back in the terminal:&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="c"&gt;# First check what's coming&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--dry-run&lt;/span&gt; &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything looks good, apply the changes:&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="c"&gt;# Apply the changes&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, &lt;code&gt;git ls-files&lt;/code&gt; might show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/index.html
src/style.css
src/script.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start a local server to serve your game directly from the src folder:&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="c"&gt;# Python 3 server (simplest option)&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;src &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; python3 &lt;span class="nt"&gt;-m&lt;/span&gt; http.server
&lt;span class="c"&gt;# Or specify a different port&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;src &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; python3 &lt;span class="nt"&gt;-m&lt;/span&gt; http.server 8080

&lt;span class="c"&gt;# Or Python 2 if that's what you have&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;src &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; python &lt;span class="nt"&gt;-m&lt;/span&gt; SimpleHTTPServer

&lt;span class="c"&gt;# Or using Node.js with 'serve'&lt;/span&gt;
npx serve src

&lt;span class="c"&gt;# Or using live-server for auto-reload&lt;/span&gt;
npx live-server src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open your browser to the URL shown (typically &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;, &lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;, or &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;). You'll see a basic Pong setup—maybe a canvas with a paddle and ball, controlled by keyboard. Here's a screenshot of what I got:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpecmf6wc8le77wk040ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpecmf6wc8le77wk040ug.png" alt="Basic Pong Screenshot" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Commit it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
./autocommit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;autocommit&lt;/code&gt; script will use &lt;code&gt;git-context&lt;/code&gt; to gather information about your changes, pass it to the LLM via the &lt;code&gt;llm&lt;/code&gt; CLI tool, generate a commit message, and open your editor to review and finalize it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Adding a Second Paddle
&lt;/h2&gt;

&lt;p&gt;One paddle is boring—let's add a second one for two-player action. Gather the current state:&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="c"&gt;# Gather all files from src directory&lt;/span&gt;
./context src/&lt;span class="k"&gt;*&lt;/span&gt; | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste into Grok. The built-in prompt will guide it to understand the codebase. Add your request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please add a second paddle for two-player mode. Don't forget the ball.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Grok should modify &lt;code&gt;script.js&lt;/code&gt; for a second paddle and maybe tweak &lt;code&gt;index.html&lt;/code&gt; for controls. Apply the changes:&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="c"&gt;# First check what's coming&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--dry-run&lt;/span&gt; &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything looks good:&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="c"&gt;# Apply the changes&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;git ls-files&lt;/code&gt; should show the same files but with updated content. Refresh the browser—both paddles should move (e.g., W/S for left, Up/Down for right). Screenshot time:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbfa12f9655c9jd50rml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbfa12f9655c9jd50rml.png" alt="Two-Paddle Pong Screenshot" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Commit again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
./autocommit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Styling It Up with CSS
&lt;/h2&gt;

&lt;p&gt;Let's make it look less like a wireframe. Gather the context:&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="c"&gt;# Gather all files from src directory&lt;/span&gt;
./context src/&lt;span class="k"&gt;*&lt;/span&gt; | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste into Grok with your styling request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please enhance the styling with colors, backgrounds, and better visual effects.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Grok might suggest adding or modifying &lt;code&gt;style.css&lt;/code&gt; and updating &lt;code&gt;index.html&lt;/code&gt;. Apply it:&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="c"&gt;# First check what's coming&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--dry-run&lt;/span&gt; &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything looks good:&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="c"&gt;# Apply the changes&lt;/span&gt;
pbpaste | ./apply-md &lt;span class="nt"&gt;--create-missing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload the browser—paddles and ball should have colors, maybe a background. Screenshot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyfobkmxxmdz2709robz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyfobkmxxmdz2709robz.png" alt="Styled Pong Screenshot" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
./autocommit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Approach Matters
&lt;/h2&gt;

&lt;p&gt;This workflow maintains terminal-centric development, eliminating the need to constantly switch between terminal, browser, and code editor. The &lt;code&gt;poorcoder&lt;/code&gt; toolchain enables Grok to create and update files directly through terminal commands, using &lt;code&gt;pbcopy&lt;/code&gt;, &lt;code&gt;pbpaste&lt;/code&gt;, and &lt;code&gt;apply-md&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;autocommit&lt;/code&gt; script combined with the &lt;code&gt;llm&lt;/code&gt; CLI tool automates the generation of meaningful commit messages without leaving the terminal environment. The built-in prompts manage the context presentation, enabling efficient collaboration with the AI. This approach works on any system with SSH access and leverages your existing LLM subscription without additional costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Could add scoring (tweak &lt;code&gt;script.js&lt;/code&gt;), a start screen (update &lt;code&gt;index.html&lt;/code&gt;), or smoother animations (enhance &lt;code&gt;style.css&lt;/code&gt;). Same deal: &lt;code&gt;./context&lt;/code&gt;, paste, &lt;code&gt;./apply-md&lt;/code&gt;. It's flexible—files evolve as we go, no rigid planning.&lt;/p&gt;

&lt;p&gt;That's it—Pong from scratch, terminal-style. Check out &lt;code&gt;poorcoder&lt;/code&gt; at &lt;a href="https://github.com/vgrichina/poorcoder" rel="noopener noreferrer"&gt;github.com/vgrichina/poorcoder&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;—Vlad&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
