Skip to content

docs: adopt PaperMoon styleguide via AGENTS.md + Vale lint#1678

Merged
brunopgalvao merged 5 commits into
masterfrom
adopt-papermoon-agents-md
Jun 2, 2026
Merged

docs: adopt PaperMoon styleguide via AGENTS.md + Vale lint#1678
brunopgalvao merged 5 commits into
masterfrom
adopt-papermoon-agents-md

Conversation

@brunopgalvao
Copy link
Copy Markdown
Contributor

@brunopgalvao brunopgalvao commented May 15, 2026

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:

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-guide on every CI run, and on demand for local linting.

Layer Lives in How it gets here
PaperMoon house-style rules (styles/PaperMoon/*.yml) and the PaperMoon vocab (styles/config/vocabularies/PaperMoon/) The canonical styleguide repo (single source of truth) scripts/sync-styleguide-vale.sh clones the repo and copies the files into local styles/. The synced directories are gitignored — never committed back.
Project-specific Polkadot vocab (styles/config/vocabularies/Polkadot/) This repo Committed normally. Contains ecosystem terms the canonical vocab intentionally does not carry (Polkadot, Kusama, Paseo, parachain, collator, XCM, etc.).
Project-specific config / overrides (.vale.ini, project notes in AGENTS.md) This repo Committed normally.
CI runner (.github/workflows/vale.yml) This repo Runs the sync step first, then Vale on changed markdown files via reviewdog.

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 read AGENTS.md at session start, load the canonical rules from the styleguide repo, apply them at generation time.
  • Vale CI catches anything the agent missed before review. The lint rules always reflect the latest canonical styleguide — no manual sync.
  • Reviewers focus on technical accuracy instead of formatting friction.

Local dev

./scripts/sync-styleguide-vale.sh   # pull canonical rules + vocab
vale .                              # lint

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 base Vale style 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.Repetition and Vale.Terms remain enabled. Tradeoff: genuine typos in prose are no longer caught by Vale and rely on review.

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.
@brunopgalvao brunopgalvao marked this pull request as ready for review May 26, 2026 02:17
@brunopgalvao brunopgalvao requested a review from a team as a code owner May 26, 2026 02:17
@brunopgalvao brunopgalvao requested a review from eshaben May 26, 2026 02:17
@brunopgalvao brunopgalvao added the B0 - Needs Review Pull request is ready for review label May 26, 2026
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.

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.

Comment thread .github/scripts/sync-styleguide-vale.sh
Comment thread AGENTS.md
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.
@brunopgalvao
Copy link
Copy Markdown
Contributor Author

@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:

  • filter_mode: added — Vale only annotates lines added in the diff, never pre-existing prose. The "25 comments on old text" problem can't occur.
  • It lints only changed *.md files, not the whole repo.
  • Vale.Spelling is now disabled — that was the single biggest false-positive source (it was flagging valid terms like npm, toolchain, Turbopack). What's left is a small curated house-style rule set (lists, bold, backticks, casing, link text, etc.).

Changes I just pushed to address the "when/how often it runs" concern:

  • Non-blocking: fail_on_error: false — Vale never blocks merge.
  • Checks tab, not inline: reporter: github-pr-check — findings show as a check run, not inline review comments. No comment spam.
  • Kept per-commit runs on purpose: if it only ran on open/ready, a contributor who pushes a fix (or adds content after marking ready) would get no updated signal. Since it's now advisory + in the Checks tab, re-running per commit is cheap and keeps the status accurate without adding noise.

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.

@eshaben eshaben added B1 - Ready to Merge Pull request is ready to be merged and removed B0 - Needs Review Pull request is ready for review labels Jun 1, 2026
brunopgalvao added a commit to papermoonio/polkadot-mkdocs that referenced this pull request Jun 2, 2026
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.
@brunopgalvao brunopgalvao merged commit 1c65bae into master Jun 2, 2026
10 of 11 checks passed
@brunopgalvao brunopgalvao deleted the adopt-papermoon-agents-md branch June 2, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B1 - Ready to Merge Pull request is ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants