# Vision Foresight Scenarios Projection Engine

> TLDR — INTERNAL Sub-skill. vision-foresight-scenarios 대표 마스터의 6번째 sub-skill. Glenn & TFG V3.0 19장 Section III TFG Development "Project the key measures" + Section V Frontiers TIA conjunction verbatim 풀 구현. **Projection Engineer AI Agent** — PDF 원전 verbatim: *"Project the key measures. Trend Impact Analysis (TIA) is a useful technique for projecting the key measures. (A methodology paper in this series describes this technique.) Briefly, the historical data for each of the measures is projected using time-series methods. The events, expressed probabilistically, are combined with the extrapolation using Monte Carlo methods to produce a new median forecast and a range of uncertainty. Since events within a scenario impact several measures wherever they are used, they have the same probability; thus, internal consistency is promoted."* Section V: *"Also, over the years, various quantitative forecasting methods, such as trend impact analysis (TIA), have been used in conjunction with scenarios. A late 1980s scenario

- Skill: `idoforgod/vision-foresight-scenarios-projection-engine` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add idoforgod/vision-foresight-scenarios-projection-engine`
- Raw SKILL.md: https://api.skillmd.com/api/skills/idoforgod/vision-foresight-scenarios-projection-engine/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: idoforgod (https://skillmd.com/u/idoforgod)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/idoforgod/vision-foresight-scenarios-projection-engine

---


# Scenarios — Projection Engine Sub-skill (INTERNAL)

> **출처**: Glenn & TFG V3.0 19장 Section III TFG Development + Section V TIA·Battelle·Z_Punkt verbatim.

본 sub-skill은 **vision-foresight-scenarios** 마스터의 INTERNAL component이며 **6번째 단계**다. 사용자 직접 호출 금지.

---

## 1. AI Agent 역할 — Projection Engineer

당신은 **Scenarios Projection 전문가**다. TFG TIA-integrated projection으로 각 scenario별 key measures trajectory 산출.

**핵심 약속**:
- validator.py + monte_carlo.py가 결정론적으로 처리하는 항목은 LLM이 재추론하지 않는다
- 모든 수치 결과는 monte_carlo.py 출력을 인용한다
- Internal consistency는 monte_carlo.py의 구조적 보장(단일 probability matrix 사용)으로 달성한다

---

## 2. PDF 원전 (verbatim)

> *"Project the key measures. Trend Impact Analysis (TIA) is a useful technique for projecting the key measures. Briefly, the historical data for each of the measures is projected using time-series methods. The events, expressed probabilistically, are combined with the extrapolation using Monte Carlo methods to produce a new median forecast and a range of uncertainty. Since events within a scenario impact several measures wherever they are used, they have the same probability; thus, internal consistency is promoted."* (TFG Development)

> *"various quantitative forecasting methods, such as trend impact analysis (TIA), have been used in conjunction with scenarios. A late 1980s scenario study by Battelle utilized a software program to determine how the occurrence of each outcome would affect the a priori probabilities of other outcomes."* (Section V)

> *"scenarios are presented in a descriptive manner... but are also linked each to the level of quantitative extrapolations, for example market size estimates, growth and changes in customer groups, or prices of resources etc."* (Z_Punkt, Section V)

---

## 3. 입력 포맷 명세

본 sub-skill은 **vision-foresight-scenarios-key-measures-events**로부터 다음 JSON 구조를 handoff로 수신한다. 이 포맷을 `projection_input.json`으로 저장해 validator.py에 전달한다.

### 필수 최상위 키

```json
{
  "key_measures": [...],
  "events": [...],
  "probability_matrix": {...},
  "scenarios": ["Scenario A", "Scenario B", "Scenario C", "Scenario D"],
  "time_horizon": {
    "start_year": 2026,
    "end_year": 2040
  },
  "monte_carlo_runs": 1000
}
```

### key_measures 구조 (KME sub-skill에서 전달 + 본 sub-skill이 historical_data 추가)

```json
{
  "id": "KM01",
  "name": "GDP Growth Rate",
  "unit": "%/year",
  "current_value": 2.3,
  "historical_data": [
    {"year": 2000, "value": 4.2},
    {"year": 2005, "value": 3.1},
    {"year": 2010, "value": 2.5},
    {"year": 2015, "value": 2.9},
    {"year": 2020, "value": -3.4},
    {"year": 2025, "value": 2.3}
  ]
}
```

- `historical_data`: 본 sub-skill Step 2(VRMP cascade)에서 추가. 최소 2개, 권장 5-30개 데이터 포인트.
- 데이터 없으면 `historical_data: []` — monte_carlo.py가 `constant` baseline으로 fallback.

### events 구조 (KME 전달 + 본 sub-skill이 TIA params 추가)

```json
{
  "id": "E01",
  "name": "AGI Announced by Major Lab",
  "impacts": ["KM01", "KM02"],
  "impact_direction": "+",
  "impact_magnitude_pct": 20.0,
  "tia_params": {
    "time_to_first_impact": 1,
    "time_to_max_impact": 3,
    "time_to_steady_state": 8,
    "steady_state_magnitude_pct": 10.0
  }
}
```

**TIA 5 parameters (TIA V3.0 Ch08 verbatim)**:
- `time_to_first_impact` (T_F): event 발생 후 영향이 처음 시작되기까지의 년수. T_F=0이면 발생 직후 시작.
- `time_to_max_impact` (T_M): event 발생 후 최대 영향에 도달하는 년수. T_F ≤ T_M.
- `time_to_steady_state` (T_S): event 발생 후 정상 상태 영향이 유지되는 년수. T_M ≤ T_S.
- `impact_magnitude_pct` (M_L): 최대 영향 크기 (baseline 대비 %). 양수. default: 10.
- `steady_state_magnitude_pct` (M_S): 정상 상태 영향 크기 (%). default: M_L의 50%.

**TIA 파라미터 부재 시**: validator.py가 WARN 출력, monte_carlo.py가 default(T_F=1, T_M=3, T_S=10, M_S=50%·M_L) 적용.

**KME handoff에 `impact_magnitude_pct` 없음**: 본 sub-skill이 추가 필수.

| impact_direction | 설명 |
|---|---|
| `"+"` | baseline 대비 양의 방향으로 impact_magnitude_pct만큼 변화 |
| `"-"` | 음의 방향으로 변화 |
| `"+/-"` | 방향이 scenario마다 다름 — scenario+event_id의 결정론적 hash로 방향 고정 |

### probability_matrix

```json
{
  "E01": {"Scenario A": 0.7, "Scenario B": 0.2, "Scenario C": 0.9, "Scenario D": 0.4},
  "E02": {"Scenario A": 0.1, "Scenario B": 0.8, "Scenario C": 0.05, "Scenario D": 0.6}
}
```

**내부 일관성 구조적 보장**:
> TFG verbatim: *"events within a scenario impact several measures wherever they are used, they have the same probability"*
> → probability_matrix에 event-scenario pair당 정확히 하나의 P 값이 저장됨.
> → monte_carlo.py가 trial마다 event를 한 번 sampling하고 해당 event가 impacts하는 **모든 measure에 동일 occurrence를 적용**.
> → 동일 P(E|S)가 모든 measure에 구조적으로 강제됨. LLM의 재추론 불필요.

### 엣지 케이스 처리

| 상황 | 처리 |
|---|---|
| scenarios < 2 | validator.py ERROR → 즉시 오류 반환, 진행 불가 |
| events = 0 | validator.py ERROR → 진행 불가 |
| key_measures = 0 | validator.py ERROR → 진행 불가 |
| historical_data 없음 | validator.py WARN → monte_carlo.py constant baseline fallback |
| tia_params 없음 | validator.py WARN → monte_carlo.py default params 사용 |
| monte_carlo_runs < 100 | validator.py ERROR → 100으로 상향 권고 |
| CI 논리 순서 위반 (P10 > median) | validator.py --output ERROR → monte_carlo.py 재실행 필요 |
| probability spread < 0.05 | validator.py WARN → TFG verbatim 인용 후 근거 요청 |

---

## 4. 6-Step Pipeline

### Step 1 — 입력 확인 + TIA 파라미터 보완

KME sub-skill으로부터 받은 handoff를 §3 포맷으로 정리한다.

**KME handoff에 없는 항목 — 본 sub-skill이 추가**:
1. `impact_magnitude_pct` — 이벤트별 최대 영향 크기
2. `tia_params` — TIA V3.0 Ch08 5 parameters

**추가 방법**: 각 이벤트의 성격, focal issue domain, 유사 사례 TIA 문헌을 참고해 전문가 판단으로 설정. 불확실 시 default 사용하고 validator.py WARN 허용.

**cross-skill foresight-trend-impact-analysis (8장)** — TIA 파라미터를 더 정밀하게 도출하려면 이 sub-skill을 선택적으로 호출.

### Step 2 — Historical Data 수집 (VRMP L1-L6 cascade)

각 key measure에 대해 10-30년 시계열 데이터를 수집한다.

```
For each key measure KM_i:
  L1 WebSearch: "[measure name] historical data [unit] [2000-2025]"
  L2 WebSearch: "[measure name] trend [country/region] [year range]"
  L3 WebFetch: World Bank / IMF / OECD / IEA / government stats
  L4 WebSearch: "[measure name] forecast extrapolation recent study"
  L5 WebSearch: "[focal issue domain] [measure name] annual statistics"
  L6 WebFetch: academic paper or authoritative report with time-series
  
  Collect: [{year: Y, value: V}, ...] — minimum 2 points, aim for 5-20
  If no data found after L6: historical_data = [] → constant baseline
```

**수집된 데이터를 `historical_data` 배열로 §3 포맷에 추가한다.**

**주의 — 정상성(stationarity) 이슈**:
- GDP 성장률, 인플레이션 같은 변화율 변수는 추세가 없는 평균 회귀 시계열일 수 있음
- 이 경우 polynomial/linear fit보다 최근 3-5년 평균이 더 좋은 baseline
- R² < 0.5인 경우 주석으로 표시하고 current_value 앵커링 적용 (monte_carlo.py 자동 처리)

### Step 3 — validator.py 호출 (입력 검증)

```bash
SKILL_DIR="/Users/cys/Desktop/CYSjavis/cys-claude-vision-coaching-skills/skills/vision-foresight-scenarios-projection-engine"
python3 "$SKILL_DIR/validator.py" --input /tmp/projection_input.json
```

**validator.py 검증 항목 (결정론, LLM 재추론 금지)**:
- 필수 키 존재 여부 (key_measures, events, probability_matrix, scenarios, time_horizon, monte_carlo_runs)
- time_horizon 논리 (start_year < end_year, span ≥ 5년)
- P(E|S) ∈ [0.0, 1.0]
- cross-scenario probability spread ≥ 0.05 per event
- impact_direction ∈ {"+", "-", "+/-"}
- impact_magnitude_pct > 0
- tia_params 논리 순서 (T_F ≤ T_M ≤ T_S)
- probability_matrix 완전성 (모든 event × 모든 scenario 커버)
- Internal consistency (모든 scenario가 동일한 event set 커버)

**ERROR 발생 시**: 해당 필드를 수정 후 재검증. validator 오류를 자연어로 무시하거나 "대략 맞다"고 판단하는 것 금지.

**WARN만 있는 경우**: 진행 가능. WARN 내용을 출력 섹션에 명시.

### Step 4 — monte_carlo.py 호출 (TIA + MC 실행)

```bash
python3 "$SKILL_DIR/monte_carlo.py" \
  --input /tmp/projection_input.json \
  --output /tmp/mc_results.json \
  --seed 42
```

**monte_carlo.py 처리 흐름 (결정론, LLM 재추론 금지)**:

```
1. Baseline 곡선 적합 (각 key measure):
   - Linear: v = slope × year + intercept
   - Polynomial2: v = a×(year-y0)² + b×(year-y0) + c
   - Exponential: v = a × exp(m × year)  [양수 데이터만]
   - R² 자동 비교 → 최고 R² 방법 선택
   
   TIA V3.0 Ch08 verbatim: "7 curve types" 중 위 3가지 구현
   (ARIMA, Logistic, Inverse_v, Inverse_t는 향후 확장)
   
   앵커링 규칙: R² < 0.80 AND start_year 예측치가 current_value에서 >20% 이탈 시
   → anchor_offset = current_value - predicted_at_start 적용
   → 정상성 변수(GDP 성장률 등) 왜곡 방지

2. Monte Carlo 1000 runs per scenario:
   
   For each scenario S:
     For run i in 1..1000:
       # Event sampling (ONCE per event per trial — TFG 내부 일관성 구조적 보장)
       For each event E:
         P = probability_matrix[E.id][S]
         event_occurrence_year = first year in projection window where random() < P
         # (or None if event never triggers this trial)
       
       # Measure trajectory
       For each measure KM:
         For each year Y:
           baseline = fitted_curve(Y)
           cumulative_impact = 0
           For each event E that impacts KM:
             if E triggered in year E_occ ≤ Y:
               frac = TIA_impact_curve(E, E_occ, Y)  # 0→M_L at T_M→M_S at T_S
               directed = frac × direction(E, S)     # deterministic +/- sign
               cumulative_impact += directed
           adjusted[Y] = baseline × (1 + cumulative_impact)
       
       Save trial trajectory
     
     # CI 계산 (각 measure × 각 year)
     median = percentile(all_trials, 50)
     P10    = percentile(all_trials, 10)  # 80% CI 하한
     P90    = percentile(all_trials, 90)  # 80% CI 상한
     P5     = percentile(all_trials,  5)  # 90% CI 하한
     P95    = percentile(all_trials, 95)  # 90% CI 상한

3. Internal consistency audit (monte_carlo.py 내장):
   multi-impact events (impacts ≥2 measures) 목록화
   per event-scenario pair: P(E|S) 단일 값 확인 (구조적 보장)
```

**CI 정의**:
- **80% CI = P10–P90**: 표준 불확실성 범위. TFG verbatim "range of uncertainty"의 정량화.
- **90% CI = P5–P95**: 극단 불확실성. 요청 시 추가 출력.

### Step 5 — validator.py --output 호출 (MC output 검증)

```bash
python3 "$SKILL_DIR/validator.py" --output /tmp/mc_results.json
```

검증 항목:
- projections 구조 (scenarios × measures × years 완전성)
- CI 논리 순서: P10 ≤ median ≤ P90 (위반 시 ERROR)
- internal_consistency_audit 존재 여부

### Step 6 — 내부 일관성 감사 결과 확인

monte_carlo.py 출력의 `internal_consistency_audit` 섹션을 읽어 출력에 포함한다.

```
TFG verbatim 강제:
"events within a scenario impact several measures wherever they are used,
 they have the same probability; thus, internal consistency is promoted"

구조적 보장 메커니즘:
- probability_matrix에 event-scenario pair당 정확히 1개 P 값 저장
- monte_carlo.py가 trial마다 event를 1회 sampling
- 동일 occurrence decision이 해당 event의 모든 impacts 대상 measure에 적용
- → 모든 multi-impact event의 내부 일관성이 수학적으로 보장됨
```

---

## 5. 결정론적 Python 구성요소

| 항목 | 구성요소 | LLM 재추론 여부 |
|---|---|---|
| 필수 키 존재 검사 | validator.py | 금지 |
| 확률 범위 [0,1] 검사 | validator.py | 금지 |
| cross-scenario variation ≥ 0.05 | validator.py | 금지 |
| impact_direction 유효값 | validator.py | 금지 |
| impact_magnitude_pct > 0 | validator.py | 금지 |
| TIA params 논리 순서 | validator.py | 금지 |
| probability_matrix 완전성 | validator.py | 금지 |
| internal consistency 구조적 검사 | validator.py | 금지 |
| 시계열 baseline 곡선 적합 (R²) | monte_carlo.py | 금지 |
| Monte Carlo 1000+ runs | monte_carlo.py | 금지 |
| CI 계산 (P5/P10/P90/P95) | monte_carlo.py | 금지 |
| CI 논리 순서 검사 | validator.py --output | 금지 |
| Internal consistency audit | monte_carlo.py | 금지 |

**결정론 환원 불가 항목** (LLM 처리 허용):
- Historical data 수집 (WebSearch/WebFetch) — 외부 정보 조회
- TIA 파라미터 추정 (전문가 판단) — 학계 표준 TIA 사례 참조
- impact_magnitude_pct 추정 — TIA Ch08 사례 수준 참조
- 출력 서술 (quantitative 수치 해석) — LLM의 자연어 역할

---

## 6. 출력 양식

> **주의**: 모든 수치는 monte_carlo.py 출력에서 직접 인용. LLM이 수치를 임의 생성하거나 반올림으로 수정하는 것 금지.

---

### § Projections per Scenario (vision-foresight-scenarios-projection-engine)

**Method**: TIA-integrated Monte Carlo | Baseline: [linear/polynomial2/exponential] (R²=[값])
**CI**: 80% (P10–P90) | 90% (P5–P95) on request
**Cross-skill**: foresight-trend-impact-analysis · foresight-statistical-modeling
**MC runs**: 1,000 per scenario | Random seed: 42

#### Validator Input Result

```json
{"valid": true/false, "errors": [...], "warnings": [...]}
```

#### Baseline Fit Report

| Measure | Method | R² | Data Points | Note |
|---|---|---|---|---|
| KM01: GDP Growth Rate | polynomial2 | 0.27 | 5 | anchored at current_value=2.3 |
| KM02: AI R&D Spend | polynomial2 | 0.9998 | 4 | high-quality fit |
| ... | | | | |

#### Per-Measure Trajectories per Scenario

**[measure별 테이블 — monte_carlo.py 출력 직접 인용]**

형식: `median (P10–P90)` — 모두 동일 소수점 자리수 사용

| Year | Scenario A | Scenario B | Scenario C | Scenario D |
|---|---|---|---|---|
| [start] | [baseline, no divergence yet] | | | |
| [+5yr] | med (P10–P90) | med (P10–P90) | med (P10–P90) | med (P10–P90) |
| [+10yr] | med (P10–P90) | med (P10–P90) | med (P10–P90) | med (P10–P90) |
| [end] | med (P10–P90) | med (P10–P90) | med (P10–P90) | med (P10–P90) |

*연도 선택: start_year + 0, +5, +10, +전체 span 4개 이상 표시*

#### Z_Punkt 정량 요약 (Z_Punkt Section V verbatim 구현)

> *"scenarios are linked each to the level of quantitative extrapolations, for example market size estimates, growth and changes in customer groups, or prices of resources"*

| Key Measure | 현재 (start_year) | Scenario A (end_year) | Scenario B | Scenario C | Scenario D |
|---|---|---|---|---|---|
| [measure + unit] | [current_value] | [median] | [median] | [median] | [median] |
| ... | | | | | |

*각 셀: median (P10–P90) 포함*

#### Internal Consistency Audit

monte_carlo.py `internal_consistency_audit` 출력 직접 인용:

```
Multi-impact events checked: [N]
Overall consistent: true/false
Mechanism: [구조적 보장 설명]

[Per event-scenario: P(E|S) 단일 값 확인 — multi-impact events만]
```

#### Validator Output Result

```json
{"valid": true/false, "errors": [...], "warnings": [...]}
```

#### WARN 목록 (있는 경우)

[validator.py WARN 전문 인용 + TFG/TIA 출처 명시]

---

→ vision-foresight-scenarios-narrative-writing

---

## 7. 엣지 케이스 처리

### 7a. Historical Data 없음

```
historical_data = []  →  monte_carlo.py: constant baseline at current_value
Baseline Fit Report: "no historical data — constant baseline at current_value"
WARN 출력: "No historical data for KM0N — baseline assumed constant at [value] [unit].
           To improve projection accuracy, provide 10-30 year time-series data."
```

### 7b. scenarios = 1

```
validator.py ERROR: "SCENARIO_COUNT_ERROR: ≥2 scenarios required"
→ 즉시 중단. vision-foresight-scenarios-scenario-logics-selection 재실행 요청.
```

### 7c. validator ERROR 발생

```
→ 해당 JSON 필드를 수정
→ validator.py --input 재호출
→ PASS 확인 후 monte_carlo.py 진행
→ validator.py 오류를 "큰 문제 없다"며 진행하는 것 절대 금지
```

### 7d. R² < 0.5 (불량 곡선 적합)

```
monte_carlo.py: 앵커링 적용 (current_value에서 시작)
WARN 출력: "Baseline fit quality is low (R²=[값]) — projection uncertainty is high.
           Consider using recent 3-5 year data only for stationary/mean-reverting variables."
```

### 7e. 모든 scenario P(E|S) = 0 또는 1 (이벤트가 실질적 분기 미생성)

```
WARN 출력: "Event [E_id] has P=0 or P=1 in all scenarios — no MC divergence.
           TFG verbatim: 'probabilities of the events are different in each scenario'"
```

### 7f. Monte Carlo runs 부족

```
n_runs < 100: validator.py ERROR → 100으로 상향
n_runs = 100-499: WARN "Consider 1000+ for stable CI (CI width may fluctuate)"
n_runs ≥ 1000: DEFAULT, no warning
```

---

## 8. 마스터 협업 Protocol

| 항목 | 내용 |
|---|---|
| **입력** | § Key Measures + Events + Probability Matrix (KME handoff) |
| **LLM 추가** | impact_magnitude_pct + tia_params + historical_data (VRMP cascade) |
| **validator.py** | 입력 검증 — ERROR 시 수정 후 재검증 |
| **monte_carlo.py** | TIA + MC 1000 runs — 결과 /tmp/mc_results.json |
| **validator.py --output** | MC 출력 검증 — CI 논리 순서 확인 |
| **출력** | § Projections per Scenario (테이블 + CI + Internal Consistency Audit) |
| **다음 단계** | → vision-foresight-scenarios-narrative-writing |

