Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f54a290c31 |
@@ -1,6 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"hooks": {
|
||||
"userPromptSubmit": [
|
||||
{
|
||||
"command": ".cursor/hooks/user-prompt-submit.sh",
|
||||
"timeout": 5
|
||||
}
|
||||
],
|
||||
"preToolUse": [
|
||||
{
|
||||
"command": ".cursor/hooks/pre-tool-use.sh",
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"hooks": {
|
||||
"userPromptSubmit": [
|
||||
{
|
||||
"command": "powershell -ExecutionPolicy Bypass -File .cursor/hooks/user-prompt-submit.ps1",
|
||||
"timeout": 5
|
||||
}
|
||||
],
|
||||
"preToolUse": [
|
||||
{
|
||||
"command": "powershell -ExecutionPolicy Bypass -File .cursor/hooks/pre-tool-use.ps1",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# planning-with-files: Post-tool-use hook for Cursor (PowerShell)
|
||||
# Reminds the agent to update task_plan.md after file modifications.
|
||||
|
||||
Write-Output "[planning-with-files] File updated. If this completes a phase, update task_plan.md status."
|
||||
if (Test-Path "task_plan.md") {
|
||||
Write-Output "[planning-with-files] Update progress.md with what you just did. If a phase is now complete, update task_plan.md status."
|
||||
}
|
||||
exit 0
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
# planning-with-files: Post-tool-use hook for Cursor
|
||||
# Reminds the agent to update task_plan.md after file modifications.
|
||||
|
||||
echo "[planning-with-files] File updated. If this completes a phase, update task_plan.md status."
|
||||
if [ -f task_plan.md ]; then
|
||||
echo "[planning-with-files] Update progress.md with what you just did. If a phase is now complete, update task_plan.md status."
|
||||
fi
|
||||
exit 0
|
||||
|
||||
@@ -26,8 +26,9 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
|
||||
}
|
||||
|
||||
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
|
||||
Write-Host "{`"followup_message`": `"[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL). If the user has additional work, add new phases to task_plan.md before starting.`"}"
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host "{`"followup_message`": `"[planning-with-files] Task incomplete ($COMPLETE/$TOTAL phases done). Read task_plan.md and continue working on the remaining phases.`"}"
|
||||
Write-Host "{`"followup_message`": `"[planning-with-files] Task incomplete ($COMPLETE/$TOTAL phases done). Update progress.md, then read task_plan.md and continue working on the remaining phases.`"}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -33,10 +33,11 @@ fi
|
||||
: "${PENDING:=0}"
|
||||
|
||||
if [ "$COMPLETE" -eq "$TOTAL" ] && [ "$TOTAL" -gt 0 ]; then
|
||||
# All phases complete, allow stop
|
||||
# All phases complete — provide re-entry guidance
|
||||
echo "{\"followup_message\": \"[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL). If the user has additional work, add new phases to task_plan.md before starting.\"}"
|
||||
exit 0
|
||||
else
|
||||
# Phases incomplete — auto-continue via followup_message
|
||||
echo "{\"followup_message\": \"[planning-with-files] Task incomplete ($COMPLETE/$TOTAL phases done). Read task_plan.md and continue working on the remaining phases.\"}"
|
||||
echo "{\"followup_message\": \"[planning-with-files] Task incomplete ($COMPLETE/$TOTAL phases done). Update progress.md, then read task_plan.md and continue working on the remaining phases.\"}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# planning-with-files: User prompt submit hook for Cursor (PowerShell)
|
||||
# Reminds the agent about active planning files on every user message.
|
||||
# Critical for session recovery after context reset.
|
||||
|
||||
if (Test-Path "task_plan.md") {
|
||||
Write-Output "[planning-with-files] Active plan detected. If you have not read task_plan.md, progress.md, and findings.md in this conversation, read them now before proceeding."
|
||||
}
|
||||
exit 0
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# planning-with-files: User prompt submit hook for Cursor
|
||||
# Reminds the agent about active planning files on every user message.
|
||||
# Critical for session recovery after context reset.
|
||||
|
||||
if [ -f task_plan.md ]; then
|
||||
echo "[planning-with-files] Active plan detected. If you have not read task_plan.md, progress.md, and findings.md in this conversation, read them now before proceeding."
|
||||
fi
|
||||
exit 0
|
||||
+10
-2
@@ -1,4 +1,12 @@
|
||||
{
|
||||
"UserPromptSubmit": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "if [ -f task_plan.md ]; then echo '[planning-with-files] Active plan detected. If you have not read task_plan.md, progress.md, and findings.md in this conversation, read them now before proceeding.'; fi",
|
||||
"timeout": 5000,
|
||||
"description": "Remind agent about active plan on every user message for session recovery"
|
||||
}
|
||||
],
|
||||
"PreToolUse": [
|
||||
{
|
||||
"type": "command",
|
||||
@@ -11,9 +19,9 @@
|
||||
"PostToolUse": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "echo '[planning-with-files] File updated. If this completes a phase, update task_plan.md status.'",
|
||||
"command": "if [ -f task_plan.md ]; then echo '[planning-with-files] Update progress.md with what you just did. If a phase is now complete, update task_plan.md status.'; fi",
|
||||
"matcher": { "tool_name": "Write|Edit" },
|
||||
"description": "Remind agent to update plan status after file changes"
|
||||
"description": "Remind agent to update progress and plan status after file changes"
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
|
||||
Reference in New Issue
Block a user