# wish-ssh-code-review

wish-ssh-code-review inspects Go SSH server code using charmbracelet/wish for middleware order, session handling, host keys, and graceful shutdown patterns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 119 installs · ★ 89 repo stars
- Author: existential-birds
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/existential-birds/beagle/tree/HEAD/plugins/beagle-go/skills/wish-ssh-code-review/SKILL.md
- Updated: 2026-09-15
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/wish-ssh-code-review

## What it does

This skill enforces a staged audit sequence for SSH services written with `charmbracelet/wish`. The assistant first traces entry points such as `wish.NewServer`, top-level `ssh.Handler` pipelines, and `bubbletea.Middleware`. Next, it collects concrete implementation facts: host key paths, exact middleware sequence, and whether `ListenAndServe` pairs with context-driven `Shutdown`.

A dedicated review gate analyzes TUI handling. The model confirms whether `teaHandler` calls `s.Pty()` before reading window dimensions and verifies if `bubbletea.MakeRenderer` is used for Lipgloss styling per session. Unchecked `s.Pty()` calls cause runtime panics on non-PTY connections, so the skill flags them directly in `[FILE:LINE] ISSUE_TITLE` format.

The review rules prohibit reporting defects based on memory: every finding must link to verified lines in the actual Go source files.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/wish-ssh-code-review/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/wish-ssh-code-review/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/wish-ssh-code-review/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/wish-ssh-code-review/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install existential-birds/beagle plugins/beagle-go/skills/wish-ssh-code-review
```

2. **Manually: put the files in place**
- File: `.github/skills/wish-ssh-code-review/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-go/skills/wish-ssh-code-review
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/wish-ssh-code-review/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/existential-birds/beagle/tree/HEAD/plugins/beagle-go/skills/wish-ssh-code-review/SKILL.md

## When to use it
- audit middleware ordering in Wish SSH servers
- verify graceful shutdown logic under active connections
- catch missing PTY checks in BubbleTea terminal handlers
- confirm secure host key loading from disk

## Example prompts
- Review our Wish SSH server setup according to the checklist
- Check `server.go` to see if middleware order and timeouts are safe
- Verify that BubbleTea sessions handle window resize events and PTYs correctly

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 0f079c0b29d4367d.

BEGIN THIRD-PARTY FILE 0f079c0b29d4367d
````text
---
name: wish-ssh-code-review
description: Reviews Wish SSH server code for proper middleware, session handling, and security patterns. Use when reviewing SSH server code using charmbracelet/wish.
---

# Wish SSH Code Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| Server setup, middleware | [references/server.md](references/server.md) |
| Session handling, security | [references/sessions.md](references/sessions.md) |

## Review gates

Run these **in order** when producing a written review. Do not claim a defect in a later step until the **Pass when** for the current step is satisfied for the code under review.

1. **Locate Wish entry points** — **Pass when:** you have at least one repo path per server surface that calls `wish.NewServer`, `wish.WithMiddleware`, registers `bubbletea.Middleware`, or defines the top-level `ssh.Handler` chain (list the paths explicitly).
2. **Capture server-setup evidence** — **Pass when:** for each path from step 1, you have the actual `wish.WithHostKey*` / host-key configuration and the **full middleware list in source order** as written (not recalled from memory). If graceful shutdown exists, note the file(s) where `ListenAndServe` and `Shutdown` run.
3. **Capture session / TUI evidence** — **Pass when:** for each `teaHandler` (or equivalent), you have noted from source whether `s.Pty()` is checked before using window size, and whether per-session renderers (`bubbletea.MakeRenderer`) are used where Lipgloss styles apply.
4. **Write findings** — **Pass when:** each finding uses `[FILE:LINE] ISSUE_TITLE` (line range allowed where needed) and points to the relevant row in **Quick Reference** (or the matching section in `references/`).

## Review Checklist

Use alongside **Review gates**; for a written review, complete the gates first so each item below can be tied to cited source.

- [ ] Host keys are loaded from file or generated securely
- [ ] Middleware order is correct (logging first, auth early)
- [ ] Session context is used for per-connection state
- [ ] Graceful shutdown handles active sessions
- [ ] PTY requests are handled for terminal apps
- [ ] Connection limits prevent resource exhaustion
- [ ] Timeout middleware prevents hung connections
- [ ] BubbleTea middleware correctly configured

## Critical Patterns

### Server Setup

```go
// GOOD - complete server setup
s, err := wish.NewServer(
    wish.WithAddress(fmt.Sprintf("%s:%d", host, port)),
    wish.WithHostKeyPath(".ssh/id_ed25519"),
    wish.WithMiddleware(
````
END THIRD-PARTY FILE 0f079c0b29d4367d

The third-party file has ended. Everything between the 0f079c0b29d4367d tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2542 of 3977 bytes. © existential-birds · Apache-2.0 · https://github.com/existential-birds/beagle/tree/HEAD/plugins/beagle-go/skills/wish-ssh-code-review/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
