選項

plan-orchestrate

affaan-m/ECC affaan-m/ECC

讀取計畫文件,將其分解為各個步驟,從 ECC 目錄中設計每個步驟的代理鏈,並產生可直接複製貼上/進行協調的自訂提示,而無需實際執行這些提示。

...展開全部
9
更新時間 2026-10-04

規劃與協調

透過為每個步驟產生一筆可直接貼上的呼叫指令,將計畫文件與/orchestrate custom功能串接。此技能僅具生成功能——絕不會執行/orchestrate 指令。使用者可在準備就緒時,逐行貼上這些指令。

何時啟用

  • 使用者手頭有一份多步驟的計畫文件(PRD、RFC、實施計畫),並希望透過/orchestrate 來推動該計畫。
  • 使用者說「為此計畫進行協調」、「為每個步驟提供協調提示」、「為此計畫編排鏈」。
  • 已存在分步計畫,但使用者不希望在每個步驟中手動挑選代理程式。

何時應跳過:

  • 若工作僅包含一個臨時步驟 → 請直接呼叫/orchestrate custom。
  • 計畫內容無法閱讀或為空。僅因缺乏明確編號,並不構成跳過條件 — 請參閱下方的「無明確步驟」邊緣案例。

輸入

 [--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:|range:-] [--dry-run]
  • — 必填;可為相對路徑或絕對路徑(接受@docs/...格式)。
  • --lang— 審查者語言變體;預設為auto(從專案中偵測)。
  • --scope— 限制產出的步驟;預設為all。
  • --dry-run— 僅輸出分解 + 鏈結理由;不輸出最終提示。

權威性/orchestrate格式(請勿偏離)

{ORCH_CMD} custom ",,...," ""

其中{ORCH_CMD}於第 0 階段確定(見下文)。發出的輸出中的命令字串始終採用一種具體形式——絕不同時使用兩種形式,也絕不使用佔位符。

  • custom是一個順序鏈;每個代理的 HANDOFF 會傳遞給下一個。
  • 以逗號分隔的代理清單。建議不要使用空格;允許出現一個空格。
  • 不存在--mode/--gate/--agents=...等參數 — 切勿自行新增。
  • 代理名稱取自此技能的目錄。任務描述中嵌入的雙引號會以\" 進行轉義。

ECC 安裝格式與命名空間

兩種安裝形式決定了斜線指令及每個代理名稱的前綴。這兩者必須保持同步——每種形式對應一種輸出,絕不可混用:

讓 表示 Claude Code 的主目錄:macOS/Linux 為~/.claude,Windows 為%USERPROFILE%\.claude。請依照主機平台解析使用者主目錄的方式進行解析(切勿硬編碼~)。

形式 偵測 {ORCH_CMD} 代理名稱格式
外掛程式安裝 (1.9.0+) 是否存在/plugins/marketplaces/everything-claude-code/ /everything-claude-code:orchestrate everything-claude-code:
舊版基本安裝 上述路徑不存在;代理程式檔案位於/agents/ /orchestrate

為何這很重要:在外掛程式安裝模式下,代理程式會以everything-claude-code:tdd-guide 進行註冊。純名稱會強制進行模糊比對,這在並行呼叫時會間歇性地失敗。在傳統模式下,帶前綴的形式不會被註冊,因此會直接失敗。

可用代理程式目錄(必須從中選擇)

一般類別:

  • 規劃者— 需求重述、風險分解、步驟規劃
  • architect— 架構、系統設計、重構提案
  • tdd-guide— 編寫測試 → 實作 → 覆蓋率達 80% 以上
  • 程式碼審查員— 一般程式碼審查
  • 安全審查員— 安全稽核、OWASP、機密洩漏
  • 重構清理員— 死碼、重複碼、knip 類別清理
  • 文件更新員— 文件、程式碼映射、README
  • docs-lookup— 第三方函式庫 API 查詢 (Context7)
  • e2e-runner— 端對端測試協調
  • database-reviewer— PostgreSQL 資料庫結構、遷移、效能
  • harness-optimizer— 本地代理框架配置
  • loop-operator— 長時間運行的自主迴圈
  • chief-of-staff— 多管道分流(極少適用於計畫步驟)

建置錯誤解決器:

  • build-error-resolver(通用) /cpp-build-resolver/go-build-resolver/java-build-resolver/kotlin-build-resolver/rust-build-resolver/pytorch-build-resolver

程式碼審查員:

  • python-reviewer/typescript-reviewer/go-reviewer/rust-reviewer/cpp-reviewer/java-reviewer/kotlin-reviewer/flutter-reviewer

代理名稱拼寫錯誤會導致/orchestrate 失敗。發送前請對照此清單進行交叉核對。

運作原理

第 0 階段 — 偵測 ECC 模式 + 程式語言

  1. 讀取 。若缺失或為空,則回報並停止。

  2. 偵測 ECC 安裝形式一次,並將其固定為ECC_MODE。演算法(依序執行,於首次匹配時停止):

    1. 若/plugins/marketplaces/everything-claude-code/存在 →ECC_MODE=plugin。
    2. 否則,若/agents/存在且包含至少一個 ECC 代理程式檔案(例如tdd-guide.md、code-reviewer.md)→ECC_MODE=legacy。
    3. 否則 → 預設為ECC_MODE=legacy,並在輸出頂端顯示一行警告:> 警告:無法偵測到 ECC 安裝;預設為舊版形式。若您使用外掛程式安裝,請手動編輯前綴。
    4. 若兩種標記皆存在(混合安裝),則以外掛程式為準 — 僅外掛程式的命名空間會在不進行模糊匹配的情況下解析代理程式名稱。

    從此處開始,每條產出的內容都會在斜線指令及每個代理名稱上使用相符的前綴。切勿在同一輸出中同時產生兩種形式。

  3. 解析--lang。當設定為auto 時,執行支援多種語言的偵測:

    • 探測標記:pyproject.toml/uv.lock/requirements.txt→ python;package.json→ typescript;go.mod→ go;Cargo.toml→ rust;CMakeLists.txt或頂層*.cpp→ cpp;pom.xml/build.gradle(Java) → java;build.gradle.kts或頂層 Kotlin → kotlin;pubspec.yaml→ flutter。
    • 多語言平手處理規則:若有多個標記符合條件,則選擇其原始碼檔案數量多於其他語言的語言(透過`git ls-files` 統計,排除vendor/、node_modules/、dist/、build/、.venv/、生成的檔案以及明顯的測試輔助檔案)。 若出現平手,或沒有任何語言的原始碼檔案佔比超過 60%,則將lang 設為unknown。
    • 若無標記匹配 → 將lang 設為unknown。
    • lang=unknown是一個哨兵變數 — 它並非代理名稱。第二階段的規則 4 和 5 會在鏈組建時將其轉換為代碼審查者/建置錯誤解決者。
  4. 偵測PyTorch 子配置檔:當lang=python且pyproject.toml/requirements.txt/uv.lock中的任何檔案宣告對torch 的依賴時,將pytorch 設為 true。這僅影響建置鏈的選取(參見下文第二階段規則);審查者仍維持為python-reviewer。

  5. 將計畫中宣告的任何代理名稱標準化:若計畫文字以帶有外掛程式前綴的形式引用代理(例如everything-claude-code:tdd-guide),則在驗證或組合鏈之前,移除前綴以取得原始目錄名稱。 根據ECC_MODE(第 4 階段),僅在輸出時才會重新添加前綴。切勿讓已添加前綴的名稱流入鏈組建流程——這會在外掛程式模式下導致前綴重複。

第 1 階段 — 分解步驟

依優先順序識別「步驟單位」:

  1. 明確編號:## 步驟 N/### 階段 N/## N. .../ 頂層有序清單。
  2. 表格中的「步驟」欄位。
  3. ----以動詞開頭的標題分隔各區塊。
  4. 否則將每個 H2 視為一個步驟。

針對每個步驟,萃取ID(從 1 開始計數)、標題(≤ 80 個字元)、意圖(1–3 句)及標籤。

第二階段 — 標籤與鏈選

根據意圖進行標籤標記(允許多標籤;標籤鏈由主要標籤 + 堆疊的次要標籤構成):

以下觸發詞的匹配不區分大小寫。只要語義與列出的英文觸發詞一致,系統便會透過匹配任何語言的詞幹來支援多語言計畫。

標籤 觸發詞 預設鏈
設計 建築、設計、選擇、評估、RFC 規劃師、建築師
計畫 計畫、細分、里程碑 規劃師
實作 實作、建置、新增、建立、移植 TDD 指南、- 審閱者
測試 測試、覆蓋率、端到端、整合 tdd-guide, e2e-runner
重構 重構、清理、去重、拆分 架構師、重構清理工具、- 審查員
遷移 遷移、升級、重寫、移植 架構師、TDD 指南、- 審閱者
資料庫 資料結構、遷移、索引、SQL、Postgres、Alembic、SQLModel 資料庫審查員、 審查員
安全性 加密、身份驗證、機密資訊、OWASP、個人識別資訊 安全審查員、-reviewer
建置 建置、編譯、程式碼檢查失敗、持續整合 -build-resolver(若失敗則回退至build-error-resolver)
文件 文件、讀我檔、程式碼地圖、變更紀錄 文件更新器
查詢 查詢、參考、API 使用說明 文件查詢
審查 審查、稽核、驗證 -審查員、程式碼審查員
迴圈 迴圈、自主、看門狗 迴圈運算子

鏈結組合規則:

  1. 主要標籤選取:當某個步驟符合多個標籤時,依表格順序排在最前面的標籤(表格頂端 = 最高優先級)即為主要標籤;其餘則為次要標籤。下方的組合規則 2 和 3 會明確處理特定的多標籤組合;否則,則依標籤表格順序追加次要鏈。
  2. impl+security→tdd-guide,-reviewer, security-reviewer.
  3. impl+db→tdd-guide,database-reviewer,-reviewer。
  4. 對生成的鏈進行去重(保留首次出現的項目)。例如,review+lang=unknown根據規則 5 會產生code-reviewer,code-reviewer;去重後會併縮為code-reviewer。
  5. 當 lang=unknown 時,-reviewer會解析為code-reviewer。
  6. 當 `lang=unknown` 時,`-build-resolver`會解析為`build-error-resolver`。特殊情況:若第 0 階段設定了`pytorch=true`,則無論如何,建置鏈皆使用`pytorch-build-resolver`。不存在python-build-resolver;若未設定pytorch=true且使用--lang=python,則解析為build-error-resolver。
  7. 零標籤步驟:若無觸發詞匹配,則將鏈設定為code-reviewer並註明「無標籤匹配」;預設在「鏈邏輯依據」下採用僅審查鏈。
  8. 去重後鏈長 ≤ 4。若超過此限制,則捨棄最弱的標籤(優先捨棄「查詢」與「文件」)。
  9. 請勿在實作鏈中將規劃者與架構師配對(浪費標籤)。僅在設計步驟中將其配對。
  10. 標記為impl、refactor 或migration的步驟,必須以審查員類別的代理作為結尾——包括-reviewer、code-reviewer、security-reviewer 或database-reviewer 中的任何一種。 最符合領域特性的審查者將佔據尾端位置(例如:規則 2 的impl+security以security-reviewer 結尾;規則 3 的impl+db則以-reviewer結尾,因為database-reviewer已在鏈條較早階段對 migration 進行了閘門控制)。測試與 建置步驟由各自的驗證器(分別為e2e-runner和建置解析器)進行門控,無需額外的審查員。

第三階段 — 壓縮任務描述

每個發出的 必須:

  • 具備自包含性(第一個代理程式無需開啟計畫文件)。
  • 以[Plan:#step-] 開頭。
  • 包含 1 至 3 項可驗證的驗收準則。
  • 僅當計畫為此步驟宣告了範圍守護條件(範圍外:...)時,才需包含該守護條件。須逐字繼承。若計畫中未包含範圍外聲明,則應完全省略該條款——切勿自行編造。
  • 字數須為 200–600 個字元;僅佔一行;嵌入的"須以\" 轉義;不得包含字面上的換行符。

第 4 階段 — 輸出

根據 ECC_MODE決定的格式輸出 Markdown。 輸出須貫徹單一格式 — 每個{ORCH_CMD}及每個代理名稱均須搭配第 0 階段對應的前綴進行渲染。請勿同時輸出兩種形式;渲染後的輸出中請勿包含「此為外掛程式格式」/「移除前綴」等指示。

具體渲染規則:

  • {ORCH_CMD}=插件模式下為/everything-claude-code:orchestrate,舊版模式下為/orchestrate。
  • {AGENT(name)}= 在plugin 模式下為everything-claude-code:, 在舊版模式下。
  • 概覽表格中的「Chain」欄位採用相同的{AGENT(name)}渲染方式。
  • 每個步驟的 bash 區塊僅包含可執行的命令。不包含# plugin 格式或 # legacy 格式的註解— 該格式是隱含的,且在整個輸出中保持一致。

輸出結構:

#Plan-Orchestrate 結果

**計畫**:``
**語言**:``
**ECC 模式**:``
**步驟**:
**範圍**:

## 步驟概覽

| # | 標題 | 標籤 | 鏈 |
|---|---|---|---|
| 1 | ... | 實作, 資料庫 | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
| ... | | | |

---

## 步驟 1 —

**意圖**:<1–3 sentences>
**標籤**:<a, b>
**鏈結依據**:<why this chain; which agent closes the loop>

```bash
{ORCH_CMD} custom "{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}" "[計畫:docs/foo.md#step-1]<compressed task description>; 驗收:<1–3 items>; 超出範圍:<…>"
```
</code></pre>
<blockquote>
<p>上方的<code>{ORCH_CMD}</code>和<code>{AGENT(...)}</code>標記描述了此技能在執行時所進行的替換。實際產出的 Markdown 內容包含已解析的字串,絕不會包含佔位符。</p>
</blockquote>
<p>在末尾追加一個「批次執行」區塊,將每個步驟的指令依序彙整,以便使用者能一次貼上所有指令。<strong>在僅顯示概覽的模式下</strong>(參見「大型計畫」邊界案例)<strong>請跳過批次區塊</strong>:當僅輸出概覽表格時,並無需彙整各步驟的指令。</p>
<h3>第 5 階段 — 自我檢查(在輸出前執行)</h3>
<ul>
<li><input disabled="" type="checkbox"> 每個鏈中的每個代理均來自目錄(在移除計畫中出現的任何<code>everything-claude-code:</code>前綴後;參見第 0 階段第 5 步)。</li>
<li><input disabled="" type="checkbox"> 已解析的<code>{ORCH_CMD}</code>以及每個已解析的<code>{AGENT(...)}</code>均採用<strong>相同</strong>的形式(<code>外掛程式或</code> <code>舊版形式</code>)——絕不會在同一輸出中混用。</li>
<li><input disabled="" type="checkbox"> 渲染後的輸出中不應殘留任何<code># 外掛程式形式</code>/<code># 傳統形式</code>註解,亦不應有「移除前綴」的指令。</li>
<li><input disabled="" type="checkbox"> 不會出現任何虛構的<code>--mode</code>/<code>--gate</code>/<code>--agents=...</code>欄位。</li>
<li><input disabled="" type="checkbox"> 每個任務描述均為單行、雙引號包圍,且其中的<code>"</code>已轉為 "。</li>
<li><input disabled="" type="checkbox"> 每個任務描述均以<code>[Plan:<path>#step-<id>]</code>開頭,並包含驗收條件(1–3 項)。僅當從計畫繼承時,才會出現「<code>範圍外:</code>」子句。</li>
<li><input disabled="" type="checkbox"> 在第 2 階段去重後,任何鏈中均不得有重複的代理。</li>
<li><input disabled="" type="checkbox"> 鏈長 ≤ 4。</li>
<li><input disabled="" type="checkbox"> 標記為<code>impl/refactor/migration 的</code>步驟以審查員類別的代理結尾(<code><lang>-reviewer</code>、<code>code-reviewer</code>、<code>security-reviewer</code> 或<code>database-reviewer</code>)。<code>test</code>和<code>build</code>除外 — 請參閱第二階段規則 10。</li>
<li><input disabled="" type="checkbox"> 標籤為零的步驟會發出「<code>code-reviewer</code>」,理由為「<code>無標籤匹配」;預設為僅審查鏈</code>。</li>
<li><input disabled="" type="checkbox"> 概覽表會列出計畫中的每個步驟,無論<code>--scope</code> 設定為何。</li>
<li><input disabled="" type="checkbox"> 每個步驟的詳細區塊數量與已解析的<code>--scope</code>相符(當<code>--scope=all</code> 時為完整計畫;<code>步驟:n</code> 為一個區塊;<code>範圍:a-b</code> 為<code>範圍</code>大小)。在僅概覽模式下,不會產生每個步驟的區塊,也不會產生批次區塊。</li>
</ul>
<h2>邊緣情況</h2>
<ul>
<li><strong>無明確步驟</strong>:優先採用 H2/H3 分割;若仍不明確,則報告「未偵測到結構化步驟」,並附上文件大綱,要求使用者確認是否依大綱執行。</li>
<li><strong>大型計畫(>1500 行)</strong>:進入<strong>僅概覽模式</strong>— 僅輸出概覽表,並請使用者在重新執行以取得詳細資訊前,先使用<code>--scope</code>縮小範圍。在此模式下,將跳過每步驟的詳細區塊以及「批次」執行區塊。</li>
<li><strong>步驟過於寬泛</strong>(例如「完成所有後端工作」):不要強行建立單一鏈。建議拆分為 N.a 和 N.b,並提出拆分方案。</li>
<li><strong>計畫中宣告代理程式</strong>(罕見):首先<strong>移除所有<code>everything-claude-code:</code>前綴,</strong>以取得原始目錄名稱(第 0 階段第 5 步),然後對照目錄進行驗證。替換無效的代理程式,並在「鏈結依據」下說明原因。原始名稱將在輸出時根據<code>ECC_MODE</code> 重新加上前綴。</li>
<li><strong>在<code>--lang=auto</code>無法選定首選語言的多語言專案中</strong>:將<code>lang</code> 設<code>為 unknown</code>;將 code-reviewer 解析為<code>code-reviewer</code>,並將 build-resolver 解析為<code>build-error-resolver</code>。請在「鏈結理由」中提及此備用方案。</li>
</ul>
<h2>範例</h2>
<h3>範例 1 — 外掛程式模式,Python 計畫</h3>
<p>輸入:</p>
<pre><code>plan-orchestrate @docs/plan/example-feature.md --lang=python
</code></pre>
<p>預期輸出節錄:</p>
<pre><code class="language-markdown">## 步驟 2 — 加密敏感的 UserProfile 欄位

**目標**:引入 SQLAlchemy 的 `EncryptedString` 類型,並在資料持久化前使用 AES-GCM 加密 `birth_datetime` / `location`;從環境變數載入金鑰。
**標籤**:實作、安全性、資料庫
**審查鏈邏輯**:此為涉及安全性的寫入路徑,因此由 `security-reviewer` 負責關閉審查鏈;`database-reviewer` 負責驗證 Alembic 遷移檔;`python-reviewer` 則負責檢查類型與 PEP 8 規範。

```bash
/everything-claude-code:orchestrate custom "everything-claude-code:tdd-guide,everything-claude-code:database-reviewer,everything-claude-code:python-reviewer,everything-claude-code:security-reviewer" “[計畫:docs/plan/example-feature.md#step-2] 實作 EncryptedString SQLAlchemy 類型,並遷移 UserProfile 的 birth_datetime/location 欄位;密鑰取自環境變數 APP_DB_KEY; 驗收標準:加密/解密往返測試通過;在空資料庫上,Alembic 升級/降級操作無錯誤;遷移後資料庫中無明文;範圍外:跨租戶個人資料共享邏輯"
```
</code></pre>
<h3>範例 2 — 傳統模式,相同步驟</h3>
<p>若偵測到<code>ECC_MODE=legacy,</code>則會將相同步驟發送為單一統一指令(輸出中任何位置均無插件前綴形式):</p>
<pre><code class="language-bash">/orchestrate custom "tdd-guide,database-reviewer,python-reviewer,security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] ..."
</code></pre>
<p>上述兩個範例說明了兩種不同環境下<strong>可能產生的兩種輸出結果</strong>。單次技能呼叫僅會產生其中一種,且為端到端的完整輸出。</p>
<h2>注意事項</h2>
<ul>
<li>僅限生成模式。切勿在此技能內部呼叫<code>/orchestrate</code>。</li>
<li>任務描述應與計畫文件的語言保持一致(代理名稱始終維持英文)。</li>
<li>除非使用者明確要求,否則請勿在輸出中插入「Co-Authored-By」行或表情符號。</li>
</ul>                                </div>
                                <div class="skilldetailsL1_skillmd">
                                    <a href="https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate" title="在 GitHub 上查看" target="_blank" rel="nofollow"
                                        aria-label="在 GitHub 上查看" class="skilldetails_toGitHub">
                                        <span>在 GitHub 上查看</span>
                                        <b></b>
                                    </a>
                                    <pre><code>---
name: plan-orchestrate
description: Reads a plan document, decomposes it into steps, designs a per-step agent chain from the ECC catalogue, and emits ready-to-paste /orchestrate custom prompts without executing them.
---

# Plan Orchestrate

Bridge a plan document to `/orchestrate custom` by emitting one ready-to-paste invocation per step. The skill is generative only — it never executes `/orchestrate`. The user pastes each line when ready.

## When to Activate

- User has a multi-step plan document (PRD, RFC, implementation plan) and wants to drive it through `/orchestrate`.
- User says "orchestrate this plan", "give me orchestrate prompts for each step", "compose chains for this plan".
- A step-by-step plan exists but the user does not want to manually pick agents per step.

Skip when:
- The work is one ad-hoc step → call `/orchestrate custom` directly.
- The plan is unreadable or empty. Lack of explicit numbering alone is not a skip condition — see the "No clear steps" edge case below.

## Inputs

```
<plan-doc-path> [--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:<n>|range:<a>-<b>] [--dry-run]
```

- `<plan-doc-path>` — required; relative or absolute path (`@docs/...` accepted).
- `--lang` — reviewer language variant; defaults to `auto` (detected from project).
- `--scope` — limits emitted steps; defaults to `all`.
- `--dry-run` — print decomposition + chain rationale only; do not emit final prompts.

## Authoritative `/orchestrate` shape (do not deviate)

```
{ORCH_CMD} custom "<agent1>,<agent2>,...,<agentN>" "<task description>"
```

Where `{ORCH_CMD}` is determined in Phase 0 (see below). The command string in the emitted output **always uses one concrete form** — never both, never a placeholder.

- `custom` is a sequential chain; each agent's HANDOFF feeds the next.
- Comma-separated agent list. No spaces preferred; one space tolerated.
- No `--mode` / `--gate` / `--agents=...` flags exist — never invent them.
- Agent names come from the catalogue in this skill. Embedded double quotes in the task description are escaped as `\"`.

## ECC install form and namespacing

Two install forms determine the prefix on **both** the slash command and every agent name. The two MUST stay in sync — one form per output, never mixed:

Let `<claude-home>` denote the Claude Code home directory: `~/.claude` on macOS/Linux, `%USERPROFILE%\.claude` on Windows. Resolve it the way the host platform resolves the user home directory (do not hardcode `~`).

| Form | Detection | `{ORCH_CMD}` | Agent name format |
|---|---|---|---|
| Plugin install (1.9.0+) | `<claude-home>/plugins/marketplaces/everything-claude-code/` exists | `/everything-claude-code:orchestrate` | `everything-claude-code:<name>` |
| Legacy bare install | Above absent; agent files under `<claude-home>/agents/` | `/orchestrate` | `<name>` |

Why this matters: under the plugin install, agents register as `everything-claude-code:tdd-guide`. Bare names force fuzzy matching, which fails intermittently under parallel calls. Under legacy, the prefixed forms are not registered and fail outright.

## Available agent catalogue (must pick from these)

General:
- `planner` — requirement restatement, risk decomposition, step planning
- `architect` — architecture, system design, refactor proposals
- `tdd-guide` — write tests → implement → 80%+ coverage
- `code-reviewer` — generic code review
- `security-reviewer` — security audit, OWASP, secret leakage
- `refactor-cleaner` — dead code, duplicates, knip-class cleanup
- `doc-updater` — documentation, codemap, README
- `docs-lookup` — third-party library API lookups (Context7)
- `e2e-runner` — end-to-end test orchestration
- `database-reviewer` — PostgreSQL schema, migration, performance
- `harness-optimizer` — local agent harness configuration
- `loop-operator` — long-running autonomous loops
- `chief-of-staff` — multi-channel triage (rarely a fit for plan steps)

Build error resolvers:
- `build-error-resolver` (generic) / `cpp-build-resolver` / `go-build-resolver` / `java-build-resolver` / `kotlin-build-resolver` / `rust-build-resolver` / `pytorch-build-resolver`

Code reviewers:
- `python-reviewer` / `typescript-reviewer` / `go-reviewer` / `rust-reviewer` / `cpp-reviewer` / `java-reviewer` / `kotlin-reviewer` / `flutter-reviewer`

A misspelled agent name fails `/orchestrate`. Cross-check against this list before emitting.

## How It Works

### Phase 0 — Detect ECC mode + language

1. Read `<plan-doc-path>`. If missing or empty, report and stop.
2. Detect ECC install form once and freeze it into `ECC_MODE`. Algorithm (run in order, stop at the first match):
   1. If `<claude-home>/plugins/marketplaces/everything-claude-code/` exists → `ECC_MODE=plugin`.
   2. Else if `<claude-home>/agents/` exists and contains at least one ECC agent file (e.g. `tdd-guide.md`, `code-reviewer.md`) → `ECC_MODE=legacy`.
   3. Else → default to `ECC_MODE=legacy` and emit a one-line warning at the top of the output: `> Warning: could not detect ECC install; defaulting to legacy form. If you use the plugin install, edit the prefixes manually.`
   4. If both markers exist (mixed install), `plugin` wins — the plugin namespace is the only one that resolves agent names without fuzzy matching.

   From this point on, every emitted line uses the matching prefix on **both** the slash command and every agent name. **Never emit both forms in the same output.**
3. Resolve `--lang`. When `auto`, run a polyglot-aware detection:
   - Probe markers: `pyproject.toml` / `uv.lock` / `requirements.txt` → python; `package.json` → typescript; `go.mod` → go; `Cargo.toml` → rust; `CMakeLists.txt` or top-level `*.cpp` → cpp; `pom.xml` / `build.gradle` (Java) → java; `build.gradle.kts` or top-level Kotlin → kotlin; `pubspec.yaml` → flutter.
   - **Polyglot tie-break**: if more than one marker matches, pick the language whose source files outnumber the others (count via `git ls-files`, excluding `vendor/`, `node_modules/`, `dist/`, `build/`, `.venv/`, generated files, and obvious test fixtures). On a tie or when no language exceeds 60% of source files, set `lang=unknown`.
   - No marker matched → set `lang=unknown`.
   - `lang=unknown` is a sentinel — it is **not** an agent name. Phase 2 rules 4 and 5 turn it into `code-reviewer` / `build-error-resolver` at chain composition time.
4. Detect a **PyTorch sub-profile**: when `lang=python` and any of `pyproject.toml` / `requirements.txt` / `uv.lock` declares a dependency on `torch`, set `pytorch=true`. This only affects `build` chain selection (Phase 2 rule below); the reviewer remains `python-reviewer`.
5. **Normalize any agent names declared in the plan**: if the plan text references agents by their plugin-prefixed form (e.g. `everything-claude-code:tdd-guide`), strip the prefix to get the bare catalogue name before validating or composing chains. Re-prefixing happens only at output time per `ECC_MODE` (Phase 4). Never let a pre-prefixed name flow into chain composition — it would double-prefix in plugin mode.

### Phase 1 — Decompose steps

Identify "step units" in priority order:

1. Explicit numbering: `## Step N` / `### Phase N` / `## N. ...` / top-level ordered list.
2. A "Step" column in a table.
3. `---`-separated blocks with verb-led headings.
4. Otherwise treat each H2 as one step.

Per step extract `id` (1-based), `title` (≤ 80 chars), `intent` (1–3 sentences), `tags`.

### Phase 2 — Tag and pick chain

Tag by intent (multi-tag allowed; chain built from primary + stacked secondaries):

Trigger words below are matched case-insensitively. Multilingual plans are supported by matching the word stems in any language as long as the meaning aligns with the listed English trigger words.

| Tag | Trigger words | Default chain |
|---|---|---|
| `design` | architecture, design, choose, evaluate, RFC | `planner,architect` |
| `plan` | plan, breakdown, milestone | `planner` |
| `impl` | implement, build, add, create, port | `tdd-guide,<lang>-reviewer` |
| `test` | test, coverage, e2e, integration | `tdd-guide,e2e-runner` |
| `refactor` | refactor, cleanup, dedupe, split | `architect,refactor-cleaner,<lang>-reviewer` |
| `migration` | migrate, upgrade, rewrite, port | `architect,tdd-guide,<lang>-reviewer` |
| `db` | schema, migration, index, SQL, Postgres, alembic, sqlmodel | `database-reviewer,<lang>-reviewer` |
| `security` | encrypt, auth, secret, OWASP, PII | `security-reviewer,<lang>-reviewer` |
| `build` | build, compile, lint failure, CI | `<lang>-build-resolver` (falls back to `build-error-resolver`) |
| `docs` | docs, readme, codemap, changelog | `doc-updater` |
| `lookup` | lookup, reference, API usage | `docs-lookup` |
| `review` | review, audit, verify | `<lang>-reviewer,code-reviewer` |
| `loop` | loop, autonomous, watchdog | `loop-operator` |

Chain composition rules:
1. **Primary tag selection**: when a step matches multiple tags, the **first one in table order** (top of the table = highest priority) is the primary; the rest are secondaries. Composition rules 2 and 3 below handle specific multi-tag combinations explicitly; otherwise, append secondary chains in tag table order.
2. `impl` + `security` → `tdd-guide,<lang>-reviewer,security-reviewer`.
3. `impl` + `db` → `tdd-guide,database-reviewer,<lang>-reviewer`.
4. **Deduplicate** the resulting chain (preserve first occurrence). E.g. `review` + `lang=unknown` would yield `code-reviewer,code-reviewer` after rule 5; deduplication collapses it to `code-reviewer`.
5. `<lang>-reviewer` resolves to `code-reviewer` when `lang=unknown`.
6. `<lang>-build-resolver` resolves to `build-error-resolver` when `lang=unknown`. **Special case**: if Phase 0 set `pytorch=true`, use `pytorch-build-resolver` for `build` chains regardless of `<lang>`. There is no `python-build-resolver`; `--lang=python` without `pytorch=true` resolves to `build-error-resolver`.
7. **Zero-tag steps**: if no trigger word matches, set chain to `code-reviewer` and write `no tag matched; default review-only chain` under "Chain rationale".
8. Chain length ≤ 4 after deduplication. If exceeded, drop weakest tag (`lookup` and `docs` first).
9. Do not pair `planner` and `architect` in an `impl` chain (token waste). Pair them only on `design` steps.
10. Steps tagged `impl`, `refactor`, or `migration` end with a **reviewer-class** agent — any of `<lang>-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`. The most domain-specific reviewer wins the tail position (e.g. rule 2's `impl+security` ends with `security-reviewer`; rule 3's `impl+db` ends with `<lang>-reviewer` because `database-reviewer` already gates the migration earlier in the chain). `test` and `build` steps are gated by their own validators (`e2e-runner` and the build resolver respectively) and do not require an additional reviewer.

### Phase 3 — Compress task description

Each emitted `<task description>` must:
- Be self-contained (the first agent does not need the plan document open).
- Start with `[Plan: <path>#step-<id>]`.
- Include 1–3 verifiable Acceptance criteria.
- Include a Scope guard (`Out of scope: ...`) **only if the plan declares one for this step**. Inherit verbatim. If the plan has no out-of-scope statement, omit the clause entirely — do not invent one.
- Be 200–600 characters; one line; embedded `"` escaped as `\"`; no literal newlines.

### Phase 4 — Output

Emit Markdown using **the form determined by `ECC_MODE`**. The output uses one form throughout — every `{ORCH_CMD}` and every agent name is rendered with the matching prefix from Phase 0. **Do not emit both forms; do not include "this is plugin form" / "strip the prefix" instructions in the rendered output.**

Concrete rendering rules:

- `{ORCH_CMD}` = `/everything-claude-code:orchestrate` under `plugin`, `/orchestrate` under `legacy`.
- `{AGENT(name)}` = `everything-claude-code:<name>` under `plugin`, `<name>` under `legacy`.
- The overview-table "Chain" column uses the same `{AGENT(name)}` rendering.
- Per-step bash blocks contain only the runnable command. **No `# plugin form` or `# legacy form` comments** — the form is implicit and uniform across the whole output.

Output structure:

````markdown
# Plan-Orchestrate Result

**Plan**: `<path>`
**Lang**: `<detected-or-given>`
**ECC mode**: `<plugin | legacy>`
**Steps**: <N>
**Scope**: <all | step:n | range:a-b>

## Steps overview

| # | Title | Tags | Chain |
|---|---|---|---|
| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
| ... | | | |

---

## Step 1 — <title>

**Intent**: <1–3 sentences>
**Tags**: <a, b>
**Chain rationale**: <why this chain; which agent closes the loop>

```bash
{ORCH_CMD} custom "{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}" "[Plan: docs/foo.md#step-1] <compressed task description>; Acceptance: <1–3 items>; Out of scope: <…>"
```
````

> The `{ORCH_CMD}` and `{AGENT(...)}` notation above describes the substitution this skill performs at runtime. The actual emitted Markdown contains the resolved strings, never the placeholders.

Append a final "Batch execution" block aggregating every step's command in order so the user can paste them all at once. **Skip the Batch block in overview-only mode** (see "Large plan" edge case): when only the overview table is being emitted, there are no per-step commands to aggregate.

### Phase 5 — Self-check (run before emitting)

- [ ] Every agent in every chain comes from the catalogue (after stripping any `everything-claude-code:` prefix that appeared in the plan; see Phase 0 step 5).
- [ ] Resolved `{ORCH_CMD}` and every resolved `{AGENT(...)}` use the **same** form (`plugin` or `legacy`) — never mixed in one output.
- [ ] No `# plugin form` / `# legacy form` annotations and no "strip the prefix" instructions remain in the rendered output.
- [ ] No invented `--mode` / `--gate` / `--agents=...` fields.
- [ ] Each task description is single-line, double-quoted, with embedded `"` escaped.
- [ ] Each task description begins with `[Plan: <path>#step-<id>]` and includes Acceptance (1–3 items). The `Out of scope:` clause is present only when inherited from the plan.
- [ ] No duplicate agent in any chain after Phase 2 dedup.
- [ ] Chain length ≤ 4.
- [ ] Steps tagged `impl`/`refactor`/`migration` end with a reviewer-class agent (`<lang>-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`). `test` and `build` are exempt — see Phase 2 rule 10.
- [ ] Zero-tag steps emit `code-reviewer` with the rationale `no tag matched; default review-only chain`.
- [ ] Overview table lists every step in the plan, regardless of `--scope`.
- [ ] Per-step detail block count matches the resolved `--scope` (full plan when `--scope=all`; one block for `step:n`; range size for `range:a-b`). In overview-only mode, no per-step blocks and no Batch block are emitted.

## Edge cases

- **No clear steps**: prefer H2/H3 splitting; if still ambiguous, report "no structured steps detected" with the document outline and ask the user to confirm running by outline.
- **Large plan (>1500 lines)**: enter **overview-only mode** — emit only the overview table and ask the user to narrow with `--scope` before re-running for details. In this mode, skip per-step detail blocks and skip the Batch execution block.
- **Step too broad** (e.g. "complete all backend work"): do not force a single chain. Suggest splitting into N.a and N.b and propose a split.
- **Plan declares agents** (rare): first **strip any `everything-claude-code:` prefix** to get the bare catalogue name (Phase 0 step 5), then validate against the catalogue. Replace invalid agents and explain under "Chain rationale". The bare name is re-prefixed at output time per `ECC_MODE`.
- **Polyglot project where `--lang=auto` cannot pick a winner**: set `lang=unknown`; reviewer resolves to `code-reviewer` and build resolver to `build-error-resolver`. Mention the fallback under "Chain rationale".

## Examples

### Example 1 — Plugin mode, Python plan

Input:
```
plan-orchestrate @docs/plan/example-feature.md --lang=python
```

Excerpt of expected output:
````markdown
## Step 2 — Encrypt sensitive UserProfile fields

**Intent**: Introduce an `EncryptedString` SQLAlchemy type and AES-GCM encrypt `birth_datetime` / `location` before persistence; load the key from an environment variable.
**Tags**: impl, security, db
**Chain rationale**: Security-sensitive write path, so `security-reviewer` closes the chain; `database-reviewer` validates the alembic migration; `python-reviewer` covers typing and PEP 8.

```bash
/everything-claude-code:orchestrate custom "everything-claude-code:tdd-guide,everything-claude-code:database-reviewer,everything-claude-code:python-reviewer,everything-claude-code:security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] Implement EncryptedString SQLAlchemy type and migrate UserProfile.birth_datetime/location columns; key from ENV APP_DB_KEY; Acceptance: encrypt/decrypt roundtrip tests pass; alembic upgrade/downgrade clean on empty DB; no plaintext in DB after migrate; Out of scope: cross-tenant profile sharing logic"
```
````

### Example 2 — Legacy mode, same step

If `ECC_MODE=legacy` were detected, the same step would be emitted as a single uniform command (no plugin-prefixed forms anywhere in the output):

```bash
/orchestrate custom "tdd-guide,database-reviewer,python-reviewer,security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] ..."
```

The two examples above illustrate **the two possible outputs** for two different environments. A single skill invocation produces only one of them, end to end.

## Notes

- Generative only. Never invoke `/orchestrate` from inside this skill.
- Match the language of the plan document for task descriptions (agent names always remain English).
- Do not insert "Co-Authored-By" lines or emoji in the output unless the user explicitly asks.
</code></pre>                                </div>
                            </div>

                        </div>
                        <script>
                            layui.use(function () {
                                var element = layui.element;
                                element.tab({
                                    headerElem: "#skilldetailsL1_header>button",
                                    bodyElem: "#skilldetailsL1_body>div",
                                });
                            });
                        </script>
                        <div class="skilldetailsL2">
                            <div class="skilldetailsL2_title">
                                <h2>所有檔案</h2>
                                <span>1 個檔案</span>
                            </div>
                                                        <div class="skillFiles">
                                <div class="skillFilesL">
                                    <b></b>
                                    <a href="https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate" title="plan-orchestrate.md" target="_blank"
                                        aria-label="plan-orchestrate.md"
                                        rel="nofollow">plan-orchestrate.md</a>
                                    <span>17.5k</span>
                                </div>
                                <a href="https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate" title="查看" target="_blank" aria-label="查看"
                                    rel="nofollow">查看</a>
                            </div>
                                                    </div>
                    </div>
                    <div class="skilldetailsR">
                        <div class="skilldetailsR1">
                            <div class="skilldetailsR1s">
                                <h2>安裝 plan-orchestrate</h2>
                                <div class="skilldetailsR1s_header" id="skilldetailsR1s_header">
                                    <button class="layui-this">
                                        <b></b>
                                        <span>下載 ZIP</span>
                                    </button>
                                    <button class="">
                                        <b></b>
                                        <span>Git Clone</span>
                                    </button>
                                </div>
                                <div class="skilldetailsR1s_body" id="skilldetailsR1s_body">
                                    <div class="skilldetailsR1s_body1 layui-show">
                                        <p>請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。</p>
                                        <a href="javascript:;" title="下載 ZIP" data-source="TeeN26C1ni2ZDZRkOJVh9w"
                                            aria-label="下載 ZIP" role="button" class="skill_downloadzip">
                                            <b></b>
                                            <span>下載 ZIP</span>
                                        </a>
                                    </div>
                                    <div class="skilldetailsR1s_body2">
                                        <p>複製儲存庫並將技能檔案複製到您的專案中。</p>
                                        <div class="skill_clone">
                                            <p>
                                                git clone https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate
# Copy SKILL.md to your .claude/skills/ directory                                            </p>
                                            <a href="javascript:;" title="複製" role="button" aria-label="複製"
                                                class="skill_clone_copy">
                                                <img src="/assets/images/prompt_word2RMs_p_btn.png"
                                                    alt="複製" />
                                                <span>複製</span>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="skilldetailsR1s_info">
                                    <span>快速設定: </span>
                                    將技能資料夾複製到 .claude/skills/
Claude 會自動偵測並使用該技能                                </div>
                                <div class="skilldetailsR1s_repository">
                                    <span>儲存庫</span>
                                    <a href="https://github.com/affaan-m/ECC/tree/main/skills/plan-orchestrate" title="affaan-m/ECC" target="_blank"
                                        aria-label="儲存庫" rel="nofollow">affaan-m/ECC</a>
                                </div>
                            </div>
                        </div>
                        <div class="skilldetailsR2">
                            <h2>相關技能</h2>
                            <div>
                                                                <div class="skilldetailsR2s">
                                    <a href="/zh-tw/skill/detail/airtableautomation.html" title="airtable-automation" aria-label="airtable-automation">airtable-automation</a>
                                    <div>
                                        <div class="skilldetailsR2s_time">
                                            <b></b>
                                            <span>更新時間                                                2026-06-29</span>
                                        </div>
                                        <button class="xix_star skill_datas"
                                            data-source="P_PqrAzxvKSebU4gaXatSw">
                                            <b></b>
                                            <span
                                                class="collectNums_P_PqrAzxvKSebU4gaXatSw">0</span>
                                        </button>
                                    </div>
                                </div>
                                                                <div class="skilldetailsR2s">
                                    <a href="/zh-tw/skill/detail/notionautomation.html" title="notion-automation" aria-label="notion-automation">notion-automation</a>
                                    <div>
                                        <div class="skilldetailsR2s_time">
                                            <b></b>
                                            <span>更新時間                                                2026-06-29</span>
                                        </div>
                                        <button class="xix_star skill_datas"
                                            data-source="yLOF7em0zgx36kG9EQmIAQ">
                                            <b></b>
                                            <span
                                                class="collectNums_yLOF7em0zgx36kG9EQmIAQ">0</span>
                                        </button>
                                    </div>
                                </div>
                                                                <div class="skilldetailsR2s">
                                    <a href="/zh-tw/skill/detail/seoprogrammatic.html" title="seo-programmatic" aria-label="seo-programmatic">seo-programmatic</a>
                                    <div>
                                        <div class="skilldetailsR2s_time">
                                            <b></b>
                                            <span>更新時間                                                2026-06-29</span>
                                        </div>
                                        <button class="xix_star skill_datas"
                                            data-source="qrlDZwmv4vNLPwqrODKcOQ">
                                            <b></b>
                                            <span
                                                class="collectNums_qrlDZwmv4vNLPwqrODKcOQ">0</span>
                                        </button>
                                    </div>
                                </div>
                                                                <div class="skilldetailsR2s">
                                    <a href="/zh-tw/skill/detail/revops.html" title="revops" aria-label="revops">revops</a>
                                    <div>
                                        <div class="skilldetailsR2s_time">
                                            <b></b>
                                            <span>更新時間                                                2026-06-29</span>
                                        </div>
                                        <button class="xix_star skill_datas"
                                            data-source="ZDIT-veTOzkFQQ0eUEoT-g">
                                            <b></b>
                                            <span
                                                class="collectNums_ZDIT-veTOzkFQQ0eUEoT-g">0</span>
                                        </button>
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <footer>
  <div class="footer">
    <div class="footer1">
      <div class="footer11">
        <span class="footer11_title">熱門人工智能工具</span>
        <div class="footer11info">
                    <a href="/zh-tw/tool/ai-clothes-remover.html" aria-label="AI Clothes Remover" class="footer11s">AI Clothes Remover</a>
                    <a href="/zh-tw/tool/deepnude-generator.html" aria-label="DeepNude generator" class="footer11s">DeepNude generator</a>
                    <a href="/zh-tw/tool/purechat.html" aria-label="PureChat" class="footer11s">PureChat</a>
                  </div>
      </div>
      <div class="footer12">
        <span class="footer11_title">有潛力的人工智能工具</span>
        <div class="footer11info">
                    <a href="/zh-tw/tool/idea-box-ai-tool.html" aria-label="Name Idea Box" class="footer11s">Name Idea Box</a>
                    <a href="/zh-tw/tool/qi-jing-ai-ai-tool.html" aria-label="奇境 AI" class="footer11s">奇境 AI</a>
                    <a href="/zh-tw/tool/ezaudio-ai-tool.html" aria-label="EZAudio" class="footer11s">EZAudio</a>
                  </div>
      </div>
      <div class="footer13">
        <span class="footer11_title">查看詳情</span>
        <div class="footer11info">
                    <a href="/zh-tw/ainews/ai-hosts-notebooklm-podcast-interviews.html" aria-label="AI寄主Notebooklm播客現已上" class="footer11s">AI寄主Notebooklm播客現已上</a>
                    <a href="/zh-tw/ainews/corporate-ai-adoption-leveling-ramp-data.html" aria-label="Ramp 數據顯示,企業對 AI 的採納已進入停滯期" class="footer11s">Ramp 數據顯示,企業對 AI 的採納已進入停滯期</a>
                    <a href="/zh-tw/ainews/microsoft-unveils-businessfocused-copilot-surface-devices-powered-intel.html" aria-label="Microsoft推出了以商業為中心的副吉洛特+地表設備" class="footer11s">Microsoft推出了以商業為中心的副吉洛特+地表設備</a>
                  </div>
      </div>
      <div class="footer4">
        <span class="footer11_title">關注</span>
        <div class="footer11info">
          <a href="javascript:;" class="footer11s">聯繫我們</a>
          <a href="mailto:admin@xix.ai" role="button" aria-label="聯繫我們" class="footer11s">admin@xix.ai</a>
          <a href="/sitemap.xml" class="footer11s" aria-label="SiteMap">SiteMap</a>
        </div>
      </div>
    </div>
    <span class="footer2"></span>
    <div class="footer3">Copyright ©2025 xix.ai All Rights Reserved.</div>
  </div>
</footer>
<div class="ai_cookie" style="display: none">
      <div class="ai_cookie_b">
        <div class="icon_f ai_cookie_close">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-guanbi1"></use>
          </svg>
        </div>
        <p>
          點擊「接受所有Cookie」,即表示您同意在您的裝置上儲存Cookie,以增強網站導覽、分析網站使用情況並協助我們的行銷工作。<span>隱私權政策</span> 通知        </p>
        <div class="cokiesetRight">
          <a href="javascript:;" class="cokieA ai_cookie_open"  role="button" aria-label="Cookie 設定">Cookie 設定</a>
          <a href="javascript:;" class="cokieA RefuseCookies" role="button" aria-label="全部拒絕">全部拒絕</a>
          <a href="javascript:;" class="cokieA cokieAall" role="button" aria-label="接受所有 Cookie">接受所有 Cookie</a>
        </div>
      </div>
    </div>
    <div class="ai_cookieSettings" style="display: none">
      <div class="layuiDivcokie layui-layer-wrap" id="layuiDivcokie" style="display: block">
        <div class="cokielayTop dlyflx">
          <img src="/assets/images/logo.png" alt="" />
          <div class="icon_f ai_cookie_close1">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-guanbi"></use>
            </svg>
          </div>
        </div>
        <hr />
        <div class="cokielayDown dlyflx">
          <p class="cokielaydTop">隱私偏好設定</p>
          <p class="cokielaydDesc">
            當您訪問任何網站時,網站可能會在您的瀏覽器中存儲或檢索信息,主要以Cookie的形式。這些信息可能與您、您的偏好或設備有關,主要用於使網站按您期望的方式運行。這些信息通常不會直接識別您的身份,但可以為您提供更個性化的網絡體驗。由於我們尊重您的隱私權,您可以選擇不允許某些類型的Cookie。點擊不同的類別標題以了解更多信息並更改我們的默認設置。但是,阻止某些類型的Cookie可能會影響您對網站的體驗以及我們能夠提供的服務。 <a href="#" title="隱私權政策" aria-label="隱私權政策"><span>隱私權政策</span></a> <b>聲明</b>          </p>

          <div class="cokielayDivdown">
            <p class="coklaydownP">管理偏好設定</p>
            <ul class="cokidownUl">
              <li class="cokidownli dlyflx" style="padding: 25px 0px 25px">
                <div class="ckdTops">
                  <div class="ckdLeft">
                    <div class="icon_f">
                      <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-add"></use>
                      </svg>
                      <svg class="icon icon_active" aria-hidden="true">
                        <use xlink:href="#icon-add1"></use>
                      </svg>
                    </div>
                    <p class="ckdlipmid">嚴格必要Cookie</p>
                  </div>
                  <p class="ckdlipr">始終啟用</p>
                </div>
                <p class="ckdDowns">
                  這些Cookie是網站正常運行所必需的,無法在我們的系統中關閉。它們通常僅在您執行服務請求操作時設定,例如設定隱私偏好、登錄或填寫表單。您可以將瀏覽器設定為阻止這些Cookie或就這些Cookie向您發出警報,但網站的某些部分屆時將無法正常工作。這些Cookie不會存儲任何個人身份識別信息。                </p>
              </li>
            </ul>
          </div>
        </div>
        <div class="cklyBtn">
          <a href="javascript:;" role="button" aria-label="接受所有 Cookie" class="active cokieAall">接受所有 Cookie</a>
        </div>
      </div>
      <script>
        $(document).on("click", ".ai_cookie_close", function () {
          $(".ai_cookie").hide();
        });
        $(document).on("click", ".ai_cookie_close1", function () {
          $(".ai_cookieSettings").hide();
        });
        $(document).on("click", ".ai_cookie_open", function () {
          $(".ai_cookieSettings").show();
        });
        $(document).on("click", ".ckdLeft", function () {
          var $li = $(this).closest("li"); 
          var $downs = $li.find(".ckdDowns"); 
          var $iconBox = $(this).find(".icon_f"); 

         
          $downs.slideToggle(200, function () {
            if ($downs.is(":visible")) {
              $iconBox.find(".icon").hide();
              $iconBox.find(".icon_active").show();
            } else {
              $iconBox.find(".icon").hide();
              $iconBox.find(".icon").first().show(); 
            }
          });
        });     
      </script>
    </div>
<link rel="stylesheet" type="text/css" href="https://accounts.google.com/gsi/style">
<div class="login_tab">
  <div class="login_mainC">
    <div class="login_tab_top">
      <div class="login_tab_top1">
        <a href="javascript:;" role="tab" aria-label="登入" aria-selected="true" class="login_tab_top1a ">登入</a>
        <a href="javascript:;" role="tab" aria-label="註冊" aria-selected="false" class="login_tab_top2a">註冊</a>
      </div>
      <div class="login_tab_top2">
        <a href="javascript:;"><img src="/assets/images/login_mainC_top_m_img.png" alt=""></a>
      </div>

    </div>
    <div class="forms_google">
      <div id="g_id_signin"></div>
    </div>
    <div class="forms_or">
      <div class="forms_line"></div>
      <span>OR</span>
      <div class="forms_line"></div>
    </div>
    <div class="login_tab_bottom">
      <div class="login_tab_top1a_bottom">

        <div class="login_form ">
          <div class="login_forms">
            <img src="/assets/images/login_email.png" alt="郵箱">
            <input type="text" placeholder="請填寫您的郵箱地址" class="login_forms_email">
            <span></span>
          </div>
          <div class="login_forms">
            <img src="/assets/images/login_password.png" alt="密碼">
            <input type="password" placeholder="請輸入您的密碼" class="login_forms_password">
            <i style="cursor: pointer;" class="layui-icon layui-icon-eye-invisible toggle-password"
              id="toggleLoginPassword"></i>
            <span></span>
          </div>
          <div class="login_forms forms_code1">
            <input type="text" placeholder="請輸入圖形驗證代碼"
              class="login_forms_captcha">
            <img src="" alt="請輸入圖形驗證代碼" class="login-js-refresh-captcha">
            <span></span>
          </div>
          <div class="login_forms_bottom">
            <label class="login_remember">
              <input type="checkbox" aria-label="記住我">
              <span>記住我</span>
            </label>
            <a href="/zh-tw/account/forgetPassword.html" aria-label="修改密碼" class="login_forget">忘記密碼?</a>
          </div>
          <a href="javascript:;" type="button" role="button" aria-label="登入" id="login_button" class="login_button">登入</a>

        </div>
      </div>
      <div class="login_tab_top2a_bottom">
        <div class="login_form">
          <div class="login_forms">
            <img src="/assets/images/login_email.png" alt="郵箱">
            <input type="text" placeholder="請填寫您的郵箱地址" class="register_forms_email">
            <span></span>
          </div>
          <div class="login_forms">
            <img src="/assets/images/login_password.png" alt="密碼">
            <input type="password" placeholder="請輸入您的密碼" class="register_forms_password">
            <i style="cursor: pointer;" class="layui-icon layui-icon-eye-invisible toggle-password"
              id="toggleRegisterPassword"></i>
            <span></span>
          </div>
          <div class="login_forms forms_code1">
            <input type="text" placeholder="請輸入圖形驗證代碼"
              class="register_forms_captcha">
            <img src="" alt="請輸入圖形驗證代碼" class="register-js-refresh-captcha" id="register_captcha">
            <span></span>
          </div>
          <div class="login_forms">
            <input type="text" class="verify-code-input" placeholder="請輸入驗證代碼">
            <button id="verifyCodeBtn" class="verify-code-btn" data-text="獲取驗證代碼">獲取驗證代碼</button>
            <span></span>
          </div>
          <a href="javascript:;" role="button" aria-label="註冊" class="login_button" id="register_button">註冊</a>
        </div>
      </div>

    </div>
  </div>
</div>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script>
  $(document).ready(function () {
    LoginRegister.init({
      selectors: {
        email: {
          login: '.login_forms_email',
          register: '.register_forms_email'
        },
        password: {
          login: '.login_forms_password',
          register: '.register_forms_password'
        },
        captcha: {
          login: '.login_forms_captcha',
          register: '.register_forms_captcha',
          verify: '.verify-code-input'
        },
        buttons: {
          login: '#login_button',
          register: '#register_button',
          verifyCode: '#verifyCodeBtn'
        },
        tabs: {
          login: '.login_tab_top1a',
          register: '.login_tab_top2a',
          close: '.login_tab_top2 a'
        }
      },
      messages: {
        email: "郵箱格式不正確",
        password: {
          empty: "請輸入您的密碼",
          invalid: "密碼必須是6-18個字符,並且同時包含字母和數字"
        },
        captcha: "請輸入圖形驗證代碼",
        verifyCode: "請輸入驗證代碼",
        operationInProgress: "正在進行中,請等待",
        unexpectedError: "發生了一個意外錯誤,程序猿正在緊急處理中"
      },
      urls: {
        login: "/zh-tw/account/dologin.html",
        register: "/zh-tw/account/register.html",
        getMailSign: "/zh-tw/account/getMailSign",
        sendMail: "/zh-tw/account/registerSendMail.html",
        redirctUrl:'pc'
      }
    });
  });
  function initializeGoogleSignIn() {
    if (typeof google === 'undefined' || !google.accounts) {
      setTimeout(initializeGoogleSignIn, 100);
     
      return;
    }

    google.accounts.id.initialize({
      client_id: "294584378011-s53466qiuig7d30tcqrpjv1ue3ni2gun.apps.googleusercontent.com",
      callback: handlePCCredentialResponse,
      auto_select: false,
      locale: 'zh-tw',
      
    });
    
    google.accounts.id.renderButton(
      document.getElementById("g_id_signin"),
      {
        theme: "outline",
        size: "large",
        type: "standard",
        shape: "rectangular",
        logo_alignment: "left",
        text: "signin_with",
        width: 400,
        locale: 'zh-tw',
      }
    );
    
  }
  document.addEventListener('DOMContentLoaded', initializeGoogleSignIn);
</script>
  <!-- Google tag (gtag.js) -->
  <script  async src="https://www.googletagmanager.com/gtag/js?id=G-LN407DS0B4"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
  
    gtag('config', 'G-LN407DS0B4');
  </script>
  <script src="/kukukuwl.js"   type="text/javascript"></script>
 <a href="javascript:void(0);" class="totop" role="button" aria-label="回到頂部"><img src="/assets/images/totop.png" alt="" /></a>
        <script>
            layui.use(function () {
                var element = layui.element;
                element.tab({
                    headerElem: "#skilldetailsR1s_header>button",
                    bodyElem: "#skilldetailsR1s_body>div",
                });
            });
            function initSkillCloneCopy() {
                $(document)
                    .off("click.skillCloneCopy")
                    .on("click.skillCloneCopy", ".skill_clone .skill_clone_copy", function (e) {
                        e.preventDefault();

                        var $btn = $(this);
                        var $img = $btn.find("img");

                        var text = $.trim($btn.siblings("p").text());

                        var $temp = $("<textarea>");
                        $("body").append($temp);
                        $temp.val(text).select();

                        try {
                            document.execCommand("copy");

                            // 切换成功图标
                            $img.attr("src", "/assets/images/prompt_word2RMs_p_btn_ok.png");
                            $btn.addClass("active");
                            // 清除上一次定时器
                            clearTimeout($btn.data("copyTimer"));

                            // 3秒后恢复原图
                            var timer = setTimeout(function () {
                                $img.attr("src", "/assets/images/prompt_word2RMs_p_btn.png");
                                $btn.removeClass("active");
                            }, 3000);

                            $btn.data("copyTimer", timer);
                        } catch (err) {
                            alert("复制失败");
                        }

                        $temp.remove();
                    });
            }

            function initSkilldetailsFixed() {
                var $box = $(".skilldetailsR1");
                if (!$box.length) {
                    return;
                }
                var fixedTop = 20;
                var topOffset = $box.offset().top;
                var boxHeight = $box.outerHeight();
                var $placeholder = $("<div></div>").height(boxHeight).hide();
                $box.before($placeholder);
                function handleFixed() {
                    if ($(window).width() <= 1024) {
                        $placeholder.hide();
                        $box.css({
                            position: "",
                            top: "",
                            width: "",
                            zIndex: "",
                        });
                        return;
                    }
                    var scrollTop = $(window).scrollTop();
                    if (scrollTop >= topOffset - fixedTop) {
                        $placeholder.show();
                        $box.css({
                            position: "fixed",
                            top: fixedTop + "px",
                            width: $placeholder.width() + "px",
                            zIndex: 100,
                        });
                    } else {
                        $placeholder.hide();
                        $box.css({
                            position: "",
                            top: "",
                            width: "",
                            zIndex: "",
                        });
                    }
                }
                $(window).on("scroll.skilldetailsFixed resize.skilldetailsFixed", handleFixed);
                handleFixed();
            }
            function initSkilldetailsExpand() {
                $(".skilldetailsL_p").each(function () {
                    var $item = $(this);

                    $item.find(".skilldetailsL_p_expand").text($item.hasClass("active") ? "...展開全部" : "隱藏");
                });

                $(document)
                    .off("click.skilldetailsExpand")
                    .on("click.skilldetailsExpand", ".skilldetailsL_p_expand", function (e) {
                        e.preventDefault();

                        var $parent = $(this).closest(".skilldetailsL_p");

                        if ($parent.hasClass("active")) {
                            $parent.removeClass("active");
                            $(this).text("隱藏");
                        } else {
                            $parent.addClass("active");
                            $(this).text("...展開全部");
                        }
                    });
            }

            function checkFollow() {
                let dataSources = [];
                $('button.skill_datas').each(function () {
                    let source = $(this).data('source');
                    if (source) {
                        dataSources.push(String(source).trim());
                    }
                });
                dataSources = [...new Set(dataSources)];
                if (dataSources.length === 0) {
                    return;
                }
                $.post('/api/user/FindSkillFollow', {
                    source: dataSources
                }, function (res) {
                    if (res.code == 1 && res.data.length > 0) {
                        res.data.forEach(function (id) {
                            $('button.skill_datas[data-source="' + id + '"]').addClass('active');
                        });
                    }
                }, 'json');
            }
            $(function () {
                checkFollow();
                initSkillCloneCopy();
                initSkilldetailsFixed();
                initSkilldetailsExpand();
            });
            $(document).on('click', 'button.skill_datas', function (e) {
                e.preventDefault();
                const that = $(this);
                let source = that.data('source');
                if (!source || source === undefined || !CommonUtils.checkLogin()) return false;
                layer.load(2, {
                    shade: [0.3, "#000"],
                    time: 0,
                });
                var path = "/user/followSkill";
                var realPath = CommonUtils.getRealPath(path);
                $.post(realPath, { source: source }, function (result) {
                    layer.closeAll();
                    CommonUtils.showMsg(result.msg, result.code);
                    if (result.code == 1) {
                        var values = result.data.data_source;
                        var count = result.data.count;
                        var collected = result.data.collected;
                        var elements = $(".collectNums_" + values);
                        if (elements.length > 0) {
                            elements.each(function () {
                                $(this).parents('button').toggleClass('active', collected);
                                $(this).text(count);
                            });
                        }
                    }
                })
            })

            $(document).on('click', '.skill_downloadzip', function (e) {
                e.preventDefault();
                const url = $(this).data("source");
                if (!url) return;
                window.open("/api/index/download_zip?source=" + encodeURIComponent(url), "_blank");
            })

        </script>
    </body>

</html>