Workplan

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed
  • Status: Beta

The availability of this feature is controlled by a feature flag. For more information, see the history.

A workplan is a structured Markdown document attached to a work item. It captures the intent, approach, and steps for a unit of work.

A workplan provides GitLab Duo agents with an agreed specification and a human-reviewable artifact on the work item. With this context, an agent has more to work from than a short prompt, so it can run the work more accurately.

You create a workplan with GitLab Duo or write one manually. GitLab Duo drafts the workplan from the work item context, and you refine it. Agents then use the workplan as the primary specification for the work.

The workplan is part of the GitLab Duo Agent Platform and the specification-driven development workflow.

You can add a workplan to issues and tasks.

After you turn on planning for a work item, the Implementation widget appears. The widget has the following sections:

  • Workplan: The status of the workplan.
  • Readiness: The readiness level of the work item, or the status of its evaluation. It appears after the work item has a workplan.
  • Build: The status of the implementation. It appears after GitLab Duo starts to implement the workplan.

The workplan status is one of the following:

  • Not yet created: The work item has no workplan, and you can create one.
  • No workplan: The work item has no workplan, and you do not have permission to create one.
  • Preparing: GitLab Duo starts to generate a workplan.
  • Reviewing work item: GitLab Duo reviews the work item before it writes the workplan.
  • Generating workplan: GitLab Duo writes the workplan.
  • Awaiting input: GitLab Duo needs your input to continue. When GitLab Duo asks questions, the status also shows the number of open questions.
  • All questions resolved: All open questions from GitLab Duo are resolved, and the generation can continue.
  • Generation failed: GitLab Duo could not generate a workplan.
  • Generation canceled: The generation was canceled before GitLab Duo wrote a workplan.
  • Ready for review: The work item has a workplan.

Set up workplan generation

Before you can generate a workplan with GitLab Duo, your project and top-level group must be set up to run the Generate Workplan flow.

Prerequisites:

  • The work item must be an issue or a task in a project. You cannot generate a workplan for a work item in a group.
  • GitLab Duo turned on.
  • Flow execution and foundational flows turned on for the top-level group, with the Generate Workplan flow selected. On GitLab Self-Managed, flow execution and foundational flows must also be turned on for the instance.
  • The Allow flow execution and Allow foundational flows settings turned on for the project.
  • Beta and experimental features turned on for the top-level group. On GitLab Self-Managed, they must be turned on for the instance.

For the steps to change these settings, see turn foundational flows on or off.

Benefits

A workplan separates intent from implementation:

  • The work item description captures intent, or what you want and why. People read the description to understand the goal.
  • The workplan captures implementation, or how to do the work. Agents follow the workplan to carry out the work.

This separation gives you three benefits:

  • Intent protection: An agent iterates on the workplan in a field separate from the work item description, so your intent stays intact even as the plan changes across several runs.
  • Plan review: An agent pauses after producing a workplan, so you can review, refine, and approve the plan before any work starts.
  • Agent focus: Because the workplan is a dedicated field, an agent asked to plan work puts that context there instead of rewriting the description or other parts of the work item.

When to use a workplan

Use a workplan when you plan to give work to an agent, either by selecting Implement or by providing the plan to a coding agent yourself. A workplan adds the most value when an agent runs the work.

You do not need a workplan for small or well-understood changes, where planning adds more effort than it saves.

Turn on planning for a work item

By default, the Implementation widget is hidden on a work item. To show the widget, turn on planning for that work item.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.
  • An issue or a task.

To turn on planning, on the work item, in the upper-right corner, use one of the following methods:

The Implementation widget appears on the work item, and the Plan button no longer appears. After you turn on planning for a work item, you cannot turn it off.

Create a workplan

Create a workplan to describe how to complete a unit of work.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.
  • Planning turned on for the work item.

You can generate a workplan with GitLab Duo or write one manually.

Generate a workplan with GitLab Duo

GitLab Duo generates the workplan with the Generate Workplan flow, which runs in the background. When you select Plan to turn on planning for a work item, GitLab Duo starts to generate a workplan.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.
  • Workplan generation set up.

To generate a workplan with GitLab Duo:

  1. On the work item, in the Implementation widget, select Generate.
  2. If GitLab Duo asks questions, answer them in the comment threads on the work item. Then, in the Implementation widget, select Continue.

GitLab Duo writes the workplan to the Implementation widget, and the status changes to Ready for review.

The flow runs in the background, so you can leave the page while GitLab Duo works. When GitLab Duo needs your input, you receive a to-do item and an email.

To follow the progress of a run, or to find out why the generation failed, open the session for the latest run. In the Implementation widget, next to the status, select View session ( session-ai ). The icon appears when the status is Reviewing work item, Generating workplan, or Generation failed. To close the GitLab Duo sidebar, select View session ( session-ai ) again.

If the generation fails, in the Implementation widget, select Try again.

Create a workplan manually

To create a workplan manually:

  1. On the work item, in the Implementation widget, select More options > Create manually.
  2. Optional. From the template dropdown list, select a workplan template.
  3. Enter the workplan content. To switch between editors, select Switch to rich text editing or Switch to plain text editing.
  4. Select Save changes.

Workplan templates are description templates with filenames that end in .plan.

View a workplan

To view a workplan:

  1. Go to the work item.
  2. In the Implementation widget, select View.

The workplan opens in a panel and shows the rendered content.

Edit a workplan

Prerequisites:

  • Permission to edit the work item.

To edit a workplan:

  1. On the work item, in the Implementation widget, select View.
  2. In the panel, select Edit.
  3. Make your changes.
  4. Select Save changes.

To discard your changes, select Cancel.

Regenerate a workplan

Regenerate a workplan to replace its content with a new version from GitLab Duo.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.
  • Workplan generation set up.

To regenerate a workplan:

  1. On the work item, in the Implementation widget, use one of the following methods:
    • Next to View, select the down arrow ( chevron-down ) > Regenerate.
    • Select View. Then, in the panel, select More actions ( ellipsis_h ) > Regenerate.
  2. In the confirmation dialog, select Regenerate.
  3. If GitLab Duo asks questions, answer them in the comment threads on the work item. Then, in the Implementation widget, select Continue.

GitLab Duo replaces the existing workplan, including any edits, with the new version. This action cannot be undone.

Resolve all questions from GitLab Duo

When GitLab Duo asks questions while it generates a workplan, you can resolve all open questions at once. Use this option when you do not want to answer each question.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.

To resolve all questions:

  1. On the work item, in the Implementation widget, select Question actions ( ellipsis_v ) > Resolve all questions.
  2. To continue the generation, select Continue. If you cannot start GitLab Duo flows, the Implementation widget shows a message instead. Someone who can start GitLab Duo flows must continue the generation.

Delete a workplan

Prerequisites:

  • Permission to edit the work item.

To delete a workplan:

  1. On the work item, in the Implementation widget, select View.
  2. In the panel, select More actions ( ellipsis_h ) > Delete.
  3. In the confirmation dialog, select Delete.

This action cannot be undone.

Readiness

The availability of this feature is controlled by a feature flag. For more information, see the history.

Readiness shows how ready a work item is for GitLab Duo to implement. GitLab Duo evaluates how complete, clear, and well scoped the work item is, and shows the result as a readiness level.

Prerequisites:

  • Planning turned on for the work item.

In the Implementation widget, the readiness level appears as Low, Medium, or High. The readiness level appears after GitLab Duo generates a workplan and evaluates the work item.

While GitLab Duo evaluates the work item, the Implementation widget shows Evaluating. If the work item has no readiness level, the widget shows one of the following:

  • Evaluation failed: The session failed before the evaluation finished.
  • Evaluation canceled: The session was canceled before the evaluation finished.
  • Not evaluated: GitLab Duo did not evaluate the current workplan. For example, you created or edited the workplan manually.

To try again, regenerate the workplan.

To view feedback on how to improve readiness, select Readiness details ( information-o ) next to the readiness level. The feedback opens in a drawer and shows one of the following:

  • Suggested changes to the work item or its workplan
  • Ready to implement, when GitLab Duo has no suggestions

If the feedback cannot be loaded, the drawer shows an error. To load the feedback again, select Try again.

To close the drawer, select Readiness details again.

To improve readiness, make the suggested changes. For example, add requirements, acceptance criteria, and constraints to the work item description and to the workplan steps.

Decision log

The availability of this feature is controlled by a feature flag. For more information, see the history.

The decision log is a record of the decisions made about a work item. It keeps the reason for each decision next to the work item, so the history is not lost in chat or in comment threads.

The decision log is available on issues and tasks, and on custom work item types based on issues or tasks. A work item does not need a workplan to have a decision log.

GitLab Duo adds a decision to the log when it settles an open question while it plans the work. You can also record a decision yourself at any time.

Prerequisites:

  • The Planner, Reporter, Security Manager, Developer, Maintainer, or Owner role for the project.

To open the decision log:

  • On the work item, in the header, select Decision log ( log ).

The button shows a count of the decisions on the work item.

Record a decision manually

To record a decision manually:

  1. On the work item, in the header, select Decision log ( log ).
  2. In the panel, select New decision.
  3. Complete the fields. The required fields are Decision, Decided by, and Context.
  4. Optional. In Why, explain why you chose this option over other options.
  5. Optional. In Source link, add a link to where the discussion happened, such as Slack, Google Docs, or GitLab.
  6. Select Create decision.

Implement a workplan with GitLab Duo

When a workplan exists, GitLab Duo can implement it in a merge request. GitLab Duo treats the workplan as the primary specification and uses the work item description and comments only for additional context.

Prerequisites:

To implement a workplan with GitLab Duo, use one of the following methods:

  • On the work item, in the Implementation widget, select Implement.
  • Open the workplan, then implement it from the panel:
    1. On the work item, in the Implementation widget, select View.
    2. In the panel, select Implement.

While an implementation is in progress or complete, Implement does not appear, so you cannot start a second implementation at the same time.

Implementation status

The availability of this feature is controlled by a feature flag. For more information, see the history.

After you implement a workplan with GitLab Duo, the Implementation widget shows the implementation status.

In the Workplan section, the status is one of the following:

  • Implementation in progress: The implementation has started and is not complete.
  • Implementation failed: The implementation session failed.
  • Implementation canceled: The implementation session was stopped, or all merge requests from the implementation were closed.
  • Implementation complete: All merge requests from the implementation are merged.
  • Regenerating: GitLab Duo regenerates the workplan. When GitLab Duo needs your input, the status changes to Awaiting input.

The Build section shows the status of the implementation:

  • Developing: GitLab Duo writes the code for a new merge request.
  • Updating: GitLab Duo updates an open merge request.
  • Awaiting input: GitLab Duo needs your input in the session to continue.
  • Needs attention: The session ended without a merge request. To find out why, view the session.
  • Ready for review: At least one open merge request has no reviewers.
  • In review: All open merge requests have reviewers.
  • Merged: All merge requests are merged.

The Build section does not appear when the implementation fails or is canceled.

To view the session for an implementation that is in progress or needs attention, in the Build section, select View session ( session-ai ). When the implementation fails, or GitLab Duo regenerates the workplan, the icon appears next to the status in the Workplan section.

When GitLab Duo has created merge requests, the Build section links to them, except when the status is Developing or Updating:

  • For one merge request, select View merge request.
  • For more than one merge request, select the number of merge requests to go to the Development section of the work item.

While an implementation is in progress or complete, the readiness level is hidden. When the implementation is canceled, the readiness level and Implement appear again. When the implementation fails, the readiness level appears again, and Implement appears only if you cannot restart the failed session.

When the implementation is complete, you cannot regenerate the workplan.

Update an implementation

The availability of this feature is controlled by a feature flag. For more information, see the history.

After you change the workplan, GitLab Duo can update the merge requests from the implementation. GitLab Duo pushes the changes to the source branches of the open merge requests. If a change affects a merged merge request, GitLab Duo opens a new merge request.

Prerequisites:

  • The Developer, Maintainer, or Owner role for the project.
  • GitLab Duo Agent Platform remote flows turned on.
  • Developer Flow turned on for the top-level group and the project. For more information, see turn foundational flows on or off.
  • A Build status of Ready for review or In review.
  • No GitLab Duo session running for the work item.
  • Changes to the workplan after the latest implementation session started.

To update an implementation:

  1. On the work item, in the Implementation widget, next to the Build section, select the vertical ellipsis ( ellipsis_v ).
  2. Select Update implementation.

While GitLab Duo updates the merge requests, the Build status is Updating.

Implement a work item without a workplan

For a small or well-understood change, GitLab Duo can implement the work item without a workplan. GitLab Duo starts the Developer Flow with the work item as context, and planning stays off.

Prerequisites:

To implement a work item without a workplan:

  • On a work item without planning turned on, next to Plan, select the down arrow ( chevron-down ) > Implement.