> ## Documentation Index
> Fetch the complete documentation index at: https://potpieai-feat-cli-setup.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Make Code Changes

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

To understand how Build works, see the [Build mode page](/build-flow/build-a-feature).

## Workflow

<Steps>
  <Step title="Describe the feature">
    Enter a description of the feature for to build.

    <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/feature-description-input.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=2081d537d57133746bc148d78378df2a" alt="Feature description input" width="2782" height="1576" data-path="images/feature-description-input.png" />
  </Step>

  <Step title="Clarifying questions">
    Potpie surfaces a set of clarifying questions as multiple choice options. Answers lock in the scope and requirements before the specification begins.

    <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/code-agent-clarifying-questions.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=730e446a6483d9017075de54b4a94539" alt="Clarifying questions" width="2782" height="1576" data-path="images/code-agent-clarifying-questions.png" />
  </Step>

  <Step title="Specification">
    Potpie parses the codebase against the confirmed requirements and generates a specification covering every file to create or modify, implementation details for each change, and dependency relationships between affected components.

    <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/code-agent-spec-page.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=b06ee60a242bc6e85d4bea1307e6c9ac" alt="Specification page" width="2782" height="1576" data-path="images/code-agent-spec-page.png" />
  </Step>

  <Step title="Plan">
    Once the spec is confirmed, Potpie generates a plan.

    <Tabs>
      <Tab title="Summary">
        An explanation of what changes, which parts of the codebase are in scope, and how the new code fits the existing system.

        <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/code-agent-plan-summary.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=928101328339b182b6b7d23d57a12efd" alt="Plan summary tab" width="2782" height="1576" data-path="images/code-agent-plan-summary.png" />
      </Tab>

      <Tab title="Architecture">
        A dependency graph showing how new components wire into existing services, data models, and API boundaries as they exist in the repository.

        <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/build-architecture1.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=de15737e9ec13a61a7d333bebf252843" alt="Architecture tab" width="2782" height="1576" data-path="images/build-architecture1.png" />
      </Tab>

      <Tab title="Plan items">
        Each task lists the target file, implementation intent, dependency order, and the verification criteria checked after each diff is generated.

        <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/code-agent-plan-items.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=fd1c845e85f32c900e27c26b48e42b56" alt="Plan items tab" width="2782" height="1576" data-path="images/code-agent-plan-items.png" />
      </Tab>
    </Tabs>
  </Step>

  <Step title="Code generation">
    Potpie generates the code and presents every change as a **diff**. Changes match the existing code style and conventions identified during **specification**.

    <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/build-codegen.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=09d70353a7d0443200d903a5972b9455" alt="Code generation diff view" width="2782" height="1576" data-path="images/build-codegen.png" />
  </Step>

  <Step title="Pull request">
    Clicking **Create PR** pushes the full diff to the repository.

    <img src="https://mintcdn.com/potpieai-feat-cli-setup/RjcDtgma2Y5eRJIQ/images/Build-Pull.png?fit=max&auto=format&n=RjcDtgma2Y5eRJIQ&q=85&s=12164a8af99308b072649f9aa6214319" alt="Final review before PR" width="2782" height="1576" data-path="images/Build-Pull.png" />
  </Step>
</Steps>
