{"owner":"scala","repo":"scala3","hasSkills":true,"totalSkillsCount":2,"totalTokensCount":1816,"categories":["root-instruction","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","docs/.ai/skills/add-error-code-docs.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to AI coding agents when working with code in this repository.\n\n**Important**:\n- All AI-assisted contributions, including  code, PR/issue descriptions, comments, and code reviews, must comply with the [LLM usage policy](LLM_POLICY.md) . **Important**: state LLM usage clearly in descriptions, commit messages, etc.\n- Read `CONTRIBUTING.md`, in particular the \"Forbidden\" section!\n\n## Project Overview\n\nDotty is the Scala 3 compiler (`dotc`). It compiles Scala source code into JVM bytecode (and optionally Scala.js IR). The compiler is itself written in Scala 3.\n\nWe care about maintainability. \"The tests pass\" is not enough to justify that a change is good.\n\n## Build Commands\n\nUse `sbt --client` (sbt with native thin client) to run commands. This keeps an sbt server running for faster subsequent invocations.\n\n### Compilation\n- `sbt --client scalac <file>` - Compile a file with the current compiler changes\n- `sbt --client scala <class>` - Run a compiled class\n\nUse the `local/` directory for temporary test files (gitignored).\n\n### Testing\n- `sbt --client testCompilation` - Run the whole compilation test suite.\n- `sbt --client testCompilation <name>` - Run compilation tests matching `<name>` (e.g., `sbt --client testCompilation i12345`)\n- `sbt --client scala3-bootstrapped/test` - Run all tests (slow, CI-level)\n- `sbt --client \"testCompilation --update-checkfiles\"` - Update `.check` files with actual output\n\n\n## Test Directory Structure\n\nTests are in `tests/` with categories:\n- `tests/pos` - Should compile successfully\n- `tests/neg` - Should fail to compile (requires `// error` annotations on expected error lines)\n- `tests/run` - Compile and execute (requires `@main def Test` or `object Test extends App`)\n- `tests/pos-custom-args`, `tests/neg-custom-args` - Tests requiring special compiler options\n\nCustom compiler options can be specified:\n1. Per-directory in `compiler/test/dotty/tools/dotc/CompilationTests.scala`\n2. Per-file with `//> using options <flags>` directive at the top of the file\n\nCapture checking tests are in `tests/{pos,neg}-custom-args/captures`. Use `-Ycc-verbose` for verbose capture checking output.\n\nMulti-file tests: Use `_1.scala`, `_2.scala` suffixes for ordered separate compilation, or no suffix for joint compilation.\n\nCheckfiles: `<test>.check` files contain expected compiler output or program output.\n\nTest annotations (magic comments):\n- `// error` - Expect an error on this line (use multiple times for multiple errors)\n- `// warn` - Expect a warning on this line\n- `// nopos-error` - Expect an error with no position (can be anywhere in file)\n- `// anypos-error` - Expect an error with position that can't be annotated\n- `// scalajs: --skip` - Skip this test for Scala.js\n\n## Bootstrapping\n\nThe compiler has two configurations:\n- **nonbootstrapped** - Built with a released Scala 3 compiler (faster iteration)\n- **bootstrapped** - Built with itself (required for some tests, final validation)\n\nUse `scala3-compiler-bootstrapped/testCompilation` for tests requiring the bootstrapped compiler.\n\n## Documentation\n\nDocumentation lives in `docs/_docs/`:\n- `docs/_docs/reference/` - Scala 3 language reference\n- `docs/_docs/reference/experimental/capture-checking/` - Capture checking specification\n- `docs/_docs/internals/` - Compiler internals documentation\n\nFor available AI-assisted documentation workflows or skills start refer to [./docs/.ai/INDEX.md](./docs/.ai/INDEX.md)\n","docs/.ai/skills/add-error-code-docs.md":"# Add Error Code Docs\n\nCanonical skill for creating or updating Scala 3 error-code docs in\n`docs/_docs/reference/error-codes/`.\n\nThis file is the single source of truth. Keep other related files as pointers.\n\n## Best-Effort Contract\n\n- Prefer full mechanical validation with `project/scripts/checkErrorCodeSnippets.scala`.\n- If the environment blocks full validation, still produce the best draft possible and\n  clearly mark what was not verified.\n- If a code is not reproducible from pure Scala snippets, follow the non-reproducible path\n  below and keep `NonReproducibleErrorCodes` aligned in\n  `project/scripts/checkErrorCodeSnippets.scala`.\n\n## Required Output Shape\n\nUse this template for each `E###.md` page:\n\n````markdown\n---\ntitle: E###: <Short Title>\nkind: Error\n# since: 3.x.y   # required when code > E166\n# until: 3.x.y   # required when the compiler ID is inactive\n---\n# E###: <Short Title>\n\n<Explain when this diagnostic happens and why.>\n\n## Example\n\n```scala sc:fail sc-opts:-explain\n<minimal snippet that triggers only E###>\n```\n\n### Error\n\n```scala sc:nocompile\n-- [E###] <Error|Warning>: example.scala:<line>:<col> -------------------------\n<exact checker output here, including explanation text when present>\n```\n\n### Solution\n\n```scala sc:compile\n<direct fix of the example above>\n```\n\n<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. -->\n<aside class=\"warning\">\n    This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios.\n</aside>\n````\n\nFor warning diagnostics, normally make the example fail under `-Werror`:\n\n```scala sc:fail sc-opts:-Werror\n<warning-producing snippet>\n```\n\n## Workflow\n\n1. Establish target metadata.\n- Find the compiler ID in `compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala`.\n- Use filename `docs/_docs/reference/error-codes/E###.md`.\n- Set frontmatter `title` and `kind` (`Error` or `Warning`).\n- Add `since` when `errorNumber > 166`.\n- Add `until` when the ID is inactive.\n\n2. Draft from a nearby entry.\n- Keep section order: `## Example`, `### Error` or `### Warning`, `### Solution`.\n- Keep snippets minimal and deterministic.\n- Keep solutions as direct fixes of the failing scenario.\n\n3. Apply snippet marker rules.\n- Example: `sc:fail` (or `custom-sc:fail` only when required).\n- Output block: `sc:nocompile`.\n- Solution: `sc:compile` (or `custom-sc:compile` only when required).\n- Include needed flags in snippet options (`sc-opts:-explain`, `sc-opts:-Werror`, etc.).\n\n4. Keep output faithful.\n- Store exact compiler output with `[E###]`.\n- Include explain text when emitted.\n\n5. Keep indexing consistent.\n- Add new files to `docs/sidebar.yml` under `Error Codes` in numeric order.\n\n## Validation Commands\n\nFrom repository root:\n\n```bash\nDOC=docs/_docs/reference/error-codes/E###.md\n```\n\nOne-time local compiler setup (rerun only when artifacts/version change):\n\n```bash\nsbtn scala3-bootstrapped/publishLocal\n```\n\nCache local bootstrapped version:\n\n```bash\nVERSION_CACHE=/tmp/scala3-bootstrapped-version.txt\nversion=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh --refresh)\n# later runs:\n# version=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh)\n```\n\nRefresh `### Error` / `### Warning` output:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --update-output\n```\n\nRun full validation:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --verbose\n```\n\nExpected guarantees when validation runs:\n\n- Example snippets fail and include the documented `E###`.\n- Unexpected extra error codes are rejected.\n- Output block matches compiler output.\n- Solution snippets compile cleanly (`-Werror` enforced by checker).\n\n## Completion Checklist\n\n- Frontmatter and heading match `E###`.\n- Examples produce only the documented code (or are explicitly non-reproducible).\n- Output block includes exact checker output.\n- Solutions resolve the same scenario and compile without warnings.\n- Sidebar entry exists and is ordered.\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to AI coding agents when working with code in this repository.\n\n**Important**:\n- All AI-assisted contributions, including  code, PR/issue descriptions, comments, and code reviews, must comply with the [LLM usage policy](LLM_POLICY.md) . **Important**: state LLM usage clearly in descriptions, commit messages, etc.\n- Read `CONTRIBUTING.md`, in particular the \"Forbidden\" section!\n\n## Project Overview\n\nDotty is the Scala 3 compiler (`dotc`). It compiles Scala source code into JVM bytecode (and optionally Scala.js IR). The compiler is itself written in Scala 3.\n\nWe care about maintainability. \"The tests pass\" is not enough to justify that a change is good.\n\n## Build Commands\n\nUse `sbt --client` (sbt with native thin client) to run commands. This keeps an sbt server running for faster subsequent invocations.\n\n### Compilation\n- `sbt --client scalac <file>` - Compile a file with the current compiler changes\n- `sbt --client scala <class>` - Run a compiled class\n\nUse the `local/` directory for temporary test files (gitignored).\n\n### Testing\n- `sbt --client testCompilation` - Run the whole compilation test suite.\n- `sbt --client testCompilation <name>` - Run compilation tests matching `<name>` (e.g., `sbt --client testCompilation i12345`)\n- `sbt --client scala3-bootstrapped/test` - Run all tests (slow, CI-level)\n- `sbt --client \"testCompilation --update-checkfiles\"` - Update `.check` files with actual output\n\n\n## Test Directory Structure\n\nTests are in `tests/` with categories:\n- `tests/pos` - Should compile successfully\n- `tests/neg` - Should fail to compile (requires `// error` annotations on expected error lines)\n- `tests/run` - Compile and execute (requires `@main def Test` or `object Test extends App`)\n- `tests/pos-custom-args`, `tests/neg-custom-args` - Tests requiring special compiler options\n\nCustom compiler options can be specified:\n1. Per-directory in `compiler/test/dotty/tools/dotc/CompilationTests.scala`\n2. Per-file with `//> using options <flags>` directive at the top of the file\n\nCapture checking tests are in `tests/{pos,neg}-custom-args/captures`. Use `-Ycc-verbose` for verbose capture checking output.\n\nMulti-file tests: Use `_1.scala`, `_2.scala` suffixes for ordered separate compilation, or no suffix for joint compilation.\n\nCheckfiles: `<test>.check` files contain expected compiler output or program output.\n\nTest annotations (magic comments):\n- `// error` - Expect an error on this line (use multiple times for multiple errors)\n- `// warn` - Expect a warning on this line\n- `// nopos-error` - Expect an error with no position (can be anywhere in file)\n- `// anypos-error` - Expect an error with position that can't be annotated\n- `// scalajs: --skip` - Skip this test for Scala.js\n\n## Bootstrapping\n\nThe compiler has two configurations:\n- **nonbootstrapped** - Built with a released Scala 3 compiler (faster iteration)\n- **bootstrapped** - Built with itself (required for some tests, final validation)\n\nUse `scala3-compiler-bootstrapped/testCompilation` for tests requiring the bootstrapped compiler.\n\n## Documentation\n\nDocumentation lives in `docs/_docs/`:\n- `docs/_docs/reference/` - Scala 3 language reference\n- `docs/_docs/reference/experimental/capture-checking/` - Capture checking specification\n- `docs/_docs/internals/` - Compiler internals documentation\n\nFor available AI-assisted documentation workflows or skills start refer to [./docs/.ai/INDEX.md](./docs/.ai/INDEX.md)\n","docs/.ai/skills/add-error-code-docs.md":"# Add Error Code Docs\n\nCanonical skill for creating or updating Scala 3 error-code docs in\n`docs/_docs/reference/error-codes/`.\n\nThis file is the single source of truth. Keep other related files as pointers.\n\n## Best-Effort Contract\n\n- Prefer full mechanical validation with `project/scripts/checkErrorCodeSnippets.scala`.\n- If the environment blocks full validation, still produce the best draft possible and\n  clearly mark what was not verified.\n- If a code is not reproducible from pure Scala snippets, follow the non-reproducible path\n  below and keep `NonReproducibleErrorCodes` aligned in\n  `project/scripts/checkErrorCodeSnippets.scala`.\n\n## Required Output Shape\n\nUse this template for each `E###.md` page:\n\n````markdown\n---\ntitle: E###: <Short Title>\nkind: Error\n# since: 3.x.y   # required when code > E166\n# until: 3.x.y   # required when the compiler ID is inactive\n---\n# E###: <Short Title>\n\n<Explain when this diagnostic happens and why.>\n\n## Example\n\n```scala sc:fail sc-opts:-explain\n<minimal snippet that triggers only E###>\n```\n\n### Error\n\n```scala sc:nocompile\n-- [E###] <Error|Warning>: example.scala:<line>:<col> -------------------------\n<exact checker output here, including explanation text when present>\n```\n\n### Solution\n\n```scala sc:compile\n<direct fix of the example above>\n```\n\n<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. -->\n<aside class=\"warning\">\n    This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios.\n</aside>\n````\n\nFor warning diagnostics, normally make the example fail under `-Werror`:\n\n```scala sc:fail sc-opts:-Werror\n<warning-producing snippet>\n```\n\n## Workflow\n\n1. Establish target metadata.\n- Find the compiler ID in `compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala`.\n- Use filename `docs/_docs/reference/error-codes/E###.md`.\n- Set frontmatter `title` and `kind` (`Error` or `Warning`).\n- Add `since` when `errorNumber > 166`.\n- Add `until` when the ID is inactive.\n\n2. Draft from a nearby entry.\n- Keep section order: `## Example`, `### Error` or `### Warning`, `### Solution`.\n- Keep snippets minimal and deterministic.\n- Keep solutions as direct fixes of the failing scenario.\n\n3. Apply snippet marker rules.\n- Example: `sc:fail` (or `custom-sc:fail` only when required).\n- Output block: `sc:nocompile`.\n- Solution: `sc:compile` (or `custom-sc:compile` only when required).\n- Include needed flags in snippet options (`sc-opts:-explain`, `sc-opts:-Werror`, etc.).\n\n4. Keep output faithful.\n- Store exact compiler output with `[E###]`.\n- Include explain text when emitted.\n\n5. Keep indexing consistent.\n- Add new files to `docs/sidebar.yml` under `Error Codes` in numeric order.\n\n## Validation Commands\n\nFrom repository root:\n\n```bash\nDOC=docs/_docs/reference/error-codes/E###.md\n```\n\nOne-time local compiler setup (rerun only when artifacts/version change):\n\n```bash\nsbtn scala3-bootstrapped/publishLocal\n```\n\nCache local bootstrapped version:\n\n```bash\nVERSION_CACHE=/tmp/scala3-bootstrapped-version.txt\nversion=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh --refresh)\n# later runs:\n# version=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh)\n```\n\nRefresh `### Error` / `### Warning` output:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --update-output\n```\n\nRun full validation:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --verbose\n```\n\nExpected guarantees when validation runs:\n\n- Example snippets fail and include the documented `E###`.\n- Unexpected extra error codes are rejected.\n- Output block matches compiler output.\n- Solution snippets compile cleanly (`-Werror` enforced by checker).\n\n## Completion Checklist\n\n- Frontmatter and heading match `E###`.\n- Examples produce only the documented code (or are explicitly non-reproducible).\n- Output block includes exact checker output.\n- Solutions resolve the same scenario and compile without warnings.\n- Sidebar entry exists and is ordered.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/scala/scala3/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# AGENTS.md\n\nThis file provides guidance to AI coding agents when working with code in this repository.\n\n**Important**:\n- All AI-assisted contributions, including  code, PR/issue descriptions, comments, and code reviews, must comply with the [LLM usage policy](LLM_POLICY.md) . **Important**: state LLM usage clearly in descriptions, commit messages, etc.\n- Read `CONTRIBUTING.md`, in particular the \"Forbidden\" section!\n\n## Project Overview\n\nDotty is the Scala 3 compiler (`dotc`). It compiles Scala source code into JVM bytecode (and optionally Scala.js IR). The compiler is itself written in Scala 3.\n\nWe care about maintainability. \"The tests pass\" is not enough to justify that a change is good.\n\n## Build Commands\n\nUse `sbt --client` (sbt with native thin client) to run commands. This keeps an sbt server running for faster subsequent invocations.\n\n### Compilation\n- `sbt --client scalac <file>` - Compile a file with the current compiler changes\n- `sbt --client scala <class>` - Run a compiled class\n\nUse the `local/` directory for temporary test files (gitignored).\n\n### Testing\n- `sbt --client testCompilation` - Run the whole compilation test suite.\n- `sbt --client testCompilation <name>` - Run compilation tests matching `<name>` (e.g., `sbt --client testCompilation i12345`)\n- `sbt --client scala3-bootstrapped/test` - Run all tests (slow, CI-level)\n- `sbt --client \"testCompilation --update-checkfiles\"` - Update `.check` files with actual output\n\n\n## Test Directory Structure\n\nTests are in `tests/` with categories:\n- `tests/pos` - Should compile successfully\n- `tests/neg` - Should fail to compile (requires `// error` annotations on expected error lines)\n- `tests/run` - Compile and execute (requires `@main def Test` or `object Test extends App`)\n- `tests/pos-custom-args`, `tests/neg-custom-args` - Tests requiring special compiler options\n\nCustom compiler options can be specified:\n1. Per-directory in `compiler/test/dotty/tools/dotc/CompilationTests.scala`\n2. Per-file with `//> using options <flags>` directive at the top of the file\n\nCapture checking tests are in `tests/{pos,neg}-custom-args/captures`. Use `-Ycc-verbose` for verbose capture checking output.\n\nMulti-file tests: Use `_1.scala`, `_2.scala` suffixes for ordered separate compilation, or no suffix for joint compilation.\n\nCheckfiles: `<test>.check` files contain expected compiler output or program output.\n\nTest annotations (magic comments):\n- `// error` - Expect an error on this line (use multiple times for multiple errors)\n- `// warn` - Expect a warning on this line\n- `// nopos-error` - Expect an error with no position (can be anywhere in file)\n- `// anypos-error` - Expect an error with position that can't be annotated\n- `// scalajs: --skip` - Skip this test for Scala.js\n\n## Bootstrapping\n\nThe compiler has two configurations:\n- **nonbootstrapped** - Built with a released Scala 3 compiler (faster iteration)\n- **bootstrapped** - Built with itself (required for some tests, final validation)\n\nUse `scala3-compiler-bootstrapped/testCompilation` for tests requiring the bootstrapped compiler.\n\n## Documentation\n\nDocumentation lives in `docs/_docs/`:\n- `docs/_docs/reference/` - Scala 3 language reference\n- `docs/_docs/reference/experimental/capture-checking/` - Capture checking specification\n- `docs/_docs/internals/` - Compiler internals documentation\n\nFor available AI-assisted documentation workflows or skills start refer to [./docs/.ai/INDEX.md](./docs/.ai/INDEX.md)\n","isInternal":false,"tokens":830,"sizeBytes":3470},{"name":"add-error-code-docs.md","path":"docs/.ai/skills/add-error-code-docs.md","rawUrl":"https://raw.githubusercontent.com/scala/scala3/HEAD/docs/.ai/skills/add-error-code-docs.md","title":"Skills Skill","category":"anthropic-skill","format":"markdown","content":"# Add Error Code Docs\n\nCanonical skill for creating or updating Scala 3 error-code docs in\n`docs/_docs/reference/error-codes/`.\n\nThis file is the single source of truth. Keep other related files as pointers.\n\n## Best-Effort Contract\n\n- Prefer full mechanical validation with `project/scripts/checkErrorCodeSnippets.scala`.\n- If the environment blocks full validation, still produce the best draft possible and\n  clearly mark what was not verified.\n- If a code is not reproducible from pure Scala snippets, follow the non-reproducible path\n  below and keep `NonReproducibleErrorCodes` aligned in\n  `project/scripts/checkErrorCodeSnippets.scala`.\n\n## Required Output Shape\n\nUse this template for each `E###.md` page:\n\n````markdown\n---\ntitle: E###: <Short Title>\nkind: Error\n# since: 3.x.y   # required when code > E166\n# until: 3.x.y   # required when the compiler ID is inactive\n---\n# E###: <Short Title>\n\n<Explain when this diagnostic happens and why.>\n\n## Example\n\n```scala sc:fail sc-opts:-explain\n<minimal snippet that triggers only E###>\n```\n\n### Error\n\n```scala sc:nocompile\n-- [E###] <Error|Warning>: example.scala:<line>:<col> -------------------------\n<exact checker output here, including explanation text when present>\n```\n\n### Solution\n\n```scala sc:compile\n<direct fix of the example above>\n```\n\n<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. -->\n<aside class=\"warning\">\n    This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios.\n</aside>\n````\n\nFor warning diagnostics, normally make the example fail under `-Werror`:\n\n```scala sc:fail sc-opts:-Werror\n<warning-producing snippet>\n```\n\n## Workflow\n\n1. Establish target metadata.\n- Find the compiler ID in `compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala`.\n- Use filename `docs/_docs/reference/error-codes/E###.md`.\n- Set frontmatter `title` and `kind` (`Error` or `Warning`).\n- Add `since` when `errorNumber > 166`.\n- Add `until` when the ID is inactive.\n\n2. Draft from a nearby entry.\n- Keep section order: `## Example`, `### Error` or `### Warning`, `### Solution`.\n- Keep snippets minimal and deterministic.\n- Keep solutions as direct fixes of the failing scenario.\n\n3. Apply snippet marker rules.\n- Example: `sc:fail` (or `custom-sc:fail` only when required).\n- Output block: `sc:nocompile`.\n- Solution: `sc:compile` (or `custom-sc:compile` only when required).\n- Include needed flags in snippet options (`sc-opts:-explain`, `sc-opts:-Werror`, etc.).\n\n4. Keep output faithful.\n- Store exact compiler output with `[E###]`.\n- Include explain text when emitted.\n\n5. Keep indexing consistent.\n- Add new files to `docs/sidebar.yml` under `Error Codes` in numeric order.\n\n## Validation Commands\n\nFrom repository root:\n\n```bash\nDOC=docs/_docs/reference/error-codes/E###.md\n```\n\nOne-time local compiler setup (rerun only when artifacts/version change):\n\n```bash\nsbtn scala3-bootstrapped/publishLocal\n```\n\nCache local bootstrapped version:\n\n```bash\nVERSION_CACHE=/tmp/scala3-bootstrapped-version.txt\nversion=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh --refresh)\n# later runs:\n# version=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh)\n```\n\nRefresh `### Error` / `### Warning` output:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --update-output\n```\n\nRun full validation:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --verbose\n```\n\nExpected guarantees when validation runs:\n\n- Example snippets fail and include the documented `E###`.\n- Unexpected extra error codes are rejected.\n- Output block matches compiler output.\n- Solution snippets compile cleanly (`-Werror` enforced by checker).\n\n## Completion Checklist\n\n- Frontmatter and heading match `E###`.\n- Examples produce only the documented code (or are explicitly non-reproducible).\n- Output block includes exact checker output.\n- Solutions resolve the same scenario and compile without warnings.\n- Sidebar entry exists and is ordered.\n","isInternal":false,"tokens":986,"sizeBytes":4210}],"systemPromptSnippet":"<yakaai_skills repo=\"scala/scala3\">\n<!-- File: AGENTS.md (Tokens: ~830 | Category: root-instruction) -->\n# AGENTS.md\n\nThis file provides guidance to AI coding agents when working with code in this repository.\n\n**Important**:\n- All AI-assisted contributions, including  code, PR/issue descriptions, comments, and code reviews, must comply with the [LLM usage policy](LLM_POLICY.md) . **Important**: state LLM usage clearly in descriptions, commit messages, etc.\n- Read `CONTRIBUTING.md`, in particular the \"Forbidden\" section!\n\n## Project Overview\n\nDotty is the Scala 3 compiler (`dotc`). It compiles Scala source code into JVM bytecode (and optionally Scala.js IR). The compiler is itself written in Scala 3.\n\nWe care about maintainability. \"The tests pass\" is not enough to justify that a change is good.\n\n## Build Commands\n\nUse `sbt --client` (sbt with native thin client) to run commands. This keeps an sbt server running for faster subsequent invocations.\n\n### Compilation\n- `sbt --client scalac <file>` - Compile a file with the current compiler changes\n- `sbt --client scala <class>` - Run a compiled class\n\nUse the `local/` directory for temporary test files (gitignored).\n\n### Testing\n- `sbt --client testCompilation` - Run the whole compilation test suite.\n- `sbt --client testCompilation <name>` - Run compilation tests matching `<name>` (e.g., `sbt --client testCompilation i12345`)\n- `sbt --client scala3-bootstrapped/test` - Run all tests (slow, CI-level)\n- `sbt --client \"testCompilation --update-checkfiles\"` - Update `.check` files with actual output\n\n\n## Test Directory Structure\n\nTests are in `tests/` with categories:\n- `tests/pos` - Should compile successfully\n- `tests/neg` - Should fail to compile (requires `// error` annotations on expected error lines)\n- `tests/run` - Compile and execute (requires `@main def Test` or `object Test extends App`)\n- `tests/pos-custom-args`, `tests/neg-custom-args` - Tests requiring special compiler options\n\nCustom compiler options can be specified:\n1. Per-directory in `compiler/test/dotty/tools/dotc/CompilationTests.scala`\n2. Per-file with `//> using options <flags>` directive at the top of the file\n\nCapture checking tests are in `tests/{pos,neg}-custom-args/captures`. Use `-Ycc-verbose` for verbose capture checking output.\n\nMulti-file tests: Use `_1.scala`, `_2.scala` suffixes for ordered separate compilation, or no suffix for joint compilation.\n\nCheckfiles: `<test>.check` files contain expected compiler output or program output.\n\nTest annotations (magic comments):\n- `// error` - Expect an error on this line (use multiple times for multiple errors)\n- `// warn` - Expect a warning on this line\n- `// nopos-error` - Expect an error with no position (can be anywhere in file)\n- `// anypos-error` - Expect an error with position that can't be annotated\n- `// scalajs: --skip` - Skip this test for Scala.js\n\n## Bootstrapping\n\nThe compiler has two configurations:\n- **nonbootstrapped** - Built with a released Scala 3 compiler (faster iteration)\n- **bootstrapped** - Built with itself (required for some tests, final validation)\n\nUse `scala3-compiler-bootstrapped/testCompilation` for tests requiring the bootstrapped compiler.\n\n## Documentation\n\nDocumentation lives in `docs/_docs/`:\n- `docs/_docs/reference/` - Scala 3 language reference\n- `docs/_docs/reference/experimental/capture-checking/` - Capture checking specification\n- `docs/_docs/internals/` - Compiler internals documentation\n\nFor available AI-assisted documentation workflows or skills start refer to [./docs/.ai/INDEX.md](./docs/.ai/INDEX.md)\n\n<!-- File: docs/.ai/skills/add-error-code-docs.md (Tokens: ~986 | Category: anthropic-skill) -->\n# Add Error Code Docs\n\nCanonical skill for creating or updating Scala 3 error-code docs in\n`docs/_docs/reference/error-codes/`.\n\nThis file is the single source of truth. Keep other related files as pointers.\n\n## Best-Effort Contract\n\n- Prefer full mechanical validation with `project/scripts/checkErrorCodeSnippets.scala`.\n- If the environment blocks full validation, still produce the best draft possible and\n  clearly mark what was not verified.\n- If a code is not reproducible from pure Scala snippets, follow the non-reproducible path\n  below and keep `NonReproducibleErrorCodes` aligned in\n  `project/scripts/checkErrorCodeSnippets.scala`.\n\n## Required Output Shape\n\nUse this template for each `E###.md` page:\n\n````markdown\n---\ntitle: E###: <Short Title>\nkind: Error\n# since: 3.x.y   # required when code > E166\n# until: 3.x.y   # required when the compiler ID is inactive\n---\n# E###: <Short Title>\n\n<Explain when this diagnostic happens and why.>\n\n## Example\n\n```scala sc:fail sc-opts:-explain\n<minimal snippet that triggers only E###>\n```\n\n### Error\n\n```scala sc:nocompile\n-- [E###] <Error|Warning>: example.scala:<line>:<col> -------------------------\n<exact checker output here, including explanation text when present>\n```\n\n### Solution\n\n```scala sc:compile\n<direct fix of the example above>\n```\n\n<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. -->\n<aside class=\"warning\">\n    This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios.\n</aside>\n````\n\nFor warning diagnostics, normally make the example fail under `-Werror`:\n\n```scala sc:fail sc-opts:-Werror\n<warning-producing snippet>\n```\n\n## Workflow\n\n1. Establish target metadata.\n- Find the compiler ID in `compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala`.\n- Use filename `docs/_docs/reference/error-codes/E###.md`.\n- Set frontmatter `title` and `kind` (`Error` or `Warning`).\n- Add `since` when `errorNumber > 166`.\n- Add `until` when the ID is inactive.\n\n2. Draft from a nearby entry.\n- Keep section order: `## Example`, `### Error` or `### Warning`, `### Solution`.\n- Keep snippets minimal and deterministic.\n- Keep solutions as direct fixes of the failing scenario.\n\n3. Apply snippet marker rules.\n- Example: `sc:fail` (or `custom-sc:fail` only when required).\n- Output block: `sc:nocompile`.\n- Solution: `sc:compile` (or `custom-sc:compile` only when required).\n- Include needed flags in snippet options (`sc-opts:-explain`, `sc-opts:-Werror`, etc.).\n\n4. Keep output faithful.\n- Store exact compiler output with `[E###]`.\n- Include explain text when emitted.\n\n5. Keep indexing consistent.\n- Add new files to `docs/sidebar.yml` under `Error Codes` in numeric order.\n\n## Validation Commands\n\nFrom repository root:\n\n```bash\nDOC=docs/_docs/reference/error-codes/E###.md\n```\n\nOne-time local compiler setup (rerun only when artifacts/version change):\n\n```bash\nsbtn scala3-bootstrapped/publishLocal\n```\n\nCache local bootstrapped version:\n\n```bash\nVERSION_CACHE=/tmp/scala3-bootstrapped-version.txt\nversion=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh --refresh)\n# later runs:\n# version=$(BOOTSTRAPPED_VERSION_CACHE=\"$VERSION_CACHE\" project/scripts/get-bootstrapped-version.sh)\n```\n\nRefresh `### Error` / `### Warning` output:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --update-output\n```\n\nRun full validation:\n\n```bash\nscala --server=false --scala-version \"$version\" \\\n  project/scripts/checkErrorCodeSnippets.scala -- \"$DOC\" --verbose\n```\n\nExpected guarantees when validation runs:\n\n- Example snippets fail and include the documented `E###`.\n- Unexpected extra error codes are rejected.\n- Output block matches compiler output.\n- Solution snippets compile cleanly (`-Werror` enforced by checker).\n\n## Completion Checklist\n\n- Frontmatter and heading match `E###`.\n- Examples produce only the documented code (or are explicitly non-reproducible).\n- Output block includes exact checker output.\n- Solutions resolve the same scenario and compile without warnings.\n- Sidebar entry exists and is ordered.\n</yakaai_skills>"}