Fetching latest headlinesโ€ฆ
4-Phase Orchestration: 5 Universal Agent Skills with YAML-Driven Rules, Composable Components, and Graceful Degradation
NORTH AMERICA
๐Ÿ‡บ๐Ÿ‡ธ United Statesโ€ขJuly 1, 2026

4-Phase Orchestration: 5 Universal Agent Skills with YAML-Driven Rules, Composable Components, and Graceful Degradation

0 views0 likes0 comments
Originally published byDev.to

4-Phase Orchestration: How 5 Universal Agent Skills Achieve YAML-Driven Rules + Composable Components + Graceful Degradation

When you're hard-coding your 3rd scoring if-else, maybe it's time to ask: can I move the rules into YAML and let the business change config instead of code?

The Problem: Why Do Agent Skills Keep Reinventing the Wheel?

Every Agent developer faces the same dilemma โ€” every business scenario rewrites a similar pipeline:

  • Scoring: Extract features โ†’ Match rules โ†’ Calculate score โ†’ Generate report
  • Complaints: Extract ticket โ†’ Cross-validate โ†’ Pinpoint root cause โ†’ Archive
  • Querying: Understand intent โ†’ Build SQL โ†’ Execute query โ†’ Render chart

The skeleton is identical. What changes is only the "content" at each step. Yet every team builds pipelines from scratch.

teleagent-skills offers an answer: freeze the skeleton into 5 universal Skills with 4-Phase orchestration, and let business changes live in YAML config only.

Architecture Overview: 4-Phase Pipeline + 5 Universal Skills

2.1 4-Phase Orchestration Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Upper Business Skill                      โ”‚
โ”‚  (Scoring Engine / Evidence Chain / Data Aggregator / ...)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚          โ”‚          โ”‚          โ”‚
           โ–ผ          โ–ผ          โ–ผ          โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Phase 1  โ”‚โ”‚ Phase 2  โ”‚โ”‚ Phase 3  โ”‚โ”‚ Phase 4  โ”‚
    โ”‚ Extract  โ”‚โ”‚ Analyze  โ”‚โ”‚ Generate โ”‚โ”‚ Archive  โ”‚
    โ”‚          โ”‚โ”‚          โ”‚โ”‚          โ”‚โ”‚          โ”‚
    โ”‚Info-     โ”‚โ”‚Data-     โ”‚โ”‚Report-   โ”‚โ”‚Archive-  โ”‚
    โ”‚Extractor โ”‚โ”‚Analyst   โ”‚โ”‚Generator โ”‚โ”‚Manager   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚           โ”‚           โ”‚           โ”‚
         โ–ผ           โ–ผ           โ–ผ           โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚          JSON Contract (Structured Data Contract) โ”‚
    โ”‚   phase1_output.json โ†’ phase2_input.json โ†’ ...  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Core idea: each Phase is an independent component, and Phases pass data only through JSON contracts.

  • Any Phase can be replaced (want a more powerful Analyzer? Swap it out)
  • Any Phase can be skipped (degradation mode)
  • Any Phase can be reused (5 Skills share the same Extract component)

2.2 JSON Contract Example

{
  "phase": "extract",
  "skill": "scoring-engine",
  "output": {
    "entities": [
      {
        "name": "ๅฎขๆˆทA",
        "type": "enterprise_customer",
        "attributes": {
          "annual_revenue": 50000000,
          "employee_count": 320,
          "industry": "ๅˆถ้€ "
        }
      }
    ],
    "metadata": {
      "extraction_time": "2026-07-01T10:30:00Z",
      "source": "CRM_API",
      "confidence": 0.92
    }
  },
  "next_phase": "analyze"
}

Three Design Principles, Deep Dive

Principle 1: YAML-Driven, Parameterized Rules

The traditional approach hard-codes scoring rules:

# Hard-coded โ€” every business change means a code change
if customer.revenue > 10000000:
    score += 30
elif customer.revenue > 5000000:
    score += 20

teleagent-skills does it differently โ€” all rules are externalized to YAML:

# scoring_rules.yaml
scoring_engine:
  name: "ๆ”ฟไผๅฎขๆˆทๅ•†ๆœบ่ฏ„ๅˆ†"
  version: "2.1"
  dimensions:
    - id: revenue
      name: "่ฅๆ”ถ่ง„ๆจก"
      weight: 0.30
      rules:
        - condition: "attributes.annual_revenue >= 100000000"
          score: 30
          label: "่ถ…ๅคงๅž‹"
        - condition: "attributes.annual_revenue >= 50000000"
          score: 20
          label: "ๅคงๅž‹"
        - condition: "attributes.annual_revenue >= 10000000"
          score: 10
          label: "ไธญๅž‹"
    - id: industry
      name: "่กŒไธšๅฑžๆ€ง"
      weight: 0.25
      rules:
        - condition: "attributes.industry in ['้‡‘่ž','ๅŒป็–—']"
          score: 25
          label: "้ซ˜ไปทๅ€ผ่กŒไธš"
    - id: growth
      name: "ๅขž้•ฟๆฝœๅŠ›"
      weight: 0.20
    - id: connectivity
      name: "ๆŽฅๅ…ฅๆˆ็†Ÿๅบฆ"
      weight: 0.15
    - id: decision_chain
      name: "ๅ†ณ็ญ–้“พๆธ…ๆ™ฐๅบฆ"
      weight: 0.10
  thresholds:
    high: 70
    medium: 40
    low: 0

Business changed? Edit YAML. Need a new dimension? Add YAML. Zero code changes.

Principle 2: Composable Components โ€” 4-Phase Orchestration + JSON Contracts

All 5 Skills share the same 4-Phase skeleton, but each Skill's Phase behavior differs:

Skill Phase 1 Extract Phase 2 Analyze Phase 3 Generate Phase 4 Archive
Scoring Engine Extract scoring object attributes Load YAML rules & match scores Generate scoring report + recommendations Archive scoring records
Evidence Chain Extract evidence from multiple sources Cross-validate + conflict detection Generate evidence chain report Archive validation records
Data Aggregator Validate & clean raw data Aggregation + YoY/MoM calculation Output statistical report Archive aggregated results
Visualization Renderer Analyze data characteristics Generate ECharts config Render HTML/Dashboard Cache chart assets
NL2Query Extract query intent + entities Build SQL + confidence assessment Format query results Record query logs

The power of composability: upper-level Skills can chain lower-level Skills on demand. For example, the data query gateway pipeline:

NL2Query(Phase1-2) โ†’ Data Aggregator(Phase1-2) โ†’ Visualization Renderer(Phase1-3)

One natural language query automatically flows through "understand โ†’ query โ†’ aggregate โ†’ visualize" end to end.

Principle 3: Graceful Degradation โ€” When Sub-Components Fail

The 4-Phase architecture has built-in 3-tier degradation:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Phase 1   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Phase 2   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Phase 3   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Phase 4   โ”‚
โ”‚   Extract   โ”‚     โ”‚   Analyze   โ”‚     โ”‚   Generate  โ”‚     โ”‚   Archive   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                   โ”‚                   โ”‚                   โ”‚
       โ–ผ                   โ–ผ                   โ–ผ                   โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Return   โ”‚       โ”‚ Skip     โ”‚       โ”‚ Simplify โ”‚       โ”‚ Local    โ”‚
  โ”‚ raw      โ”‚       โ”‚ analysis โ”‚       โ”‚ template โ”‚       โ”‚ cache +  โ”‚
  โ”‚ input +  โ”‚       โ”‚ mark low โ”‚       โ”‚ raw data โ”‚       โ”‚ deferred โ”‚
  โ”‚ conf=0   โ”‚       โ”‚ confidenceโ”‚      โ”‚ passthroughโ”‚      โ”‚ retry    โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The core principle of degradation: I'd rather give the user a low-confidence result than crash with an error.

The 5 Skills, One by One

4.1 Scoring Engine

What it is: A multi-dimensional weighted scoring component driven by YAML rule configs.

Typical scenarios: enterprise opportunity scoring, vendor evaluation, customer churn prediction, partner tiering.

Input โ†’ Rule matching โ†’ Scoring output flow:

{
  "customer": "ๅฎขๆˆทA",
  "total_score": 78,
  "grade": "A็บง-้‡็‚น่ทŸ่ฟ›",
  "dimension_breakdown": {
    "revenue": { "score": 20, "max": 30, "label": "ๅคงๅž‹" },
    "industry": { "score": 15, "max": 25, "label": "ไธญไปทๅ€ผ่กŒไธš" },
    "growth": { "score": 20, "max": 20 },
    "connectivity": { "score": 15, "max": 15 },
    "decision_chain": { "score": 8, "max": 10 }
  },
  "recommendation": "ๅปบ่ฎฎๅฎ‰ๆŽ’ไธ“ๅฑžๅฎขๆˆท็ป็†๏ผŒไผ˜ๅ…ˆๆŽจ่5Gไธ“็ฝ‘+ไบ‘็ฝ‘่žๅˆๆ–นๆกˆ"
}

4.2 Evidence Chain

What it is: A multi-source evidence cross-validation component that detects conflicts, evaluates confidence, and pinpoints root causes.

Data Source 1: Customer complaints    โ”€โ”€โ”
                                         โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
Data Source 2: System alert logs      โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ–ถโ”‚  Evidence Chain  โ”‚
                                         โ”‚     โ”‚  Phase2: Analyze โ”‚
Data Source 3: SLA monitoring data    โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                  โ”‚
                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
                          โ”‚ Cross-validation:      โ”‚
                          โ”‚ โ€ข Complaint: "2hr outage"
                          โ”‚ โ€ข Alert: "optical attenuation"โ”‚
                          โ”‚ โ€ข SLA: "99.1% availability" โ”‚
                          โ”‚ Conflict detected:      โ”‚
                          โ”‚ Complaint vs SLA surface contradictionโ”‚
                          โ”‚ Root cause="optical attenuation": 0.87โ”‚
                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

4.3 Data Aggregator

What it is: A raw data re-processing component supporting validation/cleaning, aggregation, YoY/MoM, and TOP rankings.

Raw query results           Aggregator output
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 300 rows of  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ โ”‚ Monthly summary + YoY/MoM    โ”‚
โ”‚ detail data  โ”‚         โ”‚ TOP10 ranking                โ”‚
โ”‚ (region x    โ”‚         โ”‚ Anomaly flags (>2ฯƒ)          โ”‚
โ”‚  month)      โ”‚         โ”‚ Trend direction              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

4.4 Visualization Renderer

What it is: An automated rendering component that turns structured data into ECharts charts and Dashboards.

Chart type selection is automatic: time-series โ†’ line chart, categorical โ†’ bar/pie, multi-dimensional โ†’ radar.

4.5 NL2Query

What it is: A smart natural-language-to-structured-query conversion component.

User input: "ๅŽไธœๅŒบไธŠๆœˆ5Gไธ“็ฝ‘ๆ–ฐๅขžๅฎขๆˆทๆ•ฐ"

Phase1 Extract:  intent="query", entities=[region="ๅŽไธœ", time="ไธŠๆœˆ", metric="5Gไธ“็ฝ‘"]
Phase2 Analyze:  Generate SQL + confidence 0.88
Phase3 Generate: Format results
Phase4 Archive:  Record query log

Confidence scoring: When confidence drops below a threshold, the output gets a "low confidence" warning and shows the SQL for human review.

Industry Use-Case Matrix

Industry Scoring Engine Evidence Chain Data Aggregator Viz Renderer NL2Query
Finance Customer credit rating Anti-money-laundering multi-source verification Transaction volume YoY/MoM Risk control dashboard "Check a customer's last 3 months of transactions"
Manufacturing Supplier evaluation QA vs. production line verification Line OEE statistics Capacity dashboard "Check line A's yield this month"
Retail Member value scoring Data conflict detection SKU sales aggregation Sales heatmap "Top sellers in East China"
Healthcare Patient risk stratification Diagnosis vs. lab verification Department admission stats Bed occupancy dashboard "Available beds in cardiology"

Key insight: All 5 Skills adapt to different industries purely through YAML rule configs. The scoring engine code logic is identical โ€” only the YAML files differ.

How This Fundamentally Differs from Existing Frameworks

Dimension LangChain/LlamaIndex AutoGen/CrewAI teleagent-skills
Orchestration Code-level Chain Multi-Agent dialogue 4-Phase declarative orchestration
Rule management Hard-coded in code Described in prompts YAML parameterized config
Degradation strategy try-catch Retry dialogue Declarative degradation config
Business adaptation Change code Change prompts Change YAML

Quick Start

git clone https://github.com/yuzhaopeng-up/teleagent-skills.git
cd teleagent-skills

# Scoring engine example
cp skills/scoring-engine/config/scoring_rules.yaml my_rules.yaml
# Edit my_rules.yaml to customize your scoring dimensions
# Copy the Skill directory into your Agent platform's skills directory

License: Apache 2.0

Agent Skills Open-Source Ecosystem

Repo What It Does GitHub
financial-ai-skills Financial AI skill library: 104 scenarios, pure Python https://github.com/yuzhaopeng-up/financial-ai-skills
teleagent-skills 5 universal business Skills: 4-Phase orchestration + YAML-driven rules https://github.com/yuzhaopeng-up/teleagent-skills
agent-cluster-comm Multi-Agent cluster 5-layer communication architecture https://github.com/yuzhaopeng-up/agent-cluster-comm
skill-framework Skill governance framework: L0-L4 classification + YAML templates + Python tools https://github.com/yuzhaopeng-up/skill-framework
fintech-h5-demos 12 zero-dependency financial H5 dashboard demos https://github.com/yuzhaopeng-up/fintech-h5-demos

Stop building pipelines from scratch. The 4-Phase skeleton is ready โ€” you just need to write YAML.

Star teleagent-skills and let's standardize Agent Skills together.

Comments (0)

Sign in to join the discussion

Be the first to comment!