Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Description

The coding agent was skipping baseline setup steps before building/running tests, causing "missing testhost" and "shared framework" errors. Restructured instructions to make baseline build impossible to miss.

Key changes:

  • Moved baseline build to first section after title with ⚠️ MANDATORY heading
  • Added explicit cause-effect: skipping causes testhost/shared framework errors
  • Replaced verbose bullet lists with quick-scan tables for component ID and build commands
  • Added gate condition: "Only proceed after baseline build succeeds"
  • Reduced document from ~325 to ~185 lines (~43% reduction)
  • Removed table of contents and verbose iterative strategy section (standard behavior, not actionable)
  • Consolidated troubleshooting and references into compact table format

Restored guidance per feedback:

  • WASM/WASI library detection logic (condensed)
  • "Checkout main branch" instruction before baseline build
  • Instruction to switch back to working branch after baseline build
  • Success criteria (exit code 0, zero test failures)
  • Library test project structure guidance with discovery command
  • "Target does not exist" troubleshooting entry
  • Log collection guidance for failure reporting

Added new components per feedback:

  • Added entries for src/tools, src/native/managed, src/tasks, src/tests to component identification table
  • Added baseline build commands for Tools, Build Tasks, and Runtime Tests
  • Added workflow sections for Tools, Build Tasks, and Runtime Tests with build/test commands

Customer Impact

N/A - Internal tooling instructions only.

Regression

No.

Testing

Documentation-only change. Verified no trailing whitespace per markdown guidelines.

Risk

Low. No code changes. Core guidance retained; only organization and emphasis changed.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Original prompt

Our instructions aren't working as well as we'd like. In particular, the coding agent isn't doing the baseline setup steps before it tries building/running tests. Please make whatever changes are needed to make these instructions more effectove. That could include anything from minor tweaks to an overhaul. Please retain the core instructions and guidance; focus on organization, brevity, relevance to copilot, etc


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update instructions for baseline setup improvements Restructure copilot-instructions.md to emphasize mandatory baseline build Jan 10, 2026
Copilot AI requested a review from stephentoub January 10, 2026 15:06
@stephentoub stephentoub marked this pull request as ready for review January 10, 2026 15:34
Copilot AI review requested due to automatic review settings January 10, 2026 15:34
@stephentoub
Copy link
Member

/ba-g markdown only

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the copilot-instructions.md document to address issues where the coding agent was skipping baseline setup steps, causing "missing testhost" and "shared framework" errors. The restructure moves the baseline build instructions to a prominent first section with mandatory warning emphasis and consolidates the document from ~325 to ~150 lines.

Changes:

  • Moved baseline build to first section with "⚠️ MANDATORY" heading and explicit warnings about consequences of skipping
  • Replaced verbose bullet lists with scannable tables for component identification and build commands
  • Removed table of contents and consolidated iterative strategy, troubleshooting, and reference sections into compact formats
Comments suppressed due to low confidence (2)

.github/copilot-instructions.md:73

  • The instruction to switch back to the working branch after the baseline build is missing. After completing the baseline build on main (Step 2) and configuring the environment (Step 3), the agent needs to switch back to the working branch before applying changes. Without this step, the agent would apply changes to the main branch instead of the working branch. Add an instruction at the end of Step 3, e.g., "Then switch back to your working branch before making changes."
**Only proceed with changes after the baseline build succeeds.** If it fails, report the failure and stop.

.github/copilot-instructions.md:79

  • The iterative build and test strategy guidance has been removed, including important details about retry attempts (up to 5 attempts for build failures, test build failures, and test failures), how to handle different types of test failures, and when to escalate. This guidance helps the agent know when to retry vs when to report failure. While this might reduce verbosity, it may lead to the agent giving up too early or retrying indefinitely without clear boundaries. Consider adding a brief note about retry strategy, such as: "If builds or tests fail, attempt to fix and retry up to 5 times with different approaches before reporting failure."
After completing the baseline build above, use the appropriate workflow for your changes.

@stephentoub
Copy link
Member

@copilot address the feedback please

Copy link
Contributor Author

Copilot AI commented Jan 10, 2026

@copilot address the feedback please

Addressed all feedback in 98963cc:

  • Restored WASM/WASI library detection logic in condensed form
  • Added "checkout main branch" instruction before baseline build
  • Added instruction to switch back to working branch after baseline build
  • Added success criteria (exit code 0, zero test failures) to workflows section
  • Added library test project structure guidance with discovery command
  • Added "Target does not exist" troubleshooting entry
  • Added log collection guidance for failure reporting

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please address the feedback in this review.

Copy link
Contributor Author

Copilot AI commented Jan 10, 2026

@copilot please address the feedback in this review.

Added all requested entries in 4754fd9:

  • Component table entries for src/tools, src/native/managed, src/tasks, src/tests
  • Baseline build commands for Tools, Build Tasks, and Runtime Tests
  • Workflow sections for Tools, Build Tasks, and Runtime Tests with build/test commands

@stephentoub stephentoub force-pushed the copilot/improve-instruction-guidelines branch from 4754fd9 to c965e5b Compare January 10, 2026 21:29
@stephentoub
Copy link
Member

/ba-g markdown only

@steveisok steveisok merged commit 840ecd9 into main Jan 10, 2026
15 of 16 checks passed
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.

5 participants