본문으로 건너뛰기
cccskills
무료GitHub에 공개

montecarlo-subgroup-prediction

Fix Monte Carlo project completion simulations that give identical dates for all sub-groups (milestones, priorities, epics). Use when: (1) All sub-group predictions converge to the same date despite different remaining counts, (2) Proportional throughput scaling produces flat/identical results, (3) Applying overall scope rate to individual sub-groups causes simulations to hit max_weeks cap and never converge, (4) Building project forecasting tools that predict completion for sub-groups of a larger backlog. Covers hypergeometric draw model for milestones and cumulative priority model for sequential priorities.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Monte Carlo Sub-Group Prediction Scaling

Problem

When running Monte Carlo simulations for project completion, predicting dates for sub-groups (milestones, priorities, epics) within a larger project produces identical results for all groups, or simulations diverge and hit the max_weeks cap.

Context / Trigger Conditions

  • Building a project forecasting tool that predicts dates for individual milestones or priority groups within a larger project backlog
  • All sub-group predictions show the same date despite very different remaining counts (e.g., 5-item milestone shows same date as 46-item milestone)
  • Simulations hit max_weeks (104) and produce dates 2+ years in the future
  • Scope rate applied per-group causes negative net velocity (items grow each week)

Root Causes

1. Proportional Scaling is Mathematically Constant

If you scale throughput proportionally:

share = remaining_i / total_remaining
scaled_throughput = overall_throughput * share
weeks = remaining_i / scaled_throughput
      = remaining_i / (overall_throughput * remaining_i / total_remaining)
      = total_remaining / overall_throughput  # CONSTANT for all groups!

Every sub-group predicts the same number of weeks regardless of size.

2. Overall Scope Rate Overwhelms Sub-Group Throughput

If the project's overall scope rate is 50 items/week and you apply it to a sub-group with only 5 remaining items (share = 1.6%), the scaled throughput might be ~0.6/week while scaled scope is ~0.8/week. Net velocity is negative — the simulation never converges and hits max_weeks.

3. GitHub created_at ≠ "Added to Board"

Scope rate calculated from created_at dates reflects when GitHub issues were created, not when they were added to the project board. Bulk triaging or importing old issues inflates the apparent scope rate dramatically.

Solution

Use different simulation models for different sub-group types:

For Sequential Priorities (P0, P1, P2...): Cumulative Model

Higher priorities are completed first. Each priority's prediction includes all higher-priority work that must finish before it:

sorted_priorities = sorted(priorities, key=lambda p: p["name"])
cumulative_before = 0

for p in sorted_priorities:
    effective_remaining = cumulative_before + p["remaining"]
    result = simulate(
        remaining=effective_remaining,
        throughput_history=full_project_throughput,  # NOT scaled
        scope_rate=0.0,  # Don't apply scope per-group
    )
    result.remaining = p["remaining"]  # Show actual remaining
    cumulative_before += p["remaining"]

For Milestones/Epics: Hypergeometric Draw Model

Items from each milestone are randomly drawn from the overall work pool. Smaller milestones finish earlier due to higher variance:

for i in range(n_simulations):
    subset_left = remaining
    pool_left = total_remaining
    weeks = 0
    while subset_left > 0 and weeks < max_weeks:
        throughput = rng.choice(throughput_samples)
        draw_size = min(throughput, pool_left)
        if draw_size > 0 and pool_left > 0:
            other = pool_left - subset_left
            # How many completed items come from this milestone?
            drawn = rng.hypergeometric(subset_left, max(other, 0), draw_size)
            subset_left -= drawn
            pool_left -= draw_size
            pool_left = max(pool_left, subset_left)
        weeks += 1

Key Principles

  1. Don't scale throughput proportionally — it produces identical results
  2. Don't apply overall scope rate to sub-groups — it causes divergence
  3. Use the full project throughput for priority predictions (cumulative model)
  4. Use hypergeometric sampling for milestone predictions (discrete draws)
  5. Show scope rate as informational rather than baking it into per-group MC

Verification

  • Sub-groups with fewer remaining items should predict earlier dates
  • Smaller sub-groups should have wider confidence intervals (more variance)
  • No predictions should hit the max_weeks cap under normal conditions
  • Priority predictions should be ordered (P0 < P1 < P2 < P3)

Example

With throughput of [2, 29, 44, 34, 11, 24, 33, 54, 34, 101, 57, 81, 0] and 303 total remaining items:

Before fix (proportional scaling):

MVP Rel 1 (5 left):   Apr 13    # All identical!
MVP Rel 2 (46 left):  Apr 13
Release 3 (33 left):  Apr 13

After fix (hypergeometric draws):

MVP Rel 1 (5 left):   Apr 6     # Differentiated by size
MVP Rel 2 (46 left):  Apr 13
Release 3 (33 left):  Apr 13
Zap Store (10 left):  Apr 13

Notes

  • The continuous proportional model (subset_throughput = throughput * share) is mathematically equivalent to "everything finishes when the project finishes" because the differential equation d(subset)/dt = -T*(subset/pool) preserves ratios
  • The hypergeometric distribution is the correct statistical model for "drawing without replacement from a mixed pool"
  • For very small sub-groups (< 5 items), the hypergeometric model produces high variance — this is correct and reflects genuine uncertainty
  • Consider capping scope_rate at min(scope_rate, throughput * 0.5) if using it, to prevent divergent simulations

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y". Use when: (1) ExternalSecret shows OutOfSync in ArgoCD but won't sync, (2) ArgoCD application status shows "namespace X is not permitted in project 'infrastructure'", (3) ExternalSecret targets a namespace managed by a different ArgoCD project, (4) Using apps-of-apps pattern with separate infrastructure and application projects.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language. After selection, generates AI image prompts and visual briefs section-by-section. Use when the user shares content and needs visual direction, image sourcing, or creative direction for any material.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

Fix "Null check operator used on a null value" errors when an object is set to null during an async await. Use when: (1) Object reference is nullified while awaiting, (2) Code accesses object with ! after await returns, (3) Cancel/dispose operations run concurrently with async operations on same object. Solution: capture local reference before await.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

Add custom metadata headers (x-amz-meta-*) to AWS v4 signed requests for GCS S3-compatible API. Use when: (1) Adding custom metadata to GCS uploads via S3 API, (2) Getting signature mismatch errors after adding new headers, (3) x-amz-meta-* headers being ignored or causing 403 errors. Custom headers MUST be included in canonical headers and signed headers list.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings. Use when: (1) Password authentication fails with correct password, (2) Secret created with `<<< "value"` syntax, (3) Error like "password authentication failed" or "invalid token" despite correct value. Bash here-strings (`<<<`) add a trailing newline that corrupts secrets.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp). Use when: (1) Media moderation, transcoding, or analysis silently skips files from Blossom or content-addressed storage servers, (2) URL extraction from Nostr event tags (imeta, r tags) drops URLs without recognized extensions, (3) CDN fallback URLs append .mp4 but the actual server uses extensionless content-addressed paths like /{sha256}. Common in Nostr video events (kind 34236) where different clients use different URL formats.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2652026년 10월 22일 업데이트

divinevideo의 스킬 모두 보기

이 스킬의 문제 신고