Community程式設計與開發github.com

路徑類型

針對 Codex 儲存庫中作業系統路徑選擇 Rust 類型。用於定義新的路徑承載類型或明確遷移現有類型。

路徑類型 是什麼?

此技能提供在 Codex 儲存庫中為作業系統路徑選擇適當 Rust 類型的指導方針。其主要目的是在進行 URI 遷移時,於不同伺服器(如應用程式伺服器與執行伺服器)的邊界與內部邏輯中,指引開發者使用 `PathUri`、`AbsolutePathBuf`、`LegacyAppPathString` 或 `PathBuf` 等類型。技能強調相容性與漸進式遷移,例如在應用程式伺服器的通訊協定類型中先用 `LegacyAppPathString` 保持向後相容,再轉為 `PathUri` 供內部使用。對於模型生成的工具呼叫參數,則建議將其反序列化為一般 `String`,再由特定功能的路徑處理程式碼處理。此技能也列出了遷移要求,包括維持現有用戶端相容性、使用 file:// URI、不改變模型可見文字、以及路徑推理需在環境就緒前完成等。此外,它提倡在 `PathUri` 或 `LegacyAppPathString` 上使用小型且專注的方法,而非分散的區域輔助函式,並強調路徑轉換錯誤時應根據安全性需求選擇嚴謹或寬鬆的處理方式。支援的平台包括 Codex 儲存庫中的 app-server、exec-server 及其共享依賴。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/openai/codex/tree/main/.codex/skills/path-types

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

在你喜歡的 AI 中提問

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

說明文件

路徑類型 是做什麼的?

在定義新型別時,請遵循此指引。僅在明確要求時才變更現有程式碼,並保持編輯的最小化與比例性。將這些規則視為持續遷移的目標狀態;若難以符合,請詢問使用者該如何進行。

  • 在 app-server 協定型別中,請使用 LegacyAppPathString 以保持 URI 遷移期間的向後相容性。在協定邊界處,將其轉換為 PathUri,並在內部使用 PathUri。對於僅限主機的邏輯(例如某些設定值),請改用 AbsolutePathBuf 或 PathBuf。
  • 在 exec-server 協定型別中,請使用 PathUri。在內部,請視情況使用 PathUri 或 AbsolutePathBuf。
  • 在兩個伺服器共用的依賴項中,請使用 PathUri 或將其使用案例解耦的獨立 API。
  • 預期由模型產生的工具呼叫參數,應反序列化為常規的 String,並使用特定功能的路徑處理程式碼。

遷移需求

在遷移程式碼以遵循上述準則時,請記住以下需求:

  • 現有的 app-server 客戶端會繼續傳送和接收舊版的原生路徑字串
  • app-server 可以保留和操作跨平台的路徑 URI
  • exec-server API 使用 file:// URI
  • 僅限本機的操作不得改變模型可看到的文字
  • 模型工具參數可能包含任何作業系統的原始相對或絕對路徑
  • 路徑推理必須在相關環境上線前就能運作
  • URI 不能明確編碼執行器的路徑慣例或作業系統
  • 使用者不得明確設定環境的作業系統/路徑慣例
  • URI 尚不應儲存在發布、資料庫或其他持久性儲存中
  • 路徑轉換錯誤:對於安全相關路徑應故障關閉,對於 UI/診斷應故障開啟
  • 優先選擇 PathUri 或 LegacyAppPathString 上的小型聚焦方法,而非本機輔助函式
  • 在診斷中將 PathUri 值表示為 URI

只要路徑與 URI 之間的轉換能為真實使用者正確運作,即使有些許失真也是可以的。

遷移至 URI 不應增加顯著的新失敗模式。我們需要在某些原本不會失敗的地方呈現錯誤,但應將其降至最低。

Individual skills in this repo

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

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

code-review

Run a final code review on a pull request

code-review-change-size

Change size guidance (800 lines)

code-review-context

Model visible context

code-review-testing

Test authoring guidance

codex-bug

Diagnose GitHub bug reports in openai/codex. Use when given a GitHub issue URL from openai/codex and asked to decide next steps such as verifying against the repo, requesting more info, or explaining why it is not a bug; follow any additional user-provided instructions.

codex-issue-digest

Run a GitHub issue digest for openai/codex by feature-area labels, all areas, and configurable time windows. Use when asked to summarize recent Codex bug reports or enhancement requests, especially for owner-specific labels such as tui, exec, app, or similar areas.

codex-pr-body

Update the title and body of one or more pull requests.

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

openai/babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

openai-docs

Use when the user asks how to build with OpenAI products or APIs, asks about Codex itself or choosing Codex surfaces, needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; use OpenAI docs MCP tools for non-Codex docs questions, use the Codex manual helper first for broad Codex self-knowledge, and restrict fallback browsing to official OpenAI domains.

openai/test-tui

Guide for testing Codex TUI interactively

plugin-creator

Create and scaffold plugin directories for Codex with a required `.codex-plugin/plugin.json`, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries for plugin ordering and availability metadata, or update an existing local plugin during development with the CLI-driven cachebuster and reinstall flow.

pushing-ci-changes

Pushing GitHub Actions changes, resolving push rejection, requesting upload exceptions.

remote-tests

Testing against remote executors in integration tests.

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

test-tui

Guide for testing Codex TUI interactively

update-v8-version

Update Codex's pinned `v8` / `rusty_v8` versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update `rusty_v8` artifacts, prepare or validate a V8 release candidate, check `v8-canary`, or diagnose why a V8 version update no longer builds.

相關技能