Install
$ agentstack add skill-danaidev-agent-skills-facets-dotnet-mapping ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Facets .NET Mapping
Overview
Use this skill to add Facet to .NET solutions, define facets and projections, and migrate existing mapping code to generated facets.
Workflow Decision Tree
Use the path that matches the task:
- Integrate Facet in a project with no mapper: follow "Integration Quick Start."
- Migrate from AutoMapper/Mapster/Mapperly or manual mapping: follow "Migration Workflow."
- Add EF Core projections or advanced mapping: follow "EF Core Workflow" and "Advanced Mapping."
Before implementation, read references/overview.md, references/usage.md, and references/examples.md to align on Facet concepts, APIs, and patterns.
Integration Quick Start (No Existing Mapper)
- Add the Facet packages you need (core plus optional Extensions/EF Core packages).
- Define facets with
[Facet]attributes for each DTO shape. - Replace manual DTO creation with generated facets and extension methods (
ToFacet,SelectFacet,SelectFacets). - Build the solution to trigger source generation and address compile-time errors.
Use references/overview.md for package choices and references/usage.md for attribute patterns.
Migration Workflow (AutoMapper/Mapster/Mapperly -> Facet)
- Inventory existing mapping profiles, DTOs, and custom converters.
- Create facets that match each DTO shape (use include/exclude and nested facets).
- Replace mapping calls with Facet projections (
ToFacet,SelectFacet,SelectFacets,ToFacetsAsync). - Implement custom mapping via Facet configuration interfaces where you used custom resolvers.
- Remove old mapping registration and libraries after tests pass.
Use references/migration.md for a checklist and common pitfalls.
EF Core Workflow
- Add EF Core packages for Facet (
Facet.Extensions.EFCoreand optional mapping add-ons). - Use
SelectFacetin queries for server-side projection. - Use async helpers (
ToFacetsAsync) for query execution. - Lean on Facet's generated projections to avoid manual includes unless necessary.
Read references/efcore.md for EF Core specifics and limitations.
Advanced Mapping
- Add mapping packages if you need custom logic or expression transforms.
- Implement Facet mapping configuration interfaces for sync/async custom mapping.
- Use attribute-based configuration (e.g., property rename/conditional mapping) where applicable.
- Apply safeguards for circular references (depth limits and reference preservation).
Use references/usage.md for attribute hints and references/overview.md for feature inventory.
Validation Checklist
- Build and ensure generated facets compile cleanly.
- Replace mapping tests with projection-focused tests.
- Verify EF Core queries translate as expected in SQL.
- Remove legacy mapper configs after verifying runtime behavior.
Resources
references/overview.mdfor packages, features, and terminology.references/usage.mdfor attribute patterns and mapping APIs.references/efcore.mdfor EF Core integration details.references/migration.mdfor migration steps and checks.references/sources.mdfor primary documentation links.references/examples.mdfor a catalog of examples and when to apply them.assets/snippets/FacetBasics.csfor a basic include/exclude and projection starter.assets/snippets/FacetNestedCollections.csfor nested facets and collections.assets/snippets/FacetEfCoreProjection.csfor query projection patterns.assets/snippets/FacetUpdateChanges.csfor update/patch with change tracking.assets/snippets/FacetCustomMapperAsync.csfor custom async mapping with DI.assets/snippets/FacetCircularRefs.csfor MaxDepth + PreserveReferences.assets/snippets/FacetGenerateDtos.csfor auto CRUD DTO generation.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: DanAIDev
- Source: DanAIDev/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.