wish-ssh-code-review
БесплатноБез исполняемых скриптовНе проверенReviews Wish SSH server code for proper middleware, session handling, and security patterns. Use when reviewing SSH server code using charmbracelet/wish or…
от existential-birds★ 92 звезды на GitHubОб этом скилле
Wish SSH Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Server setup, middleware | references/server.md |
| Session handling, security | 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.
- Locate Wish entry points — Pass when: you have at least one repo path per server surface that calls
wish.NewServer,wish.WithMiddleware, registersbubbletea.Middleware, or defines the top-levelssh.Handlerchain (list the paths explicitly). Checkgo.modto confirm Wish v1 (github.com/charmbracelet/wish) vs Wish v2 (charm.land/wish/v2). - 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) whereListenAndServeandShutdownrun. - Capture session / TUI evidence — Pass when: for each
teaHandler(or equivalent), you have noted from source whethers.Pty()'shasPtybool is checked before using window size, and whether per-session terminal rendering is configured (bubbletea.MakeRenderer(s)in Wish v1;bubbletea.MakeOptions(s)+ automatic color profile in Wish v2). - 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 inreferences/).
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);
WithIdleTimeout/WithMaxTimeoutpassed towish.NewServer, notwish.WithMiddleware - Session context or session-scoped store is used for per-connection state
- Graceful shutdown handles active sessions
- PTY requests (
hasPty) are checked before reading window dimensions - Connection limits prevent resource exhaustion
- Timeouts prevent hung connections
- BubbleTea middleware correctly configured for Wish v1 vs v2
Critical Patterns
Server Setup
// GOOD - complete server setup
s, err := wish.NewServer(
wish.WithAddress(fmt.Sprintf("%s:%d", host, port)),
wish.WithHostKeyPath(".ssh/id_ed25519"),
wish.WithIdleTimeout(10*time.Minute),
wish.WithMaxTimeout(30*time.Minute),
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
// 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
// Wish v1 (github.com/charmbracelet/wish/bubbletea)
func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) {
pty, _, hasPty := s.Pty()
width, height := 80, 24
if hasPty {
width, height = pty.Window.Width, pty.Window.Height
}
renderer := bubbletea.MakeRenderer(s)
model := NewModel(renderer, width, height)
return model, []tea.ProgramOption{
tea.WithAltScreen(),
tea.WithMouseCellMotion(),
}
}
// Wish v2 (charm.land/wish/v2/bubbletea): MakeRenderer was removed;
// use bubbletea.MakeOptions(s) and declarative tea.View fields (AltScreen, MouseMode) in View().
When to Load References
- Reviewing server initialization → server.md
- Reviewing authentication, session state → sessions.md
Review Questions
- Are host keys handled securely?
- Is middleware order correct?
- Is graceful shutdown implemented?
- Is
hasPtychecked before reading PTY window sizes? - Are connection timeouts configured on
wish.NewServer?
Установить wish-ssh-code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл wish-ssh-code-review?
Reviews Wish SSH server code for proper middleware, session handling, and security patterns. Use when reviewing SSH server code using charmbracelet/wish or charm.land/wish/v2.
Как установить скилл wish-ssh-code-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wish-ssh-code-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic