agentleFS
nelmionelmio/NelmioApiDocBundle/.github/copilot-instructions.md

NelmioApiDocBundle

Copilot instructions2.4k starsChanged 2 years agoMITView on GitHub

Follow these mandatory guidelines when contributing code, documentation, and translations to this repository. All contributions will be reviewed for compliance. Adhere to the Symfony Coding Standards and Best Practices alongside the following specific rules:

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

33 rules. About 0 are common, 10 are distinctive, and 23 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 23

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these mandatory guidelines when contributing code, documentation, and translations to this repository.

    line 3
  2. Distinctive:

    Target PHP: Use modern PHP 8.2 syntax and features.

    line 11
  3. Distinctive:

    PSR Compliance: Follow PSR-1, PSR-2, PSR-4, and PSR-12 standards.

    line 23
  4. Very specific:

    Strictness: Always use strict comparisons (===) and not loose (==).

    line 24
  5. Very specific:

    Yoda Conditions: Use Yoda conditions for comparisons (e.g., if (null === $value)).

    line 25
  6. Very specific:

    Braces: Use braces {} in all control structures, even for one-liners.

    line 26
  7. Distinctive:

    One Class Per File: Use one class per file (except for tests).

    line 27
  8. Distinctive:

    Trailing Commas: Use trailing commas in multi-line arrays and parameter lists.

    line 28
  9. Very specific:

    Test Setup/Teardown (setUp() / tearDown())

    line 34
  10. Very specific:

    Add a blank line before return, unless it is the only line in the block.

    line 38
  11. Very specific:

    Use return null; for nullable returns and return.

    line 39
  12. Distinctive:

    Start with a capital letter and end with a dot.

    line 58
  13. Very specific:

    Do not: use backticks ( `).

    line 59
  14. Very specific:

    Use get_debug_type() for inserting class names into messages.

    line 61
  15. Distinctive:

    Code Comments: Add code comments only for complex or unintuitive code.

    line 67
  16. Distinctive:

    Do not: use one-line docblocks.

    line 69
  17. Very specific:

    Avoid @return: if the method returns void.

    line 70
  18. Very specific:

    Put null last in union types (e.g., string|null).

    line 72
  19. Very specific:

    Instantiation: Use parentheses when instantiating classes, even without arguments (new MyClass();).

    line 80
  20. Very specific:

    use Statements: Add use statements for all non-global classes.

    line 81
  21. Distinctive:

    Syntax: Use the reStructuredText syntax.

    line 90
  22. Very specific:

    Headings: Use the specified heading symbols for levels 1–5: =, -, ~, ., ".

    line 91
  23. Very specific:

    Code Blocks: Prefer :: over .. code-block:: php unless it causes formatting issues.

    line 92
  24. Very specific:

    Realism: Use realistic and meaningful examples.

    line 97
  25. Very specific:

    Placeholders: Use Acme for vendor names and example.com / example.org / example.net for URLs.

    line 98
  26. Very specific:

    Directory Root: Use your-project/ as the root directory in examples.

    line 99
  27. Very specific:

    Quotes: Never use typographic quotes (curly quotes).

    line 107
  28. Very specific:

    Add trailing slashes when referencing directories (e.g., src/).

    line 110
  29. Very specific:

    Use a leading dot for file extensions (e.g., .html.twig).

    line 111
  30. Very specific:

    Twig/Assets: Use snake_case for Twig templates and assets (e.g., template.html.twig, style.scss).

    line 112
  31. Distinctive:

    Language: Write in American English.

    line 116
  32. Very specific:

    Person: Use the second person (you) and avoid the first person (we).

    line 118
  33. Very specific:

    Inclusivity: Use gender-neutral language (they/them).

    line 119

≈ “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

AI Contribution Guidelines: Enhanced

Follow these mandatory guidelines when contributing code, documentation, and translations to this repository. All contributions will be reviewed for compliance.


General Project Overview

  • Project Scope: This is a standalone third-party Symfony bundle.
  • Compatibility: Code must be compatible with Symfony 6.4, and 7.x versions.
  • Target PHP: Use modern PHP 8.2 syntax and features.
  • Deprecations: Avoid using deprecated Symfony or PHP features. Consult the Symfony Backward Compatibility Promise for accepted changes during review.
  • Readability: Break text lines in documentation at ~72–78 characters for optimal readability.

PHP Code Standards

Adhere to the Symfony Coding Standards and Best Practices alongside the following specific rules:

Fundamentals

  • PSR Compliance: Follow PSR-1, PSR-2, PSR-4, and PSR-12 standards.
  • Strictness: Always use strict comparisons (===) and not loose (==).
  • Yoda Conditions: Use Yoda conditions for comparisons (e.g., if (null === $value)).
  • Braces: Use braces {} in all control structures, even for one-liners.
  • One Class Per File: Use one class per file (except for tests).
  • Trailing Commas: Use trailing commas in multi-line arrays and parameter lists.

Structure and Organization

  • Class Order:
    1. Constructor (__construct())
    2. Test Setup/Teardown (setUp() / tearDown())
    3. Class properties
    4. Methods (ordered: public → protected → private)
  • Return Statements:
    • Add a blank line before return, unless it is the only line in the block.
    • Use return null; for nullable returns and return; for void functions.
  • Control Flow: Avoid else, elseif, or break after a block that returns or throws.

Naming Conventions

  • Case Conventions:
    • camelCase: Variables and method names.
    • snake_case: Configuration keys, routing names, and Twig template/asset names.
    • SCREAMING_SNAKE_CASE: Class constants.
    • UpperCamelCase (PascalCase): PHP class, interface, trait, and enum names.
  • Suffixing/Prefixing:
    • Interfaces: Suffix with Interface (e.g., MyInterface).
    • Traits: Suffix with Trait (e.g., MyTrait).
    • Exceptions: Suffix with Exception (e.g., MyException).
    • Abstract Classes: Prefix with Abstract, except for test cases (e.g., AbstractFactory).

Error Handling

  • Exception Messages:
    • Start with a capital letter and end with a dot.
    • Do not use backticks (`).
    • Concatenate messages using sprintf().
    • Use get_debug_type() for inserting class names into messages.
    • Error messages must be concise but very precise.
  • Handling: Handle exceptions explicitly and avoid silent catch blocks (i.e., blocks that catch an exception and do nothing).

PHP Comments & PHPDoc

  • Code Comments: Add code comments only for complex or unintuitive code.
  • PHPDoc Blocks:
    • Do not use one-line docblocks.
    • Avoid @return if the method returns void.
    • Group annotations by type.
    • Put null last in union types (e.g., string|null).

Bundle Configuration

  • Dependency Injection: Do not use service autowiring; configure all services explicitly.
  • Service Configuration: Service configuration must use the PHP format (config/services.php).
  • Instantiation: Use parentheses when instantiating classes, even without arguments (new MyClass();).
  • use Statements: Add use statements for all non-global classes.

Documentation, Examples & Assets

Documentation Format

  • Location: Documentation is stored in the docs/ directory.
  • Syntax: Use the reStructuredText syntax.
  • Headings: Use the specified heading symbols for levels 1–5: =, -, ~, ., ".
  • Code Blocks: Prefer :: over .. code-block:: php unless it causes formatting issues.
  • Hyperlinks: Separate link text and its URL (avoid inline hyperlinks).

Code Examples

  • Realism: Use realistic and meaningful examples; avoid generic placeholders like foo, bar, etc.
  • Placeholders: Use Acme for vendor names and example.com / example.org / example.net for URLs.
  • Directory Root: Use your-project/ as the root directory in examples.
  • Line Length: Break code lines $>85$ characters; use ... to indicate folded code.
  • Dependencies: Include use statements when showing referenced classes.
  • Command Line: Prefix bash lines with $. Show the filename as a comment when useful.
  • Configuration Order: Show all configuration formats in this order: YAML, XML, PHP (or Attributes when applicable).

Strings and Assets

  • Quotes: Never use typographic quotes (curly quotes); use straight quotes only: ' and ".
  • String Wraps: Wrap strings (in PHP, CSS, and JavaScript) with single straight quotes (').
  • Paths:
    • Add trailing slashes when referencing directories (e.g., src/).
    • Use a leading dot for file extensions (e.g., .html.twig).
  • Twig/Assets: Use snake_case for Twig templates and assets (e.g., template.html.twig, style.scss).

Language and Tone

  • Language: Write in American English.
  • Contractions: Contractions are allowed (e.g., "it's," "you're").
  • Person: Use the second person (you) and avoid the first person (we).
  • Inclusivity: Use gender-neutral language (they/them).
  • Tone: Avoid belittling or exclusionary words (e.g., "just," "obviously," "easy").

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about nelmio/NelmioApiDocBundle

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

See all 67

Talked about on GitHub, Stack Overflow and Bluesky (67 times).

On GitHub · 50

45 more on GitHub

On Stack Overflow · 16

11 more on Stack Overflow
  • 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.