---
title: 'ARC0002: Missing [Command] attribute on command-like type'
---

## Rule

Types that look like commands (properties plus `Handle` methods) must be marked with `[Command]` to be recognized as commands.

## Severity

Warning

## Example

### Violation

```csharp
public record CreateUser
{
    public string Name { get; set; }

    // ARC0002: Missing [Command] attribute
    public void Handle()
    {
        // Command logic
    }
}
```

### Fix

```csharp
[Command]
public record CreateUser
{
    public string Name { get; set; }
    public string Email { get; set; }

    public void Handle()
    {
        // Command logic
    }
}
```

```csharp
[Command]
public record CreateUser
{
    public string Name { get; set; }

    public UserCreatedResult Handle()
    {
        return new UserCreatedResult { UserId = Guid.NewGuid() };
    }
}
```

## Why This Rule Exists

Commands are identified by the `[Command]` attribute. Without it:
- Handlers are not discovered by the runtime.
- Validation and metadata generation are incomplete.
- Command routing becomes inconsistent across the system.

## Related Rules

- [ARC0001](/arc/backend/code-analysis/arc0001/): Incorrect query method signature on ReadModel
