爽用GPT6 Astra之前,每个人都应该先安装这个skill
来源:微信公众号 原文链接:https://mp.weixin.qq.com/s/pcPM4VrFd7Nr44vojtY1IA 原文时间:2026-09-09

用上 Astra 后,最先烧掉大把额度的,可能并非那些预想中的“复杂的长流程科研难题”。 而是扫目录、读文件、理结果这些琐碎杂活。 尽管大家想通过手动切换模型,来尽可能省额度。但任务一多,分工容易乱,上下文也会越传越长。 我们索性做了个主要适配 ChatGPT 的小 Skill:Astra 留在主线程做判断,Luna、Terra 接走边界清楚的工作,结果统一用 JSON 交回。 | 01 项目思路 项目名称:astra-task-router 这是一个面向 Codex 的轻量模型调度 Skill。它不接管具体科研任务,只负责判断是否值得派发 worker、选择模型、压缩交接信息,并检查返回结果。 这套 Skill 的设计思路,说白了就是”分工“。Astra 负责拆任务、定边界、处理难点并验收;Terra 负责阅读量大的扫描任务;Luna 接手规则清楚、重复频繁的小活。 通过这个Skill,任务交给 worker 前,主线程会被先压成一份短 JSON:要做什么、能看哪些材料、交付成什么样、怎样才算完成。 worker 做完就返回结论和证据,随后结束。下一项工作重新开一个 worker,避免旧对话一路膨胀。

| 02 项目结构和安装 完整结构
astra-task-router/├── SKILL.md└── README.md 这个Skill所需要的首次初始化、备份、作用域切换和验证都已经写在了 SKILL.md 里,由 Codex 按规则执行。 项目安装 接下来大家可以选择把附录中的项目源代码复制下来,按照目录的结构,克隆到skill文件夹;也可以直接把这篇文章下载然后直接发给 Codex。 Tips:下载时候注意走.html格式,采用.pdf 会导致代码被截断!

安装提示词:
#任务请阅读本文附录,从中提取 astra-task-router 的完整目录和两个源文件。将它安装到当前用户的全局 Skill 目录:Windows 使用 %USERPROFILE%.agents\skills\astra-task-router\macOS/Linux 使用 ~/.agents/skills/astra-task-router/#要求
- 严格还原 SKILL.md 与 README.md,不改写源码;2. 先检查目标路径,若已有同名 Skill,只报告差异,不覆盖;3. 本次只安装文件,不修改 config.toml 或任何 AGENTS.md;4. 安装后校验 YAML frontmatter、目录名和文件完整性;5. 最后只报告安装位置、校验结果,以及“请新开任务调用 $astra-task-router 完成首次初始化”。

新任务里调用 Skill 后,它会让用户选择当前项目或全局环境。选择只代表作用域,真正写文件前仍会展示变更清单。 Tips:项目默认从 GPT-6 Astra / low 主线程开始,如果是其他档位,Skill 也可以运行,但它不会自动把当前任务切换成 Astra。只有在全局初始化后新开任务,才会按配置把主线程默认设为 Astra / low。

| 03 调用演示
安装完成后,新开一个任务并调用 $astra-task-router。
如果当前项目和全局环境都没有初始化记录,它会先停下来询问:只在当前项目使用,还是让所有项目都采用这套分工。
当前项目
调度规则写进项目根目录的 AGENTS.md。每次派发 worker 时显式指定 Terra 或 Luna,不改全局 config.toml。适合先在一项论文、一个代码仓库或一组数据上试用。
全局环境
规则写入 ~/.codex/AGENTS.md,并把 Astra low、Luna medium 设为默认的根代理与子代理组合(对于这个模型参数不满意的朋友,也可以考虑修改一下代码)。
与此同时,现有 MCP、插件、provider、权限和沙箱设置都会原样保留。
两种模式都会先列出拟修改文件,再等用户确认。已有文件按时间备份;再次调用时读取初始化标记,不会每次都追问。项目规则离当前目录更近,因此会覆盖全局默认。
| 04 模型分配说明

Astra 留在主线程 Astra 处理需求拆解、研究设计中的难点、架构选择和最终验收。worker 已经领取的工作,主线程不再重做;返回信息不合格时,只补发一次聚焦的修正要求。 Terra 接阅读量大的任务 仓库扫描、长文档阅读、论文结构提取、证据收集,优先交给 Terra。它返回的是文件地图、页码、行号或来源,不把整段日志塞回主线程。 Luna 处理清楚的小活 字段抽取、批量重命名、格式整理、局部修改等任务交给 Luna。日常默认 medium;只有子任务本身需要深推理时才临时上调。Luna 不可用时,按原任务边界改用 Terra,不会悄悄回退到 Astra。 考虑到多代理会比同等的单代理任务消耗更多 Token。因此,这个 Skill 会先判断任务是否值得拆。几分钟能完成的读取或修改,主线程直接处理即可。 Tips:为了避免不必要的额度浪费,项目默认采用 Astra low、Terra medium、Luna medium 。对于这个模型参数不满意的朋友,也可以考虑修改一下代码,或者在Codex内自行调整成合适的思考深度。 | 05 把上下文压成一张任务单 也有的朋友可能会担心,模型的交互也要成本,两个模型来回切换,可能会越聊越贵。 Astra 派发任务时,会先把长对话整理成一张简短任务单,只保留目标、材料范围、限制条件、交付内容和验收标准。 Terra 或 Luna 完成后,也只交回结论、证据位置、生成文件和下一步建议,不把阅读记录、命令日志等过程内容重新塞进主线程。

当然,大家不需要自己制作这些任务单。安装 Skill 后,模型会自动按这套格式交接。完整规则位于附录 SKILL.md 的 ## JSON handoff 小节,两段 JSON 分别规定了“如何派活”和“如何回传结果”。 | 06 科研场景怎么用 接下来。我们选用论文”AI-Driven Demand Forecasting With Dynamic.pdf“设计一次只读演示。 提示词范例
只在这个任务启用 $astra-task-router 然后阅读下面这篇论文:C:\Users\WIN10\Desktop\papers\AI-Driven Demand Forecasting With Dynamic.pdf 目标是形成一份“研究设计速查”,包括研究问题、数据来源、核心变量、模型方法、验证方式和作者报告的主要结果。 请先由 Astra 定义提取口径和验收条件,再判断是否需要 worker。如果派发,只启动一个 Terra 只读扫描任务;用精简 JSON 交接,要求每项返回页码或章节位置。Terra 完成后结束该任务,由 Astra 核对证据并整理最终中文速查表。不要让主线程与 worker 重复阅读全文。 接下来,Codex 会自动配置子Agent

在Terra完成对全文证据的整理后,Astra才会负责进行检查工作,并呈现最终的输出成果。

上述展示的仅仅是对一篇文献的操作,如果我们的任务更加复杂,通过这个skill,也可以实现有效分解。


| 07 尾声 这个项目适合材料多、步骤长、又能切出清晰子任务的工作。例如批量阅读论文、扫描代码仓库、整理实验日志,再由主线程完成研究判断。它对‘该派谁、给多少材料、怎样收口’做了统一约束。 单次问答、只改一小段文字、只读取一个短文件,直接交给当前模型更省事。它也不会承诺固定节省多少额度,真正的收益取决于任务规模、worker 数量以及交接是否克制。 我更建议先选‘当前项目’,跑通一项真实任务后再决定是否全局启用。这样能观察自己的任务是否真的适合拆分,也不会突然改变其他项目的工作习惯。 | 08 附录
以下两个文件就是项目全部源码,不包含测试材料。
目录结构
astra-task-router/
├── SKILL.md
└── README.md
SKILL.md
---
name: astra-task-router
description: Configure and run a lean Codex root-worker workflow in which GPT-6 Astra coordinates and selected GPT-5.6 Terra or Luna workers handle bounded subtasks. Use when the user wants model routing, lean subagent handoffs, or project/global initialization of this workflow.
---
# Astra Task Router
Keep the main thread focused on requirements, architecture, difficult judgment, acceptance, and the final deliverable. Delegate only work that has a clear boundary and a checkable return value.
## First invocation
Before doing task work, inspect the current project root and the Codex home directory for an `ASTRA-TASK-ROUTER` managed block or state record.
If neither project nor global initialization exists:
1. Explain in one sentence that the workflow has not been initialized.
2. Ask the user to choose exactly one scope: `current project` or `global`.
3. Do not create or modify files until the user answers.
4. After the answer, show the exact files that would change and request confirmation.
If both scopes exist, the project scope wins for the current project. Do not ask again unless the user requests a switch or reconfiguration.
## Initialization
Always create timestamped backups before changing an existing file. Preserve unrelated text and all existing MCP, plugin, provider, sandbox, approval, and project settings. Add or update only the keys and managed blocks owned by this skill.
Use these markers in Markdown files:
```text
<!-- ASTRA-TASK-ROUTER:START -->
<!-- ASTRA-TASK-ROUTER:END -->
```
Write a small state record containing the selected scope, project root when applicable, changed paths, backup paths, prior values of changed TOML keys, and initialization time.
### Current project
- Resolve the Git root. If there is no Git root, show the current working directory and ask whether it should be treated as the project root.
- Add the managed routing block to `<project-root>/AGENTS.md`.
- Store state at `<project-root>/.agents/astra-task-router-state.json`.
- Do not change the user's global `config.toml`.
- Every subagent spawn must explicitly select its model and reasoning effort.
### Global
- Add the managed routing block to `~/.codex/AGENTS.md`.
- In `~/.codex/config.toml`, set or update only these routing defaults after showing the proposed diff:
```toml
model = "gpt-6-astra"
model_reasoning_effort = "low"
[agents]
default_subagent_model = "gpt-5.6-luna"
default_subagent_reasoning_effort = "medium"
```
- If one of these keys already exists, record its previous value before changing it. Never append a duplicate TOML key.
- Store state at `~/.codex/astra-task-router-state.json`.
After either mode is initialized, tell the user to start a new task because Codex reads the AGENTS instruction chain when a run starts.
## Routing policy
Use GPT-6 Astra with low reasoning as the root/orchestrator unless the user explicitly selects another setting. The root may decompose the task, define acceptance criteria, solve the genuinely difficult part, choose architecture, and produce or approve the final answer. It must not repeat a subtask already assigned to a worker.
Choose one worker at a time by default:
- Use `gpt-5.6-terra` for repository exploration, read-heavy scans, large files, document extraction, and evidence collection.
- Use `gpt-5.6-luna` for narrow, repeatable, high-volume tasks such as renaming, formatting, field extraction, and small localized edits.
- Use `medium` reasoning for routine workers. Raise it only when the subtask itself needs deeper reasoning and the selected model supports that level.
- If Luna is unavailable, retry the same bounded task once with Terra. Do not silently fall back to Astra.
Do not spawn a worker for a task the root can finish with one short read or edit. Do not run parallel write-heavy workers on overlapping files. Start a fresh worker for a new bounded task instead of extending an old worker into unrelated work.
## JSON handoff
Send the worker one compact JSON object and the minimum necessary files or paths:
```json
{
"task_id": "T1",
"objective": "one testable objective",
"scope": ["allowed paths or materials"],
"inputs": ["required files or facts"],
"constraints": ["must preserve or avoid"],
"deliverable": "exact return format",
"done_when": ["observable checks"]
}
```
Require one JSON result:
```json
{
"task_id": "T1",
"status": "complete|blocked|partial",
"summary": "short result",
"evidence": ["file, page, line, command, or source"],
"artifacts": ["created or changed paths"],
"open_questions": [],
"next_action": "what the root should decide"
}
```
The worker should return conclusions and evidence, not its full scratchpad or long command logs. The root checks the result against `done_when`, requests one focused correction if needed, then closes that worker's task.
## Commands the user may request
- `status`: report the effective scope, managed files, configured root/worker models, and any project override.
- `switch scope`: preview removal from the old scope and installation in the new scope; wait for confirmation.
- `reconfigure`: change owned model or reasoning values after showing the diff.
- `uninstall`: remove only managed blocks and owned state; restore prior TOML values when they are recorded and still safe to restore. Keep backups and report their paths.
## Verification
After initialization or reconfiguration:
1. Parse `config.toml` when global mode is active and confirm it contains no duplicate keys.
2. Report the effective AGENTS files from global scope down to the current directory.
3. Confirm the selected models are available on the current host when that information is exposed.
4. Offer, but do not automatically run, a single read-only smoke test that spawns a repository-scan worker and returns its selected model plus a three-item file map.
5. If the host does not expose the worker's effective model in status metadata, say that direct identity verification is unavailable and report the explicit spawn selection instead.
README.md
# astra-task-router
一个极简的 Codex 模型调度 Skill。GPT-6 Astra 留在主线程处理拆解、难题、架构和最终验收;GPT-5.6 Terra 或 Luna 接手边界清楚的读取、提取和局部执行任务。主线程与 worker 只交换精简 JSON,减少重复工作和上下文来回搬运。
## 文件
```text
astra-task-router/
├── SKILL.md
└── README.md
```
## 安装
把本文附录交给 Codex,并发送:
```text
请从附录中提取 astra-task-router 的完整目录与源码,安装到当前用户的全局 Skill 目录。不要改写源码,也不要立即修改 config.toml 或 AGENTS.md。安装完成后只报告文件位置与校验结果。
```
Windows 默认位置:
```text
%USERPROFILE%\.agents\skills\astra-task-router\
```
macOS / Linux 默认位置:
```text
~/.agents/skills/astra-task-router/
```
安装后新开一个 Codex 任务,调用:
```text
$astra-task-router
```
第一次调用时,Skill 会询问使用“当前项目”还是“全局”模式,并在任何配置修改前展示文件清单和变更预览。
## 两种作用域
- 当前项目:规则写入项目根目录的 `AGENTS.md`,派发 worker 时显式选择模型,不改变其他项目。
- 全局:规则写入 `~/.codex/AGENTS.md`,并只更新 `config.toml` 中属于本 Skill 的模型路由键。
## 日常使用
初始化后直接描述任务即可。若希望明确调用,可说:
```text
使用 $astra-task-router 处理这个任务。先判断是否值得派发 worker;若派发,只给 worker 一项边界清楚的工作,并用 JSON 交接。
```
还可以使用 `status`、`switch scope`、`reconfigure` 和 `uninstall` 管理配置。Skill 不会自动执行 smoke test,也不会覆盖 MCP、plugin、provider、sandbox 或 approval 设置。