iso-24495-code

Applies plain-language principles to source code (per ISO 24495-1:2023): governs the human-facing parts of code, including ordering of code units, naming, comments and error messages. Intended for use during code writing or refactoring, not for explanatory commentary on code.

Last repository push
GitHub Stars
217
Forks
12
Issues / PRs
19

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "iso-24495-code" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-00b2aa9004a6a5c5f5a730a9f7bf6fd118116577b630b1d2bd0e50ab7ec845cb. Verify the upstream source and version against https://github.com/GaZmagik/iso-24495 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Applies plain-language principles to source code (per ISO 24495-1:2023): governs the human-facing parts of code, including ordering of code units, naming, comments and error messages. Intended for use during code writing or refactoring, not for explanatory commentary on code.

0 Downloads

Introduction source: third_party · GaZmagik · 0.7.0 Reference

SkillPi interpretation

Tasks
Plain language applied to source code (ISO 24495-1:2023 principles). Governs the parts of code a person reads: the order units appear in, their names, comments, and error messages. Applied when writing or restructuring code, not when explaining it.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: iso-24495-code
description: "Plain language applied to source code (ISO 24495-1:2023 principles). Governs the parts of code a person reads: the order units appear in, their names, comments, and error messages. Applied when writing or restructuring code, not when explaining it."
metadata:
  version: "0.7.0"
  iso-standard: "ISO 24495-1:2023"
  iso-status: "published, applied by analogy to source code"

Plain language in code

Extends ISO 24495-1 to source code. Code is read far more often than it is written, so the person reading it is the reader the standard is about.

Scope. This skill governs what a reader reads: the order units appear in, what they are called, what the comments say, and what an error tells the person who hits it.

It does not govern correctness, performance, or system design. It does govern local organisation, in rules 1 and 2, because where a unit sits and how far it reaches decide what a reader must hold in their head. For maintainability weaknesses such as complexity and dead code, use a code quality skill built on ISO/IEC 5055.

This is an interpretation of ISO 24495-1 applied by analogy, not a conformance claim.

The four principles, in code

Principle In prose In code
Findable The reader can find what they need The public entry point appears first
Understandable The reader understands it Names say what the thing is, in the reader's words
Relevant The reader gets what they need A comment says why; interface documentation says what
Usable The reader can act on it An error names the problem and shows a safe value

Rules

1. Front-load the main path

Put the public entry point at the top of the file, before the helpers it calls. A reader opening the file meets the thing it does, then the detail, in that order. This is the code form of leading with the outcome.

Where a language forces declarations before use, put a short delegating entry point first and the implementation below it.

Measured on 30 generated implementations of one specification. Without this rule the public function landed anywhere in the file, and in half the files it was the last thing in it. With the rule it sat in the first fifth of the file every time.

The measure was chosen after those runs rather than before them, and the effect appeared in one model family but not in the two others tested. Treat it as a hypothesis with a clean separation, not a settled result.

2. One job per unit

A function does one thing that its name describes. A name needing "and" is a prompt to look, not an instruction to split. Some operations are genuinely single and named for a pair, as compareAndSwap is, and splitting those breaks them.

Helpers belong at the top level or as members of a class, rather than buried as closures inside the function they serve. A reader cannot reach a closure without reading its container first.

3. Name for the reader

  • A name says what the thing is or does, in the vocabulary of someone who knows the domain but not this file.
  • Use one name for one concept throughout. If it is a token here it is not a lexeme three functions later. Elegant variation confuses code exactly as it confuses prose.
  • Prefer a longer name that reads to a shorter one that must be decoded. remainingBudget beats rb.

4. A comment says why; interface documentation says what a caller needs

A comment earns its place when it records something a reader cannot recover from the code: a reason, a constraint, a rejected alternative, a bug it guards against.

Delete a comment that merely restates the line beneath it, and delete commented-out code.

This is not a rule against documentation. An interface comment tells a caller what a function returns, when it returns nothing, and what it throws. That is the reader's work being done for them, so it belongs there even when the body makes it obvious.

5. An error message serves the person who hits it

An error names the problem, shows a value it is safe to show, and where it helps, says what to do instead. Write it in the words its reader would use, so it can be acted on without opening the source.

Never put a secret in an error. A credential, token, key, password, session identifier or personal detail must not appear in a message, because messages reach logs, telemetry and screens. Name the field and describe the fault instead: API token rejected: expected 32 characters, got 8. Where you cannot show a value safely, show its shape.

A value on this path has just failed validation, so its contents are unknown. Naming the field does not make them safe: whatever the caller passed is what reaches the log. Report the format you expected and the shape of what arrived, never the value itself. Read a length only once you know the value is a string, because any other value can carry a length property holding anything at all.

Bad:   throw new Error("invalid input")
Good:  if (typeof duration !== "string") {
         throw new TypeError(`Duration must be a string; got a value of type ${typeof duration}`)
       }
       throw new TypeError(
         `Duration must be a number followed by ms, s, m, h or d; got ${duration.length} characters`)
Good:  if (typeof token !== "string") {
         throw new TypeError(`API token must be a string; got a value of type ${typeof token}`)
       }
       throw new Error(`API token rejected: expected 32 characters, got ${token.length}`)

Quote a value only where you control it, such as one you have already matched against a fixed set. Then the set, not the caller, decides what can appear.

6. Prefer the plain construction

Where two constructions are equally correct, use the one a competent reader understands without pausing. Cleverness that needs a comment to explain it has already failed.

What this skill does not do

  • It does not require comments. A file with no comments and clear names is fine.
  • It does not set a line count for a function. Use iso-5055-code-quality for size and complexity thresholds, which are measurable.
  • It does not apply to generated code, vendored code, or code whose layout a formatter owns.

Applying it to existing code

Change the reading order and the language. Do not restructure behaviour in the same pass, and never move code and change it at once, because the diff stops being reviewable.

Version history

  1. v0.7.0 GitHub ↗
    Original release notes

    ### Added - **Document-level rules for legal writing.** `iso-24495-2` governed wording alone, so a contract came out clearly worded inside a structure nobody could navigate. It now carries five rules the wording rules could not reach: defined terms, cross-references, clause identifiers, a summary layer, and section names. Cross-references name what they point at, clause identifiers survive an amendment, and section names use the reference case Part 5 already allows. - **A summary that cannot be mistaken for the agreement.** It sits directly after Part 5's opening block. The summary must state that the operative text governs, and must name where that text starts. It must not add, qualify or remove an obligation, because a summary a reader acts on instead of the contract changes their rights. - **A qualification that travels with its term.** Part 5 requires an overview to keep every essential qualification, so the summary states a term together with every one of them. Where that cannot be done plainly, the term is left out and its clause named instead. - **A worked summary example**, showing the governing statement that a bare summary leaves out. - **A mapping between a technical explanation and a technical document.** `iso-24495-3` orders an explanation in three stages, and `iso-24495-5` orders a document in three levels. They are different axes, so Part 3 now says where each stage lands. The purpose sentence supplies the purpose line of the opening block, and opens the overview where Part 5 calls for one. Stages 2 and 3 are the main body, and nothing is demoted to optional detail by default. - **A stage covers what the explanation contains.** Every stage was mandatory, so a runbook needed a diagram of its own step list and a decision record needed a code snippet it has no code for. A stage with no content is omitted, and the order of the rest holds. - **A text alternative wherever a diagram is required.** Part 3 mandates a diagram or table where an explanation covers how more than one component relates to another. It never mentioned alternative text, so a document passing its own checklist could hand a listener nothing. A Mermaid diagram reaches a listener as its source, which is not an explanation, so the alternative is prose beside it. - **A definition of the clause the numbering rule means.** "Number every operative clause" never said what operative means, and the checklist repeated the term, so a non-lawyer could not tell whether they had complied. An operative clause imposes, permits or prohibits an action, and recitals, definitions and schedules are numbered by the document's conventions instead. - **This repository now audits its own pull request descriptions.** The suite reads every document here, and a description was the one piece of text it never saw, because it lives on GitHub rather than in the tree. A workflow now hands it to `scripts/audit-pull-request-text.sh`, which a contributor can run over any file. Findings are advice, listed in the log and on the job's summary page, and never fail the check. It fails only a description that is empty or holds only whitespace, or a run where the audit did not complete. - **A `--no-front-matter` option for the text audit.** A pull request description cannot carry metadata, so a leading `---` block in one is text a reader sees. The option reads that block as text, and the description check passes it. A file in a repository still has its front matter set aside as metadata. ### Known limits - **The audit engine does not measure the new rules.** Its seventeen checks are mechanical proxies: eleven read prose, five of them also read headings, and six read markup, such as headings, table headers, link text and image alternatives. None reads the structure this release adds. A document with no summary, undefined terms, unnumbered clauses or a misplaced stage still reports zero findings. A zero is not a pass for any of them, and the organisational Measurement dimension does not move when that structure is absent. - **Thirty reviewed documents are pinned whole, and editing one means rebuilding its fixture.** The list covers skills, manifests, selected references and templates, the output style, and root documents. A separate test requires every skill and manifest to appear on the list, but the list does not cover every repository file or determine what a host packages. TypeScript is excluded because it changes constantly and has its own suites. Sentences printed by the audit tools are pinned separately, after a review reversed the report's certification disclaimer in code with every test still green. - **The workflow test checks the audit command, not the workflow settings.** It runs the pull request workflow's shell block and confirms that an empty description fails. It cannot see settings that GitHub applies outside that block, such as `continue-on-error` on the step or an `if` condition on the job. A setting like that can stop a failed run from failing the check while every test still passes. ### Changed - **A technical task now reaches the document design skill too**, whenever its output is a document. A code review comment and a chat answer are explanations rather than documents, so the pairing is conditional where the legal one is not. - **Part 5 says what Part 3 governs.** It claimed Part 3 governed the wording across its levels. Part 3 governs the stages, and now states where each one lands. - **The citation rule governs an explanation of code.** It read on any logic at all, so a user guide describing what happens after a click would have carried file and line references its reader cannot use. - **A defined term is collected where it appears in more than one section.** The rule said "where a term runs throughout", which two writers would not apply the same way. - **The design document template requires a text alternative** beside a diagram. It offered a diagram or a description, and so permitted a diagram with neither. - **A legal task now reaches the document design skill.** The Part 5 trigger named reports, specifications and guides, and stopped there, so nothing routed a contract or a licence to the design rules. The core skill, the output style and the Codex style skill now send legal work to `iso-24495-5` as well as `iso-24495-2`. - **The text audit states that it supports English only.** Its word rules match English words, and its counting rules count words by spaces against English benchmarks. The README and the audit skill now say so, and say that the audit reads Markdown as written rather than interpreting raw HTML. - **The version checks run in three stages.** The gate compared the version with every release tag, so any checkout of a release failed once that release was tagged. Every gate run now checks only that the version sites agree and the changelog records the version. A preflight, run by hand before tagging, requires a version later than every release. A workflow checks each pushed tag against the files it names, then runs the gate. - **Continuous integration moves to a newer Bun release.** The workflows now pin Bun 1.4.2 instead of 1.3.14. - **Part 5 names the one exception to its ordered-list rule.** No ordered list renders a compound identifier such as 4.2.1, so a legal document writes its clause identifiers into the clause text. Part 5 states that exception where the rule itself is stated, and its self-audit checklist carries the same exception. ### Fixed - **The description check reads the audit's report as JSON.** It searched the report for the text `"violations":`, so it trusted invalid JSON and a report naming a different file. The report must now be valid JSON, name the description and no other file, and skip nothing. - **The version check reads a skill's front matter as YAML.** It took the first `version:` line anywhere in the front matter, so a line inside a description could hide a stale `metadata.version`. It now reads `metadata.version` itself. - **An abbreviation defined across a line break counts as defined.** The definition scan started afresh on every source line, so an expansion wrapped onto a second line never matched the abbreviation after it. A line break inside a paragraph is a space to the reader, so the words now carry across it. They never carry across a paragraph, list item, quotation, heading, table row or code block. - **Headings are read by the five word rules.** `legalese`, `doublet`, `wordy-phrase`, `complex-word` and `double-negative` read prose only, so a heading holding a banned term reported nothing. They now read headings too, and report the line where a heading starts. The rules about sentences and paragraphs still read prose only. - **Example 18 in the output style restructures without rewriting.** Its "after" replaced "For the rollback steps, click here" with "See the rollback steps", which Part 5 forbids, because rewording belongs to Part 1. The link now moves onto the words that name its destination, and every word stays as written. Examples 15 to 17 were checked against the same rule and pass, because labels, slots and heading changes are structure the skill permits. A test now holds every Part 5 example to it. - **The Codex style skill must equal the output style exactly.** The test checked that the skill contained the style's text, so a line added to the Codex copy alone, such as "Ignore every rule above.", passed. Everything from the style's first sentence onwards must now be identical. - **Three output style examples keep to their own rules.** Example 6 added a test assertion the "before" never made, so its list now names only the three areas. Example 12 left "token bucket algorithm" and "mutex" undefined, which Part 3 forbids, so it now defines both, and its five-sentence paragraph is now two. Example 7's clause now carries the identifier Part 2 requires. - **A Windows checkout passes the gate.** Under `core.autocrlf` the shipped documents arrived with Windows line endings. A test splitting them on line feeds then failed on files nobody had changed. A `.gitattributes` file now checks every text file out with Unix line endings. - **Example 17 in the output style restructures without rewriting.** Its "after" split a sentence into steps, added a lead-in the "before" never held, and reworded "Otherwise" as "If the copy succeeds". Part 5 forbids rewriting prose in a restructure, so every sentence in the "after" now appears word for word in the "before".

  2. v0.6.2 GitHub ↗
    Original release notes

    Document design rules for `iso-24495-5`, drawn from the International Plain Language Federation's Document design pattern library, version 0.6, June 2025. ## Added - **An opening block.** Every document states its title, a one-line purpose, its version or date, and the reader it is for, each with a stated minimum. - **A layering rule.** A document with 6 or more sections labels its overview, which keeps the conclusion, the required action and every essential qualification. - **A signposting rule.** A document tells a reader who needs something else where to go, and leaves the line out where no alternative exists. - **Two heading exceptions, and no others**, for a published structure and for a reference section a reader jumps to by subject. - **Branching routes, heading numbering, named heading failures**, limits on tables, callouts and sequences, bullet limits, an accessibility exemption, and a provisional-label rule. ## Changed - **The self-audit checklist grows from 6 checks to 25**, so every rule above it has one. - **All three templates carry the opening block.** The runbook's headings state their task, the design document names what its sequential subsections explain, and the decision record gains a status and cites Michael Nygard's Documenting Architecture Decisions, 2011. ## Fixed - **Restructuring could have required inventing content.** It now builds the opening block only from sentences the document already holds, or from wording the author supplies, and marks what is missing as a gap. A wrong purpose sends a reader confidently in the wrong direction, which is worse than no purpose at all. - **A promoted sentence can move only where its meaning survives**, since every word can survive a move while the meaning does not. - **The Codex manifest sat at 0.6.0** while every other version site had moved to 0.6.1, because nothing checked that they agree. - **The three templates are now compared against their recorded text**, so no reader-visible change to them can happen without the test changing in the same commit. No substantial wording is copied from the pattern library. Read the [original](https://www.iplfederation.org/wp-content/uploads/2025/06/ISOpatternlibrary06.pdf). **Full changelog:** https://github.com/GaZmagik/iso-24495/blob/v0.6.2/CHANGELOG.md

  3. v0.6.1 GitHub ↗
    Original release notes

    ### Fixed - `iso-24495-code` would not load. Its description was an unquoted YAML scalar holding a colon and a space, in "the parts of code a person reads: the order units appear in". YAML reads that as the start of a nested mapping, so a loader refused the file with `mapping values are not allowed in this context at line 2 column 123`. The skill has been unloadable since 0.6.0 shipped. The description is now quoted, so a later edit that adds a colon still parses. - Nothing had ever parsed a `SKILL.md` as YAML, which is why the gate did not catch it. The other tests read these files as text, check the prose inside them and the files beside them, and took the frontmatter on trust. Every skill's frontmatter is now parsed on each run, and must carry a name matching its directory and a description that is not empty. ### Installing ``` /plugin marketplace add https://github.com/GaZmagik/iso-24495.git /plugin install iso-24495-plain-language@iso-24495 ``` Already installed? The marketplace `ref` now points at `v0.6.1`, so update the marketplace to pick it up.

  4. v0.6.0 GitHub ↗
    Original release notes

    ## A seventh skill: plain language in code `iso-24495-code` applies the four principles to what a person reads in source code: the order units appear in, their names, what a comment says, and what an error tells the reader who hits it. It exists because the writing rules were measured and found to do nothing to code. Across 30 generated implementations of one specification: | Measure | No rules | Prose style | Style plus code rules | |---|---|---|---| | Public function position in file, median | 0.54 | 0.39 | **0.07** | | Named units, median | 12 | 12 | **15** | | Hidden tests passed | 10/10 | 10/10 | 10/10 | Without code rules the entry point lands anywhere, and last of all in half the files. With them it sits in the first fifth every time, at no cost to correctness. The same three arms on Codex and Gemini 3.7 Flash show no such movement, so treat this as a Claude effect rather than a general one. The reading-order measure was also chosen after those runs rather than predicted, so it is a hypothesis with a clean separation rather than a settled result. That caveat is carried inside the skill itself. The skill sets no size or complexity thresholds. Those are software quality rather than language. ## The engine stopped manufacturing findings Every engine defect fixed here made the audit report something that was not there, or miss something that was. - **A full stop inside emphasis, quotes or brackets now ends a sentence.** `**Lead in.** Next sentence.` was read as one sentence, so the engine was at its worst on the commonest pattern in these very skills. - **A code span is one atom.** `` `alpha. beta` `` split one sentence into three, so any text quoting punctuation was miscounted. - **A badge is read again.** An image inside a reference link lost its `image-alt` finding, which is the commonest nested link anyone writes. - **An escaped character reads as the character a reader sees.** An escaped terminator lost its sentence boundary, and an abbreviation behind an escaped bracket stopped being an abbreviation. - **Markup spanning lines no longer moves the lines after it.** Findings pointed one line early, so a reader opened an innocent line. ## It no longer stalls Six separate places grew with the square of the document, and generated or damaged Markdown reaches those shapes without anybody meaning harm. | Input | Before | After | |---|---|---| | 10,000 unmatched brackets | 8,940 ms | 18 ms | | 20,000 unmatched brackets | about 40 seconds | 25 ms | | 4,000 long sentences in one paragraph | 10,810 ms | 1,901 ms | | 8,000 acronyms | 8,847 ms | 298 ms | | A long sentence | threw | audited | Every link and image is now found by one scan rather than by a pattern per rule. ## How this was tested Eight adversarial review rounds. Rounds one to seven found defects every time, and several were introduced by the repair for the round before. Each was reproduced, its origin measured against the previous release rather than assumed, and fixed. Round eight passed. The engine was verified against the previous release across 40,000 generated documents holding badges, nested images and bracketed destinations, with no difference in what is reported. The gate is 160 tests across 10 files at 100% line and function coverage, and it includes the plugin auditing its own documents. ## Known limitations Stated rather than fixed. Each needs Markdown a reader is unlikely to write, and they are listed in the changelog. - A link destination ends at the first `)`, so one holding both parentheses and a raw `]` is not read as a link. - A link inside a link label is reported as two links, where CommonMark resolves it to the innermost one. - An image whose description is only another image with no description of its own is not reported.

  5. v0.5.0 GitHub ↗
    Original release notes

    Plain language skills inspired by the ISO 24495 series, for Claude Code and now Codex CLI. ## What is new **A user-invoked text audit.** `iso-24495-text-audit` audits one file or directory you choose, and reports each finding with its file, line, rule and explanation. It replaces the automatic hook and the background monitor, which audited without being asked. Only you can invoke it: the model cannot, and it is told not to do the same work by other means. **Codex CLI support.** The plugin installs from the same address in both tools. Every skill carries the interface file Codex reads for its display name and prompt. Codex has no output style, so `iso-24495-style` carries those rules as a skill, word for word, with a test keeping the two identical. **Document design.** Part 5 provides templates for architecture decision records, runbooks and design documents, and reframes its rules around the heading tree, link text and reading order, which are the structure a listener has. **Seventeen rules, and a reader who cannot see the page.** `link-text` and `image-alt` serve readers who hear a document. `table-header` reports a column a listener would hear announced with no name. Four more rules close gaps between what the skills promised and what the engine checked. ## What changed underneath The engine reads Markdown the way CommonMark describes it, rather than inferring structure line by line. Each line is matched against the containers already open, then against any container it starts, and what remains is the block a rule measures. That is checked against the CommonMark reference implementation over 302 documents, recorded in the repository. 236 are read identically. The rest differ for one of five reasons, each a decision about a reader rather than about Markdown, and the script that rebuilds the record refuses to write a difference it cannot explain. List items and quotations are measured as the sentences a reader reads them as. A bullet can run to forty words, and nothing was checking it. ## Installing Claude Code: ``` /plugin marketplace add https://github.com/GaZmagik/iso-24495.git /plugin install iso-24495-plain-language@iso-24495 ``` Codex CLI: ``` codex plugin marketplace add https://github.com/GaZmagik/iso-24495.git codex plugin add iso-24495-plain-language@iso-24495 ``` ## What this is not The rules are mechanical proxies for the standard's public principles, not its licensed text. Nothing here is a claim of ISO conformance, and a clean audit is not proof that writing suits its readers.

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.7.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value82/100

Highlights

  • 提供基于国际标准的代码可读性规范,显著提升开发团队协作效率
  • 覆盖命名、注释、错误处理等关键编码实践,实用性强
Trigger Precision88/100

Highlights

  • 触发描述清晰界定适用范围(编写/重构代码)与排除范围(解释代码)
  • 边界明确,不易与其他 Skill 混淆
Structure and Standards92/100

Highlights

  • 结构完整:含原则表、具体规则、示例、非适用范围和应用建议
  • frontmatter 信息完整,文档长度适中
Execution Reliability85/100

Areas to improve

  • description写错位置 Reported severity: Minor

    description 内容写在 skill_body 内部的 frontmatter 中,而非顶层 frontmatter

    Recommendation: 将 description 移至顶层 frontmatter

Highlights

  • 内容为自洽的规范性指南,无外部依赖风险
  • 错误处理建议符合安全最佳实践
Evidence Verifiability (mean of the first four)87/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 66

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.