Skip to content

feat: Introduce AI agent rules and specialized skills - #1577

Open
willum070 wants to merge 9 commits into
mainfrom
add-agent-rules
Open

feat: Introduce AI agent rules and specialized skills#1577
willum070 wants to merge 9 commits into
mainfrom
add-agent-rules

Conversation

@willum070

@willum070 willum070 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR standardizes the repository for autonomous agent assistance by establishing a centralized knowledge base and tooling suite in the new .agents/ directory. By embedding these guidelines directly into the repository, any AI assistant or future contributor will automatically discover and adhere to our established patterns, severely reducing CI pipeline failures and review cycles.

Key Additions

1. Agent Rules (.agents/rules/)
Contains strict, file-level triggered guidelines detailing how samples must be written and modernized. Key rules include:

  • CI Pipeline Alignment: Explicit instructions ensuring agents pass build-single.sh checks (e.g., enforcing void init(), using // prettier-ignore inside script tags, and avoiding direct global google.maps namespace access).
  • Security & Quality: Enforcing modern Promise-based architectures (via Promise.all and importLibrary), proper DOM clearing techniques (using replaceChildren() instead of innerHTML), and secure text rendering.
  • Dynamic Key Injection: Standardizing the GOOGLE_MAPS_API_KEY placeholder across all sample code to ensure CI scripts run successfully.
  • Modern Architecture: Establishing standards for <gmp-map>, <gmp-map-3d>, React patterns, and advanced Maps APIs.

2. Agent Skills (.agents/skills/)
Packages specialized SOPs that can be invoked to automate complex repository tasks.

  • code-review: Guidelines for agentic code reviews specifically geared toward js-api-samples.
  • migration: Runbooks and checklists for transitioning legacy samples to the js-api-samples standards.
  • refactor: Focused patterns for migrating standard 2D samples from programmatic div instantiation to declarative Web Components.
  • refactor-3d: Specialized standards for migrating Maps 3D samples to be TypeScript-centric.

Impact

These rules act as the "source of truth" for code generation. When developers use agentic AI to create or refactor samples moving forward, the agent will seamlessly inject the correct bootstrapping code, adhere to our linting strictness, and correctly implement our Web Component patterns without requiring human correction.

@snippet-bot

snippet-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 7 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@willum070 willum070 changed the title Add agent rules feat: Introduce AI agent rules and specialized skills Jul 24, 2026
@willum070
willum070 requested a review from oppenheimera July 24, 2026 20:21
Change-Id: I827ee90fa6bd7192275c28b3562eae5ce35aa580
Change-Id: I5b30ff79af240ec831557097053e9a6a2dd0f490
Change-Id: I8a1958f51f46bddf40074455b31928ced4b7db96
Change-Id: Ib62a11831c76bc70bee582490c927599675fa84c
…pm run build validation

Change-Id: Icb750eb006af4735576c98677f8ac2a2a1a89c98
Change-Id: I7137d25a244915bab3b20016fbed0bc5a1011c2f
Change-Id: Iba8378bea5744c304399a273a62a28808dfb35b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant