Feature: Skill CLI coverage boost
  Target remaining uncovered lines in src/cleveragents/cli/commands/skill.py:
  - Lines 82-103: _get_skill_service DB initialization and fallback
  - Line 889: tools non-rich format source_type "agent_skills" branch
  - Lines 984-985: refresh defensive guard for name=None after earlier check

  Background:
    Given boost- a fresh skill CLI service

  # -------------------------------------------------------------------
  # _get_skill_service: delegates to DI container
  # -------------------------------------------------------------------

  Scenario: _get_skill_service delegates to DI container skill_service
    Given boost- the DI container returns a DB-backed SkillService
    When boost- I call _get_skill_service
    Then boost- the returned service should have a skill_repo

  Scenario: _get_skill_service always delegates to container (no module cache)
    Given boost- the DI container returns a DB-backed SkillService
    When boost- I call _get_skill_service twice
    Then boost- the container skill_service should be called twice

  # -------------------------------------------------------------------
  # tools non-rich format: agent_skill: source type (line 889)
  # -------------------------------------------------------------------

  Scenario: Tools JSON output shows agent_skills source for agent_skill entries
    Given boost- a registered skill "local/agent-skill-test" with agent_skills
    When boost- I invoke tools "local/agent-skill-test" in format "json"
    Then boost- the CLI exit code should be 0
    And boost- the JSON output should be valid
    And boost- the JSON tools list should contain an entry with source "agent_skills"

  # -------------------------------------------------------------------
  # refresh: defensive name=None guard (lines 984-985)
  # -------------------------------------------------------------------

  Scenario: Refresh defensive guard fires when name is None after bypassing first check
    Given boost- a fresh skill CLI service
    When boost- I call refresh directly with name None and all_skills False bypassing first guard
    Then boost- the second guard should have printed the error message
    And boost- the function should have raised Abort
