Skip to content

Add AGENTS.md for AI coding assistants#1616

Open
facumenzella wants to merge 5 commits intomainfrom
add-agents-md
Open

Add AGENTS.md for AI coding assistants#1616
facumenzella wants to merge 5 commits intomainfrom
add-agents-md

Conversation

@facumenzella
Copy link
Member

@facumenzella facumenzella commented Feb 20, 2026

Summary

  • Add AGENTS.md with guidelines for AI coding agents working on this SDK
  • Add CLAUDE.md as a symlink to AGENTS.md for Claude Code compatibility
  • Add .claude/ to .gitignore

The file includes:

  • Project overview and architecture (including web support)
  • Development setup commands
  • Public API stability rules
  • Code structure and architecture layers
  • Constraints and support policy
  • Testing and development workflow
  • Pull request label conventions
  • Guardrails for safe development

Based on Callstack's agent-skills recommendations.

@facumenzella facumenzella requested a review from a team as a code owner February 20, 2026 13:58
@facumenzella facumenzella added the pr:other A code change that improves performance label Feb 20, 2026
@facumenzella facumenzella requested a review from vegaro February 20, 2026 13:58
Provides development guidelines for AI agents working with this repository, including:
- Project overview and React Native/TypeScript structure
- Common development commands (yarn)
- Browser fallback architecture for Expo Go
- Public API stability guidelines
- PR labeling conventions
- Code guardrails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Looks good overall. But I believe the web support should be mentioned as well?

facumenzella and others added 2 commits March 13, 2026 10:35
- Add explicit mention of web support in project overview
- Remove (~2,000+ lines) from purchases.ts description to avoid staleness

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@facumenzella facumenzella enabled auto-merge (squash) March 13, 2026 09:36
facumenzella and others added 2 commits March 13, 2026 11:02
@facumenzella facumenzella requested a review from ajpallares March 13, 2026 10:04
Copy link
Contributor

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

The PR description still mentions "Add CLAUDE.md as a symlink to AGENTS.md for Claude Code compatibility" but CLAUDE.md isn't in the diff anymore. We should probably update the description to match the current state of the branch.


### Main Entry Point: `src/purchases.ts`
- **Core Class**: `Purchases` with static methods
- **Dual Mode**: Native module OR browser mode (Expo Go)
Copy link
Contributor

Choose a reason for hiding this comment

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

Browser mode actually covers three environments — Expo Go, Rork Sandbox, and web (Platform.OS === 'web') — but this line only says "Expo Go". We should probably update to something like:

Suggested change
- **Dual Mode**: Native module OR browser mode (Expo Go)
- **Dual Mode**: Native module OR browser mode (web, Expo Go, Rork Sandbox)

Same applies to a few other spots:

  • Line 106: "For web/Expo Go environments" → include Rork
  • Line 195 (Guardrails): "ensure Expo Go fallback works" → "ensure web/Expo Go/Rork fallback works"

This is important because an agent that doesn't realize the SDK runs on web might introduce web-incompatible changes.

│ ├── errors.ts # Re-exports from typescript-internal
│ ├── browser/ # Browser/Expo Go fallback implementation
│ │ ├── nativeModule.ts # Browser implementation of native module
│ │ └── simulatedstore/ # Simulated purchase helpers
Copy link
Contributor

Choose a reason for hiding this comment

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

The tree under src/browser/ is missing typeGuards.ts and utils.ts. The latter contains methodNotSupportedOnWeb() which is pretty important for agents to know about when working on the browser path — it's how unsupported APIs fail at runtime. We should probably add them:

Suggested change
│ │ ── simulatedstore/ # Simulated purchase helpers
│ │ ── nativeModule.ts # Browser implementation of native module
│ │ ├── typeGuards.ts # Runtime type validation for browser responses
│ │ ├── utils.ts # Browser helpers (e.g. methodNotSupportedOnWeb)
│ │ └── simulatedstore/ # Simulated purchase helpers

- `index.test.js` — Main integration tests
- `alertHelper.test.ts` — Browser alert tests
- `offeringsLoader.test.ts` — Offerings tests
- `purchaseSimulatedPackageHelper.test.ts` — Simulated purchase tests
Copy link
Contributor

Choose a reason for hiding this comment

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

The test listing is missing nativeModuleNull.test.js and the ApiKeyValidation/ directory (contains ExpoGo.test.js and RorkSandbox.test.js). These cover browser-mode scenarios and would be useful for agents to know about — especially if they're modifying environment detection or the browser fallback. We should probably add them:

Suggested change
- `purchaseSimulatedPackageHelper.test.ts` — Simulated purchase tests
- `purchaseSimulatedPackageHelper.test.ts` — Simulated purchase tests
- `nativeModuleNull.test.js` — Null native module handling
- `ApiKeyValidation/ExpoGo.test.js` — Expo Go API key validation
- `ApiKeyValidation/RorkSandbox.test.js` — Rork Sandbox API key validation

3. Make changes in `src/` (TypeScript) or native code (`ios/`, `android/`)
4. Run tests: `yarn test`
5. Type check: `yarn typecheck`
6. Test in example app: `yarn example ios` or `yarn example android`
Copy link
Contributor

Choose a reason for hiding this comment

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

The development workflow covers iOS and Android testing but doesn't explain how to test browser/web mode changes. Even a brief mention of how to use yarn prepare-expo or how to run the Expo test app in web mode would help agents know how to verify their changes for that path.

| React Native | >= 0.73.0 |
| iOS | 13.0+ |
| Android | API 21+ |
| TypeScript | 5.2.2 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the SDK supports web through browser mode, we should probably add a Web row to the Constraints / Support Policy table so agents treat it as a first-class target:

Suggested change
| TypeScript | 5.2.2 |
| TypeScript | 5.2.2 |
| Web | Supported (via browser mode) |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other A code change that improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants