Skip to content

[camera_android_camerax] Migrate check-readiness skill from bash to Dart#11943

Open
reidbaker wants to merge 41 commits into
mainfrom
convert-check-sh-to-dart
Open

[camera_android_camerax] Migrate check-readiness skill from bash to Dart#11943
reidbaker wants to merge 41 commits into
mainfrom
convert-check-sh-to-dart

Conversation

@reidbaker

@reidbaker reidbaker commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

1. Migrated check-readiness Skill to Dart

  • Replaced scripts/check.sh with a Dart implementation.
  • Implemented unit tests for the checker logic under test/check_test.dart

2. Tooling & CI Support for Agent Skills

  • Static Analysis (Opt-in): Added a new --analyze-skills-for flag to the analyze command. When set, it explicitly runs dart analyze on the .agents/skills directories of the configured packages.
  • CI Configuration: Configured the global analyze workflow in .ci/targets/analyze.yaml to run analysis on camera's skills via script/configs/skills_analysis.yaml.
  • Unit Testing: Because .agents/skills/check-readiness is set up as a standalone Dart package with its own pubspec.yaml, the repository's existing dart-test command automatically discovers and runs its unit tests.
  • Validation Exemption: Added .pubignore parsing support to RepositoryPackage and integrated it into the validate command. Any subpackage matching .pubignore patterns (e.g. .agents/skills/) is now skipped by the validate command, ensuring internal/contributor-only tools do not fail publishing hygiene checks.
  • Versioning & CHANGELOG Exemption: Classified paths starting with .agents/ as developer-only changes. This exempts skill-only or script-only modifications within the .agents/ directory from triggering version-bump and CHANGELOG update requirements.

I asked my agent to articulate the interaction between top level packages tool commands and .agents/skills. Then I filtered the list to the command I thought reviewers or people looking at this pr later would find interesting.

Interaction of Packages Tool Commands with .agents/skills

Command Targeting Scope Runs on .agents/skills? Interaction Details
analyze topLevelOnly Yes (Explicitly) Runs pub get on the main package and all subpackages (including those in .agents/skills). If the main package is listed in --analyze-skills-for (configured in CI via script/configs/skills_analysis.yaml), it explicitly runs dart analyze --fatal-infos .agents/skills.
validate includeAllSubpackages No (Skipped) Since .pubignore specifies .agents/, the skill packages are marked as ignored (isPubIgnored = true). The validate command skips them entirely (SKIPPING: Ignored by .pubignore), exempting developer-only helper tools from public-facing package hygiene rules.
dart-test includeAllSubpackages Yes Because it targets all subpackages, it scans .agents/skills/*. If a skill package contains a test/ directory, it executes the Dart/Flutter unit tests inside it.
format topLevelOnly Yes Uses recursive file gathering (getFilesForPackage) under the main package directory, formatting all Dart, C++, Java, Kotlin, and Swift files under .agents/skills/. It does not filter files using .pubignore.
license-check N/A (Repository-wide) Yes Gathers all tracked files in Git via git ls-files. Any file checked into Git under .agents/skills/ is validated for standard first-party or recognized third-party license headers.
fix includeAllSubpackages Yes Runs dart fix --apply inside any skill package directory that contains a pubspec.yaml.
update-dependency includeAllSubpackages Yes If a targeted dependency is used by the skill package, its pubspec.yaml will be updated.
update-min-sdk includeAllSubpackages Yes Updates SDK constraints inside the skill package's pubspec.yaml when run.
remove-dev-dependencies includeAllSubpackages Yes Removes development dependencies from the skill package's pubspec.yaml when targeted.
publish-check topLevelOnly No Runs on the main package. Because .agents/ is listed in .pubignore, the directory is excluded from the package archive and not uploaded or checked.
publish topLevelOnly No Similar to publish-check, the .agents/ directory is skipped during publish due to .pubignore.
fetch-deps topLevelOnly No N/A
list N/A No Lists only top-level packages.

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
@reidbaker reidbaker marked this pull request as draft June 18, 2026 23:41

@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 introduces a new local agent skill check-readiness to verify the environment, adds a custom lint rule to enforce that tracked skills are marked as internal, and implements proxy tests to run unit tests and validate skills. It also integrates several third-party skills via symlinks. The review feedback highlights several critical improvements: ensuring dependencies are resolved with pub get before running tests, avoiding crashes on broken symlinks by setting followLinks: false, adding safe type checks before casting YAML to a map, using Directory.current.path to robustly determine the workspace root, handling ProcessException when executing git commands, and updating the skill documentation to reference the Dart implementation instead of the duplicate bash script.

Comment thread packages/camera/camera_android_camerax/test/skills_unit_tests_test.dart Outdated
Comment thread packages/camera/camera_android_camerax/test/skills_unit_tests_test.dart Outdated
Comment thread packages/camera/camera_android_camerax/.agents/skills/check-readiness/SKILL.md Outdated
@reidbaker reidbaker force-pushed the convert-check-sh-to-dart branch from e1801ee to d98795b Compare June 19, 2026 00:03
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 19, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 19, 2026
@reidbaker reidbaker requested a review from camsim99 June 19, 2026 17:46
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 19, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Jun 19, 2026
@reidbaker reidbaker force-pushed the convert-check-sh-to-dart branch from b113c22 to a03abb1 Compare June 22, 2026 18:48
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
@reidbaker reidbaker force-pushed the convert-check-sh-to-dart branch from a03abb1 to 307eb67 Compare June 22, 2026 19:08
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@reidbaker reidbaker force-pushed the convert-check-sh-to-dart branch from 307eb67 to f17e516 Compare June 22, 2026 19:09
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
# Conflicts:
#	packages/camera/camera_android_camerax/.agents/skills/check-readiness/SKILL.md
@reidbaker reidbaker marked this pull request as ready for review June 22, 2026 19:45
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026

@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 replaces the bash-based readiness check script with a Dart-based tool, introduces a new --analyze-skills-for flag to the analyze command, and adds support for skipping packages ignored by .pubignore during validation. The review feedback suggests enhancing the .pubignore matching logic to recursively check ancestor path segments for directory patterns without trailing slashes, adding corresponding test cases, and enabling followLinks: true when scanning for Dart files in .agents/skills to support symlinked directories.

Comment thread script/tool/lib/src/common/repository_package.dart
Comment thread script/tool/test/common/repository_package_test.dart Outdated
Comment thread script/tool/lib/src/analyze_command.dart
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
@reidbaker reidbaker requested a review from stuartmorgan-g June 22, 2026 20:36
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant