Commit Graph

4 Commits

Author SHA1 Message Date
freemo 1f94b7e8d5 fix(skills): validate included skills are registered before adding skill
- Implemented a pre-registration validation in SkillService.add_skill() to ensure all skills listed in the includes field are already registered in self._skills before accepting the new skill registration. This prevents registering a skill that depends on non-existent skills.
- The validation applies to both the initial add and when update=True (re-registration), ensuring dependencies are consistently enforced across both creation and update flows.

- If any included skills are missing, a clear ValueError is raised listing all missing skill names with guidance to register them first, providing complete visibility rather than failing on the first missing item.

- Added new Behave feature file features/skill_add_include_validation.feature with 8 scenarios covering: single missing include, multiple missing includes, partial includes, all includes registered (success), update with missing include, and service-level assertions. Also added step definitions in features/steps/skill_add_include_validation_steps.py.

- Updated features/skill_cli.feature to pre-register local/file-reader in scenarios that use the full skill YAML (which includes local/file-reader) to reflect the new validation behavior.

- Updated features/steps/skill_cli_coverage_r3_steps.py to pre-register local/new-include in the update-with-different-includes scenario to align with the updated validation flow.

- Rationale and design decisions:
  - Validation is placed in the service layer (SkillService.add_skill()) rather than the CLI layer to ensure consistent enforcement regardless of how the service is invoked.
  - The error message reports all missing includes at once for better user guidance and faster remediation.
  - Tests that relied on the full skill YAML were updated to pre-register dependencies to accurately reflect the validation changes and maintain test integrity.

ISSUES CLOSED: #2555
2026-04-05 04:36:52 +00:00
aditya c40ea014dc feat(cli): add skill tools and refresh commands
Implemented agents skill refresh command to recompute tool flattening and sync
MCP-backed skills. Enhanced skill list/show/tools outputs with capability
summary fields.

- agents skill refresh <name>|--all to recompute flattening
- Enhanced skill list/show/tools with capability summary and tool counts
- Added --format json/yaml schemas for refresh output
- CLI errors for nonexistent skills and MCP sync failures
- Behave tests (skill_cli.feature), Robot tests (skill_cli.robot)
- ASV benchmarks (skill_cli_bench.py) for CLI overhead baseline
- Updated docs/reference/skill_cli.md with refresh command examples
- Documented refresh side effects and caching behavior

ISSUES CLOSED: #167
2026-02-26 10:57:07 +00:00
brent.edwards 3598924d6f test(cov): add skill CLI and service coverage scenarios
Add 19 behave scenarios covering uncovered paths in skill_service.py
and cli/commands/skill.py to bring coverage above the 97% threshold:
- show with includes, MCP servers, agent_skills, inline tools, Referenced By
- tools with mixed MCP/inline sources
- list with non-local namespaces
- remove without --yes (abort path)
- update with dependent skills (Affected Actors panel)
- service edge cases: skill_count, empty names, source filtering, no config_path
- add with missing-description YAML (validation failure)
2026-02-18 01:03:11 +00:00
aditya c562557da8 feat(cli): add skill commands 2026-02-17 14:44:40 +00:00