vercel/swr

GitHub
https://github.com/vercel/swr

React Hooks for Data Fetching

  • cache
  • data
  • data-fetching
  • fetch
  • hook
  • hooks
  • nextjs
  • react
  • react-native
  • stale-while-revalidate
  • suspense
  • swr
  • vercel
Stars:
32.5k
Language:
TypeScript
Default branch:
main
Last scored:
Overall

At a glance

Rank
#183 of 401
Top 46% · #52 of 82 TypeScript repos
Checks passed
9 of 17
Full list below
Best set up for
Claude Code
Score 74.2
Needs most work for
Cursor
Biggest fix: Cursor rules (.cursor/rules) (+11.5 pts)

What it has

What it's missing

What to fix first

Pick an AI agent

Showing fixes for Claude Code

  1. 1
    AGENTS.md / CLAUDE.md
    Add an AGENTS.md covering project goals, layout, setup commands, and conventions. Aim for 800+ chars of real guidance (not boilerplate).
    +13.2 pts
  2. 2
    Linter / formatter config
    Configure a linter/formatter (ESLint+Prettier, Biome, Ruff, rustfmt+clippy, golangci-lint) and commit the config.
    +7.9 pts
  3. 3
    Reproducible dev env
    Add a Makefile or devcontainer or Dockerfile so the agent can set up the project in one command.
    +4.7 pts

Score for each AI agent

Each agent weighs the checks by its own docs. Under each score are its top three. How each agent is scored →

Claude Code
#177 of 401
74.2
  • ✗AGENTS.md / CLAUDE.md
  • ✓Test suite
  • ~Reproducible dev env
Devin
#135 of 401
73.8
  • ~Reproducible dev env
  • ✓Dependency manifest
  • ✓Test suite
Codex
#180 of 401
72.4
  • ✗AGENTS.md / CLAUDE.md
  • ✓README
  • ✓Test suite
OpenHands
#121 of 401
71.0
  • ✓CI configuration
  • ✓Dependency manifest
  • ~Reproducible dev env
Kimi Code CLI
#200 of 401
69.6
  • ✗AGENTS.md / CLAUDE.md
  • ✓Test suite
  • ✓Dependency manifest
Pi
#221 of 401
67.5
  • ✗AGENTS.md / CLAUDE.md
  • ✓Test suite
  • ✗Linter / formatter config
Gemini CLI
#170 of 401
66.5
  • ✗GEMINI.md
  • ✓README
  • ✓Test suite
Aider
#203 of 401
64.8
  • ✗.aider.conf.yml
  • ✗Linter / formatter config
  • ✓Test suite
Cursor
#212 of 401
63.2
  • ✗Cursor rules (.cursor/rules)
  • ✓README
  • ✓Type configuration

Does vercel/swr have agent instructions?

An AGENTS.md (or CLAUDE.md) at the root tells AI coding agents how to build, test and work in the repo. A few agents also read a file of their own.

AGENTS.md / CLAUDE.md
None at the root (no AGENTS.md, CLAUDE.md, AGENT.md, .claude/CLAUDE.md or .claude/AGENTS.md)
Agent-specific files
None: no GEMINI.md, .cursor/rules, .openhands/setup.sh, .aider.conf.yml or .agents/skills
Repos that have one
62 of 82 TypeScript repos · 221 of 401 repos on the leaderboard · See examples →
Get a starter AGENTS.md

From the files the checks found. Fill in the commands, then commit it at the root.

# AGENTS.md

Guidance for AI coding agents working in vercel/swr. React Hooks for Data Fetching. Written mainly in TypeScript.

## Where things are

- Dependencies are declared in `package.json`.
- Tests live in `test`.
- Type checking is configured in `tsconfig.json`.
- CI is defined in `.github/workflows`; read it for the exact install, lint and test steps.
- Commit hooks are set up in `.husky`; don't skip them.
- Project tasks are the `scripts` in `package.json`.
- Follow the conventions in `.github/CONTRIBUTING.md`.

## Commands

<!-- Fill in the exact commands CI runs. -->
- Install: TODO
- Test: TODO
- Lint: TODO

All 17 checks · 9 passed

No .agents/skills/<name>/SKILL.md
No agent instructions file found
.aider.conf.yml· 0% pass
No .aider.conf.yml at repo root
CI configuration· 100% pass
4 GitHub Actions workflows
No .cursor/rules/*.mdc or .cursorrules
Manifest present
package.json has 21 scripts
GEMINI.md· 0% pass
No GEMINI.md at repo root
License file· 100% pass
License present
No linter/formatter config found
No .openhands/setup.sh
Hook framework configured
README· 100% pass
README detailed (3,735 characters)
Manageable size· 100% pass
328 files
Test suite· 100% pass
Found /test
Type configuration· 100% pass
Type config present

How vercel/swr compares

vs leaderboard average
2.4 pts above
Average 66.8
vs TypeScript average
2.0 pts below
Average 71.2
Stars among TypeScript repos
#54 of 82

Missing here, and how many repos have it

  • Linter / formatter config · passed by 65% of leaderboard repos, 57% of TypeScript repos
  • Skills (.agents/skills) · passed by 17% of leaderboard repos, 30% of TypeScript repos
  • Cursor rules (.cursor/rules) · passed by 4% of leaderboard repos, 13% of TypeScript repos

Passes checks most repos miss

  • Pre-commit / git hooks · only 29% of repos pass it
  • Manageable size · only 16% of repos pass it

One fix for the most agents: Linter / formatter config would raise the score for all 9 agents, by up to 14.1 points.

Similar repos

Same language and host as this repo, closest in overall score.

All TypeScript repos →

Same topics, any language

Repos tagged with the same GitHub topics, most shared first.

Add a badge to your README

Paste this at the top of the README. It shows the score, and links back to this page.

Agent friendly score for github/vercel/swr
[![Agent Friendly](https://agentfriendlycode.com/api/badge/github/vercel/swr.svg)](https://agentfriendlycode.com/repo/github/vercel/swr)

Check the score on every pull request

A GitHub Action posts one comment per pull request with how the score changed and why.