Advanced AI-assisted Development

The Software Development Life Cycle (SDLC) has changed, now applications can be shipped with heavily work of AI tools – from IDEs, passing by Skills and Agents to fully automated workflows with the support of Cloud Agents, such as Github Copilot.

We need to understand what techniques and tools are required for this new normal.

Control Context and Constraints

Context Management Strategies

1 Fill in the bucket

Play with ask, plan and agent modes to get more context about what you intend doing

  • Use ask to navigate through the codebase and get alternatives for the implementation, then use the plan in another context window to build the implementation plan

Example of prompt to get a preliminary idea for the plan:

Write up a brief description of the desired feature as if it would be implemented using <desired option previously suggested by the model>

2 Context Poisoning

Context poisoning happens when you give a too broad prompt that the LLM will probably lose itself while trying to come up with a solution.

Techniques to avoid it:

  • Restart with a new context window when the prompt was broad and the LLM is struggling to design the plan
  • Redo previous prompts so that Cursor will discard the results generated by the wrong or not assertive prompt

3 Inject Focused Documentation

  • Use the Context7 MCP to get up to date documentation

4 Record Project Culture

Capture team decisions to promote future consistency

  • Use rules to set pre defined patterns to keep consistency within the project
    • Use commands to generate and update rules in a more productive way

Design Custom Agents and Modes

What’s an agent?

  • A set of instructions with access to Tools
  • Unit of work for an AI-based solution
  • Isolated session
  • Connected in a pipeline

Step 1: Agent Breakdown

  • Plan
    • User Stories
    • Specifications
  • Code
    • Backend
      • Code design
      • Database migration
      • etc.
    • Frontend
      • Custom hooks
      • React components
      • etc.
  • Test
    • Unit tests
    • Integration tests

An Agent should be specific to a team, project and purpose

Step 2: Identify Skills

  • Code (Agent)
  • Commands (Agent)
  • Taste (Human)
  • Discerniment (Human)

Step 3: Create the Agent

  • Each tool has his own way of creating agents, in Claude Code, they call it subagent

Step 4: Agent Chaining

Based on the example of Agent Breakdown of step 1, we could chain them like this:

flowchart TD
    US[User Story] --> Spec[Specification] --> Design[Code Design]
    Design --> UnitTesting[Unit Testing] --> Integration[Integration Testing]
    Integration --> Services --> DB[Database Migrations] --> Etc

Step 5: Inputs and Outputs

We need to add validations between each agent to ensure consistency in the outputs. One way to do this is to clearly define Input and Output for each agent.

  • Connect agents via inputs and outputs
  • Constrain an agent via inputs
  • Validate early and often (this is also a token management strategy)
  • Build custom agents
  • Apply taste and dicerniment

Orchestrate Workflows and Processes

The agent inputs are basically:

  • User Prompt
  • Instructions

But we can enhance the inputs by using a few strategies:

Deterministic vs Non-deterministic

A deterministic workflow is a strict process where the steps are always the same (e.g.: Step 1 goes to Step 2).

LLMs are mostly non-deterministic, but a good workflow should balance both deterministic and non-deterministic behavior to reach better results. So, having a dynamic element in the middle of the process, such as another LLM, code script, or even a human, can leverage the process and make it more effective.

So we can, for instance, include scripts that the LLM will use whenever we want something more strict, more deterministic. On the other hand, we can place another LLM with different characteristics if we want to add a little more of dynamism to the flow.

Skills

Skills can leverage agent constraints, making it more reliable.

Progressive disclosure: the LLM uses instructions of skills on demand, they only load the skill name and description at start time.

Compressible vs Non-compressible Tasks

A Compressible task is a task that AI can take, and hence boost the speed of it. A non-compressible task, on the other hand, is a task that can’t be done by an LLM, and requires a human doing it.

  • Agents performs compressible tasks
  • Humans perform non-compressible tasks
  • Orchestration controls the sequence

Automate the Software Development Lifecycle

The goal of the new SDLC (Software Development Life Cycle) is to minimize handoffs between each actor in the pipeline (Product Owner, Developer, Specialist, etc)

Value Stream Alignment

A value stream is a cohesive set of capabilities that provides value to the organization

Stacked Pull Requests

Stacked PRs is a repository management strategy to handle software changes by having branches per "developer".

In this idea, each dev will work in their single branch and then push PRs to the main branch, that ‘s why it’s called "stacked PRs", because we start stacking PRs to be shipped to production.

Example of Cloud Agents

  • Current examples of agents running on Cloud:
    • Jules
    • Copilot
    • Cursorbot
    • and others

Basically, after creating a workflow of agents that a developer can use, Cloud Agents like Jules can replicate the same process, automating the process of software development.

Final Consideration

Due to the rapid evolution and expansion of AI, this article will be updated whenever my understanding of some of concepts/tools presented here were somehow changed.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top