AgentSkillsCN

smart-commit

审查变更并更新文档、自定义指令与引用,以确保与代码保持一致。适用于分析变更对文档的影响、在代码变更后同步指令文件、审核文档的时效性,或在提交前进行文档审查时使用。

SKILL.md
--- frontmatter
name: smart-commit
description: "Review changes and update documentation, custom instructions, and references to stay consistent with code. Use when analyzing change impact on docs, syncing instruction files after code changes, auditing documentation currency, or preparing a documentation review before committing."

Smart Commit — Documentation & Instruction Review

Review code changes and ensure documentation, custom instructions, and references stay synchronized. Delegates actual committing to the git-commit skill.

Workflow

1. Change Analysis

  • Review git status and analyze staged/unstaged changes

  • Categorize changes by type:

    • Code functionality (new features, bug fixes, refactoring)
    • Configuration changes (settings, dependencies, build configs)
    • Documentation updates
    • Infrastructure/tooling changes
    • Instruction/guideline modifications
  • Assess impact level:

    • Minor: Small fixes, typos, minor tweaks
    • Moderate: New functions, configuration updates, doc improvements
    • Major: Architectural changes, new features, breaking changes
    • Critical: Security fixes, major refactoring, instruction overhauls

2. Documentation Consistency Check

  • Verify README.md reflects current project state
  • Check if API docs match code changes
  • Review getting-started guide for accuracy with new dependencies/setup
  • Validate examples still work with code changes
  • Ensure changelog needs updating for significant changes

3. Custom Instructions Review

Based on change analysis, check if updates are needed to:

.github/instructions/copilot-instructions.md

  • New coding patterns or preferences
  • Project-specific terminology changes
  • Updated best practices or conventions

.github/instructions/python.instructions.md

  • New Python dependencies or frameworks
  • Changed virtual environment approach
  • Updated testing or linting standards

.github/instructions/powershell.instructions.md

  • New PowerShell modules or functions
  • Changed execution policies or requirements
  • Updated error handling patterns

.github/instructions/docker.instructions.md

  • New containerization approach
  • Updated base images or configurations
  • Changed deployment patterns

.github/instructions/markdown.instructions.md

  • New documentation structure or formatting
  • Updated style guidelines
  • Changed template requirements

4. Apply Updates

For each gap identified above:

  1. Draft the documentation or instruction update
  2. Present changes to the user for approval
  3. Apply approved updates

5. Review Summary

Output a status report:

  • ✅ / ❌ for each documentation file checked
  • ✅ / ❌ for each instruction file checked
  • List of updates applied
  • Remaining items the user should address manually

After review is complete, suggest using the git-commit skill to commit all changes.


Usage Examples

Example: Feature Addition Review

code
User: @smart-commit
Assistant: Analyzing changes...

Changes detected:
- Added process_data() in src/processor.py
- Updated requirements.txt with pandas

Documentation check:
✅ README updated with usage
❌ API docs need updating for new function
✅ Getting started guide still accurate

Instructions check:
❌ python.instructions.md should mention pandas patterns

I'll draft updates for the flagged items...

Example: Breaking Change Review

code
User: @smart-commit
Assistant: Analyzing changes...

⚠️  MAJOR CHANGES — Breaking change impact

Required updates:
❌ README.md needs API endpoint updates
❌ Getting started guide needs new env var setup
❌ API docs outdated
❌ copilot-instructions.md needs new auth patterns

I'll draft updates for all flagged items...

Modes

Default

Analyze changes → check docs and instructions → draft updates → summarize.

Instruction Sync

Focus exclusively on .github/instructions/ files:

  • Ensure consistency across all instruction files
  • Validate instruction completeness against current codebase

Documentation Audit

Comprehensive documentation review:

  • Identify all gaps and inconsistencies across docs/
  • Check cross-references between documents
  • Flag stale content

Success Criteria

After running this skill:

  • ✅ Documentation reflects current code state
  • ✅ Custom instructions reflect current project patterns
  • ✅ No documentation/code inconsistencies
  • ✅ Future contributors have accurate guidance
  • ✅ Changes are ready for the git-commit skill