Staying on Top of Agentic Coding as a Software Developer

This is an open discussion about using LLMs for software development in a productive way, without losing yourself in the process.


Since I have increased the amount of agentic coding I do in my day to day, I have often found myself relegated to an outsider of the projects the LLMs are developing. Through prompting, and a possible overuse of /plan mode, I retain a high-level overview of the tooling, but I might as well need to be re-onboarded to the project any time I decide to make a change like a caveman with a keyboard.

Context. For projects I worked on pre-GPT (e.g. freeCodeCamp/freeCodeCamp), I do not even bother using LLMs, because I can debug, find code (context), and understand the global effects substantially better. Lately, for greenfield projects, I have mostly been creating opinionated Product Requirements Documents (PRDs), and having the LLM develop whilst I am blind-folded.

This has meant, in times when I run out of LLM session, I either fumble to make changes to a codebase I am unfamiliar with, and risk making changes I do not know the consequences of in the global context. Or, I move back to a project I can make productive changes to sans LLMs, and wait for a renewed session to continue with the project I actually planned to work on.

What I Plan to Do About This

I have just started trying a different workflow for these greenfield projects I am working on which makes me the navigator, and the agent the driver. This is more work on my side, but puts the capability of retaining responsible oversight for the changes in my purview.

Steps

Outline

Start with a short outline of the project. Nothing more than 3 sentences describing the project, plus example usage or case studies.

This provides the minimal context needed for an LLM to stay on track with changes.

Boilerplate

This is the main setup for success - retaining context of the codebase. Instead of having an agent create files, functions, or config unchecked, YOU create the file(s), declare the function(s), and describe the config. Then, prompt agents to ONLY edit explicit files, functions, and config.

Case Study

Poor Workflow
  1. Open terminal to the project directory
  2. Prompt LLM harness:

Add a /blog page. Blogs should have `title`, `author`, `created_at`, `updated_at`, and `slug` meta. each blog should be sourced from `client/pages/blogs/`. `slug` should be unique, routing to `/blog/`.

  1. Twiddle thumbs
Improved Workflow
  1. Open editor in project directory
  2. touch client/pages/blog.tsx
  3. Create unimplemented blocks
// client/pages/blog.tsx
export function BlogIndexPage() {

}

export function BlogPostPage() {

}
<!-- client/pages/blog/example-blog.md -->
---
title: Example Blog
author: Shaun Hamilton
created_at: ...
updated_at: ...
---

Content++
// client/pages/blog/post.ts
export interface Post {

}

interface Frontmatter {
}

function parseFrontmatter(raw: string): Frontmatter {
}

export const POSTS: Post[] = undefined;

export function getPost(slug: string): Post | undefined {

}
  1. Track global context changes to mention in prompt:
- `client/pages/layout.tsx`

needs `/blog` added to `PUBLIC_PATH_PREFIXES`. Either, prompt with `PUBLIC_PATH_PREFIXES` or `client/pages/layout.tsx` - agents can find the needed changes quite easily with either bit of information.

- `client/pages/router.tsx`

needs a new route defined.

- `server/src/app.rs`

needs `/blog` route defined
  1. Prompt:

Implement the blog feature by completing all unimplemented code blocks across client/pages/blog.tsx and client/pages/blog/post.ts using the context in client/pages/blog/example-blog.md.

Wire up the new /blog routes by modifying the following files:

  • client/pages/layout.tsx
  • client/pages/router.tsx
  • server/src/app.rs

You have full agency to add, modify, or update any CSS as needed to ensure the UI looks polished and complete.

Guard Rails

Either, this can be in the form of a skill on how to add a feature / make a change, or it could be a simple section in context (e.g. AGENTS.md) that encourages agents to remain within scope.

Something like:

When making changes, only edit the unimplemented bodies of code in the files explicitly mentioned. Freely read other files in the repository for additional context, but do not edit unmentioned files without permission.

Alternative Approaches?

Currently, I am focusing on getting a decent local inline auto-complete model running on my laptop RTX3060, as I think inline auto-complete was a decent enough productivity boost whilst retaining personal context

How have you found success in productive and controlled development using LLMs?

2 Likes

I was trying to ask for more and more detailed planning before implementation, to stay on top of what’s happening

but this sounds much better, I will try it

(and you have stuff to do while on cool down)

Hi @Sky020

Auto-complete can burn through tokens, even for commit messages. I’ve turned it off on all my settings on GitHub. This forces me to carefully think about the changes and additions I’m making.

The agents don’t remember anything, they need to constantly read files. Giving them license to read files is like giving them an open cheque book. Restrict file-reading to a single isolated folder. Whitelist file types.

Have it store past interactions, update a summary of the conversation or project state, and store critical variables in a secure database so the agent doesn’t need to scan files.