From 10f969a5b0248b2577bf54ef9e853a176a5321b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Jan 2026 20:47:44 +0000 Subject: [PATCH 1/3] Improve promise tag format to show policy name with checkmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the promise tag body from generic "addressed" text to a more compelling "✓ Policy Name" format that clearly shows which policy was addressed. This provides better visibility for end users when viewing the LLM's response. --- .claude/commands/deepwork_policy.define.md | 2 +- .deepwork/jobs/deepwork_policy/steps/define.md | 2 +- .gemini/commands/deepwork_policy/define.toml | 2 +- README.md | 2 +- doc/architecture.md | 2 +- src/deepwork/hooks/evaluate_policies.py | 4 ++-- src/deepwork/standard_jobs/deepwork_policy/steps/define.md | 2 +- tests/unit/test_evaluate_policies.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.claude/commands/deepwork_policy.define.md b/.claude/commands/deepwork_policy.define.md index 6ff16c72..44dcc4ae 100644 --- a/.claude/commands/deepwork_policy.define.md +++ b/.claude/commands/deepwork_policy.define.md @@ -203,7 +203,7 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `considered` in your response. This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. ## Inputs diff --git a/.deepwork/jobs/deepwork_policy/steps/define.md b/.deepwork/jobs/deepwork_policy/steps/define.md index b2114bef..2d11b213 100644 --- a/.deepwork/jobs/deepwork_policy/steps/define.md +++ b/.deepwork/jobs/deepwork_policy/steps/define.md @@ -171,4 +171,4 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `considered` in your response. This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. diff --git a/.gemini/commands/deepwork_policy/define.toml b/.gemini/commands/deepwork_policy/define.toml index 9333a940..85a4ff80 100644 --- a/.gemini/commands/deepwork_policy/define.toml +++ b/.gemini/commands/deepwork_policy/define.toml @@ -208,7 +208,7 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `considered` in your response. This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. ## Inputs diff --git a/README.md b/README.md index f93a7213..d4f52fc8 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ Policies automatically enforce team guidelines when files change: 1. When you start a Claude Code session, the baseline git state is captured 2. When the agent finishes, changed files are compared against policy triggers 3. If policies fire (trigger matches, no safety match), Claude is prompted to address them -4. Use `addressed` to mark policies as handled +4. Use `✓ Policy Name` to mark policies as handled **Use cases**: - Keep documentation in sync with code changes diff --git a/doc/architecture.md b/doc/architecture.md index e98ef5d1..fbd20eff 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -1033,7 +1033,7 @@ Policies are defined in `.deepwork.policy.yml` at the project root: - The agent hasn't marked it with a `` tag - → The policy fires - If policies fire, Claude is prompted to address them -4. **Promise Tags**: Agents can mark policies as addressed by including `addressed` in their response +4. **Promise Tags**: Agents can mark policies as addressed by including `✓ Policy Name` in their response ### Hook Integration diff --git a/src/deepwork/hooks/evaluate_policies.py b/src/deepwork/hooks/evaluate_policies.py index 341b6d16..7882768f 100644 --- a/src/deepwork/hooks/evaluate_policies.py +++ b/src/deepwork/hooks/evaluate_policies.py @@ -63,8 +63,8 @@ def format_policy_message(policies: list) -> str: lines = ["## DeepWork Policies Triggered", ""] lines.append( "Comply with the following policies. " - 'To mark a policy as addressed, include `addressed` ' - "in your response." + 'To mark a policy as addressed, include `✓ Policy Name` ' + "in your response (replace Policy Name with the actual policy name)." ) lines.append("") diff --git a/src/deepwork/standard_jobs/deepwork_policy/steps/define.md b/src/deepwork/standard_jobs/deepwork_policy/steps/define.md index b2114bef..2d11b213 100644 --- a/src/deepwork/standard_jobs/deepwork_policy/steps/define.md +++ b/src/deepwork/standard_jobs/deepwork_policy/steps/define.md @@ -171,4 +171,4 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `considered` in your response. This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. diff --git a/tests/unit/test_evaluate_policies.py b/tests/unit/test_evaluate_policies.py index 99b88b23..be0109ef 100644 --- a/tests/unit/test_evaluate_policies.py +++ b/tests/unit/test_evaluate_policies.py @@ -9,7 +9,7 @@ class TestExtractPromiseTags: def test_extracts_double_quote_promise(self) -> None: """Test extracting promise with double quotes.""" - text = 'addressed' + text = '✓ Update Docs' result = extract_promise_tags(text) assert result == {"Update Docs"} From 5ab0d5f73075ebf1e5e4db6f88db32a676ad6bed Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Jan 2026 23:04:16 +0000 Subject: [PATCH 2/3] Simplify promise tag format and improve QUALITY_COMPLETE display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - Remove redundant policy= attribute from promise tags - New format: ✓ Policy Name - Extract policy name from tag body after checkmark - Update QUALITY_COMPLETE to ✓ Quality Criteria Met - Update all documentation and tests This makes the promise format less redundant and more user-friendly when displayed in LLM responses. --- .../commands/add_platform.add_capabilities.md | 10 +++--- .claude/commands/add_platform.implement.md | 10 +++--- .claude/commands/add_platform.research.md | 10 +++--- .claude/commands/add_platform.verify.md | 10 +++--- .claude/commands/deepwork_jobs.define.md | 10 +++--- .claude/commands/deepwork_jobs.implement.md | 12 +++---- .claude/commands/deepwork_jobs.refine.md | 8 ++--- .claude/commands/deepwork_policy.define.md | 2 +- .deepwork/jobs/add_platform/job.yml | 8 ++--- .../add_platform/steps/add_capabilities.md | 2 +- .../jobs/add_platform/steps/implement.md | 2 +- .deepwork/jobs/add_platform/steps/research.md | 2 +- .deepwork/jobs/add_platform/steps/verify.md | 2 +- .deepwork/jobs/deepwork_jobs/job.yml | 6 ++-- .deepwork/jobs/deepwork_jobs/steps/define.md | 2 +- .../jobs/deepwork_jobs/steps/implement.md | 4 +-- .../jobs/deepwork_policy/steps/define.md | 2 +- .../add_platform/add_capabilities.toml | 2 +- .gemini/commands/add_platform/implement.toml | 2 +- .gemini/commands/add_platform/research.toml | 2 +- .gemini/commands/add_platform/verify.toml | 2 +- .gemini/commands/deepwork_jobs/define.toml | 2 +- .gemini/commands/deepwork_jobs/implement.toml | 4 +-- .gemini/commands/deepwork_policy/define.toml | 2 +- README.md | 2 +- doc/architecture.md | 2 +- src/deepwork/hooks/evaluate_policies.py | 13 ++++---- .../standard_jobs/deepwork_jobs/job.yml | 6 ++-- .../deepwork_jobs/steps/define.md | 2 +- .../deepwork_jobs/steps/implement.md | 4 +-- .../deepwork_policy/steps/define.md | 2 +- .../claude/command-job-step.md.jinja | 4 +-- tests/unit/test_evaluate_policies.py | 32 +++++++------------ 33 files changed, 87 insertions(+), 98 deletions(-) diff --git a/.claude/commands/add_platform.add_capabilities.md b/.claude/commands/add_platform.add_capabilities.md index 902ea1fe..dac48f9f 100644 --- a/.claude/commands/add_platform.add_capabilities.md +++ b/.claude/commands/add_platform.add_capabilities.md @@ -18,7 +18,7 @@ hooks: 5. adapters.py remains consistent - all adapters have the same hook fields 6. If no new hooks are needed, document why in a comment - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. ## Instructions @@ -26,7 +26,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -178,7 +178,7 @@ Or if no changes are needed, add a documentation comment: - `job_schema.py` has no syntax errors (verified with py_compile) - `adapters.py` has no syntax errors (verified with py_compile) - All adapters have consistent hook fields (same fields across all adapters) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context @@ -251,7 +251,7 @@ Verify the capability additions meet ALL criteria: 5. adapters.py remains consistent - all adapters have the same hook fields 6. If no new hooks are needed, document why in a comment -If ALL criteria are met, include `QUALITY_COMPLETE`. +If ALL criteria are met, include `✓ Quality Criteria Met`. ### Completion Promise @@ -259,7 +259,7 @@ If ALL criteria are met, include `QUALITY_COMPLETE`. To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/add_platform.implement.md b/.claude/commands/add_platform.implement.md index e204f9fe..098fb55e 100644 --- a/.claude/commands/add_platform.implement.md +++ b/.claude/commands/add_platform.implement.md @@ -22,7 +22,7 @@ hooks: - Installation instructions for the platform - Any platform-specific notes - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. ## Instructions @@ -30,7 +30,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -281,7 +281,7 @@ deepwork install --platform - Platform listed in supported platforms - Installation command documented - Any platform-specific notes included -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context @@ -354,7 +354,7 @@ Verify the implementation meets ALL criteria: - Installation instructions for the platform - Any platform-specific notes -If ALL criteria are met, include `QUALITY_COMPLETE`. +If ALL criteria are met, include `✓ Quality Criteria Met`. ### Completion Promise @@ -362,7 +362,7 @@ If ALL criteria are met, include `QUALITY_COMPLETE`. To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/add_platform.research.md b/.claude/commands/add_platform.research.md index 303737b2..3fd6ec01 100644 --- a/.claude/commands/add_platform.research.md +++ b/.claude/commands/add_platform.research.md @@ -19,7 +19,7 @@ hooks: 5. No extraneous documentation (only these two specific topics) 6. Documentation is comprehensive enough to implement the platform - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. ## Instructions @@ -27,7 +27,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -234,7 +234,7 @@ Source: [URL where this documentation was obtained] - NOT general CLI hooks (only command-level hooks) - Documentation is detailed enough to implement the platform adapter - No extraneous topics (only CLI config and command hooks) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context @@ -298,7 +298,7 @@ Verify the research output meets ALL criteria: 5. No extraneous documentation (only these two specific topics) 6. Documentation is comprehensive enough to implement the platform -If ALL criteria are met, include `QUALITY_COMPLETE`. +If ALL criteria are met, include `✓ Quality Criteria Met`. ### Completion Promise @@ -306,7 +306,7 @@ If ALL criteria are met, include `QUALITY_COMPLETE`. To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/add_platform.verify.md b/.claude/commands/add_platform.verify.md index f13f7957..d92da75a 100644 --- a/.claude/commands/add_platform.verify.md +++ b/.claude/commands/add_platform.verify.md @@ -17,7 +17,7 @@ hooks: 5. Established DeepWork jobs (deepwork_jobs, deepwork_policy) are installed correctly 6. The platform can be used alongside existing platforms without conflicts - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. ## Instructions @@ -25,7 +25,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -159,7 +159,7 @@ Ensure the implementation step is complete: - No template errors or missing content - Existing platforms still work (if applicable) - No conflicts between platforms -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context @@ -221,7 +221,7 @@ Verify the installation meets ALL criteria: 5. Established DeepWork jobs (deepwork_jobs, deepwork_policy) are installed correctly 6. The platform can be used alongside existing platforms without conflicts -If ALL criteria are met, include `QUALITY_COMPLETE`. +If ALL criteria are met, include `✓ Quality Criteria Met`. ### Completion Promise @@ -229,7 +229,7 @@ If ALL criteria are met, include `QUALITY_COMPLETE`. To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/deepwork_jobs.define.md b/.claude/commands/deepwork_jobs.define.md index 76723ba5..2030d982 100644 --- a/.claude/commands/deepwork_jobs.define.md +++ b/.claude/commands/deepwork_jobs.define.md @@ -20,7 +20,7 @@ hooks: 7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ## Instructions @@ -28,7 +28,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -235,7 +235,7 @@ steps: Verify this step's output meets quality criteria: 1. [Criterion 1] 2. [Criterion 2] - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: [another_step] name: "[Another Step]" @@ -464,7 +464,7 @@ Verify the job.yml output meets ALL quality criteria before completing: 7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`? If ANY criterion is not met, continue working to address it. -If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. +If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ### Completion Promise @@ -472,7 +472,7 @@ If ALL criteria are satisfied, include `QUALITY_COMPLETE` in To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/deepwork_jobs.implement.md b/.claude/commands/deepwork_jobs.implement.md index 4f414427..b2c3d7e8 100644 --- a/.claude/commands/deepwork_jobs.implement.md +++ b/.claude/commands/deepwork_jobs.implement.md @@ -24,7 +24,7 @@ hooks: - Not every job needs policies - only suggest when genuinely helpful. If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ## Instructions @@ -32,7 +32,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -187,7 +187,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil 1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the stop hooks will validate 2. **Be explicit about success** - Help the agent understand when the step is truly complete -3. **Include the promise pattern** - Mention that `QUALITY_COMPLETE` should be included when criteria are met +3. **Include the promise pattern** - Mention that `✓ Quality Criteria Met` should be included when criteria are met **Example: If the job.yml has:** ```yaml @@ -208,7 +208,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil - Each competitor has at least 3 distinct data points - All information is sourced with citations - Data is current (from within the last year) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ``` This alignment ensures the AI agent knows exactly what will be validated and can self-check before completing. @@ -556,7 +556,7 @@ Verify the implementation meets ALL quality criteria before completing: - Not every job needs policies - only suggest when genuinely helpful. If ANY criterion is not met, continue working to address it. -If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. +If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ### Completion Promise @@ -564,7 +564,7 @@ If ALL criteria are satisfied, include `QUALITY_COMPLETE` in To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/deepwork_jobs.refine.md b/.claude/commands/deepwork_jobs.refine.md index 7801c1f6..84479a61 100644 --- a/.claude/commands/deepwork_jobs.refine.md +++ b/.claude/commands/deepwork_jobs.refine.md @@ -21,7 +21,7 @@ hooks: 8. **Sync Complete**: Has `deepwork sync` been run to regenerate commands? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ## Instructions @@ -29,7 +29,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -554,7 +554,7 @@ Verify the refinement meets ALL quality criteria before completing: 8. **Sync Complete**: Has `deepwork sync` been run to regenerate commands? If ANY criterion is not met, continue working to address it. -If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. +If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. ### Completion Promise @@ -562,7 +562,7 @@ If ALL criteria are satisfied, include `QUALITY_COMPLETE` in To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/.claude/commands/deepwork_policy.define.md b/.claude/commands/deepwork_policy.define.md index 44dcc4ae..b671de19 100644 --- a/.claude/commands/deepwork_policy.define.md +++ b/.claude/commands/deepwork_policy.define.md @@ -203,7 +203,7 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. ## Inputs diff --git a/.deepwork/jobs/add_platform/job.yml b/.deepwork/jobs/add_platform/job.yml index bf35577d..07544743 100644 --- a/.deepwork/jobs/add_platform/job.yml +++ b/.deepwork/jobs/add_platform/job.yml @@ -49,7 +49,7 @@ steps: 5. No extraneous documentation (only these two specific topics) 6. Documentation is comprehensive enough to implement the platform - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: add_capabilities name: "Add Hook Capabilities" @@ -75,7 +75,7 @@ steps: 5. adapters.py remains consistent - all adapters have the same hook fields 6. If no new hooks are needed, document why in a comment - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: implement name: "Implement Platform Support" @@ -110,7 +110,7 @@ steps: - Installation instructions for the platform - Any platform-specific notes - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: verify name: "Verify Installation" @@ -133,4 +133,4 @@ steps: 5. Established DeepWork jobs (deepwork_jobs, deepwork_policy) are installed correctly 6. The platform can be used alongside existing platforms without conflicts - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. diff --git a/.deepwork/jobs/add_platform/steps/add_capabilities.md b/.deepwork/jobs/add_platform/steps/add_capabilities.md index 46812245..5389213a 100644 --- a/.deepwork/jobs/add_platform/steps/add_capabilities.md +++ b/.deepwork/jobs/add_platform/steps/add_capabilities.md @@ -108,7 +108,7 @@ Or if no changes are needed, add a documentation comment: - `job_schema.py` has no syntax errors (verified with py_compile) - `adapters.py` has no syntax errors (verified with py_compile) - All adapters have consistent hook fields (same fields across all adapters) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.deepwork/jobs/add_platform/steps/implement.md b/.deepwork/jobs/add_platform/steps/implement.md index 760cc251..55ff6ec7 100644 --- a/.deepwork/jobs/add_platform/steps/implement.md +++ b/.deepwork/jobs/add_platform/steps/implement.md @@ -206,7 +206,7 @@ deepwork install --platform - Platform listed in supported platforms - Installation command documented - Any platform-specific notes included -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.deepwork/jobs/add_platform/steps/research.md b/.deepwork/jobs/add_platform/steps/research.md index 4c7d1e0f..c4ee425e 100644 --- a/.deepwork/jobs/add_platform/steps/research.md +++ b/.deepwork/jobs/add_platform/steps/research.md @@ -169,7 +169,7 @@ Source: [URL where this documentation was obtained] - NOT general CLI hooks (only command-level hooks) - Documentation is detailed enough to implement the platform adapter - No extraneous topics (only CLI config and command hooks) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.deepwork/jobs/add_platform/steps/verify.md b/.deepwork/jobs/add_platform/steps/verify.md index 7288d79b..c4d35ffc 100644 --- a/.deepwork/jobs/add_platform/steps/verify.md +++ b/.deepwork/jobs/add_platform/steps/verify.md @@ -90,7 +90,7 @@ Ensure the implementation step is complete: - No template errors or missing content - Existing platforms still work (if applicable) - No conflicts between platforms -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.deepwork/jobs/deepwork_jobs/job.yml b/.deepwork/jobs/deepwork_jobs/job.yml index f0c3a781..54301f14 100644 --- a/.deepwork/jobs/deepwork_jobs/job.yml +++ b/.deepwork/jobs/deepwork_jobs/job.yml @@ -41,7 +41,7 @@ steps: 7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. - id: implement name: "Implement Job Steps" @@ -72,7 +72,7 @@ steps: - Not every job needs policies - only suggest when genuinely helpful. If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. - id: refine name: "Refine Existing Job" @@ -99,4 +99,4 @@ steps: 8. **Sync Complete**: Has `deepwork sync` been run to regenerate commands? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. diff --git a/.deepwork/jobs/deepwork_jobs/steps/define.md b/.deepwork/jobs/deepwork_jobs/steps/define.md index aceb3677..d9610603 100644 --- a/.deepwork/jobs/deepwork_jobs/steps/define.md +++ b/.deepwork/jobs/deepwork_jobs/steps/define.md @@ -176,7 +176,7 @@ steps: Verify this step's output meets quality criteria: 1. [Criterion 1] 2. [Criterion 2] - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: [another_step] name: "[Another Step]" diff --git a/.deepwork/jobs/deepwork_jobs/steps/implement.md b/.deepwork/jobs/deepwork_jobs/steps/implement.md index bb100a3c..de77741d 100644 --- a/.deepwork/jobs/deepwork_jobs/steps/implement.md +++ b/.deepwork/jobs/deepwork_jobs/steps/implement.md @@ -118,7 +118,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil 1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the stop hooks will validate 2. **Be explicit about success** - Help the agent understand when the step is truly complete -3. **Include the promise pattern** - Mention that `QUALITY_COMPLETE` should be included when criteria are met +3. **Include the promise pattern** - Mention that `✓ Quality Criteria Met` should be included when criteria are met **Example: If the job.yml has:** ```yaml @@ -139,7 +139,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil - Each competitor has at least 3 distinct data points - All information is sourced with citations - Data is current (from within the last year) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ``` This alignment ensures the AI agent knows exactly what will be validated and can self-check before completing. diff --git a/.deepwork/jobs/deepwork_policy/steps/define.md b/.deepwork/jobs/deepwork_policy/steps/define.md index 2d11b213..0a47e55b 100644 --- a/.deepwork/jobs/deepwork_policy/steps/define.md +++ b/.deepwork/jobs/deepwork_policy/steps/define.md @@ -171,4 +171,4 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. diff --git a/.gemini/commands/add_platform/add_capabilities.toml b/.gemini/commands/add_platform/add_capabilities.toml index 0a0f0ce1..da2fec82 100644 --- a/.gemini/commands/add_platform/add_capabilities.toml +++ b/.gemini/commands/add_platform/add_capabilities.toml @@ -152,7 +152,7 @@ Or if no changes are needed, add a documentation comment: - `job_schema.py` has no syntax errors (verified with py_compile) - `adapters.py` has no syntax errors (verified with py_compile) - All adapters have consistent hook fields (same fields across all adapters) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.gemini/commands/add_platform/implement.toml b/.gemini/commands/add_platform/implement.toml index 39c5c379..4c348a38 100644 --- a/.gemini/commands/add_platform/implement.toml +++ b/.gemini/commands/add_platform/implement.toml @@ -251,7 +251,7 @@ deepwork install --platform - Platform listed in supported platforms - Installation command documented - Any platform-specific notes included -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.gemini/commands/add_platform/research.toml b/.gemini/commands/add_platform/research.toml index 4be39e9a..48f4afd1 100644 --- a/.gemini/commands/add_platform/research.toml +++ b/.gemini/commands/add_platform/research.toml @@ -207,7 +207,7 @@ Source: [URL where this documentation was obtained] - NOT general CLI hooks (only command-level hooks) - Documentation is detailed enough to implement the platform adapter - No extraneous topics (only CLI config and command hooks) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.gemini/commands/add_platform/verify.toml b/.gemini/commands/add_platform/verify.toml index 040fd991..1ee56ab8 100644 --- a/.gemini/commands/add_platform/verify.toml +++ b/.gemini/commands/add_platform/verify.toml @@ -134,7 +134,7 @@ Ensure the implementation step is complete: - No template errors or missing content - Existing platforms still work (if applicable) - No conflicts between platforms -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ## Context diff --git a/.gemini/commands/deepwork_jobs/define.toml b/.gemini/commands/deepwork_jobs/define.toml index 5e7ea51b..8d16386b 100644 --- a/.gemini/commands/deepwork_jobs/define.toml +++ b/.gemini/commands/deepwork_jobs/define.toml @@ -207,7 +207,7 @@ steps: Verify this step's output meets quality criteria: 1. [Criterion 1] 2. [Criterion 2] - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: [another_step] name: "[Another Step]" diff --git a/.gemini/commands/deepwork_jobs/implement.toml b/.gemini/commands/deepwork_jobs/implement.toml index 3c1958e8..d5f7dc19 100644 --- a/.gemini/commands/deepwork_jobs/implement.toml +++ b/.gemini/commands/deepwork_jobs/implement.toml @@ -155,7 +155,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil 1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the stop hooks will validate 2. **Be explicit about success** - Help the agent understand when the step is truly complete -3. **Include the promise pattern** - Mention that `QUALITY_COMPLETE` should be included when criteria are met +3. **Include the promise pattern** - Mention that `✓ Quality Criteria Met` should be included when criteria are met **Example: If the job.yml has:** ```yaml @@ -176,7 +176,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil - Each competitor has at least 3 distinct data points - All information is sourced with citations - Data is current (from within the last year) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ``` This alignment ensures the AI agent knows exactly what will be validated and can self-check before completing. diff --git a/.gemini/commands/deepwork_policy/define.toml b/.gemini/commands/deepwork_policy/define.toml index 85a4ff80..821e9289 100644 --- a/.gemini/commands/deepwork_policy/define.toml +++ b/.gemini/commands/deepwork_policy/define.toml @@ -208,7 +208,7 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. ## Inputs diff --git a/README.md b/README.md index d4f52fc8..a87d0371 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ Policies automatically enforce team guidelines when files change: 1. When you start a Claude Code session, the baseline git state is captured 2. When the agent finishes, changed files are compared against policy triggers 3. If policies fire (trigger matches, no safety match), Claude is prompted to address them -4. Use `✓ Policy Name` to mark policies as handled +4. Use `✓ Policy Name` to mark policies as handled **Use cases**: - Keep documentation in sync with code changes diff --git a/doc/architecture.md b/doc/architecture.md index fbd20eff..cd30f351 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -1033,7 +1033,7 @@ Policies are defined in `.deepwork.policy.yml` at the project root: - The agent hasn't marked it with a `` tag - → The policy fires - If policies fire, Claude is prompted to address them -4. **Promise Tags**: Agents can mark policies as addressed by including `✓ Policy Name` in their response +4. **Promise Tags**: Agents can mark policies as addressed by including `✓ Policy Name` in their response ### Hook Integration diff --git a/src/deepwork/hooks/evaluate_policies.py b/src/deepwork/hooks/evaluate_policies.py index 7882768f..a6d93083 100644 --- a/src/deepwork/hooks/evaluate_policies.py +++ b/src/deepwork/hooks/evaluate_policies.py @@ -34,9 +34,8 @@ def extract_promise_tags(text: str) -> set[str]: """ Extract policy names from tags in text. - Supported formats: - - ... - - ... + Supported format: + - ✓ Policy Name Args: text: Text to search for promise tags @@ -44,10 +43,10 @@ def extract_promise_tags(text: str) -> set[str]: Returns: Set of policy names that have been promised/addressed """ - # Match ... or - pattern = r'.*?' + # Match ✓ Policy Name and extract the policy name + pattern = r'✓\s*([^<]+)' matches = re.findall(pattern, text, re.IGNORECASE | re.DOTALL) - return set(matches) + return {m.strip() for m in matches} def format_policy_message(policies: list) -> str: @@ -63,7 +62,7 @@ def format_policy_message(policies: list) -> str: lines = ["## DeepWork Policies Triggered", ""] lines.append( "Comply with the following policies. " - 'To mark a policy as addressed, include `✓ Policy Name` ' + "To mark a policy as addressed, include `✓ Policy Name` " "in your response (replace Policy Name with the actual policy name)." ) lines.append("") diff --git a/src/deepwork/standard_jobs/deepwork_jobs/job.yml b/src/deepwork/standard_jobs/deepwork_jobs/job.yml index f0c3a781..54301f14 100644 --- a/src/deepwork/standard_jobs/deepwork_jobs/job.yml +++ b/src/deepwork/standard_jobs/deepwork_jobs/job.yml @@ -41,7 +41,7 @@ steps: 7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. - id: implement name: "Implement Job Steps" @@ -72,7 +72,7 @@ steps: - Not every job needs policies - only suggest when genuinely helpful. If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. - id: refine name: "Refine Existing Job" @@ -99,4 +99,4 @@ steps: 8. **Sync Complete**: Has `deepwork sync` been run to regenerate commands? If ANY criterion is not met, continue working to address it. - If ALL criteria are satisfied, include `QUALITY_COMPLETE` in your response. + If ALL criteria are satisfied, include `✓ Quality Criteria Met` in your response. diff --git a/src/deepwork/standard_jobs/deepwork_jobs/steps/define.md b/src/deepwork/standard_jobs/deepwork_jobs/steps/define.md index aceb3677..d9610603 100644 --- a/src/deepwork/standard_jobs/deepwork_jobs/steps/define.md +++ b/src/deepwork/standard_jobs/deepwork_jobs/steps/define.md @@ -176,7 +176,7 @@ steps: Verify this step's output meets quality criteria: 1. [Criterion 1] 2. [Criterion 2] - If ALL criteria are met, include `QUALITY_COMPLETE`. + If ALL criteria are met, include `✓ Quality Criteria Met`. - id: [another_step] name: "[Another Step]" diff --git a/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md b/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md index bb100a3c..de77741d 100644 --- a/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md +++ b/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md @@ -118,7 +118,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil 1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the stop hooks will validate 2. **Be explicit about success** - Help the agent understand when the step is truly complete -3. **Include the promise pattern** - Mention that `QUALITY_COMPLETE` should be included when criteria are met +3. **Include the promise pattern** - Mention that `✓ Quality Criteria Met` should be included when criteria are met **Example: If the job.yml has:** ```yaml @@ -139,7 +139,7 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil - Each competitor has at least 3 distinct data points - All information is sourced with citations - Data is current (from within the last year) -- When all criteria are met, include `QUALITY_COMPLETE` in your response +- When all criteria are met, include `✓ Quality Criteria Met` in your response ``` This alignment ensures the AI agent knows exactly what will be validated and can self-check before completing. diff --git a/src/deepwork/standard_jobs/deepwork_policy/steps/define.md b/src/deepwork/standard_jobs/deepwork_policy/steps/define.md index 2d11b213..0a47e55b 100644 --- a/src/deepwork/standard_jobs/deepwork_policy/steps/define.md +++ b/src/deepwork/standard_jobs/deepwork_policy/steps/define.md @@ -171,4 +171,4 @@ Policies are evaluated automatically when you finish working on a task. The syst 3. Skips policies where safety patterns also matched 4. Prompts you with instructions for any triggered policies -You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. +You can mark a policy as addressed by including `✓ Policy Name` in your response (replace Policy Name with the actual policy name). This tells the system you've already handled that policy's requirements. diff --git a/src/deepwork/templates/claude/command-job-step.md.jinja b/src/deepwork/templates/claude/command-job-step.md.jinja index c7e6853e..ff7c2837 100644 --- a/src/deepwork/templates/claude/command-job-step.md.jinja +++ b/src/deepwork/templates/claude/command-job-step.md.jinja @@ -24,7 +24,7 @@ hooks: Review the conversation and determine if ALL quality criteria above have been satisfied. Look for evidence that each criterion has been addressed. - If the agent has included `QUALITY_COMPLETE` in their response AND + If the agent has included `✓ Quality Criteria Met` in their response AND all criteria appear to be met, respond with: {"ok": true} If criteria are NOT met AND the promise tag is missing, respond with: @@ -144,7 +144,7 @@ The validation script will be executed automatically when you attempt to complet To signal that all quality criteria have been met, include this tag in your final response: ``` -QUALITY_COMPLETE +✓ Quality Criteria Met ``` **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected. diff --git a/tests/unit/test_evaluate_policies.py b/tests/unit/test_evaluate_policies.py index be0109ef..03f1a26a 100644 --- a/tests/unit/test_evaluate_policies.py +++ b/tests/unit/test_evaluate_policies.py @@ -7,31 +7,25 @@ class TestExtractPromiseTags: """Tests for extract_promise_tags function.""" - def test_extracts_double_quote_promise(self) -> None: - """Test extracting promise with double quotes.""" - text = '✓ Update Docs' + def test_extracts_policy_name_from_promise(self) -> None: + """Test extracting policy name from promise tag body.""" + text = "✓ Update Docs" result = extract_promise_tags(text) assert result == {"Update Docs"} - def test_extracts_single_quote_promise(self) -> None: - """Test extracting promise with single quotes.""" - text = "done" - result = extract_promise_tags(text) - assert result == {"Security Review"} - def test_extracts_multiple_promises(self) -> None: """Test extracting multiple promise tags.""" text = """ I've addressed the policies. - done - checked + ✓ Update Docs + ✓ Security Review """ result = extract_promise_tags(text) assert result == {"Update Docs", "Security Review"} def test_case_insensitive(self) -> None: """Test that promise tag matching is case insensitive.""" - text = 'done' + text = "✓ Test Policy" result = extract_promise_tags(text) assert result == {"Test Policy"} @@ -41,15 +35,11 @@ def test_returns_empty_set_for_no_promises(self) -> None: result = extract_promise_tags(text) assert result == set() - def test_multiline_promise_content(self) -> None: - """Test promise tag with multiline content.""" - text = """ - I have addressed this by: - 1. Updating the docs - 2. Running tests - """ + def test_strips_whitespace_from_policy_name(self) -> None: + """Test that whitespace is stripped from extracted policy names.""" + text = "✓ Policy With Spaces " result = extract_promise_tags(text) - assert result == {"Complex Policy"} + assert result == {"Policy With Spaces"} class TestFormatPolicyMessage: @@ -70,7 +60,7 @@ def test_formats_single_policy(self) -> None: assert "## DeepWork Policies Triggered" in result assert "### Policy: Test Policy" in result assert "Please update the documentation." in result - assert '' in result + assert "✓ Policy Name" in result def test_formats_multiple_policies(self) -> None: """Test formatting multiple policies.""" From 470d1e0678dcee609ab4127855d599c388578f00 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Jan 2026 23:46:09 +0000 Subject: [PATCH 3/3] Format: use double quotes for consistency --- src/deepwork/hooks/evaluate_policies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deepwork/hooks/evaluate_policies.py b/src/deepwork/hooks/evaluate_policies.py index a6d93083..8713d7a4 100644 --- a/src/deepwork/hooks/evaluate_policies.py +++ b/src/deepwork/hooks/evaluate_policies.py @@ -44,7 +44,7 @@ def extract_promise_tags(text: str) -> set[str]: Set of policy names that have been promised/addressed """ # Match ✓ Policy Name and extract the policy name - pattern = r'✓\s*([^<]+)' + pattern = r"✓\s*([^<]+)" matches = re.findall(pattern, text, re.IGNORECASE | re.DOTALL) return {m.strip() for m in matches}