-
Notifications
You must be signed in to change notification settings - Fork 1
Add AGENTS.md #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AGENTS.md #47
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughA new documentation file, AGENTS.md, was added providing agent-workflow guidelines for the Python Vercel Functions app that monitors RPC node response times, covering testing, dependencies, coding conventions, quality checks, testing practices, project structure, and environment variable handling. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (8)
AGENTS.md (8)
3-3: Generalize the agent example and add a link to the Agents.md standard"Codex CLI" is specific and may age quickly. Suggest making the example generic and linking the canonical spec for discoverability.
-This repository contains a Python-based Vercel Functions application for monitoring RPC node response times. When working on the project interactively with an agent (e.g. the Codex CLI) please follow the guidelines below to ensure smooth development and testing. +This repository contains a Python-based Vercel Functions application for monitoring RPC node response times. When working on the project interactively with an agent (e.g., an AI coding agent or CLI), please follow the guidelines below to ensure smooth development and testing. See the AGENTS.md standard for background: https://agents.md/
7-10: Clarify test script invocation paths and tighten the wording
- Use consistent paths for test scripts (here you later use
python tests/...).- Style: prefer “outside the interactive workflow” over “outside of”.
- Minor punctuation fix after “e.g.”
-* **Always use the test scripts** (`test_api_read.py`, `test_api_write.py`, `test_update_state.py`) for local testing and development. -* **Do _not_ deploy to Vercel during the agent session** unless explicitly requested. Deployments should be handled outside of the interactive workflow to avoid disrupting production services. +* **Always use the test scripts** (`tests/test_api_read.py`, `tests/test_api_write.py`, `tests/test_update_state.py`) for local testing and development. +* **Do _not_ deploy to Vercel during the agent session** unless explicitly requested. Deployments should be handled outside the interactive workflow to avoid disrupting production services. * **Create a `.env.local` file** with the necessary environment variables before testing locally.
15-17: Pinning and runtime clarity for Python compatibilityYou ask to verify Python 3.9+ compatibility. Two clarifications improve reliability:
- Explicitly state the supported runtime(s) and where that is configured (e.g.,
vercel.json,runtime.txt,.python-version).- Prefer pinned versions in
requirements.txt(already implied) and consider documenting a lock workflow if used (pip-tools/uv).1. Update `requirements.txt` with the new package and version. 2. Reinstall dependencies in your virtual environment with `pip install -r requirements.txt`. -3. Verify compatibility with Python 3.9+ as specified in the project. +3. Verify compatibility with Python 3.9+ as specified in the project. +4. Ensure the Vercel Python runtime matches the supported version(s) (e.g., set in `vercel.json`, `runtime.txt`, or `.python-version`) to avoid environment drift.
21-26: Clarify how cyclomatic complexity is enforcedRuff enforces McCabe complexity via rule C901 if enabled. Calling that out reduces ambiguity and helps contributors self-check.
-* Keep cyclomatic complexity below 10 (enforced by Ruff). +* Keep cyclomatic complexity below 10 (Ruff C901). + - If not already configured, enable `C901` in `ruff.toml` and set `max-complexity = 10`.
31-37: Single formatter or clear order of operationsYou run Black and Ruff. If Ruff is not used as a formatter, this is fine; otherwise, choose a single formatter to avoid churn. If keeping both, specify order (format → lint → type-check) and add an optional
pre-commithook to automate.-| `black .` | Format code to project standards | -| `ruff check .` | Run linting checks | -| `ruff check . --fix` | Auto-fix linting issues where possible | -| `mypy .` | Run type checking | +| `black .` | Format code to project standards | +| `ruff check .` | Lint (use `ruff check . --fix` to auto-fix) | +| `mypy .` | Type-check | + +Optional: install and run `pre-commit` to enforce these locally: +`pre-commit install && pre-commit run -a`
41-43: Fix unordered list style inconsistency (markdownlint MD004)Earlier bullets use asterisks; these use dashes. Switch to asterisks for consistency. Also remove the trailing double space at Line 42.
- - `python tests/test_api_read.py` for read metrics - - `python tests/test_api_write.py` for write metrics - - `python tests/test_update_state.py` for state updates + * `python tests/test_api_read.py` for read metrics + * `python tests/test_api_write.py` for write metrics + * `python tests/test_update_state.py` for state updates
44-46: Concretize mocking guidance for external callsIf the project uses pytest, naming common libraries helps new contributors:
responses/requests-mockfor requests,pytest-httpxif using httpx.-* Mock external API calls when writing unit tests. +* Mock external API calls when writing unit tests (e.g., `responses` or `requests-mock` for `requests`, `pytest-httpx` for `httpx`).
56-63: Environment hygiene: ensure ignore rules and provide a sample file; tighten wording
- Confirm
.env.localand.envare git-ignored; provide a.env.local.example.- Prefer “Set” over “Use” for environment variable instruction.
- Make explicit that production configuration lives in Vercel project settings.
* Development: `.env.local` (git-ignored) -* Production: Configured in Vercel dashboard -* Use `VERCEL_ENV=development` to add dev prefix to metrics during testing +* Production: Configure secrets in the Vercel project settings (never commit them) +* Add `.env.local.example` with non-secret placeholders to help contributors get started +* Set `VERCEL_ENV=development` to add a dev prefix to metrics during testing
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
AGENTS.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
AGENTS.md
[style] ~8-~8: This phrase is redundant. Consider using “outside”.
Context: ...equested. Deployments should be handled outside of the interactive workflow to avoid disru...
(OUTSIDE_OF)
[grammar] ~44-~44: There might be a mistake here.
Context: ...` is properly configured before testing. * Mock external API calls when writing uni...
(QB_NEW_EN)
[grammar] ~60-~60: There might be a mistake here.
Context: ... Development: .env.local (git-ignored) * Production: Configured in Vercel dashboa...
(QB_NEW_EN)
[grammar] ~61-~61: There might be a mistake here.
Context: ...oduction: Configured in Vercel dashboard * Use VERCEL_ENV=development to add dev ...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
AGENTS.md
41-41: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
42-42: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
43-43: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
🔇 Additional comments (3)
AGENTS.md (3)
1-66: Strong addition: clear agent workflow and local-testing guardrailsGood structure, actionable steps, and alignment with a standardized AGENTS.md. The local-first guidance, explicit quality gates (black/ruff/mypy), and emphasis on not deploying during agent sessions will reduce production risk. Nice work.
38-46: Minor consistency: align earlier script references with this sectionEarlier you list script names; here you show
python tests/.... With the earlier change, these will align. Good to keep both places consistent.
24-24: McCabe complexity checks verifiedThe Ruff configuration in
pyproject.tomlalready enables McCabe (C901) enforcement:• File:
pyproject.toml[tool.ruff.mccabe] max-complexity = 10No further changes are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
AGENTS.md (2)
15-18: Document runtime pinning (Vercel + CI) in addition to “Python 3.9+”This avoids CI/deploy drift and aligns with tooling. This repeats a prior reviewer’s request but remains applicable.
3. Verify compatibility with Python 3.9+ as specified in the project. + +Pin the runtime to avoid CI/CD and Vercel mismatches: + +- Add a `runtime.txt` at the repo root with: + ``` + python-3.9 + ``` +- Or add a `vercel.json`: + ```json + { + "functions": { + "api/**/*.py": { + "runtime": "python3.9" + } + } + } + ``` +- (Optional) Enforce packaging compatibility via `python_requires` (e.g., ">=3.9") in `setup.cfg`/`setup.py`.
60-63: Tighten env-var guidance, note .gitignore, and show VERCEL_ENV exampleImproves grammar, ensures secrets aren’t committed, and gives a concrete local-testing command. The .gitignore recommendation mirrors an earlier review request.
-* Development: `.env.local` (git-ignored) -* Production: Configured in Vercel dashboard -* Metrics are automatically prefixed using the `METRIC_PREFIX` constant from `config/defaults.py` which reads `os.getenv("VERCEL_ENV")` (e.g., "dev_" for non-production and "" for production) +* Development: Use `.env.local` (git-ignored). +* Production: Configure variables in the Vercel dashboard. +* Ensure `.env` and `.env.local` are listed in `.gitignore` (to prevent accidental commits). +* Metrics are automatically prefixed using the `METRIC_PREFIX` constant from `config/defaults.py`, which reads `os.getenv("VERCEL_ENV")` (e.g., "dev_" for non-production and "" for production). + +For local testing, explicitly set the environment: + +```bash +export VERCEL_ENV=development +```Outside this file, update the repo-level ignore list:
# .gitignore (repo root) +# Environment files +.env +.env.local
🧹 Nitpick comments (3)
AGENTS.md (3)
1-3: Reference the AGENTS.md standard explicitlyAdd a short line near the top so contributors know this doc follows the public standard mentioned in the PR description.
# AGENTS Guidelines for This Repository + +This document follows the AGENTS.md standard: https://agents.md/ This repository contains a Python-based Vercel Functions application for monitoring RPC node response times. When working on the project interactively with an agent (e.g. the Codex CLI) please follow the guidelines below to ensure smooth development and testing.
8-8: Minor wording fix: “outside of” → “outside”Tiny readability/style improvement.
-* **Do _not_ deploy to Vercel during the agent session** unless explicitly requested. Deployments should be handled outside of the interactive workflow to avoid disrupting production services. +* **Do _not_ deploy to Vercel during the agent session** unless explicitly requested. Deployments should be handled outside the interactive workflow to avoid disrupting production services.
41-43: Fix unordered list style to satisfy markdownlint (MD004) and remove trailing spacesUse asterisks consistently like elsewhere in the doc.
- - `python tests/test_api_read.py` for read metrics - - `python tests/test_api_write.py` for write metrics - - `python tests/test_update_state.py` for state updates + * `python tests/test_api_read.py` for read metrics + * `python tests/test_api_write.py` for write metrics + * `python tests/test_update_state.py` for state updates
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
AGENTS.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
AGENTS.md
[style] ~8-~8: This phrase is redundant. Consider using “outside”.
Context: ...equested. Deployments should be handled outside of the interactive workflow to avoid disru...
(OUTSIDE_OF)
[grammar] ~44-~44: There might be a mistake here.
Context: ...` is properly configured before testing. * Mock external API calls when writing uni...
(QB_NEW_EN)
[grammar] ~60-~60: There might be a mistake here.
Context: ... Development: .env.local (git-ignored) * Production: Configured in Vercel dashboa...
(QB_NEW_EN)
[grammar] ~61-~61: There might be a mistake here.
Context: ...oduction: Configured in Vercel dashboard * Metrics are automatically prefixed using...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
AGENTS.md
41-41: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
42-42: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
43-43: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
🔇 Additional comments (1)
AGENTS.md (1)
62-63: Nice: METRIC_PREFIX behavior is documented correctlyThis resolves the previous feedback about environment-based metric prefixes.
| * Ensure `endpoints.json` is properly configured before testing. | ||
| * Mock external API calls when writing unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Clarify where endpoints.json lives and/or provide a template
If contributors don’t know the expected path or schema, tests can fail unexpectedly. Please either document the canonical path (e.g., repo root vs tests/) and a minimal schema or include a sample file.
Run this to locate references and decide where to point the docs:
🏁 Script executed:
#!/bin/bash
# Find endpoints.json references and nearby context to confirm location/schema.
rg -n -C2 -i 'endpoints\.json' || true
# Also look for any example/template files in the repo.
fd -a 'endpoints*.json' -E '**/node_modules/**' -E '**/.venv/**'Length of output: 1633
Clarify endpoints.json location and template in AGENTS.md
Please update AGENTS.md (around line 44) to explicitly state where endpoints.json should live and how to initialize it. For example:
- Note that tests load the file from the repository root (
Path(project_root) / "endpoints.json"). - Remind contributors to copy the provided template:
cp endpoints.json.example endpoints.json
- Optionally, link to the full schema in README.md under “RPC Provider Configuration.”
Suggested replacement for line 44:
- * Ensure `endpoints.json` is properly configured before testing.
+ * Ensure `endpoints.json` (located at the project root) is configured—copy from `endpoints.json.example` and update your values (see README.md for full schema).This will prevent unexpected test failures due to a missing or mislocated configuration file.
🧰 Tools
🪛 LanguageTool
[grammar] ~44-~44: There might be a mistake here.
Context: ...` is properly configured before testing. * Mock external API calls when writing uni...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In AGENTS.md around lines 44-45, clarify where endpoints.json must live and how
to create it: state tests load Path(project_root)/"endpoints.json", instruct
contributors to initialize it from the template (e.g., copy
endpoints.json.example to endpoints.json), and add a note/link to the RPC
Provider Configuration schema in README.md; update the file with these three
explicit steps so tests won’t fail due to a missing or mislocated configuration
file.
Following the new standard https://agents.md/
Summary by CodeRabbit