# LS5004: Mark Uses the Undeclared Style

## Intent

LS5004 is a compiler check that reports a mark written in the style the project did not declare, because two styles in one project send each search to half the code. This page states what the rule reports, where the error sits, and how to write the mark in the declared style.

## Reference

### What the Rule Enforces

LS5004 enforces [Write Each Mark in the Declared Style](https://litespec.dev/4.0.0/backend/dotnet/stack.md#write-each-mark-in-the-declared-style) (`litespec/backend/dotnet/stack#write-each-mark-in-the-declared-style`). It runs in every layer, on every marked code element and test. Its category is `LiteSpec.Traceability`.

### What the Rule Reports

The rule reports an `implements` or `proves` documentation tag when the project declares `attribute`, and an `Implements` or `Proves` attribute when the project declares `xml`. The Claimwick product declares `"marks": "xml"`, so its marks are documentation tags. The diagnostic sits on the mark.

### Failing Example

```csharp
[Implements("use-case/spending.submit-expense")]
internal sealed class SubmitExpenseCommandHandler(...)
    : ICommandHandler<SubmitExpenseCommand, SubmitExpenseCommandResult>
{
    // Loads the expense, submits it, stages it, and returns the result.
}
```

### Passing Example

```csharp
/// <implements>use-case/spending.submit-expense</implements>
internal sealed class SubmitExpenseCommandHandler(...)
    : ICommandHandler<SubmitExpenseCommand, SubmitExpenseCommandResult>
{
    // Loads the expense, submits it, stages it, and returns the result.
}
```

### How to Fix

Write the mark in the declared style. A code fix converts the mark to the declared style, with Fix All.

## Notes

### What the Rule Ignores

The rule does not report a mark written in the declared style. It reads C# only; frontend `litespec` constants are checked by `litespec model check`. The rule stays silent when no `.litespec/project.json` is in reach, or when the docs root it names cannot be resolved; the CLI owns that configuration error.

### Severity

The rule reports an error. A finding that a live exception covers stays silent. An `.editorconfig` entry for the rule id overrides the computed severity.
