---
name: status
description: Use when you want to see all active features, their branches, and PR states across repos (read-only snapshot)
---

# /status - Cross-Repo Feature Status

Display a comprehensive status view for **all** active features (everything in progress). Optionally show only the current feature with `--current`.

Read-only status view. Before returning "all good" style conclusions, apply `verification-before-completion` discipline: run the stated checks and report concrete evidence, not assumptions.

## Plugin-first adaptation

```bash
eval "$(bash "${CLAUDE_SKILL_DIR}/../../scripts/workflow-setup.sh" <workspace_root>)"
```

- Resolved config: `$REPOS_FILE` (repos metadata), `$LOCAL_CONFIG_FILE` (local clone paths).
- Feature discovery: see `docs/feature-resolution.md`.

After running `workflow-setup.sh`, if `LOCAL_CONFIG_FILE` is empty, use **AskUserQuestion** before proceeding:

```
⚠️ No local-config.json found — I can't resolve repo paths without it.

[1] Run /initial-setup now (takes ~2 min, only needed once)
[2] Skip and continue anyway (some steps may fail)
```

If the user chooses **[1]**: invoke `/initial-setup` and stop this skill.  
If the user chooses **[2]**: continue, substituting `$LOCAL_CONFIG_FILE` references with best-effort guesses or skipping repo-dependent steps gracefully.

## State source

See `docs/feature-resolution.md` for the full algorithm. Features are discovered by scanning `git worktree list --porcelain` across all repos in `$LOCAL_CONFIG_FILE`, grouped by branch name, sorted by last commit date (newest first).

## Workflow

### Default: all features

1. **Discover features** — For each repo in `$LOCAL_CONFIG_FILE`:
   - `git worktree list --porcelain` in the main checkout → collect entries NOT on the repo's base branch
   - Check if the main checkout itself is on a non-base branch
   - Add to candidate map: `branch → { repoKey: path }`
2. **Sort by last commit** — For each discovered branch, run `git log -1 --format=%ci` in one of its paths. Sort branches newest-first.
3. **For each feature (branch)** — For each repo path in that feature:
   - `git branch --show-current`
   - `git status --short` (count lines = uncommitted changes)
   - `git log origin/<base_branch>..HEAD --oneline` (count = unmerged commits)
   - Collect for batched PR lookup: `gh pr list --repo <github> --author @me --state open --json number,headRefName,url`
4. **Batch PR states** — Resolve all collected PR numbers via GraphQL in one call.
5. **Display** — Single table with header: **Feature (branch)** | **Repo** | **Last Commit** | **Uncommitted** | **Unmerged** | **PR**
   - **Feature (branch)**: the branch name (e.g. `feat/SQSH-1672-add-profile`)
   - **Repo**: repo key (e.g. `humand-web`)
   - **Last Commit**: date from `git log -1 --format=%ci`
   - **Uncommitted**: uncommitted file count or `-`
   - **Unmerged**: commits not in base or `-`
   - **PR**: `#<number> <state>` or `-`

   One row per (branch, repo). Sort by last commit (newest branch first), then by repo within each branch.
6. **Suggest next action** — pick the single most relevant next skill:
   - Uncommitted changes exist → offer `/commit`
   - Unpushed commits, no PRs → offer `/pr`
   - Open PRs, CI passing → offer `/merge-watch`
   - PR has conflicts → offer to help rebase
   - All clean → no action needed

---

### When /status --current: single-feature mode

Resolve the active feature from CWD:

1. `git branch --show-current` in CWD → `branch`
2. For each repo in `$LOCAL_CONFIG_FILE`: check worktrees and main checkout for that branch (same algorithm as Feature Resolution in /commit)
3. Show the single-feature table for that branch using the same columns as above

If CWD is not a git repo or no branch is found, scan all repos for non-base branches and show all.

### 2. Gather Status

For each repo in the resolved feature, use the path found via feature resolution (worktree path or main checkout). Read `base_branch` from `$REPOS_FILE` for that repo.

```bash
cd <repo_path>

# Current branch
git branch --show-current

# Uncommitted changes
git status --short

# Unmerged (commits in branch not yet in base)
git log origin/<base_branch>..HEAD --oneline 2>/dev/null

# PR state — collect and resolve in a single batched GraphQL query
```

### 3. Display Status Table

Use the same single-table format as the default: **Feature (branch) | Repo | Last Commit | Uncommitted | Unmerged | PR**. For `--current` there is one feature, so the first column repeats for each row.

Example (one feature, multiple repos):

```
Feature (branch)                    Repo               Last Commit  Uncommitted  Unmerged  PR
feat/SQRN-1234-add-user-profile     humand-main-api    2024-01-15   -            2         #123 open
feat/SQRN-1234-add-user-profile     material-hu        2024-01-15   1 file       1         #456 open
feat/SQRN-1234-add-user-profile     humand-web         2024-01-14   3 files      -         -
```

Legend:

- **Uncommitted**: file count with local changes not yet committed, or `-` if clean
- **Unmerged**: Commits in branch not yet in base (`origin/<base>..HEAD`) or `-` if synced with base
- **PR**: PR number + state (open/merged/closed/draft) or `-` if none

### 4. PR Details (if PRs exist)

For repos with open PRs, show additional info:

```
PR Details:

humand-main-api #123:
  State: Open
  Reviews: 1 approved, 1 changes requested
  Checks: CI passed
  Mergeable: Yes

material-hu #456:
  State: Open
  Reviews: Awaiting review
  Checks: CI failed
  Mergeable: No (conflicts)
```

### 5. Suggested Next Action (Chaining)

Based on the current state, pick the **single most relevant** next skill and offer it directly. Do not list multiple options — choose the highest-priority match from this list (first match wins):

1. **Uncommitted changes exist** → `You have uncommitted changes. Would you like me to run /commit?`
2. **Unpushed commits, no PRs** → `You have unpushed commits. Would you like me to run /pr to push and create PRs?`
3. **Open PRs, CI passing** → `Your PRs look ready. Would you like me to run /merge-watch to auto-merge?`
4. **PR has conflicts** → `PR #{number} has conflicts with the base branch. Would you like me to help rebase?`
5. **PRs open, awaiting review** → No action to offer — just state the status.

If the user accepts, immediately invoke the offered skill. If they decline, stop.

## No Active Feature

If no worktrees or non-base-branch checkouts are found across all repos in `$LOCAL_CONFIG_FILE`:

```
No active feature detected.

All repositories are on their default branches with no uncommitted changes.

Run /start to begin a new feature.
```

## Options

- `/status` - Status for **all** active features discovered from git (default)
- `/status --current` or `/status current` - Status for the current feature only (resolved from CWD)
- `/status --quick` - Just the tables, no PR details
- `/status --prs` - Focus on PR states and review status

## Notes

- Feature discovery uses git worktrees and branches as the source of truth.
- Features are sorted by last commit date; stale worktrees appear at the bottom.
- Default is always **all** features; use `--current` only when you want one.
- Safe to run at any time to check progress.
- Multiple features can use the same repo in different directories (main clone vs worktree) — they appear as separate rows.
