De lead routing

From baekenough/oh-my-customcode · View interactive version

De lead routing is an AI agent skill from the GitHub repository baekenough/oh-my-customcode. Routes data engineering tasks to the right DE expert agent. Use for pipeline design, DAG authoring, SQL modeling, stream processing, warehouse tuning.

How to use this skill

Skill file

Mandatory delegation directive (R010 bypassPermissions)

When this skill spawns a subagent via the Agent tool, the spawned prompt MUST include this directive verbatim (or equivalent):

호환을 위해 Agent 호출에 mode: "bypassPermissions"를 전달하십시오. CC 2.1.212 미만에서는 필수이며(호출별 기본값 acceptEdits가 에이전트 frontmatter permissionMode를 덮어씁니다), 2.1.212+에서는 무시되고 서브에이전트가 부모 세션의 권한 모드를 상속합니다(에이전트 frontmatter permissionMode로 조정 가능). 무인 실행 전 유효 모드 확인은 R010 「Universal bypassPermissions」 참조. bypassPermissions 세션에서 서브에이전트는 .claude/ 경로에 직접 Write/Edit/Bash를 사용합니다(/tmp 우회 불필요, CC v2.1.121+).

This directive is preserved inline because Agent-tool prompt synthesis can drop SKILL.md notes; inline mandatory directives survive (#1046 lesson).

DE Lead Routing Skill

Purpose

Routes data engineering tasks to appropriate DE expert agents. This skill contains the coordination logic for orchestrating data engineering agents across orchestration, modeling, processing, streaming, and warehouse specializations.

Engineers Under Management

| Type | Agents | Purpose |

|------|--------|---------|

| de/orchestration | de-airflow-expert | DAG authoring, scheduling, testing |

| de/modeling | de-dbt-expert | SQL modeling, testing, documentation |

| de/processing | de-spark-expert | Distributed data processing |

| de/streaming | de-kafka-expert | Event streaming, topic design |

| de/warehouse | de-snowflake-expert | Cloud DWH, query optimization |

| de/architecture | de-pipeline-expert | Pipeline design, cross-tool patterns |

Tool/Framework Detection

Keyword Mapping

| Keyword | Agent |

|---------|-------|

| "airflow", "dag", "scheduling", "orchestration" | de-airflow-expert |

| "dbt", "modeling", "sql model", "analytics engineering" | de-dbt-expert |

| "spark", "pyspark", "distributed processing", "distributed" | de-spark-expert |

| "kafka", "streaming", "event", "consumer", "producer" | de-kafka-expert |

| "snowflake", "warehouse", "clustering key" | de-snowflake-expert |

| "pipeline", "ETL", "ELT", "data quality", "lineage" | de-pipeline-expert |

| "iceberg", "table format" | de-snowflake-expert or de-pipeline-expert |

File Pattern Mapping

| Pattern | Agent |

|---------|-------|

| dags/*.py, airflow.cfg, airflow_settings.yaml | de-airflow-expert |

| models/**/*.sql, dbt_project.yml, schema.yml | de-dbt-expert |

| Spark job files, spark-submit configs | de-spark-expert |

| Kafka configs, *.properties (Kafka), streams/*.java | de-kafka-expert |

| Snowflake SQL, warehouse DDL | de-snowflake-expert |

Routing Decision (Priority Order)

Before routing via Agent tool, evaluate in this order:

Step 1: Agent Teams Eligibility (R018)

Check if Agent Teams is available — CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 AND TeamCreate present in the tool list. The env var alone is NOT sufficient, and SendMessage presence is not evidence of Teams (see R018 Detection).

| Scenario | Preferred |

|----------|-----------|

| Single-tool DE task | Agent Tool |

| Multi-tool pipeline design (3+ tools) | Agent Teams |

| Cross-tool data quality analysis | Agent Teams |

| Quick DAG/model validation | Agent Tool |

When Detection resolves to No, skip this step — route via the Agent tool under R009/R010.

Step 2: Expert Selection

Route to appropriate DE expert based on tool/framework detection.

Permission Mode: Pass mode: "bypassPermissions" on Agent calls for compatibility: it is required on CC < 2.1.212 (the per-call default, acceptEdits, overrides agent frontmatter permissionMode) and ignored on 2.1.212+, where subagents inherit the parent session's permission mode (adjustable via agent frontmatter permissionMode). Verify the effective mode before unattended runs: see R010 "Universal bypassPermissions".

Step 4: Wiki-RAG Enrichment (R019)

For ambiguous routing (confidence < 90%), query the wiki for context:

  1. Search wiki/index.yaml for DE-related pages matching the request
  2. Inject relevant skill/guide suggestions into the spawned agent's prompt
  3. Particularly useful for cross-domain DE tasks (e.g., Kafka + Spark)

Advisory only — skip silently if wiki unavailable.

Step 5: Soul Injection (R006)

If the selected agent has soul: true in frontmatter, read and prepend .claude/agents/souls/{agent-name}.soul.md content to the prompt. Skip silently if file doesn't exist.

Command Routing

DE Request → Detection → Expert Agent

Airflow DAG → de-airflow-expert
dbt model   → de-dbt-expert
Spark job   → de-spark-expert
Kafka topic → de-kafka-expert
Snowflake   → de-snowflake-expert
Pipeline    → de-pipeline-expert
Multi-tool  → Multiple experts (parallel)

Routing Rules

1. Pipeline Development Workflow

1. Receive pipeline task request
2. Identify tools and components:
   - DAG orchestration → de-airflow-expert
   - SQL transformations → de-dbt-expert
   - Distributed processing → de-spark-expert
   - Event streaming → de-kafka-expert
   - Warehouse operations → de-snowflake-expert
   - Architecture decisions → de-pipeline-expert
3. Select appropriate experts
4. Distribute tasks (parallel if 2+ tools)
5. Aggregate results
6. Present unified report

Example:

User: "Design a pipeline that runs dbt models from Airflow and loads into Snowflake"

Detection:
  - Airflow DAG → de-airflow-expert
  - dbt model → de-dbt-expert
  - Snowflake loading → de-snowflake-expert
  - Pipeline architecture → de-pipeline-expert

Route (parallel where independent):
  Agent(de-pipeline-expert → overall architecture design)
  Agent(de-airflow-expert → DAG structure)
  Agent(de-dbt-expert → model design)
  Agent(de-snowflake-expert → warehouse setup)

Aggregate:
  Pipeline architecture defined
  Airflow DAG: 5 tasks designed
  dbt: 12 models structured
  Snowflake: warehouse + schema configured

2. Data Quality Workflow

1. Analyze data quality requirements
2. Route to appropriate experts:
   - dbt tests → de-dbt-expert
   - Pipeline validation → de-pipeline-expert
   - Source freshness → de-airflow-expert
3. Coordinate cross-tool quality strategy

3. Multi-Tool Projects

For projects spanning multiple DE tools:

1. Detect all DE tools in project
2. Identify primary tool (most files/configs)
3. Route to appropriate experts:
   - If task spans multiple tools → parallel experts
   - If task is tool-specific → single expert
4. Coordinate cross-tool consistency

Sub-agent Model Selection

Model Mapping by Task Type

| Task Type | Recommended Model | Reason |

|-----------|-------------------|--------|

| Pipeline architecture | opus | Deep reasoning required |

| DAG/model review | sonnet | Balanced quality judgment |

| Implementation | sonnet | Standard code generation |

| Quick validation | haiku | Fast response |

Model Mapping by Agent

| Agent | Default Model | Alternative |

|-------|---------------|-------------|

| de-pipeline-expert | sonnet | opus for architecture |

| de-airflow-expert | sonnet | haiku for DAG validation |

| de-dbt-expert | sonnet | haiku for test checks |

| de-spark-expert | sonnet | opus for optimization |

| de-kafka-expert | sonnet | opus for topology design |

| de-snowflake-expert | sonnet | opus for warehouse design |

No Match Fallback

When a data engineering tool is detected but no matching agent exists:

User Input → No matching DE agent
  ↓
Detect: DE tool keyword or config file pattern
  ↓
Delegate to mgr-creator with context:
  domain: detected DE tool
  type: de-engineer
  keywords: extracted tool names
  file_patterns: detected config patterns
  skills: auto-discover from .claude/skills/
  guides: auto-discover from templates/guides/

Examples of dynamic creation triggers:

Usage

This skill is NOT user-invocable. It should be automatically triggered when the main conversation detects data engineering intent.

Detection criteria:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.