Skip to content

Add automated style guide#4830

Draft
aneta-petrova wants to merge 19 commits into
theforeman:masterfrom
aneta-petrova:ai-contributors
Draft

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

Conversation

@aneta-petrova
Copy link
Copy Markdown
Member

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

What changes are you introducing?

Adding a style guide for the project that 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
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

The PR preview for 0609413 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
Copy link
Copy Markdown
Contributor

Lennonka commented May 19, 2026

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
Copy link
Copy Markdown
Member Author

aneta-petrova commented May 27, 2026

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 and others added 4 commits June 5, 2026 12:26
CONTRIBUTING.md is now a symlink to a skill file that serves dual purposes:
- Human-readable contribution guidelines (visible on GitHub)
- AI-invocable validation skill via /validate-contribution

The skill validates and auto-fixes common issues in documentation contributions:
- Trailing whitespace removal
- File naming conventions (con_, proc_, ref_, snip_ prefixes)
- Content type attributes
- Module ID format with {context}
- Hardcoded product names replaced with attributes
- Vale linter integration
- Build verification

Contributors can run /validate-contribution manually to check their changes
before submitting PRs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create a standalone guide at guides/doc-Contributing/ that consolidates
all contribution resources into a single HTML page.

Content included:
- CONTRIBUTING.md (contribution guidelines)
- All documentation skills from .cursor/skills/
  (abstract, heading, prerequisites, refactor-adoc, split-web-ui-cli,
  validate-contribution)
- Project-specific Vale rules from .vale/styles/foreman-documentation/
  (AvoidBrandedTerminology, Capitalization, OneSentencePerLine)

Build system:
- Uses kramdown (Ruby markdown processor) instead of asciidoctor
- Single build (no BUILD context variants like foreman-el, katello, etc.)
- Auto-rebuilds on GitHub when source files change via Makefile dependencies
- Output: guides/build/Contributing/index.html

Files added:
- guides/doc-Contributing/build.rb - Concatenates markdown sources,
  strips YAML frontmatter, converts to HTML
- guides/doc-Contributing/template.html - HTML5 template with responsive
  CSS, TOC sidebar, syntax highlighting
- guides/doc-Contributing/Makefile - Build system with dependency tracking
- guides/doc-Contributing/README.md - Documentation for using the guide

Modified:
- Gemfile - Added kramdown and kramdown-parser-gfm gems
- guides/Makefile - Excluded doc-Contributing from BUILD matrix,
  added separate 'contributing' target

The guide auto-rebuilds in GitHub Actions when CONTRIBUTING.md, skill
files, or Vale rules are modified. No workflow changes needed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Maximilian Kolb <mail@maximilian-kolb.de>
@aneta-petrova aneta-petrova force-pushed the ai-contributors branch 2 times, most recently from 760bd4b to a516e6a Compare June 5, 2026 13:05
aneta-petrova and others added 6 commits June 5, 2026 15:16
- Reorganize skill files with standardized sections:
  - Overview: Human-readable guidelines and definitions
  - Examples: Good/bad examples with explanations
  - Instructions: AI-specific workflow steps
- Update build.rb to extract only Overview and Examples sections
  for the Contributors' Guide
- Change category headings to top-level in the guide
- Fix .claude/skills path (was incorrectly .cursor/skills)
- Update all skills except validate-contribution with new structure:
  abstract, heading, prerequisites, refactor-adoc,
  review-assembly-user-story, split-web-ui-cli

This separates human-facing documentation guidelines from
AI-specific instructions, making the Contributors' Guide more
focused and useful for human contributors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
aneta-petrova and others added 4 commits June 5, 2026 17:20
- Extract YAML comment descriptions as Overview sections for Vale rules
- Update Vale rule descriptions to imperative voice:
  - "Use attributes instead of branded terms"
  - "Use proper capitalization for product names and technical terms"
  - "Write one sentence per line"
- Rename category to "Foreman-documentation custom Vale rules"
- Add skip notification for skills without Overview/Examples sections
- Match formatting style with AI skills section (H1 categories, H2 items)

Vale rules now have the same human-friendly structure as AI skills,
with Overview sections explaining the rules in user-directed language.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Expand Vale rule Overview sections with detailed explanations:
  - AvoidBrandedTerminology: Explain attribute usage for multi-product docs
  - Capitalization: Include examples and context exceptions
  - OneSentencePerLine: Explain benefits for version control and review
- Replace embedded YAML code blocks with links to rule files
- Keep guide focused on guidelines rather than technical implementation

This makes the Contributors' Guide more readable while still providing
access to the detailed rule definitions via links.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create new "personas" skill for user persona guidelines
  - Overview explains User, Admin, and Architect personas
  - Instructions for applying persona-appropriate content
- Restructure "validate-contribution" skill as "Documentation conventions"
  - Add comprehensive Overview section covering all conventions
  - Add Examples section with good/bad examples
  - Keep AI validation instructions in Instructions section
  - Improve code block handling in build script
  - Now properly appears in Contributors' Guide
- Update build.rb to include personas in style guidelines category

Both skills now follow the standard structure with Overview and
Examples sections for the Contributors' Guide, while keeping
detailed AI instructions separate.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@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.

aneta-petrova and others added 2 commits June 5, 2026 18:14
Vale rules are run by the Vale linter locally and in CI, not in AI-assisted editors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace links to Vale rule files with embedded YAML content inside
collapsible HTML <details> sections. This keeps the guide concise
while making full rule definitions accessible without navigation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@apinnick
Copy link
Copy Markdown
Contributor

apinnick commented Jun 8, 2026

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

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