refactor(skills): provider-driven ai:skills command#119
Merged
Conversation
Replace the directory-scanning skills/rules modules with a single provider-driven `ai:skills` command. Skills are now declared by a provider whose `provider_key` appears in `SkillRegistry.skills`, with a bundled `SKILL.md` stub per declared destination. - Remove the entire `skills/rules/` subtree and the separate `skills:sync`/`skills:list`/`rules:*` commands. - Add `SkillsCommand` (`ai:skills --list/--sync --target --prune --force`). - Extract front-matter parsing into `SkillParser` (`parser.py`). - Rework `SkillRegistry` around `get_providers()`/`discover()`/`publish()`, preferring the project's `.ai/` copy over the bundled stub. - Rename the fastapi stub dir to match its provider key. - Rewrite skills tests against the new API (registering the real FastAPIProvider/DatabaseProvider) and add `test_parser.py`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ovider
Simplify the skills command/registry tests:
- Register only the real FastAPIProvider (declares the `fastapi` skill).
DatabaseProvider was pulled in purely for a second skill and forced a
global Model/Migrator.db_manager save/restore fixture for no added
coverage — both are gone.
- Drive SkillsCommand through Cleo's CommandTester instead of hand-stubbing
option/line/info/choice/confirm. Option parsing and IO now go through the
real machinery; tests run non-interactively so an omitted --target
resolves to the prompt default ("all") rather than blocking.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Replaces the directory-scanning
skills/rulesmodules with a single provider-drivenai:skillscommand. A provider now declares skills simply by having aprovider_keythat appears inSkillRegistry.skills; the framework ships a bundledSKILL.mdstub per declared destination.Changes
skills/rules/subtree and the oldskills:sync/skills:list/rules:sync/rules:listcommands.SkillsCommand(ai:skills) with--list(default),--sync,--target=claude|gemini|all,--prune, and--force.SkillParser(parser.py).SkillRegistryaroundget_providers()/discover()/publish()—discover()prefers the project's edited.ai/copy and falls back to the bundled stub.FastAPIProvider/DatabaseProviderso the provider→skill wiring is exercised end-to-end) and addtest_parser.py.Behavior notes
--targetis now reported as a message with exit code0(the old commands returned1).name:isfastapi-startkit, so Claude skill files land under.claude/skills/fastapi-startkit/.Testing
uv run pytest tests/skills/ -q→ 49 passeduv run pytest --ignore=tests/masoniteorm/postgres -q→ 1402 passed, 7 skipped (the test fixtures restore the globalModel.db_manager/Migrator.db_managerthatDatabaseProvidermutates, so registering it in tests doesn't leak).🤖 Generated with Claude Code