Skills CLI
The Skills CLI simplifies the process of creating "Agent Skills" from external documentation. It allows you to crawl documentation websites to discover relevant pages and then uses Generative AI (Gemini) to convert those pages into structured SKILL.md files that agents can use.
Context
Prerequisite
This tool requires the GEMINI_API_KEY environment variable to be set.
Commands
Note
To use the default configuration file path (
resources/flutter_skills.yaml), commands should be run from the root of the repository as:dart run tool/generator/bin/skills.dart <command>. Alternatively, if running from this directory, specify the path to the configuration file explicitly (e.g.,../../resources/flutter_skills.yaml).
generate-skill
Generates SKILL.md files from a YAML configuration file. Use the --skill option to generate a specific skill.
Usage:
dart run skills generate-skill [options] [config_file]
Arguments:
[config_file]: Path to the YAML configuration file. Defaults toresources/flutter_skills.yaml.
Options:
--skill: Filter to generate only the specified skill by name.--directory(-d): The directory to output the generated skill folder. Defaults to../skills/.--dry-run: Performs a dry run, showing what would be generated and token count without writing files.
Example: Generate all skills defined in resources/flutter_skills.yaml to the skills/ directory:
dart run skills generate-skill
Generate only the 'flutter-layout' skill to a custom directory:
dart run skills generate-skill --skill flutter-layout --directory ../skills
update-skill
Updates an existing skill by combining its current content with fetched resources and new instructions.
Usage:
dart run skills update-skill [options] [config_file]
Arguments:
[config_file]: Path to the YAML configuration file. Defaults toresources/flutter_skills.yaml.
Options:
--skill: Filter to update only the specified skill by name.--directory(-d): The directory to search for skills. Defaults to../skills/.--thinking-budget: The token budget for the model to "think" before generating content. Defaults to 2048.
Example: Update all skills defined in resources/flutter_skills.yaml:
dart run skills update-skill
Update only the 'flutter-layout' skill:
dart run skills update-skill --skill flutter-layout
validate-skill
Validates skills by re-generating and comparing with existing skills. This is useful for testing prompts or verifying consistency.
Usage:
dart run skills validate-skill [options] [config_file]
Arguments:
[config_file]: Path to the YAML configuration file. Defaults toresources/flutter_skills.yaml.
Options:
--skill: Validate only the specified skill by name.--directory(-d): The directory containing the generated skills to validate. Defaults to../skills/.--thinking-budget: The token budget for the model to "think" before generating content. Defaults to 2048.
Example: Validate skills in the default 'skills' directory:
dart run skills validate-skill
Validate skills in a custom directory:
dart run skills validate-skill --directory ../validation_results
update-readme
Updates the README.md file with a table of available skills.
Usage:
dart run skills update-readme [config_file] [readme_file]
Arguments:
[config_file]: Path to the YAML configuration file. Defaults toresources/flutter_skills.yaml.[readme_file]: Path to the README.md file to update. Defaults to../README.md.
Example: Update the root README.md:
dart run skills update-readme
Configuration
The default configuration file is located at resources/flutter_skills.yaml. It contains a list of skill definitions:
- name: flutter-layout
description: "..."
resources:
- https://docs.flutter.dev/ui/widgets/layout
- https://docs.flutter.dev/ui/layout
- ../packages/flutter/lib/src/widgets/layout.md
Development
To run analysis, formatting, and tests, navigate to this directory (tool/generator) and run:
dart analyze
dart format .
dart test