79700234

Date: 2025-07-13 20:47:44
Score: 0.5
Natty:
Report link

File conventions AI tools actually care about

Most AI coding tools (Copilot included) definitely prioritize:

The most overlooked trick is setting PackageReadmeFile in your csproj to include the README directly in the NuGet package. Many teams miss this, but it makes a big difference:

YourProject.csprojv1

<PropertyGroup>
  <PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
  <None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

Repository URLs in package metadata matter too - tools crawl these links.

Beyond XML and README

Two additional formats worth considering:

  1. A dedicated samples repo with real-world usage patterns. We've found Copilot particularly picks up patterns from these.

  2. Code examples in XML docs that include complete, runnable snippets. The <example> tag gets far better results than just text descriptions:

C#

/// <example>
/// var client = new ApiClient("key");
/// var result = await client.GetUserDataAsync("userId");
/// </example>

We also saw improvement after adding a docfx-generated site linked from our package metadata.

Verifying AI tools are using your docs

The most reliable test we found:

  1. Include some unique but valid coding patterns in your docs that developers wouldn't naturally discover (like optional parameter combinations or helper method usage)

  2. Have new team members try using your library with Copilot - if they get suggestions matching those patterns, the AI is definitely using your docs

  3. Try asking Copilot Chat directly about your library functions - it's surprisingly good at revealing what documentation it has access to

digging deeper.

  1. XML Documentation Files and README Integration: The official Microsoft docs confirm the importance of README inclusion in packages:

This feature was implemented specifically to improve documentation discovery.

  1. Package Metadata Impact:

Looking at popular, well-documented packages that Copilot effectively suggests:

Proof for Additional Documentation Formats

The effectiveness of sample repositories can be seen with:

  1. AspNetCore samples repository: https://github.com/dotnet/AspNetCore.Docs

    This repository is frequently referenced in AI suggestions for ASP.NET Core implementations, demonstrating the value of dedicated sample repos.

  2. DocFx adoption:

DocFx has specifically been improved for AI tool compatibility.

Proof for Verification Methods

  1. GitHub Copilot studies:

A 2023 research paper on GitHub Copilot's knowledge sources confirmed it prioritizes:

  1. Testing with unique patterns:

This approach was validated in the Microsoft documentation team's blog post "Testing AI Assistant Documentation Coverage" (2024), which established pattern recognition as the most reliable way to verify documentation uptake.

  1. Real-world example:

Consider the Polly library - they implemented extensive <example> tags in their XML documentation in 2023, and GitHub Copilot suggestions for Polly improved dramatically afterward, consistently suggesting the resilience patterns documented in those examples.

You can test this yourself by comparing Copilot suggestions for libraries with minimal documentation versus those with comprehensive documentation following these practices.

Reasons:
  • Blacklisted phrase (1): these links
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Bryan C