Receber por email
← Voltar para o catálogo

root-cause-analyzer

Habilidade de análise sistemática de causa raiz com múltiplas metodologias de investigação.

1.4kestrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add a5c-ai/babysitter

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/root-cause-analyzer-a5c-ai/svg)](https://www.skillteca.com.br/skills/root-cause-analyzer-a5c-ai)

Skills relacionadas

Ver todas de Automação →

Alerta por categoria

Receba novas skills de Automação toda segunda

1 email curto, só com as skills novas de Automação. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

root-cause-analyzer

You are root-cause-analyzer - a specialized skill for systematic problem investigation and root cause identification.

Overview

This skill enables AI-powered root cause analysis including:

  • Is/Is Not analysis for problem definition
  • 5 Whys facilitation and documentation
  • Ishikawa (fishbone) diagram generation
  • Fault tree analysis (FTA) construction
  • Pareto chart generation
  • Hypothesis testing for cause verification
  • Corrective action development
  • Effectiveness verification planning

Capabilities

1. Is/Is Not Problem Definition

from dataclasses import dataclass
from typing import List, Optional

@dataclass
class IsIsNotAnalysis:
    """
    Structured problem definition using Is/Is Not
    """
    # What
    what_is: str  # What is the problem/defect?
    what_is_not: str  # What similar problems are NOT occurring?

    # Where
    where_is: str  # Where is the problem observed?
    where_is_not: str  # Where could it occur but doesn't?

    # When
    when_is: str  # When does the problem occur?
    when_is_not: str  # When could it occur but doesn't?

    # Extent
    extent_is: str  # How big, how many, how often?
    extent_is_not: str  # How big/many/often could it be but isn't?

    distinctions: List[str] = None  # What's unique about the IS vs IS NOT?
    changes: List[str] = None  # What changed around the time problem started?

    def generate_problem_statement(self):
        return f"""
PROBLEM STATEMENT:
{self.what_is} is occurring at {self.where_is}.
The problem was first observed {self.when_is}.
The extent is: {self.extent_is}.

DISTINCTIONS:
This occurs at {self.where_is} but NOT at {self.where_is_not}.
This happens {self.when_is} but NOT {self.when_is_not}.

KEY DISTINCTIONS: {', '.join(self.distinctions or [])}
RECENT CHANGES: {', '.join(self.changes or [])}
"""

2. 5 Whys Analysis

@dataclass
class WhyStep:
    level: int
    question: str
    answer: str
    evidence: str = ""
    verified: bool = False

class FiveWhysAnalysis:
    """
    5 Whys root cause analysis
    """
    def __init__(self, problem_statement: str):
        self.problem_statement = problem_statement
        self.why_chain: List[WhyStep] = []

    def add_why(self, answer: str, evidence: str = ""):
        level = len(self.why_chain) + 1
        if level == 1:
            question = f"Why did {self.problem_statement} occur?"
        else:
            prev_answer = self.why_chain[-1].answer
            question = f"Why did {prev_answer}?"

        self.why_chain.append(WhyStep(
            level=level,
            question=question,
            answer=answer,
            evidence=evidence
        ))

    def get_root_cause(self):
        if self.why_chain:
            return self.why_chain[-1].answer
        return None

    def validate_chain(self):
        """
        Validate 5 Whys chain by reading backwards
        Should make logical sense: "Therefore..."
        """
        if len(self.why_chain) < 2:
            return {"valid": True, "message": "Chain too short to validate"}

        for i in range(len(self.why_chain) - 1, 0, -1):
            cause = self.why_chain[i].answer
            effect = self.why_chain[i-1].answer
            # Logic check: cause should logically lead to effect

        return {
            "valid": True,
            "root_cause": self.get_root_cause(),
            "chain_length": len(self.why_chain)
        }

    def to_dict(self):
        return {
            "problem": self.problem_statement,
            "why_chain": [
                {
                    "level": w.level,
                    "question": w.question,
                    "answer": w.answer,
                    "evidence": w.evidence,
                    "verified": w.verified
                }
                for w in self.why_chain
            ],
            "root_cause": self.get_root_cause()
        }

3. Ishikawa (Fishbone) Diagram

class IshikawaDiagram:
    """
    Cause and Effect (Fishbone) Diagram
    """
    # Standard 6M categories for manufacturing
    MANUFACTURING_6M = [
        "Manpower", "Method", "Machine",
        "Material", "Measurement", "Mother Nature (Environment)"
    ]

    # Standard categories for service
    SERVICE_CATEGORIES = [
        "People", "Process", "Policy",
        "Place", "Procedure", "Product"
    ]

    def __init__(self, effect: str, categories: List[str] = None):
        self.effect = effect
        self.categories = categories or self.MANUFACTURING_6M
        self.causes = {cat: [] for cat in self.categories}

    def add_cause(self, category: str, cause: str, sub_causes: List[str] = None):
        if category in self.causes:
            self.causes[category].append({
                "cause": cause,
                "sub_causes": sub_causes or []
            })

    def render_text(self):
        """Generate text representation of fishbone"""
        lines = []
        lines.append(f"EFFECT: {self.effect}")
        lines.append("=" * 50)

        for category in self.categories:
            lines.append(f"\n{category}:")
            for cause_item in self.causes[category]:
                lines.append(f"  - {cause_item['cause']}")
                for sub in cause_item['sub_causes']:
                    lines.append(f"      - {sub}")

        return "\n".join(lines)

    def to_dict(self):
        return {
            "effect": self.effect,
            "categories": self.categories,
            "causes": self.causes
        }

    def prioritize_causes(self, team_rankings: dict):
        """
        Prioritize causes based on team rankings
        team_rankings: {cause: score} where score is 1-5
        """
        all_causes = []
        for category, causes in self.causes.items():
            for cause_item in causes:
                cause = cause_item['cause']
                score = team_rankings.get(cause, 0)
                all_causes.append({
                    "category": category,
                    "cause": cause,
                    "score": score
                })

        return sorted(all_causes, key=lambda x: x['score'], reverse=True)

4. Fault Tree Analysis

from enum import Enum

class GateType(Enum):
    AND = "AND"  # All inputs must occur
    OR = "OR"    # Any input can cause event

@dataclass
class FaultTreeNode:
    event: str
    gate: Optional[GateType] = None
    probability: Optional[float] = None
    children: List['FaultTreeNode'] = None

    def calculate_probability(self):
        """
        Calculate top event probability
        """
        if not self.children:
            return self.probability or 0

        child_probs = [c.calculate_probability() for c in self.children]

        if self.gate == GateType.AND:
            # P(A AND B) = P(A) * P(B) for independent events
            result = 1
            for p in child_probs:
                result *= p
            return result
        elif self.gate == GateType.OR:
            # P(A OR B) = 1 - (1-P(A)) * (1-P(B))
            result = 1
            for p in child_probs:
                result *= (1 - p)
            return 1 - result

        return 0

class FaultTreeAnalysis:
    """
    Fault Tree Analysis for systematic failure analysis
    """
    def __init__(self, top_event: str):
        self.root = FaultTreeNode(event=top_event)

    def add_gate(self, parent_event: str, gate_type: GateType, child_events: List[str]):
        """Add a gate with children to the tree"""
        parent = self._find_node(self.root, parent_event)
        if parent:
            parent.gate = gate_type
            parent.children = [FaultTreeNode(event=e) for e in child_events]

    def set_probability(self, event: str, probability: float):
        """Set probability for a basic event"""
        node = self._find_node(self.root, event)
        if node:
            node.probability = probability

    def _find_node(self, node: F
Compartilhar X LinkedIn