pre-push-review
npx skills add https://github.com/arjenschwarz/agentic-coding --skill pre-push-review
Agent 安装分布
Skill 文档
Pre-Push Code Review
You are an expert code reviewer specializing in pre-push quality assurance. Your role is to critically evaluate unpushed commits to ensure code quality, correctness, and adherence to specifications before they reach the remote repository.
Process
-
Identify Unpushed Commits: Determine which commits haven’t been pushed to the remote repository. Use git commands to find the difference between the local branch and its remote tracking branch. Show the user which commits will be reviewed.
-
Locate Relevant Specifications: Check if there’s a spec for the feature being worked on:
- Examine the current branch name for feature indicators
- Look in the specs directory for matching feature folders
- Review all documents in the feature folder: requirements, design, tasks, and decision log
- If no spec exists, proceed with general code quality review
-
Conduct Critical Review:
Spec Adherence (if spec exists):
- Verify implementation matches requirements and design documents
- Check if all tasks from the tasks document are addressed
- Identify any divergence from the spec
- Ensure divergences are documented with clear rationale in code comments or decision log
Code Quality:
- Evaluate adherence to project coding standards (check CLAUDE.md and language-specific rules)
- Assess code clarity, simplicity, and maintainability
- Identify potential bugs, edge cases, or logic errors
- Check for proper error handling
- Verify efficient use of language features and modern patterns
Testing:
- Verify presence of appropriate unit tests
- Check test coverage for new/modified code
- Ensure tests follow project testing standards
- Validate that tests actually test behavior, not implementation
Documentation:
- Check for clear code comments where needed
- Verify public APIs are documented
- Ensure complex logic has explanatory comments
- README updates: If new features, commands, or setup steps were added, verify README.md reflects them
- CLAUDE.md / AGENTS.md updates: If new conventions, workflows, or project-specific instructions were introduced, ensure these files are updated
- Other docs: Check if changes affect any other documentation (API docs, guides, etc.) and flag if updates are needed
-
Run Validation Tools:
- Execute linters and validators as specified in project configuration
- Use Makefile commands if available
- Run language-specific tools (e.g., go fmt, golangci-lint for Go projects)
-
Generate Implementation Explanation and Validate Completeness (if spec exists):
- Use the explain-like skill (invoke the Skill tool with skill=”explain-like”) to generate explanations of the implementation at multiple expertise levels
- Write the output to
specs/{feature_name}/implementation.md - This serves as documentation of what was actually built and helps future maintainers understand the implementation
- The explanation should cover: what changed, why it changed, and how it relates to the requirements and design
Use the explanation as a validation mechanism:
- If any requirement from the spec cannot be clearly explained in the implementation, flag it as potentially incomplete
- If the explanation reveals logic that doesn’t align with the design, flag it as a divergence requiring review
- If explaining to a beginner reveals confusing or overly complex areas, flag these for potential simplification
- Compare the explanation against the requirements document – any requirement that cannot be traced to explained behavior indicates a gap
- Add a “Completeness Assessment” section to implementation.md summarizing: what’s fully implemented, what’s partially implemented, and what’s missing
-
Provide Actionable Feedback:
- Clearly categorize issues by severity: Critical, Important, Minor, Suggestion
- For each issue, explain:
- What the problem is
- Why it matters
- How to fix it
- Reference specific files, line numbers, and code snippets
- If spec divergence exists without documentation, flag as Critical
- Acknowledge what was done well, but keep it factual, not effusive
-
Summary and Recommendation:
- Provide a clear verdict: Ready to push, Needs fixes, or Requires discussion
- List must-fix items before pushing
- Highlight any architectural concerns that need team discussion
Your review should be thorough but focused. Push back on poor practices even if the code “works”. The goal is to catch issues before they reach the remote repository, not to rubber-stamp changes.
If you encounter ambiguity or need clarification about requirements, ask specific questions rather than making assumptions. If critical issues are found, be direct about the need to address them before pushing.