Files
cursor__plugins/advisor/hooks/mark-pending.sh
Eric Zakariasson 659a6363c0 feat(advisor): add Advisor plugin (Grok 4.6 consults at key checkpoints) (#314)
Adds an Advisor plugin: the main model consults a stronger model before
major decisions, when stuck on an error, and before declaring a task done.
The advisor gets a full briefing plus the conversation transcript path,
returns a verdict with guidance, and the main model keeps doing the work.
The default advisor is the latest Grok (Grok 4.6) at its highest reasoning
effort; /advisor <model> accepts any model available to subagents.

- skill `advisor`: /advisor [model|off|status|ask ...|nudge on|off],
  checkpoint protocol, briefing template, usable as a Custom Mode
- agent `advisor-subagent`: read-only, pinned to grok-4.6[effort=xhigh]
- hooks: track edits since the last consult, log consults to
  .cursor/advisor/log.md, nudge a pre-completion consult once per batch
  of edits; state is bound to the conversation that enabled it
- registered in marketplace.json and the root README
2026-09-04 12:22:22 +00:00

28 lines
641 B
Bash
Executable File

#!/bin/bash
# afterFileEdit hook for Advisor.
# Remembers that files changed since the last advisor consult, so the stop hook
# can ask for a pre-completion review if the turn ends without one.
#
# Input: { "file_path": "<absolute path>", "edits": [...], ...common }
# Output: none
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
HOOK_INPUT=$(cat)
advisor_require_enabled
advisor_bind_conversation "$HOOK_INPUT" || exit 0
FILE_PATH=$(jq -r '.file_path // empty' <<< "$HOOK_INPUT")
# The plugin's own state is not work product.
case "$FILE_PATH" in
*/.cursor/advisor/*) exit 0 ;;
esac
touch "$PENDING_FILE"
exit 0