generative-ai / group-licensing
AGENTS.md18k starsChanged 2 months agoApache-2.0View on GitHub
[!IMPORTANT] Before making any code changes, architectural decisions, or refactoring in this codebase, any skill, agent, or subagent MUST first read the service Technical Design Document (TDD) located at docs/TDD.md (in the docs/ subdirectory). This document contains the definitive architectural requirements, data flows, and design rationale for the service. No linter config is present; use go vet ./... for static checks. Strict Ports and Adapters (Hexagonal Architecture). The layers must not be mixed: Every adapter declares a compile-time interface satisfaction…
Trending
More talk lately.about the whole repository
Who's talking about GoogleCloudPlatform/generative-ai
- langchain-ai/langchain“Feature request: Vertex AI Function Calling”GitHub · Dec 22, 2023 · 9 reactions
- A Hacker News story“Google Always-On Memory Agent”Hacker News · Mar 7, 2026 · 5 points
- langchain-ai/langchain-google“support for JSON output mode in ChatGoogleGenerativeAI”GitHub · Sep 6, 2024 · 4 reactions
- cicero-im/generative-ai“Jsje”GitHub · May 17, 2025 · 3 reactions
- @github-trending.bsky.social“📦 GoogleCloudPlatform / generative-ai ⭐ 9,197 (+20) 🗒 Jupyter Notebook Sample code and notebooks for …”Bluesky · Feb 7, 2025 · 2 likes
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub, Bluesky and Hacker News (52 times).
On GitHub · 43
- Dec 22, 2023Feature request: Vertex AI Function Calling — langchain-ai/langchain9 reactions · 1 comment
- Sep 6, 2024support for JSON output mode in ChatGoogleGenerativeAI — langchain-ai/langchain-google4 reactions · 7 comments
- May 17, 2025Jsje — cicero-im/generative-ai3 reactions · 35 comments
- Jan 25, 2025error occurring while using Gemini with multiple tools — agno-agi/agno2 reactions · 2 comments
- Apr 26, 2025Use PCM instead of OGG_OPUS for Google TTS — livekit/agents1 reaction · 6 comments
38 more on GitHub
- May 7, 2024[FEAT]: Add a "SQL Talk Agent" — Mintplex-Labs/anything-llm1 reaction · 5 comments
- Jan 13, 2024Google Official API — dsdanielpark/Bard-API1 reaction
- Oct 29, 2026agent-plugins.github.googlecloudplatform.generative-ai: 0-unstable-2026-10-12 → 0-unstable-2026-10-29 — sudosubin/agents.nix0 reactions
- Oct 21, 2026ImageLab prepara y termina la imagen del carril en lote (Vertex batch) y envía el lote por /api/lote — unrealvillestudio-hub/ImageLab0 reactions · 2 comments
- Oct 14, 2026agent-plugins.github.googlecloudplatform.generative-ai: 0-unstable-2026-10-13 → 0-unstable-2026-10-12 — sudosubin/agents.nix0 reactions
- Oct 14, 2026agent-plugins.github.googlecloudplatform.generative-ai: init at 0-unstable-2026-10-13 — sudosubin/agents.nix0 reactions
- Sep 5, 2026Gemini 3.8 Flash only for end users — Gugurbuz/JETWORK0 reactions · 1 comment
- Aug 17, 2026Session.CallTool appends one message per tool call, so a parallel tool turn is answered in several turns — gollem-dev/agentkit0 reactions · 1 comment
- Aug 14, 2026chore: remove relocated experiment stubs (storycraft, VeoStart) — GoogleCloudPlatform/genmedia-creative-studio0 reactions · 1 comment
- May 18, 2026feat: token harvester, always-on memory system, and conductor track references — rb1whitney/agentic-project-factory0 reactions
- May 18, 2026feat: Token Harvester Cost Reduction + Always-On Memory System — rb1whitney/agentic-project-factory0 reactions
- Apr 16, 2026feat: add bigquery ai-ml skills — GoogleCloudPlatform/bigquery-data-analytics-plugin0 reactions
- Mar 24, 2026Add support for vector search 2.0 — GoogleCloudPlatform/genai-factory0 reactions · 1 comment
- Mar 13, 2026Memory Bank - Memory Generation with Files — google/adk-python0 reactions · 4 comments
- Mar 11, 2026📈 Bản tin xu hướng AI mã nguồn mở 2026-03-11 — compasify/agents-radar0 reactions
- Mar 10, 2026📈 Bản tin xu hướng AI mã nguồn mở 2026-03-10 — compasify/agents-radar0 reactions
- Dec 19, 2025google veo 3.1 preview has extend video functionality — griptape-ai/griptape-nodes-library-standard0 reactions
- Dec 14, 2025Integrate with Gemini Live API — changtimwu/you-kb0 reactions · 1 comment
- Nov 24, 2025Fix GoogleSearchRetrieval import to use proper grounding module — anonx00/phantom0 reactions · 1 comment
- Oct 14, 2025 — Chaiyphopnilpat/generative-ai0 reactions
- Oct 14, 2025## Code Review — Chaiyphopnilpat/generative-ai0 reactions
- Aug 22, 2025[Bug]: — Michael-Santoro/generative-ai-evaluation-framework0 reactions · 1 comment
- Apr 18, 2025chore: Migrate Notebooks to Generative AI Repository — GoogleCloudPlatform/applied-ai-engineering-samples0 reactions · 1 comment
- Mar 15, 2025VertexAIServerModel Integration to Enable Openinference instrumentation with Phoenix — huggingface/smolagents0 reactions · 1 comment
- Mar 10, 2025Fix LiveConnectConfig validation error — heiko-hotz/gemini-multimodal-live-dev-guide0 reactions
- Feb 13, 2025All .ipynb page lengths are infinitely extended — StylishThemes/GitHub-Dark0 reactions · 1 comment
- Feb 3, 2025Add Gemini models native support as LLM judge — confident-ai/deepeval0 reactions · 10 comments
- Dec 12, 2024GoogleCloudPlatform/generative-ai, Google, 2024.12 — AkihikoWatanabe/paper_notes0 reactions · 2 comments
- Dec 12, 2024Gemini 2.0 Flash released (12, Dec) — gongqi-zhen/HealthBuddy-QA0 reactions
- Sep 21, 2024googleapi/vertex: fix multi-tool call error, Invalid argument — tmc/langchaingo0 reactions · 3 comments
- Jun 6, 2024[Bug]: SQLTalk demo is using VertexAI SDK, not Gemini SDK but is branded as GeminiAI — google-gemini/deprecated-generative-ai-python0 reactions · 1 comment
- May 18, 2024Content has no parts — google-gemini/deprecated-generative-ai-python0 reactions · 5 comments
- Jan 9, 2024feat: add image gen and image processing — String-sg/ai-starter-kit0 reactions
- Dec 8, 2023Google Gemini LLM — ObrienlabsDev/blog0 reactions · 8 comments
- Nov 23, 2023Google Palm API should(?) also support the Vertex AI — patterns-ai-core/google_palm_api0 reactions · 1 comment
- Oct 20, 2023fix: Empty Page SubElements — googleapis/python-documentai-toolbox0 reactions · 1 comment
- Aug 18, 2023Gen AI module - roles and api — GoogleCloudPlatform/rad-lab0 reactions · 7 comments
- Aug 8, 2023Question Answering Over Documents — NeroCube/bookmark0 reactions
On Bluesky · 6
- Feb 7, 2025📦 GoogleCloudPlatform / generative-ai ⭐ 9,197 (+20) 🗒 Jupyter Notebook Sample code and notebooks for Generative AI on Google Cloud, with… — @github-trending.bsky.social2 likes and reposts
- Dec 13, 2024📦 GoogleCloudPlatform / generative-ai ⭐ 8,514 (+48) 🗒 Jupyter Notebook Sample code and notebooks for Generative AI on Google Cloud, with… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Sep 1, 2026🚀 GitHub Intelligence Drop generative-ai (Jupyter Notebook • 🟢) ⭐ 17.6K → https://github.com/GoogleCloudPlatform/generative-ai… — @githubfeed.bsky.social1 likes and repost
- Dec 15, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 GoogleCloudPlatform / generative-ai ⭐ 3,014 (+181) 🗒 Jupyter Notebook Sample code and notebooks for… — @github-trending.bsky.social1 likes and repost · 1 reply
- Mar 7, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 GoogleCloudPlatform / generative-ai ⭐ 13,222 (+348) 🗒 Jupyter Notebook Sample code and notebooks… — @github-trending.bsky.social0 likes and reposts · 1 reply
1 more on Bluesky
- Nov 16, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 GoogleCloudPlatform / generative-ai ⭐ 7,628 (+163) 🗒 Jupyter Notebook Sample code and notebooks for… — @github-trending.bsky.social0 likes and reposts · 1 reply
On Hacker News · 3
- Mar 7, 2026Google Always-On Memory Agent5 points · 1 comment
- Oct 1, 2024Analyze a Codebase with the Vertex AI Gemini 1.5 Pro2 points
- Dec 12, 2024Multimodal Live API with Gen AI SDK1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- search/gemini-enterprise/ge-demo-generator/AGENTS.mdAGENTS.md
- professional-documentSkill
- professional-presentationSkill
- web-reportSkill
- ge-demo-generatorSkill
- professional-documentSkill
- professional-presentationSkill
- web-reportSkill
- ge-demo-videoSkill
- migration-config-skillSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 1 is common, 4 are distinctive, and 6 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
No linter config is present.
- Distinctive: line 44
Every adapter declares a compile-time interface satisfaction check:
- Distinctive: line 48
Add this to any new adapter you write.
- Distinctive: line 129
Never promote a soft-failure error to a hard failure.
- Very specific: line 173
All tests are unit tests. go test ./...
- Very specific: line 174
Use testify/mock for port mocks.
- Common: line 178
Do not add integration tests or tests that require Google Cloud credentials.
- Very specific: line 228
All logs are structured JSON emitted to stdout via log/slog (slog.NewJSONHandler).
- Very specific: line 234
When working on complex tasks in this repository, you can delegate work to specialized subagents using invoke_subagent.
- Distinctive: line 253
Mandatory TDD Review: When delegating any task that involves modifying code or architecture, explicitly instruct the invoked subagent or …
- Very specific: line 255
Isolated Adapter Refactoring: When modifying an individual adapter or adding a new port/adapter implementation, delegate to a self subagent …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Gemini Enterprise Group Licensing — Agent Context
Mandatory First Step: Read the Service TDD
[!IMPORTANT] Before making any code changes, architectural decisions, or refactoring in this codebase, any skill, agent, or subagent MUST first read the service Technical Design Document (TDD) located at docs/TDD.md (in the
docs/subdirectory). This document contains the definitive architectural requirements, data flows, and design rationale for the service.
Project identity
- Module:
github.com/GoogleCloudPlatform/generative-ai/search/gemini-enterprise/group-licensing - Language: Go 1.25.4
- Deployment: Google Cloud Run Jobs (serverless batch — no HTTP server)
- Purpose: Automates Gemini Enterprise license lifecycle management by reconciling Google Cloud Identity group membership with Discovery Engine user license state. Runs two independent workflows from a single binary:
joiner(grant) andgarbage_collection(revoke).
Quick reference
# Run all unit tests (no credentials required)
go test ./...
# Build the binary
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /tmp/job ./cmd/job
# Build the container image
docker build -t gemini-box-office:latest .No linter config is present; use go vet ./... for static checks.
Architecture
Strict Ports and Adapters (Hexagonal Architecture). The layers must not be mixed:
cmd/job/main.go composition root — wires adapters into services, dispatches workflow
internal/ports/ Go interfaces (the ports) — the only API surface the service layer sees
internal/adapters/ Concrete Google SDK implementations of the ports
internal/services/ Pure business logic — imports ports only, never adapter or SDK packages
internal/models/ Domain types, enums, sentinel errors, constants — no external imports
internal/config/ Config loading and env-var parsing
internal/middleware/ slog logger retrieval from contextEvery adapter declares a compile-time interface satisfaction check:
var _ ports.SomeClient = (*Adapter)(nil)Add this to any new adapter you write.
Key files
| File | Role |
docs/TDD.md | Technical Design Document (MUST READ FIRST before any changes) — definitive service architecture, data flows, and requirements |
docs/PRD.md | Product Requirements Document — background and user stories |
cmd/job/main.go | Entry point. 8-step startup: logger → config → settings → logger enrichment → project sharding → client init → workflow dispatch → exit |
internal/ports/gemini.go | GeminiClient interface (Discovery Engine) |
internal/ports/idp.go | IdpClient interface (Cloud Identity) |
internal/ports/resourcemanager.go | ResourceManagerClient interface |
internal/services/joiner.go | Joiner workflow business logic |
internal/services/gc.go | GC workflow business logic + chunkLicenseUpdates (shared) |
internal/services/mocks_test.go | testify/mock implementations of all three ports (package-internal) |
internal/models/types.go | Domain data structures: Member, UserLicense, LicenseUpdate, LicenseConfigKey, LicenseConfigEntry, LicenseConfigIndex |
internal/models/enums.go | All typed-string enums: SKU, WorkflowType, LicenseState, LicenseAction, Location, MemberType |
internal/models/errors.go | All sentinel errors — use errors.Is against these |
internal/models/constants.go | MaxBatchSize=100, MembersListPageSize=200, MaxPagesPerGroup=5000, ConfigFilePath |
internal/models/dto/sync.go | Request and response DTOs (SyncAddRequest/Response, SyncRemoveRequest/Response) |
internal/config/config.go | JSON config parsing and validation rules for entitlement configuration |
internal/config/job_settings.go | Parses and validates Cloud Run Job runtime environment variables (JOB_TYPE, DRY_RUN, etc.) |
internal/adapters/discoveryengine/adapter.go | Most complex adapter — see Known Constraints below |
internal/adapters/cloudidentity/adapter.go | Cloud Identity Admin SDK adapter implementation |
internal/adapters/resourcemanager/adapter.go | Cloud Resource Manager API v3 adapter implementation |
Ports (interfaces)
// ports/gemini.go
type GeminiClient interface {
FetchLicenseConfigIndex(ctx context.Context, billingAccountID string, directLaw bool) (models.LicenseConfigIndex, error)
ListUserLicenses(ctx context.Context, projectID string, location models.Location, pageToken string) ([]models.UserLicense, string, error)
BatchUpdateUserLicenses(ctx context.Context, projectID string, location models.Location, updates []models.LicenseUpdate) error
FetchLicenseUsageStats(ctx context.Context, projectID string, location models.Location) (map[string]int64, error)
}
// ports/idp.go
type IdpClient interface {
ListMembers(ctx context.Context, groupEmail, pageToken string) ([]models.Member, string, error)
HasMember(ctx context.Context, groupEmail, userEmail string) (bool, error)
}
// ports/resourcemanager.go
type ResourceManagerClient interface {
ResolveProjectNumber(ctx context.Context, projectID string) (string, error)
}Workflows
Joiner (JOB_TYPE=joiner)
FetchLicenseConfigIndex— builds aLicenseConfigIndex:map[LicenseConfigKey][]LicenseConfigEntry. Multiple active subscriptions for the same(SKU, ProjectNumber, Location)appear as distinct slice entries (multi-pool spill).ResolveProjectNumber— project IDs → numeric project numbers (Discovery Engine paths use numbers).- Per project: page through all group members via
ListMembers(withincludeDerivedMembership=true), resolve the highest-precedence SKU per user viaSKU.HasHigherPrecedenceThan. - Group grant updates by
LicenseConfigKey, chunk toMaxBatchSize=100, callBatchUpdateUserLicenses. - On
ErrLicensesExhausted: callFetchLicenseUsageStatsfor observability, retry remaining users in the batch 1-by-1 so no-op grants do not strand available seats, and carry ungranted remainder to the next subscription pool in the slice. After all pools exhausted, soft-fail remaining users (licenses_soft_failedin summary log). Exit 0.
Garbage Collection (JOB_TYPE=garbage_collection)
- Deduplicate locations from project config; iterate each location separately.
- Page through
ListUserLicenses; skipState=REVOKEDrecords. - Per active license, evaluate
shouldRevoke:- Staleness (only when
staleness_threshold_days > 0): reference time =LastLoginTime→ fallbackAssignmentTime→ fallback zero (treat as stale). Short-circuits the membership check. - Entitlement:
HasMemberfor every group in the project config. Firsttrue→ keep. All false → revoke.
- Staleness (only when
- Collect revocation candidates per page, flush in
MaxBatchSizechunks, then advance to the next page (bounds memory).
SKU precedence (highest → lowest)
SEARCH_AND_ASSISTANT (13) → ENTERPRISE (12) → SEARCH (11) → NOTEBOOK_LM (10) → AGENTSPACE_BUSINESS (9) → AGENTSPACE_STARTER (8) → FRONTLINE_WORKER (7) → FRONTLINE_STARTER (6) → ENTERPRISE_EMERGING (5) → EDU_PRO (4) → EDU (3) → EDU_PRO_EMERGING (2) → EDU_EMERGING (1)
Error handling model
| Error | Classification | Behavior |
ErrLicensesExhausted | Soft failure (joiner only) | Fetch usage stats, retry 1-by-1, spill to next pool, WARN log, exit 0 |
ErrInvalidMemberKey | Soft failure (GC only) | Skip user, WARN log with problematic_username, no revocation |
ErrAPIRateLimited | Hard failure | Return error, job exits 1 |
| All other errors | Hard failure | Return error, job exits 1 |
Never promote a soft-failure error to a hard failure. Never demote a hard failure to a soft one without explicit justification.
Configuration
Runtime config is read from /run/secrets/entitlements.json (mounted from Secret Manager):
{
"billing_account_id": "ABCDE-12345-FGHIJ",
"projects": {
"customer-project-alpha": [
{
"subscription_tier": "SUBSCRIPTION_TIER_ENTERPRISE",
"location": "global",
"groups": ["eng-team@example.com"]
}
]
},
"settings": {
"staleness_threshold_days": 30
}
}Validation rules enforced at startup (internal/config/config.go):
billing_account_idmust be non-empty- Project IDs must match
^[a-z][a-z0-9\-]{4,28}[a-z0-9]$ - Each project must have at least one entry with a valid SKU, a valid location (
global/us/eu), and at least one group email staleness_threshold_daysmust be>= 0(0 = disabled)
Environment variables (internal/config/job_settings.go):
| Variable | Required | Default | Notes |
JOB_TYPE | Yes | — | joiner or garbage_collection |
DRY_RUN | No | false | Skips all write API calls when true |
DIRECT_LAW | No | false | When true, assignments map to admin-specified subscription IDs |
GC_SKIP_GROUP_EVAL | No | false | When true, GC skips group membership checks and revokes based on staleness only |
GC_GROUP_CACHING_MODE | No | false | When true, GC pre-fetches and caches group members in memory |
CLOUD_RUN_TASK_INDEX | No | 0 | Injected by Cloud Run |
CLOUD_RUN_TASK_COUNT | No | 1 | Injected by Cloud Run |
Testing conventions
- All tests are unit tests.
go test ./...requires no credentials and no network. - Use
testify/mockfor port mocks. The three mock implementations live ininternal/services/mocks_test.go(packageservices, not exported). Add new mock methods there rather than creating separate mock files. - Adapter tests inject testable interfaces via package-private
newWith*constructors (e.g.,cloudidentity.newWithMembers,discoveryengine.newWithClient). Follow this pattern for any new adapter. - Service tests are white-box (same package,
package services). Use table-driven tests witht.Runsub-tests. - Config tests write fixture JSON to
t.TempDir()— never write to the module root. - Do not add integration tests or tests that require Google Cloud credentials.
Known constraints and non-obvious decisions
Revoke field mask omits license_config: BatchUpdateUserLicenses for REVOKE sends only ["license_assignment_state"] in the update mask. Including license_config alongside NO_LICENSE state triggers a known API bug ("subscription reaches the limit"). Do not change this without re-testing against the live API.
Discovery Engine gRPC client caching uses double-checked locking: The discoveryengine adapter lazily creates one gRPC client per location using a sync.Mutex. The lock is released before the blocking dial, then re-acquired before writing the cache. A post-write check guards against concurrent winners. Do not simplify this without understanding the race.
Project sharding is deterministic: main.go sorts project map keys with slices.SortedFunc before applying modulo arithmetic. This ensures each project is processed by exactly one task instance. Any change to the sharding logic must preserve determinism across all concurrent task instances.
LicenseConfigIndex maps to a slice, not a single entry: A billing account can have multiple active subscriptions for the same (SKU, ProjectNumber, Location). The slice preserves all pools in order; the joiner iterates them to spill ungranted users from an exhausted pool into the next one. Never collapse this to a single entry.
MaxPagesPerGroup=5000 is a safety net, not a hard error: When the limit is hit, a WARN is logged and processing continues with partial results. This applies to both collectGroupMembers (joiner) and the license listing loop (GC). Partial results are always preferred over a full job failure for a scheduled reconciliation job.
DTOs carry vestigial HTTP tags: dto.SyncAddRequest and dto.SyncRemoveRequest have json struct tags referencing POST /sync/add and POST /sync/remove. These are from an earlier HTTP server design. The structs are constructed directly in main.go; no HTTP deserialization occurs. Do not add an HTTP server without re-evaluating the entire auth model.
PII policy: User email addresses must not appear in log output at INFO level or higher. The sole exception is the problematic_username field in the GC ErrInvalidMemberKey warning — it is deliberate and logged to help operators diagnose malformed emails stored in Discovery Engine.
GROUP-typed members are discarded in the joiner: ListMembers is called with includeDerivedMembership=true, which causes the Admin SDK to return flattened leaf members. Any Member whose Type != MemberTypeUser is skipped. Do not attempt to recurse into nested groups manually.
External API surface
The service is a client of three Google Cloud APIs. It exposes no server endpoints.
| API | SDK | Methods used |
Cloud Identity Admin (admin/directory/v1) | REST via google.golang.org/api | members.list (paginated, includeDerivedMembership=true), members.hasMember |
| Discovery Engine gRPC SDK | cloud.google.com/go/discoveryengine/apiv1 | ListUserLicenses (iterator), BatchUpdateUserLicenses (LRO, adapter waits) |
| Discovery Engine REST v1alpha | REST via google.golang.org/api | billingAccounts.billingAccountLicenseConfigs.list, projects.locations.userStores.licenseConfigsUsageStats.list |
| Cloud Resource Manager v3 | REST via google.golang.org/api | projects.get |
Non-global Discovery Engine gRPC calls use regional endpoints:
us→us-discoveryengine.googleapis.com:443eu→eu-discoveryengine.googleapis.com:443global→ default endpoint
IAM requirements
The Cloud Run Job service account needs:
roles/discoveryengine.admin— list and update user licensesroles/cloudidentity.groups.viewer— enumerate group members and check membershiproles/secretmanager.secretAccessor— read the entitlement config volume mountroles/billing.viewer— read billing account license configs
OAuth scopes used:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/admin.directory.group.member.readonly
Logging
All logs are structured JSON emitted to stdout via log/slog (slog.NewJSONHandler). Every log line automatically carries workflow and task_index (set once in main.go step 4). Retrieve the logger in service/adapter code via middleware.LoggerFromContext(ctx) — never call slog.Default() directly from library code.
Required fields on summary log lines: duration_ms, workflow-specific counts (licenses_granted, licenses_revoked, licenses_soft_failed, groups_processed, users_evaluated), dry_run.
Available Subagents & Delegation
When working on complex tasks in this repository, you can delegate work to specialized subagents using invoke_subagent.
Built-in Subagents
| Subagent | Capabilities | Best Used For |
research | Read-only codebase exploration, file reading, and web search | Running broad codebase surveys, searching documentation, or investigating multi-package patterns without cluttering the primary conversation context. |
self | Full inheritance of parent agent's configuration, read/write/execute tools, and model | Running independent implementation tasks, refactoring isolated adapters, or executing comprehensive test suites in a separate conversation context. |
owl | Multi-agent orchestrator with deep strategic planning and verification | Solving complex architectural tasks, large-scale refactoring, or difficult bugs requiring multi-perspective analysis and rigorous verification. |
Custom Subagents
You can also define custom subagents using define_subagent and invoke them with invoke_subagent. Subagent workspaces can be configured as:
inherit: Uses the same workspace as the parent agent (default).branch: Creates an isolated workspace branched or cloned from the parent.share: Creates a new workspace sharing the underlying repository directory (similar to a git worktree) for independent branching without storage duplication.
Delegation Guidelines for this Repository
- Mandatory TDD Review: When delegating any task that involves modifying code or architecture, explicitly instruct the invoked subagent or skill to read docs/TDD.md before making any changes.
- Research & Exploration: For tasks requiring exploration across multiple adapters (
discoveryengine,cloudidentity,resourcemanager), delegate investigation to aresearchsubagent. - Isolated Adapter Refactoring: When modifying an individual adapter or adding a new port/adapter implementation, delegate to a
selfsubagent in abranchorshareworkspace to keep changes isolated and test them cleanly before merging back. - Direct Implementation: For focused, single-package edits (e.g., updating a sentinel error in
models/errors.goor modifying a service test), perform the work directly in the main conversation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

