Skip to content

Add general-purpose fix-mypy, fix-pylint, and fix-black Copilot skills#45809

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/create-general-copilot-skills
Draft

Add general-purpose fix-mypy, fix-pylint, and fix-black Copilot skills#45809
Copilot wants to merge 3 commits intomainfrom
copilot/create-general-copilot-skills

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

The existing Copilot skills for mypy and pylint were scoped exclusively to azure-ai-ml and used tox. This adds three general-purpose equivalents that work across any package in the repo and use python -m azpysdk tooling.

New skills

  • .github/skills/fix-mypy/SKILL.md — fixes mypy type errors in any package; trigger: fix mypy issue <url> [in <pkg-path>] [using venv <path>]
  • .github/skills/fix-pylint/SKILL.md — fixes pylint warnings in any package; trigger: fix pylint issue <url> [in <pkg-path>] [using venv <path>]
  • .github/skills/fix-black/SKILL.md — new skill for auto-formatting with black; trigger: fix black issue <url> [in <pkg-path>] [using venv <path>]

Key differences from ml/ skills

ML skills New skills
Scope azure-ai-ml only Any package path
Runner tox -e {check} --c .../tox.ini --root . python -m azpysdk {check} --pkg-path <path>
Package prompt Hardcoded Prompts user if not provided

All three skills prompt "Please provide the package path (e.g. sdk/storage/azure-storage-blob)." when no path is given, and follow the same step-by-step structure (activate venv → install deps → run check → fix → verify → open PR).

Original prompt

Overview

Create three new general-purpose Copilot skills under .github/skills/ that work for any Azure SDK for Python package (not just azure-ai-ml). These are modelled after the existing ML-specific skills in .github/skills/ml/fix-mypy/SKILL.md and .github/skills/ml/fix-pylint/SKILL.md, but:

  1. Are generalised to work with any package path in the repo (user provides the package path, e.g. sdk/storage/azure-storage-blob)
  2. Use python -m azpysdk tooling instead of tox for running checks
  3. Include a new fix-black skill for auto-formatting

Files to create

1. .github/skills/fix-mypy/SKILL.md

A general mypy skill. Key differences from the ML version:

  • The frontmatter description should say it works for any Azure SDK for Python package, not just azure-ai-ml
  • The trigger format should be: "fix mypy issue <issue-url> [in <package-path>] [using venv <path>]"
  • Use python -m azpysdk mypy instead of tox -e mypy --c ../../../eng/tox/tox.ini --root .
    • Command for entire package: python -m azpysdk mypy --pkg-path <package-path>
    • Command for specific file: python -m azpysdk mypy --pkg-path <package-path> -- path/to/file.py
  • If the user does not specify a package path, ask: "Please provide the package path (e.g. sdk/storage/azure-storage-blob)."
  • Install dependencies step should be generic:
    cd <package-path>
    pip install -r dev_requirements.txt
    pip install -e .
  • Step to identify modified files should use the package path the user gave, not a hardcoded sdk/ml/azure-ai-ml
  • All commit messages, branch names, and PR titles should use the package name (derived from the package path), not a hardcoded azure-ai-ml
  • Everything else (venv setup, fix strategy, allowed/forbidden actions, PR creation options, common issues/fixes section, notes) should be identical in structure to the ML skill but generalised

2. .github/skills/fix-pylint/SKILL.md

A general pylint skill. Key differences from the ML version:

  • Frontmatter description works for any Azure SDK for Python package
  • Trigger format: "fix pylint issue <issue-url> [in <package-path>] [using venv <path>]"
  • Use python -m azpysdk pylint instead of tox -e pylint --c ../../../eng/tox/tox.ini --root .
    • Command for entire package: python -m azpysdk pylint --pkg-path <package-path>
    • Command for specific file: python -m azpysdk pylint --pkg-path <package-path> -- path/to/file.py
  • If package path is missing, ask for it
  • Install dependencies step is generic (same as mypy above)
  • Branch names, commit messages, PR titles are derived from the actual package name
  • All common pylint issues/fixes section, notes, and PR creation options carried over but generalised

3. .github/skills/fix-black/SKILL.md

A brand-new black formatting skill. Structure it consistently with the other two skills:

Frontmatter:

---
name: fix-black
description: Automatically fix black formatting issues in any Azure SDK for Python package. Expects GitHub issue URL, package path, and optional virtual env path. Format "fix black issue <issue-url> in <package-path> [using venv <path>]"
---

Overview — intelligently fixes black formatting by:

  1. Getting the GitHub issue URL from the user
  2. Reading and analyzing the issue details
  3. Setting up or using existing virtual environment
  4. Installing required dependencies
  5. Running black check to identify formatting issues
  6. Applying black formatting fixes automatically
  7. Re-running black to verify all formatting is correct
  8. Creating a pull request that references the GitHub issue
  9. Providing a summary of what was fixed

Running Black:

  • Check for formatting issues (dry-run): python -m azpysdk black --pkg-path <package-path> --check
  • Apply formatting fixes: python -m azpysdk black --pkg-path <package-path>
  • On specific file: python -m azpysdk black --pkg-path <package-path> -- path/to/file.py

Reference Documentation:

Fixing Strategy (mirror the same Step 0–9 structure as the other skills):

  • Step 0: Get GitHub issue URL + package path + optional venv path (ask if missing)
  • Step 1: Activate venv (identical pattern to other skills)
  • Step 2: Install dependencies (identical generic pattern)
  • Step 3: Identify target files — run black in check mode first; Option C for modified files uses the user-supplied package path
  • Step 4: Run black check (--check flag)
  • Step 5: Analyze formatting issues — black outputs files that would be reformatted; list them
  • Step 6: Apply fixes — run black without --check to auto-format
    • Note: Black is largely automatic; minimal manual judgment is required
  • ...

This pull request was created from Copilot chat.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Copilot AI changed the title [WIP] Add general-purpose Copilot skills for Azure SDK for Python Add general-purpose fix-mypy, fix-pylint, and fix-black Copilot skills Mar 19, 2026
Copilot AI requested a review from l0lawrence March 19, 2026 21:17
description: Automatically fix black code formatting issues in any Azure SDK for Python package. Expects GitHub issue URL, package path, and optional virtual env path in the request. Format "fix black issue <issue-url> [in <package-path>] [using venv <path>]"
---

# Fix Black Formatting Issues Skill
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we should use --isolate flag on azpysdk calls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — added --isolate to all python -m azpysdk calls across all three skill files in commit 12242f4.

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • scanning-api.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from l0lawrence March 19, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants