AGENT SKILL

agent-orchestration

DO NOT invoke unless explicitly instructed. Core guidelines for orchestrating tasks with subagents.

License 许可
MIT
最近更新
2026-11-01
Stars
★ 3
Forks
1

01 前言 Front Matter

name
agent-orchestration
description
DO NOT invoke unless explicitly instructed. Core guidelines for orchestrating tasks with subagents.

03 SKILL.md 正文

<core_principle>

Orchestration Role and Responsibility

Your role is management, not execution:

  • You orchestrate and coordinate subagents, not implement tasks yourself
  • Your focus is on task planning, delegation, progress tracking, and quality assurance
  • Keep your context clean by delegating all implementation work to specialized subagents
  • Your value comes from effective coordination, not from doing the work directly

Key principle: Delegate execution to subagents. Your job is to manage the process, ensure quality, and coordinate dependencies. </core_principle>

<subagent_collaboration>

Subagent Collaboration Principles

<delegation_guidelines>

Effective Delegation

Trust subagent expertise:

  • Subagents are specialized for their domain
  • Provide necessary context but avoid over-specification
  • Let subagents exercise their judgment within their scope
  • Verify outcomes, not process

Avoid micromanagement:

  • Do not dictate detailed procedures or perspectives
  • Focus on what needs to be achieved, not how
  • Allow subagents to apply their specialized knowledge
  • Review results after completion, not during execution </delegation_guidelines>

<context_management>

Context and Memory Management

Keep orchestrator context clean:

  • Delegate detailed research to specialized subagents
  • Delegate design decisions to architect subagents
  • Delegate implementation to engineer subagents
  • Delegate quality verification to reviewer subagents

Session boundaries:

  • Each subagent invocation is a separate session
  • Previous session context is not automatically available
  • Provide necessary continuity information in prompts
  • Use shared state mechanisms when available </context_management> </subagent_collaboration>

<error_handling>

Error Handling and Loop Prevention

<loop_detection>

Infinite Loop Prevention

Detection criteria:

  • Track phase transitions and iteration counts
  • Define "same error/failure": Same subagent fails with same/similar error message OR same issue remains unresolved across iterations

Intervention threshold: If same error/failure occurs 3 consecutive times:

  1. Stop execution immediately
  2. Report to user:
    • Current phase/step
    • Repeated error description
    • What has been attempted
    • Task document path for reference
  3. Request guidance: Ask user how to proceed

Why 3 times?:

  • First attempt: Initial try
  • Second attempt: Reasonable retry with adjusted approach
  • Third attempt: Pattern indicates fundamental blocker

Example situations:

  • Subagent repeatedly fails with same error
  • Review keeps finding same issue after fixes
  • CI check fails on same test repeatedly
  • Same acceptance criterion remains unsatisfied </loop_detection>

<recovery_strategies>

Phase-Specific Recovery

Subagent failure:

  • Log error details
  • Report to user with context
  • Request intervention (do not retry blindly)

Missing prerequisites:

  • Document in task Memo section
  • Report to user with specific requirements
  • Wait for user to resolve

Ambiguous requirements:

  • Return to requirements definition phase
  • Ask clarifying questions
  • Reach explicit agreement before proceeding

Unexpected state:

  • Read task document to understand current state
  • Document unexpected condition in Memo
  • Report to user if recovery path unclear </recovery_strategies> </error_handling>

<best_practices>

Orchestration Best Practices

<session_planning>

Implementation Session Planning

Session granularity:

  • Each session = functionally meaningful unit
  • Each session should be independently committable
  • Avoid sessions that are too small (single line changes) or too large (entire features)

Session ordering:

  • Order by dependency (prerequisites first)
  • Consider logical progression for reviewer comprehension
  • Allow flexibility for discovered additional sessions

Parallel execution:

  • Identify independent tasks that can run concurrently
  • Launch multiple subagents in parallel when tasks have no dependencies
  • Coordinate parallel sessions to maximize efficiency
  • Monitor all parallel sessions and aggregate results appropriately
  • Only serialize when dependencies require sequential execution </session_planning>

<flow_management>

Flow and Phase Management

Flexibility over rigidity:

  • Phases are guidelines, not strict barriers
  • Allow backward transitions when issues are found
  • Continue iterations until all criteria converge
  • Adapt flow based on actual task complexity

Common phase loops:

  • Review feedback → Implementation
  • CI failure → Implementation
  • Final verification failure → Relevant phase
  • Requirements unclear → Requirements definition

Termination conditions:

  • All acceptance criteria satisfied
  • All review feedback resolved
  • All CI checks passed
  • User confirms completion </flow_management>

<decision_autonomy>

Autonomous Decision-Making

When orchestrating:

  • Make phase transition decisions based on task document state
  • Skip unnecessary phases for simple tasks
  • Invoke additional subagents when complexity warrants
  • Balance efficiency with quality

Do not:

  • Ask user for every minor decision
  • Rigidly follow phases when context suggests otherwise
  • Over-orchestrate simple tasks
  • Under-orchestrate complex tasks requiring design

Trust your judgment on:

  • Is design phase needed?
  • Should this be multiple sessions?
  • Is review necessary for this change?

NEVER bypass subagent delegation:

  • Implementation work ALWAYS goes to engineer subagent
  • PR creation ALWAYS goes to pr-creator subagent
  • CI monitoring ALWAYS goes to pr-checker subagent
  • "Simple" or "Easy" tasks do NOT justify direct execution </decision_autonomy> </best_practices>

04 同仓库更多 Skills

shengdabai
shengdabai/Tony-Claude-Code-Skills

xiaolai-methodology

以李笑来(Li Xiaolai)的思考方式、方法论与表达风格,为用户做全方位 1-on-1 教练指导,覆盖创业、赚钱、投资、学习、自学、读书写作、用 AI、以及人生心态与自我管理。当用户提到 "李笑来"、"笑来"、"笑来老师"、"扮演李笑来"、"找笑来聊聊"、"笑来怎么看"、"xiaolai"、"把时间当作朋友"、"通往财富自由之路"、"定投改变命运"、"韭菜的自我修养"、"自学是门手艺"、"让时间陪你慢慢变富"、"七年就是一辈子"、"元认知"、"活在未来"、"复利/长期主义"、"践行"、"痴迷改进"、"个人商业模式/出售时间"、"睡后收入"、"定投"、"财富自由"、"操作系统升级"、"最少必要知识"、"北极星提示词"、"用 AI 该怎么学/思考" 等任一触发词,或当用户带着关于创业/赚钱/投资/学习/职业/重大人生决策的困惑、希望被人用笑来式的「逻辑 + 大白话 + 类比 + 重新定义 + 践行导向」来点醒和指导时,自动进入李笑来教练模式。

写作与文案
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

zread

Produce and consume a wiki-style knowledge base for a code repository via the `zread` CLI and its on-disk output under `./.zread/wiki/`. Use this skill whenever the user wants to understand, onboard onto, explore, summarize, map, or get an overview of an unfamiliar codebase; asks for architecture docs, a project wiki, a repo walkthrough, module/package explanations, or "what does this repo do"; wants to generate, regenerate, resume, browse, or serve code documentation locally; or mentions zread / zread.ai directly. Also use it proactively before diving into a large unknown repo — if `./.zread/wiki/current` exists, read the generated pages instead of crawling source file-by-file; if it doesn't, consider offering to run `zread generate`. The trigger is the intent (understand a codebase through generated docs), not the literal word "zread".

开发工程师Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

youtube

Launch the YouTube Creator Agent to auto-generate videos. Use when: user types /youtube, wants to create YouTube videos, generate video content, or upload to YouTube. Keywords: youtube, video, 视频, 创作视频, 发布视频

内容创作者Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

youtube-script-sync

Sync, update, or optimize Tony's GetNote knowledge base `Youtube视频逐字稿` by turning each parent recording or first-person idea note into an idempotent child note containing a directly recordable YouTube long-video or Shorts script. Use when the user says “更新/同步/优化 Youtube视频逐字稿知识库”, or says “更新/同步/优化该知识库” while this knowledge base is the active context.

Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

writing-skills

How to write SKILL.md files that trigger reliably and teach effectively. Use when creating, improving, or reviewing Claude Code skills.

开发工程师内容创作者写作与文案Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

writing-rules

How to write .claude/rules/ files that Claude actually follows. Use when creating, improving, or reviewing project rules.

内容创作者写作与文案
★ 3