agentleFS
shalombshalomb/agent-skills/skills/branch-doctor/SKILL.md

branch-doctor

Skill3 starsChanged 3 months agoMITView on GitHub

Comprehensive health check for the current git branch. Diagnoses working tree cleanliness, validates git history against Conventional Commits, executes local tests, checks GitHub Actions CI runs, and audits Pull Request well-formedness against PR templates and issue linking standards. Triggers on: 'doctor', 'branch health', 'check branch', 'pre-flight check', 'PR health check'.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a comprehensive diagnostic health check of the current branch before opening a PR, requesting review, or merging.

    line 13
  2. Distinctive:

    When invoked, execute the diagnostic script or perform the 5 checks:

    line 19
  3. Distinctive:

    Verify whether there are unstaged changes, untracked debris, or unresolved merge conflicts.

    line 27
  4. Distinctive:

    Ensure only intentional files are modified.

    line 28
  5. Very specific:

    Check all commits on the branch since branching from base (git log origin/main..HEAD --oneline).

    line 31
  6. Distinctive:

    Check the status of remote GitHub Actions workflows for the current branch:

    line 50
  7. Very specific:

    Check for any failure, startup_failure (permissions blocks), or ongoing runs.

    line 54
  8. Distinctive:

    Check whether an open PR exists for the branch:

    line 57
  9. Distinctive:

    If PR exists, audit against quality gates:

    line 61
  10. Very specific:

    Title: Must follow Conventional Commits (feat(auth): add OAuth2 provider).

    line 62
  11. Distinctive:

    Body Content: Must not be blank; must detail *what*, *why*, and verification proof.

    line 63
  12. Very specific:

    Issue References: Must link related tickets or issues (Fixes #123, Resolves #456, or Jira ticket keys).

    line 64
  13. Very specific:

    Template Conformance: Check against .github/PULL_REQUEST_TEMPLATE.md (or .github/pull_request_template.md).

    line 65
  14. Distinctive:

    If PR does NOT exist:

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Branch Doctor: Git, Test, CI & PR Health Check

Run a comprehensive diagnostic health check of the current branch before opening a PR, requesting review, or merging.


The 5-Point Health Check

When invoked, execute the diagnostic script or perform the 5 checks:

uv run {SKILLS_DIR}/branch-doctor/scripts/doctor.py

1. Working Tree Health

  • Inspect git status --porcelain and git diff --stat.
  • Verify whether there are unstaged changes, untracked debris, or unresolved merge conflicts.
  • Ensure only intentional files are modified.

2. Git History & Conventional Commits Sanity

  • Check all commits on the branch since branching from base (git log origin/main..HEAD --oneline).
  • Validate that every commit message strictly adheres to the Conventional Commits format:
    <type>(<optional scope>): <imperative subject>
  • Reject WIP commits (wip, temp, fixup!, squash!, bare merge commits).
  • Confirm commits adhere to the Atomic Commit Protocol (ACP): complete, self-contained units with corresponding tests.

3. Local Test Ladder Execution

  • Detect the project's local test runner in this order of precedence:
    • justfile $\rightarrow$ just test (or just fast-fail)
    • Makefile $\rightarrow$ make test
    • pyproject.toml / uv.lock $\rightarrow$ uv run pytest
    • Cargo.toml $\rightarrow$ cargo test
    • package.json $\rightarrow$ npm test
    • go.mod $\rightarrow$ go test ./...
  • Execute the test suite, confirm exit code is 0, and note the test count and duration.

4. GitHub Actions CI Status

  • Check the status of remote GitHub Actions workflows for the current branch:
    gh run list --branch "$(git rev-parse --abbrev-ref HEAD)" --limit 3 --json databaseId,name,status,conclusion,url
  • Check for any failure, startup_failure (permissions blocks), or ongoing runs.

5. Pull Request Well-Formedness

  • Check whether an open PR exists for the branch:
    gh pr view --json number,title,body,state,mergeable,reviewDecision,url
  • If PR exists, audit against quality gates:
    • Title: Must follow Conventional Commits (feat(auth): add OAuth2 provider).
    • Body Content: Must not be blank; must detail what, why, and verification proof.
    • Issue References: Must link related tickets or issues (Fixes #123, Resolves #456, or Jira ticket keys).
    • Template Conformance: Check against .github/PULL_REQUEST_TEMPLATE.md (or .github/pull_request_template.md). Verify sections are completed without unedited template placeholders.
    • Mergeability: Confirm no merge conflicts (mergeable: MERGEABLE).
  • If PR does NOT exist:
    • Provide a ready-to-use PR title and summary generated from the branch commits.

Output Format

# 🏥 Branch Doctor Report

- **Branch:** `feat/auth-token-validation` (base: `origin/main`)
- **Overall Status:** ✅ HEALTHY / ⚠️ WARNINGS / ❌ UNHEALTHY

## Diagnostic Checks

| Check | Status | Details |
|---|---|---|
| **Working Tree** | ✅ Clean | 0 unstaged, 0 untracked |
| **Commit History** | ✅ Sane | 3 commits, all valid Conventional Commits |
| **Local Tests** | ✅ Passing | 42 passed in 1.4s via `make test` |
| **GitHub CI** | ✅ Passing | All 3 workflow runs successful |
| **Pull Request** | ⚠️ Attention | PR #104 missing linked issue reference |

## Findings & Action Items
1. **Pull Request:** Add `Fixes #<issue>` to PR description before requesting review.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.