Skip to content

Commit 9416df7

Browse files
nhortonclaude
andauthored
Simplify commit job file review to agent self-verification (#82)
Changed the commit_and_push step to verify files match the agent's own expectations instead of asking the user every time. This reduces unnecessary interruptions while still catching unexpected changes. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 923cd6d commit 9416df7

6 files changed

Lines changed: 69 additions & 82 deletions

File tree

.claude/skills/commit.commit_and_push/SKILL.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
name: commit.commit_and_push
3-
description: "Review changed files, commit, and push to remote"
3+
description: "Verify changed files, commit, and push to remote"
44
user-invocable: false
55
hooks:
66
Stop:
77
- hooks:
88
- type: prompt
99
prompt: |
1010
Verify the commit is ready:
11-
1. Changed files list was reviewed with user
12-
2. User confirmed the files match expectations
11+
1. Changed files list was reviewed by the agent
12+
2. Files match what was modified during this session (or unexpected changes were investigated)
1313
3. Commit was created with appropriate message
1414
4. Changes were pushed to remote
1515
If ALL criteria are met, include `<promise>✓ Quality Criteria Met</promise>`.
@@ -29,17 +29,17 @@ Before proceeding, confirm these steps are complete:
2929

3030
## Instructions
3131

32-
**Goal**: Review changed files, commit, and push to remote
32+
**Goal**: Verify changed files, commit, and push to remote
3333

3434
# Commit and Push
3535

3636
## Objective
3737

38-
Review the changed files with the user, create a commit with an appropriate message, and push to the remote repository.
38+
Review the changed files to verify they match the agent's expectations, create a commit with an appropriate message, and push to the remote repository.
3939

4040
## Task
4141

42-
Present the list of changed files for user review, ensure they match expectations, then commit and push the changes.
42+
Check the list of changed files against what was modified during this session, ensure they match expectations, then commit and push the changes.
4343

4444
### Process
4545

@@ -49,31 +49,26 @@ Present the list of changed files for user review, ensure they match expectation
4949
```
5050
Also run `git diff --stat` to see a summary of changes.
5151

52-
2. **Present changes to the user for review**
52+
2. **Verify changes match expectations**
5353

54-
Use the AskUserQuestion tool to ask structured questions about the changes:
54+
Compare the changed files against what you modified during this session:
55+
- Do the modified files match what you edited?
56+
- Are there any unexpected new files?
57+
- Are there any unexpected deleted files?
58+
- Do the line counts seem reasonable for the changes you made?
5559

56-
Show the user:
57-
- List of modified files
58-
- List of new files
59-
- List of deleted files
60-
- Summary of changes (lines added/removed)
60+
If changes match expectations, proceed to commit.
6161

62-
Ask them to confirm:
63-
- "Do these changed files match your expectations?"
64-
- Provide options: "Yes, proceed with commit" / "No, let me review first" / "No, some files shouldn't be included"
62+
If there are unexpected changes:
63+
- Investigate why (e.g., lint auto-fixes, generated files)
64+
- If they're legitimate side effects of your work, include them
65+
- If they're unrelated or shouldn't be committed, use `git restore` to discard them
6566

66-
3. **Handle user response**
67-
68-
- If user confirms, proceed to commit
69-
- If user wants to review first, wait for them to come back
70-
- If user says some files shouldn't be included, ask which files to exclude and use `git restore` or `git checkout` to unstage them
71-
72-
4. **Stage all appropriate changes**
67+
3. **Stage all appropriate changes**
7368
```bash
7469
git add -A
7570
```
76-
Or stage specific files if user excluded some.
71+
Or stage specific files if some were excluded.
7772

7873
5. **View recent commit messages for style reference**
7974
```bash
@@ -102,16 +97,16 @@ Present the list of changed files for user review, ensure they match expectation
10297

10398
## Quality Criteria
10499

105-
- Changed files list was presented to user
106-
- User explicitly confirmed the files match expectations
100+
- Changed files list was reviewed by the agent
101+
- Files match what was modified during this session (or unexpected changes were investigated and handled)
107102
- Commit message follows project conventions
108103
- Commit was created successfully
109104
- Changes were pushed to remote
110105
- When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>` in your response
111106

112107
## Context
113108

114-
This is the final step of the commit workflow. It ensures the user has reviewed and approved the changes before they are committed and pushed. This prevents accidental commits of unintended files or changes.
109+
This is the final step of the commit workflow. The agent verifies that the changed files match its own expectations from the work done during the session, then commits and pushes. This catches unexpected changes while avoiding unnecessary user interruptions.
115110

116111

117112
### Job Context

.claude/skills/commit/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Steps:
2525

2626
1. **test** - Pull latest code and run the test suite until all tests pass
2727
2. **lint** - Format and lint code with ruff using a sub-agent (requires: test)
28-
3. **commit_and_push** - Review changed files, commit, and push to remote (requires: lint)
28+
3. **commit_and_push** - Verify changed files, commit, and push to remote (requires: lint)
2929

3030
## Execution Instructions
3131

.deepwork/jobs/commit/job.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: commit
2-
version: "1.0.0"
2+
version: "1.0.1"
33
summary: "Run tests, lint, and commit code changes"
44
description: |
55
A workflow for preparing and committing code changes with quality checks.
@@ -14,6 +14,8 @@ description: |
1414
3. commit_and_push - Review changes and commit/push
1515
1616
changelog:
17+
- version: "1.0.1"
18+
changes: "Changed file review from user confirmation to agent self-verification - agent now checks files match its own expectations instead of asking user every time"
1719
- version: "1.0.0"
1820
changes: "Initial job creation"
1921

@@ -56,7 +58,7 @@ steps:
5658
5759
- id: commit_and_push
5860
name: "Commit and Push"
59-
description: "Review changed files, commit, and push to remote"
61+
description: "Verify changed files, commit, and push to remote"
6062
instructions_file: steps/commit_and_push.md
6163
inputs: []
6264
outputs: []
@@ -66,8 +68,8 @@ steps:
6668
after_agent:
6769
- prompt: |
6870
Verify the commit is ready:
69-
1. Changed files list was reviewed with user
70-
2. User confirmed the files match expectations
71+
1. Changed files list was reviewed by the agent
72+
2. Files match what was modified during this session (or unexpected changes were investigated)
7173
3. Commit was created with appropriate message
7274
4. Changes were pushed to remote
7375
If ALL criteria are met, include `<promise>✓ Quality Criteria Met</promise>`.

.deepwork/jobs/commit/steps/commit_and_push.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Objective
44

5-
Review the changed files with the user, create a commit with an appropriate message, and push to the remote repository.
5+
Review the changed files to verify they match the agent's expectations, create a commit with an appropriate message, and push to the remote repository.
66

77
## Task
88

9-
Present the list of changed files for user review, ensure they match expectations, then commit and push the changes.
9+
Check the list of changed files against what was modified during this session, ensure they match expectations, then commit and push the changes.
1010

1111
### Process
1212

@@ -16,31 +16,26 @@ Present the list of changed files for user review, ensure they match expectation
1616
```
1717
Also run `git diff --stat` to see a summary of changes.
1818

19-
2. **Present changes to the user for review**
19+
2. **Verify changes match expectations**
2020

21-
Use the AskUserQuestion tool to ask structured questions about the changes:
21+
Compare the changed files against what you modified during this session:
22+
- Do the modified files match what you edited?
23+
- Are there any unexpected new files?
24+
- Are there any unexpected deleted files?
25+
- Do the line counts seem reasonable for the changes you made?
2226

23-
Show the user:
24-
- List of modified files
25-
- List of new files
26-
- List of deleted files
27-
- Summary of changes (lines added/removed)
27+
If changes match expectations, proceed to commit.
2828

29-
Ask them to confirm:
30-
- "Do these changed files match your expectations?"
31-
- Provide options: "Yes, proceed with commit" / "No, let me review first" / "No, some files shouldn't be included"
29+
If there are unexpected changes:
30+
- Investigate why (e.g., lint auto-fixes, generated files)
31+
- If they're legitimate side effects of your work, include them
32+
- If they're unrelated or shouldn't be committed, use `git restore` to discard them
3233

33-
3. **Handle user response**
34-
35-
- If user confirms, proceed to commit
36-
- If user wants to review first, wait for them to come back
37-
- If user says some files shouldn't be included, ask which files to exclude and use `git restore` or `git checkout` to unstage them
38-
39-
4. **Stage all appropriate changes**
34+
3. **Stage all appropriate changes**
4035
```bash
4136
git add -A
4237
```
43-
Or stage specific files if user excluded some.
38+
Or stage specific files if some were excluded.
4439

4540
5. **View recent commit messages for style reference**
4641
```bash
@@ -69,13 +64,13 @@ Present the list of changed files for user review, ensure they match expectation
6964

7065
## Quality Criteria
7166

72-
- Changed files list was presented to user
73-
- User explicitly confirmed the files match expectations
67+
- Changed files list was reviewed by the agent
68+
- Files match what was modified during this session (or unexpected changes were investigated and handled)
7469
- Commit message follows project conventions
7570
- Commit was created successfully
7671
- Changes were pushed to remote
7772
- When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>` in your response
7873

7974
## Context
8075

81-
This is the final step of the commit workflow. It ensures the user has reviewed and approved the changes before they are committed and pushed. This prevents accidental commits of unintended files or changes.
76+
This is the final step of the commit workflow. The agent verifies that the changed files match its own expectations from the work done during the session, then commits and pushes. This catches unexpected changes while avoiding unnecessary user interruptions.

.gemini/skills/commit/commit_and_push.toml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# commit:commit_and_push
22
#
3-
# Review changed files, commit, and push to remote
3+
# Verify changed files, commit, and push to remote
44
#
55
# Generated by DeepWork - do not edit manually
66

7-
description = "Review changed files, commit, and push to remote"
7+
description = "Verify changed files, commit, and push to remote"
88

99
prompt = """
1010
# commit:commit_and_push
@@ -20,17 +20,17 @@ Before proceeding, confirm these steps are complete:
2020
2121
## Instructions
2222
23-
**Goal**: Review changed files, commit, and push to remote
23+
**Goal**: Verify changed files, commit, and push to remote
2424
2525
# Commit and Push
2626
2727
## Objective
2828
29-
Review the changed files with the user, create a commit with an appropriate message, and push to the remote repository.
29+
Review the changed files to verify they match the agent's expectations, create a commit with an appropriate message, and push to the remote repository.
3030
3131
## Task
3232
33-
Present the list of changed files for user review, ensure they match expectations, then commit and push the changes.
33+
Check the list of changed files against what was modified during this session, ensure they match expectations, then commit and push the changes.
3434
3535
### Process
3636
@@ -40,31 +40,26 @@ Present the list of changed files for user review, ensure they match expectation
4040
```
4141
Also run `git diff --stat` to see a summary of changes.
4242
43-
2. **Present changes to the user for review**
43+
2. **Verify changes match expectations**
4444
45-
Use the AskUserQuestion tool to ask structured questions about the changes:
45+
Compare the changed files against what you modified during this session:
46+
- Do the modified files match what you edited?
47+
- Are there any unexpected new files?
48+
- Are there any unexpected deleted files?
49+
- Do the line counts seem reasonable for the changes you made?
4650
47-
Show the user:
48-
- List of modified files
49-
- List of new files
50-
- List of deleted files
51-
- Summary of changes (lines added/removed)
51+
If changes match expectations, proceed to commit.
5252
53-
Ask them to confirm:
54-
- "Do these changed files match your expectations?"
55-
- Provide options: "Yes, proceed with commit" / "No, let me review first" / "No, some files shouldn't be included"
53+
If there are unexpected changes:
54+
- Investigate why (e.g., lint auto-fixes, generated files)
55+
- If they're legitimate side effects of your work, include them
56+
- If they're unrelated or shouldn't be committed, use `git restore` to discard them
5657
57-
3. **Handle user response**
58-
59-
- If user confirms, proceed to commit
60-
- If user wants to review first, wait for them to come back
61-
- If user says some files shouldn't be included, ask which files to exclude and use `git restore` or `git checkout` to unstage them
62-
63-
4. **Stage all appropriate changes**
58+
3. **Stage all appropriate changes**
6459
```bash
6560
git add -A
6661
```
67-
Or stage specific files if user excluded some.
62+
Or stage specific files if some were excluded.
6863
6964
5. **View recent commit messages for style reference**
7065
```bash
@@ -93,16 +88,16 @@ Present the list of changed files for user review, ensure they match expectation
9388
9489
## Quality Criteria
9590
96-
- Changed files list was presented to user
97-
- User explicitly confirmed the files match expectations
91+
- Changed files list was reviewed by the agent
92+
- Files match what was modified during this session (or unexpected changes were investigated and handled)
9893
- Commit message follows project conventions
9994
- Commit was created successfully
10095
- Changes were pushed to remote
10196
- When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>` in your response
10297
10398
## Context
10499
105-
This is the final step of the commit workflow. It ensures the user has reviewed and approved the changes before they are committed and pushed. This prevents accidental commits of unintended files or changes.
100+
This is the final step of the commit workflow. The agent verifies that the changed files match its own expectations from the work done during the session, then commits and pushes. This catches unexpected changes while avoiding unnecessary user interruptions.
106101
107102
108103
### Job Context

.gemini/skills/commit/index.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Steps:
3131
Command: `/commit:test`
3232
2. **lint** - Format and lint code with ruff using a sub-agent (requires: test)
3333
Command: `/commit:lint`
34-
3. **commit_and_push** - Review changed files, commit, and push to remote (requires: lint)
34+
3. **commit_and_push** - Verify changed files, commit, and push to remote (requires: lint)
3535
Command: `/commit:commit_and_push`
3636
3737
## Execution Instructions

0 commit comments

Comments
 (0)