Skip to content

chore: Improve agent docs, add skills, and curate skill set#3611

Merged
buenaflor merged 19 commits intomainfrom
chore/agents-update
Mar 31, 2026
Merged

chore: Improve agent docs, add skills, and curate skill set#3611
buenaflor merged 19 commits intomainfrom
chore/agents-update

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented Mar 30, 2026

📜 Description

Improves the developer experience for this repo by:

  • Rewriting agent documentation (AGENTS.md) to be actionable and concise
  • Adding skills (test-conventions, code-guidelines) that auto-activate during relevant tasks
  • Curating agents.toml to only include relevant skills
  • Adding melos scripts for analyze, format, and test with proper dart/flutter filtering
  • Adding a pre-commit hook that auto-formats staged .dart files and only analyzes changed packages
  • Adding FVM integration via sdkPath in melos.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?

  • Verified pre-commit hook scopes correctly by staging changes in individual packages:
    • Staging a packages/dio/ file: dart analyze ran on 1 package, flutter analyze on 0
    • Staging a packages/flutter/ file: dart analyze ran on 0 packages, flutter analyze on 2
    • Staging only root files: hook skips with "No package changes staged"
  • Verified auto-format: staged a badly formatted file, hook reformatted and re-staged it
  • Verified melos run format, melos run analyze:dart, melos run analyze:flutter work independently

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

#skip-changelog

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
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (563056a) to head (e1dd1a4).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 30, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
sentry_flutter_example io.sentry.flutter.sample 9.16.0 (1) Release Install Build

buenaflor and others added 6 commits March 30, 2026 17:15
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>
@buenaflor buenaflor marked this pull request as ready for review March 31, 2026 11:38
@buenaflor buenaflor requested a review from denrase as a code owner March 31, 2026 11:39
Copilot AI review requested due to automatic review settings March 31, 2026 11:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yaml scripts 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.md content, new skill files, curated agents.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.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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 sentry package analysis
    • Added special case handling for the dart directory to map to --scope=sentry instead of --scope=*dart* since the packages/dart/ directory contains the package named 'sentry'.

Create PR

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 them

This 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>
@github-actions
Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1253.45 ms 1247.63 ms -5.82 ms
Size 5.73 MiB 6.17 MiB 455.49 KiB

Baseline results on branch: main

Startup times

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

buenaflor and others added 3 commits March 31, 2026 13:51
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>
buenaflor and others added 3 commits March 31, 2026 15:06
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the way

@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 31, 2026

buenaflor and others added 2 commits March 31, 2026 15:52
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>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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>
@buenaflor
Copy link
Copy Markdown
Contributor Author

Failing test is not relevant to this PR

@buenaflor buenaflor merged commit caa8620 into main Mar 31, 2026
142 of 144 checks passed
@buenaflor buenaflor deleted the chore/agents-update branch March 31, 2026 14:21
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.

3 participants