Claude-skill-registry-data metalama-2026.0
Complete Metalama documentation for aspect-oriented programming in C#. Use when writing aspects, templates, fabrics, or meta-programming code with Metalama.
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/metalama-20260" ~/.claude/skills/majiayu000-claude-skill-registry-data-metalama-2026-0 && rm -rf "$T"
data/metalama-20260/SKILL.mdMetalama Documentation Skill
This skill contains the complete Metalama documentation including conceptual guides, API reference, and sample code.
This skill pertains to Metalama 2026.0.
Directory Structure
| Directory | Contents |
|---|---|
| Conceptual documentation (aspects, templates, fabrics, validation, etc.) |
| Pattern libraries (contracts, caching, observability, memoization, DI) |
| API documentation overview pages |
| Sample code ( = source, = transformed output, = aspect implementation) |
| API reference YML files from DocFx |
Finding Information
- Search the index: Use grep with
to search index.yml for keywords (each entry has: name, path, summary, keywords - so-B3
captures the path):-B3grep -i -B3 "caching" index.yml grep -i -B3 "BuildAspect" index.yml - Browse by topic: Navigate the
directory structure.content/ - API lookup: Use grep on
to find API YML files by type or member name:api/.manifestgrep -i "OverrideMethodAspect" api/.manifest
Key Entry Points
| Topic | File | Description |
|---|---|---|
| Getting Started | | How to use Metalama in your projects |
| Creating Aspects | | Overview of aspect creation |
| Overriding Methods | | Basic method interception |
| Templates | | T# template syntax and patterns |
| Fabrics | | Bulk aspect application |
| Contracts | | Parameter/property validation |
| Caching | | Method result caching |
| Observability | | INotifyPropertyChanged implementation |
| Debugging Aspects | | Debug compile-time code, breakpoints, |
| Debugging User Code | | Debug run-time transformed code, LamaDebug configuration |
Common Patterns
Base Classes
| Base Class | Target | Key Override | Use When |
|---|---|---|---|
| Methods | | Wrap/intercept methods |
| Fields/Properties | | Wrap property access |
| Parameters/Fields/Properties | | Validate values |
| Types | | Introduce members, implement interfaces |
| Methods | | Programmatic method transformation |
| Single type | | Bulk changes to one type |
| Project | | Apply aspects across project |
Template Fundamentals
[!IMPORTANT] T# templates look like C# but have different semantics. Code that works in normal C# may not work identically in a template. Always read the full template documentation at
before writing template code.content/conceptual/aspects/templates/
public override dynamic? OverrideMethod() { // Pre-logic try { return meta.Proceed(); // Calls original method } finally { // Post-logic (always runs) } }
handles any return type (void returns null)dynamic?
auto-transforms tometa.Proceed()
for async targetsawait- Use
to access compile-time information about the target declarationmeta.Target.* - To debug templates, use
(notmeta.DebugBreak()
)Debugger.Break()
Debugging Quick Reference
Debugging compile-time code (aspects, fabrics, templates):
- Add
inDebugger.Break()
/fabrics, orBuildAspect
in templatesmeta.DebugBreak() - Build with:
dotnet build -p:MetalamaDebugCompiler=True -p:MetalamaConcurrentBuildEnabled=False - Attach debugger when prompted, then set breakpoints in transformed code (
)obj/.../metalama/
Debugging run-time code (transformed output):
- Create a
build configuration in Visual StudioLamaDebug - Use
to step into code, or addF11Debugger.Break() - Set breakpoints in transformed files under
obj/<Config>/<TFM>/metalama/
Common Pitfalls
| Mistake | Correct Approach |
|---|---|
Using in templates | Use in templates; only works in and fabrics |
| Setting breakpoints in source files | Breakpoints don't work in Metalama-transformed projects; use / then set breakpoints in transformed code |
Using for introduced members | Use string literals; resolves at aspect compile-time, not target compile-time |
| Filtering all types by namespace in fabrics | Use or a instead of |
Forgetting on target classes | Classes receiving introduced members need the modifier |
Sample Code Conventions
- Target code receiving the aspectName.cs
- Aspect implementationName.Aspect.cs
- Transformed output (what the compiler generates)Name.t.cs
- Referenced project code for multi-project examplesName.Dependency.cs
Metalama Markdown Directives
The documentation uses custom
[!metalama-*] directives to include code samples. These are processed at build time to generate HTML, but in the skill files you see the raw directives.
Reading Directive References
When you see a directive in a Markdown file, extract the file path and read the referenced file directly.
| Directive | Purpose | Example |
|---|---|---|
| Shows a single source file | |
| Shows test with input/output | |
| Shows side-by-side diff | |
| Embeds Vimeo video | |
Path Resolution
resolves to the SKILLS.md directory~/- Example:
→ Read~/code/Metalama.Documentation.SampleCode.AspectFramework/GettingStarted/GettingStarted.cscode/Metalama.Documentation.SampleCode.AspectFramework/GettingStarted/GettingStarted.cs
How to Read Referenced Code
When you encounter a directive like
[!metalama-file ~/code/Project/File.cs]:
- Read the main file:
code/Project/File.cs - Check for related files (same name, different suffix):
- Aspect implementationFile.Aspect.cs
- Transformed outputFile.t.cs
- Fabric codeFile.Fabric.cs
Markers: If you see
marker="NAME", look for code between // [<snippet NAME>] and // [<endsnippet NAME>] in the file.
API Reference
The
api/ directory contains DocFx-generated YML files for all public APIs.
Finding API Documentation
Use
- a JSON index mapping all UIDs (types, members, overloads) to their YML files.api/.manifest
-
Search the manifest for the type or member name:
"Metalama.Framework.Aspects.OverrideMethodAspect": "Metalama.Framework.Aspects.OverrideMethodAspect.yml" "Metalama.Framework.Aspects.OverrideMethodAspect.OverrideMethod": "Metalama.Framework.Aspects.OverrideMethodAspect.yml" "Metalama.Framework.Code.IMethod": "Metalama.Framework.Code.IMethod.yml" -
Read the corresponding YML file to get full documentation.
-
Naming conventions:
- Types:
Namespace.TypeName.yml - Generic types: backtick becomes dash, e.g.,
→IAspectBuilder<T>Metalama.Framework.Aspects.IAspectBuilder-1.yml - All members of a type are in the same YML file as the type
- Types:
YML File Structure
Each type's YML file contains all members of that type in a single file:
items: - uid: Namespace.TypeName # Type definition commentId: T:Namespace.TypeName type: Class|Interface|Enum|... summary: Type description remarks: Detailed explanation syntax: content: public class TypeName : BaseClass children: # List of member UIDs - Namespace.TypeName.Method1 - Namespace.TypeName.Property1 - uid: Namespace.TypeName.Method1 # Member definition commentId: M:Namespace.TypeName.Method1 type: Method|Property|Field|... summary: Member description syntax: content: public void Method1() parameters: [...] # For methods return: { type: ..., description: ... }
Key Namespaces
| Namespace | Purpose |
|---|---|
| Aspect base classes, attributes, API |
| Code model interfaces (, , , etc.) |
| Advice APIs for introducing members, implementing interfaces |
| Eligibility builders for aspect targeting |
| Reporting warnings and errors |
| Fabric base classes |
| Contract validation aspects |
| Caching aspects and configuration |
| INotifyPropertyChanged implementation |
| Dependency injection |
| Architecture enforcement/validation |
Linking to Documentation
When referencing documentation articles, provide links to the live documentation at
https://doc.metalama.net.
URL format:
https://doc.metalama.net/<path> where <path> is derived from the file path under content/:
- Remove
prefixcontent/ - Remove
suffix.md - For index files where the filename matches the parent folder (e.g.,
), use justpath/leaf/leaf.mdpath/leaf
Examples:
| File Path | URL |
|---|---|
| |
| |
| |
| |
External Resources
- Live documentation: https://doc.metalama.net
- Source repository: https://github.com/metalama/Metalama
- Samples repository: https://github.com/metalama/Metalama.Samples