Skip to content

docs(agents): 优化 Astra 自主执行、授权与完成规则 - #39

Merged
CubePlus1 merged 4 commits into
mainfrom
codex/astra-instruction-audit
Sep 6, 2026
Merged

docs(agents): 优化 Astra 自主执行、授权与完成规则#39
CubePlus1 merged 4 commits into
mainfrom
codex/astra-instruction-audit

Conversation

@CubePlus1

@CubePlus1 CubePlus1 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

用户已要求实现的工作会被 Trellis 的建任务、开始实现、设计检查点和提交确认反复暂停;固定文档、讨论轮次与验证要求也会扩大小任务,并导致收尾依赖用户再次操作。

统一 AGENTS.md、Trellis 工作流、实际 SessionStart/状态提示、Skills、继续/收尾命令和子 Agent 定义:在已有目标和授权内持续执行,只澄清实质缺口;按风险选择规划、委派和验证;区分本地交付、提交、PR、合并、发布和归档。创建任务文件前先检查分支,保留 main 分支保护约定、PR 合入、最新提交 Codex review 和禁止直接写业务数据库等约束。

验证:

  • git diff --check 通过。
  • 实际 Trellis 解析器读取全部 13 个步骤、6 个 workflow-state 正文及 Codex/Claude 平台过滤通过。
  • 用隔离临时任务运行实际 SessionStart 状态函数,覆盖无任务、失效指针、缺 PRD、PRD-only planning、in_progress 和 completed;未使用的 JSONL 占位清单不再改变下一步授权策略。
  • 在隔离临时 Git 仓库执行真实 task.py create,确认生成的 PRD、命令提示、日期 slug 和可选文档策略;实际 check/finish 子 Agent 提示构建检查通过。
  • 修改的 Skill 入口和 Agent 定义元数据已完成校验。
  • 初次 CI 的构建、测试、PostgreSQL 集成测试、Typecheck 与 Skills/Plugin 校验通过;最新提交重新执行 CI 和 Codex review。

本次涉及 23 个仓库内指令、Hook 和任务生成文件,不修改业务实现或部署服务。个人目录的全局配置与安装技能不属于本仓库,未包含在此 PR。Trellis 升级仍需保留这些本地工作流策略。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T08:17:53.863533Z 066b34c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@CubePlus1

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2bc3139ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .trellis/workflow.md
Comment on lines 86 to +87
[workflow-state:planning]
Load `trellis-brainstorm`; stay in planning.
Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
Inspect evidence; use trellis-brainstorm only for material ambiguity. Record concise scope/acceptance in prd.md; add design/implementation documents only when useful. If independently delegating, supply relevant context. When implementation is authorized and no material blocker remains, run task.py start and continue without another approval. Planning-only requests end with the plan.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the planning SessionStart hook

When Claude starts, clears, or compacts a session with a task in planning, .claude/hooks/session-start.py:388-410 still injects the old requirements that complex tasks add design.md/implement.md, ask for review, and not begin implementation until the user confirms. That runtime prompt directly conflicts with this new no-second-approval rule, so the repeated pauses this commit is intended to remove remain on every such session transition; update the hook's planning branch along with the workflow text.

AGENTS.md reference: AGENTS.md:L53-L53

Useful? React with 👍 / 👎.

Comment thread .trellis/workflow.md Outdated
Comment on lines +127 to +129
#### 1.0 Create/reuse task `[when needed · once]`

**Format**: one JSON object per line — `{"file": "<path>", "reason": "<why>"}`. Paths are repo-root relative.
Check `task.py current --source` and `task.py list`. Reuse a matching task; create one for product work or useful durable coordination without asking process consent. Simple answers, read-only audits, and narrow documentation/rule maintenance need no task. Honor an explicit request to skip Trellis with a proportionate inline plan.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check the branch before creating task files

For product work started while the repository is on main, this paragraph tells the agent to create the task before the following paragraph checks the branch. task.py create immediately writes task.json, prd.md, and context manifests, so following the documented order modifies files on main; move the branch/status check ahead of any task creation.

AGENTS.md reference: AGENTS.md:L61-L62

Useful? React with 👍 / 👎.

Comment thread .trellis/workflow.md
Comment on lines +165 to +167
Load `trellis-before-dev` when coding, read relevant context, and implement the requested outcome directly. Preserve unrelated changes and scope. Prefer existing APIs/patterns; add abstractions only for demonstrated complexity or meaningful duplication.

#### 2.2 Quality check `[required · repeatable]`
Delegate only a concrete independent task that improves time/quality when active instructions permit it. Platform support does not require delegation. Include `Active task: <task path>` when present, role, owned files, inputs, output, and completion criteria. Dispatched agents execute their roles without recursively spawning the same implement/check role. If an agent type is unavailable, work inline.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align routing references with the new delegation policy

When an agent uses the Trellis customization references, .claude/skills/trellis-meta/references/local-architecture/workflow.md:23-28 still says sub-agent-capable platforms dispatch implement/check agents by default, while customize-local/change-workflow.md:20,42-44 directs maintainers to a removed Skill Routing table and platform groups. Those references can reintroduce mandatory delegation or send maintainers to nonexistent edit points, so synchronize them with this new usefulness-based routing structure.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

Comment thread .trellis/workflow.md Outdated
### Workspace System

Records every AI session for cross-session tracking under `.trellis/workspace/<developer>/`.
`create` seeds `task.json` and `prd.md`, with optional context manifests; `--slug` omits the date prefix. `start` sets `in_progress` and the session pointer. If session identity is missing, follow the command's hint using the real current session identifier. `finish` clears the pointer without completing the task. `archive` sets `completed`, moves the task, clears matching pointers, and can auto-commit. Inspect `--help` and configuration before commands with commit/external effects.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Correct the documented --slug behavior

For anyone creating a task with --slug, this says the option removes the date prefix, but .trellis/scripts/common/task_store.py:240-244 always constructs the directory as MM-DD-<slug>; the updated brainstorm skill also correctly documents that behavior. Correct this sentence so agents do not derive or report the wrong task path.

Useful? React with 👍 / 👎.

@CubePlus1

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a29d719d55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### Useful Content

For triggered tasks, include all sections below:
Include only the applicable details below, preferably in existing sections. Do not add empty sections, duplicate code/tests, or require a seven-section rewrite for a small contract change:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the spec-update checklist conditional

When trellis-update-spec handles a small contract change for which only one of the listed details applies, this instruction now says to omit the other sections, but the final Quality Checklist at lines 323–328 still requires a code example, signatures, an error matrix, Good/Base/Bad cases, and tests. An agent following the whole skill will therefore either fail its completion gate or recreate the seven-section documentation bloat this change is intended to remove; qualify those checklist items as applicable-only as well.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

**Find and explain the evidence needed by the research brief.**

Conversations get compacted; files don't. Every research output MUST end up as a file under `{TASK_DIR}/research/`. Returning findings only through the chat reply is a failure — the caller cannot read them next session.
Return concise findings with source locations. Persist expensive-to-recover evidence or an explicitly requested research artifact under the caller's task research directory. A brief read-only lookup can return directly; file count does not establish research quality.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Synchronize the research-agent contract references

For a taskless or brief read-only lookup, the new contract permits returning findings directly without creating an artifact, but .claude/skills/trellis-meta/references/platform-files/agents.md:15 still defines this agent as writing into the current task's research/, and customize-local/change-agents.md:44 still says research always persists. Because trellis-meta is the guidance used when maintaining these agent definitions, following it can reintroduce mandatory persistence or leave the agent requiring a nonexistent task directory; update those references to match this conditional contract.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

@CubePlus1

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4511206e1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .trellis/workflow.md
Inspect relevant code, current instructions, and decisions. Define the outcome, boundaries, and acceptance evidence in a concise PRD or inline plan. Use `trellis-brainstorm` for consequential ambiguity; choose routine implementation details yourself. Ask the smallest useful set of questions and continue independent work.

These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
Add design/implementation documents only when their separate purpose justifies them. Do not split tasks or rewrite a sufficient PRD merely for a formatting gate. Update the plan when evidence changes scope/acceptance.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update task creation to stop requiring complex-task artifacts

Whenever task.py create is used, .trellis/scripts/common/task_store.py:186-188 writes the old requirement into the generated prd.md, and lines 353-356 repeat it in the command's immediate “Next steps” output. Agents creating any complex product task therefore still receive two task-specific instructions to add design.md and implement.md before task.py start, directly defeating this new usefulness-based rule; update the task template and CLI output as part of the policy change.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

@CubePlus1

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 066b34c7e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@CubePlus1
CubePlus1 merged commit a2bfb4f into main Sep 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant