-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Replace per-skill AI disclosure with a PreToolUse hook #125889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
148082d
691492f
d740af9
081b325
f750f38
8605e50
44b9d43
1c10b95
5a6fd89
1e2ccaf
4d27624
b6477d3
540ccbd
f9187cb
3a45511
b23db60
4212c92
658ba6b
82d68d6
b4c5f18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "hooks": { | ||
| "PreToolUse": [ | ||
| { | ||
| "matcher": "Bash|PowerShell|create|comment|update|edit|review|push|merge", | ||
| "hooks": [ | ||
|
lewing marked this conversation as resolved.
|
||
| { | ||
| "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const a=i.toolArgs||'';const n=i.toolName||'';if(/gh\\s+(pr|issue)\\s+(create|comment|review|edit|merge|close)/.test(a)||/github/i.test(n))process.stderr.write('Include AI-generated content disclosure (> [!NOTE]) per copilot-instructions.md\\n')}catch{}})\"", | ||
| "bash": "d=; while IFS= read -r l; do d=$d$l; done; case $d in *'gh pr create'*|*'gh pr comment'*|*'gh pr review'*|*'gh pr edit'*|*'gh pr merge'*|*'gh issue create'*|*'gh issue comment'*|*'gh issue edit'*|*'gh issue close'*|*github*) echo 'Include AI-generated content disclosure (> [!NOTE]) per copilot-instructions.md' >&2;; esac; :", | ||
| "powershell": "$d = [Console]::In.ReadToEnd(); if ($d -match 'gh (pr|issue) (create|comment|review|edit|merge|close)' -or $d -match 'github') { [Console]::Error.WriteLine('Include AI-generated content disclosure (> [!NOTE]) per copilot-instructions.md') }", | ||
| "timeout": 5 | ||
| } | ||
| ], | ||
| "description": "Remind about AI disclosure when posting to GitHub via gh CLI or MCP tools" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -450,9 +450,14 @@ Key points: each section has multiple outcome variants (pick the one that matche | |
|
|
||
| When posting any content to GitHub under a user's credentials (not a dedicated bot account), you **MUST** include a concise, visible note (e.g. a `> [!NOTE]` alert) indicating the content was AI/Copilot-generated. Skip this if the user explicitly asks you to omit it. | ||
|
|
||
| - **NEVER** use `gh issue close`, `gh issue edit`, `gh issue comment`, or `gh pr review --approve`/`--request-changes` **unless the user explicitly asks you to** after picking an outcome. | ||
|
|
||
| - **Security concerns are out of scope.** Do not assess, discuss, or make recommendations about potential security implications. Security assessment is handled through separate processes. | ||
| - **NEVER** use `gh issue close`, `gh issue edit`, `gh issue comment`, or | ||
| `gh pr review --approve`/`--request-changes` **unless the user explicitly | ||
| asks you to** after picking an outcome. | ||
|
Comment on lines
451
to
+455
|
||
|
|
||
| - **Security concerns are out of scope.** This skill does not assess, discuss, or | ||
| make recommendations about potential security implications of issues. If you | ||
| believe an issue may have security implications, do not mention this in the | ||
| triage report. Security assessment is handled through separate processes. | ||
|
|
||
| - **Do not guess area labels.** Always cross-reference with `docs/area-owners.md`. | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.