IW-323: Support Plugin Command Directories #329

Merged
mprihoda merged 28 commits from IW-323 into main 2026-04-01 18:01:43 +00:00
mprihoda commented 2026-04-01 08:48:17 +00:00 (Migrated from github.com)

Summary

  • Adds plugin command directory support for extensible command discovery via XDG auto-discovery (~/.local/share/iw/plugins/*/)
  • Plugin commands invoked with <plugin>/<command> namespace (e.g., iw kanon/implement)
  • Bidirectional hook discovery: plugin hooks extend core commands, project hooks extend plugin commands
  • // REQUIRES: iw-cli >= X.Y.Z version gating for plugin commands

Changes

Production code:

  • iw-run: discover_plugins(), extended list_commands(), describe_command(), execute_command() with plugin namespace support, version checking functions (read_iw_version, compare_versions, check_version_requirement), generalized extract_hook_classes()
  • .iw/VERSION: Single source of truth for version string
  • Constants.scala: IwPluginDirs, PluginsDir, CommandHeaders.Requires
  • version.scala: Reads version from .iw/VERSION at runtime

Tests: 53 BATS E2E tests + 3 munit unit tests covering:

  • Plugin discovery (XDG, env var, precedence, error resilience)
  • Command listing, describing, execution
  • Classpath assembly (core + plugin lib)
  • Hook discovery (plugin→core, project→plugin)
  • Version checking (read, compare, gate)

Test plan

  • All 53 plugin-specific E2E tests pass
  • All existing E2E tests pass (regression)
  • Unit tests pass
  • Core compilation with -Werror passes
  • Code reviewed across 4 phase PRs (#325, #326, #327, #328)

Release Notes

See project-management/issues/IW-323/release-notes.md (Czech)

🤖 Generated with Claude Code

## Summary - Adds plugin command directory support for extensible command discovery via XDG auto-discovery (`~/.local/share/iw/plugins/*/`) - Plugin commands invoked with `<plugin>/<command>` namespace (e.g., `iw kanon/implement`) - Bidirectional hook discovery: plugin hooks extend core commands, project hooks extend plugin commands - `// REQUIRES: iw-cli >= X.Y.Z` version gating for plugin commands ## Changes **Production code:** - `iw-run`: `discover_plugins()`, extended `list_commands()`, `describe_command()`, `execute_command()` with plugin namespace support, version checking functions (`read_iw_version`, `compare_versions`, `check_version_requirement`), generalized `extract_hook_classes()` - `.iw/VERSION`: Single source of truth for version string - `Constants.scala`: `IwPluginDirs`, `PluginsDir`, `CommandHeaders.Requires` - `version.scala`: Reads version from `.iw/VERSION` at runtime **Tests:** 53 BATS E2E tests + 3 munit unit tests covering: - Plugin discovery (XDG, env var, precedence, error resilience) - Command listing, describing, execution - Classpath assembly (core + plugin lib) - Hook discovery (plugin→core, project→plugin) - Version checking (read, compare, gate) ## Test plan - [x] All 53 plugin-specific E2E tests pass - [x] All existing E2E tests pass (regression) - [x] Unit tests pass - [x] Core compilation with -Werror passes - [x] Code reviewed across 4 phase PRs (#325, #326, #327, #328) ## Release Notes See `project-management/issues/IW-323/release-notes.md` (Czech) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.