Consultant Utilization Forecasting and Capacity Balancing Engine
Develop a statistical forecasting and anomaly detection script in Python or R to predict advisory staff utilization and prevent burnout across service lines.
Deploy this template when professional services staffing managers need forward-looking visibility into consultant capacity. It generates a statistical forecasting pipeline that flags upcoming bench imbalances and extreme overtime risks.
Role: Principal Workforce Intelligence Data Scientist for enterprise advisory firms.
Context
- Target practice divisions: {{firm_service_lines}}
- Staff allocation dataset: {{capacity_allocation_data}}
- Overtime warning ceiling: {{overtime_threshold_hours}}
- Forward projection window: {{forecast_horizon_weeks}}
- Required statistical confidence: {{statistical_confidence_level}}
- Webhook destination: {{alert_webhook_target}}
Task
Develop a modular Python or R predictive analytics script that forecasts consultant utilization across {{firm_service_lines}}, identifies impending bench surplus or burnout bottlenecks, and publishes payload summaries to {{alert_webhook_target}}.
Method
- Ingest historical time tracking and forward pipeline allocations from {{capacity_allocation_data}} across the specified {{firm_service_lines}}.
- Cleanse and normalize schedule records, accounting for statutory holidays, planned annual leave, and training buffers.
- Fit a rolling time-series forecasting model projecting weekly consultant billable hours across {{forecast_horizon_weeks}}.
- Calculate statistical forecast intervals at the {{statistical_confidence_level}} level to quantify staffing volatility.
- Detect individual and practice-wide anomalies exceeding {{overtime_threshold_hours}} or dropping below baseline billable expectations.
- Compute supply-demand gaps categorized by consultant seniority, skill tags, and location hubs.
- Generate structured alert payloads containing high-risk capacity breaches and format them for {{alert_webhook_target}}.
- Package the entire sequence into a deterministic batch job with comprehensive run diagnostics.
Constraints
- MUST set deterministic random seeds for all statistical estimators to guarantee reproducible forecasts.
- MUST NOT drop incomplete records silently; impute missing schedules using explicit, documented fallback strategies.
- The script must complete end-to-end execution in under 90 seconds for a dataset of up to 10,000 consultants.
- Payload formatting must strictly validate against standard webhook JSON specifications.
Output format
- Section 1: Forecasting methodology and assumptions matrix (100-150 words)
- Section 2: Complete production script with data processing, forecasting logic, and dispatch routine
- Section 3: Webhook payload schema documentation and sample output JSON (100-150 words)
Self-review
- Confirm that {{forecast_horizon_weeks}} and {{overtime_threshold_hours}} are correctly factored into threshold flags.
- Verify that webhook dispatch handles network timeouts and retries cleanly.
- Check that confidence interval calculations align with {{statistical_confidence_level}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.