Skip to main content
skill CX Codex

wish-ssh-code-review — Claude Code skill: review and install

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

Apache-2.0 119 installs ★ 89 updated 2026-09-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add existential-birds/beagle --skill wish-ssh-code-review -a claude-code
Open on GitHub

What wish-ssh-code-review 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.

What it helps with

  • 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 for the agent

  • 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

How to install wish-ssh-code-review

1Skills CLI (Vercel)

npx skills add existential-birds/beagle --skill wish-ssh-code-review -a claude-code

2Manually: put the files in place

~/.claude/skills/wish-ssh-code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/wish-ssh-code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about wish-ssh-code-review

How to install wish-ssh-code-review in Claude Code?

Run npx skills add existential-birds/beagle --skill wish-ssh-code-review -a claude-code or place the specification directly at ~/.claude/skills/wish-ssh-code-review/SKILL.md.

What does wish-ssh-code-review do?

It guides code review for Go applications built with charmbracelet/wish, spotting flaws in authentication middleware order, host key setup, connection limits, and TUI session renderers.

What syntax does the review output follow?

Findings use the structured format [FILE:LINE] ISSUE_TITLE and reference specific server or session guidelines from the skill.

Source text

SKILL.md · Apache-2.0
---
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(
        logging.Middleware(),       // first: log all connections
        activeterm.Middleware(),    // handle terminal sizing
        bubbletea.Middleware(teaHandler),
    ),
)
if err != nil {
    return fmt.Errorf("creating server: %w", err)
}
```

### Graceful Shutdown

```go
// BAD - abrupt shutdown
log.Fatal(s.ListenAndServe())

// GOOD - graceful shutdown
done := make(chan os.Signal, 1)
signal.Notify(done, os.Interrupt, syscall.SIGTERM)

go func() {
    if err := s.ListenAndServe(); err != nil && !errors.Is(err, ssh.ErrServerClosed) {
        log.Error("server error", "error", err)
    }
}()

<-done
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := s.Shutdown(ctx); err != nil {
    log.Error("shutdown error", "error", err)
}
```

### BubbleTea Handler

```go
func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) {
    pty, _, _ := s.Pty()

    model := NewModel(pty.Window.Width, pty.Window.Height)

    return model, []tea.ProgramOption{
        tea.WithAltScreen(),
        tea.WithMouseCellMotion(),
    }
}
```

## When to Load References

- Reviewing server initialization → server.md
- Reviewing authentication, session state → sessions.md

## Review Questions

1. Are host keys handled securely?
2. Is middleware order correct?
3. Is graceful shutdown implemented?
4. Are PTY window sizes passed to the TUI?
5. Are connection timeouts configured?

© existential-birds · Apache-2.0 · existential-birds/beagle

Similar skills

All skills for Code review and refactoring →

From the same set68

The whole set →
reference-docs reference-docs is a Claude Code skill for writing API and symbol reference pages, with parameter tables, return values, errors, and runnable examples. CX Codex +1 121installs widgetkit-code-review widgetkit-code-review is a Claude Code skill that checks WidgetKit widget code against a checklist for timelines, view composition, configurable intents, and memory, before release or after an iOS 17 migration. CX Codex +1 121installs pydantic-ai-model-integration pydantic-ai-model-integration guides LLM provider configuration, fallback model chains, streaming, and token limits in PydanticAI. CX Codex +1 120installs review-ai-writing review-ai-writing scans documentation, docstrings, commit messages, and pull request descriptions for machine-generated writing patterns. Useful for keeping project artifacts clear and natural. CX Codex +1 119installs urlsession-code-review urlsession-code-review reviews the networking layer of iOS and macOS apps: status codes, caching, timeouts, background sessions. Findings come with file:line. CX Codex +1 116installs elixir-security-review elixir-security-review audits Elixir code for security issues like code injection, atom table exhaustion, and exposed secrets before merging. CX Codex +1 110installs elixir-performance-review elixir-performance-review is a Claude Code skill that checks Elixir code for GenServer, memory and concurrency bottlenecks when a service slows under load, with findings backed by measurement. CX Codex +1 107installs elixir-writing-docs elixir-writing-docs guides writing Elixir documentation using @moduledoc, @doc, @typedoc, doctests, and ExDoc metadata in .ex source files. CX Codex +1 106installs

Project sponsors

Companies that keep this analytics open