pre-submit-pr

作者: huggingface

在提交拉取请求前验证更改。运行全面检查,包括代码检查、测试、对齐审查和RFC分析。在创建…之前使用。

npx skills add https://github.com/huggingface/openenv --skill pre-submit-pr

Pre-Submit PR Check

Comprehensive validation before submitting a pull request. Run this before creating or updating a PR.

Instructions

  1. Check branch freshness (BLOCKING):

    • Run git fetch origin main to get latest main
    • Run git rev-list --count HEAD..origin/main to check commits behind
    • If > 0 commits behind, merge main before proceeding: git merge origin/main
    • This prevents "branch out of date" issues on GitHub
  2. Run all automated hooks:

    • bash .claude/hooks/lint.sh - format check (includes ruff format + ruff check)
    • bash .claude/hooks/test.sh - run tests
    • bash .claude/hooks/check-debug.sh - find debug code
  3. Run alignment review:

    • Read .claude/docs/PRINCIPLES.md and .claude/docs/INVARIANTS.md
    • Compare changes against principles and invariants
    • Identify Tier 1 (mechanical) and Tier 2 (alignment) issues
  4. RFC check:

    • If changes touch src/openenv/core/, flag for RFC consideration
    • If any public API signatures change, RFC required
    • Check against existing RFCs in rfcs/ for conflicts
  5. Documentation freshness check:

    • Review .claude/docs/REPO_WALKTHROUGH.md against the current repo structure
    • If the PR adds new directories, moves files, or changes structure significantly:
      • Update REPO_WALKTHROUGH.md to reflect the changes
      • Include these updates in the PR
    • Check triggers: new directories in src/, envs/, .claude/, or rfcs/
    • Check if any public API signatures changed (function/class renames, new params):
      • Search for references in docs/, examples/, README.md, other .py docstrings
      • If stale references found, recommend running /update-docs before PR
  6. Summarize PR readiness:

    • List all blocking issues
    • List all discussion points for reviewers
    • Provide overall verdict
  7. After push/PR creation, run the post-push check:

    • bash .claude/hooks/post-push-pr.sh
    • Verifies: PR is open, no merge conflicts, branch freshness, PR description quality, CI check status

Output Format

## Pre-Submit PR Report

### Branch Freshness
| Check | Status | Details |
|-------|--------|---------|
| Up to date with main | YES/NO | [X commits behind, merged if needed] |

### Automated Checks
| Check | Status | Details |
|-------|--------|---------|
| Lint | PASS/FAIL | [summary] |
| Tests | PASS/FAIL | [X passed, Y failed] |
| Debug code | CLEAN/FOUND | [details] |

### Alignment Review

#### Tier 1: Fixes Required (blocking)
- [ ] path/file.py:123 - [issue description]

#### Tier 2: Discussion Points (flag for reviewers)
[ALIGNMENT FLAGS or "None identified"]

### Invariant Check
[List any invariants at risk, or "All invariants maintained"]

### RFC Status
[NOT REQUIRED / RECOMMENDED / REQUIRED: reason]

### Documentation Freshness
[UP TO DATE / UPDATED: list of changes made to REPO_WALKTHROUGH.md]
[STALE DOCS: run /update-docs — list of stale references found]

### Verdict: READY FOR PR / ISSUES TO ADDRESS

### Summary for PR Description
[2-3 sentences summarizing changes for the PR description]

Blocking Issues

The following issues block PR submission:

  • Branch out of date with main (must merge first)
  • Lint failures
  • Test failures
  • Debugger statements (breakpoint, pdb)
  • Invariant violations
  • RFC required but not written

Non-Blocking (Flag for Reviewers)

These should be noted in PR but don't block:

  • Alignment discussion points (Tier 2)
  • RFC recommended (optional)
  • TODOs in code
  • Print statements (unless in core code)

来自 huggingface 的更多技能

sync-models
huggingface
将chat-ui的模型配置与HuggingFace路由器同步——为新模型添加描述,标记支持推理的模型,为32B及以上的模型启用artifacts……
custom-blocks
huggingface
Use when the user has written (or wants to write) a `ModularPipelineBlocks` subclass in a local Python file and needs to package it into a Hub-uploadable…
self-review
huggingface
Use before opening a PR, or whenever asked to self-review a diffusers contribution. Applies the same rubric as the `@claude` CI (checks the diff against…
hf-cloud-sagemaker-production-defaults
huggingface
创建一个SageMaker端点(实时或异步),默认启用自动扩缩、CloudWatch告警和标签功能。每当要创建…时,使用此技能。
hf-cloud-serving-image-selection
huggingface
为SageMaker模型部署选择合适的服务容器,并查找其当前镜像URI。在即将部署模型到……时使用此技能。
Hugging Face Cli
huggingface
Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.
Hugging Face Datasets
huggingface
在 Hugging Face Hub 上创建和管理数据集。支持初始化仓库、定义配置/系统提示、流式更新行数据,以及基于 SQL 的数据集查询与转换。设计为与 HF MCP 服务器协同工作,实现完整的数据集工作流。
Hugging Face Evaluation
huggingface
在Hugging Face模型卡片中添加和管理评估结果。支持从README内容中提取评估表格、从Artificial Analysis API导入分数,以及使用vLLM/lighteval运行自定义模型评估。兼容model-index元数据格式。