@viccydev/pi-fpa 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +135 -0
  2. package/extensions/fpa-data/calc.ts +544 -0
  3. package/extensions/fpa-data/index.ts +478 -0
  4. package/extensions/fpa-data/registry.ts +303 -0
  5. package/extensions/fpa-data/sql.ts +412 -0
  6. package/extensions/fpa-data/supabase.ts +96 -0
  7. package/package.json +54 -0
  8. package/prompts/fpa-plan-cycle.md +44 -0
  9. package/prompts/fpa-review-cycle.md +33 -0
  10. package/skills/fpa-analyze-drivers/SKILL.md +30 -0
  11. package/skills/fpa-analyze-drivers/references/artifact-contract.md +34 -0
  12. package/skills/fpa-apply-core-rules/SKILL.md +34 -0
  13. package/skills/fpa-apply-core-rules/references/core-rules.md +96 -0
  14. package/skills/fpa-diagnose-actuals/SKILL.md +30 -0
  15. package/skills/fpa-diagnose-actuals/references/artifact-contract.md +38 -0
  16. package/skills/fpa-execute-approved-strategy/SKILL.md +40 -0
  17. package/skills/fpa-execute-approved-strategy/references/artifact-contract.md +29 -0
  18. package/skills/fpa-forecast-approved-strategy/SKILL.md +39 -0
  19. package/skills/fpa-forecast-approved-strategy/references/artifact-contract.md +36 -0
  20. package/skills/fpa-plan-cycle/SKILL.md +29 -0
  21. package/skills/fpa-plan-cycle/references/artifact-contract.md +41 -0
  22. package/skills/fpa-recommend-strategy/SKILL.md +29 -0
  23. package/skills/fpa-recommend-strategy/references/artifact-contract.md +30 -0
  24. package/skills/fpa-review-cycle/SKILL.md +32 -0
  25. package/skills/fpa-review-cycle/references/artifact-contract.md +30 -0
  26. package/skills/fpa-review-strategy/SKILL.md +28 -0
  27. package/skills/fpa-review-strategy/references/artifact-contract.md +25 -0
  28. package/skills/fpa-simulate-strategies/SKILL.md +32 -0
  29. package/skills/fpa-simulate-strategies/references/artifact-contract.md +35 -0
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: fpa-simulate-strategies
3
+ description: Build and compare pre-approval UA allocation scenarios for a configurable future business period, including expected operating outcomes, uncertainty, assumptions, and constraint checks. Use after driver analysis and before strategy recommendation.
4
+ ---
5
+
6
+ # FP&A Strategy Simulation
7
+
8
+ Load `$fpa-apply-core-rules` first. This skill performs exploratory scenario trial calculations; its outputs are not an approved plan or official forecast.
9
+
10
+ ## Procedure
11
+
12
+ 1. Consume `planning_brief`, eligible Actuals, and `driver_analysis`.
13
+ 2. Define a status-quo scenario plus materially distinct candidate allocations.
14
+ 3. Map each changed lever to an explicit response assumption or model.
15
+ 4. Calculate each scenario at the finest supported App × Store × Channel Group grain, then aggregate.
16
+ 5. Produce downside, base, and upside results and identify extrapolation outside historical support.
17
+ 6. Test budgets, allocation limits, business guardrails, and metric trade-offs.
18
+ 7. Run sensitivity analysis on the assumptions that most affect the decision.
19
+ 8. Write `strategy_scenarios` using [artifact-contract.md](references/artifact-contract.md).
20
+
21
+ ## Modeling rules
22
+
23
+ - Use `paid_installs = spend / CPI` only when CPI is a scenario assumption at the proposed Spend level.
24
+ - Use `new_paid_users = paid_installs × paid_rate` only with comparable cohort definition and maturity.
25
+ - Use `net_proceeds_dN = cohort_size × observed_ltv_dN` only for an explicitly selected D-window.
26
+ - Do not treat historical average ROAS as marginal ROAS. If no response curve or experiment exists, constrain the change to an evidenced range and widen uncertainty.
27
+ - Keep model outputs `NULL` when required inputs are unavailable; do not turn missing observations into optimistic defaults.
28
+ - Evaluate every scenario formula with `fpa_calc` (historical inputs via `fpa_query`/`fpa_cohort`); scenario numbers must never come from model arithmetic.
29
+
30
+ ## Handoff
31
+
32
+ Pass all viable scenarios, not only the apparent winner, to `$fpa-recommend-strategy`.
@@ -0,0 +1,35 @@
1
+ # `strategy_scenarios` contract
2
+
3
+ ```yaml
4
+ artifact_type: strategy_scenarios
5
+ status: complete | complete_with_limits | blocked
6
+ planning_brief_id: string
7
+ driver_analysis_id: string
8
+ target_period: {start_inclusive: timestamp, end_exclusive: timestamp, timezone: string}
9
+ data_as_of: timestamp
10
+ model_version: string
11
+ assumption_version: string
12
+ scenarios:
13
+ - scenario_id: string
14
+ label: status_quo | candidate
15
+ allocation:
16
+ - app_id: string
17
+ store: string
18
+ channel_group: string
19
+ spend: number
20
+ assumptions: []
21
+ outputs:
22
+ downside: {}
23
+ base: {}
24
+ upside: {}
25
+ constraint_results: []
26
+ extrapolations: []
27
+ risks: []
28
+ sensitivity:
29
+ - assumption: string
30
+ tested_range: string
31
+ effect_on_primary_objective: string
32
+ unsupported_outputs: []
33
+ ```
34
+
35
+ Each output metric must include unit, currency where applicable, calculation window, and whether it is observed, assumed, or modeled.