Skip to content

Add commit job with quality checks workflow#165

Merged
nhorton merged 12 commits intomainfrom
claude/generalize-commit-job-tXvfM
Jan 27, 2026
Merged

Add commit job with quality checks workflow#165
nhorton merged 12 commits intomainfrom
claude/generalize-commit-job-tXvfM

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 26, 2026

Summary

This PR introduces a new commit job that implements a structured workflow for committing code changes with built-in quality checks. The job enforces a four-step process: code review, testing, linting, and commit/push, ensuring all code meets quality standards before reaching the repository.

Key Changes

  • New job definition (library/jobs/commit/job.yml): Defines the complete commit workflow with four sequential steps, each with clear inputs, outputs, dependencies, and quality verification hooks
  • Comprehensive documentation (library/jobs/commit/readme.md): Includes overview, installation instructions, customization guide, and usage examples
  • Step implementations:
    • steps/review.md: Code review using sub-agents to catch issues, DRY violations, naming problems, and missing tests
    • steps/test.md: Test execution with iterative fixing until all tests pass
    • steps/lint.md: Code formatting and linting using sub-agents
    • steps/commit_and_push.md: Final verification and commit/push with git commit wrapper script

Notable Implementation Details

  • Sub-agent architecture: Review and lint steps use sub-agents to reduce context usage in the main conversation
  • Git commit interception: Design includes mechanism to block direct git commit commands and redirect to the /commit skill, enforcing the workflow
  • Quality gates: Each step includes after_agent hooks with verification prompts that require <promise>✓ Quality Criteria Met</promise> confirmation
  • Customization placeholders: Step files include clear placeholders for test commands, lint commands, and script paths that must be customized per project
  • Installation guide: Detailed instructions for setting up hook scripts, permissions, and settings configuration

Installation Requirements

Projects using this job must:

  1. Replace placeholder test and lint commands with project-specific ones
  2. Set up bash hook scripts to block git commit and provide a wrapper for the commit job
  3. Configure permissions in .claude/settings.json
  4. Run deepwork sync to generate slash commands

claude and others added 12 commits January 26, 2026 20:35
Adds a generalized commit workflow job to the library that enforces
quality checks before every commit through git commit interception.

The job includes:
- Code review step (DRY, naming, test coverage)
- Test execution step
- Lint/format step
- Commit and push step

The README explains:
- Why git commit is hijacked (to enforce the workflow)
- How to configure the settings.json PreToolUse hook
- Required placeholder replacements for test/lint commands

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Remove "view recent commit messages" step from commit_and_push.md
- Create code_review_standards.example.md with review criteria
- Update review.md to reference [code review standards path] placeholder
- Update README with instructions for code review standards replacement

The code review standards are now externalized to a separate file that
users can customize for their project's specific requirements.

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Update review.md to have sub-agent read code review standards (not main agent)
- Remove example sub-agent prompt from review.md
- Remove language-specific test command examples from test.md
- Split [lint and format command] into [format command] and [lint check command]
- Remove example sub-agent prompt from lint.md
- Update README with new placeholder descriptions

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
Add commit_job_git_commit.sh to the job folder so users can just copy
it rather than creating from scratch. Update README instructions.

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Replace after_agent hooks with quality_criteria in job.yml
- Remove "Sub-agent was used to conserve context" (implementation detail)
- Remove "Test command was run" (redundant with "tests passing")
- Remove promise tags from step files (handled by framework)
- Simplify and align criteria between job.yml and step files

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Replace hooks.after_agent.prompt with quality_criteria in job.yml
- Simplify quality criteria in step files (remove <promise> instructions)
- Align with library/jobs/commit structure while keeping project-specific
  customizations (ruff, CHANGELOG guidance)

https://claude.ai/code/session_01JfPmbjHD1JaRV95DY83nUr

Co-authored-by: Claude <noreply@anthropic.com>
Add the git commit blocker hook script to the job folder so users can
copy it during installation. Simplified README installation instructions
to reference the included scripts rather than inline code.

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Add workflows section with 'full' workflow defining step sequence
- Update block_bash_with_instructions.sh to output to stderr (matches upstream)
- Improve regex pattern to anchor at start of command

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
Document the new job.yml schema fields:
- workflows: Named sequences of steps
- quality_criteria: Measurable criteria for step completion

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
- Add "Test Quality" section to code_review_standards.example.md
  - Tests should add value and verify distinct behaviors
  - Tests should not be duplicative of each other
- Copy code review standards to doc/code_review_standards.md
- Update .deepwork review.md to reference doc file instead of inline criteria

https://claude.ai/code/session_01MKARbdLAGS4xcAoNQiNzkn
@nhorton nhorton merged commit 9adc19c into main Jan 27, 2026
4 checks passed
@nhorton nhorton deleted the claude/generalize-commit-job-tXvfM branch January 27, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants