Community程式設計與開發github.com

alfathafp/portofolio-web-design

在當前會話中執行實作計劃時,為每個獨立任務分派全新的實作子代理,並在每個任務後進行合規與程式碼審查,最後進行全分支審查

portofolio-web-design 是什麼?

這項技能定義了一種「子代理驅動開發」流程,旨在高品質、快速地執行實作計劃。核心做法是為計劃中的每個獨立任務,分派一個全新的實作子代理,該代理擁有完全隔離的上下文,不會繼承主會話的歷史,從而確保專注並順利完成任務。每個任務完成後,會立即進行一次任務層級的審查(規格符合性 + 程式碼品質),而不是等到最後才統一審查,這樣可以及早發現問題並快速迭代。整個流程由一個「台帳」檔案追蹤進度,即使在會話上下文壓縮後也能可靠恢復,避免重複執行。這項技能支援 Claude Code、Cursor、Codex 等代理工具,尤其適用於任務間耦合度低、可獨立執行的實作計劃,並透過明確的模型選擇指南來平衡成本與效能。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/subagent-driven-development

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

子代理驅動開發

透過為每個任務分派一個全新的實作子代理、每個任務後進行任務審查(規格合規 + 程式碼品質),並在最後進行全面的全分支審查來執行計劃。

為什麼要使用子代理: 你將任務委派給具有隔離上下文的專業代理。透過精確地建構它們的指令和上下文,你確保它們能夠保持專注並成功完成任務。它們絕不應該繼承你會話的上下文或歷史——你只為它們建構所需的內容。這也為你保留了用於協調工作的上下文。

核心原則: 每個任務使用全新子代理 + 任務審查(規格 + 品質)+ 全面的最終審查 = 高品質、快速迭代

敘述: 在工具呼叫之間,最多敘述一行簡短的內容——台帳和工具結果會記錄一切。

持續執行: 不要在任務之間停下來與你的合作夥伴確認。不停頓地執行計劃中的所有任務。唯一需要停止的原因是下面列出的四種情況,或者所有任務都已完成。「我該繼續嗎?」之類的提示和進度摘要會浪費他們的時間——他們要求你執行計劃,那就執行它。

做出裁決,而非停滯。 一個運作中的計劃不應等待人類。衝突、不明確之處、計劃缺陷、你可能需要請求超過的額度——這些都由你來決定。規格是具有約束力的權威,計劃是它的論據,而你的判斷來解決兩者都未回答的問題。將每個決定記錄在台帳中,格式為 裁決:<你的決定> — <原因> — <如果錯誤會付出的代價>,然後繼續前進。一個錯誤的裁決會導致返工,你的合作夥伴可以看到並撤銷;但一個卡在問題上的會話會浪費他們一整天的時間,而且一無所獲。

有四件事會讓你停止,且只有這四件:不可逆或破壞性操作;安全敏感操作;此工作樹之外的副作用,按慣例你應先詢問(合併、推送到共享分支、發布);以及一個嚴重缺陷到每個前進方向都是猜測的計劃。遇到這些情況,停下來詢問。

何時使用

digraph when_to_use {
    "有實作計劃?" [shape=diamond];
    "任務大多獨立?" [shape=diamond];
    "合作夥伴選擇內聯,或無子代理工具?" [shape=diamond];
    "subagent-driven-development" [shape=box];
    "executing-plans" [shape=box];
    "手動執行或先腦力激盪" [shape=box];

    "有實作計劃?" -> "任務大多獨立?" [label="是"];
    "有實作計劃?" -> "手動執行或先腦力激盪" [label="否"];
    "任務大多獨立?" -> "合作夥伴選擇內聯,或無子代理工具?" [label="是"];
    "任務大多獨立?" -> "手動執行或先腦力激盪" [label="否 - 高度耦合"];
    "合作夥伴選擇內聯,或無子代理工具?" -> "executing-plans" [label="是"];
    "合作夥伴選擇內聯,或無子代理工具?" -> "subagent-driven-development" [label="否"];
}

與執行計劃(內聯)相比:

  • 每個任務使用全新子代理(無上下文污染),而非一個上下文執行所有任務
  • 每個任務後進行審查(規格合規 + 程式碼品質),而非僅在最後
  • 代價:每個任務和每個審查需要一個新上下文;內聯代價:一個上下文加上一個最終審查者
  • 兩者都在此會話中執行,共享相同的計劃工作區和台帳,並且在任務之間從不暫停

流程

digraph process {
    rankdir=TB;

    subgraph cluster_per_task {
        label="每個任務";
        "分派實作子代理 (./implementer-prompt.md)" [shape=box];
        "實作者提出問題?" [shape=diamond];
        "回答問題,提供上下文" [shape=box];
        "實作者實作、測試、提交、自我審查" [shape=box];
        "產生審查套件,分派任務審查者 (./task-reviewer-prompt.md)" [shape=box];
        "規格 ✅ 且品質批准?" [shape=diamond];
        "發現與計劃文字衝突?" [shape=diamond];
        "對衝突做出裁決,記錄到台帳" [shape=box];
        "修復輪次 R(共 5 輪):R≤3 恢復實作者;R≥4 全新實作者,更強大模型" [shape=box];
        "分派限定的重新審查 (./re-review-prompt.md)" [shape=box];
        "所有發現已解決?" [shape=diamond];
        "R = 5?" [shape=diamond];
        "裁決每個未解決的發現" [shape=box];
        "有任何承重發現?" [shape=diamond];
        "做出裁決並繼續;僅在每個前進方向都是猜測時停止" [shape=box];
        "將發現與裁決一起記錄在台帳中" [shape=box];
        "將完成情況附加到台帳,標記待辦事項為完成" [shape=box];
    }

    "設定:工作區、台帳檢查、讀取計劃、預先審查" [shape=box];
    "還有更多任務?" [shape=diamond];
    "分派最終程式碼審查者 (../requesting-code-review/code-reviewer.md)" [shape=box];
    "最終發現?一次修復分派,一次限定重新審查,裁決殘留事項" [shape=box];
    "最終審查乾淨:刪除本計劃的工作區" [shape=box];
    "使用 superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];

    "設定:工作區、台帳檢查、讀取計劃、預先審查" -> "分派實作子代理 (./implementer-prompt.md)";
    "分派實作子代理 (./implementer-prompt.md)" -> "實作者提出問題?";
    "實作者提出問題?" -> "回答問題,提供上下文" [label="是"];
    "回答問題,提供上下文" -> "實作者實作、測試、提交、自我審查";
    "實作者提出問題?" -> "實作者實作、測試、提交、自我審查" [label="否"];
    "實作者實作、測試、提交、自我審查" -> "產生審查套件,分派任務審查者 (./task-reviewer-prompt.md)";
    "產生審查套件,分派任務審查者 (./task-reviewer-prompt.md)" -> "規格 ✅ 且品質批准?";
    "規格 ✅ 且品質批准?" -> "將完成情況附加到台帳,標記待辦事項為完成" [label="是"];
    "規格 ✅ 且品質批准?" -> "發現與計劃文字衝突?" [label="否"];
    "發現與計劃文字衝突?" -> "對衝突做出裁決,記錄到台帳" [label="是"];
    "對衝突做出裁決,記錄到台帳" -> "修復輪次 R(共 5 輪):R≤3 恢復實作者;R≥4 全新實作者,更強大模型";
    "發現與計劃文字衝突?" -> "修復輪次 R(共 5 輪):R≤3 恢復實作者;R≥4 全新實作者,更強大模型" [label="否"];
    "修復輪次 R(共 5 輪):R≤3 恢復實作者;R≥4 全新實作者,更強大模型" -> "分派限定的重新審查 (./re-review-prompt.md)";
    "分派限定的重新審查 (./re-review-prompt.md)" -> "所有發現已解決?";
    "所有發現已解決?" -> "將完成情況附加到台帳,標記待辦事項為完成" [label="是"];
    "所有發現已解決?" -> "R = 5?" [label="否"];
    "R = 5?" -> "修復輪次 R(共 5 輪):R≤3 恢復實作者;R≥4 全新實作者,更強大模型" [label="否 - 下一輪"];
    "R = 5?" -> "裁決每個未解決的發現" [label="是 - 斷路器觸發"];
    "裁決每個未解決的發現" -> "有任何承重發現?";
    "有任何承重發現?" -> "做出裁決並繼續;僅在每個前進方向都是猜測時停止" [label="是"];
    "有任何承重發現?" -> "將發現與裁決一起記錄在台帳中" [label="否"];
    "將發現與裁決一起記錄在台帳中" -> "將完成情況附加到台帳,標記待辦事項為完成";
    "將完成情況附加到台帳,標記待辦事項為完成" -> "還有更多任務?";
    "還有更多任務?" -> "分派實作子代理 (./implementer-prompt.md)" [label="是"];
    "還有更多任務?" -> "分派最終程式碼審查者 (../requesting-code-review/code-reviewer.md)" [label="否"];
    "分派最終程式碼審查者 (../requesting-code-review/code-reviewer.md)" -> "最終發現?一次修復分派,一次限定重新審查,裁決殘留事項";
    "最終發現?一次修復分派,一次限定重新審查,裁決殘留事項" -> "最終審查乾淨:刪除本計劃的工作區";
    "最終審查乾淨:刪除本計劃的工作區" -> "使用 superpowers:finishing-a-development-branch";
}

設定

確保工作在隔離的工作區中進行:使用 superpowers:using-git-worktrees 建立一個或驗證現有的工作區。如果沒有得到合作夥伴的明確同意,切勿在 main/master 分支上開始實作。

會話記憶無法在壓縮後存活。在實際會話中,控制器若失去位置,可能會重新分派整個已完成的任務序列——這是觀察到的最昂貴的失敗。請在台帳檔案中追蹤進度,而不僅僅是待辦事項。

  • 每個計劃都擁有一個工作區:在技能開始時,執行此技能的 bash scripts/sdd-workspace PLAN_FILE——它會輸出計劃的 git-忽略目錄(位於 <repo-root>/.superpowers/sdd/),這是該計劃所有產物(台帳、簡報、報告、審查套件)的存放處。另一個計劃的目錄絕非你可以讀寫的。
  • 檢查此計劃的台帳是否位於 <workspace>/progress.md。如果其第一行命名了你的計劃檔案,那麼帶有 Task <N>: complete 行的任務就已完成——不要重新分派它們;從第一個沒有該標記的任務繼續。一個任務的最後一行如果是修復輪次,則表示它處於迴圈中:從下一輪繼續該迴圈。一個第一行命名了不同計劃檔案(或舊的平路徑 .superpowers/sdd/progress.md 上有一個遺留的台帳)的台帳,是另一個計劃的進度:保持原樣,然後從頭開始你自己的。
  • 建立台帳,並將以下內容作為第一行:# SDD 台帳 — 計劃:<plan file path>。
  • 台帳是你的恢復地圖:它所命名的提交存在於 git 中,即使你的上下文不再記得建立它們。在壓縮之後,請相信台帳和 git log,而不是你自己的記憶。
  • git clean -fdx 會摧毀工作區(因為它是 git-忽略的暫存區);如果發生這種情況,從 git log 恢復。

閱讀計劃一次,注意其上下文和全域約束,並為每個任務建立一個待辦事項。如果計劃命名了一個規格,也請閱讀它:規格是計劃所依據的權威,計劃內部的衝突應以規格為準。一個沒有可達規格的計劃,會在台帳中記錄一條註釋說明——在沒有規格的情況下做出的裁決是暫定性的。

在分派任務 1 之前,掃描計劃一次以尋找衝突,並在你檢查的過程中記錄下來:

  • 彼此矛盾或與計劃全域約束矛盾的任務
  • 計劃明確要求但審查準則視為缺陷的任何事項(例如:一個沒有斷言的測試、邏輯區塊的逐字複製)

掃描的輸出是一個表格,而不是一個判決。對於每對共享檔案或介面的任務,表格中有一行:這兩個任務、一個任務產出的內容與另一個任務消費的內容,以及你的發現。對於每個任務,表格中有一行:其自身文字是否與自身一致——它指定的測試與它指定的程式碼,它建立的檔案與它稍後觸及的檔案。「掃描乾淨」如果沒有這些行,就不是你實際執行的掃描。

將表格寫入台帳。在執行開始之前,對你發現的所有事項做出裁決——每個發現都應參照強制它的計劃文字——並將每個裁決記錄在台帳中。如果掃描乾淨,則無需註釋繼續。對它浮現的每個衝突做出裁決——規格是具有約束力的權威,計劃是它的論據——將裁決記錄在其行旁邊,然後分派任務 1。審查循環仍然是捕捉僅從實作中浮現的衝突的網。

模型選擇

使用能夠處理每個角色的最不強大的模型,以節省成本並提高速度。

機械性實作任務(隔離的函數、清晰的規格、1-2 個檔案):使用快速、便宜的模型。當計劃指定良好時,大多數實作任務都是機械性的。

整合與判斷任務(多檔案協調、模式匹配、除錯):使用標準模型。

架構與設計任務:使用可用的最強大模型。最終的全分支審查屬於此類——將其分派給可用的最強大模型,而不是會話預設值。

審查任務:選擇具有相同判斷力的模型,並根據差異的大小、複雜性和風險進行調整。一個小的機械性差異不需要最強大的模型;一個微妙的並發更改則需要。限定的重新審查用於小的修復差異,應使用低成本到中階的模型。

修復循環升級(第 4-5 輪):使用至少比陷入困境的實作者高一級的模型。

在分派子代理時,始終明確指定模型。 省略模型會繼承你的會話模型——通常是最強大且最昂貴的——這會默默地使本節失效。

輪次數勝過 Token 價格。 實際耗時和上下文成本與子代理進行的輪次數成正比,而最便宜的模型在多步驟工作中通常需要 2-3 倍的輪次——總體成本更高。使用中階模型作為審查者以及從文字描述進行實作的實作者的最低標準。當任務的計劃文字包含要編寫的完整程式碼時,實作相當於抄寫加測試:對該實作者使用最便宜的層級。單一檔案的機械性修復也使用最便宜的層級。

任務複雜度訊號(實作任務):

  • 觸及 1-2 個檔案,且具有完整規格 → 便宜模型
  • 觸及多個檔案,且涉及整合問題 → 標準模型
  • 需要設計判斷或廣泛的程式碼庫理解 → 最強大模型

任務循環

批次處理相同形狀的小任務。 當計劃列出幾個任務,每個都是同類型的獨立小編輯時——例如,跨檔案重複的同一行修復、常數更改或欄位新增——不要為每個任務分派一個子代理。而是撰寫一份分派簡報,列出每個檔案及其更改,將整個批次發送給一個子代理,並將其差異作為一個單元進行審查。將每個任務分派一個代理的方式保留給需要其自身判斷、其自身測試或其自身審查面的工作。

你貼到分派提示中的一切——以及子代理返回的一切——都會在你的上下文[…]

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.

相關技能