feat(skills): wire skill loading into workflow execution#347
Merged
Conversation
- `.gitignore`: Add `.agents` directory to ignored paths - `.go-arch-lint.yml`: Register `infra-skills` component and add to application deps - `CLAUDE.md`: Update architecture rules for skill frontmatter parsing - `README.md`: Add skills feature reference - `docs/README.md`: Add agent-steps documentation entry - `docs/development/project-structure.md`: Document skills infrastructure package - `docs/reference/error-codes.md`: Add skill-related error codes - `docs/reference/interpolation.md`: Document skill context variables - `docs/user-guide/agent-steps.md`: Add full agent steps user guide (327 lines) - `docs/user-guide/workflow-syntax.md`: Document skill step syntax - `internal/application/execution_service.go`: Integrate skill loader into execution pipeline - `internal/application/execution_service_skillwiring_test.go`: Add skill wiring tests - `internal/application/execution_setup.go`: Wire skill repository into execution setup - `internal/application/skill_loader.go`: Add SkillLoader application service - `internal/application/skill_loader_test.go`: Add 466-line test suite for SkillLoader - `internal/domain/workflow/skill_test.go`: Remove obsolete skill domain tests - `internal/domain/workflow/skill_validation_codes_test.go`: Update validation code tests - `internal/domain/workflow/validation_errors.go`: Fix validation error message - `internal/infrastructure/repository/yaml_mapper.go`: Map skill step fields from YAML - `internal/infrastructure/repository/yaml_mapper_skill_test.go`: Add YAML mapper skill tests - `internal/infrastructure/repository/yaml_types.go`: Add skill step YAML type fields - `internal/infrastructure/skills/filesystem_repository.go`: Add skill resolution methods - `internal/infrastructure/skills/filesystem_repository_test.go`: Expand filesystem repo tests - `internal/infrastructure/skills/frontmatter.go`: Fix frontmatter parsing edge cases - `internal/infrastructure/skills/frontmatter_test.go`: Remove redundant frontmatter tests - `internal/interfaces/cli/validate.go`: Add skill validation to validate command - `internal/interfaces/cli/validate_skill_test.go`: Add 416-line CLI validation tests - `internal/testutil/builders/builders.go`: Add skill step builder helpers - `internal/testutil/mocks/mocks.go`: Add SkillRepository mock - `tests/integration/skills/skills_functional_test.go`: Add functional integration tests - `tests/integration/skills/validate_command_skills_test.go`: Add validate command integration tests Closes #346
05f5cc5 to
513ebbf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skills:in agent steps to inject deterministic domain knowledge (from SKILL.md files) into the agent's prompt context before execution.awf/skills/,.agents/skills/,.claude/skills/, XDG global, and their home-dir equivalents) withAWF_SKILLS_PATHenv override; path-based explicit references are also supportedawf validatenow checks all skill references for existence and content, reportingskill_not_found,skill_missing_skillmd, andskill_empty_contentcodes at pre-runtime<skill_content>XML block (agentskills.io-compliant) with bundled resource enumeration, prepended before the user promptChanges
Application Layer
internal/application/skill_loader.go: NewResolveAndFormatSkillsfunction — resolves skill references (name-based and path-based), loads SKILL.md content, strips frontmatter, and formats as<skill_content>XML blocks with bundled resource listinginternal/application/execution_service.go: WireskillRepofield; inject resolved skill content intoexecuteAgentStepbefore prompt resolution whenstep.Skillsis non-emptyinternal/application/execution_setup.go: CallSetSkillRepositoryduring service initializationInfrastructure — Skills
internal/infrastructure/skills/filesystem_repository.go: Expand discovery to cover all 7 standard directories (project + global for AWF, cross-client, and Claude Code compat tiers)internal/infrastructure/skills/frontmatter.go: Fix YAML frontmatter stripping to preserve metadata without leaking it into injected contentInfrastructure — Repository
internal/infrastructure/repository/yaml_mapper.go: Mapskills:YAML array to domainStep.Skillsfield; handle both string (name) and object (path:) referencesinternal/infrastructure/repository/yaml_types.go: AddSkillRefYAML type supporting name and path formsCLI — Validate
internal/interfaces/cli/validate.go: Add skill validation pass — resolve all declared skills across all steps at validate-time, report missing directories, missing SKILL.md, and empty contentDomain
internal/domain/workflow/validation_errors.go: Addskill_not_found,skill_missing_skillmd,skill_empty_contentvalidation error codesTest Utilities
internal/testutil/builders/builders.go: Add skill-related builder helpersinternal/testutil/mocks/mocks.go: AddMockSkillRepositoryfor unit test injectionTests
internal/application/execution_service_skillwiring_test.go: Unit tests for skill wiring throughExecutionServiceinternal/application/skill_loader_test.go: Comprehensive unit tests forResolveAndFormatSkills(name resolution, path resolution, frontmatter stripping, resource enumeration, error cases)internal/infrastructure/repository/yaml_mapper_skill_test.go: YAML parsing tests for skill reference types (string and path forms)internal/infrastructure/skills/filesystem_repository_test.go: Discovery tests across all 7 tiers including XDG fallback pathsinternal/interfaces/cli/validate_skill_test.go: CLI validate command tests for skill validation errors and warningstests/integration/skills/skills_functional_test.go: End-to-end functional tests for skill loading and injectiontests/integration/skills/validate_command_skills_test.go: Integration tests forawf validateskill checksinternal/domain/workflow/skill_test.go: Remove obsolete test stubsinternal/domain/workflow/skill_validation_codes_test.go: Update for new validation code namesDocumentation
docs/user-guide/agent-steps.md: Full Agent Skills section — basic usage, skill references, discovery directories, SKILL.md format, injection format, validation table, limitationsdocs/user-guide/workflow-syntax.md: Addskills:field to agent step reference table and example blockdocs/reference/error-codes.md: DocumentUSER.INPUT.MISSING_SKILLerror codedocs/reference/interpolation.md: Document{{.awf.skills_dir}}variable and skills discovery in local-before-global resolutiondocs/development/project-structure.md: Addinfrastructure/skills/and.awf/skills/to directory treedocs/README.md: Link Agent Skills sub-section in navigationConfig
.go-arch-lint.yml: Registerinfra-skillscomponent with correct dependency allowlistCLAUDE.md: Add two new pitfall entries for frontmatter parsing and XDG fallback testingREADME.md: Add Agent Skills to feature list.gitignore: Ignore.agentsdirectoryTest plan
make test— all unit and integration tests pass with no race conditions (make test-race)make lint— zero lint violations including arch-lintawf validate <workflow-with-skills>— reports skill_not_found for missing skills and skill_empty_content warnings for empty SKILL.md filesawf run <workflow>— agent step withskills:receives<skill_content>blocks prepended to prompt; verify with--dry-runor verbose outputCloses #346
Generated with awf commit workflow