Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@
"Bash(deepwork rules clear_queue)",
"Bash(rm -rf .deepwork/tmp/rules/queue/*.json)",
"Skill(manual_tests.reset)",
"Skill(manual_tests.infinite_block_tests)"
"Skill(manual_tests.infinite_block_tests)",
"Read(./.deepwork/**)",
"Edit(./.deepwork/**)",
"Write(./.deepwork/**)",
"Bash(deepwork:*)"
]
},
"hooks": {
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/deepwork_jobs.define/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand Down Expand Up @@ -61,10 +61,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# deepwork_jobs.define
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/deepwork_jobs.implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -55,10 +55,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# deepwork_jobs.implement
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/deepwork_jobs.learn/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand Down Expand Up @@ -60,10 +60,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# deepwork_jobs.learn
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/deepwork_jobs.review_job_spec/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -45,10 +45,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# deepwork_jobs.review_job_spec
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/manual_tests.infinite_block_tests/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -45,10 +45,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# manual_tests.infinite_block_tests
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/manual_tests.reset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -39,10 +39,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# manual_tests.reset
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/manual_tests.run_fire_tests/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -51,10 +51,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# manual_tests.run_fire_tests
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/manual_tests.run_not_fire_tests/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
SubagentStop:
- hooks:
- type: prompt
Expand All @@ -51,10 +51,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
---

# manual_tests.run_not_fire_tests
Expand Down
11 changes: 6 additions & 5 deletions doc/platforms/claude/hooks_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ hooks:
- type: prompt
prompt: |
Verify all acceptance criteria are met.
If met, respond: {"ok": true}
If not met, respond: {"ok": false, "reason": "..."}
If met, let the agent finish.
If not met, have the agent keep working until all criteria are satisfied.
```

**Blocking behavior**: Return JSON with `{"decision": "block", "reason": "..."}` or exit code 2 with stderr message.
Expand Down Expand Up @@ -191,7 +191,8 @@ hooks:
- type: prompt
prompt: |
Evaluate whether the response meets all criteria.
Respond with {"ok": true} or {"ok": false, "reason": "..."}
If all criteria are met, let the agent finish.
If criteria are not met, have the agent keep working.
```

## Quality Validation Loop Pattern
Expand Down Expand Up @@ -219,9 +220,9 @@ hooks:
3. Documentation updated

Review the conversation. If ALL criteria met and
<promise> tag present, respond: {"ok": true}
<promise> tag present, let the agent finish.

Otherwise respond: {"ok": false, "reason": "..."}
Otherwise, have the agent keep working until all criteria are satisfied.
```

## Comparison with Other Platforms
Expand Down
12 changes: 12 additions & 0 deletions src/deepwork/templates/claude/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Claude Templates - Agent Notes

Notes for AI agents working on Claude Code jinja templates.

## Prompt-Based Hooks

When writing prompt-based hooks (e.g., Stop hooks with `type: prompt`):

- **Do NOT include instructions on how to return responses** (e.g., "respond with JSON", "return `{"ok": true}`"). Claude Code's internal instructions already specify the expected response format for prompt hooks.
- Adding redundant response format instructions can cause conflicts or confusion with the built-in behavior. i.e. the hook will not block the agent from stopping.

Reference: https://github.com/anthropics/claude-code/issues/11786
6 changes: 3 additions & 3 deletions src/deepwork/templates/claude/skill-job-step.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ hooks:
Look for evidence that each criterion has been addressed.

If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response OR
all criteria appear to be met, respond with: {"ok": true}
all criteria appear to be met, let the agent finish.

If criteria are NOT met AND the promise tag is missing, respond with:
{"ok": false, "reason": "**AGENT: TAKE ACTION** - [which criteria failed and why]"}
If criteria are NOT met AND the promise tag is missing, have the agent keep working
until all criteria are satisfied.
{% endfor %}
{% endif %}
{% for event_name, event_hooks in hooks.items() %}
Expand Down