> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt
> Use this file to discover all available pages before exploring further.

# v0.3.6

> 2026-03-06

任务生命周期 hooks、自定义模板仓库、父子 subtask、修复 PreToolUse hook。

## 新增功能

* **自定义模板仓库**：`trellis init --registry` 支持从自定义 GitHub/GitLab/Bitbucket 仓库拉取 Spec 模板，自动探测 marketplace 模式（`index.json`）和直接下载模式
* **任务生命周期 hooks**：`.trellis/config.yaml` 新增 `hooks` 配置块，支持 `after_create`、`after_start`、`after_finish`、`after_archive` 四个事件，通过 `TASK_JSON_PATH` 环境变量传递任务信息，附带 Linear sync hook 示例。参考：[任务管理全流程](/zh/start/everyday-use)
* **父子 subtask 支持**：`task.py add-subtask` / `remove-subtask` 命令，task.json 新增 `children`、`parent`、`meta` 字段，`task.py create --parent` 直接创建子任务
* **`/record-session` prompt 改进**：归档判断基于实际工作状态而非 task.json status 字段
* **`/brainstorm` prompt 更新**：新增 subtask decomposition 步骤，支持将复杂任务拆分为子任务

## Bug 修复

* **PreToolUse context injection 失效**：Claude Code v2.1.63 将内部工具从 `Task` 改名为 `Agent`（[anthropics/claude-code#29677](https://github.com/anthropics/claude-code/issues/29677)），导致 hook 脚本 `tool_name != "Task"` 检查直接退出，implement/check/debug/research agent 的 code-spec context 注入全部失效。修复：兼容 `Task` 和 `Agent` 两种名称，settings.json 新增 `"Agent"` matcher

## 迁移

无需手动操作。运行 `trellis update` 即可同步更新后的 hook 脚本和 settings。
