Communitygithub.com

cdcoonce/Portfolio_Website

使用並行子代理生成多個截然不同的模組介面設計。當使用者想要設計 API、探索介面選項、比較模組形狀或提到「設計它兩次」時使用。

Portfolio_Website 是什麼?

這個技能是基於《軟體設計哲學》中「設計它兩次」的原則:你的第一個想法不太可能是最好的。它讓使用者能產生多個截然不同的設計,然後進行比較。技能支援的平台包括能執行平行子代理的 AI 代理,例如 Claude Code、Cursor、Codex 等。它透過 Task 工具同時生成 3 個以上的子代理,每個代理被賦予不同的限制條件(例如「將方法數量降到最低」或「最大化靈活性」),從而產生截然不同的 API 形狀。之後,使用者可以依序檢視每個設計的介面簽章、使用範例和隱藏的複雜度,最後根據介面簡單性、通用性、實現效率和深度等標準進行比較。這項技能特別有助於在實作前探索 API 或模組設計空間,避免過早鎖定次佳方案。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

設計一個介面

基於《軟體設計哲學》中的「設計它兩次」:你的第一個想法不太可能是最好的。生成多個截然不同的設計,然後進行比較。

工作流程

1. 收集需求

在設計之前,請了解:

  • 這個模組解決什麼問題?
  • 呼叫者是誰?(其他模組、外部使用者、測試)
  • 關鍵操作有哪些?
  • 有任何限制嗎?(效能、相容性、現有模式)
  • 哪些應隱藏在內部,哪些應公開?

問:「這個模組需要做什麼?誰會使用它?」

2. 生成設計(平行子代理)

使用 Task 工具同時生成 3 個以上的子代理。每個子代理必須產生一個截然不同的方法。

每個子代理的提示模板:

為:[模組描述] 設計一個介面

需求:[已收集的需求]

此設計的限制:[為每個代理指定不同的限制]
- 代理 1:「將方法數量降到最低 - 目標最多 1-3 個方法」
- 代理 2:「最大化靈活性 - 支援多種使用案例」
- 代理 3:「針對最常見的情況進行最佳化」
- 代理 4:「從 [特定範例/函式庫] 獲得靈感」

輸出格式:
1. 介面簽章(型別/方法)
2. 使用範例(呼叫者如何使用)
3. 此設計隱藏了什麼在內部
4. 此方法的取捨

3. 展示設計

展示每個設計,包括:

  1. 介面簽章 - 型別、方法、參數
  2. 使用範例 - 呼叫者在實務上如何實際使用
  3. 隱藏的內容 - 保留在內部的複雜度

依序展示設計,讓使用者在比較之前能吸收每種方法。

4. 比較設計

在展示所有設計後,根據以下標準進行比較:

  • 介面簡單性:更少的方法、更簡單的參數
  • 通用 vs 專用:靈活性 vs 專注度
  • 實作效率:形狀是否允許高效的內部實作?
  • 深度:隱藏顯著複雜度的小型介面(好) vs 帶有淺層實作的大型介面(壞)
  • 正確使用的容易度 vs 誤用的容易度

用文字討論取捨,不要用表格。強調設計之間差異最大的地方。

5. 綜合

通常最好的設計會結合多個選項的見解。問:

  • 「哪個設計最符合你的主要使用案例?」
  • 「有沒有來自其他設計的元素值得整合?」

評估標準

來自《軟體設計哲學》:

介面簡單性:更少的方法、更簡單的參數 = 更容易學習和正確使用。

通用性:能在不變更的情況下處理未來使用案例。但要小心過度泛化。

實作效率:介面形狀是否允許高效實作?或強制使用笨拙的內部結構?

深度:隱藏顯著複雜度的小型介面 = 深度模組(好)。帶有淺層實作的大型介面 = 淺層模組(避免)。

反模式

  • 不要讓子代理產生相似的設計 - 強制要求截然不同
  • 不要跳過比較 - 價值在於對比
  • 不要實作 - 這純粹是關於介面形狀
  • 不要根據實作工作量來評估

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.

相關技能