You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent mixing hook types in job schema validation
Updates the job schema to enforce that each hook event (after_agent,
before_tool, before_prompt) can only contain hooks of a single type -
either all scripts, all prompts, or all prompt_files. Mixing types
like having both a script and a prompt in the same event is now rejected.
This prevents confusing configurations where script output would be
followed by a prompt evaluation, which doesn't work as expected.
Adds tests to verify:
- Mixed script/prompt hooks are rejected
- Mixed script/prompt_file hooks are rejected
- Multiple scripts in same event are allowed
- Multiple prompts in same event are allowed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Evaluate the ruff format and lint check output above.
11
-
12
-
**If ruff reported issues (exit code non-zero)**: Start your response with "**AGENT: TAKE ACTION** -" followed by what needs to be fixed.
13
-
14
-
**If ruff reported no issues (exit code 0)**: Confirm the agent included `<promise>✓ Quality Criteria Met</promise>`. Allow completion.
15
-
16
8
---
17
9
18
10
# commit.format
@@ -128,11 +120,20 @@ No file output is required. Success is determined by ruff passing all checks.
128
120
-`uv run ruff check src/ tests/` passes (exit code 0)
129
121
- Any fixes made don't break functionality (tests should still pass)
130
122
- If issues couldn't be fixed in 5 attempts, clear explanation provided
131
-
- When all checks pass, include `<promise>✓ Quality Criteria Met</promise>` in your response
123
+
124
+
## Hook Behavior
125
+
126
+
After you complete this step, a hook will automatically run ruff format and lint checks and show you the results.
127
+
128
+
**Interpreting the hook output:**
129
+
-**Both checks passed (exit code 0)**: The step is complete. Proceed to the next step.
130
+
-**Checks failed (exit code non-zero)**: You must fix the issues. Use `uv run ruff format src/ tests/` for formatting and `uv run ruff check --fix src/ tests/` for auto-fixable lint issues. For remaining issues, fix manually. The hook will re-run after each attempt.
131
+
132
+
**Important**: The hook runs automatically - you don't need to run the checks yourself after fixing. Just focus on making fixes, and the hook will verify them.
132
133
133
134
## Context
134
135
135
-
This is the second step in the commit workflow, after tests pass. Code must be properly formatted and lint-free before committing. The format step uses a script hook that automatically runs ruff checks, so focus on analyzing results and making fixes efficiently.
136
+
This is the second step in the commit workflow, after tests pass. Code must be properly formatted and lint-free before committing.
**If any tests failed**: Start your response with "**AGENT: TAKE ACTION** -" followed by which tests failed and why.
13
-
14
-
**If ALL tests passed**: Confirm the agent included `<promise>✓ Quality Criteria Met</promise>`. Allow completion.
15
-
16
8
---
17
9
18
10
# commit.test
@@ -100,11 +92,20 @@ No file output is required. Success is determined by all tests passing.
100
92
- All tests pass (`uv run pytest tests/ -v` exits with code 0)
101
93
- Any fixes made are minimal and don't break other functionality
102
94
- If tests couldn't be fixed in 5 attempts, clear explanation provided
103
-
- When all tests pass, include `<promise>✓ Quality Criteria Met</promise>` in your response
95
+
96
+
## Hook Behavior
97
+
98
+
After you complete this step, a hook will automatically run `uv run pytest tests/ -v` and show you the results.
99
+
100
+
**Interpreting the hook output:**
101
+
-**All tests passed (exit code 0)**: The step is complete. Proceed to the next step.
102
+
-**Tests failed (exit code non-zero)**: You must fix the failing tests. Analyze the output, make fixes, and try again. The hook will re-run after each attempt.
103
+
104
+
**Important**: The hook runs automatically - you don't need to run pytest yourself after the initial run. Just focus on making fixes when tests fail, and the hook will verify your fixes.
104
105
105
106
## Context
106
107
107
-
This is the first step in the commit workflow. Tests must pass before code formatting is checked, ensuring that any changes being committed are functionally correct. The test step uses a script hook that automatically runs pytest, so focus on analyzing results and making fixes.
108
+
This is the first step in the commit workflow. Tests must pass before code formatting is checked, ensuring that any changes being committed are functionally correct.
Copy file name to clipboardExpand all lines: .claude/commands/uw.deepwork_jobs.implement.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ hooks:
17
17
6. **Ask Structured Questions**: Do step instructions that gather user input explicitly use the phrase "ask structured questions"?
18
18
7. **Sync Complete**: Has `deepwork sync` been run successfully?
19
19
8. **Commands Available**: Are the slash-commands generated in `.claude/commands/`?
20
-
9. **Policies Considered**: Has the agent thought about whether policies would benefit this job? If relevant policies were identified, did they explain them and offer to run `/deepwork_policy.define`? Not every job needs policies - only suggest when genuinely helpful.
20
+
9. **Rules Considered**: Has the agent thought about whether rules would benefit this job? If relevant rules were identified, did they explain them and offer to run `/deepwork_rules.define`? Not every job needs rules - only suggest when genuinely helpful.
21
21
22
22
## Instructions
23
23
@@ -192,48 +192,48 @@ This will:
192
192
193
193
After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI).
194
194
195
-
### Step 7: Consider Policies for the New Job
195
+
### Step 7: Consider Rules for the New Job
196
196
197
-
After implementing the job, consider whether there are **policies** that would help enforce quality or consistency when working with this job's domain.
197
+
After implementing the job, consider whether there are **rules** that would help enforce quality or consistency when working with this job's domain.
198
198
199
-
**What are policies?**
199
+
**What are rules?**
200
200
201
-
Policies are automated guardrails defined in `.deepwork.policy.yml` that trigger when certain files change during an AI session. They help ensure:
201
+
Rules are automated guardrails stored as markdown files in `.deepwork/rules/` that trigger when certain files change during an AI session. They help ensure:
202
202
- Documentation stays in sync with code
203
203
- Team guidelines are followed
204
204
- Architectural decisions are respected
205
205
- Quality standards are maintained
206
206
207
-
**When to suggest policies:**
207
+
**When to suggest rules:**
208
208
209
209
Think about the job you just implemented and ask:
210
210
- Does this job produce outputs that other files depend on?
211
211
- Are there documentation files that should be updated when this job's outputs change?
212
212
- Are there quality checks or reviews that should happen when certain files in this domain change?
213
213
- Could changes to the job's output files impact other parts of the project?
214
214
215
-
**Examples of policies that might make sense:**
215
+
**Examples of rules that might make sense:**
216
216
217
-
| Job Type | Potential Policy |
218
-
|----------|------------------|
217
+
| Job Type | Potential Rule |
218
+
|----------|----------------|
219
219
| API Design | "Update API docs when endpoint definitions change" |
If you identify one or more policies that would benefit the user, explain:
228
-
1. **What the policy would do** - What triggers it and what action it prompts
227
+
If you identify one or more rules that would benefit the user, explain:
228
+
1. **What the rule would do** - What triggers it and what action it prompts
229
229
2. **Why it would help** - How it prevents common mistakes or keeps things in sync
230
230
3. **What files it would watch** - The trigger patterns
231
231
232
232
Then ask the user:
233
233
234
-
> "Would you like me to create this policy for you? I can run `/deepwork_policy.define` to set it up."
234
+
> "Would you like me to create this rule for you? I can run `/deepwork_rules.define` to set it up."
235
235
236
-
If the user agrees, invoke the `/deepwork_policy.define` command to guide them through creating the policy.
236
+
If the user agrees, invoke the `/deepwork_rules.define` command to guide them through creating the rule.
237
237
238
238
**Example dialogue:**
239
239
@@ -242,15 +242,15 @@ Based on the competitive_research job you just created, I noticed that when
242
242
competitor analysis files change, it would be helpful to remind you to update
243
243
your strategy documentation.
244
244
245
-
I'd suggest a policy like:
245
+
I'd suggest a rule like:
246
246
-**Name**: "Update strategy when competitor analysis changes"
247
247
-**Trigger**: `**/positioning_report.md`
248
248
-**Action**: Prompt to review and update `docs/strategy.md`
249
249
250
-
Would you like me to create this policy? I can run `/deepwork_policy.define` to set it up.
250
+
Would you like me to create this rule? I can run `/deepwork_rules.define` to set it up.
251
251
```
252
252
253
-
**Note:** Not every job needs policies. Only suggest them when they would genuinely help maintain consistency or quality. Don't force policies where they don't make sense.
253
+
**Note:** Not every job needs rules. Only suggest them when they would genuinely help maintain consistency or quality. Don't force rules where they don't make sense.
254
254
255
255
## Example Implementation
256
256
@@ -284,8 +284,8 @@ Before marking this step complete, ensure:
284
284
- [ ] `deepwork sync` executed successfully
285
285
- [ ] Commands generated in platform directory
286
286
- [ ] User informed to follow reload instructions from `deepwork sync`
287
-
- [ ] Considered whether policies would benefit this job (Step 7)
288
-
- [ ] If policies suggested, offered to run `/deepwork_policy.define`
287
+
- [ ] Considered whether rules would benefit this job (Step 7)
288
+
- [ ] If rules suggested, offered to run `/deepwork_rules.define`
289
289
290
290
## Quality Criteria
291
291
@@ -297,7 +297,7 @@ Before marking this step complete, ensure:
297
297
- Steps with user inputs explicitly use "ask structured questions" phrasing
298
298
- Sync completed successfully
299
299
- Commands available for use
300
-
- Thoughtfully considered relevant policies for the job domain
300
+
- Thoughtfully considered relevant rules for the job domain
301
301
302
302
303
303
## Inputs
@@ -346,7 +346,7 @@ This step uses an iterative quality validation loop. After completing your work,
346
346
6.**Ask Structured Questions**: Do step instructions that gather user input explicitly use the phrase "ask structured questions"?
347
347
7.**Sync Complete**: Has `deepwork sync` been run successfully?
348
348
8.**Commands Available**: Are the slash-commands generated in `.claude/commands/`?
349
-
9.**Policies Considered**: Has the agent thought about whether policies would benefit this job? If relevant policies were identified, did they explain them and offer to run `/deepwork_policy.define`? Not every job needs policies - only suggest when genuinely helpful.
349
+
9.**Rules Considered**: Has the agent thought about whether rules would benefit this job? If relevant rules were identified, did they explain them and offer to run `/deepwork_rules.define`? Not every job needs rules - only suggest when genuinely helpful.
0 commit comments