$npx -y skills add flutter/agent-plugins --skill dart-skills-lint-setupUse this skill when you need to set up validation for AI agent skills in a Dart project for the first time. Adds the linter as a dev_dependency, creates a configuration file, and generates a baseline for legacy repos.
| 1 | # Setting up Skill Validation with dart_skills_lint |
| 2 | |
| 3 | This skill covers **first-time wiring** of `dart_skills_lint` into a |
| 4 | repository. For ongoing use — running the linter, interpreting |
| 5 | output, and writing custom rules — see the |
| 6 | [`dart-skills-lint-validation`](../dart-skills-lint-validation/SKILL.md) |
| 7 | skill. For copy-pasteable CI workflow and pre-commit hook recipes, |
| 8 | see the [`Recipes` section of the README](../../README.md#recipes). |
| 9 | |
| 10 | ## Steps |
| 11 | |
| 12 | 1. **Add `dart_skills_lint` as a `dev_dependency`.** Prefer a git |
| 13 | dependency (the package isn't on pub.dev yet): |
| 14 | |
| 15 | ```yaml |
| 16 | dev_dependencies: |
| 17 | dart_skills_lint: |
| 18 | git: |
| 19 | url: https://github.com/flutter/agent-plugins.git |
| 20 | path: tool/dart_skills_lint |
| 21 | ``` |
| 22 | |
| 23 | **Isolate the dependency** in a `tool/` package when you can, |
| 24 | instead of putting it on the root `pubspec.yaml` — keeps the |
| 25 | linter's deps out of your runtime closure. If you must add it |
| 26 | to multiple `pubspec.yaml` files, ensure the `ref:` (commit |
| 27 | hash) is identical across all of them so resolution doesn't |
| 28 | diverge. |
| 29 | |
| 30 | 2. **Create `dart_skills_lint.yaml`** at the repository root so both |
| 31 | the CLI and any embedded test invocation share the same config: |
| 32 | |
| 33 | ```yaml |
| 34 | dart_skills_lint: |
| 35 | rules: |
| 36 | check-relative-paths: error |
| 37 | check-trailing-whitespace: error |
| 38 | directories: |
| 39 | - path: ".agents/skills" |
| 40 | ``` |
| 41 | |
| 42 | Rules enabled by default — `check-absolute-paths`, |
| 43 | `valid-yaml-metadata`, `invalid-skill-name`, |
| 44 | `description-too-long` — only need to be listed if you want to |
| 45 | change their severity. See [`RULES.md`](../../RULES.md) for the |
| 46 | full list. |
| 47 | |
| 48 | 3. **Generate a baseline** if you're integrating into a repository |
| 49 | with pre-existing skills that have legacy violations you don't |
| 50 | want to fix immediately: |
| 51 | |
| 52 | ```bash |
| 53 | dart run dart_skills_lint:cli --skills-directory=.agents/skills --generate-baseline |
| 54 | ``` |
| 55 | |
| 56 | This writes the current set of failures into an ignore file so |
| 57 | the next run exits clean. New violations introduced after the |
| 58 | baseline still surface as errors. |
| 59 | |
| 60 | 4. **Wire it into CI.** Use the |
| 61 | [GitHub Actions recipe](../../README.md#recipes) from the README |
| 62 | verbatim, or follow the |
| 63 | [pre-commit hook recipe](../../README.md#recipes) below it. |
| 64 | |
| 65 | ## When you're done |
| 66 | |
| 67 | The dart-skills-lint-validation skill takes over from here for |
| 68 | day-to-day use. |