chore: Improve agent docs, add skills, and curate skill set#3611
chore: Improve agent docs, add skills, and curate skill set#3611
Conversation
Rewrite root AGENTS.md for clarity: package table, file-scoped commands, commit/PR conventions, and monorepo override pointers. Add nested AGENTS.md for packages/dart (core SDK, public API surface) and packages/flutter (native code, platform-specific details). Create test-conventions and code-guidelines skills from the existing docs/agent_instructions/ markdown files. Register both in settings.json. Switch agents.toml from wildcard skill imports to explicit names, dropping 9 irrelevant skills (Django, SRED, blog, brand, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3611 +/- ##
=======================================
Coverage 88.12% 88.12%
=======================================
Files 304 304
Lines 10372 10372
=======================================
Hits 9140 9140
Misses 1232 1232 ☔ View full report in Codecov by Sentry. |
Sentry Build Distribution
|
Configure melos with analyze, format, and test scripts. Add .githooks/pre-commit that runs checks on commit. Wire fvm via sdkPath in melos.yaml and document setup in CONTRIBUTING.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the blanket `melos run precommit` with targeted `melos exec --scope` calls so only packages with staged changes are analyzed. Auto-format staged .dart files and re-stage them before analysis. Add a `format` melos script for applying formatting (vs checking). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update pre-commit hooks section to reflect scoped analysis and auto-formatting behavior. Add format script to available scripts table. Remove redundant Type section from dart AGENTS.md for consistency with flutter AGENTS.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove legacy docs/agent_instructions/ files (now replaced by skills). Simplify melos postclean script and pubspec overrides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Improves developer tooling and AI/agent guidance for the Dart/Flutter monorepo by adding Melos scripts, git hooks, and restructuring agent “skills” documentation.
Changes:
- Added
melos.yamlscripts for analyze/format/test plus FVM integration and post-bootstrap hook configuration. - Introduced a pre-commit hook to auto-format staged Dart files and analyze only affected packages.
- Reworked agent documentation structure (new
AGENTS.mdcontent, new skill files, curatedagents.toml, and updated contributing docs).
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/flutter/example/pubspec_overrides.yaml | Adjusts melos-managed overrides and simplifies git dependency syntax. |
| packages/flutter/CLAUDE.md | Adds local pointer content for agent instructions. |
| packages/flutter/AGENTS.md | Adds package-specific agent guidance for sentry_flutter. |
| packages/dart/CLAUDE.md | Adds local pointer content for agent instructions. |
| packages/dart/AGENTS.md | Adds package-specific agent guidance for sentry. |
| melos.yaml | Adds FVM sdkPath, bootstrap hook, and common scripts (analyze/format/test). |
| docs/agent_instructions/test-conventions.md | Removes old test conventions doc (replaced by skill). |
| docs/agent_instructions/code-guidelines.md | Converts to a named skill-like document and expands guidelines. |
| agents.toml | Introduces curated agent skill sources and trust configuration. |
| CONTRIBUTING.md | Updates toolchain/environment setup, adds fvm + hook documentation. |
| AGENTS.md | Rewrites top-level agent guide (commands, conventions, skill references). |
| .gitignore | Ignores dotagents-generated files. |
| .githooks/pre-commit | Adds pre-commit hook for formatting and scoped analyzes. |
| .claude/skills | Points Claude skill discovery at .agents/skills. |
| .claude/settings.json | Loads the new test-conventions / code-guidelines skills. |
| .agents/skills/test-conventions/SKILL.md | Adds the new test-conventions skill definition and rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Pre-commit hook silently skips core
sentrypackage analysis- Added special case handling for the
dartdirectory to map to--scope=sentryinstead of--scope=*dart*since the packages/dart/ directory contains the package named 'sentry'.
- Added special case handling for the
Or push these changes by commenting:
@cursor push 9d343c5fd9
Preview (9d343c5fd9)
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -9,9 +9,14 @@
fi
# Build --scope flags for melos exec
+# Note: packages/dart/ contains the 'sentry' package, not 'sentry_dart'
SCOPE=""
for pkg in $CHANGED; do
- SCOPE="$SCOPE --scope=*${pkg}*"
+ if [ "$pkg" = "dart" ]; then
+ SCOPE="$SCOPE --scope=sentry"
+ else
+ SCOPE="$SCOPE --scope=*${pkg}*"
+ fi
done
# Auto-format staged .dart files and re-stage themThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Fix grammar and broaden JNI-only guidance to cover both JNI and FFI native interop, which both require integration tests since they cannot be mocked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 51520fc | 1253.87 ms | 1254.87 ms | 1.00 ms |
| 0e2b9b0 | 1248.69 ms | 1252.22 ms | 3.54 ms |
| c8596a6 | 1234.11 ms | 1241.19 ms | 7.08 ms |
| bfabaf2 | 1251.72 ms | 1253.38 ms | 1.67 ms |
| 29e8ebe | 1260.46 ms | 1262.60 ms | 2.14 ms |
| 1777727 | 1249.21 ms | 1258.40 ms | 9.18 ms |
| 6b69699 | 1254.80 ms | 1273.31 ms | 18.52 ms |
| e3f3ea1 | 1262.83 ms | 1264.83 ms | 1.99 ms |
| 827bf09 | 1261.86 ms | 1276.41 ms | 14.55 ms |
| 944b773 | 1252.82 ms | 1254.08 ms | 1.27 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 51520fc | 5.53 MiB | 5.96 MiB | 443.39 KiB |
| 0e2b9b0 | 5.73 MiB | 6.17 MiB | 453.79 KiB |
| c8596a6 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| bfabaf2 | 5.53 MiB | 6.01 MiB | 487.95 KiB |
| 29e8ebe | 5.53 MiB | 6.01 MiB | 488.12 KiB |
| 1777727 | 5.73 MiB | 6.17 MiB | 453.78 KiB |
| 6b69699 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| e3f3ea1 | 5.53 MiB | 5.96 MiB | 443.28 KiB |
| 827bf09 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 944b773 | 5.53 MiB | 6.00 MiB | 479.98 KiB |
Replace bash -c conditionals with plain `dart format .` which formats the entire package directory without needing a shell wrapper. Also fix incorrect barrel file reference in flutter AGENTS.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove format:check, precommit, and precommit:full scripts since the pre-commit hook handles scoped analysis and formatting directly. Keep analyze, format, and test scripts for manual developer use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The hook previously derived melos scope from directory names, which broke for packages/dart/ since the directory name "dart" doesn't match the package name "sentry". Read the actual name from each package's pubspec.yaml instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Effective Dart convention reference, update available scripts table to match current melos.yaml, and remove stale precommit:full reference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Walk up from each staged file to find the nearest pubspec.yaml instead of assuming packages are always at packages/<dir>/. Fixes incorrect scoping for nested packages like packages/flutter/example/ and packages/dart/example_web/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move AI attribution from standalone section into the Commits section as a single bullet point. Make it agent-agnostic with Claude as an example rather than the only option. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This is discoverable from the codebase and doesn't need to be documented in agent instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename 'Nested AGENTS.md' to 'Context-Aware Loading' with explicit routing for Core SDK, Flutter SDK, and general monorepo contexts. Follows the pattern from the main Sentry repo's AGENTS.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| Read these files **only when relevant** to your current task: | ||
| - 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 |
Rename the skill directory and update all references across AGENTS.md, settings.json, and code-guidelines SKILL.md. Add GOOD/AVOID code examples to every section of the test-guidelines skill for clearer agent guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
The postclean script ran `flutter clean` on all packages including Dart-only ones, which would produce errors. Add `--flutter` filter to restrict execution to Flutter packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Failing test is not relevant to this PR |


📜 Description
Improves the developer experience for this repo by:
test-conventions,code-guidelines) that auto-activate during relevant tasksagents.tomlto only include relevant skills.dartfiles and only analyzes changed packagessdkPathinmelos.yaml💡 Motivation and Context
The previous agent docs were noisy and not actionable. The repo also lacked local development tooling (pre-commit hooks, melos scripts, FVM). This PR addresses both.
Closes DART-343
💚 How did you test it?
packages/dio/file:dart analyzeran on 1 package,flutter analyzeon 0packages/flutter/file:dart analyzeran on 0 packages,flutter analyzeon 2melos run format,melos run analyze:dart,melos run analyze:flutterwork independently📝 Checklist
sendDefaultPiiis enabled#skip-changelog