Skip to content

Conversation

@RichardHightower
Copy link
Contributor

@RichardHightower RichardHightower commented Jan 21, 2026

Summary

Implements agent-specific skill loading instructions in config files. The usage template now dynamically generates the correct invocation command based on the agent type.

Changes

Component Description
config_sync.py Added _generate_usage_template() function for dynamic templates
config_sync.py Updated _build_skills_section() and _merge_skill_into_section() with agent params
config_sync.py Added force_extended parameter for --force-config support
installer.py Pass force_config to sync functions for extended instructions
read_cmd.py Implemented fallback directory search when --agent not specified
LOAD_SKILLS.md Created reference document for non-native agents
Tests Added 19 new tests for all new functionality

Agent-Specific Behavior

Agent native_skill_support Generated Invocation
claude all skilz read <skill-name> (no --agent flag)
codex all skilz read <skill-name> --agent codex
opencode home skilz read <skill-name> --agent opencode
gemini all skilz read <skill-name> --agent gemini
aider none skilz read <skill-name> --agent aider + extended instructions
qwen none skilz read <skill-name> --agent qwen + extended instructions

Rule: Claude with native_skill_support="all" gets no --agent flag. All others include --agent {name}.

Extended Instructions: Agents with native_skill_support="none" automatically get step-by-step guidance.

Force Extended Instructions (--force-config)

When --force-config is used, extended step-by-step instructions are included regardless of the agent's native_skill_support setting. This is useful for:

  • Writing to config files for agents that don't natively understand skills
  • Custom setups where extended guidance is helpful

Example:

skilz install my-skill --agent gemini --force-config
# GEMINI.md will include extended step-by-step instructions

Fallback Search Order

When skilz read <skill-name> is called without --agent:

  1. Search .claude/skills/ first
  2. Then .skilz/skills/ (universal)
  3. Then .gemini/skills/
  4. Then .opencode/skills/
  5. Then .codex/skills/

Test Plan

  • All 659 tests pass
  • Lint checks pass (ruff)
  • Type checks pass (mypy)
  • 19 new tests added for agent-specific functionality
  • Backward compatible - existing config files continue to work

- Add _generate_usage_template() for dynamic invocation commands
- Claude gets no --agent flag, all others include --agent {name}
- Agents with native_skill_support='none' get extended step-by-step guidance
- Add fallback directory search when --agent not specified
- Create LOAD_SKILLS.md reference document
- Add comprehensive tests for all new functionality (15 new tests)

The usage template in config files now dynamically generates the correct
invocation command based on the agent type:
- Claude (native_skill_support='all'): skilz read <skill-name>
- Other agents: skilz read <skill-name> --agent {agent_name}

Agents with native_skill_support='none' (Gemini, QWEN, Aider, etc.) also
receive extended step-by-step instructions to help them use skills.

The read command now implements fallback search across multiple agent
directories when --agent is not specified, searching in order:
claude -> universal -> gemini -> opencode -> codex
When --force-config is used, the usage template now includes extended
step-by-step instructions regardless of the agent's native_skill_support
setting. This is useful when:
- Writing to config files for agents that don't natively understand skills
- Using custom setups where extended guidance is helpful

Also updated gemini_agent fixture to reflect current production config
(native_skill_support='all') and added gemini_agent_no_native for testing.

Added 4 new tests for force_extended behavior.
@RichardHightower RichardHightower merged commit 691fb90 into main Jan 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant