Repository: linear-b/gitstream
Pull request #689: Measure ai
Author: login: PavelLinearB
Labels: name: 5 min review
name: examples-code-changes
name: 1 Unresolved Thread(s)
Created: 2025-04-16T17:07:56Z | Merged: 2025-04-16T17:43:16Z

<img width="224" alt="image" src="https://github.com/user-attachments/assets/d62a1717-cddd-4d83-93f4-719241740f7f" />

<!--start_gitstream_placeholder-->
### ✨ PR Description
Purpose and impact:
This PR introduces an automated system to label Pull Requests based on AI assistance used by developers.

Main changes:
- Adds new automation files for prompting developers about AI tool usage and applying labels accordingly
- Implements functionality to skip prompts for known AI tool users
- Updates integration documentation to include the new AI assistance labeling feature

_Generated by LinearB AI and added by gitStream._
<sub>AI-generated content may contain inaccuracies. Please verify before using. **[We’d love your feedback!](mailto:product@linearb.io)** 🚀</sub>
<!--end_gitstream_placeholder-->



Diff:
diff --git a/docs/automations/integrations/ai-assistance/flag-ai-pr/README.md b/docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
new file mode 100644
index 000000000..2f11d8c21
--- /dev/null
+++ b/docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
@@ -0,0 +1,91 @@
+---
+title: Automation - Label AI-Assisted PRs
+description: Automatically apply labels to PRs based on AI assistance.
+category: [quality, genai, ai, quickstart]
+starter_kits: [genai]
+---
+# Automatically Label AI-Assisted PRs
+<!-- --8<-- [start:example]-->
+Automatically apply labels to PRs based on whether they were assisted by AI tools. Developers can indicate the specific AI tools or models used, or pre-add an AI-related label to skip the prompt.
+
+=== "Ask Developers About AI Assistance"
+    ### Ask Developers About AI Assistance
+    Prompt PR authors with a convenient checkbox survey to indicate which AI tools they used for the PR. Developers can pre-add any `🤖 ai-*` label to skip the question. The automation checks for existing labels before posting the prompt.
+
+    ![Ask About AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR is created, and no `🤖 ai-*` label is pre-applied.
+        * The question hasn't been asked before.
+
+        Automation Actions:
+
+        * Post a comment with a checkbox survey about AI tools used.
+        * Apply labels based on the checkboxes selected.
+
+    !!! example "Ask the PR author about AI assistance."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm){ .md-button }
+        </span>
+        </div>
+
+
+    ### Track AI Tools
+    Add labels to the PR according to the tools that the developer checked in the micro-survey above
+    ![Label AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR with selected checkboxes for AI tools used.
+        * Optional: Details about AI Service and Model specified.
+
+        Automation Actions:
+
+        * Apply labels for specific AI tools (e.g., `🤖 ai-copilot`, `🤖 ai-cursor`).
+        * Apply labels for AI services and models if provided.
+
+    !!! example "Track AI tools, models and services."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm){ .md-button }
+        </span>
+        </div>
+
+=== "Skip the survey for known users"
+    ### Ask Developers About AI Assistance
+    The automation will not prompt known users for AI assistance. This allows a smoother experience for users who were predefined as AI users, to avoid answering the same questions again. 
+    !!! example "Skip the survey for known users."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm){ .md-button }
+        </span>
+        </div>
+
+    ### Track AI Tools
+    Add labels to the PR according to the tools that the developer checked in the micro-survey above
+    ![Label AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png)
+
+    !!! example "Track AI tools, models and services."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm){ .md-button }
+        </span>
+        </div>
+    
+<!-- --8<-- [end:example]-->
diff --git a/docs/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png b/docs/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png
new file mode 100644
index 000000000..3ec2c1a56
Binary files /dev/null and b/docs/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png differ
diff --git a/docs/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png b/docs/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png
new file mode 100644
index 000000000..4acb95186
Binary files /dev/null and b/docs/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png differ
diff --git a/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm b/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm
new file mode 100644
index 000000000..4c08b1e9d
--- /dev/null
+++ b/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm
@@ -0,0 +1,35 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+
+triggers:
+  on:
+    - pr_created
+    
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark which AI tools you used/) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            Tip: If you want to avoid this comment in the future, you can add a label of the format `🤖 ai-*` when creating your PR.
+
diff --git a/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm b/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
new file mode 100644
index 000000000..e951a62d7
--- /dev/null
+++ b/docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
@@ -0,0 +1,65 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+triggers:
+  on:
+    - pr_created
+
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.author | match(list=copilot_contributors) | nope }}
+      - {{ pr.author | match(list=cursor_contributors) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            **Tip**: If you want to avoid this comment in the future, add a label of the format `🤖 ai-*` when creating your PR, or ask your admin to add you to the pre-defined lists of known users
+
+  label_copilot_known_users:
+    # For all PRs authored by someone who is specified in the genai_contributors list
+    if:
+      - {{ pr.author | match(list=copilot_contributors) | some  }}
+    # Apply a label indicating the user has adopted Copilot
+    run:
+      - action: add-label@v1
+        args:
+          label: '🤖 ai-copilot'
+
+  label_cursor_known_users:
+    # For all PRs authored by someone who is specified in the genai_contributors list
+    if:
+      - {{ pr.author | match(list=cursor_contributors) | some  }}
+    # Apply a label indicating the user has adopted Copilot
+    run:
+      - action: add-label@v1
+        args:
+          label: '🤖 ai-cursor'
+
+copilot_contributors:
+  - username1
+  - username2
+  - usernameN
+
+cursor_contributors:
+  - username1
+  - username2
+  - usernameN
+  
\ No newline at end of file
diff --git a/docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm b/docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm
new file mode 100644
index 000000000..73fb3b6c3
--- /dev/null
+++ b/docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm
@@ -0,0 +1,71 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+
+automations:
+  label_ai_tools_by_checkbox:
+    # Apply labels based on the checkboxes selected in the PR comment
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] GitHub Copilot/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-copilot"
+          
+  label_ai_cursor:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Cursor/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-cursor"
+          
+  label_ai_tabnine:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Tabnine/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-tabnine"
+          
+  label_ai_jetbrains:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] JetBrains AI Assistant/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-jetbrains"
+          
+  label_ai_intellicode:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] VSCode IntelliCode/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-intellicode"
+          
+  label_ai_chatgpt:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] ChatGPT/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-chatgpt"
+          
+  label_ai_other:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Other AI tool/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-other"
+          
+  label_ai_none:
+    if:
+      - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] No AI tools were used/) | some }}
+    run:
+      - action: add-label@v1
+        args:
+          label: "🤖 ai-none"
+          
\ No newline at end of file
diff --git a/docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm b/docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
index 0ea82cae3..67a179be8 100644
--- a/docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
+++ b/docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
@@ -1,11 +1,11 @@
--*- mode: yaml -*-
+# -*- mode: yaml -*-
 
 manifest:
   version: 1.0
 
 on:
   - pr_created
-
+  
 automations:
   comment_copilot_prompt:
     # Post a comment for all PRs to prompt the PR author to indicate whether they used Copilot to assist coding in this PR
diff --git a/docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm b/docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm
index 4bf4f3fc6..cf930ac08 100644
--- a/docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm
+++ b/docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm
@@ -4,17 +4,17 @@ manifest:
   version: 1.0
 
 automations:
-  label_genai:
+  label_copilot_by_contributors:
     # For all PRs authored by someone who is specified in the genai_contributors list
     if:
-      - {{ pr.author | match(list=genai_contributors) | some  }}
+      - {{ pr.author | match(list=genai_contributors) | some }}
     # Apply a label indicating the user has adopted Copilot
     run:
       - action: add-label@v1
         args:
-          label: '🤖 Copilot'
+          label: '🤖 ai-copilot'
 
 genai_contributors:
   - username1
   - username2
-  - etc
+  - usernameN
diff --git a/docs/integrations/README.md b/docs/integrations/README.md
index 06d29f992..e244a47e5 100644
--- a/docs/integrations/README.md
+++ b/docs/integrations/README.md
@@ -7,6 +7,12 @@ visible: false
 <!-- --8<-- [start:integrations]-->
 <div class="integrations-list" markdown="1">
 
+<div class="integrations-card" markdown="1">
+<div class="integrations-card-title" markdown="1">
+[:material-assistant: AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr)
+</div>
+</div>
+
 <div class="integrations-card" markdown="1">
 <div class="integrations-card-title" markdown="1">
 <a href=/integrations/linearb>![LinearB](/downloads/images/linearb-symbol-dark.png#only-light) ![LinearB](/downloads/images/linearb-symbol-white.png#only-dark) LinearB</a>


Reviews:
user: login: orca-security-us[bot]
body: ### Orca Security Scan Summary
| Status  | Check | Issues by priority |   |
| ------- | ----- | ------------------ | - |
| <img width="16" alt="Passed" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/status_v1/passed.png" title="Passed"> Passed | Infrastructure as Code | <img width="12" alt="high" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/high.png" title="High"> 0 &emsp; <img width="12" alt="medium" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/medium.png" title="Medium"> 0 &emsp; <img width="12" alt="low" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/low.png" title="Low"> 0 &emsp; <img width="12" alt="info" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/info.png" title="Info"> 0 | <a href="https://app.orcasecurity.io/shift-left/iac/scan-log/9177fd4a-5d1c-4f0b-b700-6d26d0852c5f" target="_blank">View in Orca</a> |
| <img width="16" alt="Passed" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/status_v1/passed.png" title="Passed"> Passed | SAST | <img width="12" alt="high" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/high.png" title="High"> 0 &emsp; <img width="12" alt="medium" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/medium.png" title="Medium"> 0 &emsp; <img width="12" alt="low" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/low.png" title="Low"> 0 &emsp; <img width="12" alt="info" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/info.png" title="Info"> 0 | <a href="https://app.orcasecurity.io/shift-left/sast/scan-log/7c62eb0f-0bac-4a57-abd9-d095418ef35f" target="_blank">View in Orca</a> |
| <img width="16" alt="Passed" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/status_v1/passed.png" title="Passed"> Passed | Secrets | <img width="12" alt="high" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/high.png" title="High"> 0 &emsp; <img width="12" alt="medium" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/medium.png" title="Medium"> 0 &emsp; <img width="12" alt="low" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/low.png" title="Low"> 0 &emsp; <img width="12" alt="info" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/info.png" title="Info"> 0 | <a href="https://app.orcasecurity.io/shift-left/file_system_secret_detection/scan-log/73617551-64e6-4d56-a4dd-f7bce2fdb58a" target="_blank">View in Orca</a> |
| <img width="16" alt="Passed" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/status_v1/passed.png" title="Passed"> Passed | Vulnerabilities | <img width="12" alt="high" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/high.png" title="High"> 0 &emsp; <img width="12" alt="medium" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/medium.png" title="Medium"> 0 &emsp; <img width="12" alt="low" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/low.png" title="Low"> 0 &emsp; <img width="12" alt="info" src="https://raw.githubusercontent.com/orcasecurity/orca-cli/main/resources/images/prcomment/priority/info.png" title="Info"> 0 | <a href="https://app.orcasecurity.io/shift-left/file_system_vulnerabilities/scan-log/61933111-5b3b-41ad-82f1-51c0e6de59ed" target="_blank">View in Orca</a> |
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-16T17:08:27Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR updates documentation and automation scripts to replace references to GitHub Copilot with AI Assistance and to add new integrations for labeling and prompting AI-assisted PRs.  
- Renames headings and file references from “Copilot” to “AI-Assisted” in docs.  
- Introduces new automation scripts for prompting and labeling AI tool usage in PRs.  
- Updates documentation in the automation library reflecting the new AI assistance integrations.

### Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

<details>
<summary>Show a summary per file</summary>

| File | Description |
| ---- | ----------- |
| docs/integrations/github-copilot.md | Updated heading and example file reference to reflect AI Assistance |
| docs/integrations/README.md | Added new AI Assistance integration card |
| docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm | Renamed label from “🤖 Copilot” to “🤖 ai-copilot” (file path still under “copilot”) |
| docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm | Updated condition logic; regex still references old prompt text |
| docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm | New automation file for tracking AI tool selections |
| docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm | New automation file for prompting known users regarding AI usage |
| docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm | New automation file for prompting AI assistance in PRs |
| docs/automations/integrations/ai-assistance/flag-ai-pr/README.md | New documentation covering AI assistance PR labeling and prompting |
</details>



<details>
<summary>Comments suppressed due to low confidence (1)</summary>

**docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm:7**
* [nitpick] The file remains in a 'copilot' directory while the label has been updated to 'ai-copilot'. Consider renaming the file or directory to 'ai-assistance' for consistency with the new naming convention.
```
  label_copilot_by_contributors:
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:08:59Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:12:04Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:12:22Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:15:31Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:16:41Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:16:59Z
user: login: copilot-pull-request-reviewer[bot]
body: 

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.




state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:18:09Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:22:41Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR adds an automated system to label PRs based on the AI tools used during development, enhancing transparency for AI assistance. Key changes include:
- An integration card added in the docs to link the new AI assistance flag.
- Updates to automation files for labeling and prompting users about AI tool usage.
- New and updated configuration files for tracking various AI tools (e.g., Copilot, Cursor, ChatGPT).

### Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

<details>
<summary>Show a summary per file</summary>

| File | Description |
| ---- | ----------- |
| docs/integrations/README.md | Added an integration card linking to the AI assistance automation. |
| docs/downloads/automation-library/integrations/copilot/label_copilot_by_contributors.cm | Renamed the Copilot label to maintain clarity in labeling convention. |
| docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm | Adjusted file header syntax for YAML mode consistency. |
| docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm | Introduced automations for labeling PRs based on AI tool checkboxes in comments. |
| docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm | Added a prompt and label automation for known AI users with separate contributor lists. |
| docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm | Added a generic prompt for specifying used AI tools. |
| docs/automations/integrations/ai-assistance/flag-ai-pr/README.md | Documented the AI-assisted PR labeling automation and provided usage examples. |
</details>



<details>
<summary>Comments suppressed due to low confidence (2)</summary>

**docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm:59**
* [nitpick] The placeholder 'etc' is ambiguous; consider using a more descriptive example username or removing it to avoid confusion.
```
  - etc
```
**docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm:64**
* [nitpick] The placeholder 'etcc' appears inconsistent with 'etc'; consider using a consistent placeholder such as 'usernameX' or removing it.
```
  - etcc
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:30:40Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:33:08Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:33:33Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:36:11Z
user: login: PavelLinearB
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:36:38Z
user: login: gitstream-cm[bot]
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T17:42:52Z

Review comments:
diff_hunk: @@ -1,16 +1,13 @@
--*- mode: yaml -*-
+# -*- mode: yaml -*-
 
 manifest:
   version: 1.0
 
-on:
-  - pr_created
-
 automations:
   comment_copilot_prompt:
     # Post a comment for all PRs to prompt the PR author to indicate whether they used Copilot to assist coding in this PR
     if:
-      - true
+      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark whether you used Copilot/) | nope }}
path: docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
user: login: Copilot
body: The regex condition still references 'Please mark whether you used Copilot'. Please update it to match the new prompt text ('Please mark which AI tools you used') for consistency.
created_at: 2025-04-16T17:08:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,91 @@
+---
+title: Automation - Label AI-Assisted PRs
+description: Automatically apply labels to PRs based on AI assistance.
+category: [quality, genai, ai, quickstart]
+starter_kits: [genai]
+---
+# Automatically Label AI-Assisted PRs
+<!-- --8<-- [start:example]-->
+Automatically apply labels to PRs based on whether they were assisted by AI tools. Developers can indicate the specific AI tools or models used, or pre-add an AI-related label to skip the prompt.
+
+=== "Ask Developers About AI Assistance"
+    ### Ask Developers About AI Assistance
+    Prompt PR authors with a convenient checkbox survey to indicate which AI tools they used for the PR. Developers can pre-add any `🤖 ai-*` label to skip the question. The automation checks for existing labels before posting the prompt.
+
+    ![Ask About AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR is created, and no `🤖 ai-*` label is pre-applied.
+        * The question hasn't been asked before.
+
+        Automation Actions:
+
+        * Post a comment with a checkbox survey about AI tools used.
+        * Apply labels based on the checkboxes selected.
+
+    !!! example "Ask the PR author about AI assistance."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm){ .md-button }
+        </span>
+        </div>
+
+
+    ### Track AI Tools
+    Add lables to the PR according to the tools that the developer checked in the micro-survey above
path: docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
user: login: Copilot
body: There is a spelling error: 'lables' should be corrected to 'labels'.
```suggestion
    Add labels to the PR according to the tools that the developer checked in the micro-survey above
```
created_at: 2025-04-16T17:08:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,16 +1,13 @@
--*- mode: yaml -*-
+# -*- mode: yaml -*-
 
 manifest:
   version: 1.0
 
path: docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
user: login: PavelLinearB
body: ```suggestion

on:
  - pr_created
  
```
created_at: 2025-04-16T17:12:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,16 +1,13 @@
--*- mode: yaml -*-
+# -*- mode: yaml -*-
 
 manifest:
   version: 1.0
 
-on:
-  - pr_created
-
 automations:
   comment_copilot_prompt:
     # Post a comment for all PRs to prompt the PR author to indicate whether they used Copilot to assist coding in this PR
     if:
-      - true
+      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark whether you used Copilot/) | nope }}
path: docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
user: login: PavelLinearB
body: ```suggestion
      - true
```
created_at: 2025-04-16T17:12:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -4,11 +4,9 @@ description: Workflow automations to improve your GitHub Copilot usage.
 ---
 # Integrate gitStream with GitHub Copilot
 
path: docs/integrations/github-copilot.md
user: login: PavelLinearB
body: ```suggestion


```
created_at: 2025-04-16T17:15:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -5,10 +5,9 @@ description: Workflow automations to improve your GitHub Copilot usage.
 # Integrate gitStream with GitHub Copilot
 
 
-## Automatically Label Copilot-Assisted PRs
-
---8<-- "docs/automations/integrations/copilot/flag-copilot-pr/README.md:example"
+## Automatically Label AI-Assisted PRs
path: docs/integrations/github-copilot.md
user: login: PavelLinearB
body: ```suggestion
## Automatically Label Copilot-Assisted PRs

--8<-- "docs/automations/integrations/copilot/flag-copilot-pr/README.md:example"
```
created_at: 2025-04-16T17:16:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -9,6 +9,7 @@ description: Workflow automations to improve your GitHub Copilot usage.
 
 --8<-- "docs/automations/integrations/copilot/flag-copilot-pr/README.md:example"
 
+--8<-- "docs/automations/integrations/ai-assistance/flag-ai-pr/README.md:example"
path: docs/integrations/github-copilot.md
user: login: PavelLinearB
body: ```suggestion
```
created_at: 2025-04-16T17:16:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,91 @@
+---
+title: Automation - Label AI-Assisted PRs
+description: Automatically apply labels to PRs based on AI assistance.
+category: [quality, genai, ai, quickstart]
+starter_kits: [genai]
+---
+# Automatically Label AI-Assisted PRs
+<!-- --8<-- [start:example]-->
+Automatically apply labels to PRs based on whether they were assisted by AI tools. Developers can indicate the specific AI tools or models used, or pre-add an AI-related label to skip the prompt.
+
+=== "Ask Developers About AI Assistance"
+    ### Ask Developers About AI Assistance
+    Prompt PR authors with a convenient checkbox survey to indicate which AI tools they used for the PR. Developers can pre-add any `🤖 ai-*` label to skip the question. The automation checks for existing labels before posting the prompt.
+
+    ![Ask About AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR is created, and no `🤖 ai-*` label is pre-applied.
+        * The question hasn't been asked before.
+
+        Automation Actions:
+
+        * Post a comment with a checkbox survey about AI tools used.
+        * Apply labels based on the checkboxes selected.
+
+    !!! example "Ask the PR author about AI assistance."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm){ .md-button }
+        </span>
+        </div>
+
+
+    ### Track AI Tools
+    Add lables to the PR according to the tools that the developer checked in the micro-survey above
path: docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
user: login: Copilot
body: Typographical error: replace 'lables' with 'labels'.
```suggestion
    Add labels to the PR according to the tools that the developer checked in the micro-survey above
```
created_at: 2025-04-16T17:18:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,91 @@
+---
+title: Automation - Label AI-Assisted PRs
+description: Automatically apply labels to PRs based on AI assistance.
+category: [quality, genai, ai, quickstart]
+starter_kits: [genai]
+---
+# Automatically Label AI-Assisted PRs
+<!-- --8<-- [start:example]-->
+Automatically apply labels to PRs based on whether they were assisted by AI tools. Developers can indicate the specific AI tools or models used, or pre-add an AI-related label to skip the prompt.
+
+=== "Ask Developers About AI Assistance"
+    ### Ask Developers About AI Assistance
+    Prompt PR authors with a convenient checkbox survey to indicate which AI tools they used for the PR. Developers can pre-add any `🤖 ai-*` label to skip the question. The automation checks for existing labels before posting the prompt.
+
+    ![Ask About AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR is created, and no `🤖 ai-*` label is pre-applied.
+        * The question hasn't been asked before.
+
+        Automation Actions:
+
+        * Post a comment with a checkbox survey about AI tools used.
+        * Apply labels based on the checkboxes selected.
+
+    !!! example "Ask the PR author about AI assistance."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm){ .md-button }
+        </span>
+        </div>
+
+
+    ### Track AI Tools
+    Add lables to the PR according to the tools that the developer checked in the micro-survey above
+    ![Label AI Assistance](/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png)
+
+    !!! info "Configuration Description"
+        Conditions:
+
+        * A PR with selected checkboxes for AI tools used.
+        * Optional: Details about AI Service and Model specified.
+
+        Automation Actions:
+
+        * Apply labels for specific AI tools (e.g., `🤖 ai-copilot`, `🤖 ai-cursor`).
+        * Apply labels for AI services and models if provided.
+
+    !!! example "Track AI tools, models and services."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm){ .md-button }
+        </span>
+        </div>
+
+=== "Skip the survey for known users"
+    ### Ask Developers About AI Assistance
+    The automation will not prompt known users for AI assistance. This allows a smoother experience for users who were predefined as AI users, to avoid answering the same questions again. 
+    !!! example "Skip the survey for known users."
+        ```yaml+jinja
+        --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm"
+        ```
+        <div class="result" markdown>
+        <span>
+        [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm){ .md-button }
+        </span>
+        </div>
+
+    ### Track AI Tools
+    Add lables to the PR according to the tools that the developer checked in the micro-survey above
path: docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
user: login: Copilot
body: Typographical error: replace 'lables' with 'labels'.
```suggestion
    Add labels to the PR according to the tools that the developer checked in the micro-survey above
```
created_at: 2025-04-16T17:18:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,64 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+triggers:
+  on:
+    - pr_created
+
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.author | match(list=copilot_contributors) | nope }}
+      - {{ pr.author | match(list=cursor_contributors) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            **Tip**: If you want to avoid this comment in the future, add a label of the format "🤖 ai-*" when creating your PR, or ask your admin to add you to the pre-defined lists of known users
+
+  label_copilot_known_users:
+    # For all PRs authored by someone who is specified in the genai_contributors list
+    if:
+      - {{ pr.author | match(list=copilot_contributors) | some  }}
+    # Apply a label indicating the user has adopted Copilot
+    run:
+      - action: add-label@v1
+        args:
+          label: '🤖 ai-copilot'
+
+label_cursor_known_users:
path: docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
user: login: PavelLinearB
body: ```suggestion
  label_cursor_known_users:
```
created_at: 2025-04-16T17:22:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,34 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+
+triggers:
+  on:
+    - pr_created
+    
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark which AI tools you used/) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            Tip: If you want to avoid this comment in the future, you can add a label of the format "🤖 ai-*" when creating your PR.
path: docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm
user: login: PavelLinearB
body: ```suggestion
            Tip: If you want to avoid this comment in the future, you can add a label of the format `🤖 ai-*` when creating your PR.
```
created_at: 2025-04-16T17:33:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,64 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+triggers:
+  on:
+    - pr_created
+
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.author | match(list=copilot_contributors) | nope }}
+      - {{ pr.author | match(list=cursor_contributors) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            **Tip**: If you want to avoid this comment in the future, add a label of the format "🤖 ai-*" when creating your PR, or ask your admin to add you to the pre-defined lists of known users
path: docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
user: login: PavelLinearB
body: ```suggestion
            **Tip**: If you want to avoid this comment in the future, add a label of the format `🤖 ai-*` when creating your PR, or ask your admin to add you to the pre-defined lists of known users
```
created_at: 2025-04-16T17:33:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,64 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+triggers:
+  on:
+    - pr_created
+
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.author | match(list=copilot_contributors) | nope }}
+      - {{ pr.author | match(list=cursor_contributors) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            **Tip**: If you want to avoid this comment in the future, add a label of the format `🤖 ai-*` when creating your PR, or ask your admin to add you to the pre-defined lists of known users
+
+  label_copilot_known_users:
+    # For all PRs authored by someone who is specified in the genai_contributors list
+    if:
+      - {{ pr.author | match(list=copilot_contributors) | some  }}
+    # Apply a label indicating the user has adopted Copilot
+    run:
+      - action: add-label@v1
+        args:
+          label: '🤖 ai-copilot'
+
+  label_cursor_known_users:
+    # For all PRs authored by someone who is specified in the genai_contributors list
+    if:
+      - {{ pr.author | match(list=cursor_contributors) | some  }}
+    # Apply a label indicating the user has adopted Copilot
+    run:
+      - action: add-label@v1
+        args:
+          label: '🤖 ai-cursor'
+
+copilot_contributors:
+  - username1
+  - username2
+  - etc
+
+cursor_contributors:
+  - username3
+  - username4
+  - etcc
path: docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
user: login: PavelLinearB
body: ```suggestion
copilot_contributors:
  - username1
  - username2
  - usernameN

cursor_contributors:
  - username1
  - username2
  - usernameN
  
```
created_at: 2025-04-16T17:36:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,34 @@
+# -*- mode: yaml -*-
+
+manifest:
+  version: 1.0
+
+triggers:
+  on:
+    - pr_created
+    
+automations:
+  comment_ai_assistance_prompt:
+    # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR
+    # Only do this if there's no existing AI-related label and we haven't asked before
+    if:
+      - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }}
+      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark which AI tools you used/) | nope }}
+    run:
+      - action: add-comment@v1
+        args:
+          comment: |
+            Please mark which AI tools you used for this PR by checking the appropriate boxes:
+
+            - [ ] GitHub Copilot
+            - [ ] Cursor
+            - [ ] Tabnine
+            - [ ] JetBrains AI Assistant
+            - [ ] VSCode IntelliCode
+            - [ ] ChatGPT
+            - [ ] Claude
+            - [ ] Gemini
+            - [ ] Other AI tool
+            - [ ] No AI tools were used
+
+            Tip: If you want to avoid this comment in the future, you can add a label of the format `🤖 ai-*` when creating your PR.
path: docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm
user: login: PavelLinearB
body: ```suggestion
            Tip: If you want to avoid this comment in the future, you can add a label of the format `🤖 ai-*` when creating your PR.

```
created_at: 2025-04-16T17:36:37Z
author_association: CONTRIBUTOR

PR comments: