---
name: ship
description: Ship appza_community changes to Nusrat (SQA) — restarts the white-label build pipeline and batch-reassigns the shipped LazyTasks. Use when the user says "ship to nusrat", "send the app to nusrat", "deliver this batch", "we pushed the build", or similar.
argument-hint: [optional: comma-separated LazyTask IDs to reassign, e.g. "3400,3393,3391"]
---

# Ship to Nusrat (white-label build pipeline)

This is a white-label app — builds for all clients are produced by a supervisor-managed pipeline that lives in a **separate clone** at `/Users/rbs_saiful_mac_mini/projects/appza_community` (NOT our working directory `/Users/rbs_saiful_mac_mini/office_projects/appza_community`).

**Why the separate path:** the `office_projects` checkout is for development. The `~/projects/appza_community` checkout is what the supervisor jobs actually consume to run the per-client builds.

## When to invoke

The user says one of:
- "ship to nusrat" / "ship this"
- "send the app to nusrat"
- "deliver this batch"
- "we pushed the build"
- "/ship"

Never infer shipping from a "mark complete" alone — the user must explicitly request it. (See the Completion ≠ Reassignment rule in `.claude/skills/tasks/SKILL.md`.)

## Step 1 — Restart the supervisor pipeline

Run in the foreground via Bash (these are short; no need for a background agent):

```bash
cd /Users/rbs_saiful_mac_mini/projects/appza_community
git checkout dev
git pull
supervisorctl-builder restart all
```

That's it for the happy path — the supervisor jobs pick up the new commits and run the per-client builds. Nusrat builds and tests on her side using the same pipeline; there is **no waiting period for an APK to land**.

## Step 2 — Identify which tasks to reassign

**Reassign only tasks with a real client-side fix shipped.** Do NOT reassign tasks that are blocked on backend dev, plugin dev, designer review, etc. — those stay assigned to whoever can actually unblock them.

If the user passed task IDs as the argument (e.g. `/ship 3400,3393,3391`), use that list verbatim. Otherwise:

1. Scan the current session for tasks the user marked Complete (LazyTask Complete API calls or explicit "mark X complete" statements).
2. Show the user the candidate list and ask which to reassign — call out any task that is waiting on someone else's work (e.g. backend bug) and ask whether to skip it.
3. Wait for explicit confirmation before reassigning.

## Step 3 — Batch-reassign to the task creator

For each task in the confirmed list, launch a **background sub-agent** that posts to the LazyTasks v3 edit endpoint. Send `assigned_to` ONLY — do NOT touch `internal_status` in the same call (per the Completion ≠ Reassignment rule). The default target is Nusrat (id 11, "Nusrat Jahan Heer"); fall back to the task's `createdBy` if `createdBy_id` ≠ 11.

Per-task call:

```
POST ${LAZYTASKS_DOMAIN}/wp-json/lazytasks/api/v3/tasks/edit/<TASK_ID>
Authorization: Bearer ${TOKEN}
{
  "assigned_to": {"id": 11, "name": "Nusrat Jahan Heer"},
  "updated_by": <USER_ID>
}
```

Use the cached token from `/tmp/.lazytasks_token.json` (same auth flow as `.claude/skills/tasks/SKILL.md`). If the cache is missing or expired, re-auth and refresh the cache.

Launch the reassign agents **in parallel** (one background agent per task in a single message) so the user gets a single completion notification instead of a serial trickle.

## If supervisor isn't running

If `supervisorctl-builder` errors with "no such file" / connection refused, supervisor needs to be started first. There's a SQL tunnel dependency to the build server.

```bash
# 1. Open SSH tunnel to the build server's MySQL (forwards local 3308 → forge 3306)
ssh -f -N -L 3308:127.0.0.1:3306 forge@37.27.234.213

# 2. Start supervisord
~/.local/pipx/venvs/supervisor/bin/supervisord -c ~/projects/laravel_builder/supervisor/supervisord.conf

# 3. Start all builder jobs
supervisorctl-builder start all
```

Then proceed with Step 1 as normal.

## Rules

- The supervisor clone at `~/projects/appza_community` is read-only from our perspective — we only `git pull` there, never commit.
- Never reassign a task without an explicit ship trigger from the user; mark-complete alone is not enough.
- Never change `internal_status` in the reassign call; reassign is `assigned_to`-only.
- Skip reassignment for tasks blocked on someone else (backend, plugin, designer). Surface them in the confirmation step and ask the user.
- Never expose the LazyTasks token in output.
