# Findings and next steps: next, report, mark, overlap, dead-code, security scan

Rank what to do next from the index, open the repo report and mark its items, see which branches touch your files, list dead code and scan git history for secrets.

Commands that read what the index found and turn it into work: the ranked
next steps, the repo report and its item statuses, branch overlap, dead code
and the full-history secret scan. None of them call a model unless a flag
says so.

## `repowise next`

The few things worth doing next, ranked from what the index already
stores: health, fix history, performance, security, doc drift, dead code,
decisions and coverage. Each row has its reason, effort, what done looks
like, and a command when one applies. It is the same list as the
dashboard's **Do next** and `get_overview`'s `next_actions`.

```bash
repowise next [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--horizon` | string |  | week or quarter. Default: the week, or the quarter when the week holds no work. |
| `--all` | boolean | `false` | Show up to 20 rows, not 5. |
| `--format` | string | `table` | table or json (the whole stored view). |
| `--repo` | string |  | In workspace mode, target one repo. |
| `--no-workspace` | boolean | `false` | Force single-repo mode. |
| `--prompt setup` | string |  | Print the prompt that hands every setup step left to your agent. |
| `--dismiss setup` | string |  | Stop offering the setup pass here. The steps stay in this list. |

`repowise status` ends with a short **Next** block pointing here.

Setup steps rank in the same list as the rest of the work and leave it as
soon as they are done: the post-commit hook, a coverage report or runtime
evidence to ingest, decisions to check, a model for the documentation, and,
once your agents have used Repowise for a while, settings worth changing,
always-load and the distill hook. The evidence rows ask for a coverage
report when none is stored, and for a profile when the index holds an entry
point, benchmark or test suite and no run is stored; each names
`repowise coverage setup` or `repowise evidence setup`.

```bash
repowise next --prompt setup      # paste into your agent: it works through every step
repowise next --dismiss setup     # stop offering the pass
```

After your agent's first Repowise call, `repowise status`, the session-start
hook and the MCP server instructions offer the setup pass once, with one
line, until it is done or dismissed.

## `repowise report`

The repo report: what Repowise found, most urgent first, in plain language.
`init` writes it once after the first index, free, and names it on one line
of the finish panel. Every item has its path and line, a link into the
dashboard while `repowise serve` runs, a "Fix with your agent" prompt and
its status. Bare `repowise report` is `repowise report repo` on the current
directory (alias `report first-look`). The other reports (`assessment`,
`changes`, `inventory`, `estate`) are on
[Evidence reports](https://docs.repowise.dev/cli/changes#repowise-report).

```bash
repowise report [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--format` | string | `html` | html (written to .repowise/reports/repo-report.html and opened), md (the summary: headline, counts and Do these first), or json (for agents: every item with its id and status). Markdown and JSON carry no prompts. |
| `--out` | string |  | Write to this file. |
| `--since-last` | boolean | `false` | List what was fixed, changed or found new since the report was written. |
| `--prompt` | boolean | `false` | Print the whole-report agent prompt: the open items with their ids and the repowise mark command for each. |
| `--llm` | boolean | `false` | Rewrite the report's wording at HEAD with one call to the configured model. Prints the cost first. |
| `--yes / -y` | boolean | `false` | With --llm, skip the cost confirmation. |

```bash
repowise report                                   # open the HTML report
repowise report --format json && repowise mark fl_3a91c0d2e4f1 done --json
repowise report --since-last
```

- The report reads the current index against the first look stored in
  `.repowise/reports/first-look.json`: each item with its status, the items
  new since and the items resolved since.
- Sections, in order: Security, Performance, Code health, Tests and
  coverage, Dead code, Docs, Decisions, Repo hygiene, Ownership. Each shows
  12 items, then a count of the rest. Security always shows, and says "No
  live secrets in tracked files" when that holds.
- A secret shows its kind and place, never its value. Owners are counted,
  never named.
- With a provider and prose on, `init` lets one model call write the
  wording, and shows its cost in the plan first. Keyless and `--no-prose`
  runs never call a model. Model text is checked against the facts: links,
  paths and prompts always come from the items.
- JSON items carry `id`, `section`, `rule`, `status` (`open`, `done`,
  `acknowledged`, `false_positive`, `snoozed`), `status_reason`,
  `status_until`, `change` (`new`, `changed`, `resolved` or null),
  `locations`, `effort` and `confidence`.
- Settings: [`report:` block](https://docs.repowise.dev/installation/config-reference#the-report-block).

In the dashboard, the Overview's Repo report card opens the same report
live at `/repos/<id>/report`: a Mark menu on each item, one "Fix with agent"
prompt per section, and a top bar that hands the whole report to an agent or
shares it as a link, Markdown, PDF or JSON.

## `repowise mark`

Record an answer to one repo report item.

```bash
repowise mark ID done|ack|false-positive|snooze [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `ID` | string |  | Required. The item's fl_ id from repowise report --format json. |
| `--reason` | string |  | Why. Required for ack and false-positive. |
| `--days` | number | `14` | With snooze: how many days, 1 to 365. |
| `--path` | string |  | Repo path (defaults to cwd). |
| `--json` | boolean | `false` | Print {id, store, status, reason, until}; an error goes to stderr as JSON. |

```bash
repowise mark fl_3a91c0d2e4f1 done
repowise mark fl_7be0c1d2a3f4 ack --reason "kept for the plugin API"
```

The answer goes to every row the item stands for, in the stores the
dashboard and `repowise next` read: next actions, dead code, health findings
and refactoring. A security finding is never marked a false positive here:
put a `repowise-security-ignore` comment on its line, or accept it in a
baseline with `repowise security check --write-baseline FILE`. Errors exit 1
with a code: `unknown_item`, `reason_required`, `security_use_ignore`,
`bad_status`, `no_index`.

## `repowise overlap`

Which other branches edit the files this change edits. Git alone answers
it, so it works in a fresh clone with no index; an index orders the shared
files and adds co-change partners. Each row says its basis in words
(`same file` or `co-change pair, N of M commits`). There is no score.

```bash
repowise overlap                           # who else is editing what you are editing
repowise overlap --base main --limit 100   # a wider scan
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--base` | string |  | Base ref. Default: the repository's trunk. |
| `--branch` | string | `HEAD` | The change to compare. |
| `--limit` | number | `50` | How many branches to diff, newest committer date first. |
| `--path` | string |  | Repo path (defaults to cwd). |
| `--format` | string | `table` | table or json |

## `repowise dead-code`

Detect unused code via the dependency graph. No LLM calls. With an index at
HEAD it reads the findings the last `init` or `update` stored, in the same
order as MCP and the web UI; with no index, an index behind HEAD, or a lower
confidence floor than the stored run used, it analyzes the working tree live.
Confidence starts from git age (see
[the ladder](https://docs.repowise.dev/intelligence/dead-code#the-git-age-confidence-ladder)), and Apex
findings are review-only.

```bash
repowise dead-code [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--min-confidence` | number | `0.4` | Minimum confidence threshold. |
| `--safe-only` | boolean | `false` | Only show deletion-ready findings (high confidence, no runtime-load risk). |
| `--kind` | string |  | unreachable_file, unused_export, unused_internal, zombie_package |
| `--format` | string | `table` | Output format: table, json, md |
| `--include-internals` | boolean | `false` | Detect unused private/internal symbols. |
| `--include-zombie-packages` | boolean | `true` | Detect monorepo packages with no importers. |
| `--no-unreachable` | boolean | `false` | Skip detection of unreachable files. |
| `--no-unused-exports` | boolean | `false` | Skip detection of unused exports. |
| `--repo` | string |  | Workspace repo alias to analyze (implies workspace mode). |
| `--no-workspace` | boolean | `false` | Force single-repo mode even when invoked from a workspace. |
| `--verbose / -v` | boolean | `false` | Show debug logs from the live analysis (table format only). |

In workspace mode a finding whose file another workspace repo may use is
never cleanup-ready.

```bash
repowise dead-code
repowise dead-code --safe-only
repowise dead-code --kind unused_export --format json
repowise dead-code --include-internals --min-confidence 0.8
```

The agent-facing equivalent is [`get_dead_code`](https://docs.repowise.dev/mcp/get-dead-code).

## `repowise security scan`

Scan for security signals (secrets, risky patterns) and persist findings to
the local store.

```bash
repowise security scan [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--history` | boolean | `false` | Scan the full git history, not just the current working tree. |
| `--since` | string |  | Lower git revision bound (exclusive). Defaults to all history. |
| `--to` | string |  | Upper git revision bound (inclusive). Defaults to all history/HEAD. |
| `--path` | string |  | Repo path (defaults to cwd / workspace primary). |
| `--all-patterns` | boolean | `false` | History mode: also report code-smell patterns (eval, os.system, weak hashes, ...). By default history mode reports only leaked-secret patterns. |
| `--format` | string | `table` | Output format. json is the machine-readable summary. |

```bash
repowise security scan --history                       # walk the whole history
repowise security scan --history --since v1.0 --to HEAD
repowise security scan --history --all-patterns --format json
```

To gate a pull request on the findings it adds, use
[`repowise security check`](https://docs.repowise.dev/cli/gates#repowise-security-check).

## Next

- [Findings](https://docs.repowise.dev/intelligence/findings) explains what each finding means and how statuses work.
- [Evidence reports](https://docs.repowise.dev/cli/changes#repowise-report) covers the assessment, changes, inventory and estate reports.
- [`get_overview`](https://docs.repowise.dev/mcp/get-overview) gives your agent the same next actions.
