agentleFS
kalaverinkalaverin/skills/api-design/SKILL.md

api-design

Skill1 starsChanged 3 days agoBSD-3-ClauseView on GitHub

MANDATORY skill for Google AIP API resource design and compliance. Covers resources, operations, fields, design patterns, compatibility, polish, and proto API structure. For Buf lint and proto schema style, use the protobuf-lang skill.

190 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use db-design, everything-claude-code and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yuexueyuSkill

    db-design

    数据库工程师技能 - Schema设计、索引优化、并发安全、数据库审计。当你涉及数据库表/字段/索引/SQL/迁移/MCP数据库操作、建表改表、写查询时必须使用此技能。即使用户只是说"加个字段"或"查下数据",也应触发。

    Also in 4 projects that use this

  • InfopibeSkill

    everything-claude-code

    Also in 9 projects that use this

  • mryeastcodeSkill

    everything-claude-code-conventions

    Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

    Also in 8 projects that use this

  • thejordanleopoldSkill

    third-party-integration

    Use when integrating with external APIs, payment processors (Stripe), webhooks, or third-party services. Use when implementing API clients with authentication and rate limiting, handling webhooks with signature verification and idempotency, writing contract tests for external services, or isolating third-party dependencies behind adapters. Triggers: \"Stripe\", \"payment integration\", \"webhook\", \"third-party API\", \"external service\", \"API client\", \"integrate with\", \"signature verification\", \"idempotency key\".

    Also in 3 projects that use this

  • Indium-AI-LabsSkill

    data-pipeline-design

    Design batch or incremental ETL and ELT pipelines and warehouse models: grain, partitioning, idempotent loads, late-arriving data, data quality tests, PII controls, and cost monitoring, before building them. Use when adding or changing a dbt model, warehouse table, scheduled transformation, or ingestion job. Not for transactional schema design (use the database-design skill) or event-sourced stores (use the event-sourcing-architecture skill).

    Also in 3 projects that use this

  • InfopibeSkill

    investor-materials

    Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.

    Also in 21 projects that use this

  • +1 more from Infopibe

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 161 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Deviation Justification: If you deviate from any MUST directive, you MUST explicitly justify the deviation in your output.

    line 21
  2. Very specific:

    Route via the Funnel: Run Command 1, shortlist generously, run Command 2, and select cards semantically (§2.2).

    line 59
  3. Very specific:

    Proto Review (if applicable): If the change touches .proto files, invoke the protobuf-lang skill for Buf lint and proto schema style.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 161 edited versions of this file we could read. “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

SKILL: Strict API Design & Compliance (Google AIP)

You are an expert API Architect. This document is a binding rule set, not a recommendation. Every directive in this guide MUST be followed unless it explicitly uses SHOULD or MAY. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when they appear in all capitals or in bold markup.

1. Compliance and Default Rules

  • Default Rule: Unless a section, paragraph, or sentence explicitly uses SHOULD or MAY, every statement is to be treated as MUST. You MUST NOT apply external style preferences or general API-design heuristics in place of the rules documented here.
  • Deviation Justification: If you deviate from any MUST directive, you MUST explicitly justify the deviation in your output.
  • Skill Boundary: This skill enforces Google AIP resource-design rules (resources, operations, fields, patterns, compatibility, polish, and proto API structure). For Buf lint and proto schema style, consult the protobuf-lang skill.
  • RFC Verbs: For precise semantics of requirement-level verbs, consult the read-for-comments skill.

2. Reference Corpus and Lazy-Load Protocol (CRITICAL)

The references/ corpus is extremely large (7,300+ lines across 11 files). You MUST NOT read reference files in full, load them into context indiscriminately, or summarize the collection. Every reference file opens with YAML frontmatter — a subject line (file-level coarse router) plus an index of decision cards (each card is the selection gate for ONE body section) — and every routable body section is addressed by a [ref: #<anchor>] marker. You MUST route through the frontmatter, never through full-body reads.

2.1 The Two-Command Routing Funnel

The canonical two-command funnel (Command 1 — subject map; Command 2 — full frontmatter of shortlisted files) lives in frontmatter-protocol [ref: #lazy-load-routing]; run it exactly as specified there, from the skill directory (the directory containing this SKILL.md) so that the relative references/ path resolves. If the session working directory is fixed elsewhere, prefix every references/ path with the skill directory path.

2.2 Semantic Routing Rules

Routing is semantic and context-aware, never substring/keyword matching:

  1. Shortlist candidate files from the subject map using subject plus the request plus inferred session work (the artifact you are about to produce, the questions the problem implies). Shortlist generously — when uncertain, expand the file list and re-run Command 2.
  2. Within shortlisted frontmatter, read every card and match what/use_when/avoid_when semantically (OR semantics within and across files). Mark each matching card's anchor.
  3. Deduplicate anchors: several cards MAY share one anchor (convergence); load the shared section once.
  4. Routing stays in the main agent: inferred session context cannot be serialized to a subagent without loss. Subagents receive already-selected material.
  5. Cross-references inside card fields point to better alternatives: (sibling card) = another card for the same anchor in the same file; (<NN>_<name> › <topic>) = a section in the named corpus file (e.g. (07_design_patterns › soft delete)).

2.3 Bounded Section Extraction (MANDATORY)

Extract sections per the canonical loader mechanics in frontmatter-protocol [ref: #lazy-load-routing] — bounded extraction from the target marker to the next marker, never a blind fixed window like rg -A 100 (it truncates large sections and over-reads small ones). The exact command and the marker-listing recipe live there, not here.

Frontmatter extraction warning: match delimiters as anchored whole lines (^---\s*$; in awk: ^---[ \t]*$). Never split on the bare substring --- — bodies legitimately contain --- inside code, and a naive split truncates the frontmatter with false YAML errors.

2.4 Frontmatter Schema Notes

  • Top-level keys: subject, index, aips (skill-extra, below). Cards carry exactly {anchor, what, problem, use_when, avoid_when, expected}.
  • aips — api-design skill-extra field (declared per the lazyload standard's skill-extra mechanism, frontmatter-protocol/references/lazyload.md): a sorted list of the AIP numbers covered by the file, mechanically cross-checked against body section headings. Use it for coarse filtering when the request cites an AIP number directly.
  • avoid_when and expected are empty only for pure lookup sections (Glossary, RFC verbs) that have no anti-pattern and no success state.
  • The normative frontmatter schema, card semantics, and conformance checklist live in frontmatter-protocol/references/lazyload.md; api-design presentation choices live in prompts/REFERENCE_STANDARD_ADDENDUM.md.

3. Master Execution Workflow

  1. Analyze Design Task: Identify the API component (resource, method, field, relationship, error model, etc.) you are creating or reviewing.
  2. Route via the Funnel: Run Command 1, shortlist generously, run Command 2, and select cards semantically (§2.2). Load references/rfc_verbs.md (anchor rfc-verbs) first if any requirement-level verb is ambiguous.
  3. Extract Rules: For each selected anchor, run the bounded extraction (§2.3) and read only that section. Do not load full reference files into context.
  4. Apply Rules: Draft or review routes, resource names, request/response shapes, field semantics, and error behavior so that every element complies with the extracted AIP section.
  5. Proto Review (if applicable): If the change touches .proto files, invoke the protobuf-lang skill for Buf lint and proto schema style. Do not duplicate those rules here.
  6. Verify:
    • Confirm every route, method, field, and resource mentioned in the design complies with the extracted AIP section.
    • Confirm no contradictions exist between referenced sections.
    • Confirm any .proto changes were reviewed with protobuf-lang.
    • Confirm no unmodified files were changed.

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.