Skip to content

[copilot] Refine agent guidance from session review - #13778

Draft
simonrozsival wants to merge 5 commits into
mainfrom
dev/simonrozsival/agent-instructions-2026-11-25
Draft

simonrozsival wants to merge 5 commits into
mainfrom
dev/simonrozsival/agent-instructions-2026-11-25

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Context: #13521
Context: #13728

An expanded review of all stored conversation turns in 1,558 remaining local dotnet/android candidate sessions found recurring test-scope churn, overbuilt solutions, and build/environment validation pitfalls. The review used 50 subagents; 1,486 sessions had stored turns and 72 had none. The candidate filter can include non-coding conversations, and stored turns are not full raw tool transcripts.

Test and review guidance

Test additions repeatedly needed scope reductions when they duplicated existing coverage, asserted implementation shape, or used brittle GC-timing assumptions. The guidance now emphasizes unique behavioral or regression protection while preserving meaningful characterization tests. The code-review skill no longer requires a comment on clean PRs or a full-file read when relevant context is sufficient.

Build and runtime experiments

The review confirmed shared SDK/JDK path hazards and missing submodule prerequisites; local-build guidance now checks resolved paths (submodule setup is in #13780), and the tests skill now lists the SourceLink workaround next to standalone dotnet test, where agents in fresh worktrees hit it. Historical make all failures predate the existing make leeroy guidance. In one requested runtime experiment, successful builds and dotnet test --no-build exercised baseline rather than candidate artifacts, so the device skill now advises verifying manually replaced APK/native-library candidates.

Correctness and shortening

Several review rules contained inaccurate MSBuild, TFM, test-fixture, JNI, GC, and Android stack claims; these were corrected. The always-loaded instructions now enable NRT for new code without converting existing code unless asked. Duplicated commands, examples, and unconditional rules were removed or shortened.

Net change: −139 lines (+57/−196); copilot-instructions.md shrinks from 287 to 150 lines.

Validation: git diff --check passed. Builds and tests were not run because this change only updates documentation and agent instructions.

@simonrozsival simonrozsival changed the title [docs] Discourage low-value tests and trim agent instructions [docs] Refine agent guidance from session review Nov 25, 2026
simonrozsival and others added 2 commits November 25, 2026 20:17
Recurring findings from the agent session review: invalid performance
comparisons (~13 findings), flaky-test fixes that erased the test's oracle
or miscounted retries (~12), and removals that missed generated, packaging
or CI consumers (~10).

Co-authored-by: Copilot App <[email protected]>
Keep the agent-instruction changes in this PR and submit each on-demand skill separately for focused review.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival simonrozsival changed the title [docs] Refine agent guidance from session review [copilot] Refine agent guidance from session review Nov 25, 2026
Move the SourceLink workaround next to the standalone dotnet test commands
and leave api-docs submodule guidance to #13780.

Co-authored-by: Copilot App <[email protected]>
simonrozsival added a commit that referenced this pull request Nov 25, 2026
…13780)

Context: #13778

`external/android-api-docs` is the repo's only submodule, and new git worktrees don't initialize it. Neither `make prepare` nor any agent instruction mentions it. Builds in such worktrees run for several minutes and then fail during packaging:

```
sharedfx.targets(413,5): error MSB4018: System.IO.FileNotFoundException: .../bin/Release/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/37/Mono.Android.xml
```

`_ExportMsxDoc` reads `external/android-api-docs/docs/xml` (`src/Mono.Android/Mono.Android.targets`), so `Mono.Android.xml` is never produced.

A review of local agent sessions found this pattern repeatedly:

  * 30 sessions ran `git submodule update --init external/android-api-docs` by hand, and 37 hit the error above.
  * Each occurrence cost about 10 minutes: a failed `make leeroy`, a search through a ~20k-line log, and a rebuild.
  * Some orchestration prompts had started carrying "`git submodule update --init --recursive` if needed" as a workaround.

This adds one bullet to the `local-build` skill: in a new worktree, run `git submodule update --init` before building. The bullet includes the error text, so an agent that has already hit the failure can recognize it. The always-loaded instructions are unchanged.

Making `make prepare` initialize the submodule would remove the step entirely, but it is a build-system change and is not part of this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant