Repository navigation
DRAFT: Convert dart-collect-coverage skill into a deterministic script - #20
prolificcoder wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
The original skill relied on an LLM to re-derive project topology (Dart vs. Flutter, pub workspace membership, dev-dep state) on every run. Move those mechanical decisions into collect_coverage.sh so they become reproducible and exit-code-checkable. The script: - detects Dart vs. Flutter from pubspec.yaml - detects pub workspaces and enumerates member test/ directories - adds 'coverage' to dev_dependencies idempotently - runs coverage:test_with_coverage (or the manual VM-service flow via --manual) and always passes --check-ignore - validates that coverage/coverage.json and coverage/lcov.info exist and are non-empty, with distinct exit codes per failure mode - emits coverage/summary.txt with per-file line coverage so the remaining judgment step (write tests vs. add ignore directive) operates on structured input SKILL.md is rewritten to delegate to the script and to scope the remaining LLM/human judgment to coverage-gap remediation, which is the only step that genuinely requires a design decision.
36f857f to
29b9b98
Compare
|
Take a look at I discontinued this in favor of this official one, but I liked mine more. We don't NEED This is helpful for the agent to hydrate the output from (It's also pure dart, so it'll work on Windows 😄 ) Wanna run with these ideas @prolificcoder ?? |
Summary
The
dart-collect-coverageskill is currently prose that asks an LLM to re-derive project topology (Dart vs. Flutter, pub-workspace membership, whethercoverageis already a dev_dependency, which test directories to pass) on every invocation. Those decisions are purely mechanical, so this PR moves them into a self-contained shell script and rewritesSKILL.mdto delegate to it. Only the genuinely-judgment step — uncovered file: write a test or add an ignore directive? — is left to the LLM/human reviewer.What's new
skills/dart-collect-coverage/collect_coverage.sh— pure bash + awk, no extra dependencies. Detects project type, handles pub workspaces, idempotently adds the dev dep, runscoverage:test_with_coverage(or the manual VM-service flow via--manual), always passes--check-ignore, validates outputs, and emitscoverage/summary.txtwith per-file line coverage sorted ascending.skills/dart-collect-coverage/SKILL.md— rewritten to point at the script, explain which decisions are now deterministic, and scope the remaining LLM/human judgment to coverage-gap remediation.Determinism gains
awkonpubspec.yamlforflutter:underdependencies:workspace:list, builds the-- <dirs>arg automaticallypub adddev_dependencies:block first--check-ignoreflag[[ -s file ]]with distinct exit codes (1/2/3)--manualis opt-intrapkills the test PID on exitWhat still needs judgment (intentionally)
Deciding, per uncovered file, between write a test, add
// coverage:ignore-file, or acceptable gap is a design call, not a mechanical one. The script surfaces those files incoverage/summary.txtand stderr so the reviewer operates on structured input.Testing
bash -n collect_coverage.shpasses.coverageindev_dependenciesskipspub add.0success,1not a Dart project,2collection failed,3outputs missing/empty.Happy to iterate on naming, on whether the script should live next to
SKILL.mdor under a sharedbin/, or on adding an--auto-ignore-generatedflag for*.g.dart/*.freezed.dart/*.mocks.dart.