Commit Graph

261 Commits

Author SHA1 Message Date
John Ryan 5ae9599f46 Merge remote-tracking branch 'origin/update-skill-table' into update-skill-table 2026-05-04 14:54:28 -07:00
John Ryan 7fbc719ece Run dart format 2026-05-04 14:54:20 -07:00
John Ryan 04fc7d1fda Update tool/generator/lib/src/commands/update_readme_command.dart
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-04 14:50:39 -07:00
John Ryan e68363eb00 Update README 2026-05-04 14:44:50 -07:00
John Ryan 6282062457 Update example prompts 2026-05-04 14:42:16 -07:00
John Ryan acda860129 Update tool to support example prompts 2026-05-04 14:31:58 -07:00
Reid Baker a21342dc41 Merge pull request #115 from flutter/i114-perf-bench-2026-05-04
Add baseline-throughput benchmark for dart_skills_lint
2026-05-04 15:52:07 -04:00
Reid Baker 6594115f56 Replace _Row class with a record typedef
The dart_code_linter `prefer-match-file-name` rule fires on Windows
when a file declares a class whose name (after snake_case conversion)
doesn't match the file's basename. The previous `_Row` class triggered
that rule on the Windows analyze_and_test job, even though macOS and
Linux passed clean.

Convert `_Row` to `typedef _BenchResult = (...)`, a record. Typedefs
aren't class declarations, so the rule has nothing to flag, and the
record literal at the return site is just as terse as the old
constructor call.
2026-05-04 15:29:44 -04:00
Reid Baker b366f20ffe Address PR review on benchmark script
- Fix stale doc comment that pointed at CONTRIBUTING.md; the docs live in
  bench/README.md.
- Wrap arg parsing (including int.parse calls and the main loop) in a
  single FormatException try/catch, and validate that --runs >= 1 and
  --warmup >= 0 so bad input produces a clear message instead of a
  crash. _parseSizes now reports unparseable or non-positive entries
  with a specific message and rejects an empty list.
- Use p.absolute('synthetic-abs-path') for the errors-per-skill=3
  link rather than the hardcoded POSIX path '/etc/hosts', so the
  benchmark's absolute-paths rule trigger works the same way on
  Windows as on Linux/macOS.

Verified 3 distinct baseline entries are recorded when
--errors-per-skill 3 (check-absolute-paths, description-too-long,
invalid-skill-name).
2026-05-04 15:22:56 -04:00
Reid Baker d8bc6527f1 Add baseline-throughput benchmark for dart_skills_lint
Adds tool/dart_skills_lint/bench/baseline_throughput.dart, a standalone
script that calls validateSkills(generateBaseline: true) in-process
across synthetic skill sizes and prints a wall-clock table. Documents
its usage in tool/dart_skills_lint/bench/README.md.

The benchmark is local-only (not wired into CI) since wall-clock on
hosted runners is too noisy to enforce.

Fixes #114
2026-05-04 15:22:49 -04:00
Reid Baker d9befc4b21 Merge pull request #113 from reidbaker/refactor/extract-validation-session
Refactor: extract ValidationSession from entry_point.dart
2026-05-04 14:45:05 -04:00
Reid Baker 93c770b1c4 Address PR review: simplify export, drop temporal doc references
Two pieces of feedback from the maintainer:

1. entry_point.dart: collapse the explicit `export ... show <list>;` to
   a plain `export 'validation_session.dart';`. There are no name
   conflicts to disambiguate, so the show clause was just noise.

2. validation_session.dart: rewrite three doc comments that compared
   the new behavior to the "original CLI semantics" or "legacy
   _generateBaselineFile". Such comparisons go stale as the code
   evolves. Describe current behavior directly:
   - processIndividualSkill: drop "(matches the original CLI
     semantics)"
   - processSkillRoot: same
   - _saveBaseline: replace "match the legacy _generateBaselineFile
     behavior" with a direct statement of what the method does

Verified locally:
- dart format --output=none --set-exit-if-changed . exits 0
- dart analyze --fatal-infos clean
- dart run dart_code_linter:metrics analyze lib reports no issues
- dart test: all 110 tests pass
2026-05-04 14:23:15 -04:00
Reid Baker 55f305b85a Fix CI: format + prefer-moving-to-variable lint
CI on PR #113 surfaced two issues my local analyze missed:

1. dart format reported lib/src/validation_session.dart needed
   reformatting. Apply it.

2. dart_code_linter:metrics (the cyclomatic-complexity check that
   runs on Linux/macOS, and which Windows surfaces via
   `dart analyze --fatal-infos` because it's wired through
   analysis_options.yaml) flagged the inner loop in _applyIgnores
   for repeated `pair.entry.*` access. Hoist `pair.entry` to a
   local IgnoreEntry inside the loop.

Verified locally:
- dart format --output=none --set-exit-if-changed . exits 0
- dart run dart_code_linter:metrics analyze lib reports no issues
- dart analyze --fatal-infos clean
- dart test: all 110 tests pass
2026-05-04 14:04:09 -04:00
Reid Baker 2a193692d2 Address gemini-code-assist feedback on PR #113
Three review comments from the gemini-code-assist bot, all in
validation_session.dart:

1. (HIGH) generateBaseline did O(N^2) I/O — _generateBaselineFile
   read+modified+wrote the entire ignore JSON per skill. Restructured
   so processSkillRoot / processIndividualSkill load the SkillsIgnores
   once, mutate it in memory across all skills via the new
   _updateBaselineForSkill helper, and write it once at the end via
   the new _saveBaseline helper.

2. (MED) _resolveRulesForPath / _resolveIgnoreFile re-normalized every
   directoryConfig path on every call. Pre-normalize once in the
   constructor's initializer list and store as
   _normalizedDirectoryConfigs.

3. (MED) _applyIgnores re-normalized paths inside its nested loop.
   Pre-normalize the ignore filenames once at the top of the call,
   and hoist p.normalize(error.file) outside the inner loop.

Behavior preserved exactly; baseline file contents on disk are
identical to the pre-fix output. Only the timing and number of writes
change. All 110 existing tests pass; analyzer clean with --fatal-infos.
2026-05-04 13:56:20 -04:00
Reid Baker 48ce54ad7e Refactor: extract ValidationSession from entry_point.dart
entry_point.dart had grown to ~900 lines, mixing CLI argument parsing,
config loading, and the per-skill validation workflow. The two processors
(_processSkillPaths and _processSkillDirectories) duplicated significant
per-root setup, ignore loading, and stale-ignore reporting.

Extract a new ValidationSession class that owns per-invocation state
(config, resolved rules, customRules, flags, anyFailed/anySkillsValidated)
and exposes processIndividualSkill / processSkillRoot / reportNoSkillsValidated.
entry_point.dart drops to ~360 lines and becomes a thin orchestrator.

Behavior preserved exactly:
- Original fast-fail semantics: missing-directory errors contribute to
  anyFailed but don't trigger fast-fail in their own iteration; only
  validation failures do. The session methods return bool keepGoing to
  signal this to the caller.
- Public test-visible constants (skillIsValidMsg, evaluatingDirMsg, etc.)
  moved to validation_session.dart and re-exported from entry_point.dart
  via `export ... show` so test imports keep working unchanged.
- defaultIgnoreFileName loses its @visibleForTesting annotation: it's
  used in the --generate-baseline help text in production code, so the
  original annotation was a mis-application that the move exposed.

Verified:
- dart analyze --fatal-infos reports no issues
- dart test passes all 110 tests, including the fast-fail integration test
  and all fixer tests
- dart run bin/cli.dart --skills-directory ../../skills validates all 10
  Flutter skills cleanly
2026-05-04 13:56:20 -04:00
Reid Baker bac501bec8 Merge pull request #106 from reidbaker/i96-complexity-linting-fix-2026-05-1
Fix complexity exceptions
2026-05-04 13:27:18 -04:00
Reid Baker b85d538b94 Merge pull request #106 from reidbaker/i96-complexity-linting-fix-2026-05-1
Fix complexity exceptions
2026-05-01 19:54:21 -04:00
Reid Baker 550db5fc2d More rules and their fixes 2026-05-01 19:43:24 -04:00
Reid Baker 379a4babaf Catch lifecycle issue where ignore for indivdiual skills would not be read on next run 2026-05-01 19:34:18 -04:00
Reid Baker 201e87bd92 remove stale ignore entries 2026-05-01 19:26:34 -04:00
Reid Baker e43372f0a9 Enforce the new rules 2026-05-01 19:20:24 -04:00
Reid Baker 8d1fe87d89 Add rules for agents 2026-05-01 19:04:38 -04:00
Reid Baker 6d101e8b9b update definition of done to include the new linter 2026-05-01 18:58:00 -04:00
Reid Baker b901ba9d2a Reduce code complexity 2026-05-01 18:56:09 -04:00
Reid Baker 7d8c071c3a Merge pull request #105 from flutter/i96-complexity-linting-inital
Add cyclomatic complexity linting to dart_skills_lint codebase
2026-05-01 18:31:15 -04:00
Reid Baker 829557ca81 Delete pubspec.lock 2026-05-01 18:18:40 -04:00
Reid Baker a21ed42c99 Add cyclomatic complexity linting to dart_skills_lint codebase 2026-05-01 18:06:01 -04:00
Reid Baker b7cb63a91f Merge pull request #104 from reidbaker/r-dart-code-support-2026-05-01
Update skills for better contibuting documentation
2026-05-01 16:41:50 -04:00
Reid Baker 094ec81c98 Revert "Add skill rule for validating dart code blocks"
This reverts commit b32ae3ba89.
2026-05-01 16:32:04 -04:00
Reid Baker b058d9db85 Revert "Fix a dart validation error in one of our skills"
This reverts commit c4453e0765.
2026-05-01 16:32:01 -04:00
Reid Baker c4453e0765 Fix a dart validation error in one of our skills 2026-05-01 15:40:20 -04:00
Reid Baker b32ae3ba89 Add skill rule for validating dart code blocks 2026-05-01 15:25:32 -04:00
Reid Baker 1f51f75df6 Add definition of done rule and update new SkillRule command to handle interactions with on disk commands 2026-05-01 15:24:43 -04:00
Reid Baker 8269a3a7f4 Check in updates to dart-test-coverage 2026-05-01 14:44:25 -04:00
John "codefu" McDole d03dba1345 feat: pubworkspace this repository (#103)
One place to run "flutter pub get".

Brings up the lower end dart to ^3.10.8, upgrades lints and packages.
Removes lock files.
Fixes formatting for new lower bounds.
2026-05-01 11:26:10 -07:00
John Ryan 06d095dfd1 Merge pull request #102 from flutter/remove-a11y-skill
Remove a11y skill
2026-04-29 16:02:26 -07:00
John Ryan a40929a876 Remove a11y skill 2026-04-29 14:53:33 -07:00
John Ryan 6420b6a8f4 Merge pull request #99 from flutter/mariamhas_readme_updates
Update README.md
2026-04-29 09:05:07 -07:00
John Ryan 4da8cb120c Remove duplicate skills addition command
Removed redundant command for adding skills.
2026-04-29 09:04:51 -07:00
John Ryan 0bfb817157 Merge branch 'main' into mariamhas_readme_updates 2026-04-29 09:04:15 -07:00
John Ryan 2b37d2c100 Merge pull request #97 from flutter/johnpryan-patch-1
update npx command instructions
2026-04-29 09:03:47 -07:00
John Ryan 2dc99f5717 Update installation instructions in README
Clarified installation command for skills.
2026-04-29 09:03:37 -07:00
John Ryan 27d4691de8 Merge branch 'main' into mariamhas_readme_updates 2026-04-29 09:03:03 -07:00
John Ryan bbf403a93c Merge pull request #98 from flutter/johnpryan-patch-2
Update README with link to Dart skills
2026-04-29 09:02:16 -07:00
John Ryan 9c5db41e93 Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-04-29 09:01:53 -07:00
Mariam Hasnany 3f1a8cdca4 Update README.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-04-28 15:31:12 -07:00
Mariam Hasnany 47dec9d694 Update CONTRIBUTING.md
updating with more details on filing issues/requesting skills
2026-04-28 15:30:21 -07:00
Mariam Hasnany 4366e1f873 Update README.md
update description, added more installation options  and contribution
2026-04-28 15:15:04 -07:00
Mariam Hasnany c3269fa2ba Update CONTRIBUTING.md 2026-04-28 14:50:38 -07:00
John Ryan da08a96345 Update installation command for skills 2026-04-28 14:15:56 -07:00