Skip to content

Comments

Add AI-focused usage documentation for package consumers#22

Merged
leeoades merged 4 commits intomainfrom
copilot/add-usage-instructions-for-library
Feb 19, 2026
Merged

Add AI-focused usage documentation for package consumers#22
leeoades merged 4 commits intomainfrom
copilot/add-usage-instructions-for-library

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Add AI-Focused Usage Instructions for FunctionalStateMachine Package

Objective

Create documentation that helps AI coding assistants understand how to effectively use and integrate the FunctionalStateMachine package in external projects.

✅ Completed Implementation

New Documentation Files

  • .copilot-instructions.md (568 lines, 16KB) - Comprehensive guide at repository root
  • AI-USAGE-GUIDE.md (258 lines, 7.1KB) - Quick reference included in NuGet packages
  • docs/AI-Documentation-Maintenance.md (252 lines, 8KB) - Contributor guide

Updated Files

  • README.md - Added "Using with AI Coding Assistants" section
  • Directory.Build.props - Configured to include AI-USAGE-GUIDE.md in packages
  • docs/index.md - Added links to AI guides
  • CONTRIBUTING.md - Added AI docs update guidance

Recent Changes

  • Clarified that sealed keyword is optional, not required
    • Updated documentation to reflect actual usage in samples
    • Both record and sealed record work correctly
    • Added explanatory notes about when to use sealed (prevents further inheritance)

✅ Validation Complete

  • Solution builds successfully
  • All tests pass
  • Documentation aligned with actual code patterns in samples
  • No security issues

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 19, 2026 03:32
Co-authored-by: leeoades <2321091+leeoades@users.noreply.github.com>
Co-authored-by: leeoades <2321091+leeoades@users.noreply.github.com>
Copilot AI changed the title [WIP] Add usage instructions for FunctionalStateMachine package Add AI-focused usage documentation for package consumers Feb 19, 2026
Copilot AI requested a review from leeoades February 19, 2026 03:39
@leeoades leeoades marked this pull request as ready for review February 19, 2026 03:49
// 2. Define triggers (abstract record with sealed subtypes)
public abstract record OrderTrigger
{
public sealed record AddItem(string ProductId, int Quantity) : OrderTrigger;
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot - Do these really have to be sealed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, they don't have to be sealed. Both patterns work:

  • public record MyTrigger : BaseTrigger
  • public sealed record MyTrigger : BaseTrigger

The actual samples in the repository (VendingMachine, StockPurchaser) use non-sealed records. Using sealed is a best practice to prevent further inheritance, but it's not a requirement.

Updated the documentation to clarify this and remove the sealed keyword from examples to match the patterns used in the samples. (commit faa6fb0)

}

// 3. Define state data (sealed record)
public sealed record OrderData(
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot - does this have to be sealed? I don't think so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it doesn't have to be sealed. Already updated in commit faa6fb0 - the sealed keyword has been removed from OrderData and all other examples to match the patterns used in the actual repository samples.

// 4. Define commands (abstract record with sealed subtypes)
public abstract record OrderCommand
{
public sealed record AddToCart(string ProductId) : OrderCommand;
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot - do these have to be sealed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, they don't have to be sealed. Already updated in commit faa6fb0 - removed sealed from all command subtypes to align with the patterns used in repository samples. Both record and sealed record work correctly.

…ypes

Co-authored-by: leeoades <2321091+leeoades@users.noreply.github.com>
@leeoades leeoades merged commit d91ef6c into main Feb 19, 2026
1 check passed
@leeoades leeoades deleted the copilot/add-usage-instructions-for-library branch February 19, 2026 09:03
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.

2 participants