AgentSkillsCN

delegate-implementation

通过将工作分解为专注的子问题,实现功能、Bug 修复、重构以及代码变更的落地。无论是在编写、修改还是创建代码时,都可使用此方法。适用于用户希望在代码库中实现、构建、创建、添加、修复、更新、重构或更改任何内容时使用。

SKILL.md
--- frontmatter
name: delegate-implementation
description: Implements features, bug fixes, refactoring, and code changes by breaking work into focused sub-problems. Use whenever writing, modifying, or creating code. Use when the user asks to implement, build, create, add, fix, update, refactor, or change anything in the codebase.

Delegate Implementation

Decompose tasks into non-overlapping sub-problems and delegate each to the appropriate expert running in isolation.

Core Principle

Every implementation task must be decomposed and delegated. Do not implement directly. Instead:

  1. Break down into non-overlapping sub-problems (maximum 5)
  2. Identify the expert for each sub-problem
  3. Execute subagents (with concurrency limits)

Step 1: Decompose the Task

Break the task into non-overlapping sub-problems (maximum 5):

  • Non-overlapping: Sub-problems should not conflict with each other
  • Self-contained: Each sub-problem can be completed and verified by the expert

Decomposition Guidelines

  1. Separate by stack: Backend work vs Frontend work
  2. Separate by feature boundary: Distinct capabilities become separate sub-problems
  3. Keep it coarse: Aim for 1-5 sub-problems, not too granular steps

Step 2: Identify Expert per Sub-problem

For each sub-problem, determine the expert:

ExpertWhen to Use
Backend ExpertServer-side logic, API endpoints, business rules, data persistence, validation, background processing, authentication/authorization
Frontend Expertvisual components, client-side state, presentation logic, form handling, navigation, client-side implementation
UI-UX DesignerUser interface, user interactions, visual components design ideas
QA ExpertServer-site and client-site testing, unit, integration, e2e tests

Step 3: Execute Subagents

Run #tool:runSubagent tool, instructing the agent to work autonomously over the given sub-problem.

Execution

Execute subagents for each sub-problem, ensuring their work stays non-conflicting.

Simultaneous execution is allowed only when BOTH are true:

  1. Non-overlapping implementation work: No shared files, components, or shared state that could conflict.
  2. Different expert types: The subagents are different experts.

Exception (Allowed): Backend + Frontend may work simultaneously against the same API as long as the API protocol/contract is explicitly agreed upfront (routes, request/response payloads, error shapes, and auth assumptions) and treated as the source of truth.

Hard rule: never run two subagents of the same expert type simultaneously.

  • ✅ May run simultaneously: Backend Expert + UI-UX Designer + QA Expert (including when coordinating on the same API via an agreed contract)
  • ✅ May run simultaneously: Backend Expert + Frontend Expert + QA Expert (including when coordinating on the same API via an agreed contract)
  • ❌ Must not run simultaneously: Backend Expert + Backend Expert
  • ❌ Must not run simultaneously: Frontend Expert + Frontend Expert
  • ❌ Must not run simultaneously: UI-UX Designer + UI-UX Designer
  • ❌ Must not run simultaneously: UI-UX Designer + Frontend Expert
  • ❌ Must not run simultaneously: QA Expert + QA Expert

If there are dependencies between sub-problems (e.g., UI depends on an API contract), execute the prerequisite sub-problem first.

Subagent Prompt Structure

Each subagent prompt must include:

  1. Sub-problem description: Clear description of what to implement
  2. Acceptance criteria: What defines "done" for this sub-problem
  3. Prohibitions: The subagent should avoid further delegation - it must implement the assigned sub-problem autonomously. Prohibit the subsequent use of this "delegate-implementation" skill.

Example

Task: "Generate a searchable PDF in the background and allow users to download it from the UI."

Decomposition

#Sub-problemExpert
1Define the API contract (endpoints, DTOs, errors) for downloading a searchable PDFBackend
2Add a file-conversion implementation to generate searchable PDFs, plus the required background operation and executorBackend
3Introduce a new user action: "download_searchable_pdf"Backend
4Implement the "download searchable PDF" endpoint (wired to the background operation and conversion output)Backend
5Elevate the user experience for the interface, making application more intuitive, accessible, and delightful to use.UI-UX Designer
6Add the "Download Searchable PDF" UI (button/action + download flow)Frontend
7Implement unit, integration, e2e, performance, security tests for the Backend and Frontend functionalityQA Expert
8Run the tests and return errors to the appoprites subagents for fixingQA Expert

Execution

  1. Run Backend Expert subagent for sub-problem 1 and treat the output as the source-of-truth API contract.
  2. Then start simultaneous execution of:
    • Sub-problem 5 (Frontend Expert), and
    • Sub-problems 2 → 3 → 4 (Backend Expert).
  3. Backend sub-problems (2 → 3 → 4) execute sequentially due to the concurrency limitation (no Backend + Backend parallelism).

Guardrails

  • Always decompose first: Never implement directly without decomposition
  • Maximum 5 sub-problems: Keep decomposition coarse, not granular
  • Concurrency limitations: Never run same expert types simultaneously; Backend + Frontend may run simultaneously when implementation work is non-overlapping (API contract coordination is allowed if agreed upfront)
  • Experts validate internally: Each expert runs their own guardrails