codex icon indicating copy to clipboard operation
codex copied to clipboard

skill-creator: quick_validate misclassifies TODO placeholders in Markdown containers

Open deepstorm1-maker opened this issue 3 days ago • 0 comments

Summary

The bundled Skill Creator validator's unfinished-TODO check scans Markdown using a line-oriented regular expression that approximates fenced-code-block state. It does not follow CommonMark block parsing, so it both misses real scaffold placeholders and rejects literal examples inside code blocks.

The Skill Creator guide explicitly says the validator checks unfinished scaffold placeholders: Validate and Iterate.

Affected source

Current openai/codex main was inspected at 9baf9789e1b0db1d12080020017b73311950723e.

Validator TODO scanner, lines 93–115.

The scanner treats any indented fence-like line as a fence opener and permits list markers before both opening and closing fences. It does not account for Markdown container boundaries, invalid fence info strings, or HTML comments.

Reproduction cases

For each case, use valid frontmatter:

---
name: ink-guide
description: A guide for testing Markdown scaffold validation.
---

Append one of the following bodies.

1. Indented code fence token hides a real TODO

Example.

    ```

[TODO: Edit.]

CommonMark treats the four-space-indented fence token as an indented code block, not a fenced code block. The following TODO is ordinary paragraph text and should be rejected.

Actual: validator exits 0 and prints Skill is valid!.

2. A list boundary hides a real TODO

- ```text
  sample

[TODO: Edit.]

The unindented paragraph follows the blank line and is outside the list's fenced code block. It should be rejected.

Actual: validator exits 0 and prints Skill is valid!.

3. A list-like line inside a fenced example causes a false positive

```text
- ```
[TODO: Example.]
```

The list-prefixed fence-looking line is code content, not a closing fence. The TODO is an example inside a fenced code block and should be accepted.

Actual: validator exits 1 with Skill instructions contain an unfinished TODO placeholder.

4. Invalid fence info string hides a real TODO

```text` suffix

[TODO: Edit.]

A backtick in a backtick-fence info string makes that opener invalid under CommonMark. The TODO is outside a code block and should be rejected.

Actual: validator exits 0.

5. A fence-like line inside an HTML comment hides a real TODO

<!--
```
-->

[TODO: Edit.]

The fence-like line is inside an HTML comment and does not open a Markdown code block. The TODO after the comment should be rejected.

Actual: validator exits 0.

Expected behaviour

The validator should reject standalone scaffold TODO markers in actual Markdown text while ignoring TODO examples inside real code blocks. It should interpret Markdown containers and fenced-code rules consistently rather than treating every fence-looking line as a state transition.

A CommonMark-aware prototype corrected all five cases in an isolated test. That prototype used markdown-it-py; this report does not prescribe adding that dependency to the bundled skill without a separate packaging decision.

Validation

All five cases were executed against the unmodified validator from the current source snapshot. Four produced false negatives and one produced a false positive. A temporary CommonMark-aware prototype returned the expected result for all five.

The tests used synthetic temporary skill directories. No repository or installed skill files were modified. Full Codex build and CI were not run.

Scope

This is separate from:

  • empty required metadata, tracked in #44187;
  • optional compatibility frontmatter rejection, tracked in #58538;
  • initializer YAML serialization of the description placeholder, reported in #37052.

The proposed solution should preserve the existing metadata rules and avoid silently accepting genuine unfinished scaffold text.

deepstorm1-maker avatar Nov 30 '26 16:11 deepstorm1-maker