Communitygithub.com

alfathafp/portofolio-web-design

在根據規格或需求觸碰程式碼之前,先用於撰寫多步驟任務的實作計劃。

portofolio-web-design 是什麼?

此技能專注於在開始編寫程式碼之前撰寫詳細的實作計劃,適用於需要多步驟執行的任務。它假設工程師在了解確切的介面規格和測試案例後,能自行編寫符合慣例的程式碼,因此計劃的價值在於記錄那些工程師無法自行決定的設計決策:例如檔案結構、函式簽章、回傳型別、以及驗證特定需求的測試案例。該技能支援在獨立的 Git Worktree 中工作,並要求將計劃儲存到 `docs/superpowers/plans/` 目錄下。這個方法論遵循 DRY、YAGNI、TDD 原則,並強調頻繁提交程式碼。其運作流程包括:檢查規格範圍是否涵蓋多個獨立子系統、定義檔案結構與職責、將工作拆解為可獨立測試的最小任務、以及為每個任務提供明確的步驟(編寫測試、執行使之失敗、實作最小程式碼、通過測試、提交)。最後還包含完整的自我審查和執行交接機制,確保計劃品質並與使用者確認執行方式。

相容平台~Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/writing-plans

在你喜歡的 AI 中提問

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

說明文件

撰寫計劃

概覽

為尚未看過此程式碼庫或規格的工程師撰寫實作計劃。假設他們在知道確切介面和確切測試後,會使用專案語言編寫慣用的程式碼,並且在計劃留有選擇空間的地方做出合理的決定。他們無法知道的是你所做的決定:哪些檔案、哪些名稱和簽章、來自規格的哪些值、哪些測試能證明每個任務。記錄這些。給他們完整的計劃,以易於消化的小任務呈現。DRY。YAGNI。TDD。頻繁提交。

開始時宣告:「我正在使用撰寫計劃技能來建立實作計劃。」

情境: 如果正在隔離的工作樹中工作,該工作樹應在執行時透過 superpowers:using-git-worktrees 技能建立。

儲存計劃至: docs/superpowers/plans/YYYY-MM-DD-<功能名稱>.md

  • (使用者對計劃位置的偏好會覆蓋此預設值)

範圍檢查

如果規格涵蓋多個獨立子系統,應在腦力激盪階段將其拆分為子專案規格。如果沒有,建議將其拆分為單獨的計劃——每個子系統一個。每個計劃應能獨立產出可運作、可測試的軟體。

檔案結構

在定義任務之前,規劃出將建立或修改哪些檔案,以及每個檔案的職責。這就是分解決策被鎖定的地方。

  • 設計邊界清晰、介面定義良好的單元。每個檔案應有一個明確的職責。
  • 你最能推理那些你能同時掌握在上下文中的程式碼,當檔案集中時,你的編輯更可靠。偏好較小、較集中的檔案,而不是過於龐大的檔案。
  • 經常一起變更的檔案應放在一起。按職責拆分,而不是按技術層。
  • 在現有程式碼庫中,遵循既有的模式。如果程式碼庫使用大型檔案,不要單方面重構——但如果你正在修改的檔案變得難以管理,在計劃中包含拆分是合理的。

此結構會引導任務的分解。每個任務應產生獨立且合理的、自成體系的變更。

任務大小調整

一個任務是承載自己的測試週期並值得審查者重新審查的最小單元。在劃分任務邊界時:將設定、配置、框架和文件步驟折疊到需要它們的任務中;只有當審查者能有意義地拒絕一個任務而批准其相鄰任務時,才進行拆分。每個任務都以一個可獨立測試的交付物結束。

步驟粒度

每個步驟都是一個具有可檢查結果的動作:

  • 「撰寫會失敗的測試」- 步驟
  • 「執行它以確認它失敗」- 步驟
  • 「實作讓測試通過的最小程式碼」- 步驟
  • 「執行測試並確認它們通過」- 步驟
  • 「提交」- 步驟

計劃文件標頭

每個計劃必須以這個標頭開始:

# [功能名稱] 實作計劃

> **給代理工作者:** 必要子技能:使用 superpowers:subagent-driven-development(建議)或 superpowers:executing-plans 來逐任務實作此計劃。步驟使用勾選框(`- [ ]`)語法來追蹤進度。

**目標:** [一句話描述此計劃要建立的內容]

**架構:** [2-3句關於方法的描述]

**技術棧:** [關鍵技術/函式庫]

**規格:** [此計劃實作的規格/設計文件路徑 —— 計劃從規格中論證,因此規格與計劃同行;執行者需同時閱讀兩者]

## 全域約束

[規格中專案層級的需求 —— 版本下限、依賴限制、命名與複製規則、平台要求 —— 每行一個,從規格中逐字複製精確值。每個任務的需求隱含包含此部分。]

## 審查重點

[規格暗示但沒有任務的測試涵蓋的五種輸入類別或失敗模式,最可能影響使用此軟體的人 —— 每行一個,命名輸入或條件以及合理使用者預期的行為,最可能的排最前面。規格是一份願景文件:它說明軟體必須做什麼,而不是它會遇到的所有情況,它對某個輸入的沉默不代表該輸入可以破壞程式。在此一次寫好清單,同時參考規格。然後,對於每一行,將驗證它的測試加入到擁有該程式碼的任務中,使用該任務自己的步驟風格。]

---

任務結構

### 任務 N:[元件名稱]

**檔案:**
- 建立:`exact/path/to/file.py`
- 修改:`exact/path/to/existing.py:123-145`
- 測試:`tests/exact/path/to/test.py`

**介面:**
- 消費: [此任務從較早任務使用的內容 —— 精確簽章]
- 產生: [後續任務依賴的內容 —— 精確函式名稱、參數和回傳型別。任務的實作者只看自己的任務;此區塊是他們了解相鄰任務使用的名稱和型別的方式]

- [ ] **步驟 1:撰寫會失敗的測試**

```python
def test_specific_behavior():
    result = function(input)
    assert result == expected
```

- [ ] **步驟 2:執行測試以確認它失敗**

執行:`pytest tests/path/test.py::test_name -v`
預期:FAIL 並顯示「function not defined」

- [ ] **步驟 3:在 `exact/path/to/file.py` 中實作 `function(input: InputType) -> ResultType`**

當簽章和測試留下選擇時(哪個函式庫呼叫、哪個資料結構),用一行說明方法;僅針對他們無法確定的演算法提供程式碼區塊。

- [ ] **步驟 4:執行測試以確認它通過**

執行:`pytest tests/path/test.py::test_name -v`
預期:PASS

- [ ] **步驟 5:提交**

```bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"
```

步驟包含的內容

一個步驟完成於實作者能從中寫出完全合理的一件東西。這就是全部要求:明確,而非完整。每種步驟只攜帶使其明確所需的內容:

  • 一個測試步驟: 測試的名稱及其斷言,以程式碼形式呈現,其中包含規格中的精確值。
  • 一個程式碼步驟: 精確的簽章(名稱、參數、回傳型別)、所屬檔案,以及規格固定的特定值。實作者撰寫函式主體。僅當簽章和測試無法決定演算法時,或規格要求精確複製時,才提供函式主體。
  • 一個驗證步驟: 要執行的命令以及代表通過的輸出。
  • 一個對其他任務的參考: 該任務的介面區塊說明了要使用的內容;計劃不會重複該任務的程式碼。

計劃是實作者無法獨自做出的決策集合。一個比它所描述的程式碼還長的計劃,實際上已經寫好了程式碼。那些什麼都沒決定的行(「TBD」、「處理邊界情況」、「新增適當驗證」、「為上述內容撰寫測試」、沒有任務定義的型別或函式)則是相反的問題,自我審查會發現這兩種錯誤。

自我審查

在撰寫完整個計劃後,以全新的眼光審視規格,並檢查計劃是否符合它。這是一個你自己執行的檢查清單——不是分配給子代理的任務。

1. 規格覆蓋率: 瀏覽規格中的每個部分/需求。你能指出一個實作它的任務嗎?列出任何差距。

2. 步驟掃描: 每個步驟必須讓實作者能寫出完全合理的一件東西,且任何步驟都不能攜帶更多:沒有決定任何事的一行是差距,而簽章和測試已決定的函式主體則是轉錄。修正兩者。

3. 型別一致性: 你在較晚的任務中使用的型別、方法簽章和屬性名稱,是否與你在較早任務中定義的一致?在任務 3 中叫 clearLayers() 但在任務 7 中叫 clearFullLayers() 的函式就是一個 bug。

4. 審查重點: 對於規格暗示的每個輸入類別或失敗模式,是否有一個任務的測試涵蓋它?最可能影響使用者的五個未涵蓋項目應放入審查重點部分,並且每行都應將其測試加入到所屬任務中。空的章節表示你檢查過且沒有發現,而不是你跳過了檢查。

5. 比例: 比較計劃的長度與規格的長度。一個比它實作的規格長數倍的計劃是程式的轉錄,而不是計劃。如果程式碼區塊佔了文件的大部分,請將函式主體替換為簽章、測試名稱和斷言,並檢查每個步驟是否仍然明確。

如果你發現問題,直接修正即可。無需重新審查——只需修正並繼續。如果你發現一個規格需求沒有對應的任務,新增該任務。

執行交接

在儲存並自我審查計劃後,將其連結給你的人類夥伴閱讀。如果他們已經明確提供了執行方法,請他們審查計劃並確認它捕捉了他們想要的內容;在實作之前等待該審查,然後使用已保留的方法。否則,請他們審查計劃並在實作之前選擇執行方法。

當尚未提供執行方法時:

「計劃已完成並儲存至 docs/superpowers/plans/<filename>.md。請審查計劃。您偏好哪種執行方式?

  • 子代理驅動 - 一個全新的子代理實作每個任務,一個全新的審查者在下一個任務開始前檢查它,最後在整個分支上進行一次審查。最徹底;每個任務和每次審查都需要新的上下文。
  • 原生 - 我在本次會話中親自實作所有任務,以這個框架執行工作的方式,然後一個全新的審查者在最有能力的模型上檢查整個分支。最便宜且最快;直到最後才進行獨立審查。對於中階會話模型效果很好,因為計劃承載了設計。

對於此計劃我推薦 <兩者之一>,因為 <從計劃中選一句話:任務之間對彼此介面的依賴程度、任務數量、發佈錯誤的成本>。計劃是否捕捉到您想要的內容,以及我們應該使用哪種方式?」

當已經提供了執行方法時:

「計劃已完成並儲存至 docs/superpowers/plans/<filename>.md。請審查計劃。它是否捕捉到您想要的內容?」

如果選擇了子代理驅動:

  • 必要子技能: 使用 superpowers:subagent-driven-development

如果選擇了原生:

  • 必要子技能: 使用 superpowers:executing-plans

Individual skills in this repo

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

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

相關技能