git-basics

Run tests, linters, and static analysis before committing with Conventional Commits.

6|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/trevin-j/dots --skill git-basics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-basics
Source: https://github.com/trevin-j/dots/tree/main/opencode/.config/opencode/skills/git-basics
Command: npx skills add https://github.com/trevin-j/dots --skill git-basics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a disciplined, test-first git commit workflow so code changes are narrowly scoped, verified, and documented with Conventional Commits to reduce broken builds and noisy history.

Core Features & Use Cases

  • Scope hygiene: Stage only intended hunks and avoid drive-by formatting or unrelated edits.
  • Quality gates: Run tests, linters, and static analysis and report failures before committing.
  • Conventional commits: Draft commits with type(scope): summary to clearly communicate intent.
  • Use Case: When a user requests "commit this" after a code edit, follow this workflow to verify, test, and produce a clean, conventional commit.

Quick Start

Ask the assistant to implement the requested code change, run relevant tests and linters, then stage only the intended files and commit with a Conventional Commit message that includes a clear scope.

Frequently Asked Questions about git-basics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce conventional commits and run tests before committing code changes?

To enforce conventional commits and run tests before committing, use a disciplined git workflow that executes linters and static analysis, stages only intended hunks, and drafts type(scope): summary messages to ensure verified, narrowly scoped code changes.

What is the best way to stage only specific code hunks and avoid unrelated formatting changes in git?

The best way to stage specific code hunks and avoid unrelated formatting changes is to apply scope hygiene during your git commit workflow, selectively staging intended files while reverting drive-by formatting edits before finalizing the commit.

How do I write a conventional commit message with a clear scope for feature branches?

Writing a conventional commit message with a clear scope involves structuring the message as type(scope): summary, which clearly communicates the intent of verified code changes on feature branches and reduces noisy history.

Why should I run linters and static analysis before committing code to version control?

Running linters and static analysis before committing code to version control acts as a quality gate to catch failures early, ensuring that only tested, narrowly scoped changes are committed and reducing broken builds in your history.

Does this git commit workflow require any external dependencies or components to run?

This git commit workflow does not require any external dependencies or components to run, operating independently to enforce test-first commits, run static analysis, and apply conventional commit formatting.