| name | git-commit |
| description | Complete git commit workflow including pre-commit checks, staging, message generation, and verification. Use when creating commits or preparing changes for commit. |
Git Commit Workflow
Task Tracking
Create tasks to track progress through this workflow:
- Analyze changes & run pre-commit checks
- Stage changes & commit
- Post-commit verification
Prerequisites
Check what changed to determine review needs:
git diff --name-only
git diff --cached --name-only
| File Types Changed | Run Example Validation |
|---|
Python (.py) in examples/ | Yes — run a related example |
Docs only (.md) | Skip |
Config only (.yml, .json, .gitignore) | Skip |
Pre-Commit Review
Before committing, review changes against the coding style:
git diff --staged
Check for:
import pypto.language as pl (not other aliases)
- Correct
pl.FunctionType usage (InCore / Orchestration / Opaque)
- Proper parameter directions (
pl.Out, pl.InOut)
- No hardcoded absolute paths or private information
- Comments and docstrings in English
Pre-Commit Hooks
This project uses pre-commit hooks. Verify these pass before committing:
| Hook | What it checks |
|---|
ruff-check | Python linting (pyflakes: unused imports, undefined names) |
check-headers | Copyright header format |
check-english-only | Code comments and docstrings are in English |
Run all hooks:
pre-commit run --all-files
Or run individually:
ruff check --config ruff.toml .
python tests/lint/check_headers.py
python tests/lint/check_english_only.py
Stage Changes
Stage related changes together. Never stage build artifacts (build_output/, __pycache__/, *.so).
git add path/to/file1.py path/to/file2.py
git diff --staged
Commit Message Format
Subject Line
Type: concise description (under 72 characters, imperative mood, no period)
Types:
| Type | Usage |
|---|
| Add | new example, model, or tensor function |
| Fix | bug fix |
| Update | enhancement to existing example or function |
| Refactor | restructuring without behavior change |
| Docs | documentation changes |
| CI | CI/CD pipeline changes |
| Chore | config, gitignore, tooling |
Body (required for multi-file changes)
Separate from subject by a blank line. Explain what changed and why. Use bullet points for multiple items. Wrap at 72 characters.
Good examples:
Add: Qwen3-32B single-layer decode example
- Batch=16 with per-session variable context length
- Fused outer loops for attention and MLP
- All GM slices >= 512B alignment
Fix: softmax numerics in paged attention example
Row-max subtraction was applied after exponentiation,
causing overflow for large logits.
Simple changes (body optional):
Docs: clarify incore scope memory constraints
Co-Author Policy
❌ NEVER add AI assistants: No Claude, ChatGPT, Cursor AI, etc.
✅ Only credit human contributors: Co-authored-by: Name <email>
Why? AI tools are not collaborators. Commits reflect human authorship.
Post-Commit Verification
git log -1
git show HEAD --stat
Checklist