$npx -y skills add flutter/agent-plugins --skill dart-skills-lint-integrationHow to integrate, update, and configure the dart_skills_lint validation tool within a repository. Make sure to use this skill whenever the user asks to update dart_skills_lint, configure skills validation tests, fix skills linter dependency drifts, verify repository state before
| 1 | # Integrating and Configuring dart_skills_lint |
| 2 | |
| 3 | Use this skill to verify repository state, update pinned references, manage |
| 4 | centralized configurations, implement efficient validation test suites, and |
| 5 | output clean pull request commands for `dart_skills_lint`. |
| 6 | |
| 7 | ## Pre-Flight Repository Verification |
| 8 | |
| 9 | Before initiating any modifications or executing dependency updates, ensure |
| 10 | the repository is in a clean, safe state: |
| 11 | |
| 12 | 1. Run `git status` to confirm the repository has no active work in progress. |
| 13 | 2. If clean, check out the primary tracking branch (e.g., `main` or `master`). |
| 14 | 3. Fast-forward update from the remote owned by the authoritative org. |
| 15 | 4. If post-checkout hooks report engine updates, run necessary sync utilities |
| 16 | (such as `gclient sync`) to guarantee consistency before proceeding. |
| 17 | |
| 18 | ## Dependency Management Workflow |
| 19 | |
| 20 | When updating `dart_skills_lint` within a workspace or standalone project: |
| 21 | |
| 22 | 1. Locate the target `pubspec.yaml` defining the dependency. |
| 23 | 2. Update the pinned Git commit reference directly in the `ref` field. |
| 24 | 3. Synchronize the lockfile natively using the environment's package manager. |
| 25 | |
| 26 | ### Example: Pinned Git Dependency |
| 27 | ```yaml |
| 28 | dart_skills_lint: |
| 29 | git: |
| 30 | url: https://github.com/flutter/skills |
| 31 | path: tool/dart_skills_lint |
| 32 | ref: e4497873950727ee781fa411c1a2f624b1ec50c6 |
| 33 | ``` |
| 34 | |
| 35 | ## Centralized Configuration Schema |
| 36 | |
| 37 | Configure rules and target paths globally via `dart_skills_lint.yaml`. Always |
| 38 | define paths relative to the repository root execution context. Ensure that |
| 39 | rules at the directory level are properly oriented within a nested `rules` map. |
| 40 | |
| 41 | ### Standard Schema Implementation |
| 42 | ```yaml |
| 43 | dart_skills_lint: |
| 44 | rules: |
| 45 | check-relative-paths: error |
| 46 | check-absolute-paths: error |
| 47 | check-trailing-whitespace: error |
| 48 | directories: |
| 49 | - path: ".agents/skills" |
| 50 | ``` |
| 51 | |
| 52 | ## Validation Test Implementation Patterns |
| 53 | |
| 54 | To centralize rule management, load `Configuration` dynamically via |
| 55 | `ConfigParser.loadConfig` and supply it to `validateSkills`. |
| 56 | |
| 57 | If test suites execute under simple environments with stable execution roots, |
| 58 | omit the `skillDirPaths` parameter entirely to natively inherit target paths |
| 59 | defined within the YAML configuration. |
| 60 | |
| 61 | **Absolute Isolation Pattern**: If test harnesses manipulate runtime |
| 62 | execution working directories (such as CI frameworks running tests inside |
| 63 | sub-package folders), guarantee path resilience by resolving configuration |
| 64 | files absolutely using dynamic directory contexts (e.g., `repoRoot.path`). |
| 65 | Explicitly inject absolute `skillDirPaths` targeting; global rules defined |
| 66 | under `rules:` map unconditionally regardless of explicit target path usage. |
| 67 | |
| 68 | When updating an existing validation block, explicitly audit any adjacent |
| 69 | `TODO` or tracker comments. If the comment describes refactoring config |
| 70 | loading or references issues resolved by this update, delete the comment |
| 71 | block entirely. |
| 72 | |
| 73 | ### Core Validation Workflow |
| 74 | ```dart |
| 75 | import 'package:path/path.dart' as path; |
| 76 | import 'package:dart_skills_lint/dart_skills_lint.dart'; |
| 77 | |
| 78 | const String _configFileName = 'dart_skills_lint.yaml'; |
| 79 | |
| 80 | test('Validate Repository Skills', () async { |
| 81 | // Use dynamic absolute resolution references to guarantee CI stability |
| 82 | final Configuration config = await ConfigParser.loadConfig( |
| 83 | path: path.join(repoRoot.path, 'path', 'to', _configFileName), |
| 84 | ); |
| 85 | expect( |
| 86 | config.directoryConfigs, |
| 87 | isNotEmpty, |
| 88 | reason: 'Configuration directoryConfigs should not be empty.', |
| 89 | ); |
| 90 | final bool isValid = await validateSkills( |
| 91 | skillDirPaths: [skillsDirectory], // Explicit absolute targeting |
| 92 | config: config, |
| 93 | ); |
| 94 | expect(isValid, isTrue); |
| 95 | }); |
| 96 | ``` |
| 97 | |
| 98 | ### Eliminating Duplicate Overhead in Secondary Blocks |
| 99 | |
| 100 | Secondary test blocks enforcing specialized custom rules without loading the |
| 101 | shared configuration must supply target paths explicitly. To prevent |
| 102 | duplicate execution overhead, explicitly map all default registered |
| 103 | built-in rules to `AnalysisSeverity.disabled`. |
| 104 | |
| 105 | ```dart |
| 106 | test('Custom Rule Validation', () async { |
| 107 | final bool isValid = await validateSkills( |
| 108 | skillDirPaths: ['path/to/skills'], |
| 109 | customRules: [MyCustomRule()], |
| 110 | resolvedRuleConfigs: { |
| 111 | 'check-absolute-paths': const RuleConfigPatch(severity: AnalysisSeverity.disabled), |
| 112 | 'check-relative-paths': const RuleConfigPatch(severity: AnalysisSeverity.disabled), |
| 113 | 'check-trailing-whitespace': const RuleConfigPatch(severity: AnalysisSeverity.disabled), |
| 114 | 'description-too-long': const RuleConfigPatch(severity: AnalysisSeverity.disabled), |
| 115 | 'disallowed-field': const RuleConfigP |