Sokol Net
elix22/Sokol.NET
Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++…
Attempts one alternative fix for a bug, runs the given test command against it and reports what happened, always differing from existing PR fixes.
$ npx skills add dotnet/maui --skill try-fix -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install dotnet/maui try-fix --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/try-fix .claude/skills/try-fix && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .claude/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/dotnet/maui/tree/main/.github/skills/try-fixType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add dotnet/maui --skill try-fix -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install dotnet/maui try-fix --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/try-fix .agents/skills/try-fix && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .agents/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/maui --skill try-fix -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install dotnet/maui try-fix --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/try-fix .cursor/skills/try-fix && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .cursor/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/dotnet/maui.git --path .github/skills/try-fix--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add dotnet/maui --skill try-fix -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install dotnet/maui try-fix --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/try-fix .gemini/skills/try-fix && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .gemini/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install dotnet/maui try-fixInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add dotnet/maui --skill try-fix -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/try-fix .github/skills/try-fix && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .github/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/maui --skill try-fix -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install dotnet/maui try-fix --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/try-fix .opencode/skills/try-fix && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "try-fix" agent skill from https://github.com/dotnet/maui/tree/main/.github/skills/try-fix into .opencode/skills/try-fix/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "try-fix", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
try-fixAttempts one alternative fix for a bug, runs the given test command against it and reports what happened, always differing from existing PR fixes.
Each run tries exactly one fix idea. The caller supplies a problem description, a test command, target files and optional hints, and the agent reviews the fixes already in the PR, picks a different approach, implements it, tests it and reports the outcome. It is for proposing and testing fixes only, so it should stay idle for code review, PR summaries, test-only requests or general questions, and when no problem or test command is given.
The agent works only from the context it receives and git history, with no outside searching. Cleanup is limited to one restore script, EstablishBrokenBaseline.ps1 with -Restore, and git checkout, clean, reset and stash are off limits. After the baseline step it may edit only the files listed under RevertedFiles in .github/.baseline-state.json, reports Blocked if another tracked file would be needed, and leaves untracked paths that existed beforehand alone. Reference files cover compile errors and an example invocation, and the excerpt stops partway through the principles.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 7d38fd0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitpwshdotnetFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Requires PowerShell, git, .NET MAUI build environment, Android/iOS device or emulator
From compatibility in the SKILL.md frontmatter.
Try Fix Alternative Approach loads about 8.4k tokens when it runs, and up to ~9.2k if it reads all its reference files. Until then it costs about 75 tokens; SKILL.md has 3,369 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from dotnet/maui at commit 7d38fd0, republished under its MIT licence (© dotnet). 3,369 words, ~8,377 tokens.
.claude/skills/try-fix/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Attempts ONE fix for a given problem. Receives all context upfront, tries a single approach, tests it, and reports what happened.
🚨 This skill is ONLY for proposing and testing code fixes. Do NOT activate for:
If the prompt does not include a problem to fix and a test command to verify, this skill should not run.
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore. Never use
git checkout, git clean, git restore, git reset, or git stash to
revert or clean changes, including after artifacts have been captured..github/.baseline-state.json under RevertedFiles. The restore script
tracks only those original fix files; editing any other tracked file makes
restoration incomplete. If the state file is absent, or its NewFiles
array is non-empty, report Blocked before editing: added production files
are not safely restorable. If the approach requires another tracked file,
report Blocked instead of editing it.try-fix/; leave
it exactly as found even when git status --short lists it. It is
harness-owned input, not attempt-created drift. The restore script is the
only cleanup step; do not use rm, Remove-Item, or another filesystem
command to make the worktree appear clean.shellId, call read_bash with that exact
shellId and wait for the completed result. Never proceed, report, or end
the session while baseline, test, artifact, self-review, or restore work is
still running.$OUTPUT_DIR. Never persist $OUTPUT_DIR or other shell
state in .github/, the repository root, or another workspace path. Shell
variables do not persist between tool calls, so redeclare the same literal
$OUTPUT_DIR at the start of each later shell command instead of writing a
repository marker file.Every invocation runs all 11 Workflow steps below. Step 6 (Expert Self-Review) is performed inline against .github/agents/maui-expert-reviewer.md — do NOT spawn the @maui-expert-reviewer sub-agent. Step 7.5 refreshes the self-review if the test loop modified code so the recorded findings reflect the final diff. Step 8 enforces this via a file-existence gate on reviewer-findings.json. Before returning the final report, verify that Step 9 ran with the exact script-only restore command above; if it did not, run it before responding.
🚨 Try-fix runs MUST be executed ONE AT A TIME - NEVER in parallel.
Why: Each try-fix run:
If run in parallel:
Correct pattern: Run attempt-1, wait for completion, then run attempt-2, etc.
All inputs are provided by the invoker (CI, agent, or user).
| Input | Required | Description |
|---|---|---|
| Problem | Yes | Description of the bug/issue to fix |
| Test command | Yes | Repository-specific script to build and test. Use BuildAndRunHostApp.ps1 for UI tests, Run-DeviceTests.ps1 for device tests, or dotnet test for unit tests. The correct command is determined by the test type detected in the PR. ALWAYS use the appropriate script - NEVER manually build/compile. |
| Target files | Yes | Files to investigate; any file absent from the baseline state's RevertedFiles is read-only |
| Platform | Yes | Target platform (android, ios, windows, maccatalyst) |
| Hints | Optional | Suggested approaches, prior attempts, or areas to focus on |
| Baseline | Optional | Git ref or instructions for establishing broken state (default: current state) |
Results reported back to the invoker:
| Field | Description |
|---|---|
approach | What fix was attempted (brief description) |
files_changed | Which files were modified |
result | Pass, Fail, or Blocked |
analysis | Why it worked, or why it failed and what was learned |
diff | The actual code changes made (for review) |
findings_count | Number of self-review findings recorded (0 = clean self-review) |
FIRST STEP: Create output directory before doing anything else.
# Set issue/PR number explicitly (from branch name, PR context, or manual input)
$IssueNumber = "<ISSUE_OR_PR_NUMBER>" # Replace with actual number
# Find next attempt number
$tryFixDir = "CustomAgentLogsTmp/PRState/$IssueNumber/PRAgent/try-fix"
$existingAttempts = (Get-ChildItem "$tryFixDir/attempt-*" -Directory -ErrorAction SilentlyContinue).Count
$attemptNum = $existingAttempts + 1
# Create output directory
$OUTPUT_DIR = "$tryFixDir/attempt-$attemptNum"
New-Item -ItemType Directory -Path $OUTPUT_DIR -Force | Out-Null
Write-Host "Output directory: $OUTPUT_DIR"Keep this path from the command output and redeclare it in each subsequent shell invocation, for example:
$OUTPUT_DIR = "CustomAgentLogsTmp/PRState/<ISSUE_OR_PR_NUMBER>/PRAgent/try-fix/attempt-1"Do not create .github/.try-fix-output-dir, .try-fix-output-dir, or any
equivalent repository marker. The only attempt artifacts belong under
$OUTPUT_DIR.
Required files to create in $OUTPUT_DIR:
| File | When to Create | Content |
|---|---|---|
baseline.log | After Step 2 (Baseline) | Output from EstablishBrokenBaseline.ps1 proving baseline was established |
approach.md | After Step 4 (Design) | What fix you're attempting and why it's different from existing fixes |
reviewer-findings.json | After Step 6 (Self-Review), refreshed by Step 7.5 | JSON array of self-review findings — [] when clean. MUST reflect the final diff. |
reviewer-findings.diff | After Step 6 (Self-Review), refreshed by Step 7.5 | Snapshot of git diff at the time the self-review was written. Step 7.5 compares this to the post-test-loop diff to detect drift. |
result.txt | After Step 7 (Test) | Single word: Pass, Fail, or Blocked |
fix.diff | After Step 7 (Test) | Output of git diff showing your changes |
test-output.log | After Step 7 (Test) | Full output from test command |
analysis.md | After Step 8 (Capture) | Why it worked/failed, insights learned, and a one-line self-review summary |
Example approach.md:
## Approach: Geometric Off-Screen Check
Skip RequestApplyInsets for views completely off-screen using simple bounds check:
`viewLeft >= screenWidth || viewRight <= 0 || viewTop >= screenHeight || viewBottom <= 0`
**Different from existing fix:** Current fix uses HashSet tracking. This approach uses pure geometry with no state.Example result.txt:
PassThe skill is complete when:
reviewer-findings.json written — [] if clean. Refreshed by Step 7.5 if the test loop modified code, so the saved findings reflect the final diff.findings_count)🚨 CRITICAL: What counts as "Pass" vs "Fail"
| Scenario | Result | Explanation |
|---|---|---|
| Test command runs, tests pass | ✅ Pass | Actual validation |
| Test command runs, tests fail | ❌ Fail | Fix didn't work |
| Code compiles but no device available | ⚠️ Blocked | Device/emulator unavailable - report with explanation |
| Code compiles but test command errors | ❌ Fail | Infrastructure issue is still a failure |
| Code doesn't compile | ❌ Fail | Fix is broken |
NEVER claim "Pass" based on:
Pass REQUIRES: The test command executed AND reported test success.
If device/emulator is unavailable: Report result.txt = Blocked with explanation. Do NOT manufacture a Pass.
Exhaustion criteria: Stop after 3 iterations if:
Never stop due to: Compile errors (fix them), infrastructure blame (debug your code), giving up too early.
Session limits: Each try-fix invocation allows up to 3 compile/test iterations. The calling orchestrator controls how many invocations (attempts) to run per session (typically 4-5 as part of pr-review Phase 3).
MANDATORY: Review what has already been tried:
Check for existing PR changes:
git diff origin/main HEAD --name-onlyReview prior attempts if any are known:
Identify what makes your approach DIFFERENT:
Examples of alternatives:
Review the provided context:
Do NOT search for external context. Work with what's provided and the git history.
🚨 ONLY use EstablishBrokenBaseline.ps1 — NEVER use git checkout, git restore, or git reset to revert fix files.
The script auto-restores any previous baseline, tracks state, and prevents loops. Manual git commands bypass all of this and WILL cause infinite loops in CI.
pwsh .github/scripts/EstablishBrokenBaseline.ps1 *>&1 | Tee-Object -FilePath "$OUTPUT_DIR/baseline.log"If this command continues in the background, wait for its matching shellId
with read_bash until it completes. The baseline is not established merely
because the initial shell invocation returned.
Verify baseline was established:
Select-String -Path "$OUTPUT_DIR/baseline.log" -Pattern "Baseline established"Read .github/.baseline-state.json after this command. Its RevertedFiles
array is the complete modification allow-list for the attempt. Target files
outside that array may be inspected but MUST NOT be edited. If the state file
was not created, or NewFiles contains any path, report Blocked immediately
and proceed to Step 9 without modifying tracked files; the restore script does
not safely restore added production files.
If the script fails with "No fix files detected": Report as Blocked — do NOT switch branches.
If something fails mid-attempt: pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore
Read the target files to understand the code.
Verify the platform code path before implementing. Check which platform-specific file actually executes for the target scenario:
.iOS.cs compile for both iOS AND MacCatalyst.Android.cs only compile for AndroidNavigationPage.Legacy.cs, not MauiNavigationImpl)
If unsure which code path runs, check AppHostBuilderExtensions or handler registration to confirm.Key questions:
Based on your analysis and any provided hints, design a single fix approach:
"Different" means different ROOT CAUSE hypothesis, not just different code location.
adapter == null in OnMeasure; you check adapter == null in OnLayout (same root cause assumption — just a different call site)adapter == null; you prevent disposal from happening during measure (different root cause hypothesis)If hints suggest specific approaches, prioritize those.
IMMEDIATELY create approach.md in your output directory:
@"
## Approach: [Brief Name]
[Description of what you're changing and why]
**Prior approach avoided:** [Name every relevant existing/prior approach, their shared failure mechanism, and why they failed, or N/A]
**Mechanism-level difference:** [Explain the full cause-to-effect chain showing why the new mechanism avoids that failure, not merely the code location]
"@ | Set-Content "$OUTPUT_DIR/approach.md"Implement your fix. Use git status --short and git diff to track changes.
🚨 You perform this self-review yourself. Do NOT spawn the @maui-expert-reviewer sub-agent. Step 8's file-existence gate enforces that reviewer-findings.json is written every attempt.
This step runs BEFORE testing so you can catch design flaws before spending time on build+test cycles.
Procedure:
Read the rules. View these specific sections of .github/agents/maui-expert-reviewer.md:
## Overarching Principles (8 numbered principles, near the top of the file) — apply to every fix## Dimension Routing + ### Always-Active Dimensions — pick the dimensions that match your changed files## Review Dimensions (e.g., ### 1. Layout Measure-Arrange Correctness)You only need the dimensions that match the files you actually touched plus the always-active ones — typically 3–6 sections, not all 30.
Identify your changed files:
git diff --name-only HEADIf you have NO code changes (e.g., Blocked because no device available before any fix was applied), still proceed to step 4 and write '[]' — the artifact gate is the enforcement mechanism.
Walk your diff against the rules:
Write findings to $OUTPUT_DIR/reviewer-findings.json. Always write the file, even when there are zero findings. Use the same JSON format as the @maui-expert-reviewer agent (matches the GitHub Pull Request Review API):
# No findings — clean self-review (or no diff to review):
'[]' | Set-Content "$OUTPUT_DIR/reviewer-findings.json"
# With findings — JSON array of {path, line, body}:
@'
[
{
"path": "src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs",
"line": 42,
"body": "**[major] Layout Measure-Arrange** — Content measured with unconstrained height but arranged with bounded height. Concrete scenario: ScrollView inside a Grid with Star row height."
}
]
'@ | Set-Content "$OUTPUT_DIR/reviewer-findings.json"Each entry has exactly 3 fields:
path (string) — file relative to repo root, must be a file present in your diffline (integer ≥ 1) — line number on the changed (right) side of the diff. The line MUST appear in your diff — picking an unchanged line is wrong. Use 1 only as a fallback for file-level concerns where no single line captures the issue (e.g., missing import, structural concern).body (string) — format **[severity] Dimension** — description. Severity is one of critical/major/moderate/minor.Validate the JSON parses and capture the count:
try {
$findings = @(Get-Content "$OUTPUT_DIR/reviewer-findings.json" -Raw | ConvertFrom-Json)
$findingsCount = $findings.Count
Write-Host "✅ reviewer-findings.json: $findingsCount findings"
} catch {
Write-Host "❌ reviewer-findings.json is invalid JSON: $_"
throw
}
# Snapshot the diff that was reviewed — Step 7.5 uses this to detect whether the test loop mutated code.
# Use Set-Content -Value with Out-String so the file is created even when the diff is empty
# (a bare `git diff | Set-Content` does NOT create the file when the pipe is empty).
Set-Content -Path "$OUTPUT_DIR/reviewer-findings.diff" -Value (git diff | Out-String) -NoNewlineRemember $findingsCount — you will report it as findings_count in Step 10 and summarize it in analysis.md (Step 8).
Fix critical/major findings BEFORE testing:
[critical] or [major] findings → apply fixes for them in a single batch and rewrite reviewer-findings.json to reflect the new diff.[moderate] and [minor] findings → note in analysis.md (Step 8); do NOT iterate.Threshold guidance. Only record findings with a concrete failing scenario. Stylistic preferences and bikeshedding (see the ## What NOT to Flag table in maui-expert-reviewer.md) are not findings. An empty [] is the correct output for a clean fix — do not invent findings to fill the file.
Why before testing? Self-review catches design flaws (wrong null check, missing platform guard, thread safety issue) before you spend 5-15 minutes on a build+test cycle. It also runs when context is lightest — before test output floods the context window.
🚨 CRITICAL: ALWAYS use the provided test command script - NEVER manually build/compile.
For .NET MAUI repository: Use the test script matching the test type:
| Test Type | Command |
|---|---|
| UITest | pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform <platform> -TestFilter "<filter>" |
| DeviceTest | pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project <project> -Platform <platform> -TestFilter "<filter>" |
| UnitTest | dotnet test <project.csproj> --filter "<filter>" |
# Capture output to test-output.log while also displaying it
# Example for UI tests:
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform <platform> -TestFilter "<filter>" *>&1 | Tee-Object -FilePath "$OUTPUT_DIR/test-output.log"
# Example for device tests:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project <project> -Platform <platform> -TestFilter "<filter>" *>&1 | Tee-Object -FilePath "$OUTPUT_DIR/test-output.log"Testing Loop (Iterate until SUCCESS or exhausted):
Behavioral constraints:
See references/compile-errors.md for error patterns and iteration examples.
🚨 The test loop in Step 7 may modify code (compile-error fixes, runtime-error fixes). When that happens, the reviewer-findings.json written in Step 6 describes a stale diff — not the diff that will be captured in Step 8 and shipped to the reviewer. This step re-runs the self-review against the final diff so the recorded findings always correspond to the actual fix.
Procedure:
Detect drift. Compare the current working-tree diff against the diff Step 6 reviewed.
# Force both sides to a single string. `git diff` assigned to a variable is a string[]
# (one element per line); `-ne` between an array and a scalar is element-wise filtering,
# not equality. Both must be normalized to the same shape before comparison.
#
# Also: `Get-Content -Raw` on a 0-byte file returns $null, not "". The Step 6 snapshot
# creates a 0-byte file when the diff is empty (the documented Blocked-with-no-diff path),
# so coalesce $null to "" via `?? ''` to avoid a false-positive "" -ne $null drift detection.
$currentDiff = (git diff | Out-String)
$reviewedDiff = if (Test-Path "$OUTPUT_DIR/reviewer-findings.diff") {
(Get-Content "$OUTPUT_DIR/reviewer-findings.diff" -Raw) ?? ''
} else { '' }
$diffChanged = ($currentDiff -ne $reviewedDiff)
if (-not $diffChanged) {
Write-Host "✅ Diff unchanged since Step 6 — self-review still current. Skip sub-steps 2 and 3."
} else {
Write-Host "🔁 Code changed during Step 7 — refreshing self-review against final diff..."
}If $diffChanged is $true, re-do the Step 6 self-review against the new diff. This is YOU walking the rules again — it is not something the script does. Repeat the same procedure from Step 6:
git diff --name-only HEAD.github/agents/maui-expert-reviewer.md — every Overarching Principle, the always-active dimensions, and any routed dimensions whose file paths now match.$OUTPUT_DIR/reviewer-findings.json with the new findings (or '[]' if clean). The file MUST be overwritten — appending or leaving the old content is a bug. Use the same JSON schema documented in Step 6.Re-snapshot and re-validate. Only after rewriting the JSON in sub-step 2, run:
# Re-snapshot the diff (matches Step 6's snapshot logic — works for empty diffs too).
Set-Content -Path "$OUTPUT_DIR/reviewer-findings.diff" -Value (git diff | Out-String) -NoNewline
# Re-validate the JSON parses and capture the new count.
try {
$findings = @(Get-Content "$OUTPUT_DIR/reviewer-findings.json" -Raw | ConvertFrom-Json)
$findingsCount = $findings.Count
Write-Host "✅ reviewer-findings.json refreshed: $findingsCount findings"
} catch {
Write-Host "❌ reviewer-findings.json is invalid JSON: $_"
throw
}Why no programmatic "did you actually rewrite the JSON" check? A SHA256 hash sentinel rejects the legitimate byte-identical case (e.g.,
[]→[]after a small compile fix that introduces no new violations), and that case is common. The procedural enforcement is sub-step 2's explicit numbered list above, plus the example-invocation chain that walks the dimensions explicitly. If sub-step 2 is skipped, the JSON validates but ships a stale review — accept that risk in exchange for not blocking valid clean fixes.
Severity handling is the same as Step 6. If the refresh surfaces new [critical] or [major] findings, you may apply ONE more fix batch and re-run the test loop, then re-refresh. Do not loop indefinitely — if a fix introduces critical findings on the third pass, mark the attempt Blocked and explain in analysis.md.
Before reverting, save ALL required files to $OUTPUT_DIR:
# 1. Save result (MUST be exactly "Pass", "Fail", or "Blocked")
"Pass" | Set-Content "$OUTPUT_DIR/result.txt" # or "Fail"
# 2. Save the diff (use Set-Content -Value with Out-String so the file is created
# even when the diff is empty — a bare `git diff | Set-Content` does not create
# the file when the pipe is empty, which would fail the artifact gate.)
Set-Content -Path "$OUTPUT_DIR/fix.diff" -Value (git diff | Out-String) -NoNewline
# 3. Save test output (should already exist from Step 7)
# Copy-Item "path/to/test-output.log" "$OUTPUT_DIR/test-output.log"
# 4. reviewer-findings.json should already exist from Step 6 (and may have been refreshed by Step 7.5)
# 4b. reviewer-findings.diff snapshot (used by Step 7.5 to detect drift)
# 5. Save analysis (include a one-line summary of self-review findings)
@"
## Analysis
**Result:** Pass/Fail/Blocked
**What happened:** [Description of test results]
**Why it worked/failed:** [Root cause analysis]
**Self-review:** [N findings: brief summary of each, or "clean — no findings"]
**Insights:** [What was learned that could help future attempts]
"@ | Set-Content "$OUTPUT_DIR/analysis.md"Verify all required files exist (this is the enforcement gate for Steps 6 and 7 — primarily reviewer-findings.json from Step 6, refreshed by Step 7.5 if needed):
🚨 The artifact check below MUST be wrapped so that Step 9 (Restore) ALWAYS runs even if the check fails. A failed gate that skips restore would leave the worktree dirty and corrupt the next sequential try-fix attempt.
# Run the file-existence check, but DEFER any throw until after Step 9 has restored the worktree.
$missing = @()
@("baseline.log", "approach.md", "result.txt", "fix.diff", "analysis.md", "test-output.log", "reviewer-findings.json", "reviewer-findings.diff") | ForEach-Object {
if (Test-Path "$OUTPUT_DIR/$_") {
Write-Host "✅ $_"
} else {
Write-Host "❌ MISSING: $_"
$missing += $_
}
}
# Record the gate result for use after Step 9 — DO NOT throw here.
if ($missing.Count -gt 0) {
$gateFailureMessage = "Required artifacts missing: $($missing -join ', '). If 'reviewer-findings.json' is missing, Step 6 (Expert Self-Review) was not performed (or Step 7.5 did not refresh it after the test loop) — it is mandatory and must contain at least '[]' that reflects the final diff."
Write-Host "⚠️ ARTIFACT GATE FAILED — proceeding to Step 9 restore before reporting failure."
Write-Host $gateFailureMessage
"Blocked" | Set-Content "$OUTPUT_DIR/result.txt" -Force
} else {
$gateFailureMessage = $null
}If $gateFailureMessage was set: Step 9 still runs (do NOT skip it). After Step 9 restores the target files, surface the failure in Step 10's report — set result.txt to Blocked (already done above) and explain in analysis.md which artifact was missing. The next sequential attempt then starts from the same restored baseline state, including any pre-existing untracked harness inputs.
Analysis quality matters. Bad: "Didn't work". Good: "Fix attempted to reset state in OnPageSelected, but this fires after layout measurement. The cached value was already used."
ALWAYS restore, even if fix failed or Step 8 detected missing artifacts. Skipping restore corrupts the next sequential try-fix attempt.
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -RestoreIf restore continues in the background, wait for its matching shellId with
read_bash until it completes. When Step 2 created .github/.baseline-state.json,
do not report the attempt or end the session until restore confirms
Restored True. If Step 2 already reported Blocked before changing any files
and verified that baseline state was never created because all fix files were
new or no fix files were detected, the expected completion is
No baseline state found with Restored False; accept that result only for
those verified no-state paths and only when no attempt edits were made.
🚨 Use EstablishBrokenBaseline.ps1 -Restore — not git checkout, git restore, or git reset (see Step 2 for why).
After restoration, leave every pre-existing untracked path unchanged. In
particular, an evaluator-loaded try-fix/ directory may remain visible in
git status --short; do not delete it. Judge restoration by Restored True
and by the absence of attempt-created changes to the allowed target files, not
by forcing all untracked harness inputs out of the workspace.
Provide structured output to the invoker:
## Try-Fix Result
**Approach:** [Brief description of what was tried]
**Prior Approach Avoided:** [Name every relevant existing/prior approach, their shared failure mechanism, and why they failed, or N/A]
**Mechanism-Level Difference:** [Explain the full cause-to-effect chain showing why the new mechanism avoided that failure]
**Files Changed:**
- `path/to/file.cs` (+X/-Y lines)
**Result:** ✅ PASS / ❌ FAIL
**Self-Review:** N findings (X critical, Y major, Z moderate/minor) — see `reviewer-findings.json`
**Analysis:**
[Why it worked, or why it failed and what was learned]
**Diff:**
(paste `git diff` output here)
**This Attempt's Status:** Done/NeedsRetry
**Reasoning:** [Why this specific approach succeeded or failed]The two approach-comparison fields must be self-contained prose, not labels or
fragments. When prior attempts share a root cause, explicitly name that shared
failure mechanism. Then connect the new mechanism to the failure with a causal
explanation (for example, “because X now happens after Y, Z is available
directly, so the failing fallback is never consulted”). Do not rely on the
contents of approach.md or analysis.md being visible to the invoker.
Determining Status: Set Done when you've completed testing this approach (whether it passed or failed). Set NeedsRetry only if you hit a transient error (network timeout, flaky test) and want to retry the same approach.
| Situation | Action |
|---|---|
| Problem unclear | Report "insufficient context" - specify what's missing |
| Test command fails to run | Report build/setup error with details |
| Test times out | Report timeout, include partial output |
| Can't determine fix approach | Report "no viable approach identified" with reasoning |
| Git state unrecoverable | Run pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore (see Step 2/9) |
✅ Null/state checks - Guard against unexpected null or state ✅ Lifecycle timing - Move code to correct lifecycle event ✅ Cache invalidation - Reset stale cached values
❌ Massive refactors - Keep changes minimal ❌ Suppressing symptoms - Fix root cause, not symptoms ❌ Multiple unrelated changes - ONE focused fix per invocation
See references/example-invocation.md for a complete example with sample inputs.
© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (references) in .github/skills/try-fix of dotnet/maui.
Open the folder on GitHubat commit 7d38fd0
Try Fix Alternative Approach next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Try Fix Alternative Approach this skilldotnet/maui | 23k | — | ~8.4k | Automated safety check: Pass | MIT | |
| Sokol Netelix22/Sokol.NET | 154 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Maui AI DebuggingRedth/Maui.Gtk | 101 | — | ~4.1k | Automated safety check: Pass | MIT | |
| Pester Failure AnalysisPowerShell/PowerShell | 56k | — | ~5.1k | Automated safety check: Pass | MIT | |
| Debugging and Error Recoveryaddyosmani/agent-skills | 102k | 1 repos | ~2.6k | Automated safety check: Pass | MIT | |
| CanvasBitterbot-AI/bitterbot-desktop | 2.5k | — | ~1.4k | Automated safety check: Pass | MIT |
elix22/Sokol.NET
Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++…
Redth/Maui.Gtk
End-to-end workflow for building, deploying, inspecting, and debugging .NET MAUI and MAUI Blazor Hybrid apps as an AI agent.
PowerShell/PowerShell
Investigates failing Pester tests in PowerShell CI jobs by following a six-step workflow from pull request status to documented fix recommendations.
addyosmani/agent-skills
Applies a stop-the-line rule and a step-by-step triage when tests fail, builds break or something stops working, aiming at the root cause instead of guesses.
Bitterbot-AI/bitterbot-desktop
Display and control HTML content on connected Bitterbot nodes (Mac, iOS, Android) via the canvas host server.
callstackincubator/agent-skills
Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems.
dotnet/maui
Mines local Copilot CLI session logs for dotnet/maui to rank costly or failing runs, tag recurring failure modes, propose repo edits and emit guard evals.
dotnet/maui
Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.
dotnet/maui
Produces evidence-backed ship-readiness verdicts for .NET MAUI Servicing Releases and Previews, and drafts public-safe release handoff pages from the result.
dotnet/maui
Interprets pinned managed benchmark evidence for a dotnet/maui pull request and writes a narrative for the performance review workflow, without running or publishing anything.
dotnet/maui
Checks that a pull request's title and description match its implementation and reviews the code for best practices before merge, without posting anything.
dotnet/maui
Adds MAUI-specific guardrails on top of the maestro-cli skill and Maestro MCP tools for darc, BAR, and channel or feed lookups in dotnet/maui.
Works with
Categories
Attempts one alternative fix for a bug, runs the given test command against it and reports what happened, always differing from existing PR fixes. Each run tries exactly one fix idea. The caller supplies a problem description, a test command, target files and optional hints, and the agent reviews the fixes already in the PR, picks a different approach, implements it, tests it and reports the outcome.
Try Fix Alternative Approach fits situations like: CI or an agent needs an independent alternative to an existing PR fix; testing a different fix approach for a bug against a given test command; comparing several fix attempts by their measured results.
Run `npx skills add dotnet/maui --skill try-fix -a claude-code`. Or copy the skill folder (.github/skills/try-fix in dotnet/maui) into .claude/skills/try-fix in your project. Claude Code loads it when a task matches its description.
Run `npx skills add dotnet/maui --skill try-fix -a codex`. Or copy the skill folder (.github/skills/try-fix in dotnet/maui) into .agents/skills/try-fix in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/maui --skill try-fix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/try-fix, .gemini/skills/try-fix, .github/skills/try-fix and .opencode/skills/try-fix in your project.
Going by SKILL.md and its folder, Try Fix Alternative Approach needs the command-line tools its instructions call (git, pwsh and dotnet). Our summary lists: PowerShell and git; A .NET MAUI build environment; An Android or iOS device or emulator. Compatibility (from SKILL.md): Requires PowerShell, git, .NET MAUI build environment, Android/iOS device or emulator.
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Try Fix Alternative Approach is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 8.4k tokens (SKILL.md is roughly 34k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 850 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Try Fix Alternative Approach: Sokol Net (elix22/Sokol.NET, 154 stars), Maui AI Debugging (Redth/Maui.Gtk, 101 stars), Pester Failure Analysis (PowerShell/PowerShell, 56k stars) and Debugging and Error Recovery (addyosmani/agent-skills, 102k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
dotnet (a GitHub organization, an official publisher) maintains it in dotnet/maui, which has 23,322 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 7, 2026.
Source: dotnet/maui on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.