Loading...
Loading...
在~/.codex/config.toml中创建并安装Codex自定义Agent角色,生成角色配置文件,强制使用受支持的键,并引导用户完成角色所需的输入项(model、推理强度、developer_instructions)。
npx skill4agent add am-will/codex-skills role-creator[agents.<role>]config_file~/.codex/config.tomlcodex-rs/core/config.schema.jsonmodelmodel_reasoning_effortdeveloper_instructions~/.codex/config.toml.codex/config.tomlmodelmodel_reasoning_effortdeveloper_instructionsglobalprojectrole_namedescriptionrole_config_file该角色应使用哪个模型?gpt-5.3-codex应使用何种推理强度?mediummedium|high|xhigh该角色的developer_instructions应优先关注什么?你希望将其安装到全局配置(~/.codex/config.toml)还是项目配置(.codex/config.toml)中?是否需要沙箱、网页搜索、MCP或其他限制?在spawn_agent中应显示什么角色名称和描述?web_searchconfig_fileconfig_filemodelmodel_reasoning_effortmodel_reasoning_summarymodel_verbositypersonalitydeveloper_instructionssandbox_mode[sandbox_workspace_write]network_accesswritable_rootsweb_searchdisabled|cached|live[features]memory_toolshell_tool[mcp_servers.<name>]enabledrequiredcommandargsenv_vars[apps.<name>]enabledtemplates/minimal-role-config.tomltemplates/restricted-role-config.tomltemplates/full-role-config.tomltemplates/frontend-architecture-role.toml[agents.<role_name>]descriptionconfig_file[agents.<role_name>]codex-rs/core/config.schema.jsonglobal~/.codex/config.tomlproject<project>/.codex/config.tomlscripts/write_role_config.shsandbox_modeweb_searchdisabledmcp_clearmcp_enablemcp_disablemodel_reasoning_summaryfeaturesappstemplates/已配置:可用但未设置:scripts/install_role.shfeatures.multi_agent = true[agents.<role_name>] description/config_fileconfig.tomlconfig.toml--update-existingscripts/validate_role.shdescription/config_file{"agent_type":"<role_name>","message":"<task>"}# 1) 写入角色配置文件(仅包含必填字段;默认行为)
.codex/skills/role-creator/scripts/write_role_config.sh \
--output ~/.codex/agents/researcher.toml \
--role-name researcher \
--model gpt-5.3-codex \
--reasoning medium \
--developer-instructions "仅研究代码和文档;禁止编辑;返回file:line格式的证据。"
# 1b) 可选控制项(仅在明确要求时使用)
.codex/skills/role-creator/scripts/write_role_config.sh \
--output ~/.codex/agents/researcher.toml \
--role-name researcher \
--model gpt-5.3-codex \
--reasoning medium \
--developer-instructions "仅研究代码和文档;禁止编辑;返回file:line格式的证据。" \
--sandbox-mode workspace-write \
--network-access false \
--writable-roots "/home/willr/Applications/codex1" \
--web-search disabled
# 2) 在~/.codex/config.toml中注册角色
.codex/skills/role-creator/scripts/install_role.sh \
--role-name researcher \
--description "只读代码库研究专家" \
--role-config-file ~/.codex/agents/researcher.toml
# 2b) 有意更新现有角色定义
.codex/skills/role-creator/scripts/install_role.sh \
--role-name researcher \
--description "更新后的角色描述" \
--role-config-file ~/.codex/agents/researcher.toml \
--update-existing
# 3) 验证角色配置和声明键
.codex/skills/role-creator/scripts/validate_role.sh \
--role-name researcher \
--config ~/.codex/config.toml \
--role-config ~/.codex/agents/researcher.toml \
--schema /home/willr/Applications/codex1/codex-rs/core/config.schema.jsonunknown agent_typeconfig_fileagent type is currently not availablereferences/role-config-reference.mdtemplates/