smithery.ai

ai-opponent

Implement or tune AI opponent behavior

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Edit, Write, Grep, Glob, Bash

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,763 B
  • docs SUMMARY.md 57 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

AI Opponent Implementation

Help implement or tune AI opponent logic per the game design.

AI Strategy (from design doc)

func chooseAcceleration(racer: Player, track: Track, opponents: [Player]) -> GridVector {
    var bestScore = Int.min
    var bestAccel = GridVector(0, 0)

    for acceleration in allAccelerations {
        let newPos = racer.position + racer.velocity + acceleration
        let newVel = racer.velocity + acceleration

        if wouldCrash(from: racer.position, to: newPos, track: track) {
            score = -1000
        } else {
            score = progressTowardFinish(newPos, track.finishLine)
            score -= distanceToTrackCenter(newPos, track) * 0.1
            score -= speed(newVel) * 0.05  // Prefer control
        }

        if score > bestScore {
            bestScore = score
            bestAccel = acceleration
        }
    }
    return bestAccel
}

Difficulty Levels

Level Behavior
Easy Random valid moves, avoids crashes
Medium Greedy progress toward finish
Hard Looks 2-3 moves ahead, blocks opponents

Implementation Tasks

  1. Basic AI: Avoid crashes, prefer forward progress
  2. Path scoring: Evaluate each of 9 options
  3. Lookahead: Simulate N turns ahead (Hard mode)
  4. Opponent awareness: Block or avoid collisions
  5. Track awareness: Prefer center of track

Testing

  • AI should never choose crash moves when safe options exist
  • Easy AI should lose to competent player
  • Hard AI should provide challenge