Repository navigation
How to handle a plain-text-only (strict ASCII) policy when .specify contains emojis or similar? #5709
Replies: 1 comment
|
As far as I can tell there is no built-in "ASCII only" switch in Spec Kit today (I searched the CLI source and docs for one). The non-ASCII characters come from two places: the core templates and command prompts themselves (checkmarks, arrows and dashes are used in 1. A small local preset that appends an ASCII rule to every core command Presets can
schema_version: "1.0"
preset:
id: "ascii-only"
name: "ASCII only output"
version: "1.0.0"
description: "Restrict all generated artifacts to plain 7-bit ASCII"
requires:
speckit_version: ">=0.6.0"
provides:
templates:
- type: "command"
name: "speckit.specify"
file: "commands/ascii-rule.md"
strategy: "append"
- type: "command"
name: "speckit.plan"
file: "commands/ascii-rule.md"
strategy: "append"
- type: "command"
name: "speckit.tasks"
file: "commands/ascii-rule.md"
strategy: "append"
# repeat for speckit.clarify, speckit.analyze, speckit.checklist,
# speckit.implement and speckit.constitution
## Output character policy (mandatory)
Every file you create or edit must contain only plain 7-bit ASCII characters.
Do not use emojis, checkmarks, cross marks, arrows, typographic quotes or long dashes,
even if the template you are filling in contains them. Use ASCII replacements:
[x] / [ ] for checkboxes, "OK" / "FAIL" for status, "->" for arrows, "-" for dashes.
Before finishing, re-read the files you wrote and replace any remaining non-ASCII character.Install it in each project: specify preset add --dev ./ascii-only(Presets apply the command change for the active integration, so Claude Code etc. pick it up.) If you also want the templates themselves to be clean, ship ASCII copies of Docs: Presets overview, composition strategies and file resolution, customization guide. 2. Make CI reject anything outside ASCII instead of allowlisting characters An allowlist of "known" Unicode will always be one character behind. Flipping it to "anything above 0x7F fails" is stable: # fails if any tracked file under these paths contains a non-ASCII byte
if git grep -nP '[^\x00-\x7F]' -- .specify specs; then
echo "Non-ASCII characters found"; exit 1
fiThat also covers the Trojan Source class of problems (bidi controls, zero-width characters, homoglyphs), since all of those are outside ASCII. 3. Clean up what is already committed Run the same If you think it should be a first-class option, a feature request for an "ascii-only" setting or an official preset would be reasonable, and in the meantime the preset above gives you that behavior. |
Uh oh!
There was an error while loading. Please reload this page.
Hello, my role in some projects is doing quality assurance and a bit of security, and I'm trying to enforce a "plain text only" policy for all kinds of source code and similar, for cleanliness and to prevent homograph/homoglyph attacks. In our general harness we've already told Claude to only use plain ASCII characters, but looks like Spec-Kit is outside of that.
Colleagues of mine recently started using Spec-Kit, and now we see several Unicode characters popping up in the repos -- e.g. checkmarks, stylized X markers, typographic long dashes, emojis -- and they told me they cannot fix it because it's externally generated and I should ask here.

We could now start allowlisting those Unicode characters and emojis individually in our CI/CD checks, but that feels unstable to me, as unknown characters in future may break it again. Yes I know Instead, I'd love to see a more general and robust solution.
Questions:
References:
All reactions