# H6: Template Format Contract Violation

The output contract gives competing instructions or lacks selected format/version signals.

<div class="rule-facts"><span>H6</span><span>INFO–MEDIUM</span><span>LintLang 0.8.0</span></div>

**Applies to:** Recognized prompts and instruction bodies; missing-format/version checks on chat prompts. Manual repair; no automatic fix for this example.

## What triggers it

Strips code, filenames, and CLI flags before selected format checks. Missing format is LOW for eligible long chat prompts; missing version is INFO for eligible longer prompts, excluding extracted Python literals.

## How to repair it

Choose one output format for the response, or explicitly separate response types. Supply the fields the consumer actually expects.

## Reproduce the finding

Use [uv and Python 3.10+](/docs/install), plus curl. Run the examples in a scratch directory.

[Download the finding example](/examples/rules/h6-bad.json).

```json
{
  "system_prompt": "Respond in JSON. Respond in Markdown."
}
```

```sh
curl -fsS https://lintlang.ai/examples/rules/h6-bad.json -o h6-bad.json
uvx --from lintlang==0.8.0 lintlang scan h6-bad.json --format json
```

Expected with **0.8.0**: the JSON report includes **H6**, severity **MEDIUM**. 

## Improved example

[Download the improved example](/examples/rules/h6-improved.json).

```json
{
  "system_prompt": "Respond in JSON with keys invoice_id and discrepancies."
}
```

```sh
curl -fsS https://lintlang.ai/examples/rules/h6-improved.json -o h6-improved.json
uvx --from lintlang==0.8.0 lintlang scan h6-improved.json --format json
```

Expected with **0.8.0**: **H6 is absent**. Other diagnostics may still appear; this repair targets the rule above.

Both commands use advisory mode: a finding does not itself make the command fail. To fail CI on MEDIUM findings, add --fail-on review. --fail-on fail gates only HIGH and CRITICAL. See [outputs and exit codes](/docs/outputs).

## Detection details

<details>
<summary>Released H6 detection contract and scope</summary>

Strips fenced code, inline code, filenames, and CLI flags before counting format
keywords. Checks selected conflicting output formats without disambiguation,
template variables and, for chat prompts only, a missing format specification and
(not for extracted Python literals) a missing version marker.
It does not prove arbitrary output contracts satisfiable.

</details>

[All scan rules](/rules) · [Quickstart](/docs/quickstart) · [Separate preflight checks](/docs/preflight).

