From 2661c38c13fda3e48b948620489e3a295665d314 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 14 Apr 2026 16:30:47 -0400 Subject: [PATCH 1/8] add dart skills lint test and yaml config with instructions for how to use --- .agents/skills/README.md | 34 ++++++++++++++++++++++++ .agents/skills/authoring-skills/SKILL.md | 1 + dart_skills_lint.yaml | 7 +++++ pubspec.lock | 9 +++++++ pubspec.yaml | 5 ++++ tool/test/validate_skills_test.dart | 29 ++++++++++++++++++++ 6 files changed, 85 insertions(+) create mode 100644 .agents/skills/README.md create mode 100644 dart_skills_lint.yaml create mode 100644 tool/test/validate_skills_test.dart diff --git a/.agents/skills/README.md b/.agents/skills/README.md new file mode 100644 index 00000000000..8ad59303370 --- /dev/null +++ b/.agents/skills/README.md @@ -0,0 +1,34 @@ +# Agent Skills + +This directory contains AI agent skills for this repository. + +## Validation + +To ensure skills meet the required specification, they are automatically validated in pre-submit checks. +You should also validate your skills locally before submitting a review. + +### Running the Linter Locally + +To validate skills locally before review, run the linter from the root of the repository: + +```bash +dart run dart_skills_lint:cli +``` + +This will use the configuration in `dart_skills_lint.yaml` to validate all skills in the `.agents/skills` directory. + +Or for a single skill: + +```bash +dart run dart_skills_lint:cli --skill .agents/skills/my-skill +``` + +### Running via Dart Test + +Alternatively, you can run the validation as a test from the `tool` directory: + +```bash +cd tool && dart test test/validate_skills_test.dart +``` + +This ensures that the validation logic is executed in the same way as in CI. diff --git a/.agents/skills/authoring-skills/SKILL.md b/.agents/skills/authoring-skills/SKILL.md index ab871197713..da0bdcfea13 100644 --- a/.agents/skills/authoring-skills/SKILL.md +++ b/.agents/skills/authoring-skills/SKILL.md @@ -17,6 +17,7 @@ When creating or modifying skills in this repository, follow these best practice - **Naming**: Use the gerund form (**verb-ing-noun**) or **noun-phrase** (e.g., `authoring-skills`, `adding-release-notes`). Use only lowercase letters, numbers, and hyphens. - **Conciseness**: Prioritize brevity in `SKILL.md`. Agents are already highly capable; only provide context they don't already have. - **Automation**: Any utility scripts placed in the `scripts/` directory MUST be written in **Dart**. +- **Validation**: Skills are automatically validated using `dart_skills_lint`. Ensure your skills pass the linter before submitting. See the `README.md` in `.agents/skills/` for instructions on how to run the linter locally. - **Progressive Disclosure**: Use the patterns below to organize instructions effectively: - [CHECKLIST.md](CHECKLIST.md): Template for tracking skill development progress. - [EXAMPLES.md](EXAMPLES.md): Local examples and anti-patterns. diff --git a/dart_skills_lint.yaml b/dart_skills_lint.yaml new file mode 100644 index 00000000000..651fd9734c9 --- /dev/null +++ b/dart_skills_lint.yaml @@ -0,0 +1,7 @@ +dart_skills_lint: + rules: + check-relative-paths: error + check-absolute-paths: error + check-trailing-whitespace: error + directories: + - path: ".agents/skills" diff --git a/pubspec.lock b/pubspec.lock index 0bd580b73d5..d0ca01af00e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -209,6 +209,15 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.3" + dart_skills_lint: + dependency: "direct dev" + description: + path: "tool/dart_skills_lint" + ref: "9eff6bbcfa27c2724ea9ad67a611c19fe77057ea" + resolved-ref: "9eff6bbcfa27c2724ea9ad67a611c19fe77057ea" + url: "https://github.com/flutter/skills" + source: git + version: "0.2.0" dart_style: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d5920002f05..c8aa0c1c653 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,3 +15,8 @@ workspace: dev_dependencies: build_runner: ^2.5.4 flutter_lints: ^5.0.0 + dart_skills_lint: + git: + url: https://github.com/flutter/skills + path: tool/dart_skills_lint + ref: 9eff6bbcfa27c2724ea9ad67a611c19fe77057ea diff --git a/tool/test/validate_skills_test.dart b/tool/test/validate_skills_test.dart new file mode 100644 index 00000000000..96758b33b37 --- /dev/null +++ b/tool/test/validate_skills_test.dart @@ -0,0 +1,29 @@ +import 'dart:async'; +import 'package:dart_skills_lint/dart_skills_lint.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; + +void main() { + test('Validate DevTools Skills', () async { + final Level oldLevel = Logger.root.level; + Logger.root.level = Level.ALL; + final StreamSubscription subscription = Logger.root.onRecord.listen((record) { + print(record.message); + }); + + try { + final bool isValid = await validateSkills( + skillDirPaths: ['../.agents/skills'], + resolvedRules: { + 'check-relative-paths': AnalysisSeverity.error, + 'check-absolute-paths': AnalysisSeverity.error, + 'check-trailing-whitespace': AnalysisSeverity.error, + }, + ); + expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.'); + } finally { + Logger.root.level = oldLevel; + await subscription.cancel(); + } + }); +} From fed7a84c8938400c6a7a26b50c62e08078f9b67b Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 14 Apr 2026 16:59:38 -0400 Subject: [PATCH 2/8] Add ignore file for valid links that are triggering false positives --- .agents/skills/adding-release-notes/SKILL.md | 2 +- .agents/skills/dart_skills_lint_ignore.json | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .agents/skills/dart_skills_lint_ignore.json diff --git a/.agents/skills/adding-release-notes/SKILL.md b/.agents/skills/adding-release-notes/SKILL.md index c47b3e699b1..59853bf5d89 100644 --- a/.agents/skills/adding-release-notes/SKILL.md +++ b/.agents/skills/adding-release-notes/SKILL.md @@ -84,4 +84,4 @@ Add images to `packages/devtools_app/release_notes/images/` and reference them: **Constraint**: Use **dark mode** for screenshots. ## Resources -- [README.md](../../packages/devtools_app/release_notes/README.md): Official project guidance. +- [README.md](../../../packages/devtools_app/release_notes/README.md): Official project guidance. diff --git a/.agents/skills/dart_skills_lint_ignore.json b/.agents/skills/dart_skills_lint_ignore.json new file mode 100644 index 00000000000..fd315866d49 --- /dev/null +++ b/.agents/skills/dart_skills_lint_ignore.json @@ -0,0 +1,16 @@ +{ + "skills": { + "adding-release-notes": [ + { + "rule_id": "check-relative-paths", + "file_name": "SKILL.md" + } + ], + "preparing-pr": [ + { + "rule_id": "check-relative-paths", + "file_name": "SKILL.md" + } + ] + } +} \ No newline at end of file From 9c290a1453ee677fca4947634c00945366541c80 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 14 Apr 2026 17:02:00 -0400 Subject: [PATCH 3/8] resolve readme to correct location --- .agents/skills/adding-release-notes/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.agents/skills/adding-release-notes/SKILL.md b/.agents/skills/adding-release-notes/SKILL.md index 59853bf5d89..c47b3e699b1 100644 --- a/.agents/skills/adding-release-notes/SKILL.md +++ b/.agents/skills/adding-release-notes/SKILL.md @@ -84,4 +84,4 @@ Add images to `packages/devtools_app/release_notes/images/` and reference them: **Constraint**: Use **dark mode** for screenshots. ## Resources -- [README.md](../../../packages/devtools_app/release_notes/README.md): Official project guidance. +- [README.md](../../packages/devtools_app/release_notes/README.md): Official project guidance. From eb5547bda7c17d83904f8354df26c5bab5154585 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 14 Apr 2026 17:52:59 -0400 Subject: [PATCH 4/8] Copyright added to new files and issue linked in pubspec --- .agents/skills/README.md | 6 ++++++ dart_skills_lint.yaml | 3 +++ pubspec.yaml | 1 + tool/test/validate_skills_test.dart | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/.agents/skills/README.md b/.agents/skills/README.md index 8ad59303370..e310c405279 100644 --- a/.agents/skills/README.md +++ b/.agents/skills/README.md @@ -1,3 +1,9 @@ + + # Agent Skills This directory contains AI agent skills for this repository. diff --git a/dart_skills_lint.yaml b/dart_skills_lint.yaml index 651fd9734c9..1e585eb864d 100644 --- a/dart_skills_lint.yaml +++ b/dart_skills_lint.yaml @@ -1,3 +1,6 @@ +# Copyright 2026 The Flutter Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. dart_skills_lint: rules: check-relative-paths: error diff --git a/pubspec.yaml b/pubspec.yaml index c8aa0c1c653..25f186d9506 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,6 +15,7 @@ workspace: dev_dependencies: build_runner: ^2.5.4 flutter_lints: ^5.0.0 + # Update to published version tracked in https://github.com/flutter/devtools/issues/9771 dart_skills_lint: git: url: https://github.com/flutter/skills diff --git a/tool/test/validate_skills_test.dart b/tool/test/validate_skills_test.dart index 96758b33b37..ded1771a6dc 100644 --- a/tool/test/validate_skills_test.dart +++ b/tool/test/validate_skills_test.dart @@ -1,3 +1,7 @@ +// Copyright 2026 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. + import 'dart:async'; import 'package:dart_skills_lint/dart_skills_lint.dart'; import 'package:logging/logging.dart'; From 92e8b56ee766ad2cfdd2841da72e78f8125f30b6 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 14 Apr 2026 17:56:57 -0400 Subject: [PATCH 5/8] Add link to yaml configuration feature --- tool/test/validate_skills_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/test/validate_skills_test.dart b/tool/test/validate_skills_test.dart index ded1771a6dc..13c12d26846 100644 --- a/tool/test/validate_skills_test.dart +++ b/tool/test/validate_skills_test.dart @@ -16,6 +16,8 @@ void main() { }); try { + // Update test to use dart_skills_lint.yaml for config when available. + // See https://github.com/flutter/skills/issues/85. final bool isValid = await validateSkills( skillDirPaths: ['../.agents/skills'], resolvedRules: { From cbc4b025ce8b802a33b99965bf795bc9f57cc294 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Wed, 15 Apr 2026 14:27:00 -0400 Subject: [PATCH 6/8] presubmit feedback --- tool/pubspec.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/pubspec.yaml b/tool/pubspec.yaml index 90ccf119490..c4a731350dd 100644 --- a/tool/pubspec.yaml +++ b/tool/pubspec.yaml @@ -21,6 +21,13 @@ dependencies: meta: ^1.18.0 path: ^1.9.0 yaml: ^3.1.2 - + dev_dependencies: + # Update to published version tracked in https://github.com/flutter/devtools/issues/9771 + dart_skills_lint: + git: + url: https://github.com/flutter/skills + path: tool/dart_skills_lint + ref: 9eff6bbcfa27c2724ea9ad67a611c19fe77057ea + logging: ^1.1.1 test: ^1.25.8 From edbe03a86de9e8a09192b523f0747af63676cb65 Mon Sep 17 00:00:00 2001 From: Reid Baker <1063596+reidbaker@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:26:46 -0400 Subject: [PATCH 7/8] Update tool/test/validate_skills_test.dart Co-authored-by: Kenzie Davisson <43759233+kenzieschmoll@users.noreply.github.com> --- tool/test/validate_skills_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/test/validate_skills_test.dart b/tool/test/validate_skills_test.dart index 13c12d26846..7c50d63ebeb 100644 --- a/tool/test/validate_skills_test.dart +++ b/tool/test/validate_skills_test.dart @@ -16,8 +16,8 @@ void main() { }); try { - // Update test to use dart_skills_lint.yaml for config when available. - // See https://github.com/flutter/skills/issues/85. + // TODO(https://github.com/flutter/skills/issues/85): Update test + // to use dart_skills_lint.yaml for config when available. final bool isValid = await validateSkills( skillDirPaths: ['../.agents/skills'], resolvedRules: { From ed99a0205f8f6739ed68812b429181f666d13988 Mon Sep 17 00:00:00 2001 From: Reid Baker <1063596+reidbaker@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:27:00 -0400 Subject: [PATCH 8/8] Update pubspec.yaml Co-authored-by: Kenzie Davisson <43759233+kenzieschmoll@users.noreply.github.com> --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 25f186d9506..d7de5df9071 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ workspace: dev_dependencies: build_runner: ^2.5.4 flutter_lints: ^5.0.0 - # Update to published version tracked in https://github.com/flutter/devtools/issues/9771 + # TODO(https://github.com/flutter/devtools/issues/9771): Update to published version. dart_skills_lint: git: url: https://github.com/flutter/skills