Marketplace

delegate-first

Behavioral principle for context preservation through strategic delegation. Use when starting multi-step operations, uncertain about scope, or when direct execution might exhaust context. Complements never-guess and resolve-ambiguity skills.

allowed_tools: Task, AskUserQuestion, Read

$ Instalar

git clone https://github.com/rayk/lucid-toolkit /tmp/lucid-toolkit && cp -r /tmp/lucid-toolkit/plugins/luc/skills/delegate-first ~/.claude/skills/lucid-toolkit

// tip: Run this command in your terminal to install the skill


name: delegate-first description: Behavioral principle for context preservation through strategic delegation. Use when starting multi-step operations, uncertain about scope, or when direct execution might exhaust context. Complements never-guess and resolve-ambiguity skills. allowed-tools:

  • Task
  • AskUserQuestion
  • Read

Main context tokens are MORE valuable than subagent tokens. Subagent contexts are ephemeral and infinitely spawnable. Main context exhaustion = session death.

This skill governs delegation decisions. It complements never-guess (don't fabricate when uncertain about facts) and resolve-ambiguity (how to gather missing information).

<quick_start> <core_principle> Before executing ANY operation, verify absolute certainty:

  1. Do I have exact file path(s)? (Not function name, not directory, not pattern)
  2. Is this 1-2 tool calls with predictable output?
  3. Have I done fewer than 3 direct operations since last delegation?

If ANY answer is NO → Delegate via Task tool. </core_principle>

<certainty_definition> CERTAIN (execute directly):

  • User provides EXACT file path: "Edit src/auth/login.ts line 50"
  • Single file, single operation, path in hand
  • Output size is predictable and small

UNCERTAIN (delegate):

  • User provides function/class name without path
  • User provides directory or category ("all files in X")
  • User provides error message without file location
  • Scope is unknown (could be 1 file or 20)
  • Output size is unpredictable or large

Rule: If you would need Grep/Glob/Read to find the location, you don't have certainty—you have a search needle. </certainty_definition> </quick_start>

<delegation_traps> User gives specific request but you don't know WHERE or HOW MANY.

<anti_pattern> Starting Grep/Glob directly in main context to "quickly find" the location. This loads search results into main context—the search itself should be delegated. </anti_pattern>

<dangerous_tools>

  • Analyzers: dart analyze, eslint, tsc --noEmit, pylint
  • Test runners: pytest, jest, flutter test, cargo test
  • Build tools: flutter build, npm run build, cargo build
  • Linters with file output </dangerous_tools>

<research_indicators> Recent turns contained:

  • WebSearch calls
  • Multiple Read operations
  • Grep/Glob exploration
  • Task(Explore) results </research_indicators>

<action_indicators> Current request contains:

  • Edit/Write language ("update", "fix", "change", "remove", "add")
  • Mutation verbs applied to researched content
  • References to findings ("the files we found", "based on analysis") </action_indicators>

This is TRANSITION. Delegate the action phase. Task(general-purpose): "Update architecture docs to consolidate duplications based on analysis" </delegation_traps>

<decision_tree> User Request Received │ ├─► Contains "find where", "review all", "search for", "what files"? │ └─► YES → Task(Explore) IMMEDIATELY │ ├─► Has EXACT file path(s) provided by user? │ ├─► YES + 1-2 predictable ops → Direct execution OK │ └─► NO → Task(Explore) to find locations first │ ├─► Previous Task returned with errors/issues? │ └─► YES → Task(luc:fix-phase) for fixes │ DO NOT switch to direct debugging │ ├─► Will call large-output MCP tool (analyzer, test runner, build)? │ └─► YES → Task(luc:output-analyzer) wrapper │ ├─► Done ≥2 Reads or ≥3 Edits since last Task? │ └─► YES → Delegate remainder to Task │ ├─► Just finished research phase, now doing action? │ └─► YES → Task(general-purpose) for action phase │ └─► Single known file, 1-2 ops, small predictable output? └─► YES → Direct execution OK </decision_tree>

<delegation_targets> For: Finding locations, understanding scope, research When: "Find where", unknown file paths, exploration needed

When uncertain about facts → never-guess → resolve-ambiguity When uncertain about scope → delegate-first → Task delegation </with_never_guess>

<with_resolve_ambiguity> resolve-ambiguity gathers missing INFORMATION. delegate-first protects CONTEXT during execution.

If you need to resolve ambiguity about what to do → resolve-ambiguity If you know what to do but scope is uncertain → delegate-first </with_resolve_ambiguity>

<trade_off> False positives (unnecessary delegation) are acceptable. Context exhaustion is not.

A Task that "wasn't necessary" costs ~500 tokens overhead. Direct execution that exhausts context kills the session.

Err toward delegation. </trade_off>

<anti_patterns> Wrong: "Let me quickly grep for this" (loads results into main context) Right: Task(Explore): "Find where X is defined"

<success_criteria> The principle is working when:

  • Main context stays under 50% for extended sessions
  • Research phases delegate to Task(Explore)
  • Implementation phases delegate to Task(general-purpose)
  • Debug phases delegate to Task(luc:fix-phase)
  • Large MCP outputs never enter main context
  • Session longevity increases 3-5x for complex work
  • Direct execution is rare exception, not default </success_criteria>