Changes
This release replaces the three standalone hook scripts with one declarative engine driven by a JSON nudge registry. Each prompt-improvement capability is now a data row in nudges/<EventName>/*.json, dispatched by a single engine.py <EventName> entry point. Adding an inject-context nudge is one JSON file with zero Python changes.
Added
- Declarative engine (
scripts/engine.py): sole entry point, invoked asengine.py <EventName>. Reads stdin once, runs the event's rules (each in a try/except so one bad rule cannot suppress others), mergesinject_contextfragments by priority with a blank-line join, emits onehookSpecificOutput, and exits 0 on every path - Rule layer (
scripts/rules.py): JSON loader,validate_rule, the event->capability matrix, andrules_for(event). Each rule'seventmust match its parent directory; invalid rows are skipped with a stderr note (loading never raises) - Escape-hatch builtins (
scripts/nudge_builtins.py): two allowlist dicts (HANDLERS,MATCHERS) referenced by string name only - noeval/importlib/getattr-on-path - JSON nudge registry (
nudges/<EventName>/*.json): per-event subdirectories, recursively globbed and validated approach-assessmentnudge (UserPromptSubmit): on a non-trivial request, raises which approach fits - plan, subagent, heavier orchestration, or just do it - and reminds that a spawned subagent needs its context passed explicitlyoutput-readabilitynudge (UserPromptSubmit): self-cancelling reminder to make substantial deliverables (report, review, summary, comparison, analysis) human-parsablesubagent-routingnudge (SubagentStart): breadth-over-depth, conclusion-first guidance when an Explore or Plan agent spawns - a capability the old script layer could not express- New test suites:
tests/test_engine.py(end-to-end subprocess per event),tests/test_rules.py,tests/test_nudge_builtins.py
Changed
improveandworkflowbecame named handlers innudge_builtins.py;planbecame a pure-data nudge rowbackground-execmoved from UserPromptSubmit to PreToolUse/Bash so it fires only when a Bash command is actually about to run; the PreToolUse matcher now coversEnterPlanMode|Bashapproach-assessment(priority 10) now merges beforeworkflow(priority 20) on UserPromptSubmit- Bumped plugin version to 0.6.0
Removed
- Standalone hook scripts
scripts/improve-prompt.py,scripts/plan-guidance.py, andscripts/workflow-guidance.py(collapsed into the engine) - Their test files
tests/test_hook.pyandtests/test_workflow_guidance.py
Note for manual installs: the three scripts above are gone. Copy
scripts/engine.py,scripts/rules.py,scripts/nudge_builtins.py, and the wholenudges/tree (keepscripts/andnudges/siblings), then add per-eventengine.py <EventName>dispatch entries to settings.json.
Installation
claude plugin marketplace add severity1/severity1-marketplace
claude plugin install prompt-improver@severity1-marketplace