The following my workflow for agentic coding.
The basic flow is Setup -> Plan -> Act -> Review and Iterate.
- Setup - Ensure the right rules and tools are enabled, optionally gather important documentation or examples.
- Plan - Build a detailed plan based off your goals, requirements and ideation with the coding agent.
- Act - Perform the development tasks, in phases.
- Review and Iterate - Review the work, update the plan and iterate as required.
๐ต Setup
- Ensure any directories or files you don’t want Cline to read are excluded by adding them to a
.clineignore
file in the root of your project.
๐ ๏ธ Tools
The effective use of tools is critical to the success and cost effectiveness of agentic coding. The MCP Servers (tools) I frequently use are available here: sammcj/agentic-coding#mcp-servers
- MVP / Always On
- Context7: Used to fetch documentation.
- Fetch: Used to fetch URLs.
- Brave Search: Provides web search (free Brave Search AI API key required).
- Package Version: Used to get up to date package versions.
- Github: Used to fetch information from GitHub repositories, Github Issues & PRs.
- Sometimes Used
- Firecrawl: Provides web scraping and markdown conversion (Self hosted Firecrawl, or Firecrawl API key required).
- Markdownify: Converts documents to markdown.
- Browser Use: Gives access to a browser.
- SearXNG: Provides web search (Self hosted SearXNG required).
- Magic MCP: Provides frontend UI components.
๐ Rules
I heavily utilise agent rules (e.g. .Clinerules) to help with the development process. I have a set of global rules that I use for all projects, and then I often add project specific rules as needed.
- My rules available here: sammcj/agentic-coding
๐ Gather Documentation / Examples
Note: I don’t always do this step, and if the model is good at using the tools available to it to efficiently fetch this information, it may not be necessary.
If I’m working with especially new libraries, frameworks, specifications or integrations I will sometimes save important documentation or example code snippets in a directory within the project.
Let’s say I’m working with go-mcp, a relatively recently developed package and a recently update to Model Context Protocol (MCP) specification, I might save the following:
docs/reference_examples/go-mcp-readme.md
- The README file from the go-mcp repositorydocs/reference_examples/go-mcp-example-usage.go.txt
- A code example from the go-mcp repository (in this case I’d add .txt to the end so it doesn’t interfere with the go builds)docs/reference_examples/mcp-specification-2025-03-26.json
- the latest version of the MCP specification
๐ค Plan Mode
- Usually I’ll start by writing a prompt in a text editor / file with a detailed goal for project I want to build.
- Then I start a fresh session and switch to Plan mode, and provide that prompt to the agent:
- What I want to buildExample
I want you to help me develop a new Golang application that provides an API for managing a list of tasks.
- Why I’m doing itExample
The intent is to have a simple API I can use across various machines on my network that will keep track of tasks.
- Technical requirementsExample
The application must be able to be run on both Linux and macOS. It must have a Dockerfile that follows best practices to build and deploy the application.
- Include any specific libraries/packages/frameworks I want to use.Example
I want to use the Gin framework for the API and SQLite for the database.
- Include any specific libraries/packages/frameworks I want to use.
- The intended audience (users) of the softwareExample
The intended audience is myself and my family, both of which are technical and can use the command line and API tools.
- AssumptionsExample
We may be deploying the application to a remote server in the future, so it must be able to run on a server with limited resources.
- Unknowns I want to explore during planningExample
I don’t know if I want to use a REST or GraphQL API. I’d like you to help me explore the pros and cons of each and make a recommendation.
- Links to upstream documentation, examples etc…Example
Here are some links to the documentation for the libraries I want to use:
- gin web framework repository - https://github.com/gin-gonic/gin
- Popular SQLite packages for Go - https://github.com/mattn/go-sqlite3 , https://github.com/glebarez/go-sqlite
- What I want to build
๐ Plan Refinement
- Iterate to hone in on the plan and approachExample
I like the idea of going with REST, but let’s make sure we can easily switch to GraphQL in the future if we need to. Also we should consider how we will handle authentication and authorisation.
๐ Create Plan Document
Prompt the agent to create a markdown document with a checklist of tasks to complete in a phased development approach:
Development Plan PromptCreate a new markdown document called docs/DEVELOPMENT_PLAN.md. In this document, start by adding a detailed description of the project, requirements and assumptions, then add a checklist of tasks to complete in a phased development approach.
I review the markdown document and edit as required
I add a tool use and task completion reminder at the end:
Tool & Task PromptRemember to use the tools / functions available to you. After each phase is complete, you must check off any tasks that have been completed in full. Then stop and I will review your work.
The intent here is to have a clear, concise and detailed plan that you could in theory provide to any agent or competant software engineer to undertake the development.
๐ Act Mode
I start a fresh session, this so we’re not pulling all the context (token usage) added during planning to keep the development focused and cost effective.
- Switch to Act mode
- Prompt the agent to read the plan and then begin development:Begin Development Prompt
First read the docs/DEVELOPMENT_PLAN.md file. Then begin development of the first phase, ensuring all requirements are met.
๐๐งโ๐ป Review
Once completed:
- Review the work and ensure the
DEVELOPMENT_PLAN.md
file is updated. - Update the projects .clinerules with anything I’ve learned.
- Fix - or request fixes to any issues or changes required.
๐ Iterate
- Then I start a fresh session with the prompt:Continue Development Prompt
First read the docs/DEVELOPMENT_PLAN.md file. Then continue development, ensuring all requirements are met.
- Iterate until all phases are complete.
๐ Update Rules
- I like to perform a brief retro after completing with lessons, what I’d do differently etc…
- Update my global clinerules with anything I’ve learned that can be applied to all projects.