## TL;DR
"mapping values are not allowed" is YAML's way of saying a colon inside an unquoted value confused the parser, usually on the exact line number reported. Open the template at that line, quote the offending string, and re-run nuclei -validate until it passes. The template then compiles.

```text
[ERR] Could not compile template custom-check.yaml: yaml: line 12: mapping values are not allowed in this context
```

## Use this when
- A custom template fails to compile with the YAML mapping error.
- The error names a line number in your template.
- Bundled templates compile fine.

## Not for this skill when
- The template compiles but matches nothing. That is matcher logic, not YAML.
- Every template fails. Then the nuclei install is the problem.

## Steps
1. Open the template at the reported line: `sed -n '10,14p' custom-check.yaml`. Verify: you see the line with a bare colon inside a value, like `match: 200 OK: special`.
2. Quote the value: change it to `match: "200 OK: special"`. Any string containing a colon and a space must be quoted in YAML. Verify: the line no longer has a bare colon-space inside a plain scalar.
3. Validate without scanning: `nuclei -validate -t custom-check.yaml`. Verify: the validator reports the template as valid.
4. Run it against a lab target you control: `nuclei -t custom-check.yaml -u https://target.example.com`. Verify: the template executes instead of failing to compile.
5. Scan the whole custom directory for the same mistake: `grep -rn ': [^"]*$' *.yaml | head`. Verify: no other template has the same unquoted-colon shape.

Compatibility: nuclei 3.x. YAML parsing rules are version-independent.

## Variant phrasings
### nuclei yaml mapping values not allowed
Same fix path, common phrasing.
### nuclei template yaml syntax error
Symptom-level search.
### nuclei -validate template
The validator-oriented search.

## Why it happens
YAML treats `key: value: more` as a nested mapping, which is illegal in that position. Template authors hit this writing matchers, payloads, or descriptions that contain colons, like URLs with ports or "Header: value" strings. The parser reports the line where it gave up, which is usually the line with the unquoted colon.

## Edge cases / pitfalls
- Tabs for indentation break YAML too. Use spaces only; the error line may mislead you to the wrong line.
- Multi-line strings with `|` still need care with colons at line starts. Quote or use literal blocks deliberately.
- -validate checks syntax and schema, not logic. A valid template can still never match.
- Keep custom templates in version control. A one-character YAML fix is easy to lose without it.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_O-jqPdRN190tlCcClzgHSA
