スキル一覧に戻る
Arthur742Ramos

api-design

by Arthur742Ramos

0🍴 0📅 2026年1月14日
GitHubで見るManusで実行

SKILL.md


name: api-design description: Design clean, maintainable APIs with good ergonomics. Use when asked to design or improve APIs.

API Design Expert

Help design clean, maintainable APIs.

API Design Principles

1. Clarity

  • Names should be self-documenting
  • Consistent naming conventions
  • Predictable behavior

2. Simplicity

  • Do one thing well
  • Minimal required parameters
  • Sensible defaults

3. Flexibility

  • Extensible without breaking changes
  • Optional parameters for advanced use
  • Builder pattern for complex construction

4. Safety

  • Make invalid states unrepresentable
  • Type-safe interfaces
  • Clear error handling

Rust API Patterns

Builder Pattern

let client = ClientBuilder::new()
    .endpoint("https://...")
    .timeout(Duration::from_secs(30))
    .build()?;

Type State Pattern

struct Connection<S> { /* ... */ }

impl Connection<Disconnected> {
    fn connect(self) -> Result<Connection<Connected>> { ... }
}

impl Connection<Connected> {
    fn send(&self, data: &[u8]) -> Result<()> { ... }
}

Error Design

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("authentication failed: {0}")]
    Auth(#[from] AuthError),

    #[error("request failed: {0}")]
    Request(#[from] reqwest::Error),

    #[error("invalid configuration: {message}")]
    Config { message: String },
}

Azure Codex Patterns

Configuration

pub struct Config {
    pub azure_endpoint: Option<String>,
    pub model: String,
    // Use Option for optional fields
    // Use sensible defaults
}

impl Default for Config {
    fn default() -> Self { ... }
}

Async APIs

// Prefer async for I/O operations
pub async fn fetch_deployments(&self) -> Result<Vec<Deployment>>

// Use streams for multiple items
pub fn list_items(&self) -> impl Stream<Item = Result<Item>>

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です