Communitygithub.com

포트폴리오 대시보드

다중 프로젝트 포트폴리오 분석 대시보드. 프로젝트 전반의 KPI를 집계하고, 포트폴리오 건전성을 추적하며, 성과를 비교하고, 경영 의사 결정을 지원합니다.

포트폴리오 대시보드란 무엇인가요?

이 스킬은 다중 프로젝트 포트폴리오 분석 대시보드로, 여러 건설 프로젝트의 데이터를 집계하고 분석하여 포트폴리오 수준의 가시성을 제공합니다. 주요 기능으로는 프로젝트 KPI 추적(비용, 일정, 안전, 품질, 위험), 포트폴리오 건전성 평가(녹색/황색/적색 상태), 프로젝트 간 성과 비교, 리스크 식별, 현금 흐름 예측 등이 있습니다. Python 데이터 클래스와 열거형을 기반으로 구현되어 있으며, 가중 평균 CPI/SPI, 건강 분포, 추세 분석(개선/안정/악화) 등 정교한 메트릭을 제공합니다. 이 스킬은 Claude Code, Cursor, Codex와 같은 AI 에이전트 플랫폼에서 사용 가능하며, 에이전트가 데이터를 가져와 포트폴리오 요약 리포트를 생성하고 경영진 의사 결정을 지원합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry/tree/HEAD/skills/analysis/portfolio-dashboard

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

포트폴리오 대시보드은(는) 무엇을 하나요?

개요

여러 건설 프로젝트의 데이터를 집계하고 분석하여 포트폴리오 수준의 가시성을 확보합니다. KPI를 추적하고, 트렌드를 파악하며, 프로젝트 성과를 비교하고, 전략적 자원 할당 결정을 지원합니다.

포트폴리오 분석 프레임워크

┌─────────────────────────────────────────────────────────────────┐
│                  포트폴리오 대시보드                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  프로젝트 A    프로젝트 B    프로젝트 C    프로젝트 D               │
│     ↓             ↓            ↓            ↓                   │
│  ┌─────────────────────────────────────────────┐                │
│  │           데이터 집계                        │                │
│  │  비용 | 일정 | 안전 | 품질 | 위험              │                │
│  └─────────────────────────────────────────────┘                │
│                         ↓                                        │
│  ┌─────────────────────────────────────────────┐                │
│  │          포트폴리오 KPI                       │                │
│  │  📊 총 계약금액    📈 정시율                    │                │
│  │  💰 예산 충족률    🛡️ 안전율                    │                │
│  │  ⚠️ 위험 점수     📋 자원 활용률                │                │
│  └─────────────────────────────────────────────┘                │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

기술적 구현

from dataclasses import dataclass, field
from typing import List, Dict, Optional, Tuple
from datetime import datetime, timedelta
from enum import Enum
import statistics

class ProjectStatus(Enum):
    PLANNING = "planning"
    ACTIVE = "active"
    ON_HOLD = "on_hold"
    COMPLETE = "complete"
    CANCELLED = "cancelled"

class HealthStatus(Enum):
    GREEN = "green"       # 정상
    YELLOW = "yellow"     # 위험
    RED = "red"           # 심각
    GREY = "grey"         # 시작 전/일시 중단

@dataclass
class ProjectMetrics:
    project_id: str
    project_name: str
    status: ProjectStatus
    contract_value: float
    percent_complete: float

    # 일정
    planned_start: datetime
    planned_end: datetime
    actual_start: Optional[datetime]
    forecast_end: datetime
    schedule_variance_days: int = 0

    # 비용
    budget: float
    actual_cost: float
    forecast_cost: float
    cost_variance: float = 0.0
    cpi: float = 1.0
    spi: float = 1.0

    # 안전
    recordable_incidents: int = 0
    total_hours: float = 0
    trir: float = 0.0

    # 품질
    defects_open: int = 0
    rework_cost: float = 0.0

    # 위험
    risk_score: float = 0.0
    critical_risks: int = 0

    @property
    def health(self) -> HealthStatus:
        """프로젝트의 전반적인 건전성을 판단합니다."""
        if self.status in [ProjectStatus.ON_HOLD, ProjectStatus.CANCELLED]:
            return HealthStatus.GREY

        # 예산 또는 일정이 크게 벗어나면 심각
        if self.cpi < 0.85 or self.spi < 0.85 or self.critical_risks > 3:
            return HealthStatus.RED

        # 중간 정도 벗어나면 위험
        if self.cpi < 0.95 or self.spi < 0.95 or self.critical_risks > 0:
            return HealthStatus.YELLOW

        return HealthStatus.GREEN

@dataclass
class PortfolioSummary:
    report_date: datetime
    total_projects: int
    active_projects: int
    total_contract_value: float
    total_budget: float
    total_actual_cost: float
    total_forecast_cost: float

    # 성과
    avg_cpi: float
    avg_spi: float
    on_budget_pct: float
    on_schedule_pct: float

    # 안전
    portfolio_trir: float
    total_incidents: int

    # 건강 분포
    green_count: int
    yellow_count: int
    red_count: int

    # 트렌드
    cost_trend: str
    schedule_trend: str

@dataclass
class ProjectComparison:
    metric: str
    projects: Dict[str, float]
    avg: float
    best: Tuple[str, float]
    worst: Tuple[str, float]

class PortfolioDashboard:
    """다중 프로젝트 포트폴리오 분석."""

    # 건강 임계값
    THRESHOLDS = {
        "cpi_warning": 0.95,
        "cpi_critical": 0.85,
        "spi_warning": 0.95,
        "spi_critical": 0.85,
        "trir_warning": 2.0,
        "risk_score_warning": 7.0
    }

    def __init__(self, portfolio_name: str):
        self.portfolio_name = portfolio_name
        self.projects: Dict[str, ProjectMetrics] = {}
        self.snapshots: List[Dict] = []  # 이력 데이터

    def add_project(self, metrics: ProjectMetrics):
        """포트폴리오에 프로젝트를 추가하거나 업데이트합니다."""
        self.projects[metrics.project_id] = metrics

    def import_projects(self, projects_data: List[Dict]) -> int:
        """데이터에서 여러 프로젝트를 가져옵니다."""
        count = 0
        for p in projects_data:
            metrics = ProjectMetrics(
                project_id=p['id'],
                project_name=p['name'],
                status=ProjectStatus(p.get('status', 'active')),
                contract_value=p['contract_value'],
                percent_complete=p.get('percent_complete', 0),
                planned_start=p['planned_start'],
                planned_end=p['planned_end'],
                actual_start=p.get('actual_start'),
                forecast_end=p.get('forecast_end', p['planned_end']),
                budget=p['budget'],
                actual_cost=p.get('actual_cost', 0),
                forecast_cost=p.get('forecast_cost', p['budget']),
                cpi=p.get('cpi', 1.0),
                spi=p.get('spi', 1.0),
                recordable_incidents=p.get('incidents', 0),
                total_hours=p.get('total_hours', 0),
                risk_score=p.get('risk_score', 0),
                critical_risks=p.get('critical_risks', 0)
            )

            # 파생 메트릭 계산
            metrics.cost_variance = metrics.budget - metrics.actual_cost
            metrics.schedule_variance_days = (metrics.planned_end - metrics.forecast_end).days

            if metrics.total_hours > 0:
                metrics.trir = (metrics.recordable_incidents * 200000) / metrics.total_hours

            self.add_project(metrics)
            count += 1

        return count

    def get_active_projects(self) -> List[ProjectMetrics]:
        """활성 프로젝트 목록을 가져옵니다."""
        return [p for p in self.projects.values()
                if p.status == ProjectStatus.ACTIVE]

    def calculate_portfolio_summary(self) -> PortfolioSummary:
        """포트폴리오 수준의 요약 메트릭을 계산합니다."""
        active = self.get_active_projects()
        all_projects = list(self.projects.values())

        if not all_projects:
            return None

        # 총계
        total_contract = sum(p.contract_value for p in all_projects)
        total_budget = sum(p.budget for p in all_projects)
        total_actual = sum(p.actual_cost for p in all_projects)
        total_forecast = sum(p.forecast_cost for p in all_projects)

        # 성과 평균 (예산 가중)
        if total_budget > 0:
            avg_cpi = sum(p.cpi * p.budget for p in active) / sum(p.budget for p in active) if active else 1.0
            avg_spi = sum(p.spi * p.budget for p in active) / sum(p.budget for p in active) if active else 1.0
        else:
            avg_cpi = avg_spi = 1.0

        # 예산/일정 충족 백분율
        on_budget = len([p for p in active if p.cpi >= 0.95])
        on_schedule = len([p for p in active if p.spi >= 0.95])

        on_budget_pct = (on_budget / len(active) * 100) if active else 100
        on_schedule_pct = (on_schedule / len(active) * 100) if active else 100

        # 안전 메트릭
        total_incidents = sum(p.recordable_incidents for p in all_projects)
        total_hours = sum(p.total_hours for p in all_projects)
        portfolio_trir = (total_incidents * 200000 / total_hours) if total_hours > 0 else 0

        # 건강 분포
        green = len([p for p in active if p.health == HealthStatus.GREEN])
        yellow = len([p for p in active if p.health == HealthStatus.YELLOW])
        red = len([p for p in active if p.health == HealthStatus.RED])

        # 트렌드 (이전 스냅샷과 비교 가능한 경우)
        cost_trend = "stable"
        schedule_trend = "stable"

        if self.snapshots:
            prev = self.snapshots[-1]
            if avg_cpi > prev.get('avg_cpi', 1.0):
                cost_trend = "improving"
            elif avg_cpi < prev.get('avg_cpi', 1.0):
                cost_trend = "declining"

            if avg_spi > prev.get('avg_spi', 1.0):
                schedule_trend = "improving"
            elif avg_spi < prev.get('avg_spi', 1.0):
                schedule_trend = "declining"

        return PortfolioSummary(
            report_date=datetime.now(),
            total_projects=len(all_projects),
            active_projects=len(active),
            total_contract_value=total_contract,
            total_budget=total_budget,
            total_actual_cost=total_actual,
            total_forecast_cost=total_forecast,
            avg_cpi=avg_cpi,
            avg_spi=avg_spi,
            on_budget_pct=on_budget_pct,
            on_schedule_pct=on_schedule_pct,
            portfolio_trir=portfolio_trir,
            total_incidents=total_incidents,
            green_count=green,
            yellow_count=yellow,
            red_count=red,
            cost_trend=cost_trend,
            schedule_trend=schedule_trend
        )

    def compare_projects(self, metric: str) -> ProjectComparison:
        """특정 메트릭으로 프로젝트를 비교합니다."""
        active = self.get_active_projects()

        if not active:
            return None

        metric_map = {
            "cpi": lambda p: p.cpi,
            "spi": lambda p: p.spi,
            "percent_complete": lambda p: p.percent_complete,
            "cost_variance": lambda p: p.cost_variance,
            "trir": lambda p: p.trir,
            "risk_score": lambda p: p.risk_score
        }

        if metric not in metric_map:
            raise ValueError(f"알 수 없는 메트릭: {metric}")

        getter = metric_map[metric]
        values = {p.project_name: getter(p) for p in active}

        avg = statistics.mean(values.values())

        # 최고/최악은 메트릭에 따라 다름 (CPI 높은 것이 좋고, TRIR 낮은 것이 좋음)
        if metric in ["trir", "risk_score"]:
            best = min(values.items(), key=lambda x: x[1])
            worst = max(values.items(), key=lambda x: x[1])
        else:
            best = max(values.items(), key=lambda x: x[1])
            worst = min(values.items(), key=lambda x: x[1])

        return ProjectComparison(
            metric=metric,
            projects=values,
            avg=avg,
            best=best,
            worst=worst
        )

    def get_projects_at_risk(self) -> List[ProjectMetrics]:
        """주의가 필요한 프로젝트를 가져옵니다."""
        return [p for p in self.get_active_projects()
                if p.health in [HealthStatus.YELLOW, HealthStatus.RED]]

    def get_top_risks(self, limit: int = 10) -> List[Dict]:
        """포트폴리오 전체에서 주요 위험을 가져옵니다."""
        risks = []

        for p in self.get_active_projects():
            if p.risk_score > 0:
                risks.append({
                    "project": p.project_name,
                    "risk_score": p.risk_score,
                    "critical_risks": p.critical_risks,
                    "cpi": p.cpi,
                    "spi": p.spi
                })

        return sorted(risks, key=lambda x: -x['risk_score'])[:limit]

    def forecast_cash_needs(self, months: int = 6) -> List[Dict]:
        """포트폴리오 전체의 현금 수요를 예측합니다."""
        forecasts = []

        for month in range(1, months + 1):
            month_date = datetime.now() + timedelta(days=month * 30)

            month_spend = 0
            for p in self.get_active_projects():
                # 남은 작업량 기준 단순 선형 예측
                remaining = p.forecast_cost - p.actual_cost
                months_remaining = max(1, (p.forecast_end - datetime.now()).days / 30)
                monthly_burn = remaining / months_remaining
                month_spend += monthly_burn

            forecasts.append({
                "month": month_date.strftime("%Y-%m"),
                "projected_spend": month_spend
            })

        return forecasts

    def save_snapshot(self):
        """추세 분석을 위해 현재 상태를 저장합니다."""
        summary = self.calculate_portfolio_summary()
        if summary:
            self.snapshots.append({
                "date": datetime.now(),
                "avg_cpi": summary.avg_cpi,
                "avg_spi": summary.avg_spi,
                "on_budget_pct": summary.on_budget_pct,
                "on_schedule_pct": summary.on_schedule_pct,
                "total_forecast": summary.total_forecast_cost
            })

    def generate_report(self) -> str:
        """포트폴리오 대시보드 보고서를 생성합니다."""
        summary = self.calculate_portfolio_summary()

        if not summary:
            return "포트폴리오에 프로젝트가 없습니다"

        lines = [
            "# 포트폴리오 대시보드",
            "",
            f"**포트폴리오:** {self.portfolio_name}",
            f"**보고서 날짜:** {summary.report_date.strftime('%Y-%m-%d')}",
            "",
            "## 경영진 요약",
            "",
            "| 메트릭 | 값 |",
            "|--------|-------|",
            f"| 총 프로젝트 수 | {summary.total_projects} ({summary.active_projects}개 활성) |",
            f"| 총 계약 금액 | ${summary.total_contract_value:,.0f} |",
            f"| 총 예산 | ${summary.total_budget:,.0f} |",
            f"| 현재까지 실제 비용 | ${summary.total_actual_cost:,.0f} |",
            f"| 완료 시 예측 비용 | ${summary.total_forecast_cost:,.0f} |",
            "",
            "### 성과",
            "",
            f"| 메트릭 | 값 |",
            f"|--------|-------|",
            f"| 평균 CPI | {summary.avg_cpi:.2f} |",
            f"| 평균 SPI | {summary.avg_spi:.2f} |",
            f"| 예산 충족률 | {summary.on_budget_pct:.1f}% |",
            f"| 정시율 | {summary.on_schedule_pct:.1f}% |",
            f"| 비용 추세 | {summary.cost_trend} |",
            f"| 일정 추세 | {summary.schedule_trend} |",
            "",
            "### 안전",
            "",
            f"| 메트릭 | 값 |",
            f"|--------|-------|",
            f"| 포트폴리오 TRIR | {summary.portfolio_trir:.1f} |",
            f"| 총 기록 가능 사고 건수 | {summary.total_incidents} |",
            "",
            "### 프로젝트 건전성",
            "",
            f"| 상태 | 개수 |",
            f"|--------|-------|",
            f"| 🟢 정상 | {summary.green_count} |",
            f"| 🟡 위험 | {summary.yellow_count} |",
            f"| 🔴 심각 | {summary.red_count} |",
            "",
            "## 위험에 처한 프로젝트",
            "",
        ]

        at_risk = self.get_projects_at_risk()
        if at_risk:
            for p in at_risk:
                lines.append(f"- **{p.project_name}**: {p.health.value} (CPI: {p.cpi:.2f}, SPI: {p.spi:.2f}, 위험: {p.risk_score:.1f})")
        else:
            lines.append("현재 위험에 처한 프로젝트가 없습니다.")

        lines.extend([
            "",
            "## 주요 위험",
            "",
        ])

        top_risks = self.get_top_risks()
        if top_risks:
            lines.append("| 프로젝트 | 위험 점수 | 심각한 위험 | CPI | SPI |")
            lines.append("|----------|----------|------------|-----|-----|")
            for r in top_risks:
                lines.append(f"| {r['project']} | {r['risk_score']:.1f} | {r['critical_risks']} | {r['cpi']:.2f} | {r['spi']:.2f} |")
        else:
            lines.append("보고된 위험이 없습니다.")

        lines.extend([
            "",
            "## 현금 흐름 예측",
            "",
        ])

        cash_forecast = self.forecast_cash_needs()
        lines.append("| 월 | 예상 지출 |")
        lines.append("|-----|-------------|")
        for f in cash_forecast:
            lines.append(f"| {f['month']} | ${f['projected_spend']:,.0f} |")

        return "\n".join(lines)

    def analyze_variance(self, project_id: str) -> Dict:
        """단일 프로젝트에 대한 심층 분산 분석을 수행합니다."""
        project = self.projects.get(project_id)
        if not project:
            return {"error": "프로젝트를 찾을 수 없음"}

        # 포트폴리오 평균과 비교
        summary = self.calculate_portfolio_summary()

        return {
            "project": project.project_name,
            "schedule_variance": f"{project.schedule_variance_days}일",
            "cost_variance": f"${project.cost_variance:,.0f}",
            "cpi_vs_portfolio": project.cpi - (summary.avg_cpi if summary else 1.0),
            "spi_vs_portfolio": project.spi - (summary.avg_spi if summary else 1.0),
            "risk_level": project.health.value,
            "recommendation": self._generate_recommendation(project)
        }

    def _generate_recommendation(self, project: ProjectMetrics) -> str:
        """프로젝트 건강에 기반한 권장 사항을 생성합니다."""
        recommendations = []

        if project.cpi < 0.85:
            recommendations.append("비용 초과를 해결하기 위한 긴급 비용 관리 조치 필요")
        elif project.cpi < 0.95:
            recommendations.append("비용 성과를 면밀히 모니터링하고 필요한 경우 시정 조치 구현")

        if project.spi < 0.85:
            recommendations.append("일정 지연을 해결하기 위한 일정 단축 전략 필요")
        elif project.spi < 0.95:
            recommendations.append("일정 성과를 모니터링하고 완료일 재예측 고려")

        if project.critical_risks > 0:
            recommendations.append(f"{project.critical_risks}개의 심각한 위험에 대한 위험 완화 계획 개발")

        if not recommendations:
            return "프로젝트가 정상적으로 진행 중입니다. 정기적인 모니터링을 계속하세요."

        return '; '.join(recommendations)

사용 예시

# 포트폴리오 대시보드 초기화
dashboard = PortfolioDashboard("인프라 포트폴리오 2024")

# JSON/API에서 프로젝트 가져오기 (예시)
projects_data = [
    {
        'id': 'BRG-001',
        'name': '교량 건설',
        'status': 'active',
        'contract_value': 50000000,
        'percent_complete': 45,
        'planned_start': datetime(2024, 1, 1),
        'planned_end': datetime(2025, 6, 30),
        'forecast_end': datetime(2025, 8, 15),
        'budget': 45000000,
        'actual_cost': 21000000,
        'forecast_cost': 48000000,
        'cpi': 0.95,
        'spi': 0.92,
        'incidents': 1,
        'total_hours': 50000,
        'risk_score': 6.5,
        'critical_risks': 1
    }
]

count = dashboard.import_projects(projects_data)
print(f"{count}개 프로젝트 가져옴")

# 포트폴리오 요약 생성
summary = dashboard.calculate_portfolio_summary()
if summary:
    print(f"평균 CPI: {summary.avg_cpi:.2f}")
    print(f"정상 프로젝트: {summary.green_count}")

# 전체 보고서 생성
report = dashboard.generate_report()
print(report)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry

BlockRun works with Claude Code and Google Antigravity.

majiayu000/claude-skill-registry

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry

CRITICAL: Use for MolyKit AI chat toolkit. Triggers on: BotClient, OpenAI, SSE streaming, AI chat, molykit, PlatformSend, spawn(), ThreadToken, cross-platform async, Chat widget, Messages, PromptInput, Avatar, LLM

majiayu000/claude-skill-registry

AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

관련 스킬