Communitygithub.com

cdcoonce/Portfolio_Website — インターフェース設計

モジュールに対して、並列サブエージェントを用いて複数の根本的に異なるインターフェース設計案を生成します。ユーザーがAPIを設計したい、インターフェースの選択肢を探りたい、モジュール形状を比較したい、「二度設計する」と言った場合に使用します。

Portfolio_Website — インターフェース設計 とは?

このスキルは、ソフトウェア設計の哲学書『A Philosophy of Software Design』で提唱されている「Design It Twice(二度設計せよ)」の原則を実践するためのものです。最初のアイデアが最良であることは稀であるという前提に立ち、複数の根本的に異なるインターフェース設計案を並列に生成し、比較・統合することで、より良い設計を導き出します。主にClaude CodeなどのAIエージェントでの使用を想定しており、Taskツールを使って3つ以上のサブエージェントを同時に起動し、各エージェントに異なる制約条件(例:メソッド数を最小化、柔軟性を最大化、最も一般的なケースに最適化)を割り当てます。各設計案はインターフェースシグネチャ、使用例、内部隠蔽内容、トレードオフを出力し、最終的にユーザーが最適な設計を選択または統合できるようにします。評価基準には、インターフェースのシンプルさ、汎用性、実装効率、深さ(小さなインターフェースで大きな複雑性を隠す)が含まれます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cdcoonce/Portfolio_Website/tree/HEAD/.claude/skills/design-an-interface

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

インターフェースを設計する

「A Philosophy of Software Design」の「Design It Twice」に基づく:最初のアイデアが最良であることは稀です。複数の根本的に異なる設計を生成し、比較しましょう。

ワークフロー

1. 要件を収集する

設計の前に、以下を理解します:

  • このモジュールはどのような問題を解決するか?
  • 呼び出し元は誰か?(他のモジュール、外部ユーザー、テスト)
  • 主要な操作は何か?
  • 制約はあるか?(パフォーマンス、互換性、既存パターン)
  • 内部に隠すべきものと、公開すべきものは何か?

質問:「このモジュールは何をする必要があるか?誰が使うのか?」

2. 設計を生成する(並列サブエージェント)

Taskツールを使用して、3つ以上のサブエージェントを同時に起動します。各エージェントは根本的に異なるアプローチを生成しなければなりません。

各サブエージェントへのプロンプトテンプレート:

対象:[モジュールの説明] のインターフェースを設計せよ

要件:[収集した要件]

この設計の制約:[各エージェントに異なる制約を割り当てる]
- エージェント1:「メソッド数を最小化 - 最大1~3メソッドを目指せ」
- エージェント2:「柔軟性を最大化 - 多くのユースケースをサポートせよ」
- エージェント3:「最も一般的なケースに最適化せよ」
- エージェント4:「[特定のパラダイム/ライブラリ]から着想を得よ」

出力形式:
1. インターフェースシグネチャ(型/メソッド)
2. 使用例(呼び出し元がどのように使うか)
3. この設計が内部に隠すもの
4. このアプローチのトレードオフ

3. 設計案を提示する

各設計案を以下の形式で表示します:

  1. インターフェースシグネチャ - 型、メソッド、パラメータ
  2. 使用例 - 呼び出し元が実際にどのように使うか
  3. 隠蔽内容 - 内部に隠された複雑性

設計案は順番に提示し、ユーザーが比較前に各アプローチを理解できるようにします。

4. 設計案を比較する

すべての設計案を表示した後、以下の観点で比較します:

  • インターフェースのシンプルさ:メソッド数が少なく、パラメータが単純
  • 汎用性と特化性:柔軟性と焦点のバランス
  • 実装効率:形状が効率的な内部実装を可能にするか
  • 深さ:小さなインターフェースで大きな複雑性を隠す(良い) vs 大きなインターフェースで薄い実装(悪い)
  • 正しい使いやすさ vs 誤用のしやすさ

トレードオフは表ではなく文章で議論します。設計間で最も乖離している箇所を強調します。

5. 統合する

多くの場合、最良の設計は複数の選択肢からの洞察を組み合わせたものです。以下の質問を投げかけます:

  • 「どの設計があなたの主要なユースケースに最も適していますか?」
  • 「他の設計から取り入れる価値のある要素はありますか?」

評価基準

『A Philosophy of Software Design』より:

インターフェースのシンプルさ:メソッド数が少なく、パラメータが単純 = 学びやすく、正しく使いやすい。

汎用性:変更なしで将来のユースケースに対応できる。ただし、過度な一般化には注意。

実装効率:インターフェースの形状が効率的な実装を可能にするか?それとも無理な内部構造を強制するか?

深さ:小さなインターフェースで大きな複雑性を隠す = 深いモジュール(良い)。大きなインターフェースで薄い実装 = 浅いモジュール(避けるべき)。

アンチパターン

  • サブエージェントに類似した設計を生成させない - 根本的な違いを強制すること
  • 比較を省略しない - 価値はコントラストにある
  • 実装しない - これは純粋にインターフェースの形状に関するもの
  • 実装の労力に基づいて評価しない

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cdcoonce/Portfolio_Website

Git commit workflow with enforced conventional commit style. Use when Claude needs to stage and commit changes, craft commit messages, or the user asks to commit, make a commit, or save their work. Ensures consistent commit message format, proper scoping, and atomic commits across the project.

cdcoonce/Portfolio_Website

AI-powered code quality analysis for Python, Markdown, and Mermaid diagrams. Use this skill when: (1) reviewing code for quality issues, (2) checking Python files for PEP8 violations, unused code, missing type hints, docstring problems, complexity issues, or potential runtime errors, (3) validating Markdown documentation for broken links, heading structure, or formatting issues, (4) validating Mermaid diagram syntax, (5) the user asks for a "code review" or "quality check", (6) analyzing code snippets pasted in conversation, or (7) suggesting and applying fixes for code quality issues.

cdcoonce/Portfolio_Website

Deploy the portfolio chat agent Lambda function to AWS. Use when the user asks to deploy, redeploy, push to Lambda, update the chat agent, or after updating context files or lambda_function.py. Rebuilds the knowledge base, packages dependencies, and deploys to AWS Lambda.

cdcoonce/Portfolio_Website

Orchestrate the full GitHub-issues-driven development lifecycle. 7-phase pipeline from brainstorm through PR with state tracking and cross-conversation resume. Use when user says "dev cycle", "development workflow", "full development pipeline", or invokes /dev-cycle.

cdcoonce/Portfolio_Website

Production Python coding standards with automatic version detection (3.10-3.13). Use when writing, reviewing, or refactoring Python to ensure adherence to modern type syntax, LBYL exception handling, pathlib operations, ABC-based interfaces, and production-tested patterns. Not Dagster-specific - applies to any Python project.

cdcoonce/Portfolio_Website

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

cdcoonce/Portfolio_Website

GitHub CLI (gh) integration for managing issues, pull requests, branches,

cdcoonce/Portfolio_Website

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

cdcoonce/Portfolio_Website

Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.

cdcoonce/Portfolio_Website

CEO/founder-mode plan review. Rethink the problem, find the 10-star product, challenge premises, expand scope when it creates a better product. Three modes: SCOPE EXPANSION (dream big), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Use when the user asks for a plan review, CEO review, mega review, or wants a plan challenged/stress-tested before implementation.

cdcoonce/Portfolio_Website

Break a PRD into independently-grabbable GitHub issues using tracer-bullet vertical slices. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.

cdcoonce/Portfolio_Website

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in docs/plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".

cdcoonce/Portfolio_Website

Generate or update the `.claude/docs/project.md` file that gives Claude project-specific context. Use this skill when the user asks to create, update, regenerate, or refresh project context, or says things like "update project.md", "generate project context", "this repo needs a project.md", or "Claude doesn't know about this project". Also trigger when onboarding Claude to a new repository for the first time.

cdcoonce/Portfolio_Website

Generate comprehensive, high-quality README.md files for code repositories. Use this skill whenever the user asks to create, write, generate, update, or improve a README for any project or repository. Also trigger when the user says things like "document this project", "write docs for this repo", "this repo needs a README", "help me onboard developers to this codebase", or asks for project documentation in markdown. Even if the user just says "README" or "readme" in the context of a codebase, use this skill.

cdcoonce/Portfolio_Website

Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

cdcoonce/Portfolio_Website

Set up pre-commit hooks for the current repo. Use when user wants to add pre-commit hooks, configure commit-time linting, formatting, type checking, or testing. Triggers on "pre-commit", "git hooks", "linting hooks", or /setup-pre-commit.

cdcoonce/Portfolio_Website

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

cdcoonce/Portfolio_Website

Triage a bug or issue by exploring the codebase to find root cause, then create a GitHub issue with a TDD-based fix plan. Use when user reports a bug, wants to file an issue, mentions "triage", or wants to investigate and plan a fix for a problem.

cdcoonce/Portfolio_Website

Rewrites the prose sections of wiki pages in-place. Reads source files to understand current context, then updates only the content inside <!-- claude:prose --> ... <!-- claude:prose:end --> markers. Never touches <!-- generated:start --> ... <!-- generated:end --> blocks. Supports targeting a single page with /update-wiki {PageName}.

cdcoonce/Portfolio_Website

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

関連スキル