Skip to main content
Kliff

Build a feature

Have an agent plan a feature, build it once you approve, and hand it back as a draft pull request.

Video coming soon

A feature is where an agent's mistakes cost the most, because a wrong direction can produce a lot of plausible code. The remedy is a simple order of work: plan, then build, then open a draft pull request for review. This lesson walks through each step and the points where you should step in.

Start with a plan

Set Permission mode to Plan, then describe the feature. In Plan mode the agent investigates without changing anything, then replies with a plan: the steps in order, the files each one touches, how it will check the result, and anything you need to decide.

Asking for a plantext
Add CSV export to the orders table on the admin page.
Admins pick a date range and get a file with one row per order.
Follow how the existing PDF export is built. Large ranges must not time out.
Plan first.

Read the plan the way you would read a colleague's design note:

  • Does it touch the files you expected, and only those?
  • Does it reuse what exists, such as the PDF export, instead of building a parallel version?
  • Is the check real? "Add a test for a range with no orders" is better than "verify it works".
  • Are the open questions ones you can answer now?

The plan ends with Build this plan? Select Approve and build to have the agent start on the plan as written. If something is off, write what to change instead, and the agent revises the plan before it builds.

Let it build, and stay reachable

Once you approve, the agent works through the steps. It edits files, runs your tests and build, and fixes what fails. You can watch the output stream in, or leave and come back. Open Git beside the conversation to see the changes as they land.

The agent may stop to ask you something, such as which of two approaches to take. It shows the question with options to pick from, and you can write your own answer below them instead. On the Agents page, Needs you lists the agents that finished a turn you have not opened yet.

If you see it heading the wrong way, stop the turn with the stop button and correct it. A short, specific correction is better than starting over, because the agent keeps what it already learned.

Open a draft pull request

When the work is done and the checks pass, ask for a pull request:

Asking for a pull requesttext
Run the full test suite. If it passes, open a draft pull request.
In the description, list what changed and how you tested it.

The agent commits its work, and Kliff pushes it to a branch named kliff/ plus the agent's ID and opens a draft pull request, or a draft merge request on GitLab. You need write access to the repository, and pushing must be allowed in its settings. In Ask mode, or when your organization has approvals on, the agent asks you to approve before it opens the pull request.

The pull request is always a draft. An agent can read pull requests, issues, and checks, and comment on a pull request, but it cannot merge, approve, or close anything. Merging stays your decision. See Start an agent for the details.

Iterate on the same branch

Review comments and failing checks usually mean another round. Send the agent a follow-up in the same conversation:

A follow-uptext
CI fails on the lint step for orders/export.ts. Fix it, and rename
exportCsv to exportOrdersCsv to match the PDF export. Update the pull request.

The agent commits again, and Kliff updates the open pull request instead of opening a new one. On the Agents page, In review lists the agents whose pull request or merge request is still open, so you can see what is waiting for you.

Key points

  • Start in Plan mode so the agent proposes steps, files, and checks before it changes anything.
  • Select Approve and build when the plan is right, or reply with what to change.
  • Ask for a draft pull request once the checks pass. Kliff pushes the branch and opens it as a draft.
  • Agents never merge, approve, or close. Follow-ups in the same conversation update the open pull request.