{"slug": "4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable", "title": "4-Phase Orchestration: 5 Universal Agent Skills with YAML-Driven Rules, Composable Components, and Graceful Degradation", "summary": "A developer released teleagent-skills, an open-source framework that standardizes agent pipeline development with a 4-phase orchestration model and YAML-driven rules. The framework provides five universal agent skills—Scoring Engine, Evidence Chain, Data Aggregator, and others—each composed of reusable phases that communicate via JSON contracts, enabling business logic changes without code modifications.", "body_md": "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?\n\nEvery Agent developer faces the same dilemma — **every business scenario rewrites a similar pipeline**:\n\n**The skeleton is identical.** What changes is only the \"content\" at each step. Yet every team builds pipelines from scratch.\n\n[ teleagent-skills](https://github.com/yuzhaopeng-up/teleagent-skills) offers an answer:\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    Upper Business Skill                      │\n│  (Scoring Engine / Evidence Chain / Data Aggregator / ...)  │\n└──────────┬──────────┬──────────┬──────────┬────────────────┘\n           │          │          │          │\n           ▼          ▼          ▼          ▼\n    ┌──────────┐┌──────────┐┌──────────┐┌──────────┐\n    │ Phase 1  ││ Phase 2  ││ Phase 3  ││ Phase 4  │\n    │ Extract  ││ Analyze  ││ Generate ││ Archive  │\n    │          ││          ││          ││          │\n    │Info-     ││Data-     ││Report-   ││Archive-  │\n    │Extractor ││Analyst   ││Generator ││Manager   │\n    └────┬─────┘└────┬─────┘└────┬─────┘└────┬─────┘\n         │           │           │           │\n         ▼           ▼           ▼           ▼\n    ┌─────────────────────────────────────────────────┐\n    │          JSON Contract (Structured Data Contract) │\n    │   phase1_output.json → phase2_input.json → ...  │\n    └─────────────────────────────────────────────────┘\n```\n\nCore idea: **each Phase is an independent component, and Phases pass data only through JSON contracts**.\n\n```\n{\n  \"phase\": \"extract\",\n  \"skill\": \"scoring-engine\",\n  \"output\": {\n    \"entities\": [\n      {\n        \"name\": \"客户A\",\n        \"type\": \"enterprise_customer\",\n        \"attributes\": {\n          \"annual_revenue\": 50000000,\n          \"employee_count\": 320,\n          \"industry\": \"制造\"\n        }\n      }\n    ],\n    \"metadata\": {\n      \"extraction_time\": \"2026-07-01T10:30:00Z\",\n      \"source\": \"CRM_API\",\n      \"confidence\": 0.92\n    }\n  },\n  \"next_phase\": \"analyze\"\n}\n```\n\nThe traditional approach hard-codes scoring rules:\n\n```\n# Hard-coded — every business change means a code change\nif customer.revenue > 10000000:\n    score += 30\nelif customer.revenue > 5000000:\n    score += 20\n```\n\nteleagent-skills does it differently — **all rules are externalized to YAML**:\n\n```\n# scoring_rules.yaml\nscoring_engine:\n  name: \"政企客户商机评分\"\n  version: \"2.1\"\n  dimensions:\n    - id: revenue\n      name: \"营收规模\"\n      weight: 0.30\n      rules:\n        - condition: \"attributes.annual_revenue >= 100000000\"\n          score: 30\n          label: \"超大型\"\n        - condition: \"attributes.annual_revenue >= 50000000\"\n          score: 20\n          label: \"大型\"\n        - condition: \"attributes.annual_revenue >= 10000000\"\n          score: 10\n          label: \"中型\"\n    - id: industry\n      name: \"行业属性\"\n      weight: 0.25\n      rules:\n        - condition: \"attributes.industry in ['金融','医疗']\"\n          score: 25\n          label: \"高价值行业\"\n    - id: growth\n      name: \"增长潜力\"\n      weight: 0.20\n    - id: connectivity\n      name: \"接入成熟度\"\n      weight: 0.15\n    - id: decision_chain\n      name: \"决策链清晰度\"\n      weight: 0.10\n  thresholds:\n    high: 70\n    medium: 40\n    low: 0\n```\n\nBusiness changed? Edit YAML. Need a new dimension? Add YAML. **Zero code changes.**\n\nAll 5 Skills share the same 4-Phase skeleton, but each Skill's Phase behavior differs:\n\n| Skill | Phase 1 Extract | Phase 2 Analyze | Phase 3 Generate | Phase 4 Archive |\n|---|---|---|---|---|\nScoring Engine |\nExtract scoring object attributes | Load YAML rules & match scores | Generate scoring report + recommendations | Archive scoring records |\nEvidence Chain |\nExtract evidence from multiple sources | Cross-validate + conflict detection | Generate evidence chain report | Archive validation records |\nData Aggregator |\nValidate & clean raw data | Aggregation + YoY/MoM calculation | Output statistical report | Archive aggregated results |\nVisualization Renderer |\nAnalyze data characteristics | Generate ECharts config | Render HTML/Dashboard | Cache chart assets |\nNL2Query |\nExtract query intent + entities | Build SQL + confidence assessment | Format query results | Record query logs |\n\n**The power of composability**: upper-level Skills can chain lower-level Skills on demand. For example, the data query gateway pipeline:\n\n```\nNL2Query(Phase1-2) → Data Aggregator(Phase1-2) → Visualization Renderer(Phase1-3)\n```\n\nOne natural language query automatically flows through \"understand → query → aggregate → visualize\" end to end.\n\nThe 4-Phase architecture has built-in 3-tier degradation:\n\n```\n┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐\n│   Phase 1   │────▶│   Phase 2   │────▶│   Phase 3   │────▶│   Phase 4   │\n│   Extract   │     │   Analyze   │     │   Generate  │     │   Archive   │\n└──────┬──────┘     └──────┬──────┘     └──────┬──────┘     └──────┬──────┘\n       │                   │                   │                   │\n       ▼                   ▼                   ▼                   ▼\n  ┌──────────┐       ┌──────────┐       ┌──────────┐       ┌──────────┐\n  │ Return   │       │ Skip     │       │ Simplify │       │ Local    │\n  │ raw      │       │ analysis │       │ template │       │ cache +  │\n  │ input +  │       │ mark low │       │ raw data │       │ deferred │\n  │ conf=0   │       │ confidence│      │ passthrough│      │ retry    │\n  └──────────┘       └──────────┘       └──────────┘       └──────────┘\n```\n\n**The core principle of degradation**: I'd rather give the user a low-confidence result than crash with an error.\n\n**What it is**: A multi-dimensional weighted scoring component driven by YAML rule configs.\n\n**Typical scenarios**: enterprise opportunity scoring, vendor evaluation, customer churn prediction, partner tiering.\n\nInput → Rule matching → Scoring output flow:\n\n```\n{\n  \"customer\": \"客户A\",\n  \"total_score\": 78,\n  \"grade\": \"A级-重点跟进\",\n  \"dimension_breakdown\": {\n    \"revenue\": { \"score\": 20, \"max\": 30, \"label\": \"大型\" },\n    \"industry\": { \"score\": 15, \"max\": 25, \"label\": \"中价值行业\" },\n    \"growth\": { \"score\": 20, \"max\": 20 },\n    \"connectivity\": { \"score\": 15, \"max\": 15 },\n    \"decision_chain\": { \"score\": 8, \"max\": 10 }\n  },\n  \"recommendation\": \"建议安排专属客户经理，优先推荐5G专网+云网融合方案\"\n}\n```\n\n**What it is**: A multi-source evidence cross-validation component that detects conflicts, evaluates confidence, and pinpoints root causes.\n\n```\nData Source 1: Customer complaints    ──┐\n                                         │     ┌──────────────────┐\nData Source 2: System alert logs      ──┼────▶│  Evidence Chain  │\n                                         │     │  Phase2: Analyze │\nData Source 3: SLA monitoring data    ──┘     └────────┬─────────┘\n                                                  │\n                          ┌───────────────────────┐│\n                          │ Cross-validation:      │\n                          │ • Complaint: \"2hr outage\"\n                          │ • Alert: \"optical attenuation\"│\n                          │ • SLA: \"99.1% availability\" │\n                          │ Conflict detected:      │\n                          │ Complaint vs SLA surface contradiction│\n                          │ Root cause=\"optical attenuation\": 0.87│\n                          └───────────────────────┘\n```\n\n**What it is**: A raw data re-processing component supporting validation/cleaning, aggregation, YoY/MoM, and TOP rankings.\n\n```\nRaw query results           Aggregator output\n┌──────────────┐         ┌──────────────────────────────┐\n│ 300 rows of  │───────▶ │ Monthly summary + YoY/MoM    │\n│ detail data  │         │ TOP10 ranking                │\n│ (region x    │         │ Anomaly flags (>2σ)          │\n│  month)      │         │ Trend direction              │\n└──────────────┘         └──────────────────────────────┘\n```\n\n**What it is**: An automated rendering component that turns structured data into ECharts charts and Dashboards.\n\nChart type selection is automatic: time-series → line chart, categorical → bar/pie, multi-dimensional → radar.\n\n**What it is**: A smart natural-language-to-structured-query conversion component.\n\n```\nUser input: \"华东区上月5G专网新增客户数\"\n\nPhase1 Extract:  intent=\"query\", entities=[region=\"华东\", time=\"上月\", metric=\"5G专网\"]\nPhase2 Analyze:  Generate SQL + confidence 0.88\nPhase3 Generate: Format results\nPhase4 Archive:  Record query log\n```\n\n**Confidence scoring**: When confidence drops below a threshold, the output gets a \"low confidence\" warning and shows the SQL for human review.\n\n| Industry | Scoring Engine | Evidence Chain | Data Aggregator | Viz Renderer | NL2Query |\n|---|---|---|---|---|---|\nFinance |\nCustomer credit rating | Anti-money-laundering multi-source verification | Transaction volume YoY/MoM | Risk control dashboard | \"Check a customer's last 3 months of transactions\" |\nManufacturing |\nSupplier evaluation | QA vs. production line verification | Line OEE statistics | Capacity dashboard | \"Check line A's yield this month\" |\nRetail |\nMember value scoring | Data conflict detection | SKU sales aggregation | Sales heatmap | \"Top sellers in East China\" |\nHealthcare |\nPatient risk stratification | Diagnosis vs. lab verification | Department admission stats | Bed occupancy dashboard | \"Available beds in cardiology\" |\n\n**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.\n\n| Dimension | LangChain/LlamaIndex | AutoGen/CrewAI | teleagent-skills |\n|---|---|---|---|\n| Orchestration | Code-level Chain | Multi-Agent dialogue | 4-Phase declarative orchestration |\n| Rule management | Hard-coded in code | Described in prompts | YAML parameterized config |\n| Degradation strategy | try-catch | Retry dialogue | Declarative degradation config |\n| Business adaptation | Change code | Change prompts | Change YAML |\n\n```\ngit clone https://github.com/yuzhaopeng-up/teleagent-skills.git\ncd teleagent-skills\n\n# Scoring engine example\ncp skills/scoring-engine/config/scoring_rules.yaml my_rules.yaml\n# Edit my_rules.yaml to customize your scoring dimensions\n# Copy the Skill directory into your Agent platform's skills directory\n```\n\nLicense: **Apache 2.0**\n\n| Repo | What It Does | GitHub |\n|---|---|---|\nfinancial-ai-skills |\nFinancial AI skill library: 104 scenarios, pure Python |\n|\n\n**Stop building pipelines from scratch. The 4-Phase skeleton is ready — you just need to write YAML.**\n\nStar [teleagent-skills](https://github.com/yuzhaopeng-up/teleagent-skills) and let's standardize Agent Skills together.", "url": "https://wpnews.pro/news/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable", "canonical_source": "https://dev.to/__b01666abd57fb7bb91f9/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable-components-and-370b", "published_at": "2026-07-01 12:34:54+00:00", "updated_at": "2026-07-01 12:49:13.185244+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "machine-learning", "artificial-intelligence"], "entities": ["teleagent-skills", "YAML", "JSON"], "alternates": {"html": "https://wpnews.pro/news/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable", "markdown": "https://wpnews.pro/news/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable.md", "text": "https://wpnews.pro/news/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable.txt", "jsonld": "https://wpnews.pro/news/4-phase-orchestration-5-universal-agent-skills-with-yaml-driven-rules-composable.jsonld"}}