Skip to content

docs: add CLAUDE.md and AGENTS.md for AI coding agents - #908

Open
NandanPrabhu wants to merge 1 commit into
mainfrom
docs/add-claude-md
Open

docs: add CLAUDE.md and AGENTS.md for AI coding agents#908
NandanPrabhu wants to merge 1 commit into
mainfrom
docs/add-claude-md

Conversation

@NandanPrabhu

@NandanPrabhu NandanPrabhu commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds CLAUDE.md with project overview, structure, boundaries, security considerations, and lazy-loaded reference pointers for AI coding agents working in this repo.
  • Adds AGENTS.md importing CLAUDE.md per the agent-files convention, so non-Claude tools pick up the same guidance.
  • Adds references/ (commands, testing, code-style, git-workflow, pitfalls, docs-update) with the detailed content offloaded from the root file.

Test plan

  • Filesystem validation: every path referenced in CLAUDE.md/references/*.md resolves on disk.
  • Commands cross-checked against .github/workflows/main.yml, publish-af.yml, publish-afpi.yml, and DEVELOPMENT.md.
  • N/A — no code changes, docs only.

Note: this PR's title doesn't have an af:/afpi: prefix since it touches the whole repo, not a single package — may need the ignore title check label if the pr-title-checker workflow flags it.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds repository-wide AI agent instructions and reference documentation covering coding style, commands, documentation updates, Git workflow, common pitfalls, and testing conventions.

Changes

Agent guidance

Layer / File(s) Summary
Core agent instructions
AGENTS.md, CLAUDE.md
Adds the agent entrypoint and comprehensive guidance for repository structure, boundaries, security, workflows, coding, testing, and documentation.
Repository reference documentation
references/*.md
Adds focused references for Dart style, setup and verification commands, documentation mappings, Git workflow, common pitfalls, and testing conventions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: amitsingh05667, ankita10119

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main documentation change by adding AI agent guidance files, even though it omits the additional reference docs.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/add-claude-md

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.

❤️ Share

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

@NandanPrabhu
NandanPrabhu marked this pull request as ready for review July 27, 2026 11:07
@NandanPrabhu
NandanPrabhu requested a review from a team as a code owner July 27, 2026 11:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Around line 36-54: Update the project-structure Markdown code fence in
CLAUDE.md to specify the text language identifier, changing the opening fence to
```text while preserving the directory listing unchanged.
- Around line 162-167: Update the PR titles entry in the Git Workflow section to
document the exceptions defined in references/git-workflow.md: allow “ignore
title check” and “dependencies” for applicable non-package PRs while retaining
the af:/afpi: requirements for package changes. Keep the always-loaded guidance
consistent with the referenced workflow documentation.

In `@references/commands.md`:
- Around line 63-66: Update the Windows CMake command’s CMAKE_TOOLCHAIN_FILE
placeholder to be shell-safe, using a path such as /path/to/vcpkg or a quoted
placeholder, and clearly indicate that users must replace it with their actual
vcpkg location.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 842b8242-a180-42c1-aaab-19e16a46cee3

📥 Commits

Reviewing files that changed from the base of the PR and between 327f5f3 and d15e3a0.

📒 Files selected for processing (8)
  • AGENTS.md
  • CLAUDE.md
  • references/code-style.md
  • references/commands.md
  • references/docs-update.md
  • references/git-workflow.md
  • references/pitfalls.md
  • references/testing.md

Comment thread CLAUDE.md
Comment on lines +36 to +54
```
auth0-flutter/
├── auth0_flutter/ # Published package: public Dart API + native glue
│ ├── lib/
│ │ ├── auth0_flutter.dart # Mobile/desktop entry point (Auth0 class)
│ │ ├── auth0_flutter_web.dart # Web entry point (Auth0Web class)
│ │ └── src/
│ │ ├── mobile/ # Auth, MFA, My Account, Passwordless, CredentialsManager, WebAuthentication
│ │ ├── web/ # JS interop with auth0-spa-js
│ │ └── desktop/ # Windows web authentication
│ ├── android/, ios/, macos/, darwin/ # Native platform implementations (Kotlin, Swift)
│ ├── windows/ # Native C++ implementation (no native SDK dependency)
│ ├── example/ # Sample app used for manual verification and native/integration tests
│ └── test/ # Dart unit tests
├── auth0_flutter_platform_interface/ # Published package: platform contract
│ └── lib/src/ # MethodChannel platform implementations, options/models, exceptions
├── scripts/generate-symlinks.sh # Keeps ios/macos/darwin native sources in sync (see Boundaries)
└── .github/workflows/ # CI: analyze, test, native unit tests, publish, security scans
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language identifier to this Markdown fence.

The project-structure block triggers markdownlint MD040. Use ```text so documentation lint passes.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 36-36: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 36 - 54, Update the project-structure Markdown code
fence in CLAUDE.md to specify the text language identifier, changing the opening
fence to ```text while preserving the directory listing unchanged.

Source: Linters/SAST tools

Comment thread CLAUDE.md
Comment thread references/commands.md
Comment on lines +63 to +66
# Windows (native C++ client, no vendor SDK — built via CMake + vcpkg)
cd auth0_flutter/windows
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake \
-DAUTH0_FLUTTER_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the vcpkg placeholder shell-safe.

When pasted literally, <path-to-vcpkg> is interpreted by Bash as input redirection, so this command fails before CMake runs. Use a placeholder such as /path/to/vcpkg or quote it and explicitly instruct users to replace it.

Proposed fix
-cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake \
+cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake \
📝 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
# Windows (native C++ client, no vendor SDK — built via CMake + vcpkg)
cd auth0_flutter/windows
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake \
-DAUTH0_FLUTTER_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
# Windows (native C++ client, no vendor SDK — built via CMake + vcpkg)
cd auth0_flutter/windows
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DAUTH0_FLUTTER_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@references/commands.md` around lines 63 - 66, Update the Windows CMake
command’s CMAKE_TOOLCHAIN_FILE placeholder to be shell-safe, using a path such
as /path/to/vcpkg or a quoted placeholder, and clearly indicate that users must
replace it with their actual vcpkg location.

Documents build/test/lint commands, project structure, boundaries,
and security considerations for the federated Flutter plugin so AI
agents (and human contributors) have accurate, repo-specific context.
Comment thread CLAUDE.md
- **Framework:** `flutter_test` + `mockito` (Dart); JUnit/Robolectric (Android, via `./gradlew koverXmlReportDebug`); XCTest (iOS/macOS); a custom C++ test binary built via CMake (Windows)
- **Test Location:** `auth0_flutter/test/`, `auth0_flutter_platform_interface/test/`
- **Coverage Tool:** `flutter test --coverage` (lcov) for Dart; JaCoCo/Kover for Android; xcresultparser→Cobertura for iOS; OpenCppCoverage for Windows — all uploaded to Codecov
- **Coverage Threshold:** project target 2%, patch target 50% (`codecov.yml`)

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.

These aren't "targets" — in codecov.yml, 2 and 50 are threshold values (max allowed coverage drop), and project.target is auto. Your own references/testing.md:39 says it correctly ("50% patch threshold, 2% project-drop threshold"). Make this line match that: Coverage Threshold: patch threshold 50%, project-drop threshold 2% (\codecov.yml).

Comment thread CLAUDE.md

## Security Considerations

- **Token storage:** Credentials are persisted via the native `CredentialsManager` — SimpleKeychain 1.3.0 on iOS/macOS (`auth0_flutter/darwin/.../CredentialsManager/CredentialsManagerHandler.swift`), `EncryptedSharedPreferences` (Android Keystore-backed) on Android (`auth0_flutter/android/.../request_handlers/credentials_manager/`), and OS-level secure storage on Windows. Never log tokens, and never bypass `CredentialsManager` to persist credentials by hand.

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.

EncryptedSharedPreferences is the wrong class. Android delegates to Auth0.Android's SecureCredentialsManager (see the handlers/tests under credentials_manager/), which does its own Keystore-backed AES over SharedPreferencesStorage — not the Jetpack EncryptedSharedPreferences. Reword to "the native SecureCredentialsManager (Android Keystore-backed encrypted storage)."

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