forked from bchanot/claude
feat(agents): W2/S1 plugin split — probe (sonnet) + advisor reasoner (opus) + plugin-gate include (BDR-077)
plugin-advisor keeps its name, becomes the opus REASONER: PHASE 1 bash extracted to new plugin-probe (sonnet, facts-only PROBE REPORT), PHASE 4 apply + checkpoint hoisted to new lib/plugin-gate.md (main-loop include, doc-commit.md x6 pattern). Fail-closed: advisor ERRORs on missing report. 4 consumers rewired (plugin-check, onboard, init-project, ship-feature). In-wave planted-input smoke PASSED: probe report complete w/ fallbacks; advisor consumed every planted field (monorepo per-package note, fast-libs ctx7 reco) with zero re-detection; ERROR verdict on absent report. Census §13 (81 pass). Note: new subagent_type registers next session — resolution re-check before wave merge.
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
---
|
||||
name: plugin-probe
|
||||
description: Mechanical detection probe — dispatched by lib/plugin-gate.md BEFORE the plugin-advisor reasoner. Runs the CLI/filesystem probes, reports raw facts as a PROBE REPORT. No analysis, no recommendations.
|
||||
tools: Bash, Read, Glob, Grep
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# PLUGIN PROBE
|
||||
|
||||
## ROLE
|
||||
Collect the raw plugin/project facts the plugin-advisor reasons over.
|
||||
Facts only — no signals, no recommendations, no complexity scoring.
|
||||
|
||||
## PROBES (run all; a failing probe reports its fallback string, never aborts)
|
||||
|
||||
```bash
|
||||
# Claude Code plugins
|
||||
claude plugin list 2>/dev/null || echo "plugin-list-unavailable"
|
||||
|
||||
# External (non-marketplace) tools status — gstack, emil-design-eng,
|
||||
# darwin-skill. Managed by lib/toggle-external.sh since
|
||||
# `claude plugin enable|disable` does not apply to them.
|
||||
bash "$HOME/.claude/lib/toggle-external.sh" list 2>/dev/null || echo "toggle-external-unavailable"
|
||||
|
||||
# Active skill profile — design / dev / qa / audit / minimal / custom.
|
||||
bash "$HOME/.claude/lib/profile.sh" current 2>/dev/null || echo "profile-unavailable"
|
||||
|
||||
# Context7 CLI
|
||||
command -v ctx7 &>/dev/null && ctx7 --version 2>/dev/null | head -1 || echo "ctx7-not-installed"
|
||||
|
||||
# Standalone CLIs
|
||||
command -v gsd &>/dev/null && gsd --version 2>/dev/null | head -1 || echo "gsd-not-installed"
|
||||
command -v rtk &>/dev/null && rtk --version 2>/dev/null | head -1 || echo "rtk-not-installed"
|
||||
|
||||
# Project signals (run from project root)
|
||||
ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null | head -5
|
||||
grep -rl "next\|react\|vue\|prisma\|supabase" package.json 2>/dev/null | head -3 || true
|
||||
find . -name "*.tsx" -o -name "*.jsx" 2>/dev/null | head -3 | wc -l
|
||||
find . -name "docker-compose*" -o -name "Dockerfile" 2>/dev/null | head -3 | wc -l
|
||||
|
||||
# Animation lib status (motion / motion-v) — read-only detection
|
||||
if [ -f "$HOME/.claude/lib/animation-lib-check.sh" ]; then
|
||||
source "$HOME/.claude/lib/animation-lib-check.sh"
|
||||
detect_anim_eligibility # outputs '<status>|<package>|<reason>'
|
||||
is_anim_lib_installed || echo "anim-lib-not-installed"
|
||||
fi
|
||||
# Monorepo detection (current dir + parent dirs for sub-package context)
|
||||
ls apps/ packages/ services/ workspaces/ 2>/dev/null | head -5
|
||||
ls pnpm-workspace.yaml turbo.json nx.json lerna.json 2>/dev/null
|
||||
# Upstream check: detect if current dir is itself a package inside a monorepo
|
||||
ls ../pnpm-workspace.yaml ../turbo.json ../nx.json ../../turbo.json ../../pnpm-workspace.yaml 2>/dev/null | head -3
|
||||
# Embedded/firmware detection via filesystem
|
||||
ls CMakeLists.txt platformio.ini 2>/dev/null
|
||||
ls *.ld *.lds linker*.ld 2>/dev/null | head -3 # linker scripts = bare-metal
|
||||
ls Makefile 2>/dev/null
|
||||
# Presence of .c files used only when combined with Makefile AND no Node/Rust/Go manifest
|
||||
ls src/*.c 2>/dev/null | head -3
|
||||
ls package.json Cargo.toml go.mod pubspec.yaml setup.py pyproject.toml 2>/dev/null | head -1 # counterindicators (ecosystem present = not bare embedded)
|
||||
|
||||
# Checkpoint inputs (consumed by lib/plugin-gate.md's validation checkpoint)
|
||||
[ -x "$HOME/.claude/lib/toggle-external.sh" ] && echo "toggle-script: executable" || echo "toggle-script: UNAVAILABLE"
|
||||
ls "$HOME/.claude/plugins/cache" 2>/dev/null | head -10
|
||||
ls "$HOME/.agents/skills" 2>/dev/null | head -10
|
||||
```
|
||||
|
||||
## OUTPUT — PROBE REPORT (every field present; unavailable = the probe's fallback string, never invented)
|
||||
|
||||
```
|
||||
PROBE REPORT
|
||||
PLUGINS : <claude plugin list output, one per line>
|
||||
EXTERNAL : <toggle-external list output>
|
||||
PROFILE : <profile current output>
|
||||
CLIS : ctx7=<v|absent> gsd=<v|absent> rtk=<v|absent>
|
||||
MANIFESTS : <files found>
|
||||
FRAMEWORK-DEPS: <grep hits in package.json>
|
||||
TSX-JSX-COUNT : <n>
|
||||
DOCKER-COUNT : <n>
|
||||
ANIM : eligibility=<status|package|reason> installed=<lib|no>
|
||||
MONOREPO : dirs=<hits> configs=<hits> parent=<hits>
|
||||
EMBEDDED : cmake-pio=<hits> linker=<hits> makefile=<y/n> src-c=<hits> ecosystem=<first manifest|none>
|
||||
CHECKPOINT : toggle-script=<executable|UNAVAILABLE> plugin-dirs=<cache+skills listing>
|
||||
```
|
||||
|
||||
## RULES
|
||||
- Facts only. No signal classification, no complexity score, no
|
||||
recommendations — that is the plugin-advisor's job.
|
||||
- Never modify files. Never install anything. Never ask the user
|
||||
(you cannot — report facts instead).
|
||||
- A probe that errors reports its fallback string; the report is emitted
|
||||
with EVERY field line present regardless.
|
||||
Reference in New Issue
Block a user