Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
{
"name": "audit-docs",
"source": "./.claude/skills/audit-docs",
"description": "Audit and update the project's documentation so it matches the current code, grounding every claim in a file opened this run."
"description": "Audits and updates a project's documentation, both its Markdown pages and the comments in its code, so they match the current code, grounding every claim in a file opened this run."
},
{
"name": "audit-pr",
"source": "./.claude/skills/audit-pr",
"description": "Review a pull request or working-branch diff across eighteen triaged categories and produce findings evidenced by the changed line."
"description": "Reviews a pull request or working-branch diff across triaged categories and returns one report whose findings quote the changed line and show the corrected code."
},
{
"name": "audit-quality",
"source": "./.claude/skills/audit-quality",
"description": "Audit code for architecture, security, privacy, testing, dependency, supply chain, and cost issues, reporting findings with file and symbol evidence."
"description": "Audits code for architecture, security, privacy, testing, dependency, supply chain, and cost issues, returning one report whose findings carry file and symbol evidence and show each fix as code."
},
{
"name": "typescript-code-and-test-standards",
"source": "./.claude/skills/typescript-code-and-test-standards",
"description": "TypeScript and JavaScript standards that formatters and linters cannot catch, covering comment discipline, JSDoc, the test mandate, and the mocking policy."
"description": "Applies TypeScript and JavaScript standards that formatters and linters cannot catch, covering comment discipline, JSDoc, type-system defects, accessibility, the test mandate, and the mocking policy."
}
]
}
2 changes: 1 addition & 1 deletion .claude/agents/prompt-skill-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You judge whether the two halves of a published audit still aim at the same outc

## Procedure

1. **Run `make -f .claude/Makefile check-skills` first** and read the exit code. It decides the mechanical questions: specification validity, licences, bundled paths resolving, and the isolation rules. Fix anything it reports before judging parity, and report what you fixed.
1. **Run `make -f .claude/Makefile check-skills` first** and read the exit code. It decides the mechanical questions: specification validity, licences, bundled paths resolving, the isolation rules, and the skill authoring guide's checkable rules. Fix anything it reports before judging parity, and report what you fixed.
2. **Read both halves in full.** There is no shortcut; the judgement is semantic.
3. **Build a rule inventory for each half.** List every hard rule, prohibition, evidence requirement, and output-format element. Compare the two lists rather than the two texts.
4. **Classify each difference** as allowed depth, allowed fallback, or a real divergence. State which for every difference you found, so the caller can check your reasoning.
Expand Down
9 changes: 6 additions & 3 deletions .claude/rules/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ The counts, thresholds, and carve-outs behind these live in the skill. What foll

- Strict mode is on; types must be explicit (no implicit `any`).
- Do **not** "fix" an existing `any` by swapping it to `unknown` or adding an `eslint-disable` - replace it with a specific concrete type, and respect an `any` that is intentional.
- No `@ts-ignore` or `@ts-nocheck`. `@ts-expect-error` is permitted in tests only, with a comment.
- No `@ts-ignore` or `@ts-nocheck`. `@ts-expect-error` is permitted in tests only, with a comment; prefer casting the one expression, since the directive suppresses every error on its line.

## Google style guide carve-outs

Four rules from the [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html) digest in the skill do **not** apply here. Do not "fix" code to match them.
Two rules from the [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html) digest in the skill do **not** apply here. Do not "fix" code to match them.

- **Default exports.** Google bans them; this repository uses them for the module kinds listed under Exports above.
- **Filenames.** Google specifies `snake_case`; this repository uses kebab-case directories with PascalCase component files ([`policy/dialog/PolicyDialog.tsx`](../../src/components/policy/dialog/PolicyDialog.tsx)).
- **Underscore prefixes.** Google bans `_` on identifiers. Here they are required on intentionally unused bindings, because [`eslint.config.js`](../../eslint.config.js) sets `no-unused-vars` with `argsIgnorePattern: '^_'` and `varsIgnorePattern: '^_'`.

Two more are where projects commonly diverge from Google, and this repository follows Google on both:

- **Underscore prefixes.** Google allows a `_` prefix only to mark an unused, syntactically required identifier, and bans one that marks a member private. Here the prefix is required on intentionally unused bindings, because [`eslint.config.js`](../../eslint.config.js) sets `no-unused-vars` with `argsIgnorePattern: '^_'` and `varsIgnorePattern: '^_'`.
- **Return-type annotations.** Optional, as Google leaves them. Add one where a complex return benefits.

## Toolchain
Expand Down
9 changes: 5 additions & 4 deletions .claude/rules/docs-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ When creating or editing any markdown file, follow the discipline below. These a
- **Prove it.** Before writing any technical claim, know the exact file (and ideally lines) that prove it. If you can't, don't write it. Silence beats speculation: no "appears to", "should", "will", or planned/intended behaviour.
- Fix existing statements that contradict the code.
- **Cut a comment by whole sentences, above the public floor.** Never delete or cut below one sentence the documentation comment on a public or exported symbol, a public structure member, or a package or module. Keep the sentence saying what it does, even where it restates the name, code, or syntax; where unclear, keep the first sentence. Correct a wrong or absent-content claim from the body. If the body was not read, keep the comment and report it. Cut other sentences that restate code, re-describe documented members, or narrate alternatives or reasoning where the code needs only the conclusion, keeping every other sentence word for word. A package or file comment says what the unit is for and never tours its members.
- **Current state only.** Describe the code as it is now, in prose and in comments alike. Never narrate the past ("replaces", "used to", "formerly", "for the first time", "unlike the old") and never name a file, flag, or tool that no longer exists. Future intent lives in a `TODO` in the code, never in the documentation. Name the code a comment describes (a line, a block, the function, or the file); a comment giving the reason the code is written as it is passes. Where no code corresponds, correct the comment to the current fact it carries, and delete it only when none remains. An existing comment, public or private, is kept unless it is commented-out code, every sentence restates the code beneath it, or it narrates a change stating no current fact; a verbose one is tightened by whole sentences, keeping its summary and every reason, constraint, or warning, and trimming happens only inside the requested scope. A note about a deliberate omission the code depends on and a file header pass this test. An architectural or cross-cutting decision goes in a decision record of its own under [`docs/`](../../docs/index.md). The reason a particular piece of code is written as it is stays in a comment beside that code.
- **Current state only.** Describe the code as it is now, in prose and in comments alike. Never narrate the past ("replaces", "used to", "formerly", "for the first time", "unlike the old") and never name a file, flag, or tool that no longer exists. Future intent lives in a `TODO` in the code, never in the documentation. Name the code a comment describes (a line, a block, the function, or the file); a comment giving the reason the code is written as it is passes. Where no code corresponds, correct the comment to the current fact it carries, and delete it only when none remains. An existing comment, public or private, is kept unless it is commented-out code, every sentence restates the code beneath it, or it narrates a change stating no current fact; a verbose one is tightened by whole sentences, keeping its summary and every reason, constraint, or warning that no other kept sentence gives while cutting its history and the alternatives not taken, and trimming happens only inside the requested scope. A note about a deliberate omission the code depends on and a file header pass this test. An architectural or cross-cutting decision goes in a decision record of its own under [`docs/`](../../docs/index.md). The reason a particular piece of code is written as it is stays in a comment beside that code.

## Style

- **No em-dashes or en-dashes.** Never write `—` (em-dash) or `–` (en-dash); replace each with a comma, parenthesis, colon, separate sentence, or a spaced hyphen `-`. The hyphen `-` is fine wherever it is grammatically correct, including the `-` separator between a label and a brief description in lists. When you edit a markdown file, replace its existing em-dashes and en-dashes too.
- **Canadian English (strong preference)** for prose you write or change: colour, behaviour, favour, centre, defence, and `-ize`/`-ization` (standardize, organization). See the [Canadian spelling guide](https://our-languages.canada.ca/en/blogue-blog/canadian-spelling-eng). Don't retroactively convert existing prose, and never change code identifiers, config/JSON keys, quoted code, file/package names, or CSS properties (`background_color`, `themeColor`).
- **No subjective adjectives** in new prose (important, critical, robust, seamless, powerful, efficient, etc.). State facts. Objective is not robotic, though: replace the adjective with the concrete cited fact that earns it (show, don't tell).
- Use prose for reasoning (the _why_ and _how the system uses it_), not line-by-line narration; reserve bullets and numbered lists for genuine enumerations (steps, options, fields). Don't force explanation into parallel bullet fragments, and don't de-list a real list. Lead each paragraph with its point.
- **Voice (new or changed prose only).** Read as a careful human wrote it: lead with the point, vary sentence length where natural, and cut AI tells (signposting previews, puffery copulas like "serves as" / "is a testament to", rule-of-three by default, filler transitions, formulaic conclusions). Stay formal and neutral (no contractions). Full list and scope: the **Voice** section of [`audit-docs.prompt.md`](../../.github/prompts/audit-docs.prompt.md), with worked before-and-after pairs in [`voice-and-ai-tells.md`](../skills/audit-docs/references/voice-and-ai-tells.md).
- **Voice (new or changed prose only).** Write plain, formal English for a developer reading once: complete, grammatical sentences with one idea each, ordinary pronouns and transitions where the meaning is clear, and the point first. State what the code does, and write a consequence or scenario only where code, a test, or a document states it. Stop when the facts stop: no announcing sentences, closing summaries, or adjectives without the fact that earns them. Stay formal (no contractions). Worked examples of the target style are in [`voice-and-ai-tells.md`](../skills/audit-docs/references/voice-and-ai-tells.md).
- Document a tunable value by the **name a consumer changes it by** (env var, config key, CLI flag, or a named member of a centralized constants/config module that other code reads), judging by role, not location. Don't document an ephemeral local variable as the config surface.
- **Acronyms** in prose you write or edit use capitals (ID, URL) and are expanded on first use per doc ("Deoxyribonucleic acid (DNA)"). Keep exact casing for brand/tool/package names (npm, iOS), domain terms (snRNA), and direct code references (an `id` field).
- No placeholders, TODOs, or empty "add details here" sections.
- **Two readers, one document.** Every page is read by a newcomer meeting the system for the first time and by someone who already works in it, and serving only the second is the ordinary failure. Serve both on one page, by order rather than by splitting it between them: what the subject is and why a reader would reach for it, what that reader must already have or have read, then the depth in full. A page only its author can follow is not finished, and neither is one whose reader could have got it faster from the source. A page that grows too long as a whole is tightened in place; see the next bullet.
- **Two readers, one document.** Every page is read by a newcomer meeting the system for the first time and by someone who already works in it, and serving only the second is the ordinary failure. Serve both on one page, by order rather than by splitting it between them: what the subject is and why a reader would reach for it, what that reader must already have or have read, then the detail. A page only its author can follow is not finished, and neither is one whose reader could have got it faster from the source. A page that grows too long as a whole is tightened in place; see the next bullet.
- **Keep it short.** Match the length to what the change needs: cover the substance, with no filler sections, repeated summaries, or boilerplate. Edit the sentence a change made false before adding one. Never cut a definition, a unit, or a condition to save words; cut whole passages instead.
- **Brevity is measured too, not only whether each paragraph earns its place.** Judge the whole document: would a careful human asked to write the same brief have produced something shorter? Tighten a long page in place by removing what it repeats, and propose any split, move, or rename to the user rather than making it. This is a judgement call, not a word or line count, worked through in [`writing-for-both-readers.md`](../skills/audit-docs/references/writing-for-both-readers.md#document-length-as-a-whole).
- **Complement a passage that stays long, rather than only cutting it.** Where a passage you write survives the trim above because the subject needs it, consider whether a Mermaid diagram (never defaulting to `flowchart`, chosen per [`diagram-and-image-accessibility.md`](../skills/audit-docs/references/diagram-and-image-accessibility.md#choosing-the-mermaid-diagram-type)), a table, a code/config snippet, or an image would let a reader absorb it faster than prose alone. Weigh this more heavily as the passage grows longer.
- **A diagram, table, or snippet can replace a long passage.** Where a passage stays long because the subject needs it, consider whether a Mermaid diagram (never defaulting to `flowchart`, chosen per [`diagram-and-image-accessibility.md`](../skills/audit-docs/references/diagram-and-image-accessibility.md#choosing-the-mermaid-diagram-type)), a table, a code/config snippet, or an image would replace prose and shorten the page. Add one only where it does.
- **Introduce every term of art where the document first uses it**, in a short parenthesis or by a link to the document that defines it, then use it unchanged. Expanding an acronym is not introducing it, since the expansion is often as opaque as the abbreviation. Spell a concept one way across [`docs/`](../../docs/index.md): a concept spelled three ways is three concepts to anyone meeting it, and it defeats their search.
- A document opens with a single H1 named for its file, then a one to three sentence introduction for a reader who does not yet know the subject, then H2s. Headings are unique and fully descriptive ("Retry backoff limits", not "Limits"), because anchors are generated from them, and use sentence case.
- **Tables only for uniform data scanned quickly.** If columns repeat across rows, cells sit empty, or a cell holds a sentence of prose, use a list instead.
Expand Down
2 changes: 1 addition & 1 deletion .claude/rules/prompt-skill-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Whichever half someone takes is the only thing they get. Four rules follow.

An illustrative link, such as `[config.py](../src/config.py)` inside an example teaching the citation format, is not a real link and is allowed. The test is whether the target exists here: if it does, the author linked to something real and it will break.

`make -f .claude/Makefile check-skills` enforces every rule in this section, plus the specification itself: `name` matching the directory, `description` within its character limit, a body under 500 lines, every Markdown file in a skill within 39,000 bytes, so that one Codex read of 40,000 bytes returns all of it, a licence on every skill, and every bundled path resolving inside the skill directory. It also gives each prompt a character budget: 36,000 for [`audit-docs.prompt.md`](../../.github/prompts/audit-docs.prompt.md), whose subject is narrower, and 52,000 for the other two. A skill can move detail into `references/`; a prompt is one file a reader scrolls, so its budget is the whole of what it can say. **Growth past a budget is a signal to condense, never to raise it.** What a prompt loses first is a rule restated across sections and a worked example following the rule it illustrates, and never a rule, a checklist item, or a category.
`make -f .claude/Makefile check-skills` enforces every rule in this section, plus the specification itself: `name` matching the directory, `description` within its character limit, a body under 500 lines, every Markdown file in a skill within 39,000 bytes, so that one Codex read of 40,000 bytes returns all of it, a licence on every skill, and every bundled path resolving inside the skill directory. It holds each skill to the [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) a machine can decide: every file in `references/` and `assets/` linked from `SKILL.md` itself, a table of contents on every bundled Markdown file over 100 lines, a third-person `description` with no XML tag, a `name` free of the reserved words `anthropic` and `claude`, and no backslash in a file path. It also gives each prompt a character budget: 36,000 for [`audit-docs.prompt.md`](../../.github/prompts/audit-docs.prompt.md), whose subject is narrower, and 52,000 for the other two. A skill can move detail into `references/`; a prompt is one file a reader scrolls, so its budget is the whole of what it can say. **Growth past a budget is a signal to condense, never to raise it.** What a prompt loses first is a rule restated across sections and a worked example following the rule it illustrates, and never a rule, a checklist item, or a category.

**Characters, because a line here is a paragraph.** `MD013` is off repository-wide and Prettier leaves prose unwrapped, so a single line runs to seventeen hundred characters. A line budget charges a prompt for its blank lines and its headings and lets it pay by deleting them, which makes the document harder to read while the number improves and nothing is condensed at all. Characters do not move when a file is reformatted, so the only way down is to cut what the prompt says. It is deliberately **not** part of `npm run validate`, because the repository must build, test, and lint with no agent tooling present.

Expand Down
Loading
Loading