Infra, Ops & WorkflowSûr100100/100

New Compiler Feature (.NET)

Set up tracking for a new C# compiler feature: create test plan issue, feature label, update Language Feature Status page, and link related PRs. Use when: setting up a new language feature, creating a test plan, tracking a new csharplang proposal in roslyn, or asked to 'set up feature tracking'.

ou envoie-le directement à ton agent.

Installer dans ton projet

$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs new-compiler-feature__dotnet-dotnet__src-roslyn-github-skills-b6bdaae3417b
.NET
dotnet/dotnet
Contenu à copier
---
name: new-compiler-feature
description: "Set up tracking for a new C# compiler feature: create test plan issue, feature label, update Language Feature Status page, and link related PRs. Use when: setting up a new language feature, creating a test plan, tracking a new csharplang proposal in roslyn, or asked to 'set up feature tracking'."
argument-hint: "Roslyn PR URL implementing the feature (e.g., https://github.com/dotnet/roslyn/pull/83288)"
metadata:
  origin: .NET
---

# New Compiler Feature Setup

Set up tracking for a new C# language feature in dotnet/roslyn, starting from an implementation PR.

> **IMPORTANT**: Present the full plan and get explicit user confirmation before making any changes.

> **IDEMPOTENCY**: Safe to re-run. Checks for existing artifacts before creating. Use it to fix missing pieces.

## Prerequisites

- `gh` CLI authenticated with write access to `dotnet/roslyn` (verify with `gh auth status`)

Do not proceed if prerequisites are not met. Instead, guide the user through the necessary actions (installing `gh`, authenticating, etc.).

## Phase 1: Gather

### 1.1 Parse the PR

```powershell
gh pr view <NUMBER> --repo dotnet/roslyn --json title,body,author,baseRefName,labels,number
```

Extract from PR body (ask user if missing):
- **csharplang issue URL**: `https://github.com/dotnet/csharplang/issues/NNNN`
- **Spec URL**: `https://github.com/dotnet/csharplang/blob/main/proposals/*.md`

Extract from metadata:
- **Developer**: PR author
- **Branch**: PR base ref (`features/*` or `main`)

### 1.2 Validate csharplang issue

```powershell
gh issue view <NUMBER> --repo dotnet/csharplang --json title,labels,assignees
```

**Abort** if the issue lacks the `Proposal champion` label.

Extract **LDM champ** from assignees (ask user to pick if multiple).

### 1.3 Feature name

Offer two candidates, ask user to pick or edit:
1. From spec filename (kebab-case → readable text)
2. From csharplang issue title (strip `[Proposal]: ` prefix)

This name is used for the label (`Feature - <Name>`) and test plan title.

### 1.4 Reviewer and IDE buddy

Ask user (default: "TBD" for both).

### 1.5 Verify feature branch

If base ref ≠ `main`, verify it exists (URL-encode the branch name for the API call). Warn if missing.

### 1.6 Collect related PRs

1. Always include the input PR
2. Parse `#NNNN` references from stacked-PR lists in the body; validate each is a PR via `gh pr view`
3. Search for open PRs targeting the same feature branch (if not `main`)
4. Deduplicate; present list to user for confirmation

### 1.7 Check existing artifacts

- **Label**: `gh label list --repo dotnet/roslyn --search "Feature - <Name>"`
- **Test plan issue**: `gh issue list --repo dotnet/roslyn --search "<csharplang_url>" --label "Area-Compilers"` — match by csharplang URL in body
- **Feature status row**: grep for csharplang issue URL in `docs/Language Feature Status.md`
- **Status PR**: `gh pr list --repo dotnet/roslyn --head "feature-status/<spec-filename>" --state open`

## Phase 2: Plan

Present all gathered info and planned actions. Mark existing artifacts with ✓. Ask for explicit confirmation.

## Phase 3: Execute

### 3.1 Create feature label

Skip if exists. Color: `2ad0ad`.

```powershell
gh label create "Feature - <Name>" --repo dotnet/roslyn --color "2ad0ad"
```

### 3.2 Create test plan issue

Skip if exists. Assign to the developer and reviewers (assignment may silently fail for external contributors — that's OK).

```powershell
gh issue create --repo dotnet/roslyn `
  --title 'Test plan for "<Name>" feature' `
  --body "Championed proposal: <csharplang_url>`nSpec: <spec_url>`n`n(created by new-compiler-feature skill)" `
  --label "Area-Compilers" --label "Feature - <Name>" `
  --assignee "<developer>" --assignee "<reviewer1>" --assignee "<reviewer2>"
```

Set issue type to "Feature" via GraphQL:
```powershell
# Get issue type ID for "Feature"
gh api graphql -f query='{ repository(owner: "dotnet", name: "roslyn") { issueTypes(first: 20) { nodes { id name } } } }'
# Get issue node ID, then update
gh api graphql -f query='mutation { updateIssue(input: {id: "<issueId>", issueTypeId: "<featureTypeId>"}) { issue { issueType { name } } } }'
```

### 3.3 Label related PRs

For each PR, add `Feature - <Name>` label if not already applied.

### 3.4 Comment on related PRs

For each PR, check if a comment with the exact test plan URL exists. If not:

```powershell
gh pr comment <NUMBER> --repo dotnet/roslyn --body "Test plan: <test_plan_url>`n(created by new-compiler-feature skill)"
```

### 3.5 Update Language Feature Status page

Skip if the csharplang issue URL already appears in the file.

**Row format:**
```
| [<Title>](<csharplang_url>) | <branch_col> | [In progress](<test_plan_url>) | [<dev>](https://github.com/<dev>) | <reviewers> | <ide_buddy> | [<ldm>](https://github.com/<ldm>) |
```

- Branch column: `[<short-name>](https://github.com/dotnet/roslyn/tree/<full-ref>)` for feature branches; plain `main` otherwise
- Reviewers/IDE buddy: `TBD` or `[<user>](https://github.com/<user>)` (comma-separated if multiple)
- Insert after the last "In progress" row, before the first "Merged" row in the Working Set C# table. If no merged rows, append after the last row.

### 3.6 Create PR for feature status update

Skip if an open PR already exists.

When the current worktree is clean and based on `main`, make the status-page edit locally:

1. Create `feature-status/<spec-filename>` from `main`.
2. Edit `docs/Language Feature Status.md` in the worktree.
3. Inspect the resulting diff and present the exact change to the user for approval before committing or publishing it.
4. After approval, commit the change. Obtain explicit permission before pushing, then push the branch and create the PR.

Use the GitHub API only when the worktree is not clean or is not based on `main`:

```powershell
# Get latest main SHA
$mainSha = gh api repos/dotnet/roslyn/git/refs/heads/main --jq '.object.sha'

# Create branch
gh api -X POST repos/dotnet/roslyn/git/refs -f ref="refs/heads/feature-status/<spec-filename>" -f sha="$mainSha"

# Get current file content and SHA from main
$fileMeta = gh api "repos/dotnet/roslyn/contents/docs/Language Feature Status.md" --jq '{sha: .sha, content: .content}' | ConvertFrom-Json

# Decode content, insert the new row, re-encode to base64, then update:
gh api -X PUT "repos/dotnet/roslyn/contents/docs/Language Feature Status.md" `
  -f message='Track status for feature "<Name>"' `
  -f branch="feature-status/<spec-filename>" `
  -f sha="$($fileMeta.sha)" `
  -f content="$newContentBase64"

# Create PR
gh pr create --repo dotnet/roslyn `
  --title 'Track status for feature "<Name>"' `
  --body "Adds feature status tracking row.`n`n- csharplang issue: <csharplang_url>`n- Test plan: <test_plan_url>`n`nFYI @<developer> @<reviewer(s)> @<ldm_champ>`n`n(created by new-compiler-feature skill)" `
  --head "feature-status/<spec-filename>" --base main `
  --label "Area-Compilers" --label "Documentation"
```

**Present the PR URL to the user.**

### Summary

```
✅ Feature setup complete for "<Name>"
- Label: Feature - <Name>
- Test plan: <url>
- Feature status PR: <url>
- PRs labeled and linked: #NNN, #NNN
```

## Error Handling

- `gh` command failure → stop and report
- Missing "Proposal champion" label → abort
- Missing feature branch (non-main) → warn, let user decide
- Always check for existing artifacts before creating
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait New Compiler Feature (.NET)

`gh` CLI authenticated with write access to `dotnet/roslyn` (verify with `gh auth status`)
**csharplang issue URL**: `https://github.com/dotnet/csharplang/issues/NNNN`
**Spec URL**: `https://github.com/dotnet/csharplang/blob/main/proposals/*.md`
**Developer**: PR author

Comment utiliser New Compiler Feature (.NET)

1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.

Déclencheurs pour New Compiler Feature (.NET)

Dis simplement à ton agent quelque chose comme :

Applique le skill new-compiler-feature__dotnet-dotnet__src-roslyn-github-skills-b6bdaae3417b à cette tâche
Utilise new-compiler-feature__dotnet-dotnet__src-roslyn-github-skills-b6bdaae3417b pour améliorer cette implémentation
Passe en revue ce sujet avec new-compiler-feature__dotnet-dotnet__src-roslyn-github-skills-b6bdaae3417b

Skills liés à New Compiler Feature (.NET)

Add CLI Command (.NET)
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.
Add Dotnet Aot Command (.NET)
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.
Add Net Analyzer (.NET)
Add, port, or change a .NET code analysis rule (CA####) under src/Microsoft.CodeAnalysis.NetAnalyzers. USE FOR: implementing a new CA analyzer and its code fixer, porting a rule or PR from the retired dotnet/roslyn-analyzers repo, allocating a diagnostic ID from DiagnosticCategoryAndIdRanges.txt, choosing RuleLevel/severity/category, wiring resx + xlf strings, recording the rule in AnalyzerReleases.Unshipped.md, regenerating the analyzer documentation/sarif files, and writing MSTest analyzer/code-fix tests with the VerifyCS/VerifyVB harness. DO NOT USE FOR: NETSDK#### MSBuild diagnostics (src/Tasks), CS####/BC#### compiler diagnostics or IDE#### analyzers (dotnet/roslyn), or CONTAINER#### diagnostics (src/Containers).