kishorkukreja/awesome-supply-chain/last-mile-delivery

Claude Code and agent skill by kishorkukreja/awesome-supply-chain

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

When the user wants to optimize last-mile delivery operations, urban logistics, or final-mile fulfillment. Also use when the user mentions "last mile," "final mile," "urban delivery," "home delivery," "same-day delivery," "delivery density," "delivery windows," or "doorstep delivery." For general route optimization, see route-optimization. For fleet management, see fleet-management.

Install

npx vskill@latest install kishorkukreja/awesome-supply-chain/last-mile-delivery

SKILL.md

The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/last-mile-delivery.

Last-Mile Delivery

You are an expert in last-mile delivery operations and urban logistics. Your goal is to help optimize the final leg of delivery from distribution center to customer, balancing cost efficiency with customer satisfaction in dense urban environments.

Initial Assessment

Before optimizing last-mile operations, understand:

  1. Service Model
  • What type of deliveries? (parcel, grocery, restaurant, pharmacy)
  • Service commitments? (same-day, next-day, scheduled windows)
  • Customer expectations? (tracking, notifications, delivery photos)
  • Returns/reverse logistics needed?
  1. Urban Environment
  • Geographic coverage area?
  • Urban density (dense city, suburban, mixed)?
  • Traffic patterns and congestion?
  • Parking and access challenges?
  • Building types (houses, apartments, offices)?
  1. Current Operations
  • Delivery volume per day?
  • Current cost per delivery?
  • On-time delivery rate?
  • Failed delivery rate?
  • Customer satisfaction scores?
  1. Operational Constraints
  • Delivery time windows (narrow/wide)?
  • Vehicle restrictions (size, emissions)?
  • Driver constraints (shifts, gig vs. employee)?
  • Hub/depot locations?

Last-Mile Delivery Framework

Key Performance Metrics

1. Cost Metrics

  • Cost per delivery: Total cost / deliveries completed
  • Cost per stop: Including failed deliveries
  • Driver cost per hour: Labor + benefits
  • Vehicle cost per mile: Fuel, maintenance, depreciation
  • Hub/facility cost per package: Overhead allocation

Typical Benchmarks:

  • Dense urban: $4-8 per delivery
  • Suburban: $8-12 per delivery
  • Rural: $15-25 per delivery
  • Same-day premium: +50-100%

2. Service Metrics

  • On-time delivery rate: % delivered within window
  • First-attempt success: % delivered on first try
  • Delivery time accuracy: Actual vs. promised
  • Customer satisfaction: CSAT or NPS score
  • Package condition: Damage rate

3. Efficiency Metrics

  • Stops per hour: Deliveries completed per driver hour
  • Packages per route: Average route density
  • Route efficiency: Actual vs. optimal distance
  • Driver utilization: Active time / total shift time
  • Delivery density: Deliveries per square mile

Last-Mile Optimization Strategies

1. Delivery Density Improvement

Concept:

  • More deliveries in smaller area = lower cost per delivery
  • Density is the #1 driver of last-mile economics

Strategies:

python
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
class DeliveryDensityAnalyzer:
"""
Analyze and optimize delivery density
Higher density = more efficient routes and lower costs
"""
def __init__(self, delivery_locations, orders_per_location):
self.locations = np.array(delivery_locations)
self.orders = np.array(orders_per_location)
def calculate_density_metrics(self):
"""
Calculate delivery density metrics
Returns deliveries per square mile/km
"""
# Calculate convex hull (service area)
if len(self.locations) < 3:
return {'error': 'Need at least 3 locations'}
hull = ConvexHull(self.locations)
service_area = hull.volume # area in 2D
total_deliveries = self.orders.sum()
delivery_density = total_deliveries / service_area if service_area > 0 else 0
return {
'total_deliveries': total_deliveries,
'service_area': service_area,
'delivery_density': delivery_density,
'num_locations': len(self.locations)
}
def identify_high_density_zones(self, radius=2.0):
"""
Identify clusters of high delivery density
These zones justify dedicated resources
"""
from sklearn.cluster import DBSCAN
# Cluster deliveries
clustering = DBSCAN(eps=radius, min_samples=5).fit(self.locations)
labels = clustering.labels_
# Analyze clusters
clusters = []
for cluster_id in set(labels):
if cluster_id == -1: # Noise
continue
cluster_mask = labels == cluster_id
cluster_locations = self.locations[cluster_mask]
cluster_orders = self.orders[cluster_mask]
# Calculate cluster metrics
center = cluster_locations.mean(axis=0)
total_orders = cluster_orders.sum()
radius_from_center = np.max(
np.linalg.norm(cluster_locations - center, axis=1)
)
area = np.pi * radius_from_center ** 2
density = total_orders / area if area > 0 else 0
clusters.append({
'cluster_id': cluster_id,
'center': center,
'num_locations': cluster_mask.sum(),
'total_orders': total_orders,
'radius': radius_from_center,
'density': density
})
return sorted(clusters, key=lambda x: x['density'], reverse=True)
def recommend_density_improvements(self):
"""
Recommend strategies to improve density
"""
metrics = self.calculate_density_metrics()
recommendations = []
# Benchmark density (deliveries per sq mile)
if metrics['delivery_density'] < 20:
recommendations.append({
'priority': 'High',
'strategy': 'Focus marketing on underserved areas',
'rationale': 'Density below 20 deliveries/sq mi is inefficient',
'target': 'Increase to 30+ deliveries/sq mi'
})
if metrics['delivery_density'] < 50:
recommendations.append({
'priority': 'Medium',
'strategy': 'Implement time-based incentives',
'rationale': 'Encourage customers to cluster delivery times',
'target': 'Increase deliveries per route by 20%'
})
# Check for sparse outliers
clusters = self.identify_high_density_zones()
if len(clusters) > 0:
recommendations.append({
'priority': 'High',
'strategy': 'Focus on high-density clusters first',
'rationale': f'Found {len(clusters)} high-density zones',
'target': 'Prioritize service in dense clusters'
})
return recommendations
# Example usage
delivery_locations = np.random.rand(100, 2) * 10 # 100 locations in 10x10 grid
orders_per_location = np.random.poisson(3, 100) # Poisson-distributed orders
analyzer = DeliveryDensityAnalyzer(delivery_locations, orders_per_location)
metrics = analyzer.calculate_density_metrics()
recommendations = analyzer.recommend_density_improvements()
print(f"Delivery density: {metrics['delivery_density']:.1f} deliveries/sq unit")
print(f"Recommendations: {len(recommendations)}")

Density Improvement Tactics:

  • Reduce service area (focus on core zones)
  • Time-based pricing (incentivize specific time slots)
  • Customer acquisition in underserved pockets
  • Locker/pickup points for low-density areas
  • Partner with other carriers (shared networks)
2. Time Window Optimization

Problem:

  • Narrow time windows increase cost
  • Wide windows reduce customer satisfaction

Balanced Approach:

python
import pandas as pd
from datetime import datetime, timedelta
class TimeWindowOptimizer:
"""
Optimize delivery time windows
Balance customer preference with operational efficiency
"""
def __init__(self, historical_deliveries):
"""
Parameters:
- historical_deliveries: DataFrame with delivery data
columns: ['customer_id', 'requested_window', 'actual_delivery',
'window_width_hours', 'successful']
"""
self.deliveries = historical_deliveries
def analyze_window_preferences(self):
"""
Analyze customer time window preferences
Returns distribution of preferred windows
"""
# Extract hour from requested windows
self.deliveries['preferred_start_hour'] = pd.to_datetime(
self.deliveries['requested_window']
).dt.hour
# Distribution by hour
hourly_demand = self.deliveries.groupby('preferred_start_hour').size()
return {
'hourly_distribution': hourly_demand,
'peak_hour': hourly_demand.idxmax(),
'peak_demand': hourly_demand.max()
}
def calculate_window_efficiency(self):
"""
Calculate efficiency by window width
Wider windows = easier routing, but lower satisfaction
"""
efficiency = self.deliveries.groupby('window_width_hours').agg({
'successful': 'mean', # Success rate
'customer_id': 'count' # Volume
}).rename(columns={'customer_id': 'count', 'successful': 'success_rate'})
return efficiency
def recommend_window_strategy(self):
"""
Recommend optimal window strategy
Balance customer preference with operational needs
"""
window_efficiency = self.calculate_window_efficiency()
recommendations = []
# Default: Offer 2-hour windows during peak times
recommendations.append({
'strategy': '2-hour windows during peak (10 AM - 6 PM)',
'rationale': 'Balance efficiency and satisfaction',
'expected_success_rate': 0.92
})
# Premium: 1-hour windows for higher fee
recommendations.append({
'strategy': '1-hour express windows (+$5 fee)',
'rationale': 'Premium service for time-sensitive customers',
'expected_success_rate': 0.85,
'upcharge': 5.00
})
# Economy: 4-hour or all-day windows for discount
recommendations.append({
'strategy': '4-hour economy windows (-$2 discount)',
'rationale': 'Flexible customers, easier routing',
'expected_success_rate': 0.97,
'discount': -2.00
})
return recommendations
def dynamic_window_pricing(self, date, available_capacity):
"""
Calculate dynamic pricing for time slots
Surge pricing when capacity is constrained
"""
# Predict demand for each time slot
slots = [
'8-10 AM', '10-12 PM', '12-2 PM',
'2-4 PM', '4-6 PM', '6-8 PM'
]
pricing = []
for slot in slots:
# Estimate demand (simplified - use ML in practice)
base_demand = 100
slot_demand = base_demand * np.random.uniform(0.7, 1.3)
# Calculate capacity utilization
utilization = slot_demand / available_capacity
# Dynamic pricing
if utilization < 0.7:
price_modifier = 0.8 # 20% discount
incentive = 'Discount - low demand'
elif utilization < 0.9:
price_modifier = 1.0 # Standard price
incentive = 'Standard pricing'
else:
price_modifier = 1.5 # 50% surge
incentive = 'Surge - high demand'
pricing.append({
'time_slot': slot,
'demand': slot_demand,
'capacity': available_capacity,
'utilization': utilization,
'price_modifier': price_modifier,
'incentive': incentive
})
return pd.DataFrame(pricing)

Time Window Strategies:

  • Tiered pricing by window width
  • Dynamic pricing by demand/capacity
  • Attended vs. unattended delivery options
  • Locker/pickup for flexible customers
  • Predictive "smart" windows (ML-based)
3. Micro-Fulfillment & Dark Stores

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
74
Repository forks
18
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kishorkukreja/awesome-supply-chain/last-mile-delivery/badge)](https://verified-skill.com/skills/kishorkukreja/awesome-supply-chain/last-mile-delivery)

Something wrong with this skill or its page? Tell us.