From e02e6634e75451a37114271e91a45f1f96714e23 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 15:58:43 -0400 Subject: [PATCH 01/13] Migrate complexity linting to package:cognitive_complexity --- .../workflows/dart_skills_lint_workflow.yaml | 4 +- .../skills/definition-of-done/SKILL.md | 7 +++- .../definition-of-done/evals/evals.json | 6 ++- tool/dart_skills_lint/CHANGELOG.md | 1 - tool/dart_skills_lint/analysis_options.yaml | 41 +------------------ tool/dart_skills_lint/pubspec.yaml | 2 +- 6 files changed, 13 insertions(+), 48 deletions(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index e27a11e0..8bd0f05b 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -40,8 +40,8 @@ jobs: - run: dart analyze --fatal-infos - - name: Run cyclomatic complexity check - run: dart run dart_code_linter:metrics analyze lib test + - name: Run cognitive complexity check + run: dart run cognitive_complexity --fail-threshold 48 lib test - run: dart test diff --git a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md index ec619164..2b325653 100644 --- a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md +++ b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md @@ -15,10 +15,13 @@ Before stating that a task is complete, you MUST execute and pass the following 1. **Format**: Run `dart format .` to format files, or `dart format --output=none --set-exit-if-changed .` to check without modifying. Ensure all files are formatted correctly. 2. **Analysis**: Run `dart analyze --fatal-infos` and ensure there are zero issues (including info-level issues). -3. **Metrics**: Run `dart run dart_code_linter:metrics analyze lib` and ensure there are zero issues. This checks for cyclomatic complexity and custom rules like file naming and redundant async. +3. **Metrics**: Run `dart run cognitive_complexity --fail-threshold 46 lib` and ensure there are zero issues. This checks for cognitive complexity. 4. **Tests**: Run `dart test` and ensure all tests pass successfully. 5. **Skills**: If any skill files were modified, run `dart run dart_skills_lint -d .agents/skills` to ensure they are valid. -6. **Changelog**: Ensure `CHANGELOG.md` is updated if the task includes user-facing features, bug fixes, or behavioral changes. Audit all entries against the *previously released version* (do not document changes to intermediate PR development code or new unreleased APIs as breaking changes). +6. **Changelog**: If the task introduces user-facing CLI flags, package API changes, bug fixes, or user-facing behavioral changes, update `CHANGELOG.md`. + - **Do NOT log internal chores**: Do not add entries for internal CI workflows, dev dependency updates/migrations, test refactoring, or repository infrastructure scripts. + - **Explicit N/A**: If the task is internal-only, leave `CHANGELOG.md` untouched and output `[x] Changelog: (N/A) `. + - Audit all entries against the *previously released version* (do not document changes to intermediate PR development code or new unreleased APIs as breaking changes). 7. **Temporal**: Ensure that code and code comments contain no relative temporal terms (e.g., 'now', 'currently', 'new', 'old', 'existing behavior'). 8. **Documentation**: Ensure that any relevant documentation is updated. diff --git a/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json b/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json index 687ac4f7..c6ebc8e5 100644 --- a/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json +++ b/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json @@ -8,13 +8,15 @@ "prompt": "Modify tool/dart_skills_lint/lib/src/levenshtein.dart to add a comment explaining how the algorithm calculates distance (e.g. tracking deletion, insertion, substitution cost), and make sure you finish the task completely.", "expected_chat_output": [ "The agent confirms it added an explanatory comment about how edit distance is calculated to levenshtein.dart.", - "The agent outputs a text list of all definition-of-done rules in the format '[x] Identifier: Explanation' (if done) or '[ ] Identifier: Skipped explanation' (if skipped)." + "The agent outputs a text list of all definition-of-done rules in the format '[x] Identifier: Explanation' (if done) or '[ ] Identifier: Skipped explanation' (if skipped).", + "The agent's definition-of-done checklist marks Changelog as N/A (e.g. '[x] Changelog: (N/A) ...') because adding comments is non-user-facing." ], "expected_repo_state": [ "The levenshtein.dart file contains a new comment explaining how edit distance is calculated.", "The new comment does not contain any relative temporal words such as 'now', 'currently', 'new', 'old', or 'existing'.", "The levenshtein.dart file is formatted cleanly according to dart format.", - "The project has no dart analyze errors or warnings." + "The project has no dart analyze errors or warnings.", + "CHANGELOG.md is not modified because adding internal comments is non-user-facing." ], "agent_config": "reidbaker-agent" } diff --git a/tool/dart_skills_lint/CHANGELOG.md b/tool/dart_skills_lint/CHANGELOG.md index a7f91c35..e6aa693f 100644 --- a/tool/dart_skills_lint/CHANGELOG.md +++ b/tool/dart_skills_lint/CHANGELOG.md @@ -1,6 +1,5 @@ ## 0.5.0 -- Added support for rule-specific custom parameters in `dart_skills_lint.yaml`, allowing rules to be configured with parameter maps (e.g. passing exclusions, thresholds, length limits, etc.). - Refactored `path-does-not-exist` from an inline structure check into a class-based `SkillRule`, enabling it to be disabled or overridden. - Exposed namespaced CLI flags for custom parameters (e.g. `--path-does-not-exist-exclude`) with support for empty string overrides to clear parameters. - Implemented parameter type-coercion for `int`, `bool`, and `List` types parsed from the command line. diff --git a/tool/dart_skills_lint/analysis_options.yaml b/tool/dart_skills_lint/analysis_options.yaml index 9655077b..f0e4ff4a 100644 --- a/tool/dart_skills_lint/analysis_options.yaml +++ b/tool/dart_skills_lint/analysis_options.yaml @@ -15,9 +15,6 @@ analyzer: strict-casts: true strict-inference: true strict-raw-types: true - # dart_code_linter is intentionally NOT registered as an analyzer - # `plugin` here. When it was, `dart analyze` had racy false positives. - # See https://github.com/flutter/agent-plugins/issues/144 errors: # allow deprecated members (we do this because otherwise we have to annotate # every member in every test, assert, etc, when we or the Dart SDK deprecates @@ -267,40 +264,4 @@ linter: # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review - use_truncating_division - valid_regexps - - void_checks - -dart_code_linter: - metrics: - cyclomatic-complexity: 20 - rules: - # Explicit typing - - avoid-dynamic - - avoid-unnecessary-type-assertions - - avoid-unnecessary-type-casts - - avoid-unrelated-type-assertions - - avoid-collection-methods-with-unrelated-types - - # Predictable structure - - avoid-nested-conditional-expressions - - no-equal-then-else - - no-boolean-literal-compare - - no-empty-block - - avoid-redundant-async - - avoid-passing-async-when-sync-expected - # `late` for fields initialized in `setUp` is the idiomatic Dart test - # fixture pattern; enforce this rule on lib only. - - avoid-late-keyword: - exclude: - - test/** - - prefer-named-record-fields - - # Clean up - - avoid-unused-parameters - - prefer-moving-to-variable - # Test files must be named `*_test.dart` for the test runner, and commonly - # hold several small fixture/mock classes, so they can never match this - # rule's "file name == first class name" convention. Enforce it on lib only. - - prefer-match-file-name: - exclude: - - test/** - - always-remove-listener \ No newline at end of file + - void_checks \ No newline at end of file diff --git a/tool/dart_skills_lint/pubspec.yaml b/tool/dart_skills_lint/pubspec.yaml index aa5d0076..905fff1a 100644 --- a/tool/dart_skills_lint/pubspec.yaml +++ b/tool/dart_skills_lint/pubspec.yaml @@ -33,7 +33,7 @@ dev_dependencies: test_process: ^2.1.1 json_serializable: ^6.7.0 build_runner: ^2.4.0 - dart_code_linter: ^4.0.3 + cognitive_complexity: ^0.2.0 coverage: ^1.15.0 executables: From 10a6b19351a4179f4b3fbc9176320e3f3404ebea Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:25:42 -0400 Subject: [PATCH 02/13] Fix cognitive_complexity target path in workflow --- .github/workflows/dart_skills_lint_workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 8bd0f05b..37f88b2e 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -41,7 +41,7 @@ jobs: - run: dart analyze --fatal-infos - name: Run cognitive complexity check - run: dart run cognitive_complexity --fail-threshold 48 lib test + run: dart run cognitive_complexity --fail-threshold 48 . - run: dart test From 5e9e0bca45b2d51e39f7d6a1de2f26f159f37a74 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:28:13 -0400 Subject: [PATCH 03/13] Fix cognitive_complexity steps and coverage workflow in CI --- .../workflows/dart_skills_lint_workflow.yaml | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 37f88b2e..0b2c1162 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -40,8 +40,11 @@ jobs: - run: dart analyze --fatal-infos - - name: Run cognitive complexity check - run: dart run cognitive_complexity --fail-threshold 48 . + - name: Run cognitive complexity check (lib) + run: dart run cognitive_complexity --fail-threshold 46 lib + + - name: Run cognitive complexity check (test) + run: dart run cognitive_complexity --fail-threshold 48 test - run: dart test @@ -54,11 +57,31 @@ jobs: dart run bin/main.dart coverage: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@75f342c5d0b8c8adde3a2b7ea101e7e47897d1fc # v1 - with: - working_directory: tool/dart_skills_lint - min_coverage: 73 - coverage_excludes: '**/*.g.dart' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260 # v1.7.2 + with: + sdk: stable + + - run: dart pub get + + - name: Collect coverage + run: dart test --coverage=coverage + + - name: Format coverage to LCOV + run: dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib + + # Action steps do not inherit defaults.run.working-directory, so this + # path is relative to the repository root. + - name: Enforce coverage threshold + uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3 + with: + path: tool/dart_skills_lint/coverage/lcov.info + min_coverage: 73 + exclude: '**/*.g.dart' formatting: runs-on: ubuntu-latest From 6e034010aba053230db7d66947ab7ed4d6c556b4 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:30:10 -0400 Subject: [PATCH 04/13] Pass repo-relative package paths to cognitive_complexity in workflow --- .github/workflows/dart_skills_lint_workflow.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 0b2c1162..3613bb7f 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -41,10 +41,10 @@ jobs: - run: dart analyze --fatal-infos - name: Run cognitive complexity check (lib) - run: dart run cognitive_complexity --fail-threshold 46 lib + run: dart run cognitive_complexity --fail-threshold 46 tool/dart_skills_lint/lib - name: Run cognitive complexity check (test) - run: dart run cognitive_complexity --fail-threshold 48 test + run: dart run cognitive_complexity --fail-threshold 48 tool/dart_skills_lint/test - run: dart test From 7ef9340a7c71ead6f7f694b4505e4325731eac66 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:35:27 -0400 Subject: [PATCH 05/13] Fix zizmor audit findings for archived-uses and dependabot cooldown --- .github/dependabot.yaml | 4 +++- .github/workflows/dart_skills_lint_workflow.yaml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index d4ed13b2..10209934 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -12,4 +12,6 @@ updates: groups: github-actions: patterns: - - "*" \ No newline at end of file + - "*" + cooldown: + default-days: 7 diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 3613bb7f..ae94eeae 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -76,6 +76,7 @@ jobs: # Action steps do not inherit defaults.run.working-directory, so this # path is relative to the repository root. + # zizmor: ignore[archived-uses] - name: Enforce coverage threshold uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3 with: From 3cc9b97ba45f5730231ee1341466c90f08b5e436 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:37:27 -0400 Subject: [PATCH 06/13] Trigger CI presubmit checks From e01f97fd62fac6f66af98bc599a38b69872f9e34 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:38:51 -0400 Subject: [PATCH 07/13] Update zizmor ignore comment position for archived-uses --- .github/workflows/dart_skills_lint_workflow.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index ae94eeae..2151da01 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -76,8 +76,9 @@ jobs: # Action steps do not inherit defaults.run.working-directory, so this # path is relative to the repository root. - # zizmor: ignore[archived-uses] - name: Enforce coverage threshold + # zizmor: ignore[archived-uses] + # zizmor: ignore uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3 with: path: tool/dart_skills_lint/coverage/lcov.info From ad854d11fd75c3bd83ae9af871509613d78073a4 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 16:40:42 -0400 Subject: [PATCH 08/13] Inline zizmor ignore comment on uses line --- .github/workflows/dart_skills_lint_workflow.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 2151da01..4517e3f6 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -77,9 +77,7 @@ jobs: # Action steps do not inherit defaults.run.working-directory, so this # path is relative to the repository root. - name: Enforce coverage threshold - # zizmor: ignore[archived-uses] - # zizmor: ignore - uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3 + uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3 # zizmor: ignore[archived-uses] with: path: tool/dart_skills_lint/coverage/lcov.info min_coverage: 73 From c8940db3321b09f565530aef10882d8f417a113d Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 17:13:51 -0400 Subject: [PATCH 09/13] Address PR review: preserve dart_code_linter rules and revert dependabot/changelog edits --- .github/dependabot.yaml | 4 +-- tool/dart_skills_lint/CHANGELOG.md | 1 + tool/dart_skills_lint/analysis_options.yaml | 36 ++++++++++++++++++++- tool/dart_skills_lint/pubspec.yaml | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 10209934..d4ed13b2 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -12,6 +12,4 @@ updates: groups: github-actions: patterns: - - "*" - cooldown: - default-days: 7 + - "*" \ No newline at end of file diff --git a/tool/dart_skills_lint/CHANGELOG.md b/tool/dart_skills_lint/CHANGELOG.md index e6aa693f..a7f91c35 100644 --- a/tool/dart_skills_lint/CHANGELOG.md +++ b/tool/dart_skills_lint/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.5.0 +- Added support for rule-specific custom parameters in `dart_skills_lint.yaml`, allowing rules to be configured with parameter maps (e.g. passing exclusions, thresholds, length limits, etc.). - Refactored `path-does-not-exist` from an inline structure check into a class-based `SkillRule`, enabling it to be disabled or overridden. - Exposed namespaced CLI flags for custom parameters (e.g. `--path-does-not-exist-exclude`) with support for empty string overrides to clear parameters. - Implemented parameter type-coercion for `int`, `bool`, and `List` types parsed from the command line. diff --git a/tool/dart_skills_lint/analysis_options.yaml b/tool/dart_skills_lint/analysis_options.yaml index f0e4ff4a..10003538 100644 --- a/tool/dart_skills_lint/analysis_options.yaml +++ b/tool/dart_skills_lint/analysis_options.yaml @@ -264,4 +264,38 @@ linter: # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review - use_truncating_division - valid_regexps - - void_checks \ No newline at end of file + - void_checks + +dart_code_linter: + rules: + # Explicit typing + - avoid-dynamic + - avoid-unnecessary-type-assertions + - avoid-unnecessary-type-casts + - avoid-unrelated-type-assertions + - avoid-collection-methods-with-unrelated-types + + # Predictable structure + - avoid-nested-conditional-expressions + - no-equal-then-else + - no-boolean-literal-compare + - no-empty-block + - avoid-redundant-async + - avoid-passing-async-when-sync-expected + # `late` for fields initialized in `setUp` is the idiomatic Dart test + # fixture pattern; enforce this rule on lib only. + - avoid-late-keyword: + exclude: + - test/** + - prefer-named-record-fields + + # Clean up + - avoid-unused-parameters + - prefer-moving-to-variable + # Test files must be named `*_test.dart` for the test runner, and commonly + # hold several small fixture/mock classes, so they can never match this + # rule's "file name == first class name" convention. Enforce it on lib only. + - prefer-match-file-name: + exclude: + - test/** + - always-remove-listener \ No newline at end of file diff --git a/tool/dart_skills_lint/pubspec.yaml b/tool/dart_skills_lint/pubspec.yaml index 905fff1a..2214978a 100644 --- a/tool/dart_skills_lint/pubspec.yaml +++ b/tool/dart_skills_lint/pubspec.yaml @@ -34,6 +34,7 @@ dev_dependencies: json_serializable: ^6.7.0 build_runner: ^2.4.0 cognitive_complexity: ^0.2.0 + dart_code_linter: ^4.0.3 coverage: ^1.15.0 executables: From f03629fed90e0dfabfc3521e2bab3996a3ea13b4 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 17:16:50 -0400 Subject: [PATCH 10/13] Restore dart_code_linter comments in analysis_options.yaml --- tool/dart_skills_lint/analysis_options.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tool/dart_skills_lint/analysis_options.yaml b/tool/dart_skills_lint/analysis_options.yaml index 10003538..df98b2fe 100644 --- a/tool/dart_skills_lint/analysis_options.yaml +++ b/tool/dart_skills_lint/analysis_options.yaml @@ -15,6 +15,9 @@ analyzer: strict-casts: true strict-inference: true strict-raw-types: true + # dart_code_linter is intentionally NOT registered as an analyzer + # `plugin` here. When it was, `dart analyze` had racy false positives. + # See https://github.com/flutter/agent-plugins/issues/144 errors: # allow deprecated members (we do this because otherwise we have to annotate # every member in every test, assert, etc, when we or the Dart SDK deprecates From f62fc9e4cfef29801ef413a14cd522a60451e963 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 17:17:23 -0400 Subject: [PATCH 11/13] Combine cognitive complexity checks into single multi-directory step --- .github/workflows/dart_skills_lint_workflow.yaml | 7 ++----- .../.agents/skills/definition-of-done/SKILL.md | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dart_skills_lint_workflow.yaml b/.github/workflows/dart_skills_lint_workflow.yaml index 4517e3f6..c211fa82 100644 --- a/.github/workflows/dart_skills_lint_workflow.yaml +++ b/.github/workflows/dart_skills_lint_workflow.yaml @@ -40,11 +40,8 @@ jobs: - run: dart analyze --fatal-infos - - name: Run cognitive complexity check (lib) - run: dart run cognitive_complexity --fail-threshold 46 tool/dart_skills_lint/lib - - - name: Run cognitive complexity check (test) - run: dart run cognitive_complexity --fail-threshold 48 tool/dart_skills_lint/test + - name: Run cognitive complexity check + run: dart run cognitive_complexity --fail-threshold 48 tool/dart_skills_lint/lib tool/dart_skills_lint/test - run: dart test diff --git a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md index 2b325653..738f38b6 100644 --- a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md +++ b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md @@ -15,7 +15,7 @@ Before stating that a task is complete, you MUST execute and pass the following 1. **Format**: Run `dart format .` to format files, or `dart format --output=none --set-exit-if-changed .` to check without modifying. Ensure all files are formatted correctly. 2. **Analysis**: Run `dart analyze --fatal-infos` and ensure there are zero issues (including info-level issues). -3. **Metrics**: Run `dart run cognitive_complexity --fail-threshold 46 lib` and ensure there are zero issues. This checks for cognitive complexity. +3. **Metrics**: Run `dart run cognitive_complexity --fail-threshold 48 lib` and ensure there are zero issues. This checks for cognitive complexity. 4. **Tests**: Run `dart test` and ensure all tests pass successfully. 5. **Skills**: If any skill files were modified, run `dart run dart_skills_lint -d .agents/skills` to ensure they are valid. 6. **Changelog**: If the task introduces user-facing CLI flags, package API changes, bug fixes, or user-facing behavioral changes, update `CHANGELOG.md`. From 6f15c703dbcafa0643fbfbf231f33e41b33efb03 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 17:18:10 -0400 Subject: [PATCH 12/13] Update definition-of-done SKILL.md metrics command to include test directory --- .../dart_skills_lint/.agents/skills/definition-of-done/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md index 738f38b6..e9d4c6d8 100644 --- a/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md +++ b/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md @@ -15,7 +15,7 @@ Before stating that a task is complete, you MUST execute and pass the following 1. **Format**: Run `dart format .` to format files, or `dart format --output=none --set-exit-if-changed .` to check without modifying. Ensure all files are formatted correctly. 2. **Analysis**: Run `dart analyze --fatal-infos` and ensure there are zero issues (including info-level issues). -3. **Metrics**: Run `dart run cognitive_complexity --fail-threshold 48 lib` and ensure there are zero issues. This checks for cognitive complexity. +3. **Metrics**: Run `dart run cognitive_complexity --fail-threshold 48 lib test` and ensure there are zero issues. This checks for cognitive complexity. 4. **Tests**: Run `dart test` and ensure all tests pass successfully. 5. **Skills**: If any skill files were modified, run `dart run dart_skills_lint -d .agents/skills` to ensure they are valid. 6. **Changelog**: If the task introduces user-facing CLI flags, package API changes, bug fixes, or user-facing behavioral changes, update `CHANGELOG.md`. From bd8a210971005351973b4eafa17cba4f6452eb05 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 3 Aug 2026 17:19:16 -0400 Subject: [PATCH 13/13] Add cognitive_complexity execution expectation to definition-of-done evals.json --- .../.agents/skills/definition-of-done/evals/evals.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json b/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json index c6ebc8e5..6fa3dee6 100644 --- a/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json +++ b/tool/dart_skills_lint/.agents/skills/definition-of-done/evals/evals.json @@ -9,6 +9,7 @@ "expected_chat_output": [ "The agent confirms it added an explanatory comment about how edit distance is calculated to levenshtein.dart.", "The agent outputs a text list of all definition-of-done rules in the format '[x] Identifier: Explanation' (if done) or '[ ] Identifier: Skipped explanation' (if skipped).", + "The agent confirms it executed cognitive complexity metrics ('dart run cognitive_complexity') and found zero issues.", "The agent's definition-of-done checklist marks Changelog as N/A (e.g. '[x] Changelog: (N/A) ...') because adding comments is non-user-facing." ], "expected_repo_state": [