Feature & Task Lifecycle
Every feature and every task in a project moves through a lifecycle: an ordered sequence of stages that describes the process work is expected to follow, from first being planned to being considered done. A project can have several named lifecycles for features and several for tasks, and each type has one default. The defaults start from a sensible built-in process that you can customize.
The default lifecycles
Before the first stage, every feature and standalone task goes through an automatic workspace setup step. It prepares the git worktree or clone when the work uses one and is instant otherwise. It isn't a stage you can edit, and work doesn't start until setup is ready. See Workspace Locations.
Out of the box, a feature moves through:
- Design — the feature is being planned: its spec is being written and refined through the feature's planning conversation. The planning agent asks clarifying questions, researches when needed, drafts a spec for your review, and iterates on your comments. If you ask it to come back to something, it returns to it before finishing, and then it creates the tasks. It can also ask for feedback whenever there is no clear path.
- Implementation — the feature's tasks are being worked on.
- Done — all of the feature's tasks are complete.
A task, by default, moves through:
- Implementation — the task is being worked on.
- Review (optional) — entered only if the task is sent for review, either by the agent that worked it or by a human. A task that's simply marked complete skips straight to Done.
- Done — the task is complete.
These defaults reproduce the behavior Melius has always had, so a project that never touches its lifecycle settings won't notice any difference. Extra stages — an additional review step, a required human approval, a design review before implementation starts — are things you add deliberately.
Claim gate for feature tasks
Agents can claim a feature's tasks only while the feature is in an Implementation stage or later (for example a review-before-done stage, so remediation work stays claimable). Every stage before Implementation — Design and Planning, or a review stage placed before Implementation — blocks claiming for all task-selection modes, including directly assigned tasks. If a lifecycle has no Implementation stage, only the Design stage blocks. Use Move to Next Stage on a feature in Design and Planning to advance it; tasks show a blocked by planning badge meanwhile.
Adding tasks to a feature after implementation
A task created on a feature that is past Implementation but not done (for example in a review stage) is accepted, and the feature moves back to its Implementation stage so the full lifecycle runs again. A feature that is done accepts no new tasks: the request is rejected with a message pointing to the melius__feature__reopen_planning tool, which returns the feature to Design and Planning with a required reason and reopens planning. Create the tasks after planning has been reopened. This rule applies when a task is created; it is not checked when a task is claimed.
Review stages and activities
A Review stage is different from the other stage kinds: instead of being worked on directly, it runs one or more review activities in parallel. Each activity is a single review — performed either by an agent with a given profile (Reviewer by default, or a custom reviewer profile) or by a human — and the stage advances once every required activity in it has passed. Optional activities never hold up the stage.
This is how you can run, say, a QA review and a security review side by side on the same feature, or have one review stage handled by an agent and a later one require a human's sign-off.
Review triggers and action stages
In a task lifecycle, an optional Review stage with the on_request trigger runs when an implementer, a human, or a reviewer agent sets the task to Review. If the task is completed from Implementation instead, it goes to Done unless a required review or an intervening Action stage applies. A required Review stage is started when the task is completed from Implementation. Once a task is already in Review, manually marking it complete moves it to Done and cancels its open reviews, even if the stage is required.
When an Action stage completes, work moves to the next stage. If that stage is Review, it runs even when its trigger is on_request. For example, Implementation → Action → Review → Done runs the review after the action; Implementation → optional Review → Done skips the review when the task is completed without a review request.
A review activity's required setting is separate from the stage's setting. Once a Review stage runs, every required activity must pass; a required failure sends the work to the configured on-fail stage for remediation. This also applies to a required activity in an optional stage. Optional review activities can record results and findings, but their outcomes do not block, fail, or advance the stage. A stage with no required review activities advances immediately.
Pass and fail outcomes
When every required review activity in a stage passes, the feature or task advances to the next stage. When a required review fails, the work is sent back for remediation instead of moving forward:
- A task that fails review returns to the to-do list for whoever originally worked it, along with the reviewer's findings posted as a comment so they know what to fix.
- A feature that fails review returns to an earlier stage — typically back to Implementation — and the feature's planning conversation is reopened with the findings, so the plan can be adjusted or follow-up tasks created to address them.
Optional review activities never cause a fail outcome — they can record findings, but they don't block progress either way.
Human vs. agent reviews
A review activity can be handled by an agent (using whichever reviewer profile it's configured with) or by a human. A human review shows up wherever that task's or feature's reviews are listed, with a simple choice to Approve or Request changes — the stage waits until someone makes that call. This is the same mechanism used for a final sign-off step, or for approving a feature's design before implementation begins.
Reviews, their verdicts, and any findings they recorded are visible wherever you'd expect to find them: in the Lifecycle tab of a task or feature, where each review appears inside the stage it belongs to.
The Lifecycle panel also shows the artifacts of the item under review, so a human reviewer can inspect the actual output, such as a diff or screenshot, without leaving the review. For a task review it lists that task's artifacts; for a feature review it includes the artifacts from all of the feature's tasks. Agent reviewers can read the same artifacts.
Reviews that end without a verdict
A review agent completes its review by submitting a verdict. When a review run ends without a verdict or a feedback request, the review returns to pending for another attempt. After three unsuccessful attempts, it is cancelled. For a task review, Melius adds a notice to the reviewed task's Conversation; this cancellation path does not add a notice for a feature review. You can request a new review or review the work yourself. A feedback request is a separate outcome from a run ending without a verdict or request. Unlike reviews, tasks and feature planning are parked after three consecutive iterations without completing work or requesting feedback.
Action stages
An Action stage does something between implementation and done, such as running an end-to-end script, opening a pull request, publishing documentation, or collecting a manual sign-off. You can add any number of action stages to a feature lifecycle or a task lifecycle, anywhere after the first stage and before Done.
Each action stage holds one or more activities of these types:
- Agent task — Melius creates a task for the stage, using the directions you write (or a prompt template with its variable values filled in) and the agent profile you choose. An agent with that profile picks it up like any other task.
- Human task — a manual checkpoint. Melius creates a task that only a person can complete; agents never pick it up. It is marked Needs you and offers Complete and Cannot complete (which asks for a reason). Pending human tasks also appear in your Inbox and count toward its badge until they are completed, failed, or cancelled.
- Command — runs a shell command on a connector. Exit code 0 passes; anything else fails. The command runs in the workspace location of the feature or task (a task uses its own, otherwise its feature's, otherwise the project default), optionally in a sub-path you specify. The timeout defaults to 30 seconds and can be raised to at most 10 minutes. Output is captured and shown with the result. A non-zero exit, a timeout, or an offline connector all count as a failure.
Activities are required by default. The stage completes, and the work moves on, once every required activity has completed. Optional activities never block the stage or make it fail.
System variables
Directions and prompt template variable values in an action stage can use system variables. Melius replaces them with details of the task or feature the lifecycle belongs to when the stage task is created. They always describe that work, never the stage task itself.
{{melius::task_id}},{{melius::task_title}},{{melius::task_description}}{{melius::feature_id}},{{melius::feature_title}},{{melius::feature_description}}— for a task, the feature the task belongs to
In a feature lifecycle there is no origin task, so the task variables are empty. The feature variables are empty for a task that does not belong to a feature. Saving a stage that uses an unknown melius:: name is rejected with a validation error that lists the unsupported names.
For example, a Commit Changes stage on a task lifecycle can use the Commit Changes prompt template and set its overview of changes variable to Commit the work for task {{melius::task_id}}: {{melius::task_title}}. {{melius::task_description}}. Every task that reaches the stage gets its own commit task whose directions name that task, with no per-task editing of the lifecycle.
Action tasks belong to the originating work
Tasks created by an action stage are part of the lifecycle of the task or feature that triggered them. They do not have a lifecycle of their own and never trigger further stages, so completing one cannot create more stage tasks. They are hidden from the Tasks list by default. Find them in the Lifecycle actions tab on the originating task or feature, which shows a count of actions and opens an action task and its conversation when you select a row. To see them in the Tasks list, turn on Include lifecycle actions; they then appear with a Lifecycle action badge and a link to the work they belong to. Opening an action task shows a link back to the task or feature it belongs to.
When an action fails
An agent working an action task can report the action as failed with a reason. The activity is marked Failed - cannot complete and the reason appears in the Lifecycle panel, the Lifecycle actions tab and the failure report. This goes to the on-fail stage: planning by default for features, the earliest earlier stage for tasks. If the agent instead asks you a question, the task pauses and waits for your answer rather than failing. A failed optional activity does not fail the stage.
A failed required activity (including an agent reporting that it cannot complete, or a person choosing Cannot complete) is handled like a failed required review. Open work in the stage, including its tasks and any running commands, is cancelled, and a report of what failed is built. By default the work goes back to planning: a feature reopens its planning conversation with the report, while a task, which has no design stage, returns to the earliest stage before the action stage. You can choose a different stage to return to. When the work reaches the action stage again it starts a fresh round.
Seeing progress
Features and tasks have a single Lifecycle tab that replaces the former Reviews-only view. It shows a timeline of stages with the current stage highlighted. Under each stage you see its activities for the current round: review verdicts and findings, agent and human tasks with their status and a link, and command results with status, exit code, and expandable output. Earlier rounds are collapsed. The stage drawer shows the same per-activity status.
Examples
- End-to-end tests: a Command activity running your e2e script before Done. If it fails, the feature goes back to planning with the output attached.
- Open a pull request: an Agent task whose directions tell the agent how to create the pull request using tools you have set up.
- Manual sign-off: a Human task asking someone to confirm the release is ready.
Melius does not create pull requests or manage git credentials itself. If you want those steps, build them as an agent task or a command.
Configuring a project's lifecycle
Open a project and go to its Lifecycle tab to see and edit its feature and task lifecycles. Each one is shown as a sequence of stages, and clicking a stage lets you:
- Rename it, or change whether it's required.
- Set its default profile — the role a task in that stage resolves to when it doesn't request one of its own. See Agent Profiles for how that resolution works.
- For a Review stage, add or remove its review activities and choose whether each one is handled by an agent or a human.
- For an Action stage, add agent task, human task, and command activities, and set each one's directions, profile, prompt template, required flag, and (for commands) sub-path and timeout.
- Choose where a failed review sends the work back to.
- Insert a new stage after it, or remove it (moving anything currently in that stage back to an earlier one).
Every project's lifecycles are independent, so you can tailor the process for a project with stricter review requirements without affecting any other project.
Multiple lifecycles per project
The Lifecycle tab has a switcher for feature lifecycles and task lifecycles. Within each type you can keep as many named lifecycles as you need, for example one for UI work and one for backend work. Names must be unique within a project and type. From the tab you can:
- Create a lifecycle by cloning an existing one of the same type.
- Rename a lifecycle.
- Set a lifecycle as the default for its type. Each type always has exactly one default, and the default cannot be archived; set another lifecycle as default first.
- Archive a lifecycle to hide it from pickers, or unarchive it later. Work already using an archived lifecycle keeps working.
Choosing a lifecycle for new work
The create dialogs for tasks and features include a Lifecycle picker pre-filled with the default for that type. Choose another to use it instead. Agents and API clients can omit the lifecycle to get the default, or name one explicitly (see MCP Server). A task created under a feature does not follow the feature's lifecycle; it uses the task default unless you choose another.
Editing a lifecycle and work in progress
A task or feature cannot change its lifecycle after it is created. It is tied to the lifecycle as it was defined at that moment. Editing a lifecycle never affects work already in flight: existing items finish on the stages they started with, and only items created afterwards use the updated stages.
When you open an item whose lifecycle has since been edited, it shows the older definition it is following in read-only form, with a notice that it is out of date and a link to the current lifecycle. The task and feature pages also show the lifecycle name with a View lifecycle link, and a feature page shows a timeline of the feature's own lifecycle stages. The feature timeline does not include its tasks' progress.