Skip to content

Add Claude Code & Cursor IDE context files with one-command install#183

Open
kamran-rapidfireAI wants to merge 3 commits intomainfrom
feature/add-claude-skills
Open

Add Claude Code & Cursor IDE context files with one-command install#183
kamran-rapidfireAI wants to merge 3 commits intomainfrom
feature/add-claude-skills

Conversation

@kamran-rapidfireAI
Copy link
Collaborator

@kamran-rapidfireAI kamran-rapidfireAI commented Feb 22, 2026

Why This Matters for Our Users

RapidFire AI has a rich API surface — Experiment, RFGridSearch, RFRandomSearch, RFModelConfig, RFLoraConfig, RFLangChainRagSpec, and dozens of config knobs across fit and evals workflows. Our users are increasingly building their experiments inside AI-assisted IDEs (Claude Code, Cursor), but the AI has no idea how to use our package correctly. It hallucinates wrong parameter names, uses mode="eval" instead of mode="evals", passes embedding instances instead of classes, and misses critical patterns like experiment.end().

This PR solves that by shipping IDE context files that teach Claude Code and Cursor the full RapidFire AI API, patterns, and common mistakes — installable in one command.

What Changes

New: ide-context/ directory

Three context files that customers copy into their project:

  • CLAUDE.md — Lean overview loaded at the start of every Claude Code session (~75 lines). Covers environment setup, server lifecycle, core mental model, and canonical code patterns for both fit and evals workflows.
  • .claude/rules/rapidfireai-api.md — Full API reference Claude can pull on demand. Every class signature, every user-function contract, IC Ops semantics, troubleshooting commands.
  • .cursor/rules/rapidfireai.mdc — Auto-applied Cursor rule for .py and .ipynb files. Complete examples for SFT and RAG, common mistakes table, LoRA knob guidance.

Plus install scripts (install.sh, install.ps1) and a README.md explaining what gets installed.

New: rapidfireai install-ide-context CLI command

Zero-friction install — customers already have the CLI from pip install rapidfireai:

cd /path/to/my-project
rapidfireai install-ide-context

Copies CLAUDE.md, .claude/rules/, and .cursor/rules/ into the current directory. Follows the same pattern as copy_tutorial_notebooks(). The command prints the target directory before copying so users know exactly where files land.

Fallback one-liners for users who don't have the CLI yet:

# macOS/Linux
curl -sSL https://raw.githubusercontent.com/RapidFireAI/rapidfireai/main/ide-context/install.sh | bash

# Windows PowerShell
irm https://raw.githubusercontent.com/RapidFireAI/rapidfireai/main/ide-context/install.ps1 | iex

Modified files

  • pyproject.toml — Bundles ide-context/ as package data so the CLI command works after pip install
  • .gitignore — Adds negation rules so ide-context/.cursor/ is tracked (the root .cursor/ remains ignored)
  • README.md — New "AI-Assisted Development" section with install instructions
  • cli.pyinstall_ide_context() function + install-ide-context command + help text

User Impact

Before After
AI guesses at our API, hallucinates params AI knows every class signature, default, and constraint
Users manually read docs to correct AI output AI generates correct rapidfireai code on first try
Common mistakes (wrong mode, Range in GridSearch, kill -9) AI actively avoids documented pitfalls
No discoverability rapidfireai install-ide-context in README + CLI help

Accuracy

All context files were audited against the actual source code. Fixes applied for:

  • mode="evals" (not "eval")
  • InteractiveController import path (rapidfireai.fit.utils, not rapidfireai.utils)
  • experiment_path parameter name (not experiments_path)
  • run_fit first param is param_config (not config_group)
  • RFRandomSearch constructor (no seed param — seed goes to run_fit/run_evals)
  • run_evals signature (num_actors defaults to None, includes gpus_per_actor/cpus_per_actor)

Test Plan

  • Run rapidfireai install-ide-context from a fresh project directory — verify CLAUDE.md, .claude/rules/rapidfireai-api.md, and .cursor/rules/rapidfireai.mdc are created
  • Open the project in Cursor — verify the .mdc rule auto-applies when editing a .py file
  • Start a Claude Code session in the project — verify CLAUDE.md is loaded and .claude/rules/rapidfireai-api.md is referenceable
  • Verify pip install . bundles ide-context/ in the wheel (check site-packages)
  • Run curl and irm fallback scripts from a clean directory

Note

Low Risk
Primarily adds documentation/static assets and a new optional CLI command that copies files; minimal impact on core runtime behavior.

Overview
Adds an ide-context/ bundle (Claude Code + Cursor rules, API reference, and install scripts) and ships it as package data so it’s available after pip install.

Introduces a new CLI command, rapidfireai install-ide-context, which copies CLAUDE.md, .claude/rules/rapidfireai-api.md, and .cursor/rules/rapidfireai.mdc into the current working directory, with help text and basic error handling.

Updates .gitignore to allow tracking ide-context/.cursor/, and extends README.md with installation instructions and curl/PowerShell fallbacks.

Written by Cursor Bugbot for commit ef24ed7. This will update automatically on new commits. Configure here.

kamran-rapidfireAI and others added 3 commits February 21, 2026 22:17
…ntext

Co-authored-by: Cursor <cursoragent@cursor.com>
…ignore and README

Co-authored-by: Cursor <cursoragent@cursor.com>
…s, signatures

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Collaborator

@david-rfai david-rfai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about doing this automatically rather than as a separate command.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we do not auto sense the IDE and do this automatically on start or init?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@david-rfai Good idea. If the user has several projects on their computer, which one to choose? Also we need to ask their permission (Yes/No in the command line). I'm open to ideas.

Copy link
Collaborator

@david-rfai david-rfai Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just detect the environment as cursor/vscode you can tell you are in the environment. See run_jupyter function in cli.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants