Back to Videos

Workflow

YouTube

This video, titled "AI-Assisted Code Development Workflow: Define, Refine, Multiply, Expand," outlines a highly successful workflow for building code with AI, emphasizing the crucial role of careful definition and iterative refinement. The presenter, Matt, demonstrates his four-phase approach, starting with defining requirements through vocal ideation and AI-generated documents. He then moves to refining the initial output, highlighting the importance of managing AI context and providing clear visual feedback with screenshots. The "Multiply" phase showcases the power of running multiple AI agents in parallel on cloud platforms to accelerate development and offers practical tips for leveraging AI-powered development environments like Claude Code. The final phase, "Expand," delves into advanced applications of AI, illustrating how custom AI agents can automate complex data enrichment tasks beyond traditional coding. Matt demonstrates an agent designed to enhance historical timeline JSON files by validating image URLs, finding better images, and refining descriptions. He underscores the versatility of AI in handling research, meeting notes, and project planning, positioning AI as a tool not just for code generation but for broader workflow optimization. The video concludes by emphasizing the value of meticulously defined processes and well-structured tests as foundational elements for sustained success and adaptability in AI-driven development.

AI-Assisted Code Development Workflow: Define, Refine, Multiply, Expand

This video presents a comprehensive workflow for AI-assisted code development, broken down into four key phases:

Introduction and Overview

  • The presenter, Matt, shares his experience building code almost exclusively with AI for "several years."
  • He describes his workflow as "really tight" and "highly successful," especially with today's AI models and tools.
  • The video will guide viewers from a "really rough idea" through ideation, planning, defining, refining, multiplying with agents, and expanding uses of AI.

1. Define Phase

  • This phase is about capturing information, brainstorming ideas, and creating a clear definition of what needs to be built (the "what," not the "how").
  • Ideation: Matt often starts with raw ideas, free-associating into a microphone to generate initial thoughts and then visual aids like a mock-up of the desired changes.
  • Product Requirements Document (PRD): He uses ChatGPT (specifically GPT-4.5) to convert raw ideas, visual notes (an annotated screenshot), and existing documentation into a structured PRD.
  • Crucial Step: Matt emphasizes that the definition phase is "incredibly important" and represents "70% of the meaningful work," believing it will be a major focus for future development.
  • AI's Role: ChatGPT synthesizes the provided inputs into a clear, concise requirements document, detailing goals (e.g., smooth interaction, clear mental model, rich navigational context), experience overview, detailed requirements (e.g., ghosted interaction, robust handles, scroll gestures), and success criteria.

2. Refine Phase

  • This phase focuses on iterating and improving the initial AI-generated code, as the first attempt is "never perfect."
  • Context Management: The most critical aspect of refining is managing the AI's context window. Matt stresses the importance of minimizing the information in the context to ensure the AI focuses on the current problem.
  • Clearing Context: He uses a /clear command (or its equivalent) to reset the conversation history and free up context frequently, especially after completing a small, discrete task, ensuring the AI only has relevant information for the next step.
  • Visual Feedback (Screenshots): Since AI models like Claude Code don't "see" the UI, Matt uses screenshot utilities (like CleanShot) to capture visual states and annotate them with arrows and text. These images are then pasted directly into the AI's chat, enabling precise visual communication and iterative UI/UX refinement.
  • Testing: Matt highlights the necessity of explicitly instructing the AI to write and run unit, visual, or end-to-end (E2E) tests. He includes these directives in his CLAUDE.md memory file to ensure consistent test generation. He warns that without solid tests, making future changes will be problematic.

3. Multiply Phase

  • This phase leverages cloud-based AI development environments to run multiple AI agents in parallel, accelerating the development process.
  • Cloud-Based Agents: Matt uses Claude Code (and mentions similar features in CodeX and Gemini) to launch multiple, asynchronous tasks (sessions) within a project.
  • Benefits: This allows him to initiate several related changes simultaneously without waiting for each to complete, effectively multiplying his output.
  • Detached Operations: The tasks run in the cloud, independent of his local machine. He can close his computer, work on other things, or even initiate tasks from his phone.
  • Iterative Comparison: He often kicks off multiple similar changes to compare different approaches and select the best one later.
  • Pull Requests (PRs): Once tasks are completed in the cloud, they are pushed back to GitHub as PRs, ready for review and merging.

4. Expand Phase

  • This phase explores using AI tools beyond traditional code generation, applying them to non-coding tasks like research, content generation, and data enrichment.
  • Non-Coding AI Applications: Matt demonstrates using Claude Code for tasks that aren't directly coding but are crucial for a project.
  • Custom AI Agents (Slash Commands): He creates custom slash commands (e.g., /history:editor) that act as specialized AI agents.
  • Data Enhancement Example: He shows an agent designed to enhance a historical timeline JSON file. This agent follows specific rules (defined in a markdown file) to:
    • Validate image URLs (using a bash script tool).
    • Search for and replace broken or missing image URLs with valid Wikimedia Commons images.
    • Enhance descriptions, ensuring they are concise, interesting, and evocative.
    • Ensure events are correctly grouped and identified.
  • Iterative Data Transformation: The agent can iterate through the entire JSON dataset, applying these rules and making external web searches to enrich the data, effectively transforming raw data into high-quality, well-researched content.
  • Persistence: These custom slash commands (agents) are stored within the project's repository, allowing him to reuse them and share them with other team members, maintaining consistency and efficiency across projects and over time.

Timestamps

00:00
IntroductionMatt introduces his AI-assisted code development workflow.
00:44
Project OverviewMatt briefly showcases the existing timeline UI that needs changes.
01:05
Phase 1: Define - IdeationMatt explains his initial brainstorming and raw idea capture using a whiteboard mock-up.
01:44
Phase 1: Define - The ProcessMatt details the 'Define' phase, capturing ideas, creating visual notes, and generating a PRD.
02:33
Phase 1: Define - AI in ActionMatt feeds his ideas and notes into ChatGPT to generate a comprehensive Product Requirements Document (PRD).
03:28
AI-Generated PRDChatGPT outputs a detailed PRD with background, goals, experience overview, requirements, and success criteria.
03:52
Preparing for Code GenerationMatt integrates the PRD into Claude Code, emphasizing the importance of a well-defined architecture file ('CLAUDE.md').
04:16
Initiating Code GenerationMatt prompts Claude Code to refactor the timeline component based on the PRD, starting in 'plan mode' to review the strategy first.
04:49
Reviewing the PlanClaude Code generates a detailed plan for the refactoring, which Matt reviews for alignment with expectations.
05:16
Executing the PlanMatt executes the plan, allowing Claude Code to modify existing files and create new ones.
05:47
Reviewing First IterationMatt reviews the initial code changes in the browser, noting improvements and areas for further refinement.
06:33
Phase 2: Refine - The ProcessMatt introduces the 'Refine' phase, acknowledging that initial AI output is rarely perfect.
07:13
Phase 2: Refine - Context ManagementMatt explains the critical role of managing the AI's context window by frequently clearing it to focus on specific problems.
08:40
Phase 2: Refine - Visual FeedbackMatt demonstrates using screenshots and annotations to provide precise visual feedback to the AI for UI refinements.
09:50
Phase 2: Refine - TestingMatt emphasizes the importance of instructing the AI to generate and run unit tests for critical logic.
11:28
Phase 3: Multiply - The ProcessMatt introduces the 'Multiply' phase, focusing on running multiple AI agents in parallel in the cloud.
11:42
Phase 3: Multiply - Cloud IntegrationMatt demonstrates using Claude Code's web interface to select a project and initiate multiple tasks simultaneously.
12:40
Phase 3: Multiply - Parallel ExecutionMatt shows two distinct tasks running concurrently in Claude Code, highlighting the asynchronous nature of cloud agents.
13:06
Phase 3: Multiply - Creating Pull RequestsMatt demonstrates how Claude Code automatically generates and pushes pull requests to GitHub for each completed task.
14:52
Phase 4: Expand - The ProcessMatt introduces the 'Expand' phase, exploring non-coding applications of AI within the development workflow.
15:29
Phase 4: Expand - Reviewing PRsMatt quickly reviews the two PRs created in the 'Multiply' phase and uses Claude Code to approve and merge them.
16:03
Phase 4: Expand - Testing Merged CodeMatt checks out the merged branches and verifies the implemented changes in the browser.
17:15
Phase 4: Expand - Iterative RefinementMatt continues to refine the grab handle visibility, pushing direct changes back to the feature branch.
18:05
Phase 4: Expand - Beyond Code: Data EditingMatt introduces an example of using Claude Code to edit a JSON data file for a historical timeline, demonstrating AI's ability to handle complex, non-coding data tasks.
19:34
Phase 4: Expand - Custom Agents (History Editor)Matt explains how he created a custom slash command ('/history:editor') as an AI agent to enhance JSON data files, including image validation and content generation.
20:41
Phase 4: Expand - Running the Custom AgentMatt executes the custom 'history:editor' agent with a board game history JSON file, demonstrating its deep research and data transformation capabilities.
21:39
Phase 4: Expand - Reviewing Enhanced DataMatt showcases the transformed JSON data, highlighting improved image links, descriptions, and overall content quality.
22:44
ConclusionMatt concludes by summarizing the four phases and emphasizing the importance of these techniques for successful AI-assisted development.
22:58
Final Thoughts on Slash CommandsMatt briefly reiterates the power and ease of creating custom slash commands for various tasks.

Target Audience

Software developers, project managers, technical leads, and anyone interested in integrating AI into their code development and project management workflows. It is particularly useful for those working with large language models (LLMs) and AI-powered development environments like Claude Code.

Use Cases

  • -Streamlining the initial ideation and requirements gathering process using AI to generate comprehensive PRDs.
  • -Accelerating iterative development and UI/UX refinements by providing precise visual feedback and managing AI context efficiently.
  • -Managing multiple development tasks concurrently in the cloud using AI agents, allowing developers to work on several features simultaneously.
  • -Automating complex data processing, research, and content generation tasks using custom AI agents for project planning and data enrichment.
  • -Improving code quality and maintainability by consistently generating and running unit/visual tests with AI assistance.

Key Topics

AI-driven workflow for developersEffective prompt engineering and context management with AILeveraging AI for parallel development and pull requestsExpanding AI capabilities beyond code to data enrichment and custom agents