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
- Distinctive: line 9
Ensure that your code is functional and well-structured before submitting
- Distinctive: line 11
Follow best practices for efficiency, readability, and maintainability
- Very specific: line 12
Use consistent and meaningful variable names (use .
- Distinctive: line 16
When adding a new algorithm:
- Distinctive: line 20
Add an example showcasing its usage (can be commented within the script)
- Distinctive: line 25
When modifying existing algorithms:
- Distinctive: line 27
Ensure that your modifications do not break existing functionality
- Distinctive: line 28
If applicable, update or add test cases to validate your changes
- Distinctive: line 33
Ensure that filenames follow the existing directory structure and naming patterns
- Distinctive: line 39
Add a brief docstring at the beginning of the script explaining:
- Distinctive: line 46
Before submitting a pull request, verify that your code:
- Common: line 48
Does not produce unnecessary warnings or errors
- Distinctive: line 49
If applicable, add a test file demonstrating the algorithm's correctness
- Distinctive: line 53
When reviewing a pull request:
- Distinctive: line 54
Verify that any added algorithms or data structures aren't already implemented elsewhere in the repository (including under a different …
- Very specific: line 56
Check that the extension of all code file names is a lowercase .r
- Distinctive: line 57
Check that the newly added algorithm is also added to DIRECTORY.md file
- Distinctive: line 58
Verify that the code includes appropriate documentation and examples
- Distinctive: line 59
Ensure that variable naming follows repository conventions
≈ “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.
Files
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.dffor 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
.rextension (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
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
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.

