From 61f11bd0b84425def91631f214da09fb49404843 Mon Sep 17 00:00:00 2001 From: Sebastian Iancu Date: Tue, 27 Oct 2026 14:10:21 +0100 Subject: [PATCH 1/2] fix(hooks): read the workspace from Cursor plugin hooks A Cursor plugin hook runs in the plugin install and only accepts additional_context from sessionStart. session-start now inspects CURSOR_PROJECT_DIR, and format-on-save finds the fixer config there. The formatter stays on afterFileEdit. Co-authored-by: Cursor --- AGENTS.md | 6 +++--- CHANGELOG.md | 3 +++ docs/authoring.md | 2 +- docs/install.md | 2 +- docs/testing.md | 2 +- hooks/cursor-hooks.json | 7 +++++-- hooks/format-on-save.sh | 14 +++++++++++++- hooks/session-start.sh | 29 ++++++++++++++++++++++++----- scripts/validate.py | 15 ++++++++++++--- 9 files changed, 63 insertions(+), 17 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4d8c822..286c5de 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -50,8 +50,8 @@ Update each hit. Keep release numbers and "checked" dates in `## Sources` sectio - **Agent**: `agents/php-reviewer.md`. Report-only, no sub-agent dispatch. Its `tools:` include `Skill` so it can load `php-coding`. - **Cursor rule**: `rules/php-context.mdc` (`globs: ["**/*.php"]`) mirrors the index table. - **Claude hooks**: `hooks/hooks.json` wires `SessionStart` and `PostToolUse` (`matcher: "Write|Edit"`) to the shared scripts as `bash "${CLAUDE_PLUGIN_ROOT}/hooks/