agentleFS
TheAlgorithmsTheAlgorithms/R/.github/copilot-instructions.md

R

Copilot instructions1.2k starsChanged 3 years agoMITView on GitHub

This repository contains implementations of various algorithms in R. All contributions should follow these guidelines to maintain code quality and consistency. When adding a new algorithm: - Verify that the algorithm is not already implemented in the repository (including under a different name) - Confirm that the proposed algorithm is a recognized computer-science algorithm, not a problem-specific adaptation of a general technique (e.g., tuned for LeetCode or other competitive-programming problems) - Include a brief explanation of the algorithm in the…

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

19 rules. About 1 is common, 16 are distinctive, and 2 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure that your code is functional and well-structured before submitting

    line 9
  2. Distinctive:

    Follow best practices for efficiency, readability, and maintainability

    line 11
  3. Very specific:

    Use consistent and meaningful variable names (use .

    line 12
  4. Distinctive:

    When adding a new algorithm:

    line 16
  5. Distinctive:

    Add an example showcasing its usage (can be commented within the script)

    line 20
  6. Distinctive:

    When modifying existing algorithms:

    line 25
  7. Distinctive:

    Ensure that your modifications do not break existing functionality

    line 27
  8. Distinctive:

    If applicable, update or add test cases to validate your changes

    line 28
  9. Distinctive:

    Ensure that filenames follow the existing directory structure and naming patterns

    line 33
  10. Distinctive:

    Add a brief docstring at the beginning of the script explaining:

    line 39
  11. Distinctive:

    Before submitting a pull request, verify that your code:

    line 46
  12. Common:

    Does not produce unnecessary warnings or errors

    line 48
  13. Distinctive:

    If applicable, add a test file demonstrating the algorithm's correctness

    line 49
  14. Distinctive:

    When reviewing a pull request:

    line 53
  15. Distinctive:

    Verify that any added algorithms or data structures aren't already implemented elsewhere in the repository (including under a different …

    line 54
  16. Very specific:

    Check that the extension of all code file names is a lowercase .r

    line 56
  17. Distinctive:

    Check that the newly added algorithm is also added to DIRECTORY.md file

    line 57
  18. Distinctive:

    Verify that the code includes appropriate documentation and examples

    line 58
  19. Distinctive:

    Ensure that variable naming follows repository conventions

    line 59

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

Copilot Instructions for TheAlgorithms/R

General Guidelines

This repository contains implementations of various algorithms in R. All contributions should follow these guidelines to maintain code quality and consistency.

Code Quality & Functionality

  • Ensure that your code is functional and well-structured before submitting
  • The code should run without errors in an R environment and produce the expected output
  • Follow best practices for efficiency, readability, and maintainability
  • Use consistent and meaningful variable names (use . or _ to separate words, e.g., results.df for a data frame)

Adding New Algorithms

When adding a new algorithm:

  • Verify that the algorithm is not already implemented in the repository (including under a different name)
  • Confirm that the proposed algorithm is a recognized computer-science algorithm, not a problem-specific adaptation of a general technique (e.g., tuned for LeetCode or other competitive-programming problems)
  • Include a brief explanation of the algorithm in the file as comments
  • Add an example showcasing its usage (can be commented within the script)
  • Update DIRECTORY.md to include the new algorithm in the appropriate section

Modifying Existing Algorithms

When modifying existing algorithms:

  • Clearly document the changes in your pull request description
  • Ensure that your modifications do not break existing functionality
  • If applicable, update or add test cases to validate your changes

File Naming & Structure Conventions

  • All code file names must use lowercase .r extension (not .R)
  • Ensure that filenames follow the existing directory structure and naming patterns
  • Files should be placed in the appropriate category directory (e.g., sorting_algorithms/, graph_algorithms/, mathematics/)

Documentation & Comments

  • Provide clear and concise documentation in the form of comments within the code
  • Add a brief docstring at the beginning of the script explaining:
    • What the algorithm does
    • The expected input and output
    • Any dependencies required

Testing & Verification

Before submitting a pull request, verify that your code:

  • Runs correctly with different test cases
  • Does not produce unnecessary warnings or errors
  • If applicable, add a test file demonstrating the algorithm's correctness

Pull Request Review Checklist

When reviewing a pull request:

  • Verify that any added algorithms or data structures aren't already implemented elsewhere in the repository (including under a different name)
  • Confirm that the proposed algorithm is a recognized computer-science algorithm, not a problem-specific adaptation of a general technique (e.g., tuned for LeetCode or other competitive-programming problems). It is prohibited to add LeetCode problems.
  • Check that the extension of all code file names is a lowercase .r
  • Check that the newly added algorithm is also added to DIRECTORY.md file
  • Verify that the code includes appropriate documentation and examples
  • Ensure that variable naming follows repository conventions

Download now (ZIP)

  • 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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.