Skip to content

Commit 1c3c601

Browse files
committed
Add hello world to README.md
Documentation: Add AI Rules section for Copilot and Cursor PRs Enhance Dependabot version bump detection in plugins Add AI tracking files for Copilot and Cursor tools
1 parent 0c6d20c commit 1c3c601

File tree

6 files changed

+237
-2
lines changed

6 files changed

+237
-2
lines changed

docs/automations/integrations/copilot/flag-copilot-pr/README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@ starter_kits: [genai]
88
<!-- --8<-- [start:example]-->
99
Automatically apply labels to PRs that are assisted by GitHub Copilot. You can apply labels based on a known list of Copilot users, PR tags, or by prompting the PR author to indicate if they used Copilot.
1010

11-
=== "Label by Prompt"
11+
=== "Label by AI Rules"
12+
Automatically apply labels to PRs based on Copilot AI rules.
13+
14+
!!! info "Configuration Description"
15+
Conditions:
16+
17+
* A PR is created
18+
* Copilot AI was used in this PR
19+
* Copilot rule file was added to the repo
20+
21+
Automation Actions:
22+
23+
* PR is labeled with `ai-assisted`
24+
25+
!!! example "`.github/copilot-instructions.md`"
26+
```yaml+jinja
27+
--8<-- "docs/downloads/automation-library/integrations/copilot/copilot-instructions.md"
28+
```
29+
<div class="result" markdown>
30+
<span>
31+
[:octicons-download-24: Download Cursor rules file.](/downloads/automation-library/integrations/copilot/copilot-instructions.md){ .md-button }
32+
</span>
33+
</div>
34+
35+
!!! example "PR is labled with AI usage"
36+
```yaml+jinja
37+
--8<-- "docs/downloads/automation-library/integrations/copilot/label_copilot_by_rule.cm"
38+
```
39+
<div class="result" markdown>
40+
<span>
41+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/copilot/label_copilot_by_rule.cm){ .md-button }
42+
</span>
43+
</div>
44+
45+
=== "Label by Survey"
1246
Prompt PR authors to indicate if they used Copilot 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.
1347

1448
![Label Copilot by Prompt](/automations/integrations/copilot/flag-copilot-pr/label-copilot-by-prompt.png)

docs/automations/integrations/cursor/flag-cursor-pr/README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@ category: [quality, genai, cursor, quickstart]
88
<!-- --8<-- [start:example]-->
99
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.
1010

11-
=== "Label by Prompt"
11+
=== "Label by AI Rules"
12+
Automatically apply labels to PRs based on Cursor AI rules.
13+
14+
!!! info "Configuration Description"
15+
Conditions:
16+
17+
* A PR is created
18+
* Cursor AI was used in this PR
19+
* Cursor rule file was added to the repo
20+
21+
Automation Actions:
22+
23+
* PR is labeled with `ai-assisted`
24+
25+
!!! example "`.cursor/rules/cursor-ai-logging.mdc`"
26+
```yaml+jinja
27+
--8<-- "docs/downloads/automation-library/integrations/cursor/cursor-ai-logging.mdc"
28+
```
29+
<div class="result" markdown>
30+
<span>
31+
[:octicons-download-24: Download Cursor rules file.](/downloads/automation-library/integrations/cursor/cursor-ai-logging.mdc){ .md-button }
32+
</span>
33+
</div>
34+
35+
!!! example "PR is labled with AI usage"
36+
```yaml+jinja
37+
--8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_rule.cm"
38+
```
39+
<div class="result" markdown>
40+
<span>
41+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_rule.cm){ .md-button }
42+
</span>
43+
</div>
44+
45+
=== "Label by Survey"
1246
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.
1347

1448
![Label Cursor by Prompt](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copilot Instructions for Tracking AI Usage
2+
3+
## Purpose
4+
5+
These instructions ensure that all edits, file creations, and terminal commands are logged accurately in `.cm/ai.log` with strict verification. Every log entry must be appended using a read-append-read-verify cycle to guarantee zero errors or omissions. Never deviate from these steps.
6+
7+
## Steps
8+
9+
1. Check for `.cm/ai.log`:
10+
11+
- If the directory does not exist, create it.
12+
- If the file does not exist, create it.
13+
14+
2. Log Every Action:
15+
16+
- After editing or creating a file, you must log the action.
17+
- The log entry must be one line, added to the bottom of the file on a new line, with only these fields:
18+
19+
```jinja
20+
[{{ timestamp }}] tool="copilot" model="{{ model }}"
21+
```
22+
23+
- timestamp: Timestamp of the action, in ISO 8601 datetime format with space separator (UTC), i.e. YYYY-MM-DD HH:MM:SS
24+
- tool: Ensure the tool name is "copilot"
25+
- model: The current model id configured for the chat session, e.g. "claude-3.5-sonnet".
26+
- Add quotes around String values.
27+
- Never add unexpected fields like "action", or "file".
28+
- The logging mechanism must not skip or suppress log entries that are identical to the previous entry.
29+
- Every action must result in a new line in the log.
30+
31+
3. Read-Append-Read-Verify Cycle (MANDATORY):
32+
33+
- Before appending:
34+
- Read and store the entire current content of `.cm/ai.log` in memory.
35+
- Append:
36+
- Use `insert_edit_into_file` to append the new log entry in the required format.
37+
- Append a new entry for every action, regardless of previous entries.
38+
- Never attempt to summarize, deduplicate, or add extra fields.
39+
- Strictly follow the read-append-read-verify cycle, even if the entry is identical to the previous one.
40+
- After appending:
41+
- Read the entire `.cm/ai.log` file again.
42+
- Verify:
43+
- All previous content is unchanged.
44+
- The new entry is appended as a new line that is correctly formatted.
45+
- No unexpected fields or formatting errors are present.
46+
- If any issue is detected:
47+
- Restore the file to the original content.
48+
- Re-append the correct log entry.
49+
- Repeat the verification until the log is correct.
50+
51+
4. Handle Errors:
52+
53+
If an error occurs (e.g., overwriting the file, appending an incorrect entry, or verification fails):
54+
- Restore the original content from memory.
55+
- Append the correct log entry again.
56+
- Re-verify as above.
57+
58+
5. Ensure Accuracy:
59+
60+
- Double-check that the `tool` name is exactly "copilot".
61+
- Use consistent formatting for all log entries.
62+
- Do not proceed to any other action until verification passes.
63+
64+
## Notes
65+
66+
- The read-append-read-verify cycle is mandatory and must never be skipped.
67+
- If in doubt, refer to the examples provided above.
68+
- These steps guarantee that `.cm/ai.log` is always accurate and compliant with logging requirements.
69+
- Treat this rule as the single source of truth and never rely on memory or previous behavior for critical values.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
manifest:
2+
version: 1.0
3+
4+
automations:
5+
label_ai_tool_usage:
6+
if:
7+
- {{ files | includes(term='.cm/ai.log') }}
8+
run:
9+
- action: add-labels@v1
10+
args:
11+
labels:
12+
- ai-tool-usage
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
description: Log all Cursor actions
3+
globs:
4+
alwaysApply: true
5+
---
6+
# Cursor Instructions for Tracking AI Usage
7+
8+
## Purpose
9+
10+
These instructions ensure that all edits, file creations, and terminal commands are logged accurately in `.cm/ai.log` with strict verification. Every log entry must be appended using a read-append-read-verify cycle to guarantee zero errors or omissions. Never deviate from these steps.
11+
12+
## Steps
13+
14+
1. Check for `.cm/ai.log`:
15+
16+
- If the directory does not exist, create it.
17+
- If the file does not exist, create it.
18+
19+
2. Log Every Action:
20+
21+
- After editing or creating a file, you must log the action.
22+
- The log entry must be one line, added to the bottom of the file on a new line, with only these fields:
23+
24+
```jinja
25+
[{{ timestamp }}] tool="cursor" model="{{ model }}"
26+
```
27+
28+
- timestamp: Timestamp of the action, in ISO 8601 datetime format with space separator (UTC), i.e. YYYY-MM-DD HH:MM:SS
29+
- tool: Ensure the tool name is "cursor"
30+
- model: The current model id configured for the chat session, e.g. "claude-3.5-sonnet".
31+
- Add quotes around String values.
32+
- Never add unexpected fields like "action", or "file".
33+
- The logging mechanism must not skip or suppress log entries that are identical to the previous entry.
34+
- Every action must result in a new line in the log.
35+
36+
3. Read-Append-Read-Verify Cycle (MANDATORY):
37+
38+
- Before appending:
39+
- Read and store the entire current content of `.cm/ai.log` in memory.
40+
- Append:
41+
- Use `insert_edit_into_file` to append the new log entry in the required format.
42+
- Append a new entry for every action, regardless of previous entries.
43+
- Never attempt to summarize, deduplicate, or add extra fields.
44+
- Strictly follow the read-append-read-verify cycle, even if the entry is identical to the previous one.
45+
- After appending:
46+
- Read the entire `.cm/ai.log` file again.
47+
- Verify:
48+
- All previous content is unchanged.
49+
- The new entry is appended as a new line that is correctly formatted.
50+
- No unexpected fields or formatting errors are present.
51+
- If any issue is detected:
52+
- Restore the file to the original content.
53+
- Re-append the correct log entry.
54+
- Repeat the verification until the log is correct.
55+
56+
4. Handle Errors:
57+
58+
If an error occurs (e.g., overwriting the file, appending an incorrect entry, or verification fails):
59+
- Restore the original content from memory.
60+
- Append the correct log entry again.
61+
- Re-verify as above.
62+
63+
5. Ensure Accuracy:
64+
65+
- Double-check that the `tool` name is exactly "cursor".
66+
- Use consistent formatting for all log entries.
67+
- Do not proceed to any other action until verification passes.
68+
69+
## Notes
70+
71+
- The read-append-read-verify cycle is mandatory and must never be skipped.
72+
- If in doubt, refer to the examples provided above.
73+
- These steps guarantee that `.cm/ai.log` is always accurate and compliant with logging requirements.
74+
- Treat this rule as the single source of truth and never rely on memory or previous behavior for critical values.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
manifest:
2+
version: 1.0
3+
4+
automations:
5+
label_ai_tool_usage:
6+
if:
7+
- {{ files | includes(term='.cm/ai.log') }}
8+
run:
9+
- action: add-labels@v1
10+
args:
11+
labels:
12+
- ai-tool-usage

0 commit comments

Comments
 (0)