WIP - feat(ways): plugin way discovery (ADR-129)#76
Open
ctracey wants to merge 4 commits into
Open
Conversation
Design for extending way discovery to scan enabled Claude Code plugins. Hybrid approach: resolve plugin paths once at session start via `claude plugin list --json`, write a session manifest, and scan plugin hooks/ways/ directories alongside project-local and global.
Extend way discovery to scan enabled Claude Code plugins for ways. At session start, resolve-plugins.sh queries `claude plugin list --json` and writes a manifest of plugin hooks/ways/ paths. The ways binary reads this manifest during scans, inserting plugin ways between project-local and global priority. Implementation: - resolve-plugins.sh: session-start hook writing plugin-ways.json - candidates.rs: collect_candidates/collect_checks gain plugin source - session.rs: PluginWayEntry, plugin_way_dirs(), resolve_plugin_way_dir() - corpus.rs: discover_plugin_way_dirs() for embedding corpus inclusion - show/mod.rs: session-aware resolve for plugin way file lookup Tests: 9 integration scenarios (11a-11i) covering keyword match, idempotency, missing manifest fallback, project-scope filtering, global coexistence, multiple plugins, check files, and macro trust. All 19 simulation tests pass with zero regressions.
Author
|
TODO
|
Plugin ways use $PLUGIN_INSTALL_PATH/ways/ (no hooks/ways/ fallback). Consolidated shell+Rust plugin resolution into a single Rust implementation: `ways resolve-plugins --session <id>` writes the manifest, resolve_plugins_live() queries the CLI, both share the same filtering and path logic. Shell hook is now a thin wrapper. ADR-129 updated with full way file path convention for all three scopes (global, project-local, plugin).
New flag lists all ways that would be candidates for a given project path — global, project-local, and plugin — grouped by source. Uses the same collect_candidates pipeline as scan, with when: precondition filtering. Plugin discovery runs live via `claude plugin list --json` so it always reflects current state (no stale session manifests). Includes --project and --json flags, scenario 12 integration tests.
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
Extends the way discovery system to scan enabled Claude Code plugins for ways, enabling plugin authors to ship domain-specific guidance alongside their tools.
claude plugin list --json, writes a session manifest; per-invocation scans read from the manifestplugin:{plugin_id}/{way_path}to prevent collisionsways corpusdiscovers plugin ways outside sessions viainstalled_plugins.jsonArchitecture
Design documented in ADR-129. Key decisions:
claude plugin listis too slow to run on every hook invocation; resolving once at session start amortizes the costinstalled_plugins.jsonfirst (fast, no session context needed), then falls back to session manifestChanges
hooks/ways/resolve-plugins.shsettings.jsonsrc/cmd/scan/candidates.rscollect_plugin_candidates(), prefixed dir scanningsrc/session.rsplugin_way_dirs(),resolve_way_file_in_session(), fallback chainsrc/cmd/show/mod.rssrc/cmd/corpus.rsdocs/architecture/system/ADR-129-*Test plan
9 scenarios covering the plugin discovery surface, documented in SIMULATION-SPEC.md §9:
plugin:prefixshow::waypipeline (markers stamped)All 19 tests pass (9 new + 10 existing, zero regressions):