Two code-quality fixes after review of dc71e23 (Task 1):
I1 — Dead-branch logic in install.sh:
The plugin-install block sits inside the `elif [ "$mode" = "user" ]` branch,
so `[ "$mode" = "project" ] && plugin_target="consumer"` is unreachable
(`$mode` is always "user" here). Replaced with hardcoded `--install-target=user`
plus clarifying comment about future consumer-mode wiring.
I2 — Filter case missing catch-all in install-plugins.sh:
The two `case "$install_target"` blocks (validation at lines 40-43, filter at
lines 75-82) were physically separate. If a future enum value is added to
validation without updating filter, $filter would be unset → set -u crash.
Added explicit `*)` catch-all with log_error + exit 1.
Plan §Task 1 Step 1.7 contained the same I1 bug as dc71e23 — implementer
followed plan faithfully. This fix corrects the code; plan stays as historical
record. Future plans referencing this pattern should match THIS fix, not the
original plan text.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes тех-долг из routing.md v1.1 §4.1 — install-plugins.sh теперь
фильтрует entries по полю `target` относительно режима install'а.
Added флаг `--install-target=user|consumer` (required, с fallback на 'user'
+ warning для backwards-compat прямых вызовов из тестов). Filter jq-выражение:
user: target ∈ {"user-level", "user-level+consumer"}
consumer: target ∈ {"consumer", "user-level+consumer"}
scripts/install.sh теперь передаёт --install-target автоматически на основе
detected $mode (user|project). Regression: текущие 8 entries → 8 plugins при
--install-target=user, 2 plugins (FD + UPM, target=user-level+consumer) при
--install-target=consumer.
Подготовка под Phase 1: добавление 4 consumer-only entries (target=consumer)
и 1 user-level+consumer entry (context7) в plugins-manifest.json — filter
обеспечит, что в brain user-level попадут только нужные.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Uses corrected Claude CLI subcommand shape:
claude plugin marketplace add <repo> (NOT `claude marketplace add`)
claude plugin marketplace list
claude plugin install <name@marketplace>
claude plugin info <name@marketplace> --json
Includes fallback for environments where `claude` CLI is not in PATH
(VSCode-extension install on Windows): logs manual edit instructions
and exits 0 so the parent installer can continue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>