agentleFS
mo-cmykmo-cmyk/mazarbul/.claude/skills/aip-naming/SKILL.md

aip-naming

Skill2 starsChanged 35 days agoApache-2.0View on GitHub

Google AIP naming compliance applied to Mazarbul's JSON APIs, MCP tool schemas, and Go internal types. USE WHEN editing JSON Schema files, MCP tool definitions, Go domain types with JSON tags, OpenAPI specs, or any code that exposes external names (resource paths, field names, method verbs). Covers AIPs 122/123/131-135/140/142/155/158/160/192/193/203 applied without proto.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run go vet ./... plus mise run lint.

    line 21
  2. Very specific:

    Every JSON Schema property carries description.

    line 48
  3. Very specific:

    Use the /new-resource skill, it's the end-to-end checklist (schema -> kernel writer -> MCP tool -> tests -> docs).

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google AIP Naming Compliance (no proto)

Mazarbul does not use proto. The wire format is JSONL. The schema layer is JSON Schema. Types are Go structs with json: tags. AIP naming conventions still apply to the JSON, MCP, and Go surface, this skill captures the mapping.

Reference: agent-docs/synthesis.md section 3 ("AIP naming applied without proto") for worked examples.

Workflow (mandatory)

  1. Define or update the JSON Schema in internal/kernel/schemas/ (or where the kernel maintains schemas).
  2. Define or update the Go struct in the matching package with json: tags.
  3. Run go vet ./... plus mise run lint.
  4. Tests cover happy path plus at least one documented error code.

Required AIPs

Reference: https://google.aip.dev

AIPPurposeMazarbul application
AIP-122Resource referencesForeign-key field stores the canonical resource name (name: "entities/{entity}").
AIP-123Resource definitionsEvery resource has a singular noun, plural collection, and stable name pattern.
AIP-131Get methodsGet<Resource> request shape: { name: string }.
AIP-132List methodsList<Resource> request: { parent, pageSize, pageToken, filter, orderBy }. Response: { <resources>: [], nextPageToken: string }.
AIP-133Create methodsCreate<Resource> request: { parent, <resourceId?>, <resource> }.
AIP-134Update methodsUpdate<Resource> request: { <resource>, updateMask }.
AIP-135Delete methodsDelete<Resource> request: { name }. Soft-delete via supersede.
AIP-140Field namesBooleans as adjectives without is/has/can (active, not isActive).
AIP-142Time fields*Time suffix: createTime, updateTime, deleteTime. Never *_at.
AIP-155IdempotencyrequestId UUID4 on mutating operations; 24h dedup.
AIP-158PaginationCursor-based via pageToken. No offset pagination.
AIP-160FilteringCEL-style filter strings.
AIP-192DocumentationJSON Schema description on every property; Go-doc on every exported field.
AIP-193Error modelJSON-RPC error code + structured data.cause for MCP; HTTP status + RFC 7807 problem JSON for the HTTP API.
AIP-203Field behaviorExpress as JSON Schema constraints (required, readOnly, writeOnly).

Documentation conventions (AIP-192 spirit)

Every JSON Schema property carries description. Every exported Go field carries a Go-doc comment. Imperative mood.

JSON Schema:

{
  "type": "object",
  "description": "Entity is the canonical record of a person, place, or thing in Mazarbul.",
  "properties": {
    "name": {
      "type": "string",
      "description": "Resource name, e.g. entities/{entity}.",
      "pattern": "^entities/[A-Z0-9]{26}$"
    },
    "createTime": {
      "type": "string",
      "format": "date-time",
      "description": "Time the entity was first observed. Set by server."
    }
  },
  "required": ["name", "createTime"]
}

Go:

// Entity is the canonical record of a person, place, or thing in Mazarbul.
type Entity struct {
    // Name is the resource name, e.g. entities/{entity}.
    Name string `json:"name"`
    // CreateTime is the time the entity was first observed. Set by server.
    CreateTime time.Time `json:"createTime"`
}

Naming conventions

  • Go: PascalCase. Single-word acronyms (Jwk, Oidc, Mfa), not JWK/OIDC/MFA. Exception: brand names (OAuth).
  • JSON: camelCase. Same single-word-acronym rule (jwk, oidc, mfa).
  • Resource paths: plural lowercase nouns. entities/{entity}, events/{event}, connectors/{connector}. Placeholder is the singular noun, not the field name.
  • MCP tool names: verbs in lowerCamelCase. searchEvents, getEntity, listConnectors.
  • Boolean fields: adjectives without prefixes. active not isActive. Exception for reserved words.
  • Enum values in Go: PascalCase typed constants (EventKindUnspecified, EventKindCreated). In JSON: SCREAMING_SNAKE_CASE strings ("UNSPECIFIED", "CREATED").
  • Time fields: *Time suffix. createTime, updateTime, deleteTime, expireTime. Never *_at.
  • Configuration toggles: enable<X> for inputs, <x>Enabled for read-only outputs.

Standard request and response shapes

  • Pagination:
    { "pageSize": 50, "pageToken": "abc", "filter": "createTime > 2026-01-01" }
    Response:
    { "events": [...], "nextPageToken": "def" }
  • Idempotency:
    { "requestId": "550e8400-e29b-41d4-a716-446655440000", ... }
  • Field mask (updates):
    { "entity": { ... }, "updateMask": "displayName,labels.kind" }
  • Filter syntax (CEL):
    createTime > "2026-01-01T00:00:00Z" AND source.connector = "gmail"

When adding a new resource

Use the /new-resource skill, it's the end-to-end checklist (schema -> kernel writer -> MCP tool -> tests -> docs).

Gotchas

  • No proto, but proto-equivalent discipline applies. Pre-1.0 we can rename and renumber freely; once external SDKs ship we lock to AIP-180 evolution rules.
  • updateMask must be a comma-separated string of field paths, not an array. AIP-161 specifies dot-notation paths ("profile.displayName,labels.kind").
  • Time fields are always UTC. Go: time.Time with time.Now().UTC(). JSON: RFC 3339 with Z suffix.
  • Resource names are case-sensitive. entities/01H... is different from Entities/01H.... Lowercase the collection, ULID the ID.
  • MCP tool errors use JSON-RPC codes (-32600, -32601, -32602, -32603) plus a data field with structured cause. Mapping to AIP error semantics: INVALID_ARGUMENT -> -32602, NOT_FOUND -> -32602 with data.cause = "not_found", INTERNAL -> -32603.
  • HTTP API uses RFC 7807 (application/problem+json). The HTTP server maps internal errors to status codes per AIP-193 mapping.
  • ULIDs everywhere externally. Internally the storage layer may use numeric IDs for joins, but external names always use ULIDs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.