Skip to content

feat: crewlore as a Claude Code plugin, from the same source as lore install - #23

Merged
srijansk merged 2 commits into
mainfrom
feat/claude-code-plugin
Oct 23, 2026
Merged

srijansk merged 2 commits into
mainfrom
feat/claude-code-plugin

Conversation

@srijansk

Copy link
Copy Markdown
Owner

What

crewlore can now be installed into Claude Code as a plugin, with no Python bundled:

/plugin marketplace add srijansk/crewlore
/plugin install crewlore@crewlore

The plugin is the same /lore skill (invoked as /crewlore:lore) and the same three hooks that lore install --hooks writes, so the two are two ways to the same files: pick one. It still needs pipx install crewlore, because the skill and the hooks run the lore command.

How it stays in sync

  • .claude-plugin/marketplace.json at the repo root points at plugins/crewlore/, which holds .claude-plugin/plugin.json, skills/lore/SKILL.md and hooks/hooks.json. An install copies exactly those three files (12 KB), not the repository.
  • All four files are generated by src/lore/claude_plugin.py (uv run python scripts/export_plugin.py) from the installer's own SKILL_MD and a new hook_groups() that install_hooks now also uses. tests/unit/test_claude_plugin.py fails when a committed file drifts from the generator, when the plugin skill differs from what lore install writes, when the hooks differ from what install_hooks writes, or when the manifest version differs from lore.__version__ (and pyproject from __version__).
  • CONTRIBUTING gains a "Releasing" section: the release steps now include regenerating the plugin files, and a note that plugin users receive skill or hook changes at the next version bump.

Verification

  • claude plugin validate (2.1.248), plain and --strict, on the marketplace root and on plugins/crewlore.
  • Isolated CLAUDE_CONFIG_DIR: marketplace add → install → list shows 0.5.2 enabled; details list the skill and the three hooks; the installed copy is the three files; the real ~/.claude is byte-identical before and after.
  • Independent adversarial review (MERGE WITH FIXES): the fixes are in the second commit (the update command is /plugin update crewlore@crewlore, the plugin files ship in the sdist so its tests pass, a version-agreement test, the release note). It also measured that a user with both lore install --hooks and the plugin gets each hook twice per event (double context, double usage counts, no corruption), which is why the README says to pick one.
  • 513 tests, ruff clean.

🤖 Generated with Claude Code

srijansk and others added 2 commits October 22, 2026 20:57
…arketplace

`/plugin marketplace add srijansk/crewlore` then `/plugin install crewlore@crewlore` gives Claude Code the `/lore` skill (as `/crewlore:lore`) and the three hooks that `lore install --hooks` writes.

- `.claude-plugin/marketplace.json` at the repository root lists one plugin, `./plugins/crewlore`, so an install copies that directory (three files, 12 KB) and not the repository.
- `plugins/crewlore/.claude-plugin/plugin.json` is metadata only; `plugins/crewlore/skills/lore/SKILL.md` and `plugins/crewlore/hooks/hooks.json` are generated by `scripts/export_plugin.py` (`lore.claude_plugin`) from `SKILL_MD` and the installer's hook entries, through `hook_groups()`, the shared chokepoint `install_hooks` now uses, so the plugin and the installer cannot disagree. `tests/unit/test_claude_plugin.py` fails when a committed file drifts from the generator, when the skill differs from what `lore install` writes, when a hook differs from what `lore install --hooks` writes, or when the manifest's version lags the package.
- The plugin bundles no Python: the hooks run the same `HOOK_SHELL` command (`lore` on PATH, exit 0 whatever happens, only the hook's own JSON passed on), so `pipx install crewlore` is still needed. README and CHANGELOG say so, and say to pick one of the two install routes, since Claude Code runs a plugin's copy of a hook separately from a settings file's copy.
- The plugin and the marketplace file stay out of the sdist, like the other repo-only files.
- CONTRIBUTING.md gains a Releasing section: the version bump, the CHANGELOG heading, `uv lock`, the plugin export (the test insists on it), the gates, the commit on main, CI, then the annotated tag that runs release.yml.

Verified with claude 2.1.248: `claude plugin validate` passes, plain and `--strict`, on the marketplace root and on `plugins/crewlore`; under an isolated CLAUDE_CONFIG_DIR, marketplace add + install + details report version 0.5.2, Skills (1) lore and Hooks (3) PreToolUse, UserPromptSubmit, SessionStart, with the installed copy holding only the three plugin files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ion-agreement test, release note)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@srijansk
srijansk merged commit 7c843c6 into main Oct 23, 2026
5 checks passed
@srijansk
srijansk deleted the feat/claude-code-plugin branch October 23, 2026 04:15
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