MentorSkillAttribute class
Decorates a class to register it as a MentorAgent Skill. A skill class plays a dual role:
On this page
- Knowledge — the class (or its linked
SKILL.md) provides domain instructions: policies, rules, workflows. These are shown to the AI as a catalogue entry and loaded on demand viaload_skill(progressive disclosure). - Tools — any
[Description]or[MentorAction]methods on the class are automatically registered as L1 tools on the Main Coordinator. The skill provides the HOW (policy + context); the methods provide the DO (execution).
⚠️ When the class has methods, register it in DI so MentorAgent can resolve instances:
builder.Services.AddScoped<ExpenseReportSkill>();Usage:
// Dual-role skill — knowledge + executable tools
[MentorSkill(
Name = "expense-report",
Description = "Handles expense report filing, validation, and policy checks",
InstructionsFile = "Skills/expense-report/SKILL.md")]
public class ExpenseReportSkill
{
private readonly ExpenseRepository _repo;
public ExpenseReportSkill(ExpenseRepository repo) => _repo = repo;
[Description("Submits a new expense report for the current user")]
public async Task<string> SubmitExpenseReportAsync(
string category, decimal amount, string notes) { ... }
[Description("Returns the reimbursement policy for a given expense category")]
public string GetPolicyForCategory(string category) { ... }
}
// Knowledge-only skill — no methods, just instructions / policy text
[MentorSkill(
Name = "refund-policy",
Description = "Return and refund rules for the online store",
Instructions = "## Refund Policy\n- Items can be returned within 30 days...")]
public class RefundPolicySkill { }
// Auto-discovery — MentorAgent looks for Skills/{Name}/SKILL.md automatically
[MentorSkill(Name = "shipping-policy", Description = "Shipping and delivery policy")]
public class ShippingPolicySkill { }Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Attributes. Package: Novior.MentorAgent.
public sealed class MentorSkillAttribute : Attribute
dotnet add package Novior.MentorAgentConstructors
Section titled “Constructors”public MentorSkillAttribute()
Properties
Section titled “Properties”Description
Section titled “Description”public required string Description { get; init; }
One-sentence description shown to the AI in the skill catalogue. Keep it concise — this is the only text visible before the skill is loaded.
Instructions
Section titled “Instructions”public string? Instructions { get; init; }
Inline skill instructions (markdown). Takes precedence over MentorSkillAttribute.InstructionsFile. Ideal for short skills; use file-based for rich, longer content.
InstructionsFile
Section titled “InstructionsFile”public string? InstructionsFile { get; init; }
Path to the skill instructions markdown file. Can be absolute or relative to the application's content root. If null, MentorAgent looks for Skills/{Name}/SKILL.md automatically.
public required string Name { get; init; }
Unique skill name in kebab-case (e.g. "expense-report", "shipping-policy"). Used as the key for the load_skill tool call.
