Communitygithub.com

drydock(乾塢)

在任何儲存庫中鋪設船廠(shipyard)共享骨架——在五個表面(CLAUDE.md、skills、design-system、mcp/cli、shared context)建立四大支柱(Context、Rules、Tools、Standards),讓每個開發人員和 AI 代理都繼承相同的設計語言,任何人都能交付。每個儲存庫執行一次;使用 --check 重新執行以稽核漂移。

drydock(乾塢) 是什麼?

Drydock 是一個 AI 代理技能,用於在任何程式碼儲存庫中初始化名為「船廠」(shipyard)的共享開發框架。這項技能建立了 Context(背景)、Rules(規則)、Tools(工具)與 Standards(標準)四大支柱,並將其對應到五個具體表面:CLAUDE.md、技能目錄、設計系統、MCP/CLI 設定檔以及共享背景文件。每次執行 drydock 不會覆寫現有文件,而是先偵測哪些表面已存在,再根據協定的文件語言(documentLanguage)填充缺失的種子檔案。支援多語言(英文、簡體中文、繁體中文),並透過前端 YAML 金鑰做語言決策。此外,drydock 會避免碰觸已初始化的儲存庫(改用 --check 稽核),並在 scaffold 前向使用者詢問無法自動偵測的項目(如技術棧、是否有 UI、問題追蹤器位置)。此技能適用於需要人類與 AI 代理協同開發的儲存庫,確保知識從文件而非聊天歷史繼承。支援 Claude Code、OMC 等使用 SKILL.md 環境的代理平台。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Yeachan-Heo/oh-my-claudecode/tree/main/skills/drydock

在你喜歡的 AI 中提問

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

說明文件

drydock(乾塢) 是做什麼的?

在船廠鋪下龍骨:一個儲存庫,一個共享骨架,每個貢獻者都繼承它。此技能為環境搭建骨架,將「人人都能交付」轉變為「人人都用同一套設計語言交付」——它會建立五個表面,以最低限度填入種子,將它們連接到負責填充的流程(launch 寫入 CONTEXT/ADR;launch C5 沈積和程式碼審查沈積標準),並回報哪些已存在、哪些已建立,以及哪些刻意保持空白。

四大支柱及其實際存放位置:

支柱表面
Context(共享背景)CONTEXT.md(詞彙表)+ docs/business/ + docs/adr/ + OMC wiki
Rules(邊界)CLAUDE.md(精簡入口:慣例、原則、索引)+ docs/standards/
Tools(可組合能力).omc/skills/ + .mcp.json + scripts/
Standards(驗船協會)design-system/(設計 Token、元件、模式)+ docs/standards/

隱喻地圖:船廠是共享設施;驗船協會(docs/standards/ + design-system/)制定船隻必須通過的規則才能適航;乾塢鋪下龍骨;launch 交付船隻。

使用時機

  • 開始一個人類與代理都會在上面開發的儲存庫
  • 一個儲存庫,知識只存在於人腦和聊天記錄中,而非檔案中
  • 入職:新夥伴或新代理應透過閱讀來繼承背景,而非發問

不使用時機

  • 沒有協作者的拋棄式原型
  • 已執行此骨架的儲存庫(改用 --check)

工作流程

1. 偵測(絕不覆寫)

在寫入任何內容前盤點現有項目:

  • CLAUDE.md 是否存在?AGENTS.md 是否存在?(規則:若任一存在,則在原地擴充它;建立缺少的那個為指向另一個的單行指標;絕不同時建立兩個全新檔案)
  • CONTEXT.md、docs/adr/、docs/standards/、docs/business/、design-system/、.omc/skills/、.mcp.json、scripts/、.gitattributes ——哪些存在,哪些缺失?
  • OMC 是否已安裝?——僅在 OMC session 內執行時值得檢查;在 OMC 外部執行時則靜默跳過此檢查(骨架在 OMC 有無的情況下皆可運作)

先回報地圖,然後採取行動。

2. 決定文件語言,然後僅詢問偵測無法回答的事項

生成骨架檔案的文件語言是由檔案支援的決定,而非對話狀態。請嚴格使用以下合約:

{
  "schemaVersion": 1,
  "authority": { "path": "CONTEXT.md", "frontmatterKey": "documentLanguage" },
  "canonicalSources": ["CLAUDE.md", "README.md"],
  "askOn": ["missing", "mixed", "conflict", "low-confidence", "invalid-explicit", "script-ambiguous"],
  "tagPattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|[0-9]{3}))?$",
  "scriptVariants": ["zh-Hans", "zh-Hant"],
  "seedCompanionPrefixes": { "en": "en", "zh-Hans": "zh-Hans", "zh-Hant": "zh-Hant" },
  "stableTokens": [
    "CONTEXT.md", "documentLanguage", "/oh-my-claudecode:launch", "--serial",
    "plan", "execute", "review", "verify", "blockedBy", "blocked_by",
    "pending", "in_progress", "completed", "failed", "ready-for-agent",
    "id", "name", "description", "triggers", "mcpServers", "```",
    "<Project>", "<term>", "<feature-slug>"
  ]
}

決策順序:

  1. 當前呼叫中有明確的人類選擇且有效時,則使用該選擇。將其正規化為穩定的 BCP-47 風格標籤:語言小寫、書寫系統首字大寫、地區大寫。無效的明確輸入必須詢問一次,而非猜測。
  2. 否則,從 CONTEXT.md 頂部的 YAML frontmatter 讀取 documentLanguage。一個有效且無書寫系統歧義的標籤在全新的 Drydock 與 Launch 呼叫中具有權威性。若持久的標籤是裸 zh 或僅地區的繁體/簡體中文,則在此權威層級詢問一次;絕不以來源推論繞過它。
  3. 若標記不存在或無效,則依序檢查規範來源:CLAUDE.md,然後 README.md。僅在每個可用來源都有一種明確的主要語言,且所有可用來源都同意同一個正規化標籤時才進行推論。當其他來源缺失或為空時,一個明確的來源就足夠。
  4. 中文必須解析為明確的書寫系統限定標籤:zh-Hans 或 zh-Hant(可選地區後綴)。裸 zh 和僅地區的中文標籤是書寫系統歧義的,必須詢問一次,而非選擇附屬版本。附屬版本的選擇使用最長的語言/書寫系統前綴:zh-Hans-* 選擇 zh-Hans 附屬版本,zh-Hant-* 選擇 zh-Hant 附屬版本;將完整的正規化標籤(例如 zh-Hans-CN)保留在 CONTEXT.md 中。
  5. 缺少可用來源、混合語言內容、衝突標籤、低信賴度推論、無效明確輸入,或書寫系統歧義的中文,必須觸發一次批次語言問題。不要猜測。若沒有可用的答案,則在寫入本地化產物之前停止。
  6. 在 scaffold 之前,將解析出的標籤寫入 CONTEXT.md 中確切的穩定 frontmatter 金鑰 documentLanguage(建立或擴充其 frontmatter,且不翻譯該金鑰)。這個可見的檔案是初始化報告的語言權威;不建立任何 daemon、隱藏分類帳或執行時期狀態。

只有散文和使用者面對面的標籤/可本地化值會跟隨所選語言;結構化金鑰保持語言穩定。保持路徑、斜線指令、旗標、程式碼圍籬、佔位符、frontmatter 金鑰與機器語義值、YAML/JSON 金鑰、生命週期 Token、狀態列舉、ID、blockedBy、公開團隊 blocked_by,以及解析器/控制 Token 的位元組穩定。

語言解析後,再詢問剩餘的問題:

  • 套件/技術棧(用於標準和設計系統種子)
  • 此儲存庫是否有 UI?(無 UI → design-system/ 建立為附說明的存根,或應要求跳過)
  • 問題追蹤器位置(GitHub / GitLab / local .scratch/)——V1 版 harbor intake 僅支援 GitHub;同時記錄 maintainer 的 intake 溝通權威(問題評論、標籤變更)——由 navigator 的地圖 home 與 harbor 的 intake 佇列消費

3. Scaffold(建立缺少的表面——種子以文件語言呈現)

CLAUDE.md                      # 精簡入口——見種子 A
CONTEXT.md                     # 詞彙表——見種子 B
.gitattributes                 # * text=auto eol=lf  (消除 Windows 上的 CRLF 警告噪音)
docs/adr/0001-adopt-shipyard-harness.md
docs/standards/architecture.md # 種子 C
docs/standards/data.md
docs/standards/process.md
docs/business/README.md        # 種子 D
design-system/README.md        # 種子 E(僅 UI 儲存庫;否則為存根)
design-system/tokens/README.md
.omc/skills/README.md          # 種子 F
.mcp.json                      # {"mcpServers": {}}
scripts/README.md

種子範例是參考附屬版本,而非合併負載。解析 documentLanguage 後,僅選取一個附屬版本;不要從另一個附屬版本重複輸出標題或標籤。使用最長匹配的語言/書寫系統前綴:en-* 使用英文,zh-Hans-* 使用簡體中文,zh-Hant-* 使用繁體中文,而種子 B 將完整的解析標籤寫入 documentLanguage。對於任何其他有效標籤,將英文標準附屬版本翻譯一次,同時保留上述每個穩定 Token。

在生成種子散文之前,使用 agent-doc-discipline 工具調用並套用其規則;僅當每個規則都是可檢查的且帶有原因,每個表面無需聊天記錄即可自描述,以及引用來源而非假定來源時,種子散文才算準備就緒。夥伴或代理應能僅透過閱讀就根據種子內容採取行動。

種子 A — CLAUDE.md,en(精簡入口;若檔案存在則在原地擴充):

# <Project> — Agent & Human Shipyard

## Project conventions
- <language/framework/package manager/naming — list what matters, skip the rest>

## Architecture principles
- <the 3-5 principles most often violated in this project>

## Standards index (full text in docs/standards/)
- Architecture: docs/standards/architecture.md
- Data: docs/standards/data.md
- Process: docs/standards/process.md

## Decision records (full text in docs/adr/; load-bearing ones listed here)
- ADR-0001: adopt shipyard harness

## Shared background
- Glossary: CONTEXT.md | Business knowledge: docs/business/ | Decision context: docs/adr/

## Agent guide
- Delivery follows the canonical workflow plan → execute → review → verify; `/oh-my-claudecode:launch` is an optional governed delivery pipeline (opt-in, invoke explicitly)
- On term conflicts CONTEXT.md wins; new terms are recorded the moment they settle
- Reusable capability goes to .omc/skills/; UI patterns go to design-system/

種子 A — zh-Hans 附屬版本(結構一致,二選一按文件語言呈現):

# <Project> — Agent & Human Shipyard

## 项目约定
- <language/framework/package manager/naming — list what matters, skip the rest>

## 架构原则
- <the 3-5 principles most often violated in this project>

## 规范索引(全文在 docs/standards/)
- 架构规范: docs/standards/architecture.md
- 数据规范: docs/standards/data.md
- 流程规范: docs/standards/process.md

## 决策记录(全文在 docs/adr/,此处只列 load-bearing 的)
- ADR-0001: adopt shipyard harness

## 共享背景
- 术语: CONTEXT.md | 业务知识: docs/business/ | 决策背景: docs/adr/

## Agent 指南
- 交付遵循 canonical 工作流 plan → execute → review → verify;`/oh-my-claudecode:launch` 是可选的受治理交付管道(opt-in,需要时显式调用)
- 术语冲突以 CONTEXT.md 为准;新术语当场补录
- 可复用能力沉淀到 .omc/skills/;UI 模式沉淀到 design-system/

種子 A — zh-Hant 附屬版本(結構一致,只渲染此版本):

# <Project> — Agent & Human Shipyard

## 專案約定
- <language/framework/package manager/naming — list what matters, skip the rest>

## 架構原則
- <the 3-5 principles most often violated in this project>

## 規範索引(全文在 docs/standards/)
- 架構規範: docs/standards/architecture.md
- 資料規範: docs/standards/data.md
- 流程規範: docs/standards/process.md

## 決策記錄(全文在 docs/adr/,此處只列 load-bearing 項目)
- ADR-0001: adopt shipyard harness

## 共享背景
- 詞彙: CONTEXT.md | 業務知識: docs/business/ | 決策背景: docs/adr/

## Agent 指南
- 交付遵循 canonical 工作流 plan → execute → review → verify;`/oh-my-claudecode:launch` 是可選的治理交付管道(opt-in,必須明確呼叫)
- 術語衝突以 CONTEXT.md 為準;新術語確定時立即補錄
- 可重用能力沉澱到 .omc/skills/;UI 模式沉澱到 design-system/

種子 B — CONTEXT.md(穩定的 frontmatter 金鑰是語言權威):

en:

---
documentLanguage: en
---

# Glossary

One entry per term: definition, boundaries, one resolved ambiguity. Agents write here the moment a term is settled. Vocabulary here is law for all specs, tickets, and code naming.

## <term>
- Definition:
- Boundary: (is X, not Y)
- Resolved ambiguity:

zh-Hans:

---
documentLanguage: zh-Hans
---

# 术语表

一条术语一个条目:定义、边界、一个已解决的歧义。术语敲定的当下写入。词汇对所有 spec、ticket、代码命名具有法律效力。

## <term>
- 定义:
- 边界: (是 X,不是 Y)
- 已解决的歧义:

zh-Hant:

---
documentLanguage: zh-Hant
---

# 詞彙表

每個術語一個條目:定義、邊界、一個已解決的歧義。術語確定時立即寫入。這裡的詞彙是所有 spec、ticket 與程式碼命名的準則。

## <term>
- 定義:
- 邊界: (是 X,不是 Y)
- 已解決的歧義:

種子 C — docs/standards/architecture.md(data.md / process.md 形狀相同;散文以文件語言呈現):

# Architecture Standards

Rule-shaped, checkable writing; every rule carries a "why". Empty sections are legal — sediment is gradual.

## Module boundaries
## Error handling
## Dependency direction

種子 D — docs/business/README.md:

# Business Knowledge

Decision background and business rules. Format suggestion: one article answers one business question, opening paragraph states why it matters.
A new teammate (human or agent) reading this directory should be able to answer "why does this product direction exist".

種子 E — design-system/README.md:

# Design System

## tokens/    Design tokens (colors/type/spacing, machine-readable JSON preferred)
## components/ Component contracts (purpose, variants, misuse)
## patterns/  Interaction patterns (forms, feedback, loading, empty states — sediment reused patterns)

種子 F — .omc/skills/README.md:

# Project Skills

Reusable capabilities sedimented by this project: specialized tools, prompt templates, specialized practices.
One skill per file `.omc/skills/<name>.md`, frontmatter must contain a stable ASCII `id` plus name + description +
**non-empty triggers** (loader validation hard requirement: missing or empty means the skill is never loaded):

```markdown
---
id: project-release-check
name: project-release-check
description: Apply this repository's release readiness rules
triggers:
  - "project release check"
---

# Project Release Check

Follow the repository-specific release checklist and report evidence.
```
The literal YAML keys `id`, `name`, `description`, and `triggers` never localize. `id` and other machine-semantic values stay ASCII and stable; the scalar display values for `name`, `description`, and `triggers`, plus Markdown headings and prose, may localize. A non-Latin display name remains loadable because the explicit ASCII `id` is stable.
Bar for admission matches skillify: if it can be Googled in 5 minutes it is not a skill;
write "this project's specific decision discipline", not generic tutorials.

.mcp.json 種子:{"mcpServers": {}}——伺服器在真正需要工具整合時才加入,而非預先加入。

4. 連接治理循環(這才是讓它成為船廠,而非資料夾的關鍵)

告知使用者,並依賴以下流程來填補骨架:

  • launch 在決策確定時寫入 CONTEXT.md 詞彙、ADR 與 docs/business/(留下紙本記錄)
  • launch C5 沈積 / code-review 沉積標準
  • navigator 消費 CONTEXT.md 與 docs/standards/ 來做出脈絡感知的決策
  • harbor 消費 docs/standards/ 與設計系統來驗證規範議題

Individual skills in this repo

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

agent-doc-discipline

Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and carrying a why, steps before reference, one meaning in one home, no restating what the environment already says. Mandatory at drydock seed generation and the launch C5 sediment pass; opt-in for any other agent-facing doc edit. The companion of minimal-code-discipline: that one disciplines code, this one disciplines papers.

ai-slop-cleaner

Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

ask

Process-first advisor routing for Claude, Codex, Gemini, Antigravity, Grok, or Cursor via `omc ask`, with artifact capture and no raw CLI assembly

ask-navigator

Shipyard

autopilot

Full autonomous execution from idea to working code

autoresearch

Stateful single-mission improvement loop with strict evaluator contract, markdown decision logs, and max-runtime stop behavior

cancel

Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state

configure-notifications

Configure notification integrations (Telegram, Discord, Slack) via natural language

debug

Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction

deepinit

Deep codebase initialization with hierarchical AGENTS.md documentation

deep-interview

Socratic deep interview with mathematical ambiguity gating before explicit execution approval

execute

Carry an approved task through to working, verified code

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup

graph

Deterministic orchestration graph runtime - declarative DAG pipelines with journal-based crash recovery

harbor

Harbor intake for external work — the captain only handles unresolved decisions. Sweeps incoming issues and PRs, verifies every claim before disposition, reuses every decision already made, and hands the maintainer a docket whose pending items each carry one question with options, recommendation, impact and evidence. Agent-autonomous for facts and for actions covered by standing authorization; signed for every new judgment. Never merges.

hud

Configure HUD display options (layout, presets, display elements)

launch

Shipyard

loft

Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks. Use when a design question stalls in words, when a navigator map carries a loft ticket, or when a spec discussion reaches

minimal-code-discipline

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

omc-doctor

Diagnose and fix oh-my-claudecode installation issues

相關技能