# AgentSkillDefinition

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.agentskilldefinition/
> Summary: AgentSkillDefinition: A markdown-based skill definition that can be loaded into an agent at run time.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

A markdown-based skill definition that can be loaded into an agent at run time.

```csharp
public sealed record AgentSkillDefinition : IEquatable<AgentSkillDefinition>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.agentskilldefinition/">AgentSkillDefinition</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;AgentSkillDefinition&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

A skill carries instructions, resources, and [AgentSkillDefinition.Scripts](/api/tracon.agentskilldefinition/#Tracon_AgentSkillDefinition_Scripts). Script
execution is a separate security boundary: unless
`TraconSkillScriptOptions.AllowStoredScripts` is enabled, stored
scripts are only kept in storage and never executed.

## Constructors

### <a id="Tracon_AgentSkillDefinition__ctor"></a> AgentSkillDefinition\(\)

```csharp
public AgentSkillDefinition()
```

## Properties

### <a id="Tracon_AgentSkillDefinition_AllowedTools"></a> AllowedTools

The allowed-tools declaration in the MAF frontmatter.

```csharp
public string? AllowedTools { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AgentSkillDefinition_Compatibility"></a> Compatibility

The skill's compatibility statement.

```csharp
public string? Compatibility { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AgentSkillDefinition_CreatedAt"></a> CreatedAt

The skill's creation time.

```csharp
public DateTimeOffset CreatedAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

### <a id="Tracon_AgentSkillDefinition_Description"></a> Description

The skill's short description.

```csharp
public required string Description { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_AgentSkillDefinition_Enabled"></a> Enabled

Whether the skill is included in compilation.

```csharp
public bool Enabled { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentSkillDefinition_Id"></a> Id

The skill's unique identifier.

```csharp
public Guid Id { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_AgentSkillDefinition_Instructions"></a> Instructions

The markdown instructions given to the model.

```csharp
public required string Instructions { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_AgentSkillDefinition_License"></a> License

The skill license.

```csharp
public string? License { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AgentSkillDefinition_Metadata"></a> Metadata

Application-specific free-form metadata.

```csharp
public IReadOnlyDictionary<string, JsonElement> Metadata { get; init; }
```

#### Property Value

 [IReadOnlyDictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlydictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [JsonElement](https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement)\>

### <a id="Tracon_AgentSkillDefinition_Name"></a> Name

The skill name. Agent definitions bind to the skill with this name.

```csharp
public required string Name { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_AgentSkillDefinition_Origin"></a> Origin

Where the definition comes from: [AgentDefinitionOrigin.Code](/api/tracon.agentdefinitionorigin/)
for a skill registered with `AddSkill`, [AgentDefinitionOrigin.Database](/api/tracon.agentdefinitionorigin/)
for a stored one.

```csharp
public AgentDefinitionOrigin Origin { get; init; }
```

#### Property Value

 [AgentDefinitionOrigin](/api/tracon.agentdefinitionorigin/)

#### Remarks

A code skill wins over a stored skill with the same name: it is the one the
runtime loads and the one whose scripts run. `GET /api/skills/{name}`
resolves the name the same way and reports which one it returned.

### <a id="Tracon_AgentSkillDefinition_Resources"></a> Resources

The skill's resources.

```csharp
public IReadOnlyList<AgentSkillResourceDefinition> Resources { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[AgentSkillResourceDefinition](/api/tracon.agentskillresourcedefinition/)\>

### <a id="Tracon_AgentSkillDefinition_ScriptSetHash"></a> ScriptSetHash

The fingerprint of the whole script set: every script's name and content
hash. Computed, never stored; a value sent in a request is ignored.

```csharp
public string ScriptSetHash { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Remarks

A grant without a script name ([SkillScriptGrant.ScriptName](/api/tracon.skillscriptgrant/#Tracon_SkillScriptGrant_ScriptName) is
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)) pins this value. Adding, removing, renaming, or
changing any script changes it, and the grant stops authorizing every script
of the skill until it is granted again. A skill without scripts has a
fingerprint too, so its first script changes it. 64 upper-case hexadecimal
characters (SHA-256).

### <a id="Tracon_AgentSkillDefinition_Scripts"></a> Scripts

The skill's scripts, stored in the database or registered in code.

```csharp
public IReadOnlyList<AgentSkillScriptDefinition> Scripts { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[AgentSkillScriptDefinition](/api/tracon.agentskillscriptdefinition/)\>

#### Remarks

These scripts run on the server. They are visible to the model only
when `TraconSkillScriptOptions.AllowStoredScripts` is on;
while off, the record is stored but cannot be executed. Each one runs only
under a grant pinned to its content.

### <a id="Tracon_AgentSkillDefinition_TenantId"></a> TenantId

The tenant the skill belongs to.

```csharp
public required string TenantId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_AgentSkillDefinition_UpdatedAt"></a> UpdatedAt

The skill's last-updated time.

```csharp
public DateTimeOffset UpdatedAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

### <a id="Tracon_AgentSkillDefinition_Version"></a> Version

The skill record's version.

```csharp
public int Version { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

## Methods

### <a id="Tracon_AgentSkillDefinition_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentSkillDefinition_Equals_Tracon_AgentSkillDefinition_"></a> Equals\(AgentSkillDefinition?\)

```csharp
public bool Equals(AgentSkillDefinition? other)
```

#### Parameters

`other` [AgentSkillDefinition](/api/tracon.agentskilldefinition/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentSkillDefinition_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_AgentSkillDefinition_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_AgentSkillDefinition_op_Equality_Tracon_AgentSkillDefinition_Tracon_AgentSkillDefinition_"></a> operator ==\(AgentSkillDefinition?, AgentSkillDefinition?\)

```csharp
public static bool operator ==(AgentSkillDefinition? left, AgentSkillDefinition? right)
```

#### Parameters

`left` [AgentSkillDefinition](/api/tracon.agentskilldefinition/)?

`right` [AgentSkillDefinition](/api/tracon.agentskilldefinition/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentSkillDefinition_op_Inequality_Tracon_AgentSkillDefinition_Tracon_AgentSkillDefinition_"></a> operator \!=\(AgentSkillDefinition?, AgentSkillDefinition?\)

```csharp
public static bool operator !=(AgentSkillDefinition? left, AgentSkillDefinition? right)
```

#### Parameters

`left` [AgentSkillDefinition](/api/tracon.agentskilldefinition/)?

`right` [AgentSkillDefinition](/api/tracon.agentskilldefinition/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
