Skip to content

Conversation

@bryan-cox
Copy link
Contributor

What this PR does / why we need it:

This PR adds Cursor rules support to the repository by creating the .cursor/rules/ directory structure and adding an idiomatic-go.mdc rule file.

The rule instructs Cursor's AI to follow Effective Go guidelines when writing Go code, ensuring all Go code in this repository is idiomatic and follows best practices.

Changes:

  • Creates .cursor/rules/ directory (per Cursor's official recommendation)
  • Adds idiomatic-go.mdc rule that references Effective Go
  • Includes required actions: gofmt, go vet, naming conventions, error handling
  • Lists common anti-patterns to avoid
  • Links to authoritative Go style guides

Which issue(s) this PR fixes:

N/A - Infrastructure improvement

Special notes for your reviewer:

  • This uses Cursor's official .cursor/rules/ directory structure (not the legacy .cursorrules file)
  • Rule files use .mdc (Markdown Context) extension as recommended by Cursor
  • The rule references external documentation rather than duplicating content, ensuring it stays current
  • This is the first rule file; others can be added following this pattern

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.

🤖 Generated with Claude Code

Add .cursor/rules/ directory with idiomatic-go.mdc rule file that instructs
Cursor AI to follow Effective Go guidelines when writing Go code.

The rule references https://go.dev/doc/effective_go and includes:
- Required actions (gofmt, go vet, naming conventions)
- Common anti-patterns to avoid
- Links to authoritative Go style guides

This ensures all Go code written in this repository follows idiomatic Go practices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@openshift-ci
Copy link

openshift-ci bot commented Oct 29, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 29, 2025
@bryan-cox bryan-cox marked this pull request as ready for review October 29, 2025 10:51
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 29, 2025
@openshift-ci openshift-ci bot requested review from dgoodwin and stbenjam October 29, 2025 10:51
Copy link

@Thealisyed Thealisyed left a comment

Choose a reason for hiding this comment

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

Should this file be .md instead of .mdc ?
Nice PR btw was looking to add something similar like this :)

@bryan-cox
Copy link
Contributor Author

Should this file be .md instead of .mdc ? Nice PR btw was looking to add something similar like this :)

No, .mdc is correct - https://cursor.com/docs/context/rules#rule-anatomy

@enxebre
Copy link
Contributor

enxebre commented Oct 30, 2025

It would be nice to somehow let this knowledge be shared with a claude agent we define in the root folder https://github.com/openshift-eng/ai-helpers/tree/main/agents that then every plugin can take advantage of

@enxebre
Copy link
Contributor

enxebre commented Oct 30, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 30, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, enxebre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@stbenjam
Copy link
Member

stbenjam commented Nov 3, 2025

There's no .go in the repo yet, is this needed here or it intended to be an example for folks to copy elsewhere?

@bryan-cox
Copy link
Contributor Author

@stbenjam this is intended to be an example of a Cursor rule. I was assuming they didn't need to copy the rule and could just follow https://github.com/openshift-eng/ai-helpers/blob/main/README.md#using-cursor instead.

@stbenjam
Copy link
Member

stbenjam commented Nov 3, 2025

Oh I see -- a cursor rules for multiple repos. Those instructions only cover commands, is it pulling in the rules for you? It didn't work for me.

The instructions in the README are kind of hacky, since the repo isn't structured really well for cursor and commands show up like "/ai-helpers/plugins/ci/commands/trigger-periodic" (and it doesn't understand skills).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants