Skip to content

feat(dart): add Skill, SkillSet, and SkillGenerator to a2ui_agent #4167

Open

Description

@jacobsimionato

Both the Python (a2ui-agent-sdk) and TypeScript (@a2ui/agent) agent SDKs include a skill generator that compiles an InferenceFormat and its catalogs into SKILL.md packages (Skill, SkillSet, and SkillGenerator). Dart's package:a2ui_agent does not implement this API yet and skips conformance/agent/skill.yaml.

What to add

  1. Add Skill and SkillSet domain models for serializing SKILL.md files with YAML frontmatter and exporting skill directories safely to disk.
  2. Add SkillGenerator to compile monolithic skills (generateSkill), core syntax skills (generateCoreSkill), per-catalog skills (generateCatalogSkill), and modular skill sets (generateSkillSet) from an InferenceFormat.
  3. Re-export the public skill API from package:a2ui_agent/a2ui_agent.dart.
  4. Enable and pass all 12 test cases in conformance/agent/skill.yaml for dart/a2ui_agent.
Implementation, blueprint, and conformance details

Blueprint and reference implementations

  1. Feature blueprint: skill_generator.blueprint.md specifies the cross-language PromptGenerator decomposition, Skill, SkillSet, SkillGenerator, clean_catalog_name, and export_to_directory rules.
  2. Python: skill.py, generator.py, and test_skill_conformance.py.
  3. TypeScript: skill.ts, generator.ts, index.ts, and skill-conformance.test.ts.

Dart implementation notes

  1. Decompose PromptGenerator (ExpressPromptGenerator and DirectJsonPromptGenerator) into base rules, per-catalog instructions, and per-catalog examples (see TypeScript's PromptGenerator) so SkillGenerator and PromptGenerator.generate() share the same rendering logic and satisfy both the conformance/test_data/skills/ goldens and the monolithic_skill_equals_prompt_snippet cases.
  2. Validate Skill.filename and SkillSet keys on construction and insertion so absolute paths, empty segments, ., and .. throw A2uiValidationError. In SkillSet.exportToDirectory, clean only each skill's immediate directory while preserving sibling folders and root files, and verify resolved ancestor paths do not escape the output directory via symlinks.
  3. Gate dart:io file-system operations behind a conditional import (if (dart.library.io)), following catalog_providers.dart, so package:a2ui_agent stays compilable on web targets.
  4. Match the YAML frontmatter formatting expected by the golden skill files (80-column plain scalar wrapping for name, description, and optional metadata, as in skill.ts).
  5. Move agent/skill.yaml from unsupportedAgentSuites to activeAgentSuites in unsupported_suites_test.dart, add dart/a2ui_agent/test/conformance/skill_conformance_test.dart, remove dart-agent from knownGaps under F-AGT-06 in features.yaml, and record skill_generator under implemented_features in codebase.blueprint.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The team intends to work on this in the near future, or at a lower priority.component: agent sdkRelating to the agent SDK libraries in any languagelang: dartAffects SDKs or apps in the Dart programming languagetype: feature/enhancement

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions