|
| 1 | +--- |
| 2 | +model: Claude Opus 4.6 (copilot) |
| 3 | +agent: agent |
| 4 | +description: Reorganizes individual error H2s into thematic sections with resolution focus |
| 5 | +tools: ['vscode', 'execute', 'read', 'agent', 'edit', 'search', 'todo'] |
| 6 | +--- |
| 7 | + |
| 8 | +# Consolidate error sections and rewrite for resolution |
| 9 | + |
| 10 | +You are reorganizing a consolidated error article so individual per-error H2s become thematic H2 sections focused on resolution. The user will provide: |
| 11 | + |
| 12 | +- **Destination filename** — the consolidated `.md` file in `docs/csharp/language-reference/compiler-messages/` |
| 13 | + |
| 14 | +## Key file locations |
| 15 | + |
| 16 | +- **Destination file**: `docs/csharp/language-reference/compiler-messages/{destination-filename}` |
| 17 | +- **Reference examples**: Other `*-errors.md` files in the same folder (study these for structural patterns) |
| 18 | + |
| 19 | +## Phase A: Propose themes |
| 20 | + |
| 21 | +1. Read the destination file and identify all error codes and their current H2 sections. |
| 22 | +2. Read 2-3 other consolidated error files in `docs/csharp/language-reference/compiler-messages/` to understand the expected structure and tone. |
| 23 | +3. Group the error codes into themes based on their error messages, underlying language rules, and resolution strategies. Each theme should represent a coherent set of related diagnostics. |
| 24 | +4. Propose the list of themes with: |
| 25 | + - A theme title (which becomes the H2 heading and anchor) |
| 26 | + - The included error codes |
| 27 | + - A one-sentence rationale for the grouping |
| 28 | + |
| 29 | +**Present the theme list to the user and stop.** Format as: |
| 30 | + |
| 31 | +``` |
| 32 | +### Proposed themes |
| 33 | +
|
| 34 | +1. **Operator signature requirements** (`#operator-signature-requirements`) |
| 35 | + - CS0448, CS0559, CS0562, CS0563, CS0564, CS0567, CS0590 |
| 36 | + - These errors all relate to invalid parameter or return types in operator declarations. |
| 37 | +
|
| 38 | +2. **Overflow and underflow errors** (`#overflow-and-underflow-errors`) |
| 39 | + - CS0031, CS0220, CS0221, CS0463, CS0543, CS0594, CS0652, CS1021, CS8778, CS8973 |
| 40 | + - These errors all involve constant values or operations that exceed type boundaries. |
| 41 | +``` |
| 42 | + |
| 43 | +Tell the user: *Review and approve each theme. Let me know which to proceed with and any adjustments.* |
| 44 | + |
| 45 | +**Wait for user approval before proceeding to Phase B.** |
| 46 | + |
| 47 | +## Phase B: Build thematic sections |
| 48 | + |
| 49 | +For each approved theme: |
| 50 | + |
| 51 | +### 1. Update the master error list at the top of the file |
| 52 | + |
| 53 | +Each error code in the master list should link to its theme's anchor. Keep the list in **numerical order** by error code. Format: |
| 54 | + |
| 55 | +```markdown |
| 56 | +- [**CS{NNNN}**](#{theme-anchor}): *{verbatim compiler error message}* |
| 57 | +``` |
| 58 | + |
| 59 | +### 2. Create the thematic H2 section |
| 60 | + |
| 61 | +Replace all the individual-error H2s that belong to this theme with a single thematic H2: |
| 62 | + |
| 63 | +```markdown |
| 64 | +## {Theme title} |
| 65 | + |
| 66 | +- **CS{NNNN}**: *{verbatim error message}* |
| 67 | +- **CS{NNNN}**: *{verbatim error message}* |
| 68 | +... |
| 69 | + |
| 70 | +{Resolution-focused content} |
| 71 | +``` |
| 72 | + |
| 73 | +The error list within the section repeats the codes and messages but **without anchor links** (they're already in the section). |
| 74 | + |
| 75 | +### 3. Write resolution-focused content |
| 76 | + |
| 77 | +The content in each thematic section should focus on **how to correct each error**, not on explaining the language feature. Follow these rules: |
| 78 | + |
| 79 | +- **Link to language reference:** Provide links to language reference articles and C# specification sections that explain the rules these diagnostics enforce. For example, link to `https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/operators/operator-overloading.md` or the relevant spec section. |
| 80 | +- **Write detailed corrections:** For each correction, use a full sentence explaining what to do and why. Put the affected error codes in parentheses, in **bold** style. Example: |
| 81 | + > Change the return type of `++` or `--` operators to the containing type or a type derived from it (**CS0448**). The language requires that increment and decrement operators return a value compatible with the containing type so the result can be assigned back to the same variable. |
| 82 | +- **No extensive examples:** Remove lengthy code examples. Brief inline code references are acceptable. |
| 83 | +- **No H3 headings:** Keep the section flat under the H2. |
| 84 | +- **Note obsolete errors:** If any error codes are no longer produced in the latest version of C#, explicitly note that. |
| 85 | +- **Incorporate source material:** Where applicable, reuse text or brief examples from the individual H2s you're replacing. |
| 86 | + |
| 87 | +### 4. Remove the old individual H2s |
| 88 | + |
| 89 | +After creating the thematic section, delete all individual-error H2s (`## CS{NNNN}`) that were absorbed into it. |
| 90 | + |
| 91 | +## Final check |
| 92 | + |
| 93 | +After all themes are built: |
| 94 | + |
| 95 | +1. Verify the master error list at the top is still in numerical order. |
| 96 | +2. Verify every error code in the front matter has a corresponding entry in the master list. |
| 97 | +3. Verify every error code in the master list links to a valid anchor in the article. |
| 98 | +4. Verify there are no orphaned H2 sections (individual error H2s that weren't grouped into a theme). |
0 commit comments