Skip to content

refactor(skills): provider-driven ai:skills command#119

Merged
bedus-creation merged 2 commits into
mainfrom
refactor/skills-provider-driven
Jun 13, 2026
Merged

refactor(skills): provider-driven ai:skills command#119
bedus-creation merged 2 commits into
mainfrom
refactor/skills-provider-driven

Conversation

@bedus-creation

Copy link
Copy Markdown
Contributor

Summary

Replaces the directory-scanning skills/rules modules with a single provider-driven ai:skills command. A provider now declares skills simply by having a provider_key that appears in SkillRegistry.skills; the framework ships a bundled SKILL.md stub per declared destination.

Changes

  • Remove the entire skills/rules/ subtree and the old skills:sync / skills:list / rules:sync / rules:list commands.
  • Add SkillsCommand (ai:skills) with --list (default), --sync, --target=claude|gemini|all, --prune, and --force.
  • Extract YAML front-matter parsing into a dedicated SkillParser (parser.py).
  • Rework SkillRegistry around get_providers() / discover() / publish()discover() prefers the project's edited .ai/ copy and falls back to the bundled stub.
  • Rename the fastapi stub directory so it matches its provider key.
  • Tests: rewrite the skills suite against the new API (registering the real FastAPIProvider / DatabaseProvider so the provider→skill wiring is exercised end-to-end) and add test_parser.py.

Behavior notes

  • An unknown --target is now reported as a message with exit code 0 (the old commands returned 1).
  • The fastapi stub's front-matter name: is fastapi-startkit, so Claude skill files land under .claude/skills/fastapi-startkit/.

Testing

  • uv run pytest tests/skills/ -q49 passed
  • uv run pytest --ignore=tests/masoniteorm/postgres -q1402 passed, 7 skipped (the test fixtures restore the global Model.db_manager / Migrator.db_manager that DatabaseProvider mutates, so registering it in tests doesn't leak).

🤖 Generated with Claude Code

bedus-creation and others added 2 commits June 12, 2026 23:22
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>
@bedus-creation bedus-creation merged commit 957ec68 into main Jun 13, 2026
3 checks passed
@bedus-creation bedus-creation deleted the refactor/skills-provider-driven branch June 13, 2026 16:48
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