diff --git a/docs/automations/integrations/cursor/flag-cursor-pr/README.md b/docs/automations/integrations/cursor/flag-cursor-pr/README.md new file mode 100644 index 000000000..ebb5e0161 --- /dev/null +++ b/docs/automations/integrations/cursor/flag-cursor-pr/README.md @@ -0,0 +1,104 @@ +--- +title: Automation - Label Cursor PRs +description: Automatically apply labels to PRs that are assisted by Cursor +category: [quality, genai, cursor, quickstart] +--- + +# Automatically Label Cursor PRs + +Automatically apply labels to Pull Requests that are assisted by Cursor AI. This automation helps track the impact and usage of Cursor's AI capabilities across your development workflow. You can apply labels based on: + +- A known list of Cursor users +- AI-generated code comments +- PR tags +- Inline prompt responses + +=== "Label by Prompt" + Prompt PR authors to indicate if they used Cursor for the PR and automatically label the PR if they did. This requires two separate automation files to handle posting the prompt and labeling accordingly. + + ![Label Cursor by Prompt](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png) + + !!! info "Configuration Description" + Conditions: + + * A PR is created + + Automation Actions: + + * Post a comment prompting the author to indicate if Cursor assisted the author with writing the code in the PR. + + !!! example "Ask the PR author about Cursor usage." + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm){ .md-button } + +
+ + !!! info "Configuration Description" + Conditions: + + * A PR is updated or merged where the author indicates they used Cursor via a prompt. + + Automation Actions: + + * Apply a `🤖 Cursor` label to the PR + + !!! example "Label PRs where the user indicated Cursor usage" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm){ .md-button } + +
+ +=== "Label by Known Users" + Automatically apply labels to PRs that are created by known users of generative AI coding tools. + + ![Label by Contributors](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-contributors.png) + !!! info "Configuration Description" + Conditions: + + * The PR author is one of a specified list of contributors + + Automation Actions: + + * Apply a `🤖 Cursor` label to the PR + + !!! example "Label by Contributors" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm){ .md-button } + +
+ +=== "Label by Tag" + Look for a specific tag in the PR title, description, comments or commit messages and if found add a label to the PR + + ![Label Cursor by Tag](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-tag.png) + !!! info "Configuration Description" + Conditions: + + * The `#cursor#` tag is found in any of the PR title, description, comments or commit messages for commits in the PR + + Automation Actions: + + * Apply a `🤖 Cursor` label to the PR + + !!! example "Label Cursor by Tag" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm){ .md-button } + +
+ diff --git a/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-contributors.png b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-contributors.png new file mode 100644 index 000000000..99af410e8 Binary files /dev/null and b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-contributors.png differ diff --git a/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png new file mode 100644 index 000000000..f9b2c0155 Binary files /dev/null and b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png differ diff --git a/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-tag.png b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-tag.png new file mode 100644 index 000000000..fc8c67c3b Binary files /dev/null and b/docs/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-tag.png differ diff --git a/docs/automations/integrations/cursor/flag-cursor-pr/logo_flag_cursor_pr.png b/docs/automations/integrations/cursor/flag-cursor-pr/logo_flag_cursor_pr.png new file mode 100644 index 000000000..ac7f636e7 Binary files /dev/null and b/docs/automations/integrations/cursor/flag-cursor-pr/logo_flag_cursor_pr.png differ diff --git a/docs/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm b/docs/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm new file mode 100644 index 000000000..9ddc6a78d --- /dev/null +++ b/docs/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm @@ -0,0 +1,21 @@ +-*- mode: yaml -*- + +manifest: + version: 1.0 + +on: + - pr_created + +automations: + comment_cursor_prompt: + # Post a comment for all PRs to prompt the PR author to indicate whether they used Cursor to assist coding in this PR + if: + - true + run: + - action: add-comment@v1 + args: + comment: | + Please mark whether you used Cursor to assist coding in this PR + + - [ ] Cursor Assisted + - [ ] Not Cursor Assisted \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm new file mode 100644 index 000000000..d0ede6aa2 --- /dev/null +++ b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm @@ -0,0 +1,20 @@ +# -*- mode: yaml -*- + +manifest: + version: 1.0 + +automations: + label_cursor_contributors: + # For all PRs authored by someone who is specified in the cursor_contributors list + if: + - {{ pr.author | match(list=cursor_contributors) | some }} + # Apply a label indicating the user has adopted Cursor + run: + - action: add-label@v1 + args: + label: '🤖 Cursor' + +cursor_contributors: + - username1 + - username2 + - etc \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm new file mode 100644 index 000000000..dda36a43d --- /dev/null +++ b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm @@ -0,0 +1,16 @@ +-*- mode: yaml -*- + +manifest: + version: 1.0 + +automations: + # You should use this automation in conjunction with comment_cursor_prompt.cm + label_cursor_pr: + # If the PR author has indicated that they used Cursor to assist coding in this PR, + # apply a label indicating the PR was supported by Cursor + if: + - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', regex=r/\- \[x\] Cursor Assisted/) | some}} + run: + - action: add-label@v1 + args: + label: '🤖 Cursor' \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm new file mode 100644 index 000000000..52eeaf427 --- /dev/null +++ b/docs/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm @@ -0,0 +1,26 @@ +# -*- mode: yaml -*- + +manifest: + version: 1.0 + +on: + - comment_added + - commit + - pr_created + +automations: + label_cursor: + # Detect PRs that contain the text '#cursor#' in the title, description, comments, or commit messages + if: + - {{ cursor_tag.pr_title or cursor_tag.pr_desc or cursor_tag.pr_comments or cursor_tag.commit_messages }} + # Apply a label indicating the user has adopted Cursor + run: + - action: add-label@v1 + args: + label: '🤖 Cursor' + +cursor_tag: + pr_title: {{ pr.title | includes(regex=r/#cursor#/) }} + pr_desc: {{pr.description | includes(regex=r/#cursor#/) }} + pr_comments: {{ pr.comments | map(attr='content') | match(regex=r/#cursor#/) | some }} + commit_messages: {{ branch.commits.messages | match(regex=r/#cursor#/) | some }} \ No newline at end of file diff --git a/docs/integrations/README.md b/docs/integrations/README.md index 039f1a833..81def1438 100644 --- a/docs/integrations/README.md +++ b/docs/integrations/README.md @@ -43,25 +43,37 @@ visible: false
-[:octicons-copilot-16: GitHub Copilot](/integrations/github-copilot) +[:material-label: PR Labels](/automations/standard/label-management)
-[:material-label: PR Labels](/automations/standard/label-management) +[:material-git: Branch Management](/automations/standard/branch-management)
-[:material-git: Branch Management](/automations/standard/branch-management) +[:simple-codereview: PR Reviews](/automations/standard/review-assignment)
+ + +## AI Tools + +
+
-[:simple-codereview: PR Reviews](/automations/standard/review-assignment) +[:octicons-copilot-16: GitHub Copilot](/integrations/github-copilot) +
+
+ +
+
+[:material-cube-outline: Cursor](/integrations/cursor)
@@ -164,6 +176,7 @@ visible: false
## Feature Flags +
@@ -198,8 +211,8 @@ visible: false
- ## Languages +
@@ -301,4 +314,7 @@ visible: false ## Additional Resources + +--8<-- "docs/snippets/general.md" + --8<-- "docs/snippets/general.md" diff --git a/docs/integrations/cursor.md b/docs/integrations/cursor.md new file mode 100644 index 000000000..03962951a --- /dev/null +++ b/docs/integrations/cursor.md @@ -0,0 +1,15 @@ +--- +title: Integrate gitStream with Cursor +description: Workflow automations to improve your Cursor AI usage. +--- +# Integrate gitStream with Cursor + +## Automatically Label Cursor-Assisted PRs + +--8<-- "docs/automations/integrations/cursor/flag-cursor-pr/README.md:example" + +## Additional Resources + +--8<-- "docs/snippets/general.md" + +--8<-- "docs/snippets/automation-footer.md"