GaZmagik/iso-24495 / skills/iso-24495-4
iso-24495-4
VerifiedProvisional task skill for organisational plain language implementation (based on ISO/CD 24495-4, committee draft). Activates for plain language gap analysis, policy drafting, review workflow design, and organisational readiness for the future published standard. Does not activate for ordinary writing, rewriting, or reviewing of individual documents.
tests/robustness.test.ts
View on GitHubimport { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { auditCorpus, auditText, configHash, listTextFiles } from "../scripts/audit-corpus.ts";
import { proseBlocks, wordCount } from "../scripts/lib/parse.ts";
const CORPUS = join(import.meta.dir, "fixtures", "corpus");
const FUZZ_INPUTS = [
"",
" \t\r\n ",
"x".repeat(100_000),
"```ts\n# not a heading\nconst value = 1;",
"First line.\r\nSecond line.\r\n",
"First line.\rSecond line.\r",
"\uFEFF# Heading\nText follows.",
"Emoji 😀 remain deterministic. 中文文本也应保持稳定。",
"نص عربي واضح. טקסט עברי ברור.",
"- item\n | A | B |\n | - | - |\n | x | y |",
"before\0after",
] as const;
const KNOWN_RULES = new Set([
"sentence-length",
"sentence-average",
"paragraph-length",
"legalese",
"heading-depth",
"heading-skip",
"heading-style",
"acronym-undefined",
"doublet",
"prose-enumeration",
]);
describe("robustness and determinism", () => {
test("auditText and proseBlocks never throw and are deterministic for hostile text shapes", () => {
for (const input of FUZZ_INPUTS) {
expect(() => auditText(input)).not.toThrow();
expect(() => proseBlocks(input)).not.toThrow();
expect(auditText(input)).toEqual(auditText(input));
expect(proseBlocks(input)).toEqual(proseBlocks(input));
}
});
test("full corpus audits and configuration hashes are deterministic", () => {
expect(auditCorpus(CORPUS)).toEqual(auditCorpus(CORPUS));
expect(configHash()).toBe(configHash());
});
test("wordCount deliberately counts whitespace-delimited tokens", () => {
expect(wordCount("state-of-the-art guidance")).toBe(2);
expect(wordCount("123 4.5 -7")).toBe(3);
expect(wordCount("hello 👋 world")).toBe(3);
expect(wordCount("café naïve façade")).toBe(3);
expect(wordCount("中文文本")).toBe(1);
});
test("every violation satisfies the shared structural invariants", () => {
const inputs = [
...FUZZ_INPUTS,
...listTextFiles(CORPUS).map((path) => readFileSync(path, "utf8")),
];
const violations = inputs.flatMap(auditText);
expect(violations.length).toBeGreaterThan(0);
for (const violation of violations) {
expect(violation.line).toBeGreaterThanOrEqual(1);
expect(KNOWN_RULES.has(violation.rule)).toBe(true);
expect(violation.detail.trim().length).toBeGreaterThan(0);
}
});
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |