Skip to content

Add automated style guide#4830

Open
aneta-petrova wants to merge 3 commits into
theforeman:masterfrom
aneta-petrova:ai-contributors
Open

Add automated style guide#4830
aneta-petrova wants to merge 3 commits into
theforeman:masterfrom
aneta-petrova:ai-contributors

Conversation

@aneta-petrova

@aneta-petrova aneta-petrova commented May 8, 2026

Copy link
Copy Markdown
Member

What changes are you introducing?

The main part of this PR is a new doc-Contributing directory. This directory provides a new guide, Contributors' guide, which provides a human-friendly overview of all our contribution resources in a single place.

It's a style guide that is automatically updated based on the latest state of our automation resources: Vale rules and AI skills.

In addition to the new guide, other changes include the following:

  • Splitting off new skills from CONTRIBUTING.md (in order to keep CONTRIBUTING.md minimal). These new skills are validate-contribution and personas.
  • Updating existing skills, but only to make their structure be displayed correctly in the Contributors' guide (for example, consistent naming, expected sections need to be present, etc.)
  • Adding a link to the new guide to docs.theforeman.org.

The new guide is a dedicated style guide for the Foreman Documentation project. It concatenates the following resources:

  • CONTRIBUTING.md (for general information on how to contribute)
  • AI skills (where certain pre-defined sections present in the skill files, namely Overview and Examples get pulled into the style guide in full, and the rest (AI instructions) gets pulled in as collapsible content)
  • Vale rules (where the comments in the Vale .yml files get pulled in as rule descriptions/instructions, and a collapsible definition of the full rule follows)

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

There are so many style resources and guidelines and rules that it's hard for a person to keep up with them. Automation should help us conform to all of these rules, but defining the rules both in a style guide and through automation introduces overhead and the risk of the style guides and automation getting out of sync.

With an automatically built style guide such as this one, we have one source of truth -- the automation-friendly resources -- but still keep a human-friendly guide for easy reference.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

This project is based on the idea that if we want to introduce a new style/contribution rule, we should think in an "automation-first" rule. In its most radical sense, it would mean that if it can't be automated (through an AI skill or a Vale rule etc.), it should not be a contribution rule. And because not everyone's this radical, there's CONTRIBUTING.md for exceptions :)

One of the outcomes should be being able to show the automated style guide next to a regular style guide for comparison. It doesn't have to be a 1:1 match but just to show that the automated style guide can also serve as a style guide for a documentation project.

Contributor checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.18/Katello 4.20 (Satellite 6.19)
  • Foreman 3.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18; orcharhino 7.6, 7.7, and 7.8)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4; orcharhino 7.5)
  • Foreman 3.13/Katello 4.15 (EL9 only)
  • Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • We do not accept PRs for Foreman older than 3.12.

@github-actions github-actions Bot added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

The PR preview for 54d82e3 is available at theforeman-foreman-documentation-preview-pr-4830.surge.sh

The following output files are affected by this PR:

show diff

show diff as HTML

Comment thread .claude/skills/validate-contribution/SKILL.md Outdated
@Lennonka

Lennonka commented May 19, 2026

Copy link
Copy Markdown
Contributor

It would be better to implement this as rules for writing rather than a validation check.

@aneta-petrova aneta-petrova removed Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels May 27, 2026
@aneta-petrova

aneta-petrova commented May 27, 2026

Copy link
Copy Markdown
Member Author

It would be better to implement this as rules for writing rather than a validation check.

Which part? (EDIT: Which part of the PR?)

@Lennonka

Copy link
Copy Markdown
Contributor

Which part? (EDIT: Which part of the PR?)

Actually, I might have misunderstood what you're trying to achieve with this PR. Not sure what that is. Consider my comment premature.

@aneta-petrova aneta-petrova force-pushed the ai-contributors branch 4 times, most recently from 41cc619 to a569878 Compare June 5, 2026 15:34
@aneta-petrova

Copy link
Copy Markdown
Member Author

I'm not ready to switch this to ready for review just yet but if anyone wants to check this PR out, it's at least in a state where it should clearly show the intent: see the PR's description. It's too early for detailed feedback but I wouldn't mind hearing some thoughts on that intent :) I could take them into account as I continue getting this ready for review.

@apinnick

apinnick commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

You could put all the AI guidelines into a single CLAUDE.md file.

@aneta-petrova

Copy link
Copy Markdown
Member Author

You could put all the AI guidelines into a single CLAUDE.md file.

Thanks for the feedback regarding the addition of an AI instructions file! I agree there's real value in providing project-wide context for AI tools, but perhaps there's a fundamental difference in the audiences at play here.

The style guide I'm proposing in this PR is intended for human eyes and writers. An AI configuration file like CLAUDE.md or AGENTS.md is meant to be consumed by machine agents.

Right now, the repository already has excellent automation and contribution resources:

  • Linting: The foreman-documentation Vale style package provides deterministic checks.
  • Modular AI skills: The .claude/ directory already contains several specific AI skills tailored for workflows.
  • CONTRIBUTING.md: Our contributing guidelines, built along the lines of standard GitHub docs files.

There's certainly value in using a root configuration AI file (CLAUDE.md, AGENTS.md). It can serve as a high-level router file pointing AI tools to these existing resources. (Personally, I am using a file like that, but I admit I'm keeping it in my gitignore files to avoid cluttering my PRs.)

Introducing a repo-wide AI file is a great conversation to have, but given that it affects global repository configuration for all contributors and tools, it feels a bit out of scope for this specific PR. It would certainly be interesting to see how other contributors set up their CLAUDE.md or AGENTS.md files :) but perhaps not in a PR that introduces a human-friendly, consolidated way to browse our existing guidelines and project rules.

@apinnick

apinnick commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

You could put all the AI guidelines into a single CLAUDE.md file.

Thanks for the feedback regarding the addition of an AI instructions file! I agree there's real value in providing project-wide context for AI tools, but perhaps there's a fundamental difference in the audiences at play here.

The style guide I'm proposing in this PR is intended for human eyes and writers. An AI configuration file like CLAUDE.md or AGENTS.md is meant to be consumed by machine agents.

CLAUDE.md files are extremely readable because they are in markdown. All the guidelines are in a single place, with sections and TOC.

Our SMEs routinely check the OpenShift sandboxed containers CLAUDE.md file because it is a style guide and a repo guide all in one. It replaces contributors' guidelines and is easier to maintain because we tell Claude to update it. Our writers check their work against the CLAUDE.md file, in addition to the DITA and style Vale checks.

@aneta-petrova aneta-petrova force-pushed the ai-contributors branch 2 times, most recently from 3cd3a69 to 4829624 Compare July 4, 2026 19:27
@aneta-petrova aneta-petrova marked this pull request as ready for review July 4, 2026 19:42
@aneta-petrova

Copy link
Copy Markdown
Member Author

Ready for review now! :)

I updated the PR's description to explain this proposal. I recommend reading both the 'what' and the 'why' parts because this is a big change with some reasoning behind it.

As the last change before switching this to 'ready for review', I also tried to make the styling of the Contributors' guide as close to the styling of the regular guides as possible but I'm afraid there's only so much I can do due to the markdown vs asciidoc differences.

Comment thread web/content/index.adoc.erb Outdated
@Lennonka

Lennonka commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Would you consider converting the resulting MarkDown file to AsciiDoc and using the standard build for HTML output?
I've found this: https://github.com/dohliam/markdoctor

EDIT: Actually, AsciiDoctor has its own MD coverter in Ruby: https://github.com/asciidoctor/kramdown-asciidoc

@aneta-petrova

Copy link
Copy Markdown
Member Author

Thanks for the suggestion, @Lennonka! I can certainly try, I appreciate the hint on how to bring this closer to AsciiDoc. I'll investigate how it could work.

@aneta-petrova aneta-petrova force-pushed the ai-contributors branch 2 times, most recently from e185863 to cbd869a Compare July 9, 2026 10:11
aneta-petrova and others added 3 commits July 9, 2026 16:11
Convert CONTRIBUTING.md to AI skills for contribution validation

Add Contributors' Guide with markdown-based build system

Make tweaks to Vale and AI skills structure

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@aneta-petrova

aneta-petrova commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

The Contributor's Guide is now built using kramdown-asciidoctor rather than plain kramdown. This feels much better because the guide can re-use the common Makefile shared among the other guides rather than configure a separate build system.

The guide has the same build targets as any other guides (foreman-deb, foreman-el, katello, orcharhino, satellite, and the containerized builds) and that's intentional because I didn't want to make things more complex by adding a new, universal build target. The builds are all identical in content. For example: https://theforeman-foreman-documentation-preview-pr-4830.surge.sh/nightly/Contributing/index-katello.html

Ready for another round of review :)

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.

4 participants