Agent Skillsopensquilla/opensquilla › meta-pre-commit-quality-gate

meta-pre-commit-quality-gate

GitHub

并行执行ruff、mypy和pytest三项质量检查,对暂存区代码进行综合评估并给出通过或拦截裁决。适用于提交前需全面质量验证的场景,逻辑与CI一致。

src/opensquilla/skills/exp/meta-pre-commit-quality-gate/SKILL.md opensquilla/opensquilla

Trigger Scenarios

用户说 pre-commit quality gate 前端元数据中列出的本地化触发词

Install

npx skills add opensquilla/opensquilla --skill meta-pre-commit-quality-gate -g -y
More Options

Non-standard path

npx skills add https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/exp/meta-pre-commit-quality-gate -g -y

Use without installing

npx skills use opensquilla/opensquilla@meta-pre-commit-quality-gate

指定 Agent (Claude Code)

npx skills add opensquilla/opensquilla --skill meta-pre-commit-quality-gate -a claude-code -g -y

安装 repo 全部 skill

npx skills add opensquilla/opensquilla --all -g -y

预览 repo 内 skill

npx skills add opensquilla/opensquilla --list

SKILL.md

Frontmatter
{
    "kind": "meta",
    "name": "meta-pre-commit-quality-gate",
    "always": false,
    "metadata": {
        "opensquilla": {
            "risk": "high",
            "capabilities": [
                "subprocess",
                "filesystem-read",
                "filesystem-write"
            ]
        }
    },
    "triggers": [
        "pre-commit quality gate",
        "pre-commit 质量门",
        "提交前质量检查"
    ],
    "provenance": {
        "origin": "opensquilla-original",
        "license": "Apache-2.0"
    },
    "composition": {
        "steps": [
            {
                "id": "collect_staged",
                "kind": "skill_exec",
                "with": {
                    "cwd": "{{ inputs.workspace_dir | default('.') }}",
                    "mode": "staged_files"
                },
                "skill": "git-diff"
            },
            {
                "id": "run_ruff",
                "kind": "agent",
                "with": {
                    "task": "Run `uv run ruff check <staged .py files>` on the staged Python files\nlisted below. Filter for paths ending in `.py` only.\n\nStaged files:\n---\n{{ outputs.collect_staged | truncate(800) }}\n---\n\nIf the staged list is NO_STAGED_FILES or contains no .py files, treat\nas PASS.\n\nReply with EXACTLY one line, no preamble:\n  PASS: ruff clean\n  FAIL: <count> findings — <head of first 5 violation lines>\n"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "collect_staged"
                ]
            },
            {
                "id": "run_mypy",
                "kind": "agent",
                "with": {
                    "task": "Run `uv run mypy --show-error-codes` on the staged Python files that\nlive under `src\/opensquilla\/` (skip files outside that tree because\nthe project's mypy config only covers the package).\n\nStaged files:\n---\n{{ outputs.collect_staged | truncate(800) }}\n---\n\nIf no `src\/opensquilla\/**` files are staged, treat as PASS.\n\nReply with EXACTLY one line, no preamble:\n  PASS: mypy clean (or no src files staged)\n  FAIL: <count> errors — <head of first 3 errors>\n"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "collect_staged"
                ]
            },
            {
                "id": "run_pytest",
                "kind": "agent",
                "with": {
                    "task": "Identify pytest files affected by these staged files (any\n`tests\/test_*.py` that imports or references a same-named module).\nRun `uv run pytest -q -x --tb=short` on the affected subset; if you\ncannot localise, run the default-path suite with the same flags.\n\nStaged files:\n---\n{{ outputs.collect_staged | truncate(800) }}\n---\n\nReply with EXACTLY one line, no preamble:\n  PASS: <count> tests passed\n  FAIL: <first failing test name> — <one-line error>\n"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "collect_staged"
                ]
            },
            {
                "id": "arbitrate",
                "kind": "agent",
                "with": {
                    "task": "Three quality gates ran over the staged diff:\n  - ruff:   {{ outputs.run_ruff }}\n  - mypy:   {{ outputs.run_mypy }}\n  - pytest: {{ outputs.run_pytest }}\n\nApply the rule STRICTLY (do NOT soften):\n  * If ANY of the three starts with \"FAIL\" → final verdict is BLOCK.\n    The BLOCK summary concatenates each failing gate's verbatim text.\n  * If ALL three start with \"PASS\" → final verdict is APPROVE.\n\nReply with EXACTLY this structure on the first line, then optionally\nadditional lines:\n  BLOCK: <one-line summary; list every gate that failed>\n  APPROVE: ruff\/mypy\/pytest all green"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "run_ruff",
                    "run_mypy",
                    "run_pytest"
                ]
            },
            {
                "id": "persist",
                "kind": "tool_call",
                "tool": "memory_save",
                "tool_args": {
                    "mode": "append",
                    "path": "memory\/pre-commit-gates.md",
                    "content": "=== pre-commit quality gate ===\ninvocation: {{ inputs.user_message | xml_escape | truncate(200) }}\nstaged: {{ outputs.collect_staged | truncate(600) }}\nruff:   {{ outputs.run_ruff | truncate(200) }}\nmypy:   {{ outputs.run_mypy | truncate(200) }}\npytest: {{ outputs.run_pytest | truncate(200) }}\nverdict: {{ outputs.arbitrate | truncate(400) }}"
                },
                "depends_on": [
                    "arbitrate"
                ],
                "tool_allowlist": [
                    "memory_save"
                ]
            }
        ]
    },
    "description": "Run three quality gates (ruff + mypy + pytest) in parallel over the staged diff, then arbitrate a single BLOCK\/APPROVE verdict. Use before committing changes locally when you want a comprehensive pre-commit gate beyond per-file linting — exactly the same gate set CI enforces.",
    "meta_priority": 70
}

Pre-Commit Quality Gate (Meta-Skill)

A combinator-style meta-skill that runs three independent quality gates in parallel over the currently-staged diff, then arbitrates a single ship-readiness verdict.

Trigger surface

Fire by saying pre-commit quality gate or one of the localized triggers listed in the frontmatter. The skill is also designed to be invoked from a git pre-commit hook via the soft path (meta_invoke), but hook installation is a separate manual step.

Fallback

If the orchestrator fails (sub-Agent error, timeout, etc.), the caller should manually run, in order: uv run ruff check src tests, uv run mypy src/opensquilla --show-error-codes, then uv run pytest -q. The same three commands are the CI quality gate in .github/workflows/ci.yml.

Version History

  • 7f72a32 Current 2026-07-05 18:41

Same Skill Collection

src/opensquilla/skills/bundled/advanced-dubbing-studio/SKILL.md
src/opensquilla/skills/bundled/ai-video-script/SKILL.md
src/opensquilla/skills/bundled/audio-cog/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-image-download/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-research/SKILL.md
src/opensquilla/skills/bundled/AwesomeWebpageMetaSkill/SKILL.md
src/opensquilla/skills/bundled/cron/SKILL.md
src/opensquilla/skills/bundled/docx/SKILL.md
src/opensquilla/skills/bundled/filesystem/SKILL.md
src/opensquilla/skills/bundled/git-diff/SKILL.md
src/opensquilla/skills/bundled/github/SKILL.md
src/opensquilla/skills/bundled/history-explorer/SKILL.md
src/opensquilla/skills/bundled/html-coder/SKILL.md
src/opensquilla/skills/bundled/html-to-pdf/SKILL.md
src/opensquilla/skills/bundled/http-fetch/SKILL.md
src/opensquilla/skills/bundled/latex-compile/SKILL.md
src/opensquilla/skills/bundled/memory/SKILL.md
src/opensquilla/skills/bundled/music-and-singing-studio/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro-openrouter/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro/SKILL.md
src/opensquilla/skills/bundled/nano-pdf/SKILL.md
src/opensquilla/skills/bundled/openrouter-video-generator/SKILL.md
src/opensquilla/skills/bundled/paper-abstract-author/SKILL.md
src/opensquilla/skills/bundled/paper-citation-planner/SKILL.md
src/opensquilla/skills/bundled/paper-experiment-stub/SKILL.md
src/opensquilla/skills/bundled/paper-outline-author/SKILL.md
src/opensquilla/skills/bundled/paper-preference-planner/SKILL.md
src/opensquilla/skills/bundled/paper-refbib-stub/SKILL.md
src/opensquilla/skills/bundled/paper-revision-author/SKILL.md
src/opensquilla/skills/bundled/paper-section-author/SKILL.md
src/opensquilla/skills/bundled/paper-source-curator/SKILL.md
src/opensquilla/skills/bundled/pptx/SKILL.md
src/opensquilla/skills/bundled/seedance-2-prompt/SKILL.md
src/opensquilla/skills/bundled/skill-creator-linter/SKILL.md
src/opensquilla/skills/bundled/skill-creator-proposals/SKILL.md
src/opensquilla/skills/bundled/skill-creator-smoke-test/SKILL.md
src/opensquilla/skills/bundled/srt-from-script/SKILL.md
src/opensquilla/skills/bundled/stack-trace-generic-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-go-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-js-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-python-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-rust-probe/SKILL.md
src/opensquilla/skills/bundled/subtitle-burner/SKILL.md
src/opensquilla/skills/bundled/swe-bench/SKILL.md
src/opensquilla/skills/bundled/text-file-read/SKILL.md
src/opensquilla/skills/bundled/title-card-image/SKILL.md
src/opensquilla/skills/bundled/video-merger/SKILL.md
src/opensquilla/skills/bundled/video-still-animator/SKILL.md
src/opensquilla/skills/bundled/voice-clone-lab/SKILL.md
src/opensquilla/skills/bundled/voice-conversion-studio/SKILL.md
src/opensquilla/skills/bundled/voiceover-studio/SKILL.md
src/opensquilla/skills/bundled/weather/SKILL.md
src/opensquilla/skills/bundled/web-search/SKILL.md
src/opensquilla/skills/bundled/xlsx/SKILL.md
src/opensquilla/skills/exp/meta-arxiv-daily-digest-deck/SKILL.md
src/opensquilla/skills/exp/meta-codereview-current-diff/SKILL.md
src/opensquilla/skills/exp/meta-compliance-audit-bundle/SKILL.md
src/opensquilla/skills/exp/meta-diagram-triangulation/SKILL.md
src/opensquilla/skills/exp/meta-github-pr-watch-digest/SKILL.md
src/opensquilla/skills/exp/meta-issue-to-pr-autopilot/SKILL.md
src/opensquilla/skills/exp/meta-knowledge-base-bootstrap/SKILL.md
src/opensquilla/skills/exp/meta-migration-assistant/SKILL.md
src/opensquilla/skills/exp/meta-multi-format-export-pack/SKILL.md
src/opensquilla/skills/exp/meta-pdf-intelligence/SKILL.md
src/opensquilla/skills/exp/meta-pdf-reformat-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-scheduled-morning-digest/SKILL.md
src/opensquilla/skills/exp/meta-security-review-bundle/SKILL.md
src/opensquilla/skills/exp/meta-spreadsheet-insight/SKILL.md
src/opensquilla/skills/exp/meta-stack-trace-investigator/SKILL.md
src/opensquilla/skills/exp/meta-travel-planner/SKILL.md
src/opensquilla/skills/exp/meta-web-to-pdf-briefing/SKILL.md
tests/_fixtures/meta-paper-write-handwritten.SKILL.md
src/opensquilla/skills/bundled/code-task/SKILL.md
src/opensquilla/skills/bundled/deep-research/SKILL.md
src/opensquilla/skills/bundled/meta-kid-project-planner/SKILL.md
src/opensquilla/skills/bundled/meta-paper-write/SKILL.md
src/opensquilla/skills/bundled/meta-short-drama/SKILL.md
src/opensquilla/skills/bundled/meta-skill-creator/SKILL.md
src/opensquilla/skills/bundled/multi-search-engine/SKILL.md
src/opensquilla/skills/bundled/pdf-toolkit/SKILL.md
src/opensquilla/skills/bundled/skill-creator/SKILL.md
src/opensquilla/skills/bundled/sub-agent/SKILL.md
src/opensquilla/skills/bundled/summarize/SKILL.md
src/opensquilla/skills/bundled/tmux/SKILL.md
src/opensquilla/skills/exp/meta-long-running-build-watchdog/SKILL.md
src/opensquilla/skills/bundled/paper-plot-stub/SKILL.md
src/opensquilla/skills/exp/meta-content-publish-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-home-it-rescue/SKILL.md
src/opensquilla/skills/exp/meta-meeting-to-workflow/SKILL.md
src/opensquilla/skills/exp/meta-research-to-slide-deck/SKILL.md
src/opensquilla/skills/exp/meta-sales-lead-researcher/SKILL.md

Metadata

Files
0
Version
7f72a32
Hash
5af685af
Indexed
2026-07-05 18:41

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 04:51
浙ICP备14020137号-1 $Гость$