diff --git a/.gemini/skills/android-maps-utils/SKILL.md b/.agents/skills/android-maps-utils/SKILL.md similarity index 100% rename from .gemini/skills/android-maps-utils/SKILL.md rename to .agents/skills/android-maps-utils/SKILL.md diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 000000000..2b7a412b8 --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../.agents/skills \ No newline at end of file diff --git a/.gemini/skills b/.gemini/skills new file mode 120000 index 000000000..2b7a412b8 --- /dev/null +++ b/.gemini/skills @@ -0,0 +1 @@ +../.agents/skills \ No newline at end of file diff --git a/.github/scripts/check_agent_leftovers.py b/.github/scripts/check_agent_leftovers.py new file mode 100755 index 000000000..dba28286f --- /dev/null +++ b/.github/scripts/check_agent_leftovers.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python3 +# +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Fail a pull request that carries leftovers from local or agent-assisted work. + +Only what the pull request adds is checked: added lines of the diff, the +names of added files, the messages of its commits, and its title and body. +Existing content on the base branch is never flagged. + +Things that are fine on the author's machine but wrong in a public repo: + + local paths file:// URLs into home or temp directories, and home + directories themselves (/Users/x/, /home/x/, + /usr/local/google/, C:\\Users\\x\\) + internal links go/ short links, b/ bug IDs, corp and googleplex hosts + secrets Google API keys + agent traces AI co-author trailers, links to agent chat sessions + local files agent settings meant to stay local, merge leftovers + +A line that legitimately needs one of these can opt out by containing +"agent-leftovers: ignore". + +Usage, from the repository root: + + BASE_SHA= [HEAD_SHA=] [PR_TITLE=...] [PR_BODY=...] \\ + check_agent_leftovers.py + +Findings are printed as GitHub Actions error annotations. +""" + +import os +import re +import subprocess +import sys + +IGNORE_MARKER = "agent-leftovers: ignore" + +# This script and its workflow describe the patterns, so they would match them. +SKIPPED_FILES = { + ".github/scripts/check_agent_leftovers.py", + ".github/workflows/agent-leftovers.yml", +} + +CONTENT_PATTERNS = [ + ("local file URL", re.compile(r"file:///(Users|home|usr/local/google|private/var|var/folders|[A-Za-z]:)")), + ("local path", re.compile(r"/usr/local/google/")), + ("local path", re.compile(r"(?