> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enagrams.com/llms.txt
> Use this file to discover all available pages before exploring further.

# workstream_complete

> Wrap up a workstream and finalize after merge

## Overview

Two-phase completion:

1. **Plan phase** — call without `pr_url`. Returns a squash-merge plan: suggested title, markdown PR body, and literal `git` + `gh` commands to run locally.
2. **Finalize phase** — after you open and merge the PR, call again with `pr_url`. Status flips to `completed` and participants' sessions are notified.

If the workstream still has open tasks the response includes `summary.has_blockers=true`. Resolve those (or cancel them) before finalizing.

## Parameters

| Parameter    | Type   | Required | Description                                  |
| ------------ | ------ | -------- | -------------------------------------------- |
| `slug`       | string | Yes      | Workstream slug                              |
| `pr_url`     | string | No       | Once the PR exists, pass its URL to finalize |
| `session_id` | string | No       | Your current session id                      |

## Plan-phase example

```json theme={null}
{
  "tool": "workstream_complete",
  "arguments": { "slug": "stripe-subscription-upgrades" }
}
```

Response (abridged):

```json theme={null}
{
  "plan": {
    "suggested_title": "feat(billing): stripe subscription upgrades",
    "pr_body_md": "## Summary\n- ...\n\n## Test plan\n- ...",
    "commands": [
      "git checkout main && git pull",
      "git merge --squash ena/stripe-subscription-upgrades",
      "git commit -m 'feat(billing): stripe subscription upgrades'",
      "gh pr create --base main ..."
    ]
  },
  "summary": { "has_blockers": false, "open_tasks": 0 }
}
```

## Finalize example

```json theme={null}
{
  "tool": "workstream_complete",
  "arguments": {
    "slug": "stripe-subscription-upgrades",
    "pr_url": "https://github.com/acme/app/pull/417"
  }
}
```
