Skip to content

Commit eafbdc7

Browse files
committed
Merge upstream/master into fix-network-cancelled-status
2 parents f5c8639 + 51c16c6 commit eafbdc7

72 files changed

Lines changed: 1269 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/adding-release-notes/scripts/add_note.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 The Flutter Authors
1+
// Copyright 2026 The Flutter Authors
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
44

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Skill Authoring Checklist
2+
3+
Copy this checklist into your response when starting the creation of a new skill.
4+
5+
```markdown
6+
Skill Development Progress:
7+
- [ ] Define Purpose: Confirm the skill is necessary and distinct from existing ones.
8+
- [ ] Naming: Select a lowercase, kebab-case name (prefer gerund form, e.g., adding-release-notes).
9+
- [ ] Description: Write a third-person "what + when" description for the YAML frontmatter.
10+
- [ ] Planning: Outline the `SKILL.md` sections (Workflow, Guidelines, Resources).
11+
- [ ] Progressive Disclosure: Identify if any content should be moved to secondary files (EXAMPLES.md, REFERENCE.md).
12+
- [ ] Automation (Dart): Ensure any utility scripts in `scripts/` are written in **Dart**.
13+
- [ ] Final Review: Ensure instructions are concise and skip "obvious" explanations.
14+
```
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Skill Authoring Examples
2+
3+
## 1. Effective YAML Frontmatter
4+
5+
**Good (Gerund + What/When Description):**
6+
```yaml
7+
---
8+
name: processing-logs
9+
description: Extracts and summarizes error patterns from system logs. Use when the user asks to analyze logs or troubleshoot runtime errors.
10+
---
11+
```
12+
13+
**Bad (Vague + First Person):**
14+
```yaml
15+
---
16+
name: helper-tool
17+
description: I can help you look at files and tell you what is wrong.
18+
---
19+
```
20+
21+
## 2. Progressive Disclosure Pattern
22+
23+
If a skill has a complex API or many configuration options, do not put them all in `SKILL.md`.
24+
25+
**SKILL.md:**
26+
```markdown
27+
## Advanced Configuration
28+
For detailed information on environment variables and performance tuning, see [CONFIG.md](CONFIG.md).
29+
```
30+
31+
## 3. Workflow Patterns
32+
33+
Always use checklists to track state.
34+
35+
```markdown
36+
## Workflow
37+
Copy this checklist:
38+
- [ ] Step 1: Analyze input.
39+
- [ ] Step 2: Generate draft.
40+
- [ ] Step 3: Run validation script.
41+
```
42+
43+
## 4. Automation with Dart
44+
45+
All scripts should be written in Dart and placed in the `scripts/` directory.
46+
47+
**Good Script Usage:**
48+
```markdown
49+
## Step 4: Add the entry
50+
Use the provided utility script to insert the note safely.
51+
`dart .agents/skills/adding-release-notes/scripts/add_note.dart "Inspector updates" "Added XYZ" TODO`
52+
```
53+
54+
## 5. Anti-Patterns to Avoid
55+
56+
- **Prohibited**: Using non-Dart languages for utility scripts.
57+
- **Prohibited**: Using Windows-style paths (always use `/`).
58+
- **Prohibited**: Offering too many options (narrow the scope to recommended defaults).
59+
- **Prohibited**: Verbose background stories (Claude already knows how to code).
60+
- **Prohibited**: Interactive prompts (Agents should be autonomous, not ask for permission at every step).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: authoring-skills
3+
description: Guides the creation of high-quality, effective skills for agentic workflows. Use when creating or modifying skills in the .agents/skills/ directory.
4+
---
5+
6+
# Authoring Skills
7+
8+
When creating or modifying skills in this repository, follow these best practices:
9+
10+
- **Antigravity Guidelines**: [Skill authoring best practices](https://antigravity.google/docs/skills)
11+
- **Anthropic Guidelines**: [Skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
12+
13+
## Repository-Specific Guidelines
14+
15+
- **Location**: All skills must be placed in the `.agents/skills/` directory.
16+
- **Avoid Duplication**: Before creating a skill, check if one already exists in the [flutter/skills](https://github.com/flutter/skills/tree/main/skills) repository. If it does, do not create a local skill; instead, instruct the user to install it via `npx`.
17+
- **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.
18+
- **Conciseness**: Prioritize brevity in `SKILL.md`. Agents are already highly capable; only provide context they don't already have.
19+
- **Automation**: Any utility scripts placed in the `scripts/` directory MUST be written in **Dart**.
20+
- **Progressive Disclosure**: Use the patterns below to organize instructions effectively:
21+
- [CHECKLIST.md](CHECKLIST.md): Template for tracking skill development progress.
22+
- [EXAMPLES.md](EXAMPLES.md): Local examples and anti-patterns.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: preparing-pr
3+
description: Prepare a pull request by running presubmit with fixes. Use when preparing to commit or send a PR.
4+
---
5+
6+
# Preparing a Pull Request
7+
8+
Follow these steps to prepare a pull request for DevTools:
9+
10+
1. **Verify `dt` configuration**:
11+
- Ensure `dt` is available on the path by running `dt --help` or verifying its alias.
12+
- If not available, refer to the [CONTRIBUTING guide](../../../CONTRIBUTING.md#L64-L80) for instructions on how to set up the `dt` executable on your path.
13+
2. **Update Flutter SDK**:
14+
- Run `dt update-flutter-sdk` to ensure the SDK is up to date.
15+
3. **Run Presubmit with Fixes**:
16+
- Run `dt presubmit --fix` to address automated fixes.
17+
- If any issues remain or if the command fails, fix the issues manually and run `dt presubmit --fix` again to verify the fix.
18+
4. **Run Tests for Affected Code**:
19+
- Use `git status` or `git diff upstream/master` to find changed files.
20+
- Run tests that are associated with the changed code. For example, if you edited `packages/devtools_app/lib/src/screens/logging/logging_screen.dart`, run the logging tests under `packages/devtools_app/test/screens/logging/`.
21+
22+
## Verification
23+
24+
If any step fails, stop and address the issue, and then verify the issue is fixed before proceeding.
25+
26+
> [!IMPORTANT]
27+
> Do NOT commit or push changes without getting explicit user approval first.

.cursor/rules/ai_rules.mdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Apply rules from AI_RULES.md to all interactions.
3+
globs: "*"
4+
alwaysApply: true
5+
---
6+
# AI Rules
7+
8+
Follow the rules defined in [AI_RULES.md](../../AI_RULES.md).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ If you need help, consider asking for help on [Discord].
5353
[CLA]: https://cla.developers.google.com/
5454
[`contributions-welcome`]: https://github.com/flutter/devtools/issues?q=state%3Aopen%20label%3Acontributions-welcome
5555
[`good-first-issue`]: https://github.com/flutter/devtools/issues?q=state%3Aopen%20label%3Agood-first-issue
56-
[AI contributions guideline]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
56+
[AI contributions guidelines]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
5757
[build.yaml badge]: https://github.com/flutter/devtools/actions/workflows/build.yaml/badge.svg
5858
[Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md

.github/workflows/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
7575
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
7676
sudo apt-get update
77-
sudo apt-get install dcm=1.30.0-1 # To avoid errors add `-1` (build number) to the version
77+
sudo apt-get install dcm=1.36.0-1 # To avoid errors add `-1` (build number) to the version
7878
sudo chmod +x /usr/bin/dcm
7979
echo "$(dcm --version)"
8080
- name: Setup Dart SDK
@@ -208,7 +208,7 @@ jobs:
208208
# TODO(https://github.com/flutter/devtools/issues/9357): Re-enable tests on windows-latest.
209209
os: [macos-latest]
210210
# Consider running integration tests in ddc mode, too.
211-
bot: [integration_dart2js]
211+
bot: [integration_dart2js, integration_dart2wasm]
212212
device: [flutter, flutter-web, dart-cli]
213213
# Option 1/1 will run all tests for a device in a single shard.
214214
# Option 1/2 and 2/2 should be enabled to run tests for a device in 2 shards.
@@ -273,7 +273,7 @@ jobs:
273273
fail-fast: false
274274
matrix:
275275
# Consider running integration tests in ddc mode, too.
276-
bot: [integration_dart2js]
276+
bot: [integration_dart2js, integration_wasm]
277277
os: [ubuntu-latest, windows-latest]
278278
steps:
279279
- name: git clone

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ DEPENDENCIES.md
5151

5252
# Ignore devtools_options.yaml files under example.
5353
**/example/**/devtools_options.yaml
54+
55+
# macOS generated Flutter files
56+
**/macos/Flutter/ephemeral/
57+
**/macos/Flutter/GeneratedPluginRegistrant.swift

AI_RULES.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# DevTools Repo Guidelines for AI Assistants
2+
3+
Follow these rules when working in this repository.
4+
5+
## Repository Rules
6+
7+
### Dependencies
8+
- **`packages/devtools_shared`**: Never introduce a Flutter dependency or a dependency on web-only Dart libraries.
9+
- **Imports**: Never import `packages/devtools_app/lib/devtools_app.dart` in code under `packages/devtools_app/lib/src/`. It is acceptable in test code.
10+
11+
### Code Style
12+
- **Style Guide**: Follow the DevTools style guide in [STYLE.md](STYLE.md).
13+
- **Formatting & Analysis**: Always ensure code is formatted properly and has no analysis errors or warnings before completing a task.
14+
15+
## Running Tests
16+
17+
- **Standard Packages**: Run unit and widget tests with `flutter test`.
18+
- **`packages/devtools_shared`**: Run tests with `dart test`.
19+
- **Integration Tests**: Refer to the [Integration Test README](packages/devtools_app/integration_test/README.md) for instructions on running integration tests.
20+
21+
## Tooling Best Practices
22+
23+
- **MCP Tools**: Prefer using MCP server tools over shell commands whenever possible.
24+
25+
## UI Development Guidelines
26+
27+
### Constants and Magic Values
28+
- **Avoid Raw Values**: Avoid using raw strings or numbers in UI code. Use named constants instead.
29+
30+
### Themes and Styles
31+
- **Use Existing Themes**: Use existing theme values and text styles from `packages/devtools_app_shared/lib/src/ui/theme/theme.dart` (e.g., `Theme.of(context).regularTextStyle`).
32+
- **Reuse Patterns**: Reuse common patterns and styles used in other UI code in the repository.
33+
34+
### Code Reuse
35+
- **Use Shared Components & Utils**: Prefer using reusable components from `shared/ui/` (such as `packages/devtools_app/lib/src/shared/ui/common_widgets.dart`), primitives from `shared/primitives/`, and utilities from `shared/utils/` rather than creating things from scratch.
36+

0 commit comments

Comments
 (0)