Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .agents/skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
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.
-->

# Agent Skills
Comment thread
reidbaker marked this conversation as resolved.

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.
1 change: 1 addition & 0 deletions .agents/skills/authoring-skills/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
16 changes: 16 additions & 0 deletions .agents/skills/dart_skills_lint_ignore.json
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These are required because of flutter/skills#83 which will be addressed by flutter/skills#84

Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
10 changes: 10 additions & 0 deletions dart_skills_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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
check-absolute-paths: error
check-trailing-whitespace: error
directories:
- path: ".agents/skills"
9 changes: 9 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ 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:
Comment thread
reidbaker marked this conversation as resolved.
git:
url: https://github.com/flutter/skills
path: tool/dart_skills_lint
ref: 9eff6bbcfa27c2724ea9ad67a611c19fe77057ea
9 changes: 8 additions & 1 deletion tool/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
35 changes: 35 additions & 0 deletions tool/test/validate_skills_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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';
Comment thread
reidbaker marked this conversation as resolved.
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<LogRecord> subscription = Logger.root.onRecord.listen((record) {
print(record.message);
});

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: {
'check-relative-paths': AnalysisSeverity.error,
'check-absolute-paths': AnalysisSeverity.error,
'check-trailing-whitespace': AnalysisSeverity.error,
Comment thread
reidbaker marked this conversation as resolved.
},
);
expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.');
} finally {
Logger.root.level = oldLevel;
await subscription.cancel();
}
});
}
Loading