Role Creator

am-will/codex-skills/skills/role-creator

作者 am-will9f954c3b63fda0d1875252009c196bf15072c1ca無授權條款1K 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫2 個月前更新

Create and update Codex custom agents using standalone custom-agent TOML files.

包含腳本AI & Agents
AI 產生的概覽

以獨立 TOML 檔案建立與更新 Codex 自訂代理角色。

功能
此技能用於撰寫、更新與疑難排解以獨立 TOML 檔案定義的 Codex 自訂代理。它會收集名稱、描述、開發者指示、模型、推理強度與範圍等必要輸入,接著將角色檔案寫入全域或專案路徑。它會驗證 TOML 與必要鍵,並回傳可直接執行的範例呼叫。此技能附有用于寫入、安裝與驗證角色設定的 shell 指令碼。
適用情境
當你需要建立新的 Codex 自訂代理或更新現有代理時使用。它也適合用來疑難排解角色檔案問題,例如解決 unknown agent_type 或檢查 TOML 語法。
執行需求
需要可執行所附指令碼的 shell 環境、tomlq 等 TOML 驗證工具,以及對目標 Codex 代理目錄的寫入權限。不需要憑證或網路存取。

Role Creator

Overview

Use this skill to author, update, or troubleshoot custom Codex agents as standalone TOML files.

Current behavior:

  • Each custom agent is defined by one file:
    • Global: ~/.codex/agents/<agent-name>.toml
    • Project: <project>/.codex/agents/<agent-name>.toml
  • The agent file is the role source of truth.
  • ~/.codex/config.toml is only for global/runtime settings (for example [agents] thread limits), not per-role registration.

Non-Negotiable Inputs

Step 1 is required before writing files:

  • name (role identifier used by agent_type)
  • description (short, human-readable purpose)
  • developer_instructions
  • model (recommend gpt-5.3-codex unless requested)
  • model_reasoning_effort (none|minimal|low|medium|high|xhigh)
  • role scope (global or project)
  • output TOML path (canonical absolute path preferred)
  • whether to include nickname_candidates and exact values

Execution rule:

  • Do not infer required values.
  • Do not write until required inputs are explicitly confirmed.

Role file contract (current)

From Codex custom agent docs (/codex/subagents):

  • Required keys: name, description, developer_instructions.
  • Optional keys: nickname_candidates, model, model_reasoning_effort, sandbox_mode, web_search, mcp_servers, skills.config, etc.
  • name is the spawn identifier and source of truth.
  • description + developer_instructions define behavior and usage boundaries.
  • nickname_candidates is optional and used only for display.

nickname_candidates requirements:

  • Must be a non-empty list of unique values when present.
  • Allowed characters: ASCII letters, digits, spaces, hyphens, underscores.

Default policy for optional settings

  • Do not add sandboxing/MCP/web-search/model extras unless requested.
  • Keep generated files minimal by default.
  • If the user says "inherit defaults", omit optional keys instead of setting explicit values.

Workflow

  1. Collect and confirm required inputs.
  2. Resolve output path:
    • global → ~/.codex/agents/<name>.toml
    • project → <project>/.codex/agents/<name>.toml
  3. Create or update the file directly with required keys.
  4. Validate TOML parse and required keys.
  5. Return a ready-to-run example call:
json
{"agent_type":"<name>","message":"<task>"}

Commands

bash
# 1) Write a standalone custom-agent file/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \  --output ~/.codex/agents/reviewer.toml \  --role-name reviewer \  --description "PR reviewer focused on correctness, security, and risk." \  --model gpt-5.4 \  --reasoning high \  --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks."
# Optional: include nickname candidates for display/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \  --output ~/.codex/agents/reviewer.toml \  --role-name reviewer \  --description "PR reviewer focused on correctness, security, and risk." \  --model gpt-5.4 \  --reasoning high \  --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks." \  --nickname-candidates "Atlas,Delta,Echo" \  --sandbox-mode read-only \  --web-search disabled

Guardrails

  • If runtime returns unknown agent_type, verify the active scope and confirm the file exists at the expected path.
  • Check syntax first with tomlq or tomlq -C.
  • Keep role instructions operational and narrowly scoped to avoid drift.

References

  • Codex subagents docs: https://developers.openai.com/codex/subagents
  • Display nicknames: https://developers.openai.com/codex/subagents#display-nicknames
  • Reusable templates: templates/

來源與署名

來源:am-will/codex-skills位於skills/role-creator提交9f954c3

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架