agentleFS
VercelKnown publishervercel/next.js/.github/AGENTS.md

next.js

AGENTS.md144k starsChanged 7 months agoMITView on GitHub

Set permissions: {} at the workflow level and grant the minimum needed per-job. Prefer GitHub-provided (actions/*) and Vercel-owned actions. For third-party actions: ${{ ... }} is interpolated into the script before bash runs, so untrusted values (PR title, branch name, issue body) can break out and execute. Route them through an env var and quote on use:

  • Installs packages

Trending

Less talk lately.about the whole repository

Dec 2025: 4 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 3 mentionsApr 2026: 2 mentionsMay 2026: 4 mentionsJun 2026: 4 mentionsJul 2026: 3 mentionsAug 2026: 2 mentionsSep 2026: 3 mentionsOct 2026: 3 mentionsNov 2026: 1 mention
Dec 2025Jun 2026Nov 2026
Mentions a month of the vercel/next.js repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about vercel/next.js

The biggest 5 of 92 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 92

Talked about on Bluesky, GitHub and Hacker News (92 times).

On Bluesky · 50

45 more on Bluesky

On GitHub · 26

21 more on GitHub

On Hacker News · 16

11 more on Hacker News

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 0 are common, 1 is distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use pull_request, not pull_request_target.

    line 3
  2. Very specific:

    When operating on pull_request, think if the workflow should use concurrency to cancel superseded runs.

    line 5
  3. Very specific:

    Prefer GitHub-provided (actions/*) and Vercel-owned actions.

    line 28
  4. Very specific:

    Don't include the third-party action if it doesn't provide much value, e.g.

    line 30
  5. Very specific:

    Before pinning, git grep -n 'owner/repo@' and reuse the SHA already in the repo if one exists.

    line 37
  6. Very specific:

    When using actions/checkout, pass persist-credentials: false unless the job actually needs to push or call the GitHub API as the checkout …

    line 43
  7. Very specific:

    Use pnpm, not npm. Add the CLI to devDependencies (root package.json for CI-only tooling).

    line 47
  8. Very specific:

    Use pnpm add -D over directly modifying package.json.

    line 48
  9. Distinctive:

    Prefer official GitHub Releases assets over raw URLs.

    line 55
  10. Very specific:

    Use curl --retry 3 (or equivalent) so transient failures don't fail the workflow.

    line 57
  11. Very specific:

    Start multi-line run: blocks with set -euo pipefail.

    line 75
  12. Very specific:

    Never echo/printf a secret.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Events Triggering Workflows

  • Use pull_request, not pull_request_target. If you genuinely need secrets on a fork PR, never check out the PR's HEAD ref in the privileged job.
  • Be extremely careful with workflow_run for similar to pull_request_target.
  • When operating on pull_request, think if the workflow should use concurrency to cancel superseded runs.

Workflow Permissions

Set permissions: {} at the workflow level and grant the minimum needed per-job.

permissions: {}

jobs:
  lint:
    permissions:
      contents: read
    # ...
  comment-on-pr:
    permissions:
      contents: read
      pull-requests: write
    # ...

Third-party GitHub Actions

Prefer GitHub-provided (actions/*) and Vercel-owned actions. For third-party actions:

  • Don't include the third-party action if it doesn't provide much value, e.g. if a pnpm-installable tool can do the same job without much more code.
  • Pin to a full commit SHA, never a tag or branch. Include the tag as a trailing comment:

    uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  • Before pinning, git grep -n 'owner/repo@' and reuse the SHA already in the repo if one exists. Otherwise look up the latest tag:

    gh api repos/{owner}/{repo}/tags --jq '.[0:10] | .[] | {name, sha: .commit.sha}'
  • When using actions/checkout, pass persist-credentials: false unless the job actually needs to push or call the GitHub API as the checkout token.

Installing CLIs from npm

  • Use pnpm, not npm. Add the CLI to devDependencies (root package.json for CI-only tooling).
  • Use pnpm add -D over directly modifying package.json. Let pnpm figure out the latest version number.
  • pnpm dlx does not pin transitive deps; don't rely on it.
  • Bootstrap pnpm via corepack so it picks up packageManager from the root package.json.

Downloading binaries (e.g. GitHub Releases)

  • Hardcode the expected sha256 and validate before chmod +x.
  • Prefer official GitHub Releases assets over raw URLs.
  • Choose stable URLs. Use the gh CLI or GitHub API as needed to find releases.
  • Use curl --retry 3 (or equivalent) so transient failures don't fail the workflow.

Script injection

${{ ... }} is interpolated into the script before bash runs, so untrusted values (PR title, branch name, issue body) can break out and execute. Route them through an env var and quote on use:

- name: Check PR title
  env:
    TITLE: ${{ github.event.pull_request.title }}
  run: |
    set -euo pipefail
    case "$TITLE" in
      octocat*) echo "starts with octocat" ;;
      *) exit 1 ;;
    esac
  • Start multi-line run: blocks with set -euo pipefail.
  • Quote every "$VAR".
  • Never echo/printf a secret. Use ::add-mask:: for dynamic secrets.
  • The same risk applies to bash -c, sh -c, and child_process invocations that build command strings.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.