拓十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Codex与Unity

Codex与Unity

Codex:

概念:

插件:工具箱;

Skill:工作流说明书,自动流程;

MCP:接工具的通道,工具接口,Model Context Protocol;

插件是Codex 的核心能力来源;

没有插件 = 普通聊天AI
有插件 = 自动干活的AI

安装unity插件:

添加插件市场:

# 1. 新增 Unity 官方外掛市集庫 codex plugin marketplace add Unity-Technologies/unity-agent-plugin # 2. 安裝 Unity 官方插件 codex plugin add unity@unity-agent-plugin

安装unity插件:

使用插件:

在聊天里面@插件名称;

unity-agent-plugin skills:

Unity接入Codex:

1. 编辑器具备MCP:

1. unity版本为6;

2. Package Manager安装com.unity.ai.assistant;

3. 检查MCP:

2. Codex安装并启用Unity插件后,在unity内接受请求;

CodeGraph(加快ai理解代码):

安装:

# Windows (PowerShell) irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex # 或者使用node npm i -g @colbymchenry/codegraph

链接到agent:

在控制台执行:

codegraph install

在每个项目初始化:

cd your-project codegraph init

ponytail:

让 AI 编程助手变得更“懒惰”、更高效,从而写出更精简、更安全的代码;

安装:

codex plugin marketplace add DietrichGebert/ponytail codex plugin add ponytail@ponytail

添加信任:

Trellis:

通过自动化机制注入项目规范,让 AI 每次都按你的标准写代码,而不是随机发挥;

安装:

# 全局安装(beta 通道) npm install -g @mindfoldhq/trellis@latest # 进入你的项目目录 cd your-project

(需要 Node.js 18+ 和 Python 3.9+)

初始化:

trellis init会自动检测已安装的平台,也可以用 flag 显式指定。每一个平台都需要最少 init 一次。随意组合:

# 交互式:检测已安装的平台并询问要配置哪些 trellis init -u your-name # 显式:配置一个或多个平台 trellis init -u your-name --claude trellis init -u your-name --claude --cursor --opencode trellis init -u your-name --codex --gemini trellis init -u your-name --pi

your-name会成为你的开发者身份,在.trellis/workspace/your-name/创建个人工作区;

trellis init 为每个平台写入各自的配置目录:

.agents/skills/ 是一份跨平台共享层(agentskills.io 规范);

基本流程:

# 1. 描述你要做什么 "新增用户登录功能" # 2. AI 判断当前 turn,必要时询问是否创建任务 # 3. 如果这是 Trellis task,AI 按 workflow.md 走 Plan → Execute → Finish # 4. 工作 commit 已存在后 /trellis:finish-work

目录结构:

your-project/ ├── .trellis/ # Trellis 核心(跨平台一致) │ ├── .developer # 开发者身份(gitignored) │ ├── .version # Trellis 版本号 │ ├── .template-hashes.json # 模板文件 hash(update 用) │ ├── workflow.md # 开发工作流指南 │ ├── config.yaml # 项目配置(packages、update.skip、hooks) │ │ │ ├── .runtime/ # 每个会话自己的运行时状态(gitignored) │ │ └── sessions/ # 每个 AI 会话/窗口对应一个 active task │ │ └── <session-key>.json │ │ │ ├── spec/ # 项目 spec 库 │ │ ├── frontend/ # 前端 spec(monorepo 可按 package 分层) │ │ ├── backend/ # 后端 spec │ │ └── guides/ # 思考指南 │ │ │ ├── workspace/ # 开发者工作区 │ │ ├── index.md │ │ └── {developer-name}/ │ │ ├── index.md │ │ └── journal-N.md │ │ │ ├── tasks/ # 任务目录 │ │ ├── {MM-DD-task-name}/ # 活跃任务 │ │ │ ├── task.json # 任务元信息 │ │ │ ├── prd.md # 需求文档 │ │ │ ├── design.md # 复杂任务的技术设计 │ │ │ ├── implement.md # 复杂任务的实施计划 │ │ │ ├── implement.jsonl # 实现阶段 spec/research manifest │ │ │ ├── check.jsonl # review 阶段 spec/research manifest │ │ │ └── research/ # 持久调研记录 │ │ └── archive/ # 归档任务 │ │ └── {YYYY-MM}/ │ │ │ └── scripts/ # 自动化脚本(Python) │ ├── task.py # 任务管理 │ ├── get_context.py # 会话上下文 │ ├── add_session.py # 记录会话 │ ├── create_bootstrap.py # 首次 spec bootstrap │ └── common/ # 共享库 │ ├── .claude/ # Claude Code 配置 │ ├── settings.json # hook 和权限配置 │ ├── commands/trellis/ # 显式命令 │ │ ├── start.md │ │ ├── finish-work.md │ │ └── continue.md │ ├── agents/ # Sub-agent 定义 │ │ ├── trellis-implement.md │ │ ├── trellis-check.md │ │ └── trellis-research.md │ ├── skills/ # Auto-trigger skills │ │ ├── trellis-brainstorm/ │ │ ├── trellis-before-dev/ │ │ ├── trellis-check/ │ │ ├── trellis-update-spec/ │ │ └── trellis-break-loop/ │ └── hooks/ # Hook 脚本 │ ├── session-start.py │ ├── inject-subagent-context.py │ └── inject-workflow-state.py │ ├── .cursor/ # Cursor:commands/ + rules/ ├── .opencode/ # OpenCode:commands/trellis/、agents/、skills/、plugins/ ├── .codex/ # Codex:prompts/、skills/ + 仓库根 AGENTS.md ├── .kiro/ # Kiro:steering/、prompts/、skills/ ├── .gemini/ # Gemini CLI:commands/trellis/ ├── .qoder/ # Qoder:commands/、skills/、agents/、hooks/ ├── .codebuddy/ # CodeBuddy:commands/trellis/ ├── .factory/ # Droid:commands/trellis/、skills/、hooks/ ├── .pi/ # Pi Agent:prompts/、skills/、agents/、extensions/trellis/ └── .github/ # Copilot:copilot-instructions.md、prompts/

启动会话:

在 ~/.codex/config.toml 开启 hook,否则聊天界面输入 / 检索不到 Trellis 的三大命令(/start、/finish-work、/continue),也无法用 /start 启动会话

[features] hooks = true # Codex 0.129+。旧版用 `codex_hooks = true`。
返回列表