sentry-dart
AGENTS.md878 starsChanged 32 days agoMITView on GitHub
Melos monorepo. Each package lives in packages/<name>/ with its own pubspec.yaml. Check pubspec.yaml environment: section: Run from within the package directory (e.g., cd packages/dart/): Format version footgun: CI's analyze gate (.github/workflows/analyze.yml) runs dart format --set-exit-if-changed ./ using the dart set up for that job's sdk input — setup-dart for dart packages, flutter-action's Flutter-bundled dart (stable channel) for flutter packages — not the package's environment: constraint. dart_style differs between Dart minor versions, so formatting with a local dart of a different…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- packages/dart/AGENTS.mdAGENTS.md
- packages/flutter/AGENTS.mdAGENTS.md
- code-guidelinesSkill
- design-firstSkill
- diagnosing-bugsSkill
- reviewSkill
- specSkill
- test-guidelinesSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Use fvm dart / fvm flutter if available (check with which fvm), else dart / flutter
- Very specific: line 31
Check pubspec.yaml environment: section:
- Very specific: line 38
Run from within the package directory (e.g., cd packages/dart/):
- Distinctive: line 52
Ask clarifying questions and/or propose a plan before implementation
- Distinctive: line 53
Write failing tests before implementation.
- Distinctive: line 54
NEVER: commit or push code unless explicitly asked
- Distinctive: line 85
Use the right AGENTS.md for the area you're working in:
- Distinctive: line 108
When you hit a wall that an instruction would have prevented, a documented command/path is wrong, or a convention has changed — propose an …
- Distinctive: line 118
Do NOT add task-specific fixes, things discoverable from code, or duplicates of what linters enforce.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sentry Dart/Flutter SDK
Melos monorepo. Each package lives in packages/<name>/ with its own pubspec.yaml.
Packages
| Directory | Description |
packages/dart/ | Core Sentry Dart SDK |
packages/flutter/ | Sentry Flutter SDK (includes native integrations) |
packages/dio/ | Dio HTTP client integration |
packages/drift/ | Drift database integration |
packages/file/ | File I/O integration |
packages/hive/ | Hive database integration |
packages/isar/ | Isar database integration |
packages/sqflite/ | SQLite integration |
packages/logging/ | Dart logging integration |
packages/supabase/ | Supabase integration |
packages/firebase_remote_config/ | Firebase Remote Config integration |
packages/link/ | GraphQL integration |
Environment
- Minimum supported: Flutter
3.44.0| Dart3.12.0(enforced bymin_version_test.ymland the3.12leg ofdart.yml) - The
analyzegate runs on the latest stable Dart (currently3.13), sincesetup-dartand.fvmrcare both unpinned — see the format footgun below package-analysisinstallspanaunpinned as well, so a new pana release can move scores below the 140 threshold on its own (0.23.18 stopped following the per-packageCHANGELOG.mdsymlink, costing every package 5 points)- Use
fvm dart/fvm flutterif available (check withwhich fvm), elsedart/flutter
Package Types
Check pubspec.yaml environment: section:
- Dart-only (no
flutter:key):sentry,sentry_dio,sentry_file,sentry_logging - Flutter (has
flutter:key):sentry_flutter,sentry_sqflite,sentry_drift, etc.
File-Scoped Commands
Run from within the package directory (e.g., cd packages/dart/):
| Task | Dart-only | Flutter |
| Test | dart test path/to/test.dart | flutter test path/to/test.dart |
| Analyze | dart analyze path/to/file.dart | flutter analyze path/to/file.dart |
| Format | dart format path/to/file.dart | dart format path/to/file.dart |
| Fix | dart fix --apply | dart fix --apply |
| Web test | — | flutter test -d chrome path/to/test.dart |
Format version footgun: CI's
analyzegate (.github/workflows/analyze.yml) runsdart format --set-exit-if-changed ./using the dart set up for that job'ssdkinput —setup-dartfor dart packages,flutter-action's Flutter-bundled dart (stable channel) for flutter packages — not the package'senvironment:constraint.dart_stylediffers between Dart minor versions, so formatting with a local dart of a different version can leave the gate red. Neither source is pinned, so a new stable Dart release can turn the gate red without any code change — the two styles are mutually exclusive, so whichever version CI resolves is the one the repo must be formatted with. This has bittenpackages/flutter(Flutter-bundled Dart 3.12 joined a line that system Dart 3.10 didn't) andpackages/dart(Dart 3.13 collapses trailing named args after a function literal, e.g.test('...', () {...}, onPlatform: {...}), which 3.12 splits). Before pushing format changes, format with the dart CI uses for that package — the Flutter SDK's bundledbin/cache/dart-sdk/bin/dartfor flutter packages, latest stable dart for dart packages (an fvm Flutter whose bundled dart matches works:ls ~/fvm/versions) — and verify with--output=none --set-exit-if-changed. A newer analyzer can also addfatal-warningsfailures (e.g.unused_catch_stackoncatch (e, _)), so rundart analyzewith that same SDK. Note that.githooks/pre-commitformats staged.dartfiles with the fvm SDK (.fvm/flutter_sdk, falling back to the main worktree's copy, then baredartonPATH) and fails the commit if anything changed, without re-staging — if the fvm Flutter's bundled dart differs from the one CI uses for that package, it will reformat to the wrong style, so review the diff rather than blindlygit add-ing it.
Conventions
- Ask clarifying questions and/or propose a plan before implementation
- Write failing tests before implementation; fix regressions with a reproducing test first
- NEVER commit or push code unless explicitly asked
- NEVER edit
CHANGELOG.md— entries are auto-generated by craft from the PR title. For a custom entry, add a## Changelog Entrysection to the PR description (not the file); apply theskip-changeloglabel to exclude. See CONTRIBUTING.md - See
CONTRIBUTING.mdfor setup and contribution workflow
Command Execution
- Verify working directory — use
pwdto confirm you're in the correct path before running commands. The shell persists working directory across tool calls - Avoid redundant
cd— do not prefix every command withcd <path> &&. Change directory once if needed, then verify withpwd - Wildcard permissions — many commands are pre-approved with wildcards (e.g.,
git add:*). Flags like-Cchange the command prefix (git -C path add≠git add), triggering a confirmation prompt. Avoid-Cwhen you can change directory instead - Prefer small, focused commands over one massive pipeline. Break complex operations into multiple steps
- JSON processing — always use
jq; do not shell out tonodeorpythonfor JSON parsing - GitHub — prefer
ghCLI over web scraping when interacting with GitHub.com
Commits
- Conventional Commits 1.0.0 — subject max 50 chars, body max 72 chars/line
- AI attribution — AI-generated commits must include a
Co-Authored-Byfooter (e.g.,Co-Authored-By: Claude <noreply@anthropic.com>) - File renames — always use
git mv, nevermv+git add - Commit types — see
.github/release.ymlfor the list of types and how they map to changelog categories
Pull Requests
- Title — same format as commit subject where the beginning of subject must be capitalized for human-authored PRs (Conventional Commits):
type(scope): Capitalized description(automated bot PRs may start lowercase) - Branch naming —
<type>/<short-description>(e.g.,feat/session-replay-privacy,fix/memory-leak-scope) - PR template —
.github/pull_request_template.mdincludes: description, motivation, how tested, checklist - Reviewers — assigned via
CODEOWNERS(.github/CODEOWNERS); one maintainer approval is sufficient - Changelog — never edit
CHANGELOG.md; entries are auto-generated by craft from the PR title. Put a custom entry in the PR description's## Changelog Entrysection, or applyskip-changelogto exclude. See CONTRIBUTING.md - Draft PRs — use for work-in-progress; convert to ready when seeking review
Context-Aware Loading
Use the right AGENTS.md for the area you're working in:
- Core SDK (
packages/dart/) →packages/dart/AGENTS.md - Flutter SDK (
packages/flutter/) →packages/flutter/AGENTS.md - General → This file for monorepo-wide commands and conventions
Skills
These form a workflow pipeline — each is model-invoked (the agent reaches for it on its triggers) and hands off to the next:
spec → design-first → code-guidelines + test-guidelines → diagnosing-bugs → review
- spec — Turn an issue link or a fuzzy ask into a verified spec (acceptance criteria) before design — the what
- design-first — Shape non-trivial work before writing it: modules, seams, public API surface — the how
- code-guidelines — Implement / refactor / review against the SDK's rules and constraints
- test-guidelines — Write or modify tests
- diagnosing-bugs — Hard bugs, flaky tests, CI hangs, performance regressions
- review — Three-axis branch review: Standards (our docs + public API surface), Spec (vs the spec above), Correctness (runtime bugs + SDK threat model)
With plan mode: plan mode enforces read-only + the approval gate; these skills supply the content. Plan with spec (the what) and design-first (the how) — their acceptance criteria + design sketch are the plan, and ExitPlanMode is the single sign-off (don't run a separate approval). code-guidelines is the constraint set the design must satisfy, not the driver. After approval, implement under code-guidelines / test-guidelines.
Maintaining Agent Docs
When you hit a wall that an instruction would have prevented, a documented command/path is wrong, or a convention has changed — propose an update to the relevant file:
AGENTS.md— commands, environment, package structure, conventions.agents/skills/spec/SKILL.md— Turning an issue link or a fuzzy ask into a verified spec before design.agents/skills/design-first/SKILL.md— Shaping non-trivial work before writing it.agents/skills/code-guidelines/SKILL.md— Implementing features, refactoring, or reviewing code.agents/skills/test-guidelines/SKILL.md— Writing or modifying tests.agents/skills/diagnosing-bugs/SKILL.md— Hard bugs, flaky tests, CI hangs, performance regressions.agents/skills/review/SKILL.md— Three-axis branch review (Standards + Spec + Correctness)
Do NOT add task-specific fixes, things discoverable from code, or duplicates of what linters enforce. Always propose changes — do not silently edit these files.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

