Skip to content

Align style guide with AI-assisted authoring workflow#6

Merged
eshaben merged 6 commits into
mainfrom
ai-aligned-styleguide
May 25, 2026
Merged

Align style guide with AI-assisted authoring workflow#6
eshaben merged 6 commits into
mainfrom
ai-aligned-styleguide

Conversation

@brunopgalvao
Copy link
Copy Markdown
Contributor

@brunopgalvao brunopgalvao commented May 13, 2026

Summary

This is a draft that rewrites the PaperMoon style guide so it's loadable, enforceable, and unambiguous for AI-assisted authoring workflows — and reduces the manual review friction the team has been seeing on AI-generated PRs.

The intent is to keep the existing substance, make ambiguous rules concrete, fold in the patterns reviewers actually flag, and ship an agent-loadable companion plus a mechanical lint layer.

Keep / drop / add

Keep + improve — every existing section survives. High-friction sections were rewritten with explicit Do: / Don't: example pairs:

  • List Formatting — collapses the punctuation rule to one decision ("full sentences → period, fragments → no period; all items in a list must match"), with a worked example showing both correct forms and a wrong-mixed form.
  • Bold — adds explicit Don't examples for emphasis-bolding in prose; clarifies bold is only for UI elements and description-list terms.
  • Terminology — promoted to a table; TestNet / MainNet (previously only in the checklist) moved into the style guide proper.
  • Links — splits the {target=\_blank} rule into external vs. same-page-internal, with examples.
  • Punctuation — adds an Em Dash / En Dash subsection (currently silent in the guide; common reviewer correction).
  • Symbols — explicitly bans / / 🟢 / 🔴 / ⚠️ markers; standardizes on text Do: / Don't: labels.

Drop

  • The 🟢 / 🔴 emoji markers in the existing variable-conventions examples — replaced with text labels, since the guide itself forbids emojis.

Add (data-driven from your last two months of PR reviews on polkadot-developers/polkadot-docs):

  • AGENTS.md — agent-loadable, rule-first companion. Coding agents auto-load AGENTS.md from a repo root, so downstream docs repos that reference it get the rules applied on every authoring session. Vendor-neutral; not coupled to any specific tool.
  • Banned Phrases table — explicit list of filler and LLM clichés (delve, leverage, seamless, robust, it's important to note, simply, currently, etc., and the rest).
  • Code Identifiers in Prose — every function, method, type, pallet, module, variable, parameter, and file path reference must be in backticks, on every mention. (Recurring inline-review correction: 0xlukem on #1586: "StakingOperator, it should be in backticks here?")
  • Identifier Consistency Within a Document — pick one form for an identifier / role and use it everywhere. (sigurpol on #1586: "at line 90 you are using stakingRcClient.purge_keys, here purgeKeys. Worth using purgeKeys everywhere.")
  • Image File Naming<topic>-<number>.webp rule made explicit. (eshaben CHANGES_REQUESTED on #1575: "the images aren't using the correct format. They should be <filename>-<number>.webp. This helps us when we do reorgs.")
  • No redundant subheadings above lead-in lists — agents often insert a ### directly above a list that's already introduced by a sentence ending in :. Reviewers strip them. (nhussein11 on #1575.)
  • Description-list bullets must not mix with free-form bullets — agents often start a list in **Term**: Description. form and drift back to plain bullets. (eshaben on #1575: "Pls update rest of list items to use this same format.")
  • Contractions guidance — currently silent.
  • .vale.ini + styles/PaperMoon/ — starter Vale config covering banned phrases (hard ban + discouraged), terminology substitutions (ERC-20, JSON-RPC, dApp, TestNet, MainNet), emoji ban, first-person plural, link text, placeholder format, and an accept-list vocabulary. Lets the high-friction rules be enforced mechanically in CI rather than caught in prose review.

What this is meant to fix

Across the last 21 PRs on polkadot-docs from this author, the recurring inline-review categories were:

  • List punctuation inconsistency (eshaben PR-level on #1575: "Lists for the most part aren't being properly formatted and some unnecessary bold usage.")
  • Unnecessary bold in prose, and missing bold on description-list terms (both directions)
  • Backticks missing on second/third mention of code identifiers
  • Identifier/term drift within a single page
  • Image naming convention misses
  • Subheadings inserted directly above lead-in-sentence lists
  • Mixed description-list and free-form bullet formats in the same list

Every one of those now has either an explicit rule (with Do/Don't example) in the style guide, a corresponding agent-loadable rule in AGENTS.md, or a mechanical Vale check — and most have all three.

Test plan

  • Style guide renders correctly on GitHub (TOC links, tables, code fences). Verified: all 40 TOC anchors resolve to headings, code fences balanced, tables render, GitHub HTML render confirmed.
  • vale . from repo root succeeds against the style guide itself (i.e., the guide doesn't violate its own rules). Verified: exit 0, 0 errors / 0 warnings / 0 suggestions across all linted files (rule-source files excluded as they intentionally contain examples of banned content).
  • At least one downstream docs repo (polkadot-docs) tries adopting AGENTS.md and the Vale config on a single PR as a pilot — see docs: adopt PaperMoon styleguide via AGENTS.md + Vale lint polkadot-developers/polkadot-docs#1678 (draft): adds AGENTS.md pointing here, .vale.ini + styles/PaperMoon/, and a changed-files-scoped Vale CI workflow.
  • Authoring-agent dry run: open a small docs change with an AI coding agent in the downstream repo and confirm fewer of the recurring reviewer corrections appear. Pilot is infrastructure-only; this is a forward-looking measurement to confirm on the next authoring PR against the historical baseline.

Note: absorbs 5 rules from the orchestrator (single-source consolidation)

The latest commit adds five PaperMoon house conventions that previously lived only in a downstream agent's inline style mirror: supermajority spelling, define-acronyms-on-first-use, hyphenated-identifier / runtime-network-profile casing (e.g. paseo-next), the "step label ending in a colon counts as punctuated" list nuance, and extending the rocket-emoji (🚀) prohibition to banners/UI for blockchain projects. Centralizing them here lets that downstream mirror be deleted entirely, so these rules have exactly one home. Added to both AGENTS.md and style-guide.md; vale . still passes clean.

Marking draft so the team can iterate on rule wording, lint severities, and the AGENTS.md convention before merging.

- Add AGENTS.md as the machine-readable companion to style-guide.md; coding
  agents auto-load it on session start.
- Rewrite list-formatting, bold, headings, terminology, and link sections
  in style-guide.md with explicit Do/Don't pairs and a one-rule decision
  for list-item punctuation.
- Add new subsections derived from recurring inline-review patterns in
  recent polkadot-docs PRs: Code Identifiers in Prose, Identifier
  Consistency Within a Document, Image File Naming, and a "no redundant
  subheadings above lead-in lists" rule.
- Add explicit Banned Phrases table covering filler and LLM clichés
  (delve, leverage, seamless, robust, "it's important to note", etc.).
- Add Em Dash / En Dash and Contractions guidance.
- Replace the existing 🟢/🔴 example markers with text labels, since the
  guide bans emojis.
- Add .vale.ini and a starter styles/PaperMoon/ rule set so the
  high-friction rules (banned phrases, terminology, emojis, link text,
  placeholders) are enforced mechanically.
- Update README.md and checklist.md to point at the new files and add
  review-derived checklist items.
Three follow-up fixes after running `vale .` from repo root:

- Add `Vocab = PaperMoon` as a core directive (must be above any
  syntax-specific section per Vale's parser). Without this the vocab
  file at styles/config/vocabularies/PaperMoon/accept.txt was never
  loaded, so Vale's built-in spelling rule flagged domain words.

- Exclude AGENTS.md, style-guide.md, and checklist.md from style
  checks. They describe the rules and intentionally contain examples
  of banned content (e.g., the Banned Phrases table lists the words
  the rule bans). Subjecting them to their own rules is circular.

- Drop `Packages = Google` from the default config and document how to
  re-enable. Keeps the lint offline-runnable; teams can opt back in by
  adding the package and running `vale sync`.

- Extend the PaperMoon accept vocab with common technical terms
  (repo, MkDocs, devcontainer, linter, etc.) that Vale's built-in
  spelling check otherwise flags.

`vale .` from repo root now exits 0 with no errors, warnings, or
suggestions across all linted files.
These conventions previously lived only in the agentic-docs-writers
style-enforcer mirror. Upstreaming them here so that mirror can be
deleted without losing any rule (single source of truth):

- supermajority spelling (one word).
- Define every acronym on first use in each article.
- Hyphenated identifiers and runtime/network profile names
  (paseo-next, westend-next) keep canonical casing on every mention;
  rephrase rather than capitalize at sentence start.
- A numbered step label ending in a colon already counts as
  punctuated — no trailing period.
- Rocket emoji (🚀) prohibition extended to HTML templates/banners/UI
  for blockchain projects (speculative-hype brand nuance).

Added to both AGENTS.md and style-guide.md. vale . passes clean.
@brunopgalvao brunopgalvao requested a review from eshaben May 18, 2026 09:52
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread checklist.md Outdated
Comment thread checklist.md Outdated
Comment thread checklist.md Outdated
Comment thread README.md Outdated
Comment thread style-guide.md
Inline review on AGENTS.md, with the same changes mirrored into
style-guide.md, checklist.md, and README.md per the reviewer's note
("apply previous comments here too"):

List item punctuation (AGENTS.md:30)
- Rewrite rule 1 to follow the Google developer documentation style
  guide explicitly: single-word, verbless, code-font, and link-text
  items take no end punctuation; mixed lists must be rewritten for
  parallel construction or all-punctuated for consistency.
- Add description-list capitalization: capitalize both the term and
  the first letter of the description.

Bold for emphasis (AGENTS.md:68)
- Allow italics for emphasis (consistent with style-guide.md Italics
  section). Stronger callouts use an admonition.

Em dash / Links (AGENTS.md:158-159, 164)
- Drop the manual `{target=\_blank}` instruction — the MkDocs plugin
  handles it automatically. Strip the attribute from all in-repo
  examples; note the plugin in its place.

Contractions (AGENTS.md:170)
- Switch all `Don't:` comparison labels to `Do not:` so the style
  guide practices what it preaches on the no-contractions rule.

Conceptual heading rule (AGENTS.md:102)
- Left as-is per reviewer's "this one is fine".

Terminology — runtime/network profile names (AGENTS.md:198)
- Distinguish identifier usage (backticked, canonical casing:
  `paseo-next`, `westend-next`) from prose mention of the same
  network (title case, no backticks: "Paseo Next", "Westend Next").

Image file naming (AGENTS.md:251, 312; checklist.md:53; style-guide.md)
- Rename pattern from `<topic>-<number>.webp` to
  `<filename>-<number>.webp`.

Pre-output checklist target_blank (AGENTS.md:304)
- Drop the manual `target=_blank` check; note the plugin handles it.

Alt text (AGENTS.md:312)
- Allow empty `alt=""` for purely decorative images per Google's
  guidance. Keep non-empty alt required for informative images.

checklist.md
- Strip bold-for-emphasis from the intro line (line 5) — italics
  instead.
- Replace the bold-emphasis check with guidance to use italics or
  an admonition.
- Drop the manual target_blank instruction; remove the attribute
  from the recommended/not-recommended link examples.

README.md
- Reformat the Files list as proper description-list bullets
  (`**Term**: Description.`) with capitalized descriptions.

`vale .` exits 0 clean.
@brunopgalvao
Copy link
Copy Markdown
Contributor Author

Addressed the inline review in c0b23d1. Per your note on style-guide.md:1 to apply your comments throughout, the same fixes are mirrored across AGENTS.md, style-guide.md, checklist.md, and README.md.

  • List item punctuation (AGENTS.md:30): Rewrote rule 1 to follow Google's list rules verbatim — single-word, verbless, code-font, and link-text items take no end punctuation; mixed lists must be rewritten for parallel construction.
  • Description-list capitalization (AGENTS.md:30): Added — both the term and the first letter of the description are now explicitly required to be capitalized.
  • Bold for emphasis (AGENTS.md:68): Now allows italics for emphasis (and admonitions for stronger callouts) instead of "rewrite the sentence". Matches style-guide.md Italics.
  • Conceptual headings (AGENTS.md:102): Left in per your "it's fine" comment.
  • External / internal link target_blank (AGENTS.md:158-159, 164): Scrapped both bullets; replaced with a single note that the MkDocs plugin handles it. Removed {target=\_blank} from every example in this repo.
  • Don't usage contradicting contractions (AGENTS.md:170): Switched every Don't: label to Do not: so the guide practices what it preaches.
  • paseo-next / westend-next (AGENTS.md:198): Split into two rules — backticked canonical-case identifier when used as an identifier, and prose title case ("Paseo Next") when referring to the network in prose.
  • <topic><filename> (AGENTS.md:251, 312; checklist.md:53; style-guide.md): Renamed everywhere.
  • target_blank in pre-output checklist (AGENTS.md:304): Replaced with descriptive-link-text guidance and a plugin note.
  • Alt text decorative exception (AGENTS.md:312): Added per Google's guidance — empty alt="" is allowed for purely decorative images; non-empty required for informative ones.
  • checklist.md:5 bold-for-emphasis: Switched to italics.
  • checklist.md:46 italics + admonitions: Updated to recommend italics for emphasis or an admonition for stronger callouts.
  • README.md list formatting: Reformatted as proper description-list bullets (**Term**: Description.).

vale . exits 0 clean against the new content.

@eshaben
Copy link
Copy Markdown
Collaborator

eshaben commented May 20, 2026

Cool, looks good on my end. Let me know when it gets kicked out of draft mode

@brunopgalvao brunopgalvao marked this pull request as ready for review May 20, 2026 04:42
@brunopgalvao
Copy link
Copy Markdown
Contributor Author

brunopgalvao commented May 20, 2026

Cool, looks good on my end. Let me know when it gets kicked out of draft mode

Thank you @eshaben - it is out of draft now.

Copy link
Copy Markdown
Collaborator

@eshaben eshaben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the vale configs belong in this repo as they're quite polkadot specific. But you can make adjustments later if needed.

eshaben approved the PR with the note that the configs felt
Polkadot-specific. PaperMoon's style guide serves multiple customers,
so the canonical repo should not carry one ecosystem's product names
or pallet identifiers. This commit makes everything customer-agnostic;
no rule changes, only example substitutions.

Vale vocab (styles/config/vocabularies/PaperMoon/accept.txt)
- Remove customer-specific product/protocol names: Polkadot, Kusama,
  Moonbeam, Moonriver, Moonbase, parachain, parachains, relay chain,
  Substrate. Each customer's own docs repo can extend the vocab with
  its ecosystem terms; the canonical accept list stays cross-cutting
  (dApp, TestNet, MainNet, JSON-RPC, Web3, EVM, WASM, etc.).

AGENTS.md
- Link examples now reference a generic "project's faucet" at
  example.com instead of the Moonbase Alpha faucet.
- Rule 11 (hyphenated identifiers) drops the runtime/network profile
  framing and the `paseo-next` / `westend-next` examples; the rule
  itself is the same (identifier-form vs prose-form), just framed
  generically.
- Oxford comma example: "red, white, and blue" instead of
  "Polkadot, Kusama, and Moonbeam".
- Code identifier examples switch from `session.purgeKeys`,
  `StakingOperator`, "staker"/"validator"/"stash" to
  `auth.getUserId`, `RoleManager`, "author"/"editor"/"writer".
- Image filename examples: `dashboard-overview-01.webp`,
  `user-permissions-01.webp` instead of `key-management-01.webp`,
  `staking-operator-proxy-01.webp`.

style-guide.md
- Same neutralization, mirrored.

checklist.md
- Recommended/not-recommended link examples use a generic faucet URL
  and prose.
- Identifier consistency examples switch to `getUserId` /
  `get_user_id` and author/editor/writer.

vale . exits 0 clean.
@brunopgalvao
Copy link
Copy Markdown
Contributor Author

Good catch on the Polkadot-flavored content — neutralized in 08a1a5a:

  • Vale vocab: dropped Polkadot/Kusama/Moonbeam/Moonriver/Moonbase/Substrate/parachain/relay chain. The accept list is now cross-cutting only (dApp, TestNet, MainNet, JSON-RPC, Web3, EVM, WASM, etc.). Each customer's own repo can extend the vocab with its ecosystem terms.
  • Examples throughout AGENTS.md / style-guide.md / checklist.md: Moonbase Alpha faucet → generic project faucet at example.com; session.purgeKeys / StakingOperator / staker-validator-stash → auth.getUserId / RoleManager / author-editor-writer; paseo-next / westend-next → generic hyphenated identifier wording (rule itself unchanged); Oxford-comma example "red, white, and blue"; image filenames dashboard-overview-01.webp / user-permissions-01.webp.

No rule changes — only example substitutions. vale . still clean.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread checklist.md Outdated
Comment thread style-guide.md Outdated
The MkDocs plugin handles new-tab behavior automatically — calling it
out in the style guide, AGENTS.md, and the checklist is internal tooling
noise rather than house style. Removes the rule from all four spots
flagged in review.
@eshaben eshaben merged commit 47cc6e7 into main May 25, 2026
@eshaben eshaben deleted the ai-aligned-styleguide branch May 25, 2026 18:07
brunopgalvao added a commit to polkadot-developers/polkadot-docs that referenced this pull request May 26, 2026
papermoonio/documentation-style-guide#6 dropped the manual
{target=\_blank} rule after review (the MkDocs plugin handles
opening external links in a new tab automatically). The
project-specific override in this file still said it was
"enforced", which now contradicts canonical. Update to mirror
the canonical guidance: the plugin handles it, do not add manually.
brunopgalvao added a commit to polkadot-developers/polkadot-docs that referenced this pull request Jun 2, 2026
* docs: adopt PaperMoon styleguide via AGENTS.md + Vale lint

Pilot adoption of the agent-loadable PaperMoon documentation styleguide:

- AGENTS.md at repo root pointing at the canonical
  papermoonio/documentation-style-guide/AGENTS.md. Coding agents
  (Claude Code, Cursor, Codex, etc.) load AGENTS.md automatically when
  they open this repository, so authoring sessions pick up the
  documentation rules without manual context wiring.

- .vale.ini and styles/PaperMoon/ mirroring the styleguide repo's
  Vale rules: banned phrases (delve, leverage, seamless, robust,
  "it's important to note", "in summary", "currently", etc., simply,
  just, easily, obviously), terminology substitutions (ERC-20,
  JSON-RPC, dApp, TestNet, MainNet), emoji ban, descriptive link
  text, INSERT_ placeholder format, first-person plural warning, and
  the no-exclamation rule. Vocab accept-list seeds Polkadot-specific
  terms.

- .github/workflows/vale.yml runs Vale on changed markdown files in
  every PR. Scoped to added/modified .md files only (not the full
  tree) so existing tech debt does not fail the workflow; the gate
  applies to net-new content.

Refresh process: when the styleguide repo updates, copy .vale.ini and
styles/ over again. The pointer in AGENTS.md always resolves to the
latest canonical source.

* Pull Vale rules from canonical styleguide at CI time

Eliminates the duplicated rule files this PR previously carried:
styles/PaperMoon/*.yml and styles/config/vocabularies/PaperMoon/accept.txt
were copies of the canonical files in papermoonio/documentation-style-guide,
so the lint rules drifted any time the canonical updated.

Architecture now:

- scripts/sync-styleguide-vale.sh clones the styleguide repo and copies
  styles/PaperMoon/ and the PaperMoon vocab into local styles/ before
  linting. Run it locally before `vale .`; CI runs it automatically.
- .gitignore excludes the synced directories so they are never committed.
- styles/config/vocabularies/Polkadot/accept.txt holds the project's
  own vocab (Polkadot, Kusama, Paseo, parachain, etc.) — these are
  ecosystem-specific terms that the canonical PaperMoon vocab
  intentionally does not carry.
- .vale.ini now loads both vocabs (Vocab = PaperMoon, Polkadot) and
  references the synced styles directory.
- .github/workflows/vale.yml adds a sync step before invoking Vale.

Result: the canonical PaperMoon styleguide repo is the only place
PaperMoon lint rules live. polkadot-docs carries only what is
genuinely project-specific (Polkadot vocab, project overrides,
the CI workflow).

* Align target=_blank guidance with updated canonical styleguide

papermoonio/documentation-style-guide#6 dropped the manual
{target=\_blank} rule after review (the MkDocs plugin handles
opening external links in a new tab automatically). The
project-specific override in this file still said it was
"enforced", which now contradicts canonical. Update to mirror
the canonical guidance: the plugin handles it, do not add manually.

* Disable Vale.Spelling; enforce house style only

The spell-checker arrived with the base Vale style and flags an endless
tail of valid tool/package names on a technical docs repo with no
typo-catching benefit worth the vocab-curation toil. Keep the curated
PaperMoon house-style rules plus Vale.Repetition and Vale.Terms.

* Address review: non-blocking Vale check + move sync script to .github/scripts

- Vale CI is now advisory (fail_on_error: false, reporter github-pr-check):
  findings surface in the Checks tab instead of blocking merge or posting
  inline review comments. Still reruns on every push so the check status
  tracks the latest commit. Addresses noise concerns from the prior Vale
  run (#38).
- Move sync-styleguide-vale.sh from scripts/ to .github/scripts/ alongside
  the other CI scripts; update all references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants