Skip to content

Feature/adding agents init#15356

Merged
Melkeydev merged 7 commits intomainfrom
feature/adding-agents-init
Mar 4, 2026
Merged

Feature/adding agents init#15356
Melkeydev merged 7 commits intomainfrom
feature/adding-agents-init

Conversation

@Melkeydev
Copy link
Copy Markdown
Contributor

@Melkeydev Melkeydev commented Mar 3, 2026

Summary

  • Adds vercel agent init command that generates an AGENTS.md file with Vercel
    deployment best practices
  • When an AGENTS.md already exists, appends the best practices section to the bottom
  • Skips if the best practices section is already present (idempotent)
  • Supports interactive TTY mode with confirmation prompt and non-interactive CI mode
    via --yes flag
  • Includes spinner animation and styled success output
  • Adds telemetry tracking for init argument and --yes flag
  • Adds 10 unit tests covering all code paths

Context

AI coding agents (Claude Code, Cursor, Gemini, Codex, etc.) read AGENTS.md files to
understand project conventions. This command gives users a one-liner to inject
Vercel-specific best practices - covering functions, caching, edge runtime,
environment variables, security, observability, and more - so agents follow Vercel
conventions out of the box.

Test plan

  • Unit test: --help returns exit code 2
  • Unit test: --help tracks telemetry
  • Unit test: creates AGENTS.md in TTY mode with user confirmation
  • Unit test: creates AGENTS.md in non-TTY mode with --yes
  • Unit test: errors in non-TTY mode without --yes
  • Unit test: appends to existing AGENTS.md without best practices
  • Unit test: skips when best practices already present (idempotent)
  • Unit test: user declining prompt returns 0 with "Canceled"
  • Unit test: implicit init subcommand (vercel agent --yes)
  • Unit test: unknown subcommand returns exit code 1
  • All 10 agent init tests pass

Note

Low Risk Change

This PR adds a new CLI command vercel agent init that generates/updates an AGENTS.md file with best practices documentation, containing only new feature code, telemetry tracking, and comprehensive unit tests with no security-sensitive changes.

  • New CLI command agent init for generating AGENTS.md documentation file
  • Telemetry tracking for command usage and flags
  • 10 unit tests covering all code paths

Risk assessment for commit 2bc4480.

@Melkeydev Melkeydev requested review from a team as code owners March 3, 2026 06:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 2bc4480

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-egolnaz0p.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-egolnaz0p.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-egolnaz0p.vercel.sh/tarballs/vercel_runtime-0.6.0.dev1772578275+2bc4480-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-egolnaz0p.vercel.sh/tarballs/vercel_workers-0.1.0.dev1772578275+2bc4480-py3-none-any.whl"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

🧪 Unit Test Strategy

Comparing: e0499152bc4480 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (3%)
  1. vercel
Unaffected packages - 39 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@Melkeydev Melkeydev marked this pull request as draft March 3, 2026 06:30
@Melkeydev Melkeydev marked this pull request as ready for review March 3, 2026 19:34
Copy link
Copy Markdown
Contributor

@brookemosby brookemosby left a comment

Choose a reason for hiding this comment

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

LGTM

@Melkeydev Melkeydev merged commit 35e6406 into main Mar 4, 2026
179 checks passed
@Melkeydev Melkeydev deleted the feature/adding-agents-init branch March 4, 2026 19:48
ricardo-agz pushed a commit that referenced this pull request Mar 4, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@50.27.0

### Minor Changes

- Add `vercel agent init` command that generates an AGENTS.md file with
Vercel deployment best practices
([#15356](#15356))

### Patch Changes

- print vercel CLI version on VERCEL=1
([#15359](#15359))

- Updated dependencies
\[[`62700e88d527e3a3be2b317b805f778f3bf97f86`](62700e8)]:
    -   @vercel/next@4.15.40

## @vercel/next@4.15.40

### Patch Changes

- vary fallback `allowQuery` by params for partial fallback shells
([#15338](#15338))


<!-- VADE_RISK_START -->
> [!NOTE]
> Low Risk Change
>
> This PR is an automated Changesets release that only bumps version
numbers in package.json files and updates CHANGELOG.md files with
release notes.
> 
> - Version bumps: vercel 50.26.1 → 50.27.0, @vercel/next 4.15.39 →
4.15.40
> - Changelog updates documenting new features and patches
> - Deleted changeset markdown files consumed by release process
>
> <sup>Risk assessment for [commit
61c7c67](https://github.com/vercel/vercel/commit/61c7c67b4789c68204b0a7bb6ab66c75e3c57997).</sup>
<!-- VADE_RISK_END -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ricardo-agz pushed a commit that referenced this pull request Mar 4, 2026
Summary

- Adds vercel agent init command that generates an AGENTS.md file with
Vercel
  deployment best practices
- When an AGENTS.md already exists, appends the best practices section
to the bottom
  - Skips if the best practices section is already present (idempotent)
- Supports interactive TTY mode with confirmation prompt and
non-interactive CI mode
  via --yes flag
  - Includes spinner animation and styled success output
  - Adds telemetry tracking for init argument and --yes flag
  - Adds 10 unit tests covering all code paths


  Context

AI coding agents (Claude Code, Cursor, Gemini, Codex, etc.) read
AGENTS.md files to
understand project conventions. This command gives users a one-liner to
inject
Vercel-specific best practices - covering functions, caching, edge
runtime,
environment variables, security, observability, and more - so agents
follow Vercel
  conventions out of the box.

  Test plan

  - Unit test: --help returns exit code 2
  - Unit test: --help tracks telemetry
  - Unit test: creates AGENTS.md in TTY mode with user confirmation
  - Unit test: creates AGENTS.md in non-TTY mode with --yes
  - Unit test: errors in non-TTY mode without --yes
  - Unit test: appends to existing AGENTS.md without best practices
  - Unit test: skips when best practices already present (idempotent)
  - Unit test: user declining prompt returns 0 with "Canceled"
  - Unit test: implicit init subcommand (vercel agent --yes)
  - Unit test: unknown subcommand returns exit code 1
  - All 10 agent init tests pass

<!-- VADE_RISK_START -->
> [!NOTE]
> Low Risk Change
>
> This PR adds a new CLI command `vercel agent init` that
generates/updates an AGENTS.md file with best practices documentation,
containing only new feature code, telemetry tracking, and comprehensive
unit tests with no security-sensitive changes.
> 
> - New CLI command `agent init` for generating AGENTS.md documentation
file
> - Telemetry tracking for command usage and flags
> - 10 unit tests covering all code paths
>
> <sup>Risk assessment for [commit
2bc4480](https://github.com/vercel/vercel/commit/2bc44807871bfc4846614ec9ec714a7fdca894c7).</sup>
<!-- VADE_RISK_END -->
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