mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
## Task -> Agent Replacement
- Replace all Task({}) calls with Agent({}) across .claude/ directory
- Update allowed-tools declarations from Task to Agent
- Update documentation references from "Task tool" to "Agent tool"
## Schema Compliance Fixes
### Agent Schema
- Add missing required `description` parameter in 6 files
- Add missing `run_in_background: false` for subagent calls
- Add missing `subagent_type` parameter
### AskUserQuestion Schema
- Fix issue-manage/SKILL.md: reduce options from 5 to 4 (max allowed)
### SendMessage Schema
- Fix team-worker.md: use correct params (type, content, summary)
- Remove invalid `team_name` parameter
### TaskCreate/TaskUpdate Schema
- Remove invalid `blockedBy`, `owner`, `status` from TaskCreate calls
- Use separate TaskUpdate calls for dependencies and ownership
- Fix TaskUpdate syntax to use object parameter
### TeamDelete Schema
- Remove parameters from TeamDelete() calls (should be no params)
### TaskOutput Schema
- Fix Python-style syntax to JavaScript object syntax
## Files Changed
- 146 files updated across commands/, skills/, skills_lib/, agents/
63 lines
1.7 KiB
Markdown
63 lines
1.7 KiB
Markdown
# Doc Generation Subagent
|
||
|
||
文档生成执行引擎。由 writer 主 agent 通过 Inner Loop 调用。
|
||
负责 CLI 多视角分析 + 模板填充 + 文件写入。
|
||
|
||
## Design Rationale
|
||
|
||
从 v4.0 的 writer 内联 CLI 执行,改为 subagent 隔离调用。
|
||
好处:CLI 调用的大量 token 消耗不污染 writer 主 agent 上下文,
|
||
writer 只拿到压缩摘要,可在多任务间保持上下文连续。
|
||
|
||
## Invocation
|
||
|
||
```
|
||
Agent({
|
||
subagent_type: "universal-executor",
|
||
run_in_background: false,
|
||
description: "Generate <doc-type>",
|
||
prompt: `## Document Generation: <doc-type>
|
||
|
||
### Session
|
||
- Folder: <session-folder>
|
||
- Spec config: <spec-config-path>
|
||
|
||
### Document Config
|
||
- Type: <product-brief | requirements | architecture | epics>
|
||
- Template: <template-path>
|
||
- Output: <output-path>
|
||
- Prior discussion: <discussion-file or "none">
|
||
|
||
### Writer Accumulator (prior decisions)
|
||
<JSON array of prior task summaries>
|
||
|
||
### Execution Strategy
|
||
<从 generate-doc.md 对应 doc-type 段落加载>
|
||
|
||
### Output Requirements
|
||
1. Write document to <output-path> (follow template + document-standards.md)
|
||
2. Return JSON summary:
|
||
{
|
||
"artifact_path": "<path>",
|
||
"summary": "<100-200字>",
|
||
"key_decisions": [],
|
||
"sections_generated": [],
|
||
"cross_references": [],
|
||
"warnings": []
|
||
}`
|
||
})
|
||
```
|
||
|
||
## Doc Type Strategies
|
||
|
||
(直接引用 generate-doc.md 的 DRAFT-001/002/003/004 策略,不重复)
|
||
See: roles/writer/commands/generate-doc.md
|
||
|
||
## Error Handling
|
||
|
||
| Scenario | Resolution |
|
||
|----------|------------|
|
||
| CLI 工具失败 | fallback chain: gemini → codex → claude |
|
||
| Template 不存在 | 返回错误 JSON |
|
||
| Prior doc 不存在 | 返回错误 JSON,writer 决定是否继续 |
|