bid-analysis-comparator
Compare and analyze contractor bids. Score proposals, identify scope gaps, and recommend selections.
What this skill does
# Bid Analysis Comparator
## Business Case
Bid evaluation requires systematic comparison across multiple criteria. This skill provides structured bid analysis and scoring.
## Technical Implementation
```python
import pandas as pd
from datetime import date
from typing import Dict, Any, List
from dataclasses import dataclass, field
from enum import Enum
class BidStatus(Enum):
RECEIVED = "received"
UNDER_REVIEW = "under_review"
SHORTLISTED = "shortlisted"
AWARDED = "awarded"
REJECTED = "rejected"
@dataclass
class EvaluationCriteria:
name: str
weight: float # 0-1
max_score: int = 10
@dataclass
class BidScore:
criteria: str
score: int
notes: str = ""
@dataclass
class Bid:
bid_id: str
bidder_name: str
bid_package: str
submitted_date: date
base_bid: float
alternates: Dict[str, float]
status: BidStatus
scores: List[BidScore] = field(default_factory=list)
qualifications: List[str] = field(default_factory=list)
exclusions: List[str] = field(default_factory=list)
@property
def total_weighted_score(self) -> float:
return sum(s.score for s in self.scores)
class BidAnalysisComparator:
def __init__(self, project_name: str, bid_package: str):
self.project_name = project_name
self.bid_package = bid_package
self.bids: Dict[str, Bid] = {}
self.criteria: List[EvaluationCriteria] = []
self._setup_default_criteria()
self._counter = 0
def _setup_default_criteria(self):
self.criteria = [
EvaluationCriteria("Price", 0.35),
EvaluationCriteria("Experience", 0.20),
EvaluationCriteria("Schedule", 0.15),
EvaluationCriteria("Safety Record", 0.10),
EvaluationCriteria("References", 0.10),
EvaluationCriteria("Capacity", 0.10)
]
def add_bid(self, bidder_name: str, base_bid: float,
submitted_date: date = None,
alternates: Dict[str, float] = None) -> Bid:
self._counter += 1
bid_id = f"BID-{self._counter:03d}"
bid = Bid(
bid_id=bid_id,
bidder_name=bidder_name,
bid_package=self.bid_package,
submitted_date=submitted_date or date.today(),
base_bid=base_bid,
alternates=alternates or {},
status=BidStatus.RECEIVED
)
self.bids[bid_id] = bid
return bid
def score_bid(self, bid_id: str, scores: Dict[str, int]):
"""Score bid on criteria. scores = {'Price': 8, 'Experience': 7, ...}"""
if bid_id not in self.bids:
return
bid = self.bids[bid_id]
bid.scores = []
for criteria, score in scores.items():
bid.scores.append(BidScore(criteria, score))
bid.status = BidStatus.UNDER_REVIEW
def calculate_weighted_scores(self) -> pd.DataFrame:
"""Calculate weighted scores for all bids."""
results = []
criteria_weights = {c.name: c.weight for c in self.criteria}
for bid in self.bids.values():
row = {
'Bidder': bid.bidder_name,
'Base Bid': bid.base_bid,
'Status': bid.status.value
}
total = 0
for score in bid.scores:
weight = criteria_weights.get(score.criteria, 0)
weighted = score.score * weight * 10
row[score.criteria] = score.score
row[f'{score.criteria} (W)'] = round(weighted, 1)
total += weighted
row['Total Score'] = round(total, 1)
results.append(row)
return pd.DataFrame(results).sort_values('Total Score', ascending=False)
def get_recommendation(self) -> Dict[str, Any]:
"""Get bid recommendation."""
df = self.calculate_weighted_scores()
if df.empty:
return {'recommendation': 'No bids to evaluate'}
top = df.iloc[0]
lowest = df.sort_values('Base Bid').iloc[0]
return {
'highest_score': {
'bidder': top['Bidder'],
'score': top['Total Score'],
'bid': top['Base Bid']
},
'lowest_price': {
'bidder': lowest['Bidder'],
'bid': lowest['Base Bid']
},
'total_bids': len(self.bids),
'recommendation': top['Bidder']
}
def export_analysis(self, output_path: str):
df = self.calculate_weighted_scores()
with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
df.to_excel(writer, sheet_name='Comparison', index=False)
# Bid details
details = [{
'Bidder': b.bidder_name,
'Bid': b.base_bid,
'Exclusions': '; '.join(b.exclusions),
'Qualifications': '; '.join(b.qualifications)
} for b in self.bids.values()]
pd.DataFrame(details).to_excel(writer, sheet_name='Details', index=False)
```
## Quick Start
```python
comparator = BidAnalysisComparator("Office Tower", "Electrical")
bid1 = comparator.add_bid("ABC Electric", 850000)
bid2 = comparator.add_bid("XYZ Electric", 920000)
comparator.score_bid(bid1.bid_id, {'Price': 9, 'Experience': 7, 'Schedule': 8,
'Safety Record': 8, 'References': 7, 'Capacity': 8})
comparator.score_bid(bid2.bid_id, {'Price': 7, 'Experience': 9, 'Schedule': 7,
'Safety Record': 9, 'References': 9, 'Capacity': 9})
recommendation = comparator.get_recommendation()
print(f"Recommended: {recommendation['recommendation']}")
```
## Resources
- **DDC Book**: Chapter 3.4 - Procurement
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.