Skip to content

Adds pre-push readiness skill#11935

Open
camsim99 wants to merge 15 commits into
flutter:mainfrom
camsim99:test-pre-push-agent
Open

Adds pre-push readiness skill#11935
camsim99 wants to merge 15 commits into
flutter:mainfrom
camsim99:test-pre-push-agent

Conversation

@camsim99

Copy link
Copy Markdown
Contributor

Adds a new pre-push skill that verifies changes made to a packages are ready to be "pushed", i.e. the committed changes could successfully be made into a pull request that follows the requirements of the flutter/packages repository (including some of the items in the checklist below).

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
```bash
dart run script/tool/bin/flutter_plugin_tools.dart \
format --run-on-changed-packages
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just saw that we could also use the --set-exit-if-changed option. But we could format directly since it might help the developer. @LouiseHsu what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think what you have is good already!

Comment thread .agents/skills/pre-push-skill/SKILL.md Outdated
@@ -0,0 +1,184 @@
---
name: "pre-push-skill"
description: "A comprehensive pre-push checklist for contributing to the flutter/packages repository."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So from what I remember, skills are invoked only based off the description and the name. So maybe you can make the desc more detailed? something like

"Executes the required pre-push steps for the flutter/packages repository. Call this tool immediately whenever the user asks to push, requests a code review before committing, or wants to validate their local changes for a pull request. Do NOT use this tool if the user is working in flutter/flutter or flutter/engine."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see. Good call, I like your description! Updated it.

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 18, 2026
@camsim99 camsim99 added the CICD Run CI/CD label Jun 18, 2026
@camsim99 camsim99 marked this pull request as ready for review June 18, 2026 20:23
@camsim99 camsim99 requested a review from reidbaker June 18, 2026 20:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new markdown document, SKILL.md, defining the pre-push validation steps and checklist for the flutter/packages repository. The review feedback suggests two improvements to the instructions: first, recommending that developers commit rather than stash their changes during the initial working tree check to ensure latest changes are validated; and second, clarifying that any auto-generated changes in the final check should be committed rather than discarded.

Comment on lines +30 to +33
If this command outputs anything, the code WAS NOT ready to push.
The developer must commit or stash their changes
before you can proceed with the remaining validation steps.
Do not continue if there are uncommitted changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Instructing the developer to stash their changes is counterproductive for validation. If they stash their changes, the working tree is reverted to the HEAD commit, meaning the subsequent validation steps (formatting, analysis, tests) will run on the older code without their latest changes. Instead, they should be instructed to commit their changes (e.g., as a temporary WIP commit) so that those changes can actually be validated.

Suggested change
If this command outputs anything, the code WAS NOT ready to push.
The developer must commit or stash their changes
before you can proceed with the remaining validation steps.
Do not continue if there are uncommitted changes.
If this command outputs anything, the code WAS NOT ready to push.
The developer must commit their changes (e.g., as a temporary WIP commit)
before you can proceed with the remaining validation steps.
Do not continue if there are uncommitted changes.

Comment on lines +140 to +141
If this command outputs anything, the code WAS NOT ready to push.
The changes must be cleaned up before the developer can push.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using the phrase 'cleaned up' might be confusing, as it could be interpreted as discarding the changes (e.g., via git checkout or git clean). Since any changes at this stage are likely formatting fixes or version updates generated by the validation tools, they should be committed instead of discarded. Clarify that these changes must be committed.

Suggested change
If this command outputs anything, the code WAS NOT ready to push.
The changes must be cleaned up before the developer can push.
If this command outputs anything, the code WAS NOT ready to push.
The changes must be committed before the developer can push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants