Skip to content

feat(cli): add sm skills for installing bundled agent skills - #64

Merged
antosubash merged 2 commits into
mainfrom
claude/add-skills-cli-command-0gbDi
Apr 30, 2026
Merged

antosubash merged 2 commits into
mainfrom
claude/add-skills-cli-command-0gbDi

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Adds three new skill packs that fill obvious gaps in the existing set:
    • simple-module-testing — root conftest.py fixtures (db_session, app, authenticated_client), the alembic-stamp trick, single-test runs, e2e/Playwright.
    • simple-module-locales — locale_dirs(), namespace conventions, CLDR plurals, the Zod-in-hook rule, SM013–SM016.
    • simple-module-registries — register_menu_items / register_permissions / register_feature_flags / register_event_handlers with realistic snippets and the publish vs publish_nowait distinction.
  • Adds a sm skills subcommand group:
    • sm skills list — print every bundled skill with its trigger description.
    • sm skills add [names...] — install into ./.claude/skills/ (default), ~/.claude/skills/ (-g), or any --dest. Skips existing dirs unless --force. Optional --symlink for skill devs iterating in-tree.
    • sm skills update [names...] — re-pull. With no names, only updates skills already present at the destination, so re-running it is safe and predictable.
  • Bundles the skills as package data without duplicating the source tree:
    • Repo-root /skills/ stays the source of truth (so npx skills add antosubash/simple_module_python keeps working).
    • simple_module_cli/skills is a symlink to ../../../skills — editable installs and importlib.resources resolve the bundle without copying.
    • For wheels, Hatch force-include copies the real files into the wheel and exclude keeps the symlink out of the package, so a plain pip install simple_module_cli ships the skills with no duplicate-entry warnings.

Test plan

  • uv run pytest framework/cli/tests — 84 passed (18 new tests cover list / add / update / unknown / skip-vs-force / symlink / --global / real bundle integrity).
  • uv run ruff check framework/cli/ — clean.
  • uv run ruff format --check framework/cli/ — clean.
  • uv run python scripts/check_file_size.py — no file exceeds 300 lines.
  • uvx --from build pyproject-build --wheel framework/cli — wheel includes 10 skill dirs at simple_module_cli/skills/<name>/SKILL.md, no duplicate-name warnings.
  • Smoke test: sm skills list, sm skills add ..., sm skills add ... again (skipped), sm skills update (force-overwrite), sm skills add does-not-exist (errors with available list).

https://claude.ai/code/session_016vjREbURssi81LjqhDpi4L


Generated by Claude Code

claude added 2 commits April 29, 2026 21:13
Three new skill packs cover testing, locales/i18n, and the cross-module
registries (menu/permissions/feature flags/events), filling the obvious
gaps in the existing skill set.

The CLI grows a `skills` subgroup with three commands:

* `sm skills list` — show every bundled skill + its trigger description
* `sm skills add [names...]` — copy skills into ./.claude/skills/
  (or `-g` for ~/.claude/skills, or `--dest` for any path);
  `--symlink` for in-place dev, `--force` to overwrite existing dirs
* `sm skills update [names...]` — re-pull. With no names, only updates
  skills already present at the destination.

The bundle is the same source as the repo-root /skills/ tree (so
`npx skills add antosubash/simple_module_python` keeps working): a
symlink at simple_module_cli/skills points at /skills/ for editable
installs, and Hatch `force-include` copies the real files into the
wheel for `pip install simple_module_cli` users.

https://claude.ai/code/session_016vjREbURssi81LjqhDpi4L
* `_GLOBAL_DIR` was captured at module import via `Path.home() /
  ".claude" / "skills"`, so HOME overrides (CI, sudo, Docker
  entrypoints) didn't take effect for the running process. The test
  exposed this exactly — it had to monkey-patch both `Path.home` and
  the cached constant. Resolve home lazily inside `_resolve_dest`.
* `install_skill` returned action codes as bare strings (`"wrote"` /
  `"updated"` / `"skipped"`) and `add_skills` keyed a `counts` dict
  off the same literals — a typo in either place silently produced
  KeyError. Replace with an `Action` StrEnum.
* `_read_description`'s "any line containing a colon ends the value"
  heuristic mis-fires on prose like ``Triggers on Foo: bar``.
  Use YAML's actual continuation rule (lines that start with
  whitespace are folded into the value) instead. Add regression
  tests for both folded continuations and prose-with-colon.

https://claude.ai/code/session_016vjREbURssi81LjqhDpi4L
@antosubash
antosubash marked this pull request as ready for review April 30, 2026 10:27
@antosubash
antosubash merged commit b23029a into main Apr 30, 2026
10 checks 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.

2 participants