{"owner":"github-linguist","repo":"linguist","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance for AI agents working with the Linguist repository.\n\n## Project Overview\n\nLinguist is a Ruby library used on GitHub.com to:\n- Detect blob languages\n- Ignore binary and vendored files\n- Suppress generated files in diffs\n- Generate language breakdown graphs\n\nIt's packaged as the `github-linguist` gem and includes CLI tools: `github-linguist` and `git-linguist`.\n\n## Key Files and Directories\n\n| Path | Purpose |\n|------|---------|\n| `lib/linguist/languages.yml` | Master list of all languages, extensions, filenames, and their properties |\n| `lib/linguist/heuristics.yml` | Rules for disambiguating files with shared extensions |\n| `lib/linguist/heuristics.rb` | Ruby code implementing heuristic logic |\n| `lib/linguist/classifier.rb` | Centroid-based classifier for language detection |\n| `samples/` | Sample code files for each language (used by classifier) |\n| `grammars.yml` | Lists all TextMate grammars used for syntax highlighting |\n| `vendor/` | Contains grammar submodules and cached license files for the grammars |\n| `script/` | Utility scripts for maintenance tasks |\n\n## Development Environment\n\nUse GitHub Codespaces or the dev container for the easiest setup. The environment includes Ruby, Node.js, Docker, and all required dependencies.\n\nTo bootstrap locally:\n```bash\nscript/bootstrap\n```\n\nTo run Linguist from the repo:\n```bash\nbundle exec bin/github-linguist --breakdown\n```\n\n## Common Tasks\n\n### Adding a Language Extension\n1. Add extension to the language entry in `lib/linguist/languages.yml` (alphabetical order, case-sensitive; primary extension first)\n2. Add sample files to `samples/<Language>/`\n3. If extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Adding a New Language\n1. Add entry to `lib/linguist/languages.yml` (omit `language_id` initially)\n2. Add grammar: `script/add-grammar <grammar-url>`\n3. Add samples to `samples/<Language>/`\n4. Generate ID: `script/update-ids`\n5. If an extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Replacing a Grammar\n```bash\nscript/add-grammar --replace <GrammarName> <new-grammar-url>\n```\n\n### Important Scripts\n- `script/bootstrap` - Install dependencies\n- `script/add-grammar` - Add or replace TextMate grammars\n- `script/update-ids` - Generate unique language IDs\n- `script/cross-validation` - Test the classifier\n- `script/cibuild` - CI build script\n\n## Testing\n\nRun tests with:\n```bash\nbundle exec rake test\n```\n\nTest the classifier:\n```bash\nbundle exec script/cross-validation --test\n```\n\nAlways ensure tests pass before submitting changes. GitHub Actions runs tests on all PRs.\n\n## Coding Conventions\n\n- **Ruby style**: Follow existing code patterns in the repository\n- **languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase) with the comment at the top. Use the comment at the top to determine the fields to add for a language.\n- **Extensions in languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase); primary extension first\n- **Samples**: Use real-world code examples, not \"Hello World\" and other common examples used in tutorials\n- **Heuristics**: Write patterns to minimize false positives. Patterns must be linear, safe from ReDoS attacks, and RE2 compatible. All heuristics must have tests.\n- **Don't refactor unrelated code.** Keep changes scoped to the task at hand.\n\n## Generated and script maintained files — do not edit by hand\n\n- `.gitmodules`\n- `grammars.yml`\n- all files in `vendor/`\n\nThese are all maintained by the `script/add-grammars` script.\n\n## PR Requirements\n\nAll PRs must:\n1. Use the provided PR template. Irrelevant sections may be removed.\n2. Link to GitHub search results showing in-the-wild usage, excluding forks, for each extension being added (minimum 2000 files for common extensions, 200 for once-per-repo files or extensions).\n3. Link to the original source of any samples added. This must not be a link to the fork of Linguist used for the contribution.\n4. State the license of any sample code added individually.\n5. Pass all CI tests.\n\nDo not open a PR if any of the above conditions are not met and notify the user why the PR has not been created.\n\n## Usage Requirements for New Languages/Extensions\n\n- At least 2000 files indexed on GitHub (or 200 for once-per-repo files like Makefile), excluding forks\n- Reasonable distribution across unique `user/repo` combinations\n- High-proportion users may be filtered out during assessment\n\n## Grammar Requirements\n\nOnly add grammars with approved licenses (see `vendor/licenses/config.yml` for the list). TextMate-compatible grammars are used for syntax highlighting.\n\n## Key Dependencies\n\n- `charlock_holmes` - Character encoding detection (requires ICU)\n- `rugged` - libgit2 bindings for Ruby\n- Docker - Required for grammar operations\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance for AI agents working with the Linguist repository.\n\n## Project Overview\n\nLinguist is a Ruby library used on GitHub.com to:\n- Detect blob languages\n- Ignore binary and vendored files\n- Suppress generated files in diffs\n- Generate language breakdown graphs\n\nIt's packaged as the `github-linguist` gem and includes CLI tools: `github-linguist` and `git-linguist`.\n\n## Key Files and Directories\n\n| Path | Purpose |\n|------|---------|\n| `lib/linguist/languages.yml` | Master list of all languages, extensions, filenames, and their properties |\n| `lib/linguist/heuristics.yml` | Rules for disambiguating files with shared extensions |\n| `lib/linguist/heuristics.rb` | Ruby code implementing heuristic logic |\n| `lib/linguist/classifier.rb` | Centroid-based classifier for language detection |\n| `samples/` | Sample code files for each language (used by classifier) |\n| `grammars.yml` | Lists all TextMate grammars used for syntax highlighting |\n| `vendor/` | Contains grammar submodules and cached license files for the grammars |\n| `script/` | Utility scripts for maintenance tasks |\n\n## Development Environment\n\nUse GitHub Codespaces or the dev container for the easiest setup. The environment includes Ruby, Node.js, Docker, and all required dependencies.\n\nTo bootstrap locally:\n```bash\nscript/bootstrap\n```\n\nTo run Linguist from the repo:\n```bash\nbundle exec bin/github-linguist --breakdown\n```\n\n## Common Tasks\n\n### Adding a Language Extension\n1. Add extension to the language entry in `lib/linguist/languages.yml` (alphabetical order, case-sensitive; primary extension first)\n2. Add sample files to `samples/<Language>/`\n3. If extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Adding a New Language\n1. Add entry to `lib/linguist/languages.yml` (omit `language_id` initially)\n2. Add grammar: `script/add-grammar <grammar-url>`\n3. Add samples to `samples/<Language>/`\n4. Generate ID: `script/update-ids`\n5. If an extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Replacing a Grammar\n```bash\nscript/add-grammar --replace <GrammarName> <new-grammar-url>\n```\n\n### Important Scripts\n- `script/bootstrap` - Install dependencies\n- `script/add-grammar` - Add or replace TextMate grammars\n- `script/update-ids` - Generate unique language IDs\n- `script/cross-validation` - Test the classifier\n- `script/cibuild` - CI build script\n\n## Testing\n\nRun tests with:\n```bash\nbundle exec rake test\n```\n\nTest the classifier:\n```bash\nbundle exec script/cross-validation --test\n```\n\nAlways ensure tests pass before submitting changes. GitHub Actions runs tests on all PRs.\n\n## Coding Conventions\n\n- **Ruby style**: Follow existing code patterns in the repository\n- **languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase) with the comment at the top. Use the comment at the top to determine the fields to add for a language.\n- **Extensions in languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase); primary extension first\n- **Samples**: Use real-world code examples, not \"Hello World\" and other common examples used in tutorials\n- **Heuristics**: Write patterns to minimize false positives. Patterns must be linear, safe from ReDoS attacks, and RE2 compatible. All heuristics must have tests.\n- **Don't refactor unrelated code.** Keep changes scoped to the task at hand.\n\n## Generated and script maintained files — do not edit by hand\n\n- `.gitmodules`\n- `grammars.yml`\n- all files in `vendor/`\n\nThese are all maintained by the `script/add-grammars` script.\n\n## PR Requirements\n\nAll PRs must:\n1. Use the provided PR template. Irrelevant sections may be removed.\n2. Link to GitHub search results showing in-the-wild usage, excluding forks, for each extension being added (minimum 2000 files for common extensions, 200 for once-per-repo files or extensions).\n3. Link to the original source of any samples added. This must not be a link to the fork of Linguist used for the contribution.\n4. State the license of any sample code added individually.\n5. Pass all CI tests.\n\nDo not open a PR if any of the above conditions are not met and notify the user why the PR has not been created.\n\n## Usage Requirements for New Languages/Extensions\n\n- At least 2000 files indexed on GitHub (or 200 for once-per-repo files like Makefile), excluding forks\n- Reasonable distribution across unique `user/repo` combinations\n- High-proportion users may be filtered out during assessment\n\n## Grammar Requirements\n\nOnly add grammars with approved licenses (see `vendor/licenses/config.yml` for the list). TextMate-compatible grammars are used for syntax highlighting.\n\n## Key Dependencies\n\n- `charlock_holmes` - Character encoding detection (requires ICU)\n- `rugged` - libgit2 bindings for Ruby\n- Docker - Required for grammar operations\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\nThis file provides guidance for AI agents working with the Linguist repository.\n\n## Project Overview\n\nLinguist is a Ruby library used on GitHub.com to:\n- Detect blob languages\n- Ignore binary and vendored files\n- Suppress generated files in diffs\n- Generate language breakdown graphs\n\nIt's packaged as the `github-linguist` gem and includes CLI tools: `github-linguist` and `git-linguist`.\n\n## Key Files and Directories\n\n| Path | Purpose |\n|------|---------|\n| `lib/linguist/languages.yml` | Master list of all languages, extensions, filenames, and their properties |\n| `lib/linguist/heuristics.yml` | Rules for disambiguating files with shared extensions |\n| `lib/linguist/heuristics.rb` | Ruby code implementing heuristic logic |\n| `lib/linguist/classifier.rb` | Centroid-based classifier for language detection |\n| `samples/` | Sample code files for each language (used by classifier) |\n| `grammars.yml` | Lists all TextMate grammars used for syntax highlighting |\n| `vendor/` | Contains grammar submodules and cached license files for the grammars |\n| `script/` | Utility scripts for maintenance tasks |\n\n## Development Environment\n\nUse GitHub Codespaces or the dev container for the easiest setup. The environment includes Ruby, Node.js, Docker, and all required dependencies.\n\nTo bootstrap locally:\n```bash\nscript/bootstrap\n```\n\nTo run Linguist from the repo:\n```bash\nbundle exec bin/github-linguist --breakdown\n```\n\n## Common Tasks\n\n### Adding a Language Extension\n1. Add extension to the language entry in `lib/linguist/languages.yml` (alphabetical order, case-sensitive; primary extension first)\n2. Add sample files to `samples/<Language>/`\n3. If extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Adding a New Language\n1. Add entry to `lib/linguist/languages.yml` (omit `language_id` initially)\n2. Add grammar: `script/add-grammar <grammar-url>`\n3. Add samples to `samples/<Language>/`\n4. Generate ID: `script/update-ids`\n5. If an extension is shared with another language, ensure there are at least two samples and add a heuristic in `lib/linguist/heuristics.yml`\n\n### Replacing a Grammar\n```bash\nscript/add-grammar --replace <GrammarName> <new-grammar-url>\n```\n\n### Important Scripts\n- `script/bootstrap` - Install dependencies\n- `script/add-grammar` - Add or replace TextMate grammars\n- `script/update-ids` - Generate unique language IDs\n- `script/cross-validation` - Test the classifier\n- `script/cibuild` - CI build script\n\n## Testing\n\nRun tests with:\n```bash\nbundle exec rake test\n```\n\nTest the classifier:\n```bash\nbundle exec script/cross-validation --test\n```\n\nAlways ensure tests pass before submitting changes. GitHub Actions runs tests on all PRs.\n\n## Coding Conventions\n\n- **Ruby style**: Follow existing code patterns in the repository\n- **languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase) with the comment at the top. Use the comment at the top to determine the fields to add for a language.\n- **Extensions in languages.yml**: Keep alphabetically sorted (case-sensitive, uppercase before lowercase); primary extension first\n- **Samples**: Use real-world code examples, not \"Hello World\" and other common examples used in tutorials\n- **Heuristics**: Write patterns to minimize false positives. Patterns must be linear, safe from ReDoS attacks, and RE2 compatible. All heuristics must have tests.\n- **Don't refactor unrelated code.** Keep changes scoped to the task at hand.\n\n## Generated and script maintained files — do not edit by hand\n\n- `.gitmodules`\n- `grammars.yml`\n- all files in `vendor/`\n\nThese are all maintained by the `script/add-grammars` script.\n\n## PR Requirements\n\nAll PRs must:\n1. Use the provided PR template. Irrelevant sections may be removed.\n2. Link to GitHub search results showing in-the-wild usage, excluding forks, for each extension being added (minimum 2000 files for common extensions, 200 for once-per-repo files or extensions).\n3. Link to the original source of any samples added. This must not be a link to the fork of Linguist used for the contribution.\n4. State the license of any sample code added individually.\n5. Pass all CI tests.\n\nDo not open a PR if any of the above conditions are not met and notify the user why the PR has not been created.\n\n## Usage Requirements for New Languages/Extensions\n\n- At least 2000 files indexed on GitHub (or 200 for once-per-repo files like Makefile), excluding forks\n- Reasonable distribution across unique `user/repo` combinations\n- High-proportion users may be filtered out during assessment\n\n## Grammar Requirements\n\nOnly add grammars with approved licenses (see `vendor/licenses/config.yml` for the list). TextMate-compatible grammars are used for syntax highlighting.\n\n## Key Dependencies\n\n- `charlock_holmes` - Character encoding detection (requires ICU)\n- `rugged` - libgit2 bindings for Ruby\n- Docker - Required for grammar operations\n","category":"root","tokens":1245}]}