diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 624e57d..df2d27c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,16 @@ jobs: min_score: 95 working_directory: examples/flutter_package + verify-dart-skills-lint: + uses: ./.github/workflows/dart_skills_lint.yml + with: + working_directory: examples/dart_skills_lint + skills_directories: "skills" + verify-semantic-pull-request: uses: ./.github/workflows/semantic_pull_request.yml with: - scopes: "dart_package, deps, flutter_package, pana, semantic_pull_request, spell_check" + scopes: "dart_package, dart_skills_lint, deps, flutter_package, pana, semantic_pull_request, spell_check" verify-spell-check: uses: ./.github/workflows/spell_check.yml @@ -73,6 +79,7 @@ jobs: verify-flutter, verify-pana-dart, verify-pana-flutter, + verify-dart-skills-lint, verify-semantic-pull-request, verify-spell-check, verify-license-check, diff --git a/.github/workflows/dart_skills_lint.yml b/.github/workflows/dart_skills_lint.yml new file mode 100644 index 0000000..7d11c7e --- /dev/null +++ b/.github/workflows/dart_skills_lint.yml @@ -0,0 +1,63 @@ +name: Dart Skills Lint Workflow + +on: + workflow_call: + inputs: + skills_directories: + required: false + type: string + default: "" + description: "Space-separated list of root directories containing skill sub-folders to validate (passed as --skills-directory flags). If empty, dart_skills_lint falls back to its defaults (.claude/skills and .agents/skills)." + dart_skills_lint_ref: + required: false + type: string + default: "" + description: "Git ref (branch, tag, or commit SHA) of flutter/skills to activate dart_skills_lint from. If empty, uses the default branch." + dart_sdk: + required: false + type: string + default: "stable" + runs_on: + required: false + type: string + default: "ubuntu-latest" + working_directory: + required: false + type: string + default: "." + +jobs: + build: + defaults: + run: + working-directory: ${{inputs.working_directory}} + + runs-on: ${{inputs.runs_on}} + + steps: + - name: 📚 Git Checkout + uses: actions/checkout@v6 + + - name: 🎯 Setup Dart + uses: dart-lang/setup-dart@v1.7.2 + with: + sdk: ${{inputs.dart_sdk}} + + - name: 📦 Activate dart_skills_lint + run: | + REF_FLAG="" + if [ -n "${{inputs.dart_skills_lint_ref}}" ]; then + REF_FLAG="--git-ref ${{inputs.dart_skills_lint_ref}}" + fi + dart pub global activate \ + --source git https://github.com/flutter/skills.git \ + --git-path tool/dart_skills_lint \ + $REF_FLAG + + - name: 🔍 Lint Skills + run: | + FLAGS="" + for dir in ${{inputs.skills_directories}}; do + FLAGS="$FLAGS --skills-directory $dir" + done + dart pub global run dart_skills_lint:cli $FLAGS diff --git a/README.md b/README.md index cf118e7..6f8c945 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,9 @@ uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/mason_publish.yml # A reusable workflow to keep track of the rights and restrictions external dependencies might impose on Dart or Flutter projects uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/license_check.yml@v1 + +# A reusable workflow for linting agent skill directories with dart_skills_lint +uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_skills_lint.yml@v1 ``` For configuration details, check out our [official docs][workflows_docs]. diff --git a/examples/dart_skills_lint/README.md b/examples/dart_skills_lint/README.md new file mode 100644 index 0000000..2b6fb5d --- /dev/null +++ b/examples/dart_skills_lint/README.md @@ -0,0 +1,9 @@ +# dart_skills_lint + +[![License: MIT][license_badge]][license_link] + +An example skills directory used to verify the `dart_skills_lint` reusable +workflow. + +[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg +[license_link]: https://opensource.org/licenses/MIT diff --git a/examples/dart_skills_lint/skills/example-skill/SKILL.md b/examples/dart_skills_lint/skills/example-skill/SKILL.md new file mode 100644 index 0000000..fc91701 --- /dev/null +++ b/examples/dart_skills_lint/skills/example-skill/SKILL.md @@ -0,0 +1,10 @@ +--- +name: example-skill +description: An example agent skill used to verify the dart_skills_lint reusable workflow. +--- + +# Example Skill + +This skill exists solely as a fixture for the `dart_skills_lint` reusable +workflow. It demonstrates the minimum structure required by the +[Agent Skills Specification](https://github.com/flutter/skills/blob/main/tool/dart_skills_lint/documentation/knowledge/SPECIFICATION.md). diff --git a/site/docs/workflows/dart_skills_lint.md b/site/docs/workflows/dart_skills_lint.md new file mode 100644 index 0000000..9374988 --- /dev/null +++ b/site/docs/workflows/dart_skills_lint.md @@ -0,0 +1,68 @@ +--- +sidebar_position: 10 +--- + +# Dart Skills Lint + +We use [`dart_skills_lint`](https://github.com/flutter/skills/tree/main/tool/dart_skills_lint) to validate agent skill directories against the [Agent Skills Specification](https://github.com/flutter/skills/blob/main/tool/dart_skills_lint/documentation/knowledge/SPECIFICATION.md). + +This workflow only validates skill linting — no tests, coverage, formatting, or pana scoring. It serves as a pre-merge check to ensure skill definitions (e.g., `SKILL.md` files, YAML front matter, directory structure, relative paths) are valid. + +## Steps + +The dart skills lint workflow consists of the following steps: + +1. Git checkout +2. Setup Dart +3. Activate `dart_skills_lint` from the [`flutter/skills`](https://github.com/flutter/skills) git repository +4. Lint skills + +## Inputs + +### `skills_directories` + +**Optional** Space-separated list of root directories containing skill sub-folders to validate (passed as `--skills-directory` flags). If empty, `dart_skills_lint` falls back to its defaults (`.claude/skills` and `.agents/skills`). + +**Default** `""` + +### `dart_skills_lint_ref` + +**Optional** Git ref (branch, tag, or commit SHA) of [`flutter/skills`](https://github.com/flutter/skills) to activate `dart_skills_lint` from. If empty, uses the default branch. + +**Default** `""` + +### `dart_sdk` + +**Optional** The Dart SDK version to use. + +**Default** `"stable"` + +### `working_directory` + +**Optional** The path to the root of the project. + +**Default** `"."` + +### `runs_on` + +**Optional** The operating system on which to run the workflow. + +**Default** `"ubuntu-latest"` + +## Example Usage + +```yaml +name: Lint Skills + +on: + pull_request: + paths: + - '.agents/skills/**' + - '.claude/skills/**' + +jobs: + lint-skills: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_skills_lint.yml@v1 + with: + skills_directories: '.agents/skills .claude/skills' +```