From 49d0850d921e2311720ea9b9183ed13a72b4dbb8 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Mon, 24 Nov 2025 10:33:59 -0600 Subject: [PATCH 1/2] docs: add AI agent code review guidelines Add AGENTS.md with comprehensive review guidelines for AI agents conducting code reviews. Includes checks for security, performance, platform-specific best practices, and functional verification. --- AGENTS.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..cac6bef --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,87 @@ +# AI Agent Instructions + +This document provides guidelines and instructions for AI agents working with this codebase. + +## Review Guidelines + +When conducting code reviews, AI agents should systematically evaluate the following aspects: + +### Code Standards and Conventions +- Do the changes follow the established conventions and patterns used throughout the codebase? +- Is the code style consistent with existing code (indentation, naming conventions, file organization)? +- Are the appropriate design patterns being used where applicable? +- Does the code follow the project's established architecture and structure? + +### Security Assessment +- Do the changes introduce any security vulnerabilities or risks? +- Are user inputs properly validated and sanitized? +- Is sensitive data properly handled and protected? +- Are authentication and authorization checks properly implemented? +- Are there any exposed API keys, credentials, or sensitive configuration data? +- Are network requests using appropriate security protocols (HTTPS, proper headers)? + +### Performance Considerations +- Do the changes introduce potential performance bottlenecks? +- Are there any inefficient algorithms or data structures being used? +- Is there unnecessary re-rendering or state updates in React components? +- Are large lists properly virtualized where appropriate? +- Is lazy loading implemented for heavy resources? +- Are bundle sizes kept reasonable (no unnecessary dependencies)? +- Are database queries optimized and avoiding N+1 problems? +- Is proper caching implemented where beneficial? + +### Platform-Specific Best Practices + +#### React Native +- Are components properly optimized using React.memo, useMemo, and useCallback where appropriate? +- Is the bridge communication between native and JavaScript minimized? +- Are platform-specific code paths properly handled? +- Are native modules properly linked and configured? +- Is proper error boundary implementation in place? + +#### Kotlin (Android) +- Does the code follow Kotlin idioms and best practices? +- Are coroutines used properly for asynchronous operations? +- Is proper null safety maintained throughout? +- Are Android lifecycle methods properly handled? +- Is memory management appropriate (avoiding leaks)? + +#### Swift (iOS) +- Does the code follow Swift conventions and best practices? +- Is proper memory management used (weak/unowned references where appropriate)? +- Are optionals handled safely? +- Is the code taking advantage of Swift's type safety? +- Are iOS-specific considerations handled (app states, background tasks)? + +### Functional Verification +- Does the code actually implement what the PR description claims? +- Are all acceptance criteria from the related issue/ticket met? +- Are edge cases properly handled? +- Is error handling comprehensive and user-friendly? +- Are all promised features fully implemented and working? + +### Testing and Documentation +- Are appropriate tests included for new functionality? +- Do existing tests still pass? +- Is the code self-documenting with clear variable and function names? +- Are complex logic sections properly commented? +- Are API changes documented? +- Are breaking changes clearly identified? + +### Dependencies and Compatibility +- Are new dependencies necessary and well-maintained? +- Are version requirements appropriate? +- Is backward compatibility maintained where expected? +- Are deprecated APIs avoided? +- Are platform version requirements respected? + +### Accessibility +- Are accessibility features properly implemented (screen readers, keyboard navigation)? +- Are appropriate accessibility labels and hints provided? +- Do UI changes maintain or improve accessibility? + +### User Experience +- Do the changes provide a smooth and intuitive user experience? +- Are loading states and error messages user-friendly? +- Is feedback provided for user actions? +- Are animations and transitions smooth and purposeful? \ No newline at end of file From 47ed5110245d9db9b24e80901549580b0757b2a2 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sun, 30 Nov 2025 15:09:18 -0600 Subject: [PATCH 2/2] docs: update React Native review guidelines for new architecture Remove outdated bridge communication reference and error boundary guideline that is not applicable to SDK development. Add guidance for React Native architecture compatibility. --- AGENTS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index cac6bef..c9d5ee7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,10 +34,9 @@ When conducting code reviews, AI agents should systematically evaluate the follo #### React Native - Are components properly optimized using React.memo, useMemo, and useCallback where appropriate? -- Is the bridge communication between native and JavaScript minimized? +- Is the SDK using the appropriate React Native APIs for the target architecture version? - Are platform-specific code paths properly handled? - Are native modules properly linked and configured? -- Is proper error boundary implementation in place? #### Kotlin (Android) - Does the code follow Kotlin idioms and best practices?