Files
gh-johnclyde-clydehub/commands/commit.md
2025-11-30 08:28:27 +08:00

1.5 KiB

description, argument-hint
description argument-hint
Smart Git commit with automatic lint fixing and CI validation
message

Create a Git commit with the following workflow:

  1. Run git status to see all files (tracked, untracked, modified)

  2. Classify all files into three categories:

    • Project files: Source code, tests, configs, documentation that belong in repo
    • Git-ignored: Files already matching .gitignore (node_modules, pycache, .env, etc.)
    • Temporary/scratch: Random scripts, debug files, test outputs, Claude-generated utilities
  3. Handle temporary files:

    • Create /tmp directory if it doesn't exist
    • Move all temporary/scratch files to /tmp
    • Create/update /tmp/README.md documenting:
      • What each file is
      • Whether it should be kept temporarily or can be deleted
      • When it was created
    • Only update .gitignore if a NEW pattern needs to be added (very rare)
  4. Stage project files only (never use git add -A)

    • Explicitly stage each legitimate project file
    • Ask for confirmation if unsure about any file
  5. Run linters and fix issues (pnpm biome check --write, uv run ruff check --fix, uv run ruff format)

  6. Run type checking (pnpm tsc --noEmit for TypeScript, uv run ty check for Python)

  7. If lint/type fixes were applied, stage those changes

  8. Create a commit with the provided message (or generate one if not provided)

IMPORTANT: Always maintain a clean working state. Move scratch work to /tmp. Never commit temporary files. Do NOT run tests as part of commit flow.