agentleFS
intelintel/neural-compressor/.github/copilot-instructions.md

neural-compressor

Copilot instructions2.7k starsChanged 5 months agoApache-2.0View on GitHub

This file configures GitHub Copilot (code suggestions and PR reviews) to follow the coding standards enforced by the project's pre-commit hooks (.pre-commit-config.yaml) and tool configuration (pyproject.toml). - Use black style formatting for all Python files (excluding examples/, neuralcompressor/torch/algorithms/fp8quant/, and test/torch/). - Line length: 120 characters. - Use double quotes for strings. - Indent with 4 spaces; never use tabs. - Respect magic trailing commas. - Sort imports with isort using the black profile. - Maximum line length for imports: 120…

We split this copilot-instructions.md into the rules it gives an agent

17 rules. About 0 are common, 4 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use black style formatting for all Python files (excluding examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/).

    line 11
  2. Distinctive:

    Use double quotes for strings.

    line 14
  3. Very specific:

    Treat neural_compressor as a first-party package.

    line 22
  4. Very specific:

    Do not modify __init__.py files' imports.

    line 23
  5. Very specific:

    Follow ruff rules E4, E7, E9, and F (Pyflakes + pycodestyle errors).

    line 29
  6. Distinctive:

    Do not wrap summary lines or description lines (wrapping is disabled).

    line 50
  7. Very specific:

    All code under neural_compressor/ must pass bandit at low severity (-lll) and low confidence (-iii) thresholds.

    line 64
  8. Distinctive:

    Do not suggest patterns that introduce common security issues such as:

    line 66
  9. Very specific:

    Use of subprocess with shell=True

    line 67
  10. Very specific:

    Use of pickle, yaml.load (without Loader), eval, or exec

    line 69
  11. Distinctive:

    Ensure all identifiers, comments, and documentation are correctly spelled.

    line 74
  12. Very specific:

    Remove # noqa comments that are no longer suppressing any active lint warning.

    line 79
  13. Very specific:

    Do not include breakpoint(), pdb.set_trace(), or any other debug statement in committed code.

    line 83
  14. Very specific:

    No trailing whitespace in .py, .rst, .cmake, .yaml, or .yml files (except files under examples/, neural_compressor/torch/utils/, …

    line 88
  15. Very specific:

    Every new file under neural_compressor/ with extension .py, .yaml, .yml, or .sh must include the Apache 2.0 license header at the top …

    line 100
  16. Very specific:

    Do not add the header again if a Copyright notice already exists in the file.

    line 120
  17. Very specific:

    Keep requirements*.txt files sorted and deduplicated (except those under examples/).

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions 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
copilot-instructions.md

GitHub Copilot Instructions

This file configures GitHub Copilot (code suggestions and PR reviews) to follow the coding standards enforced by the project's pre-commit hooks (.pre-commit-config.yaml) and tool configuration (pyproject.toml).


Python formatting – black

  • Use black style formatting for all Python files (excluding examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/).
  • Line length: 120 characters.
  • Use double quotes for strings.
  • Indent with 4 spaces; never use tabs.
  • Respect magic trailing commas.

Import ordering – isort

  • Sort imports with isort using the black profile.
  • Maximum line length for imports: 120 characters.
  • Treat neural_compressor as a first-party package.
  • Do not modify __init__.py files' imports.
  • Applies to all Python files except examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/.

Linting – ruff

  • Follow ruff rules E4, E7, E9, and F (Pyflakes + pycodestyle errors).
  • Target Python 3.10 syntax.
  • Line length: 120 characters; indent width: 4 spaces.
  • The following rule IDs are intentionally ignored in this project and must not be flagged as issues:
    • E402 – module-level import not at top of file
    • E501 – line too long
    • E721 – type comparison (using isinstance() is preferred but not enforced)
    • E722 – bare except
    • E731 – lambda assigned to variable
    • E741 – ambiguous variable names (l, O, I)
    • F401 – imported but unused
    • F403 / F405 – star imports
    • F841 – local variable assigned but never used
  • Underscore-prefixed variables are allowed to be unused.
  • Applies to all Python files except examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/.

Docstrings – docformatter

  • Format docstrings using Google style.
  • Do not wrap summary lines or description lines (wrapping is disabled).
  • Docstrings must be black-compatible.
  • Applies to all Python files except examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/.

Docstring examples in documentation – blacken-docs

  • Code blocks inside Markdown and reStructuredText documentation files must also follow black formatting with line length 120.
  • Applies to all docs except examples/, docs/source/JAX.md, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/.

Security – bandit

  • All code under neural_compressor/ must pass bandit at low severity (-lll) and low confidence (-iii) thresholds.
  • Do not suggest patterns that introduce common security issues such as:
    • Use of subprocess with shell=True
    • Hard-coded passwords or secrets
    • Use of pickle, yaml.load (without Loader), eval, or exec
    • Insecure use of temporary files or random number generators in security contexts

Spelling – codespell

  • Ensure all identifiers, comments, and documentation are correctly spelled.
  • The project uses codespell to detect and auto-fix typos.

Unused # noqa comments – yesqa

  • Remove # noqa comments that are no longer suppressing any active lint warning.

Debug statements

  • Do not include breakpoint(), pdb.set_trace(), or any other debug statement in committed code.

Whitespace and file hygiene

  • No trailing whitespace in .py, .rst, .cmake, .yaml, or .yml files (except files under examples/, neural_compressor/torch/utils/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/quantization/).
  • All .py, .md, .rst, .yaml, and .yml files must end with a single newline character (except files under examples/, neural_compressor/torch/algorithms/fp8_quant/, and test/torch/algorithms/fp8_quant/).
  • JSON files must be valid (except .vscode/settings_recommended.json).
  • YAML files must be valid.

License headers

  • Every new file under neural_compressor/ with extension .py, .yaml, .yml, or .sh must include the Apache 2.0 license header at the top (within the first 40 lines). The header template is:

    # Copyright (c) YYYY Intel Corporation
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #    http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
  • Do not add the header again if a Copyright notice already exists in the file.

Requirements and dependency files

  • Keep requirements*.txt files sorted and deduplicated (except those under examples/).

Scope of these rules

These rules apply to all code suggestions and PR review comments made by Copilot in this repository. When suggesting changes, Copilot should ensure the resulting code would pass all the pre-commit hooks listed above. If a file path matches one of the exclusion patterns for a given hook, that specific rule does not need to be applied to that file.

Download now (ZIP)

Trending

Quiet since July.about the whole repository

Dec 2025: 3 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 3 mentionsJun 2026: 2 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the intel/neural-compressor repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about intel/neural-compressor

The biggest 5 of 45 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 45

Talked about on GitHub and Stack Overflow (45 times).

On GitHub · 44

39 more on GitHub
  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

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

Reviews can't be read right now.

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.