My LLM Code Generation Process
My approach to working with LLM code generation is starting to formalize into a Plan-Do-Check-Act set of steps that stay true to my own professional experience and what I’ve learned from mentors in the Agile Community.
-
Analyze - use the power of the pattern recognition inherent in LLM’s to better understand the problem and the codebase.
-
Plan - have the LLM restate my working agreements, then use the analysis to devise a step-by-step plan adhering to those agreements. Working agreements include: atomic commits, test-first development, red/green cycles, explain reasoning for architectural decisions, etc.
-
Code with Oversight: a. Agent implements plan following the approach. b. I observe and intervene when the agent shows “instruction drift”, i.e. wanders off the plan or approach, or when new insights require plan revision. Often changes the plan.
-
Check Completeness - verify that we’ve met the goal of the plan as informed by the analysis. Move to this step when the plan is complete or time-box ends.
-
Retrospect - ask the agent to review the thread and completeness to generate learnings, determine what we collectively could have done better, and provide suggestions to me as the operator on how to improve my working agreements, prompts or actions.
This whole cycle can take anywhere from 30 min. to days depending on the scope of work. Better shorter than longer. It is my personal process separate from the workflows occurring within the agent and occurring within the larger project planning and team ceremonies. Not only does it discipline my own work and reign in the tendency of an agent to drift from its mission, it creates artifacts I share with my team put into commits, stories, pull requests, etc.