Skip to content

Conversation

@aneta-petrova
Copy link
Member

@aneta-petrova aneta-petrova commented Dec 12, 2025

What changes are you introducing?

Adding Cursor commands for use in the project.

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

I find them useful and it's good to share.

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

If there are concerns about adding these commands directly to the repo, I'm fine with closing the PR, in which case I'll just continue using them as my own personal global commands. Which means that they don't necessarily need to be included in the repo for anyone to use them.

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.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4)
  • 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.

Summary by Sourcery

Add shared Cursor editor command definitions for documentation contributors and document their usage in the repository README.

Enhancements:

  • Document the new .cursor directory and its purpose in the project README.
  • Introduce reusable Cursor editor commands to help split combined web UI/CLI procedures and improve or create file abstracts.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 12, 2025

Reviewer's Guide

Adds initial Cursor editor command templates and documents their presence in the repo for documentation contributors.

Flow diagram for applying the new Cursor commands in the documentation workflow

flowchart TD
  A[Contributor reads README .cursor section] --> B[Explore .cursor/commands]
  B --> C{Editing task type}
  C -->|Need better abstract| D[Open module in Cursor]
  D --> E[Run abstract command]
  E --> F[Review and refine generated abstract]
  F --> G[Save file]
  C -->|Need to split web UI and CLI procedures| H[Open combined procedure file in Cursor]
  H --> I[Run split-web-ui-cli command]
  I --> J[Review generated web UI file]
  I --> K[Review generated CLI file]
  J --> L[Adjust IDs, headings, and abstracts if needed]
  K --> L
  L --> M[Include new files in parent file]
  M --> N[Run docs checks and commit changes]
Loading

File-Level Changes

Change Details Files
Document the new Cursor-specific configuration directory in the contributor README.
  • Add a subsection describing the .cursor directory and its purpose
  • Mention that contributors can add their own Cursor commands for documentation work
  • Link to Cursor documentation for command usage details
README.md
Introduce reusable Cursor command prompts to help automate common documentation editing tasks.
  • Add a split-web-ui-cli command that instructs Cursor to split a combined Web UI and CLI procedure into two AsciiDoc files with adjusted IDs, headings, abstracts, and includes
  • Add an abstract command that guides Cursor to review, improve, or create concise, user-centric abstracts for documentation files
.cursor/commands/split-web-ui-cli.md
.cursor/commands/abstract.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@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 labels Dec 12, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • In README.md the new Cursor link uses AsciiDoc-style link:...[] syntax, which won’t render correctly in Markdown; switch it to standard Markdown link syntax instead.
  • In .cursor/commands/abstract.md, the last bullet’s parenthetical example is missing a closing parenthesis, so please fix the punctuation there.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In README.md the new Cursor link uses AsciiDoc-style `link:...[]` syntax, which won’t render correctly in Markdown; switch it to standard Markdown link syntax instead.
- In `.cursor/commands/abstract.md`, the last bullet’s parenthetical example is missing a closing parenthesis, so please fix the punctuation there.

## Individual Comments

### Comment 1
<location> `.cursor/commands/abstract.md:6` </location>
<code_context>
+* Make the abstract one or two sentences long.
+* Do not use documentation self-referential language (for example: avoid "This procedure..." or "This module").
+* Use user-centric language (for example: "You can...") rather than product-centric language (for example: "This feature...").
+* Where appropriate, include an example use case (for example: the reason why and when a user might find the contents of the module useful.
</code_context>

<issue_to_address>
**issue (typo):** Close the parenthesis at the end of the sentence.

This bullet opens a parenthesis after "for example:" but never closes it; consider ending the sentence with "useful)." to balance it.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@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 labels Dec 12, 2025
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

The PR preview for 7f7b46a is available at theforeman-foreman-documentation-preview-pr-4528.surge.sh

The following output files are affected by this PR:

show diff

show diff as HTML

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

I noticed that the two MD files in .cursor do not have a heading. Is that by design?

@aneta-petrova
Copy link
Member Author

I suppose it is by design (I just didn't bother adding headings or anything special). Cursor commands are created in markdown but no special markup is needed for Cursor to execute the instructions.

However, it might be useful to think through how we want to structure these team commands. A quick search for examples revealed https://github.com/hamzafer/cursor-commands/tree/main/.cursor/commands where each command follows a template with Overview etc. and that might be useful. So I will look into this a bit more.

@aneta-petrova
Copy link
Member Author

And a note to self: https://ezablocki.com/posts/cursor-slash-commands/ also includes useful examples that I want to read through when improving the commands in this PR.

@aneta-petrova aneta-petrova marked this pull request as draft December 12, 2025 12:02
@apinnick
Copy link
Contributor

FYI. write-abstract cursor command

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

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

I'm all for it if nobody minds.

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

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

Proposing a couple of adjustments of the split command that I've tested and work for me.

@aneta-petrova
Copy link
Member Author

I added headings to the Markdown files with commands, to improve readability and for potential future use if generated from the .md sources.

I'd like to propose merging the commands as they are now. I very much appreciate @Lennonka's suggestions with changes that worked for her -- that's for the command to split modules into web UI and CLI. I can confirm that the abstract command also works pretty well because I used it in #4527 and the generated abstracts largely passed peer review without issues. However, I also filed #4553 to investigate potential for future improvements, although changes like this should IMO be thoroughly tested (to see if the AI-generated results pass peer review).

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

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

I'm cool with merging it as it is. We can improve as we go.

@Lennonka Lennonka merged commit fb98b8c into theforeman:master Dec 22, 2025
8 checks passed
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