api-reviewer
БесплатноБез исполняемых скриптовНе проверенGuidelines for reviewing API design in the Hex1b codebase. Use when evaluating public APIs, reviewing accessibility modifiers, or assessing whether new APIs…
от mitchdenny★ 186 звёзд на GitHubОб этом скилле
API Reviewer Skill
This skill captures API design preferences for the Hex1b codebase. Use it when reviewing public APIs, evaluating whether code should be public or internal, or assessing API design decisions made by AI agents.
Codebase Architecture
Hex1b is structured into distinct layers, each with different API design considerations:
Layer 1: Hex1bTerminal (Core)
The foundational layer maintaining an in-memory representation of terminal state.
| Component | Purpose | Accessibility |
|---|---|---|
Hex1bTerminal |
Core terminal state management | Public |
Hex1bTerminalBuilder |
Fluent terminal construction | Public |
| Presentation adapters | Output to real terminals, tests, web | Public interfaces |
| Workload adapters | Input/output abstraction | Public interfaces |
Surface, SurfaceCell |
Low-level cell storage | Public (low-level API) |
Design note: Hex1bTerminal emerged from the need to properly test TUI components. The adapter pattern enables use in real terminals, unit tests, or projecting state across networks.
Layer 2: Hex1bApp/TUI
The widget/node tree layer, inspired by React/Ink but not beholden to it.
| Component | Purpose | Accessibility |
|---|---|---|
Hex1bApp |
Root of TUI applications | Public |
*Widget records |
Declarative UI configuration | Public |
*Node classes |
DOM-like render elements | Generally public (for extensibility) |
| Reconciliation logic | Widget→Node synchronization | Internal |
| Layout algorithms | Measure/arrange implementation | Internal |
Layer 3: Automation
Testing and automation infrastructure.
| Component | Purpose | Accessibility |
|---|---|---|
Hex1bTerminalInputSequenceBuilder |
Fluent input automation | Public |
CellPatternSearcher |
Visual assertion matching | Public |
Hex1bTerminalSnapshot |
Captured terminal state | Public |
Design note: Automation APIs are explicitly for external consumers, not just internal testing.
Public vs Internal Decision Framework
When reviewing accessibility modifiers, apply this framework:
Make it PUBLIC when:
- External consumers need it - Adapters, extension points, widget customization
- It's part of the conceptual API - Users think in terms of this abstraction
- It enables extensibility - Custom widgets, themes, adapters
- It's stable - You're confident the design won't need breaking changes
Make it INTERNAL when:
- It's implementation detail - Only Hex1b itself (or agents working on it) would invoke it
- The abstraction isn't proven - Uncertain if this is the right level of abstraction
- It could change - Design may evolve with more usage
- It exposes internals - Would leak implementation details to consumers
Make it PRIVATE when:
- Single class usage - Only used within one type
- Helper methods - Implementation helpers with no external meaning
Review Questions
When reviewing agent-generated code, ask:
- Is this API an internal implementation detail?
- Does this method/property make sense on this type?
- Is the abstraction level right?
- Would making this public lock us into a design we're not confident about?
- Can this be internal for now until we're confident in the design?
API Design Patterns
Builders: Classic With...() Pattern
For Hex1bTerminalBuilder and similar construction scenarios:
// ✅ PREFERRED: Classic builder pattern
var terminal = Hex1bTerminal.CreateBuilder()
.WithWorkload(workload)
.WithPresentation(presentation)
.WithDimensions(80, 24)
.WithHeadless()
.Build();
Widgets: SwiftUI-Inspired Minimal Constructors
For widget APIs, use minimal constructors with essential arguments only, then fluent extension methods:
// ✅ PREFERRED: Minimal constructor + fluent methods
ctx.Table(columns, rows)
.SelectedRow(selectedIndex)
.OnSelectionChanged(HandleSelection)
// ✅ PREFERRED: Cross-cutting concerns as extension methods
ctx.Progress(value, max).Fill()
// ❌ AVOID: Overloaded constructors with many parameters
new TableWidget(columns, rows, selectedIndex, onSelectionChanged, sortColumn, sortDirection, ...)
Guideline: Only include the most essential arguments in the constructor. Make usage "bleeding obvious." Use extension methods to splice in extra behavior.
Stateful Widgets: Lift-State-Up via IStatefulWidget<TSelf, TState>
When a widget owns non-trivial mutable user-facing state (a textbox's buffer + cursor, an editor's document, a navigator's selection, a checkbox's checked value), expose that state to callers so composites can drive the widget from outside.
The framework-wide contract is IStatefulWidget<TSelf, TState>:
public sealed record TextBoxWidget(...)
: Hex1bWidget, IStatefulWidget<TextBoxWidget, TextBoxState>
{
internal TextBoxState? Inj
Установить api-reviewer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл api-reviewer?
Guidelines for reviewing API design in the Hex1b codebase. Use when evaluating public APIs, reviewing accessibility modifiers, or assessing whether new APIs follow project conventions.
Как установить скилл api-reviewer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-reviewer запускает скрипты?
Нет, скилл состоит только из инструкций (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