docs: adopt PaperMoon styleguide via AGENTS.md + Vale lint#1678
Conversation
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.
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).
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.
eshaben
left a comment
There was a problem hiding this comment.
This looks fine to me, but the part I am concerned about is that it runs automatically on every PR, and whenever subsequent commits are made to an open PR.
For a trip down memory lane, this was back when we used Vale before: #38 - 25 comments first round, 11 2nd round, 6 3rd round, 1 4th round... a comment about false positives.
Maybe it's more practical to use it now since the scope is a bit more limited, but fair warning that it generates a lot of noise, and previously the benefit wasn't worth it 🤷♀️
I'll approve it, but I think @nhussein11 if you're not fully aware of this, please check it out. I'll leave it up to you guys to decide if you want to go down this road again or maybe even consider taking a different approach on when and how frequently it runs... whatever you guys think.
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.
…/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.
|
@eshaben thanks for the history — that #38 thread (25 → 11 → 6 → 1 comments + false-positive fatigue) is exactly the failure mode to avoid. I've tuned this run specifically so it doesn't repeat it: Why this shouldn't be a #38 redux:
Changes I just pushed to address the "when/how often it runs" concern:
So it's now an advisory signal authors can glance at, not a gate. Happy to dial it further (warning-only level, manual trigger, etc.) — leaving the final call to you and @nhussein11 as you suggested. |
polkadot-docs now ships an AGENTS.md (coding-agent styleguide instructions, see polkadot-developers/polkadot-docs#1678). Without this it would be published at docs.polkadot.com/AGENTS.md. Exclude it like README/LICENSE.
Summary
Pilot adoption of the agent-loadable PaperMoon documentation styleguide, so coding agents (Claude Code, Cursor, Codex, etc.) authoring documentation in this repo apply the PaperMoon rules during generation instead of waiting for reviewers to flag them.
Styleguide source (public): papermoonio/documentation-style-guide#6.
Why
Across recent AI-assisted documentation PRs in this repo, the same reviewer corrections kept recurring:
stakingRcClient.purge_keys, herepurgeKeys. Worth usingpurgeKeyseverywhere").<filename>-<number>.webpconvention (e.g., Add Bulletin Chain data storage reference and tutorial #1575 CHANGES_REQUESTED).These all map to rules in the PaperMoon styleguide — they recur because the styleguide has no in-repo presence agents can load.
Architecture — single source of truth
PaperMoon's Vale rules and vocab are not copied into this repo. They are pulled from
papermoonio/documentation-style-guideon every CI run, and on demand for local linting.styles/PaperMoon/*.yml) and the PaperMoon vocab (styles/config/vocabularies/PaperMoon/)scripts/sync-styleguide-vale.shclones the repo and copies the files into localstyles/. The synced directories are gitignored — never committed back.styles/config/vocabularies/Polkadot/).vale.ini, project notes inAGENTS.md).github/workflows/vale.yml)How it changes the authoring workflow
Before: agents author docs with no PaperMoon context. Reviewers manually catch the recurring patterns. Same corrections appear on every PR.
After:
AGENTS.mdat session start, load the canonical rules from the styleguide repo, apply them at generation time.Local dev
Re-run the sync script any time the canonical styleguide updates.
Spelling is intentionally disabled
Vale.Spelling(Hunspell) is turned off in.vale.ini(Vale.Spelling = NO). This PR enforces house style — list punctuation, bold usage, backticks, casing, image filenames — not spelling. The spell-checker arrived for free with the baseValestyle and, on a deeply technical docs repo, flags an endless tail of valid tool and package names (npm,dev,toolchain,Turbopack, etc.) with no typo-catching benefit worth the ongoing vocab-curation toil.The curated PaperMoon house-style rules plus
Vale.RepetitionandVale.Termsremain enabled. Tradeoff: genuine typos in prose are no longer caught by Vale and rely on review.