Skip to content

docs: Add AGENTS.md files for OpenAI Codex compatibility - #86

Merged
gabrypavanello merged 9 commits into
mainfrom
claude/add-agents-md-files-M09yj
Jan 11, 2026
Merged

docs: Add AGENTS.md files for OpenAI Codex compatibility#86
gabrypavanello merged 9 commits into
mainfrom
claude/add-agents-md-files-M09yj

Conversation

@gabrypavanello

Copy link
Copy Markdown
Contributor

Add root AGENTS.md as symlink to CLAUDE.md and create package-specific
AGENTS.md files with concise development notes for each package.

Add root AGENTS.md as symlink to CLAUDE.md and create package-specific
AGENTS.md files with concise development notes for each package.
Each package now has a Learnings section for documenting failures
and their solutions. This prevents repeated mistakes across agent runs.
Consistent with package AGENTS.md files.
@coderabbitai

coderabbitai Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Added comprehensive developer docs across multiple packages — onboarding, commands, usage patterns, examples, common pitfalls, and a mandatory "learnings" section requiring documented failures and remediation. Documentation-only changes; no functional code or public APIs modified.
  • Tests

    • Relaxed floating-point assertions in unit tests to use a small tolerance for more stable comparisons.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds multiple AGENTS.md documentation files (root and per-package), updates CLAUDE.md Learnings to require documenting failures in a specific format, and relaxes a floating-point test assertion to use epsilon tolerance. Most edits are documentation; one test change.

Changes

Cohort / File(s) Summary
Root docs
AGENTS.md, CLAUDE.md
Added top-level AGENTS.md (includes a mandatory-read warning and references CLAUDE.md) and updated CLAUDE.md Learnings to mandate recording failures with a specified format.
Package AGENTS.md additions
packages/core/AGENTS.md, packages/create-app/AGENTS.md, packages/testing/AGENTS.md, packages/ui-react-builder/AGENTS.md, packages/ui-react/AGENTS.md, packages/ui/AGENTS.md
New package-level AGENTS.md files containing quick commands, key exports, usage patterns, dependencies, common mistakes, and a learnings section. No code or public API changes.
Test adjustment
packages/testing/tests/unit/eval/generators.test.ts
Modified float range assertions to use epsilon = 1e-10 and inclusive bounds checks with tolerance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding AGENTS.md files for OpenAI Codex compatibility, which aligns with the changeset of creating multiple AGENTS.md documentation files across the repository.
Description check ✅ Passed The description is directly related to the changeset, explaining that root AGENTS.md acts as a symlink to CLAUDE.md and that package-specific AGENTS.md files contain development notes, which matches the documented changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5262a2f and 8f85411.

📒 Files selected for processing (1)
  • AGENTS.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: claude-review
  • GitHub Check: test-and-lint
🔇 Additional comments (1)
AGENTS.md (1)

1-5: Inconsistency between AI summary and actual file content.

The AI summary describes detailed MCP core package documentation (Quick Commands, Key Exports, Patterns, Dependencies, Common Mistakes, and Learnings), but the actual file contains only a minimal redirect to CLAUDE.md. The commit message mentions "Remove vendor-specific mention," which may explain the discrepancy.

Clarify whether:

  • This minimal reference file is the intended final state
  • The provided file content is complete (not truncated for review)
  • The per-package AGENTS.md files referenced in the AI summary are separate and present elsewhere in the PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code Review

Summary

This PR adds AGENTS.md files across the monorepo to support OpenAI Codex/agent compatibility. The changes are well-structured and provide useful package-specific guidance. Overall quality is good with some minor suggestions.

✅ Strengths

  1. Consistent Structure - All AGENTS.md files follow a uniform template with Quick Commands, Key Exports, Patterns, Dependencies, Common Mistakes, and Learnings sections
  2. Practical Examples - Each file includes code snippets showing actual usage patterns
  3. Symlink Approach - Using a symlink for root AGENTS.md → CLAUDE.md avoids duplication
  4. Package-Specific Context - Each package gets relevant context without duplicating root-level information

📝 Suggestions

1. Symlink Compatibility Concern

The root AGENTS.md is a symlink to CLAUDE.md. This works on Unix systems but may cause issues:

  • Windows users without Developer Mode enabled cannot create symlinks
  • Some tools/IDEs may not follow symlinks properly
  • Git on Windows may check out symlinks as text files containing the target path

Recommendation: Consider using a regular file with a note pointing to CLAUDE.md, or add a CI check to ensure symlink integrity.

2. Missing Context on "OpenAI Codex Compatibility"

The PR title mentions "OpenAI Codex compatibility" but:

  • CLAUDE.md already serves as agent instructions
  • No explanation of why AGENTS.md is needed or how OpenAI Codex discovers it
  • No link to OpenAI Codex documentation about this convention

Recommendation: Add a comment in root AGENTS.md explaining the dual naming convention (CLAUDE.md for Claude Code, AGENTS.md for OpenAI Codex).

3. Minor Content Issues

packages/create-app/AGENTS.md:39

- Generated projects use npm (not pnpm) to avoid workspace conflicts

This is listed under "Common Mistakes" but seems like intended behavior, not a mistake. Should be in a "Design Decisions" or "Notes" section.

packages/ui/AGENTS.md:49
Missing closing comment marker on the last line:

--->
+-->

4. Consistency with CLAUDE.md

The CLAUDE.md update changes the Learnings section comment:

-<!-- Add specific lessons learned during development. Format: what happened → what to do instead -->
+<!-- MANDATORY: Document failures here to prevent repeated mistakes -->
+<!-- Format: what went wrong → what to do instead -->

This makes the tone stronger ("MANDATORY") and format clearer. Good improvement. All package AGENTS.md files already use this improved format.

🔒 Security

No security concerns - documentation only.

⚡ Performance

No performance impact - documentation only.

🧪 Test Coverage

Not applicable - this PR adds documentation files only. No tests needed.

✅ Meets Project Standards

  • ✅ Follows monorepo structure
  • ✅ No code changes requiring build/test/lint
  • ✅ Consistent formatting
  • ⚠️ Symlink may cause cross-platform issues

🎯 Recommendation

Approve with minor suggestions. The symlink concern should be evaluated based on your team's platform requirements. If you have Windows developers, consider using a regular file instead.


Reviewed according to /home/runner/work/mcp-apps-kit/mcp-apps-kit/CLAUDE.md guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In @AGENTS.md:
- Line 1: The file AGENTS.md currently contains "CLAUDE.md" but fails Prettier
due to missing trailing newline; edit AGENTS.md to add a newline (trailing empty
line) at the end of the file so the file ends with a proper newline character.

In @packages/core/AGENTS.md:
- Around line 1-50: Update the "Patterns" section to correct the architecture
note: replace the incorrect claim that there are "no barrel files in
subdirectories" with a statement that exports are centralized through
src/index.ts which re-exports from barrel files (index.ts) in subdirectories
such as adapters/, debug/, events/, middleware/, plugins/, server/, and
server/oauth/; mention to prefer using defineTool and defineUI for type
inference and that subdirectory barrel files are used only as local re-exports
routed through src/index.ts.

In @packages/create-app/AGENTS.md:
- Line 1: The file @mcp-apps-kit/create-app (AGENTS.md) is missing a trailing
newline causing Prettier to fail; open the AGENTS.md file and add a single
newline character at the end of the file (ensure the file ends with an empty
line/line break after the last content) then save to fix the formatting check.

In @packages/ui-react-builder/AGENTS.md:
- Line 1: The file AGENTS.md is missing a trailing newline causing Prettier to
fail; open packages/ui-react-builder/AGENTS.md and add a single newline
character at the end of the file (i.e., ensure there is an empty line after the
current last line, add a newline after line 54) then save and re-run
formatting/CI.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c48cc0e and 0304716.

📒 Files selected for processing (8)
  • AGENTS.md
  • CLAUDE.md
  • packages/core/AGENTS.md
  • packages/create-app/AGENTS.md
  • packages/testing/AGENTS.md
  • packages/ui-react-builder/AGENTS.md
  • packages/ui-react/AGENTS.md
  • packages/ui/AGENTS.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-11T02:21:51.116Z
Learnt from: CR
Repo: AndurilCode/mcp-apps-kit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-11T02:21:51.116Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `defineTool` and `defineUI` (or `defineReactUI` for React components) for type inference instead of manual definitions

Applied to files:

  • packages/ui-react/AGENTS.md
  • packages/ui-react-builder/AGENTS.md
📚 Learning: 2026-01-11T02:21:51.116Z
Learnt from: CR
Repo: AndurilCode/mcp-apps-kit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-11T02:21:51.116Z
Learning: Run `pnpm build && pnpm test && pnpm lint && pnpm typecheck` before finishing any task - all four must pass without exceptions

Applied to files:

  • CLAUDE.md
🪛 GitHub Actions: PR Check
packages/create-app/AGENTS.md

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.

packages/ui-react/AGENTS.md

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.

AGENTS.md

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.


[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.

🔇 Additional comments (7)
packages/create-app/AGENTS.md (1)

1-51: Excellent documentation structure and content.

The package documentation is well-organized with clear sections for quick commands, key exports, templates, dependencies, and common mistakes. The mandatory Learnings section with format guidance is a helpful addition to encourage documentation of failures and solutions across agent runs.

packages/ui-react-builder/AGENTS.md (2)

22-30: High-quality usage example.

The TypeScript code example clearly demonstrates the intended pattern for defineReactUI with buildAndTransform. This is helpful for developers onboarding to the package.


1-54: Well-structured documentation with clear organization.

Package documentation effectively covers quick commands, key exports, usage patterns, dependencies, and common pitfalls. The Learnings section is well-positioned to capture failures and solutions to prevent repeated mistakes in future agent runs, aligning with the PR's intent.

CLAUDE.md (1)

63-71: Well-structured Learnings section.

The updated mandatory format with clear examples ("what went wrong → what to do instead") provides helpful guidance for future learnings entries. This sets a good precedent for the package-specific AGENTS.md files.

packages/ui/AGENTS.md (1)

1-49: Excellent documentation structure.

The packages/ui/AGENTS.md file provides clear onboarding guidance with practical quick commands, concrete code examples, and a well-formatted Learnings section. The documentation is comprehensive without being verbose.

packages/ui-react/AGENTS.md (1)

1-56: Prettier formatting claim cannot be verified in sandbox environment.

The file exists and its content appears well-formatted with proper markdown structure, but Prettier is not available in the sandbox to verify the claimed formatting failure. The review comment asserts a pipeline failure as fact but provides no specific details about which formatting rules are violated. Manual verification using local Prettier would be needed to confirm whether this file actually requires formatting corrections.

packages/testing/AGENTS.md (1)

1-52: Well-structured documentation for the testing package.

This AGENTS.md file provides clear guidance for developers using the MCP testing library. The structure is comprehensive: quick commands for common tasks, key exports with descriptions, practical patterns with working code examples, dependency information, and documented common mistakes.

The Learnings section template with MANDATORY comment is appropriately formatted to guide future documentation of failures and solutions. The example in the template is helpful for showing the expected format.

One suggestion: when the Learnings section is populated, consider ensuring the format stays consistent (e.g., always "Problem → Solution" format) and that entries reference specific PR numbers or issue links where applicable for traceability. However, this can be addressed during future updates.

Comment thread AGENTS.md Outdated
@@ -0,0 +1 @@
CLAUDE.md No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix Prettier formatting error (likely missing trailing newline).

The Prettier check is failing on the formatting. Since this file should reference CLAUDE.md, ensure there's a proper newline at the end of the file.

🔧 Proposed fix
-CLAUDE.md
+CLAUDE.md

(Add newline at end of file)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CLAUDE.md
CLAUDE.md
🧰 Tools
🪛 GitHub Actions: PR Check

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.


[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in AGENTS.md.

🤖 Prompt for AI Agents
In @AGENTS.md at line 1, The file AGENTS.md currently contains "CLAUDE.md" but
fails Prettier due to missing trailing newline; edit AGENTS.md to add a newline
(trailing empty line) at the end of the file so the file ends with a proper
newline character.

Comment thread packages/core/AGENTS.md
Comment thread packages/create-app/AGENTS.md
@@ -0,0 +1,54 @@
# @mcp-apps-kit/ui-react-builder

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix Prettier formatting error (likely missing trailing newline).

The Prettier check is failing. Ensure proper line ending and newline at EOF.

🔧 Proposed fix

Add a newline at the end of the file after line 54:

 <!-- Example:
 - Build succeeded but component didn't render → Check if all imports are included in bundle
 - esbuild error about JSX → Ensure .tsx extension and jsx: 'automatic' in config
--->
+-->
🤖 Prompt for AI Agents
In @packages/ui-react-builder/AGENTS.md at line 1, The file AGENTS.md is missing
a trailing newline causing Prettier to fail; open
packages/ui-react-builder/AGENTS.md and add a single newline character at the
end of the file (i.e., ensure there is an empty line after the current last
line, add a newline after line 54) then save and re-run formatting/CI.

@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

PR Review: Add AGENTS.md files

Overview

This PR adds package-specific AGENTS.md documentation files and a symlink from root AGENTS.md to CLAUDE.md.

Strengths

  • Consistent structure across all files
  • Practical package-specific content
  • No breaking changes (documentation only)
  • Good template for future learnings

Critical Issues

1. Misleading PR Title
OpenAI Codex was deprecated in March 2023. The PR title references it, which is outdated. Suggest updating to mention Claude Code or generic AI coding assistants.

2. Missing Context
The PR description does not explain WHY this change is needed. What problem does AGENTS.md solve that CLAUDE.md does not?

Minor Issues

3. Windows Compatibility
Symlinks require special permissions on Windows, which may cause issues for some contributors.

4. Empty Learnings Sections
All Learnings sections are empty templates. Consider adding real examples or removing until needed.

5. Formatting Check
Verify packages/ui/AGENTS.md:49 for proper comment closing.

6. Common Mistakes Quality
Some entries are facts rather than mistakes (e.g., create-app: Fetches latest package versions from npm). Ensure consistency.

Impact Assessment

  • Risk: Low (docs only)
  • Breaking Changes: None
  • Performance: None
  • Coverage: N/A

Recommendation

Approve with minor changes requested. Main concern is the outdated Codex reference in the title.


Review based on CLAUDE.md conventions.

Update Patterns section to accurately describe how exports are centralized
through src/index.ts with re-exports from subdirectory barrel files.
Symlinks can be problematic on Windows (require admin/developer mode).
Use a regular file instead that mirrors CLAUDE.md content.
@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code Review: AGENTS.md Documentation

Summary

This PR adds package-specific AGENTS.md documentation files for OpenAI Codex compatibility, along with a symlink at the root level pointing to CLAUDE.md. The documentation is well-structured and provides clear, concise development guidance for each package.


✅ Strengths

  1. Excellent Documentation Structure: Each AGENTS.md file follows a consistent, scannable format with:

    • Clear package purpose
    • Quick command reference
    • Key exports
    • Common patterns with code examples
    • Dependencies list
    • Common mistakes section
    • Learnings section for future documentation
  2. Practical Code Examples: All packages include realistic, working code snippets that demonstrate actual usage patterns (e.g., packages/ui-react/AGENTS.md:23-32, packages/testing/AGENTS.md:23-28)

  3. Monorepo-Aware Commands: Proper use of pnpm -C packages/<name> for package-specific operations, aligning with the monorepo structure

  4. Consistency with CLAUDE.md: The root symlink ensures agents reading AGENTS.md get the same guidance as those reading CLAUDE.md, avoiding documentation drift

  5. Package-Specific Context: Each file includes unique, relevant details (e.g., packages/core/AGENTS.md:26 explains the export structure through barrel files, packages/create-app/AGENTS.md:40 notes that generated projects use npm not pnpm)


🔍 Observations & Minor Considerations

1. Symlink Compatibility (Low Priority)

The root AGENTS.md -> CLAUDE.md symlink works perfectly on Unix-like systems but may cause issues on Windows or in certain deployment scenarios (zip archives, some git clients).

Consideration: If Windows compatibility is important for contributors, you might want to document this or test it. However, given this is a developer-focused monorepo, the symlink approach is likely fine.

2. Documentation Consistency

The CLAUDE.md update (CLAUDE.md:65-66) changes the comment from:

<!-- Add specific lessons learned during development. Format: what happened → what to do instead -->

to:

<!-- MANDATORY: Document failures here to prevent repeated mistakes -->
<!-- Format: what went wrong → what to do instead -->

This is an improvement (more direct, action-oriented language) and is consistently applied across all package AGENTS.md files.

3. Missing Package Reference

According to CLAUDE.md:44-52, there are 6 packages + examples. This PR includes AGENTS.md for all 6 packages:

  • ✅ core
  • ✅ ui
  • ✅ ui-react
  • ✅ ui-react-builder
  • ✅ testing
  • ✅ create-app

Good coverage!


🎯 Quality Checks

  • Code Quality: N/A (documentation only)
  • Best Practices: ✅ Follows consistent formatting and structure
  • Potential Bugs: ❌ None identified
  • Performance: N/A (documentation only)
  • Security: ❌ No concerns
  • Test Coverage: N/A (documentation changes don't require tests)

📝 Recommendations

  1. Consider a docs validation script (Optional Enhancement):
    Since each AGENTS.md file includes package-specific commands, you could add a script to validate that referenced files/exports actually exist. This would catch documentation drift as the codebase evolves.

  2. Git attributes for symlink (Optional):
    If you encounter issues with the symlink on different platforms, consider adding to .gitattributes:

    AGENTS.md symlink
    
  3. Examples directory (Future Consideration):
    The examples/ directory doesn't have AGENTS.md files. If examples are meant for learning, they might benefit from similar quick-reference docs.


✅ Final Verdict

Approved with enthusiasm!

This PR is well-executed, provides immediate value for AI agents working with the codebase, and maintains consistency with the existing CLAUDE.md conventions. The documentation is clear, practical, and well-organized.

The changes are:

  • Low risk (documentation only)
  • High value (better agent comprehension)
  • Well-structured
  • Consistent across all packages

No blocking issues identified. Great work @gabrypavanello! 🎉


Note: I did not run the build/test suite since this is a documentation-only change with no code modifications. The symlink and markdown files are correctly formatted.

@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

PR Review: Documentation for OpenAI Codex Compatibility

Summary

This PR adds AGENTS.md files across the repository to provide AI agent-friendly documentation. The changes are documentation-only with no code modifications.

✅ Positive Aspects

1. Clear Documentation Structure

  • Each package gets a concise, focused AGENTS.md file
  • Consistent format across all packages (Quick Commands → Key Exports → Patterns → Dependencies → Common Mistakes → Learnings)
  • Good balance between brevity and completeness

2. Practical Developer Guidance

  • Includes per-package test/lint/typecheck commands for faster iteration
  • Highlights common mistakes (e.g., forgetting await next() in middleware, missing AppsProvider wrapper)
  • Emphasizes the "Learnings" section for documenting failures
  • References actual examples from the codebase

3. Accurate Technical Content

  • Correctly describes the export pattern (exports through index.ts barrel files)
  • Accurately notes dependency versions (Zod 4, Express 5)
  • Properly documents the dual-protocol nature of the framework

4. Root-Level Duplication Strategy

  • Root AGENTS.md mirrors CLAUDE.md content for OpenAI Codex discovery
  • Comment at top clarifies the relationship between the two files

⚠️ Issues & Recommendations

1. Incomplete Comment in Root CLAUDE.md (packages/core/AGENTS.md:26)

# Current:
Exports are centralized through `src/index.ts`, which re-exports from barrel files (`index.ts`) in subdirectories: `adapters/`, `debug/`, `events/`, `middleware/`, `plugins/`, `server/`, and `server/oauth/`. Subdirectory barrel files are local re-exports only - all public API goes through the root `src/index.ts`.

# Issue:
This is very detailed for AGENTS.md (meant to be concise). Consider simplifying to match the pattern section.

Recommendation: Keep it simple:

Exports only through `src/index.ts` - keeps the public API clean and refactoring safe.

2. Accuracy: Testing Package Description (packages/testing/AGENTS.md:3)

# Current:
Comprehensive testing library for MCP applications. Supports unit, integration, behavior, property, and LLM evaluation testing.

# Issue:
While accurate, "behavior" and "property" testing aren't prominently featured in the package. This might mislead users.

Recommendation: Simplify to what's actually well-documented:

Testing utilities for MCP applications. Includes test environment setup, fluent assertions, and optional LLM evaluation.

3. Inconsistent Package Descriptions

Some packages describe themselves as "framework" (core), others as "SDK" (ui), "bindings" (ui-react), "builder" (ui-react-builder), and "tool" (create-app). While technically accurate, consider standardizing the format.

Recommendation:

packages/core            → "Server-side framework..."  ✅ Keep
packages/ui              → "Client-side SDK..."        ✅ Keep  
packages/ui-react        → "React hooks and context..." (more descriptive than "bindings")
packages/ui-react-builder → "Build tool..."             ✅ Keep
packages/testing         → "Testing utilities..."       (matches nature better)
packages/create-app      → "CLI scaffolder..."          ✅ Keep

4. Missing Context on "OpenAI Codex Compatibility" (PR Title)

The PR title references "OpenAI Codex compatibility" but OpenAI Codex was deprecated in March 2023. The intended audience is likely ChatGPT's Code Interpreter or Claude Code using AGENTS.md as a discovery file.

Recommendation: Update the PR description to clarify this is for AI coding assistants that look for AGENTS.md files, not the deprecated Codex API.

5. Duplication Concerns

Having both CLAUDE.md and AGENTS.md at the root creates maintenance burden. Every update needs to be applied twice.

Options:

  1. Keep as-is (current approach) - Simple but requires discipline
  2. Symlink - AGENTS.md as symlink to CLAUDE.md (mentioned in PR description but not implemented)
  3. Script to sync - CI check that both files match

Recommendation: Implement Option 2 (symlink) as mentioned in the PR description:

ln -s CLAUDE.md AGENTS.md

6. Minor: Example Formatting (packages/core/AGENTS.md:22-26)

The middleware example is cut off. The pattern section should show complete, runnable examples.

Current:

Middleware is Koa-style: always `await next()` or the chain breaks.

Recommendation: Add a minimal example:

Middleware is Koa-style: always `await next()` or the chain breaks.

\`\`\`typescript
const logger: Middleware = async (context, next) => {
  console.log('Before');
  await next(); // Don't forget this!
  console.log('After');
};
\`\`\`

🔍 Security Concerns

None. This is documentation-only with no code changes.

🧪 Test Coverage

N/A - No code changes mean no new tests needed. However, recommend verifying the build still passes:

pnpm build && pnpm typecheck && pnpm lint

📝 Suggested Changes

High Priority

  1. Consider making AGENTS.md a symlink to avoid duplication maintenance burden
  2. Simplify the export explanation in packages/core/AGENTS.md:26

Medium Priority

  1. Clarify "behavior" and "property" testing claims in packages/testing/AGENTS.md
  2. Update PR description to mention AI coding assistants (not "OpenAI Codex")

Low Priority

  1. Standardize package type descriptions for consistency
  2. Add middleware example to core/AGENTS.md

✅ Approval Status

This PR is approved with suggestions. The documentation accurately describes the codebase and provides valuable guidance for AI coding assistants. The suggested changes are refinements, not blockers.

Recommend:

  • Merge as-is if time-sensitive
  • OR address high-priority suggestions first (especially the symlink approach)

Review Methodology: Compared AGENTS.md files against corresponding README.md files and source code (src/index.ts exports), verified technical accuracy, checked for consistency across packages.

The float generator test was flaky due to floating point precision
issues in fast-check. Added small epsilon tolerance for comparison.
@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

PR Review: docs: Add AGENTS.md files for OpenAI Codex compatibility

Summary

This PR adds AGENTS.md files across the codebase for OpenAI Codex compatibility, duplicating CLAUDE.md at the root and creating package-specific documentation. It also includes a test fix for floating-point precision issues.


✅ Positive Aspects

  1. Clear Intent: Adding AGENTS.md for cross-platform agent compatibility is a good idea
  2. Comprehensive Coverage: All packages receive documentation
  3. Consistent Structure: Package-specific docs follow a uniform template
  4. Bug Fix: The float generator test fix (packages/testing/tests/unit/eval/generators.test.ts:265-267) properly addresses floating-point precision issues with an epsilon tolerance

🔍 Code Quality & Best Practices

Documentation Duplication Concern

Issue: The root AGENTS.md is a complete duplicate of CLAUDE.md (74 lines), differing only by a 3-line header comment. This violates the DRY principle and creates a maintenance burden.

Recommendation: Instead of duplicating content, consider one of these approaches:

  1. Symlink approach (with Windows support):

    • Use a script to create/check symlinks during CI
    • Fall back to file copies only in environments where symlinks fail
  2. Single-source approach:
    Make AGENTS.md much shorter:

    <!-- This file exists for OpenAI Codex compatibility -->
    <!-- The canonical instructions are in CLAUDE.md -->
    
    See [CLAUDE.md](./CLAUDE.md) for complete project instructions.
  3. Build-time generation:
    Generate AGENTS.md from CLAUDE.md during package builds

The commit message at 9afb1ec mentions symlinks are "problematic on Windows", but modern Windows 10+ supports symlinks with developer mode. A build script could handle this cross-platform.


🐛 Potential Issues

1. Inconsistent Export Documentation

Location: packages/core/AGENTS.md:25-26

Issue: The barrel file architecture description may be confusing:

"Exports are centralized through src/index.ts, which re-exports from barrel files (index.ts) in subdirectories... Subdirectory barrel files are local re-exports only - all public API goes through the root src/index.ts."

This is technically accurate but verbose. The original CLAUDE.md says it more simply: "Exports only through index.ts"

Recommendation: Simplify to match the clarity of CLAUDE.md, or add a concrete example showing the pattern.


2. Test Fix Analysis

Location: packages/testing/tests/unit/eval/generators.test.ts:265-267

Current Code:

const epsilon = 1e-10;
expect(samples.every((n) => n >= 0 - epsilon && n <= 1 + epsilon)).toBe(true);

Analysis:

  • ✅ The epsilon approach is correct for floating-point comparisons
  • ⚠️ However, 1e-10 may be too tight depending on fast-check's float generation
  • ⚠️ The expression 0 - epsilon is less readable than -epsilon (though functionally identical)

Recommendation: Consider using a slightly larger epsilon (e.g., 1e-6) to be more robust against different float generation strategies. Also, simplify the expression:

const epsilon = 1e-6;
expect(samples.every((n) => n >= -epsilon && n <= 1 + epsilon)).toBe(true);

🔒 Security Concerns

No security issues identified. This PR only adds documentation and fixes a test.


⚡ Performance Considerations

No performance impact - documentation changes only.


🧪 Test Coverage

Missing Coverage:

  • No tests verify that AGENTS.md and CLAUDE.md stay in sync
  • Consider adding a test that fails if they diverge (unless the duplication is eliminated)

Example Test:

// In a root-level test file
it('should keep AGENTS.md and CLAUDE.md in sync', async () => {
  const claudeMd = await fs.readFile('CLAUDE.md', 'utf-8');
  const agentsMd = await fs.readFile('AGENTS.md', 'utf-8');
  
  const claudeContent = claudeMd.trim();
  const agentsContent = agentsMd
    .replace(/^<!-- .* -->\n/gm, '') // Remove comment lines
    .trim();
  
  expect(agentsContent).toBe(claudeContent);
});

📋 Recommendations Summary

High Priority:

  1. Eliminate or reduce duplication between CLAUDE.md and AGENTS.md
  2. Add sync test if duplication remains

Medium Priority:

  1. Improve test epsilon to 1e-6 for robustness
  2. Simplify core AGENTS.md export documentation

Low Priority:

  1. Document the Windows symlink decision in commit history or docs

✅ Approval Status

The PR is functional and doesn't introduce bugs, but the documentation duplication is a maintenance concern. I recommend addressing the duplication issue before merging to prevent divergence over time.

Suggested Action: Refactor AGENTS.md to reference CLAUDE.md rather than duplicating it, or add automated sync verification.

Remove duplication - AGENTS.md now just points to CLAUDE.md as the
canonical source for project instructions.
@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code Review

Summary

This PR adds AGENTS.md files for OpenAI Codex compatibility across all packages. The overall structure is good and follows a consistent pattern. Here's my detailed feedback:


✅ Strengths

  1. Consistent Structure: All AGENTS.md files follow a uniform template with Quick Commands, Key Exports, Patterns, Dependencies, Common Mistakes, and Learnings sections.

  2. Practical Content: Each file includes actionable quick commands (pnpm -C packages/<name> test/typecheck/lint) and package-specific patterns.

  3. Good Documentation Intent: The files complement existing READMEs by providing concise, developer-focused notes rather than duplicating full API docs.

  4. Root-level Symlink Strategy: The root AGENTS.md appropriately redirects to CLAUDE.md for OpenAI Codex compatibility.


🔍 Issues & Concerns

1. Test Change Needs Review (packages/testing/tests/unit/eval/generators.test.ts:265-267)

The floating-point comparison change looks correct in principle but could be improved:

// Current (line 267):
expect(samples.every((n) => n >= 0 - epsilon && n <= 1 + epsilon)).toBe(true);

// Issue: This allows values slightly outside [0, 1] due to epsilon tolerance
// Consider if this is the intended behavior or if the test should validate
// that the generator produces values strictly within [0, 1]

Recommendation:

  • If the generator is expected to produce values strictly in [0, 1], the test should fail for out-of-bounds values, not add epsilon tolerance
  • If floating-point precision issues are causing legitimate values to fail, document why epsilon is needed
  • Consider: expect(samples.every((n) => n >= 0 && n <= 1)).toBe(true); should work if the generator is correct

2. Export Pattern Inconsistency (packages/core/AGENTS.md:26)

The exports section states:

"Exports are centralized through src/index.ts, which re-exports from barrel files (index.ts) in subdirectories"

But CLAUDE.md line 34 says:

"Exports only through index.ts"

Recommendation: Clarify whether barrel files in subdirectories are part of the public API or just internal organization. The current phrasing could confuse developers about what they can import.

3. Zod 4 Migration References (packages/core/AGENTS.md:37)

Multiple AGENTS.md files mention "check migration guide" for Zod 4, but no migration guide is linked in the codebase.

Recommendation: Either:

  • Add a link to Zod's official migration guide in CLAUDE.md
  • Create a brief MIGRATIONS.md with Zod 3→4 breaking changes relevant to this codebase
  • Document specific Zod 4 patterns to use (if different from Zod 3)

4. Template Inconsistencies

Minor inconsistencies across files:

  • packages/create-app/AGENTS.md:40: Says "Fetches latest package versions from npm at runtime" but this is presented as a "Common Mistake" when it's actually expected behavior
  • packages/testing/AGENTS.md:19: Lists framework adapters but doesn't explain when to use which one

📋 Code Quality Assessment

Category Rating Notes
Documentation Quality ⭐⭐⭐⭐☆ Clear, concise, practical
Consistency ⭐⭐⭐⭐☆ Uniform structure, minor content gaps
Completeness ⭐⭐⭐☆☆ Missing external links, test change rationale
Maintainability ⭐⭐⭐⭐☆ Easy to update, follows template

🔒 Security & Performance

  • ✅ No security concerns
  • ✅ No performance impact (documentation only)
  • ✅ No runtime code changes except test fix

🧪 Test Coverage

The PR includes one test modification but no new tests. Since this is primarily a documentation change, that's acceptable. However:

Action Required: Verify the floating-point test change doesn't mask a real bug in the generator.


📝 Recommendations

Must Fix

  1. Clarify the test change rationale - Is epsilon tolerance correct, or does it hide a generator bug?
  2. Fix Common Mistakes classification - Move runtime npm version fetching to "How it Works" section

Should Fix

  1. Add Zod 4 migration guidance - Link or document breaking changes
  2. Clarify export patterns - Make subdirectory barrel file usage explicit

Nice to Have

  1. Add cross-references - Link between AGENTS.md files where packages depend on each other
  2. Expand framework adapter guidance - When to use vitest vs jest adapters
  3. Document template versioning - How to keep all AGENTS.md files in sync when template changes

✅ Approval Status

Conditional Approval - Approve after addressing the test change rationale and Common Mistakes classification fix.

The documentation structure is excellent and will be valuable for both human developers and AI coding assistants. Great work on maintaining consistency across all packages!


Testing Checklist

  • Verify pnpm build && pnpm test && pnpm lint && pnpm typecheck passes (per CLAUDE.md line 8)
  • Confirm floating-point test still validates generator correctness
  • Check that no existing CI checks are broken

Reviewed with Claude Code following CLAUDE.md conventions

@claude

claude Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code Review

Summary

This PR adds AGENTS.md documentation files across the monorepo to improve AI agent compatibility (OpenAI Codex). The changes include:

  • Root-level AGENTS.md redirect to CLAUDE.md
  • Package-specific AGENTS.md files with concise development notes
  • Minor clarification update to CLAUDE.md
  • Bug fix for floating-point comparison in tests

Strengths

  1. Excellent Documentation Structure

    • Each package gets focused, actionable documentation
    • Consistent format across all packages (Quick Commands, Key Exports, Patterns, Dependencies, Common Mistakes, Learnings)
    • Clear separation between user-facing docs (README) and developer/agent docs (AGENTS.md)
  2. High-Quality Content

    • Accurate package descriptions and key exports
    • Practical code examples showing real usage patterns
    • Package-specific common mistakes that are genuinely helpful
    • Good balance of detail without duplication
  3. Proper Test Fix

    • packages/testing/tests/unit/eval/generators.test.ts:265-267 - The epsilon-based floating-point comparison is the correct approach for handling floating-point precision issues
    • Uses appropriate epsilon value (1e-10)
  4. Follows Repository Conventions

    • Adheres to CLAUDE.md style (concise, actionable)
    • Maintains the Learnings section pattern established in CLAUDE.md
    • Uses pnpm workspace commands correctly

Observations and Minor Suggestions

1. Root AGENTS.md Approach

The root AGENTS.md redirects to CLAUDE.md. This is simple and prevents duplication, though it might be slightly confusing that AGENTS.md and CLAUDE.md are not identical. Consider:

  • Current approach (redirect): Avoids duplication, single source of truth
  • Alternative: Make AGENTS.md a symlink to CLAUDE.md (true symlink, not content redirect)
  • Either approach works fine - the redirect is clear enough

2. Package Documentation Consistency

All package AGENTS.md files follow the same excellent structure. Minor observation:

  • packages/ui-react/AGENTS.md:23-26 - JSX formatting has a stray semicolon after the closing tag. This is not wrong per se, but typically JSX expressions do not have trailing semicolons when they are the only statement. Not critical.

3. Test Coverage for AGENTS.md Files

Since these are documentation files, no automated tests are needed. However, consider:

  • Adding a note in root AGENTS.md about keeping package-specific docs in sync when APIs change
  • Currently relies on manual maintenance

Potential Issues

None found. The changes are low-risk documentation additions with one legitimate bug fix.

Security Considerations

No security concerns. These are documentation files only.

Test Coverage

The test fix (generators.test.ts) improves test reliability by properly handling floating-point precision. The epsilon approach is textbook correct. No additional test coverage needed for documentation.

Performance Considerations

No performance impact. Documentation files are not loaded at runtime.

Recommendation

APPROVE - This is a high-quality documentation PR that adds value for AI agents and developers. The changes are:

  • Well-structured and consistent
  • Accurate and helpful
  • Low-risk
  • Include a legitimate bug fix

The only minor item is the semicolon in the JSX example, which is stylistic and not worth blocking on.


Before merging: Verify that all CI checks pass (pnpm build, test, lint, typecheck as per CLAUDE.md requirements). CI appears to still be running.

Great work!

@gabrypavanello
gabrypavanello merged commit 2dda0b1 into main Jan 11, 2026
4 checks passed
@gabrypavanello
gabrypavanello deleted the claude/add-agents-md-files-M09yj branch January 11, 2026 17:07
@coderabbitai coderabbitai Bot mentioned this pull request Jan 15, 2026
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