Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

dfs-optimizer

FreeNo executable scriptsNot checked

Build optimal Daily Fantasy Sports lineups for DraftKings and FanDuel. Maximize projected points under salary cap constraints for NBA, NFL, and MLB slates.

ianallowayby ianalloway205 installs in other catalogs

About this skill

DFS Lineup Optimizer

Build mathematically optimal Daily Fantasy Sports lineups. Uses a greedy salary-cap optimizer to maximize projected fantasy points under DraftKings/FanDuel roster constraints. No paid API needed — paste your own projections or use the built-in samples.

NBA DraftKings Optimizer

python3 -c "
import itertools, json

# =====================================================
# PASTE YOUR SLATE HERE
# Format: (name, position, salary, projected_points)
# Positions: PG, SG, SF, PF, C, G (PG/SG), F (SF/PF), UTIL (any)
# DraftKings NBA: 2 PG, 2 SG, 2 SF, 1 PF, 1 C = 8 players, \$50,000 cap
# =====================================================
players = [
    ('LeBron James',     'SF', 9800, 52.4),
    ('Stephen Curry',    'PG', 9600, 51.8),
    ('Nikola Jokic',     'C',  9900, 58.1),
    ('Luka Doncic',      'PG', 10200, 59.2),
    ('Jayson Tatum',     'SF', 9200, 49.3),
    ('Anthony Davis',    'PF', 9400, 53.7),
    ('Ja Morant',        'PG', 8600, 46.2),
    ('Kevin Durant',     'SF', 8800, 47.5),
    ('Joel Embiid',      'C',  9500, 55.0),
    ('Trae Young',       'PG', 8200, 44.1),
    ('Devin Booker',     'SG', 8400, 45.3),
    ('Bam Adebayo',      'C',  7800, 41.2),
    ('DeMar DeRozan',    'SF', 7200, 38.5),
    ('Miles Bridges',    'SF', 6800, 36.1),
    ('Tyrese Haliburton','PG', 8000, 43.7),
    ('Jordan Poole',     'SG', 6200, 32.8),
    ('Franz Wagner',     'SF', 7000, 37.9),
    ('Alperen Sengun',   'C',  7400, 39.8),
    ('Brandon Ingram',   'SF', 7600, 40.5),
    ('Cole Anthony',     'PG', 5600, 28.4),
]

SALARY_CAP = 50000
ROSTER = {'PG': 2, 'SG': 2, 'SF': 2, 'PF': 1, 'C': 1}

def greedy_lineup(players, cap, roster_req):
    # Value = pts per \$1000 salary
    valued = [(name, pos, sal, pts, pts / sal * 1000) for name, pos, sal, pts in players]
    valued.sort(key=lambda x: -x[4])  # sort by value desc

    lineup = []
    remaining_slots = dict(roster_req)
    total_salary = 0
    total_pts = 0

    for name, pos, sal, pts, val in valued:
        if remaining_slots.get(pos, 0) > 0 and total_salary + sal <= cap:
            lineup.append((name, pos, sal, pts, val))
            remaining_slots[pos] -= 1
            total_salary += sal
            total_pts += pts
            if all(v == 0 for v in remaining_slots.values()):
                break

    return lineup, total_salary, total_pts

lineup, total_sal, total_pts = greedy_lineup(players, SALARY_CAP, ROSTER)

print('=== DraftKings NBA Optimal Lineup ===')
print(f'{\"Name\":<22} {\"POS\":<5} {\"SALARY\":>8} {\"PROJ\":>7} {\"VALUE\":>8}')
print('-' * 58)
for name, pos, sal, pts, val in sorted(lineup, key=lambda x: list(ROSTER.keys()).index(x[1]) if x[1] in ROSTER else 99):
    print(f'{name:<22} {pos:<5} \${sal:>7,} {pts:>7.1f} {val:>7.2f}x')
print('-' * 58)
print(f'{\"TOTAL\":<22} {\"\":<5} \${total_sal:>7,} {total_pts:>7.1f}')
print(f'Salary remaining: \${SALARY_CAP - total_sal:,}')
"

NFL DraftKings Optimizer

python3 -c "
# DraftKings NFL: 1 QB, 2 RB, 3 WR, 1 TE, 1 FLEX (RB/WR/TE), 1 DST
# Cap: \$50,000

players = [
    # (name, position, salary, projected_pts)
    ('Patrick Mahomes', 'QB',  8400, 32.1),
    ('Josh Allen',      'QB',  8800, 33.8),
    ('Christian McCaffrey', 'RB', 9200, 38.4),
    ('Austin Ekeler',   'RB',  6800, 26.2),
    ('Breece Hall',     'RB',  7400, 28.9),
    ('Isiah Pacheco',   'RB',  6200, 24.5),
    ('Tyreek Hill',     'WR',  9000, 35.2),
    ('Stefon Diggs',    'WR',  7600, 29.8),
    ('Davante Adams',   'WR',  8200, 32.6),
    ('Jaylen Waddle',   'WR',  7000, 27.4),
    ('Travis Kelce',    'TE',  8600, 34.5),
    ('Mark Andrews',    'TE',  7200, 28.1),
    ('San Francisco 49ers', 'DST', 4200, 12.4),
    ('Kansas City Chiefs', 'DST', 3800, 11.2),
    ('Dallas Cowboys',  'DST', 3600, 10.8),
    ('Ja\'Marr Chase',   'WR',  8600, 34.1),
    ('Alvin Kamara',    'RB',  7000, 27.6),
    ('Sam LaPorta',     'TE',  5800, 22.3),
]

SALARY_CAP = 50000
SLOTS = [('QB', 1), ('RB', 2), ('WR', 3), ('TE', 1), ('DST', 1)]
FLEX_POSITIONS = {'RB', 'WR', 'TE'}

def optimize_nfl(players, cap, slots, flex_count=1):
    from collections import defaultdict
    by_pos = defaultdict(list)
    for p in players:
        name, pos, sal, pts = p
        by_pos[pos].append((name, pos, sal, pts, pts / sal * 1000))
    for pos in by_pos:
        by_pos[pos].sort(key=lambda x: -x[4])

    lineup = []
    total_sal = 0
    total_pts = 0

    for pos, count in slots:
        added = 0
        for player in by_pos[pos]:
            if added >= count: break
            if total_sal + player[2] > cap: continue
            lineup.append(player)
            total_sal += player[2]
            total_pts += player[3]
            added += 1

    # Flex slot
    flex_candidates = []
    in_lineup = {p[0] for p in lineup}
    for pos in FLEX_POSITIONS:
        for p in by_pos[pos]:
            if p[0] not in in_lineup:
                flex_candidates.append(p)
    flex_candidates.sort(key=lambda x: -x[4])
    fo
Full SKILL.md on ClawHub

Install dfs-optimizer in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the dfs-optimizer skill do?

Build optimal Daily Fantasy Sports lineups for DraftKings and FanDuel. Maximize projected points under salary cap constraints for NBA, NFL, and MLB slates.

How do I install the dfs-optimizer skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the dfs-optimizer skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare dfs-optimizer with