[F]CCAF101
BootcampClassroomPracticeDemosBlogEnterpriseContact
Log inGet the guide
CCAF101

Ameureka × CCAF101 Chinese CCA-F / CCAF learning community.

  • X (Twitter)

Learning

  • Guide
  • Bootcamp waitlist

Service

  • Enterprise
  • Contact

Switch language

CCAF101 is an independent third-party learning community, not affiliated with, sponsored by, or authorized by Anthropic. CCAF, Claude, and CPN are products or trademarks of Anthropic; all trademark rights belong to their respective owners. For certification policy and exam information, always defer to Anthropic's official announcements.
© 2026 Ameureka × CCAF101
Privacy PolicyTerms of Service
Enterprise services by Ameureka; learning content by CCAF101.
CCAF101 · Claude Certified Architect - Foundations · MODULE 06

Task Decomposition任务分解

把大任务拆成子任务有两种活法:固定链式(步骤预先写死)和动态自适应(模型运行时决定子任务)。同一节课跑两遍,看清「按工作性质选模式」。

This demo is unofficial, original practice content written from public exam objectives — not real exam questions.

迭代 0/3·messages[2]
场景 · 用户「左边:把一张格式固定的发票转成标准模板(确定性工作)。右边:为一个新市场写一份调研简报(开放性工作)。」
可用工具plan_stepsweb_searchdraft_section
AGENTIC_LOOPPython
1# 模式一:固定链式 (steps hard-coded ahead of time)2def fixed_chain(raw_invoice: str) -> str:3    # Step 1 — 抽取字段(确定性,结构永远一样)4    fields = one_shot(5        "Extract sender, amount, due_date as JSON:",6        raw_invoice,7    )8    # Step 2 — 校验金额(纯规则,不需要模型自由发挥)9    checked = one_shot("Validate the amount field:", fields)10    # Step 3 — 渲染为标准模板11    return one_shot("Render this into the invoice template:", checked)12 13 14def one_shot(instruction: str, payload: str) -> str:15    resp = client.messages.create(16        model="claude-sonnet-4-6",17        messages=[{"role": "user", "content": f"{instruction}\n{payload}"}],18    )19    return resp.content[0].text20 21 22# 模式二:动态自适应分解 (model picks sub-tasks at runtime)23def dynamic_decompose(goal: str) -> str:24    messages = [{"role": "user", "content": goal}]25    while True:26        resp = client.messages.create(27            model="claude-sonnet-4-6",28            tools=tools,          # plan_steps / web_search / draft_section29            messages=messages,30        )31        messages.append({"role": "assistant", "content": resp.content})32        if resp.stop_reason == "end_turn":33            break34        results = []35        for block in resp.content:36            if block.type == "tool_use":37                out = run_tool(block.name, block.input)38                results.append({39                    "type": "tool_result",40                    "tool_use_id": block.id,41                    "content": out,42                })43        messages.append({"role": "user", "content": results})44    return messages[-1]["content"][0].text
Conversation Historymessages[2]
  1. USER · 用户

    把这张发票转成标准模板(左:确定性工作)。

  2. ASSISTANT · Claude

    Step 1 抽取(链上写死的一步):sender=Acme Co. · amount=1280.00 · due_date=2026-07-15。

stop_reason
end_turn
工具执行 · 本步

本步未发生工具调用。

GUIDE · 引路

左边的工作是确定性的:发票字段永远是发件人、金额、到期日。所以三步直接写进代码——抽取、校验、渲染。模型不需要「想」流程,每一步只做一件被指定好的事。能写死就别让模型即兴发挥。

固定链式 · 写死的步骤 · 3 tools