Skip to content
Back to skills

downstream

ASecurity

Open a shared, live review surface for a code change or an area of code, walk the user through it, discuss it with them there, and (for pull requests) send the review you arrive at together. Use when the user asks to review a PR, branch or diff ("help me review this", "review PR 42", "walk me through this change"), or to explain how existing code works ("teach me how auth works", "give me a tour of src/sync"). TypeScript, JavaScript and Python are analyzed; other languages are mapped by hand.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 18, 2026
developmentjavascripttypescriptpythongojavashellbashsqlnodefastapi

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned October 18, 2026

npx -y skills add armanckeser/downstream --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of downstream?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for downstream
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/armanckeser-downstream/badge)](https://www.skillsdirectory.com/skills/armanckeser-downstream)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: downstream
description: Open a shared, live review surface for a code change or an area of code, walk the user through it, discuss it with them there, and (for pull requests) send the review you arrive at together. Use when the user asks to review a PR, branch or diff ("help me review this", "review PR 42", "walk me through this change"), or to explain how existing code works ("teach me how auth works", "give me a tour of src/sync"). TypeScript, JavaScript and Python are analyzed; other languages are mapped by hand.
---

# Downstream

Downstream turns a change into something a person can read the way the code runs: start at an entry point ("a door"), follow each call downstream, and see why each piece is the way it is. You (the agent) map the change, write the walkthrough, and review it; the user reads it in a browser and talks to you in the margin; together you arrive at a review, and when the user says so, it goes to the pull request. You both read and write the same review through the same actions, and you hear the user through `downstream wait`.

Run the CLI as `node "${CLAUDE_SKILL_DIR}/bin/downstream.mjs" <command>`. Below it is written `downstream <command>`. Run review commands from inside the repository being reviewed; `home`, `url` and `stop` work from anywhere. The first run installs dependencies and builds the UI (about a minute).

## The loop

1. **Open** the review.
   ```bash
   downstream open --pr 42              # someone's pull request (uses gh; no checkout needed)
   downstream open                      # working tree (incl. uncommitted) vs main
   downstream open --base main --head feature-x
   downstream open --teach src/sync     # explain existing code instead of a diff
   ```
   It prints the URL and opens the browser. Tell the user the URL in one line, then keep working; the UI fills in live as you write. When Downstream started you (see *Running inside Downstream*), the user is already watching and the browser moves to the review by itself.

2. **Understand** before you judge. `downstream show` prints the map: doors, every symbol with its status, flow edges (`*` = new in this change, `x` = removed), tests, threads. `downstream code <symbol>` prints a symbol's code with real line numbers and `+`/`-` marks, plus who calls it and what it calls. Then read past the map: the PR description, the callers of every changed function, the tests, where data comes in, what is stored, what goes out. A change can break code it doesn't touch: when a signature, return value or behavior changes, check every caller. Find the expected load (README, deploy config) and judge scale against it.

3. **Write** the walkthrough and your review in one batch: a JSON file and `downstream apply plan.json` (shape below). You can apply again; steps are replaced as a whole, notes are added, `updates` edit existing threads.

4. **Converse.** Run `downstream wait`. It blocks until the user replies, asks, edits, settles, posts or ends the session, then prints what happened with the exact command to answer (and their selected code, when they asked about a selection). While it blocks, the UI shows you as *listening*. Answer, then `wait` again.

5. **Arrive at the review.** When the conversation settles, draft what the author will read (see *Sending the review*). The user checks it in **Send review** and sends it, or tells you to.

## What to look for

Review like the senior developer who gets paged when it breaks. In order: correct, safe, holds under the expected load, tested, fast, lean.

- **bug**: wrong result, crash, missed edge case (empty, zero, last item, rounding, time zones), a caller broken by the change, a fix in one caller while the shared function stays broken.
- **risk**: security (injection, secrets, unchecked user input), data loss (swallowed errors, writes in the wrong order, no transaction), migrations that change what existing rows mean.
- **scale**: fine for one user, wrong for many: check-then-write races, a query per item, unbounded growth, per-process state that must be shared.
- **test**: risky new logic (a branch, a parser, money, security, data writes, a bug fix) with no test that fails when it breaks. One good test, not coverage.
- **speed**: big slowdowns are findings; small wins are nice-to-haves.
- **lean**: code that shouldn't exist (dead, speculative, an abstraction with one implementation), a helper the repo already has (name the path), a dependency for a few lines, near-copies that must change together.

Every finding needs a concrete case: *this input or situation leads to this wrong result*. No case, no finding. Re-read the lines before you report: confirm the caller exists, the value can really be empty, the code really is unused. Propose the smallest fix that works; prefer fixes that delete code. No style taste, no "consider", no vague worries. Three real findings beat ten weak ones.

## What a good walkthrough contains

Write for a reader who has not seen the code: short sentences, everyday words, explain a term the first time. Name things; never say "it" when you can say `openFirst`. Wrap symbol names in backticks: in the UI they become links that show the code on hover and open it on click.

- **summary** (3 to 8 sentences or a short list): what this change does, in behavior, then where the risk is. Not a file list.
- **symbols**: a one-line purpose (`summary`) for every changed symbol and any unchanged one that matters to the flow ("what is this for?"). Fix `entry` flags: a door is where control enters the change (a route, a job, a CLI command, an exported function called from unchanged code, a component a page renders). Unmark what the analyzer guessed wrong.
- **steps** (usually 3 to 8): the order to read the change, door first, then downstream along real calls. Each step anchors to a symbol (`symbolId`) and usually `lines`; its `body` says what happens at this point in the flow and why it's built this way. Point at the line that matters; don't repeat the code.
- **notes**, each anchored to a symbol and, when about specific lines, `lines` (new-side numbers; `side: "old"` for removed code). Every note gets a number (`#1`, `#2`, …) the user can refer to; commands accept `3` or `#3` wherever they take a thread.
  - `finding`: `severity` is `blocker` (shown as **must fix**: bug, security, data loss, breaks at the expected load), `concern` (**should fix**: risky code without a test, real slowness, duplication, code that shouldn't exist) or `nit` (**nice to have**). Set `category` (bug, risk, scale, test, speed, lean). `title` names the problem; `body` is the problem with its concrete case; `fix` is the smallest fix; `impact` says what happens if we ship it anyway; `suggestion` (`{lines, code}`) when the fix is concrete. A suggestion whose lines match the note's lines becomes a GitHub suggestion the author can apply in one click.
  - `decision`: an abstraction or interface choice, with the `alternatives` that lost and their tradeoffs. For every new type, function boundary, dependency or data shape ask: why this shape and not the obvious other one? Is this the right layer? Anchor it to the shape's symbol; the overview shows each shape with its decision.
  - `why`: the reason behind anything that would make a careful reader stop.
  - `question`: you need the author's (or user's) intent to judge something.
- **edges**: relationships the analyzer can't see (events, queues, HTTP between services, dynamic dispatch, DI wiring), with a `label`. `removeEdges` for noise.
- **addSymbols**: for other languages (they arrive as one `module` symbol per file) add the real functions with `file`, `name`, `lines`, `status`, then connect them with `edges`. In TS/JS/Python you can pass just `line` and the declaration around it is found.

Set `"status": "ready"` when the walkthrough is complete.

### plan.json

```json
{
  "summary": "Price tracking stops being something you switch on…\n\nThe risk is in the migration: …",
  "status": "ready",
  "symbols": [
    { "id": "backend/app/features/price_tracking/service.py#apply_price_observation", "summary": "Records a fetched price; now also turns tracking on." },
    { "id": "backend/app/features/wishlist_item/models.py#WishlistItem", "entry": false }
  ],
  "steps": [
    { "title": "Tracking turns on when a check succeeds", "symbolId": "backend/app/features/price_tracking/service.py#apply_price_observation",
      "lines": { "start": 267, "end": 271 }, "body": "A price we could read proves the page is trackable, so…" }
  ],
  "notes": [
    { "kind": "finding", "severity": "blocker", "category": "risk", "symbolId": "backend/app/alembic/versions/f1a2_add_flag.py#upgrade",
      "lines": { "start": 19, "end": 27 }, "title": "Everyone who turned tracking off is opted back in",
      "body": "The new column defaults to false for every existing row, so an item whose owner switched tracking off…",
      "fix": "Backfill in upgrade(): items that had a verified price and are off without a pause were turned off by their owner.",
      "impact": "Owners who opted out start getting price notifications again the day this deploys.",
      "suggestion": { "lines": { "start": 19, "end": 27 }, "code": "    op.add_column(…)\n    op.execute(\"UPDATE …\")" } },
    { "kind": "decision", "symbolId": "backend/app/background/price_check.py#check_tracked_prices", "title": "Group by store instead of a global rate limiter",
      "body": "…", "alternatives": [ { "option": "One global queue with a smaller delay", "tradeoff": "Every site sees faster requests." } ] },
    { "kind": "question", "symbolId": "backend/app/background/price_check.py#check_tracked_prices", "title": "Is one scheduler process the expected deployment?", "body": "…" }
  ],
  "updates": [ { "noteId": "2", "outgoing": { "include": true, "body": "…" } } ],
  "outgoingBody": "…",
  "edges": [ { "from": "src/server/jobs.ts#enqueue", "to": "src/worker/run.ts#handle", "kind": "calls", "label": "via the jobs queue" } ]
}
```

Two full examples from real reviews live in `examples/` (`kumbara-equity-grants.json` for TypeScript, `wishlist-auto-tracking.json` for Python).

## Talking in the margin

| The user… | You run |
|---|---|
| asks a question (`wait` shows `The user asked [n_x]…` with their selected code) | `downstream reply n_x "…"` |
| replies in a thread | `downstream reply 3 "…"`, or `downstream resolve 3 "why"` when it's settled (settling doesn't change whether it's in the review) |
| pushes back on a finding or decision | answer honestly. If they're right, say so and `resolve` or `dismiss` it with the reason; if the finding changes, `downstream do note.update '{"noteId":"3","body":"…"}'` |
| says "this", "here" | `downstream screen` shows their view, open frames and selected lines |
| says "fix 2 and 5" (their own code) | edit the code, `downstream reanalyze`, then `downstream resolve 2 "Fixed: …"` |
| edits a thread's outgoing wording, or a drafted comment for another PR | `wait` reports it; leave their wording alone unless asked |
| wants to tell another PR something (a follow-up for the PR that caused a bug) | `downstream post <pr> "…" --thread 3`; never paste it into a reply and wait for "post it" |
| gives a verdict, sends, or ends the session | acknowledge in chat |

- `downstream go <symbol> [--lines a-b]`, `go step 3`, `go thread 3`, `go map` moves the user's view. Use it when your answer is "look at this".
- `downstream note <kind> <symbol> --title "…" [--body] [--severity] [--category] [--fix] [--impact] [--lines a-b]` adds one thread without a full apply.
- `downstream ask "…" --symbol s` asks the user something.
- `downstream sql "select * from v_notes where status = 'open'"` reads anything (read-only connection; views `v_symbols`, `v_edges`, `v_notes`, `v_replies`).
- `downstream actions` lists every action with its input schema; `downstream do <action> '<json>'` calls one. The browser uses the same actions, so anything the user can do, you can do.

Replies are markdown, shown in your voice in the margin. Keep them short: the claim, the evidence (a line, a caller), what you'd do.

## Sending the review

Threads are between you and the user and never leave. What other people read is shown in blue in the margin: an **outbox** at the top (this PR's review, plus any comments drafted for other PRs) and, on each thread, a card with the exact comment the author will get, or "Private".

- **Which threads go out.** Open findings are in the review by default; everything else is private. The user flips a thread with **Add to review** / **Make private** on its card; that's `outgoing.include`, never override it. Settling a thread (`resolve`) keeps whatever it was; `dismiss` on a finding nobody chose to send takes it out. You change it only when asked: `downstream outgoing 3 "…"` (in the review, in these words) or `downstream outgoing 4 --exclude`. A thread with no line (on the whole change) goes into the review body.
- **Never ask "send it or keep it private?" in a reply.** The card already shows the answer and the button to change it; ask only when the conversation leaves it genuinely unclear.
- **The words.** Without outgoing wording, a finding goes out as written (severity, title, problem, fix, suggestion, impact). Reword when the conversation changed the finding, or when it should read as a question to the author. Write to the author, not to the user: no references to your conversation, and no `#3` thread numbers (on GitHub those link to issues and pull requests); name the problem instead.
- **The body.** `outgoingBody` (via `apply` or `downstream do review.update '{"outgoingBody":"…"}'`): what the change does in a sentence or two, what must change before merging, and anything you could not check. Plain and kind.
- **The verdict.** `downstream verdict changes|approve|comment "…"`. GitHub doesn't allow approving or requesting changes on your own pull request; use comment there.
- **Comments for other PRs.** When the conversation produces something for a different PR or issue (the PR that introduced a bug, a follow-up request), draft it with `downstream post <number> "…" [--repo owner/name] [--thread 3]`. It shows in the outbox with its own **Post** button; it is not part of this review. Write it to that PR's people, without references to this conversation.
- `downstream draft` prints exactly what would be sent: the event, the body, each inline comment, and the comments that fall outside the diff (GitHub only takes inline comments on changed lines and their context, so those go into the body).

Sending and posting are public and permanent. **Never run `downstream send`, or `downstream do post.send`, on your own initiative.** The user sends from the Send review panel, or tells you to in chat ("send it"); then run `downstream draft`, show them the verdict and the number of comments in one line, and send only after they confirm. Only pull request reviews (`open --pr`) can be sent; for anything else the panel copies the review as markdown. If the PR changed since you opened it, `send` refuses: tell the user, and offer to re-open it (`open --pr <n>`) or, only if they say so, `send --force`.

## Languages

- **TypeScript / JavaScript**: the compiler resolves calls, renders, type uses and callers; hover shows real types and docs. Inner functions of large containers (Effect service layers, app builders) are lifted into their own symbols, and a service's `return { createGrant }` is followed back to the function.
- **Python**: declarations come from indentation (decorators and docstrings included); FastAPI/Flask/Celery-style decorators mark routes and jobs as doors. Calls are resolved through each file's imports, `self.`/`cls.`, fresh instances (`Service().create()`), and unique method names; callers are found across the repo; hover shows the signature and docstring. There is no type checker: when a call goes through an injected object the analyzer can't see, add the edge yourself.
- **Tests** are marked as tests: never doors, shown on a frame as *tested by*, hidden on the map unless toggled.

## Teaching mode

`downstream open --teach <paths…>` maps existing code instead of a diff: every declaration is a symbol, edges are the calls between them, doors are exported functions and routes nothing else in the set calls. The job is the same minus findings unless asked: what this part of the system is for, purposes for the important symbols, a walkthrough that follows one real request or operation end to end, and `why`/`decision` notes on the shapes a newcomer would question. Large maps open scoped to your walkthrough.

## Running inside Downstream

The user can start you from Downstream's home page (`downstream home`) by pressing a pull request. Then `DOWNSTREAM_HOSTED=1` is set and:

- The user reads your output and answers your permission requests in the browser, not a terminal. Talk to them in the margin, and keep `downstream wait` running between turns; a message they write while you're idle also wakes you.
- Reading never asks: file tools, searches, and read-only shell (`git log/show/diff`, `gh pr view`, `rg`, loops over those) run straight away. Anything that writes asks, and so does an expanded argument (`$f`, `$(…)`) to `git`, `gh` or the CLI, so prefer literal arguments. `downstream send` always asks.
- For work other than a review (failing checks, feedback to address, conflicts), make changes in a git worktree and say what you'll change before you change it.
- The user can move the session to their terminal (`claude --resume`); nothing changes for you.
- For a review, Downstream usually opens the pull request before starting you, so the user sees its files and map at once. Your first message says so; then skip `open` and start at `downstream show`.

## Housekeeping

- One server per machine (`~/.downstream/`, or `$DOWNSTREAM_HOME`); each repository's reviews live in `<repo>/.downstream/` (SQLite), added to `.git/info/exclude`. `downstream status`, `downstream url`, `downstream stop`, `downstream home`. An updated skill restarts the server and rebuilds the UI on the next `open`.
- `downstream reanalyze` re-reads the code after edits and keeps summaries, threads and the walkthrough.
- Reopening (`downstream open`) starts a fresh review and makes it current; old ones stay in the database.
- If `open` fails, `~/.downstream/server.log` has the server's output.

Files in this skill

  • CLAUDE.md863 B
  • CONTRIBUTING.md6.3 KB
  • SKILL.md18 KB
  • bin/downstream.mjs1.2 KB
  • cli/downstream.ts26 KB
  • domain/agent.ts1.2 KB
  • domain/approval.test.ts6 KB
  • domain/approval.ts9.7 KB
  • domain/delivery.test.ts3 KB
  • domain/delivery.ts1.3 KB
  • domain/home.test.ts1.1 KB
  • domain/home.ts1.1 KB
  • domain/inbox.test.ts16.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.