result-foundation
Add or extend MoreSpeakers Domain Result types with explicit factory methods and structured errors.
Best use case
result-foundation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Add or extend MoreSpeakers Domain Result types with explicit factory methods and structured errors.
Teams using result-foundation should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/result-foundation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How result-foundation Compares
| Feature / Agent | result-foundation | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Add or extend MoreSpeakers Domain Result types with explicit factory methods and structured errors.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## Context
Use this skill when implementing or extending the approved Result-based exception handling migration in the Domain layer. It applies when expected failures need to flow through Data, Managers, and Web without losing structured context.
## Patterns
- Keep `Error`, `Result`, and `Result<T>` in `src\MoreSpeakers.Domain\Models\`, but expose them from the root `MoreSpeakers.Domain` namespace.
- Model creation after `IdentityResult`: factory methods live on non-generic `Result` instead of exposing public constructors.
- Use `readonly struct` for `Result` and `Result<T>` to stay additive and allocation-conscious on the hot path.
- Keep failure access explicit: success results throw if callers read `Error`, and failure results throw if callers read `Value`.
- Cover the public API surface in `src\MoreSpeakers.Domain.Tests\ResultTests.cs`, including success, failure, implicit conversion, and equality.
- When converting an existing vertical slice, let the slice interface own explicit `Result` signatures instead of inheriting generic `IDataStore` contracts that force sentinel returns.
- In DataStores, catch only expected persistence exceptions such as `DbUpdateException`; return typed `Error` codes for not-found/no-op outcomes and let unexpected exceptions propagate.
- In Managers, forward DataStore `Result` values unchanged unless adding boundary validation or input normalization that belongs above persistence.
## Examples
- `var ok = Result.Success();`
- `var saved = Result.Success(user);`
- `var failed = Result.Failure<User>(new Error("users.save.failed", "Unable to save the user.", ex));`
- `Result<Guid> id = Guid.NewGuid();`
## Anti-Patterns
- Do not expose public constructors for `Result` or `Result<T>`.
- Do not use sentinel values (`null`, `false`, empty collections) for expected failures once a Result-based path exists.
- Do not strip exception context when an `Error` can carry the underlying exception reference.Related Skills
result-web-feedback
Apply Result<T>-based feedback patterns in Razor Pages and HTMX flows.
{skill-name}
{what this skill teaches agents}
xunit-v3-discovery
Fix xUnit v3 test projects that compile but show zero discovered tests under dotnet test.
reflection-contract-tests
Use reflection-based tests to lock an API contract before the implementation lands.
windows-compatibility
Cross-platform path handling and command patterns
test-discipline
Update tests when changing APIs — no exceptions
squad-conventions
Core conventions and patterns used in the Squad codebase
session-recovery
Find and resume interrupted Copilot CLI sessions using session_store queries
secret-handling
Never read .env files or write secrets to .squad/ committed files
release-process
Step-by-step release checklist for Squad — prevents v0.8.22-style disasters
project-conventions
Core conventions and patterns for this codebase
Personal Squad — Skill Document
## What is a Personal Squad?