Skip to content

Build a Feature

In this tutorial, you'll use the Build agent to generate code that matches your codebase's patterns and review every change as a diff before it reaches the repository.

Prerequisites

  • Potpie CLI installed and set up (Quickstart)
  • A repository registered and parsed to ready status

Workflow

1. Describe the feature

Enter a description of the feature you want to build. Be specific about the desired outcome.

> "Add a rate limiting middleware that uses Redis and supports per-route configuration"

2. Answer clarifying questions

Potpie surfaces multiple-choice questions to lock in scope and requirements before the specification begins. Each option is derived from what Potpie actually finds in your repository.

3. Review the specification

Potpie generates a specification covering:

  • Every file to create or modify
  • Implementation details for each change
  • Dependency relationships between affected components

4. Review the plan

The plan includes three views:

An explanation of what changes, which parts of the codebase are in scope, and how the new code fits the existing system.

A dependency graph showing how new components wire into existing services, data models, and API boundaries.

Each task lists the target file, implementation intent, dependency order, and verification criteria.

5. Review generated code

Code is generated and presented as diffs. Changes match the existing code style and conventions identified during specification.

6. Create a pull request

Once you're satisfied with the diffs, create a PR directly from the generated changes.

Tips

Tip

The more specific your initial description, the fewer clarifying questions Potpie needs to ask. Include constraints, boundaries, and expected behavior upfront.

Info

Build reads the knowledge graph for established patterns, naming conventions, dependency direction rules, and prior architectural decisions before generating any code.

Next steps