@akjamie/agentic-sdlc 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +300 -107
- package/assets/schema/templates/design.md +94 -31
- package/assets/skills/api-design/SKILL.md +204 -0
- package/assets/skills/asdlc-impl-review/SKILL.md +153 -47
- package/assets/skills/asdlc-new/SKILL.md +42 -24
- package/assets/skills/batch-grill-me/SKILL.md +11 -7
- package/assets/skills/frontend-design/SKILL.md +84 -0
- package/assets/skills/grilling/SKILL.md +43 -17
- package/package.json +1 -1
- package/src/commands/new.js +80 -19
- package/src/lib/agents.js +5 -4
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
## 2. System Architecture & Component Interaction
|
|
11
11
|
<!--
|
|
12
12
|
Component breakdown, responsibilities, data flow, and lifecycles.
|
|
13
|
-
|
|
13
|
+
Embed a self-contained Mermaid flowchart, sequenceDiagram, or stateDiagram:
|
|
14
|
+
|
|
14
15
|
```mermaid
|
|
15
16
|
sequenceDiagram
|
|
16
17
|
autonumber
|
|
@@ -30,18 +31,72 @@ sequenceDiagram
|
|
|
30
31
|
## 3. Interface Contracts & Data Models
|
|
31
32
|
<!--
|
|
32
33
|
Specify exact TypeScript interfaces, JSON schemas, or DTO structures.
|
|
33
|
-
|
|
34
|
+
Follow the `api-design` skill for enterprise REST conventions.
|
|
35
|
+
|
|
36
|
+
1. Resource Endpoint Definitions:
|
|
37
|
+
- Method + Path: e.g. `POST /api/v1/payment-intents` (plural nouns, kebab-case, no verbs in URLs)
|
|
38
|
+
- Headers: `Content-Type: application/json`, `Idempotency-Key` (for mutations)
|
|
39
|
+
- Request DTO:
|
|
40
|
+
```typescript
|
|
41
|
+
interface CreatePaymentIntentRequest {
|
|
42
|
+
amountCents: number;
|
|
43
|
+
currency: 'usd' | 'eur' | 'cny';
|
|
44
|
+
customerId: string;
|
|
45
|
+
metadata?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
- Success Response DTO (200 / 201):
|
|
49
|
+
```typescript
|
|
50
|
+
interface PaymentIntentResponse {
|
|
51
|
+
data: {
|
|
52
|
+
id: string;
|
|
53
|
+
status: 'requires_payment_method' | 'succeeded' | 'canceled';
|
|
54
|
+
amountCents: number;
|
|
55
|
+
createdAt: string; // ISO 8601 UTC
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
- Error Response Contract:
|
|
60
|
+
Option A: Stripe-style Error Envelope (Recommended for Developer APIs)
|
|
61
|
+
```typescript
|
|
62
|
+
interface ApiErrorResponse {
|
|
63
|
+
error: {
|
|
64
|
+
code: string; // e.g. 'validation_failed', 'resource_not_found'
|
|
65
|
+
message: string; // Human-readable summary
|
|
66
|
+
details?: Array<{ field: string; code: string; message: string }>;
|
|
67
|
+
requestId?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
Option B: RFC 7807 Problem Details (Content-Type: application/problem+json)
|
|
72
|
+
```typescript
|
|
73
|
+
interface ProblemDetailsResponse {
|
|
74
|
+
type: string; // URI reference (e.g. 'https://api.example.com/errors/validation-failed')
|
|
75
|
+
title: string; // Short summary (e.g. 'Validation Failed')
|
|
76
|
+
status: number; // HTTP status code (e.g. 422)
|
|
77
|
+
detail?: string; // Specific occurrence explanation
|
|
78
|
+
instance?: string; // URI identifying specific occurrence (e.g. '/api/v1/orders/123')
|
|
79
|
+
invalidParams?: Array<{ name: string; reason: string }>;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
2. Pagination Contract (when returning collections):
|
|
83
|
+
- Cursor-based (preferred): `cursor`, `limit`, `has_more`, `next_cursor`
|
|
84
|
+
- Offset-based (admin tables): `page`, `per_page`, `total`, `total_pages`
|
|
34
85
|
-->
|
|
35
86
|
|
|
36
87
|
## 4. External Services & 3rd-Party API Integration
|
|
37
88
|
<!--
|
|
38
89
|
MANDATORY if this change integrates external vendor APIs or services.
|
|
90
|
+
Follow `api-design` resilience patterns.
|
|
39
91
|
- Endpoints & Authentication: Exact URLs, parameters, headers, and secret management.
|
|
40
92
|
- Rate Limiting & Quotas: Upstream limit constraints (e.g. 100 req/min, 5,000/day).
|
|
41
93
|
- Client Lifecycle & Caching Strategy:
|
|
42
94
|
- Cache type: in-memory Map / TTL cache / Redis.
|
|
43
95
|
- Cache key formulation, TTL duration, eviction policy.
|
|
44
96
|
- Lifecycle: Reuse client instance (singleton/service pool); NEVER re-instantiate clients per request.
|
|
97
|
+
- Idempotency & Retry Policy:
|
|
98
|
+
- Header: `Idempotency-Key: <uuid>` on outbound mutations.
|
|
99
|
+
- Exponential backoff with jitter on 429 / 503; respect `Retry-After`.
|
|
45
100
|
- Error Taxonomy & Degradation/Fallback:
|
|
46
101
|
- Ambiguous input: Candidate list returned, never wrong guess.
|
|
47
102
|
- Upstream 4xx/5xx / Quota exhaustion: User-friendly error message, fallback cache, retry with exponential backoff.
|
|
@@ -52,52 +107,60 @@ MANDATORY if this change integrates external vendor APIs or services.
|
|
|
52
107
|
## 5. UI/UX Design, Visual Hierarchy & Aesthetics
|
|
53
108
|
<!--
|
|
54
109
|
MANDATORY if this change adds or modifies user interfaces (Web, Mobile, Desktop).
|
|
55
|
-
Zero tolerance for unstyled, raw, or
|
|
110
|
+
Zero tolerance for unstyled, raw, or generic "AI slop" HTML!
|
|
111
|
+
Follow the `frontend-design` skill (Anthropic official) and Vercel Web Interface Guidelines.
|
|
112
|
+
|
|
113
|
+
🚫 Anti-AI Slop Mandate:
|
|
114
|
+
- NO generic glowing borders or arbitrary purple-on-black cards.
|
|
115
|
+
- NO arbitrary gradient text wrapping a single word in a headline.
|
|
116
|
+
- NO uniform pill buttons everywhere; align button variants with visual hierarchy.
|
|
117
|
+
- NO monotonous 3-card grids without spatial rhythm.
|
|
56
118
|
-->
|
|
57
119
|
|
|
58
|
-
### 5.1 Design
|
|
120
|
+
### 5.1 Design Direction & Subject Grounding (REQUIRED)
|
|
59
121
|
<!--
|
|
60
|
-
|
|
61
|
-
Specify the concrete human-provided design ground truth:
|
|
122
|
+
Ground the design in the domain's real vernacular and audience (e.g., high-density analytical dashboard vs playful consumer app).
|
|
62
123
|
- Mockup link / Figma URL: <url or file path>
|
|
63
124
|
- Brand styleguide / design tokens: <reference or existing CSS tokens file>
|
|
64
125
|
- Reference application / URL: <benchmark url>
|
|
65
|
-
-
|
|
126
|
+
- Design Thesis: <1-2 sentences on tone, hero moment, and personality (e.g., editorial, brutalist-clean, Swiss modern)>
|
|
66
127
|
-->
|
|
67
128
|
- Reference: <!-- insert link, file, or brand token reference -->
|
|
68
|
-
-
|
|
129
|
+
- Design Thesis: <!-- e.g., high-density devtools, restrained palette, monospace accents -->
|
|
69
130
|
|
|
70
131
|
### 5.2 Visual Theme & Design Tokens
|
|
71
|
-
<!-- Derive concrete
|
|
132
|
+
<!-- Derive 4-6 concrete, deliberate Hex codes: -->
|
|
72
133
|
- Color Palette:
|
|
73
|
-
- `--color-primary`: <!-- e.g. #
|
|
74
|
-
- `--color-background`: <!-- e.g. #
|
|
75
|
-
- `--color-surface`: <!-- e.g. #
|
|
76
|
-
- `--color-
|
|
77
|
-
- `--color-
|
|
78
|
-
- `--color-
|
|
79
|
-
- `--color-
|
|
80
|
-
- Typography:
|
|
81
|
-
- Font
|
|
82
|
-
-
|
|
134
|
+
- `--color-primary`: <!-- deliberate brand hue, e.g. #4f46e5 -->
|
|
135
|
+
- `--color-background`: <!-- deep canvas base, e.g. #0b0f19 or #fafafa -->
|
|
136
|
+
- `--color-surface`: <!-- card/surface elevation, e.g. #111827 or #ffffff -->
|
|
137
|
+
- `--color-border`: <!-- subtle boundary, e.g. #1f2937 or #e5e7eb -->
|
|
138
|
+
- `--color-accent`: <!-- high-contrast secondary accent for badges/active -->
|
|
139
|
+
- `--color-text-primary`: <!-- WCAG AA/AAA compliant contrast -->
|
|
140
|
+
- `--color-text-muted`: <!-- secondary reading text -->
|
|
141
|
+
- Typography Hierarchy:
|
|
142
|
+
- Heading / Display Font: <!-- e.g. 'Plus Jakarta Sans', 'Outfit', 'Syne' -->
|
|
143
|
+
- Body / UI Font: <!-- e.g. 'Inter', 'Geist', system-ui -->
|
|
144
|
+
- Monospace / Numbers: <!-- e.g. 'JetBrains Mono', tabular-nums -->
|
|
145
|
+
- Scale: hero (32px-48px, bold, -0.02em), section (20px-24px), body (14px-16px), micro (12px)
|
|
83
146
|
- Spacing & Radii:
|
|
84
|
-
- `--radius`: <!-- e.g. 12px -->
|
|
147
|
+
- `--radius`: <!-- e.g. 8px / 12px -->
|
|
85
148
|
- `--spacing-unit`: <!-- e.g. 8px -->
|
|
86
149
|
|
|
87
|
-
### 5.3
|
|
88
|
-
-
|
|
150
|
+
### 5.3 Hero Moment & Component Layout
|
|
151
|
+
- Hero Treatment: <!-- what first-screen element anchors the page? live preview, search bar, metrics overview -->
|
|
89
152
|
- Breakpoints:
|
|
90
|
-
- Mobile (<= 640px): single-column,
|
|
91
|
-
- Tablet (
|
|
92
|
-
- Desktop (> 1024px): 3-column / sidebar + main grid.
|
|
153
|
+
- Mobile (<= 640px): single-column, tap targets >= 44px.
|
|
154
|
+
- Tablet (641px - 1024px): 2-column adaptive grid.
|
|
155
|
+
- Desktop (> 1024px): 3-column / sidebar + main grid with sticky navigation.
|
|
93
156
|
|
|
94
|
-
### 5.4 Mandatory Interactive States
|
|
157
|
+
### 5.4 Mandatory Interactive States (Vercel Guidelines)
|
|
95
158
|
Every UI component must specify all 5 states:
|
|
96
|
-
1. Default:
|
|
97
|
-
2. Hover/
|
|
98
|
-
3. Loading State:
|
|
99
|
-
4. Empty State:
|
|
100
|
-
5. Error State:
|
|
159
|
+
1. Default: Token-governed styling.
|
|
160
|
+
2. Hover / Focus: Purposeful micro-transitions (150ms-200ms ease); visible focus rings (`:focus-visible`).
|
|
161
|
+
3. Loading State: Content-shaped skeleton cards or spinners (never blank screens or layout shifts).
|
|
162
|
+
4. Empty State: Domain icon/illustration, empathetic copy, and single obvious action prompt.
|
|
163
|
+
5. Error State: Inline non-blocking banner with actionable message and retry button.
|
|
101
164
|
|
|
102
165
|
## 6. Security Architecture & Operational NFRs (Optional / When Applicable)
|
|
103
166
|
<!--
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-design
|
|
3
|
+
description: "Industry-standard RESTful API design guidelines: resource naming, HTTP semantics, structured error taxonomy (Stripe-style and RFC 7807), cursor pagination, idempotency keys, and rate-limiting resilience."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
origin: "Best-of-market REST standards (Stripe, Zalando, Google API Design Guide, RFC 7807 / RFC 9457, RFC 9110)"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Enterprise RESTful API Design Guidelines
|
|
10
|
+
|
|
11
|
+
This skill guides coding agents to design consistent, resilient, and developer-friendly REST APIs. It establishes strict architectural conventions across resource modeling, status codes, response envelopes, error handling, idempotency, and versioning.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Resource Modeling & URL Hierarchy
|
|
16
|
+
|
|
17
|
+
### 🔗 URL Conventions
|
|
18
|
+
- **Nouns over verbs**: Resources represent entities, not remote procedure calls.
|
|
19
|
+
- **Plural, lowercase, kebab-case**: `/api/v1/team-members`, `/api/v1/payment-intents`.
|
|
20
|
+
- **Hierarchical nesting for ownership**:
|
|
21
|
+
- `GET /api/v1/organizations/:orgId/projects`
|
|
22
|
+
- `GET /api/v1/projects/:projectId/tasks/:taskId`
|
|
23
|
+
- *Rule*: Limit nesting to 2 levels maximum (`/parents/:id/children/:id`). For deeper relationships, use top-level resources with query filters: `/api/v1/comments?task_id=:taskId`.
|
|
24
|
+
- **Non-CRUD Actions**: When an operation does not map cleanly to standard CRUD, use explicit sub-resource action verbs sparingly:
|
|
25
|
+
- `POST /api/v1/orders/:id/cancel`
|
|
26
|
+
- `POST /api/v1/auth/refresh-token`
|
|
27
|
+
- `POST /api/v1/reports/export`
|
|
28
|
+
|
|
29
|
+
### 🚫 URL Anti-Patterns
|
|
30
|
+
| Anti-Pattern | Bad Example | Correct Design |
|
|
31
|
+
| :--- | :--- | :--- |
|
|
32
|
+
| Verbs in URLs | `GET /api/v1/getUsers` | `GET /api/v1/users` |
|
|
33
|
+
| Method in URLs | `POST /api/v1/users/delete` | `DELETE /api/v1/users/:id` |
|
|
34
|
+
| Singular resource | `/api/v1/user/:id` | `/api/v1/users/:id` |
|
|
35
|
+
| Mixed casing | `/api/v1/teamMembers` or `team_members` | `/api/v1/team-members` |
|
|
36
|
+
| Query params as path | `/api/v1/orders/status/active` | `/api/v1/orders?status=active` |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. HTTP Method Semantics & Status Codes
|
|
41
|
+
|
|
42
|
+
### 📋 Method Contract Matrix
|
|
43
|
+
| Method | Idempotent | Safe | Typical Response Code | Semantics |
|
|
44
|
+
| :--- | :---: | :---: | :---: | :--- |
|
|
45
|
+
| **GET** | Yes | Yes | `200 OK` | Retrieve resource representation without side effects. |
|
|
46
|
+
| **POST** | No | No | `201 Created` (with `Location`) | Create a new subordinate resource or trigger a process. |
|
|
47
|
+
| **PUT** | Yes | No | `200 OK` / `204 No Content` | Complete replacement of the identified resource. |
|
|
48
|
+
| **PATCH** | No (RFC 9110) | No | `200 OK` / `204 No Content` | Partial modification of specific resource attributes (can be made idempotent with JSON Patch or conditional headers). |
|
|
49
|
+
| **DELETE** | Yes | No | `204 No Content` | Remove resource; subsequent calls return `404` or `204`. |
|
|
50
|
+
|
|
51
|
+
### 🎯 Status Code Invariants
|
|
52
|
+
- **200 OK**: Request succeeded with response body.
|
|
53
|
+
- **201 Created**: Resource created; MUST include `Location: /api/v1/resources/:id` header.
|
|
54
|
+
- **204 No Content**: Action succeeded with zero response body (common for `DELETE`).
|
|
55
|
+
- **400 Bad Request**: Malformed JSON syntax, invalid query parameters.
|
|
56
|
+
- **401 Unauthorized**: Missing, expired, or invalid authentication credentials.
|
|
57
|
+
- **403 Forbidden**: Authenticated caller lacks permissions/scopes for this resource.
|
|
58
|
+
- **404 Not Found**: Resource does not exist (or hidden for security).
|
|
59
|
+
- **409 Conflict**: Duplicate key, concurrent state modification, or invariant violation.
|
|
60
|
+
- **422 Unprocessable Entity**: Semantically invalid payload (schema valid, but business validation failed).
|
|
61
|
+
- **429 Too Many Requests**: Rate limit exceeded; MUST include `Retry-After` header.
|
|
62
|
+
- **500 Internal Server Error**: Unexpected unhandled failure; NEVER expose stack traces or DB credentials.
|
|
63
|
+
- **502 Bad Gateway / 503 Service Unavailable**: Downstream dependency failure or maintenance mode.
|
|
64
|
+
|
|
65
|
+
> [!CAUTION]
|
|
66
|
+
> **Zero Tolerance for "200 OK Errors"**: NEVER return HTTP 200 with `{ "status": "error", "message": "..." }`. The HTTP status code is the protocol-level source of truth.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 3. Standard Response Envelopes & Error Contracts
|
|
71
|
+
|
|
72
|
+
### 📦 Success Responses
|
|
73
|
+
```typescript
|
|
74
|
+
// Single Resource Response:
|
|
75
|
+
interface ItemResponse<T> {
|
|
76
|
+
data: T;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Collection Response:
|
|
80
|
+
interface CollectionResponse<T> {
|
|
81
|
+
data: T[];
|
|
82
|
+
meta: {
|
|
83
|
+
total?: number; // Omitted for infinite scroll cursor queries
|
|
84
|
+
has_more: boolean;
|
|
85
|
+
next_cursor?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 🚨 Standardized Error Envelopes
|
|
91
|
+
|
|
92
|
+
Choose one consistent error representation across the API:
|
|
93
|
+
|
|
94
|
+
#### Option A: Stripe-Style Error Envelope (Recommended for Developer-Facing Web APIs)
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"error": {
|
|
98
|
+
"code": "validation_failed",
|
|
99
|
+
"message": "The request payload failed field validation",
|
|
100
|
+
"details": [
|
|
101
|
+
{
|
|
102
|
+
"field": "email",
|
|
103
|
+
"code": "invalid_format",
|
|
104
|
+
"message": "Must be a valid RFC 5322 email address"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"field": "amount_cents",
|
|
108
|
+
"code": "out_of_bounds",
|
|
109
|
+
"message": "Amount must be greater than 0"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"request_id": "req_01h8xyz789"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Option B: RFC 7807 Problem Details (`application/problem+json`)
|
|
118
|
+
IETF standard format specifying machine-readable problem details for HTTP APIs:
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"type": "https://api.example.com/errors/validation-failed",
|
|
122
|
+
"title": "Validation Failed",
|
|
123
|
+
"status": 422,
|
|
124
|
+
"detail": "The request payload failed validation on 2 fields",
|
|
125
|
+
"instance": "/api/v1/payment-intents",
|
|
126
|
+
"invalid_params": [
|
|
127
|
+
{
|
|
128
|
+
"name": "email",
|
|
129
|
+
"reason": "Must be a valid RFC 5322 email address"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "amount_cents",
|
|
133
|
+
"reason": "Amount must be greater than 0"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 4. Pagination Strategies
|
|
142
|
+
|
|
143
|
+
### 1. Cursor-Based Pagination (Recommended for High Volume / Real-Time Data)
|
|
144
|
+
- **Request**: `GET /api/v1/events?limit=25&starting_after=evt_123` (or `cursor=eyJpZCI6MTIzfQ`)
|
|
145
|
+
- **Response**:
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"data": [ ... ],
|
|
149
|
+
"meta": {
|
|
150
|
+
"has_more": true,
|
|
151
|
+
"next_cursor": "evt_148"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
- **Advantages**: Stable under concurrent inserts/deletes, consistent performance (O(1) indexed lookup), no duplicate records.
|
|
156
|
+
|
|
157
|
+
### 2. Offset-Based Pagination (Acceptable for Internal Admin Tables)
|
|
158
|
+
- **Request**: `GET /api/v1/users?page=2&per_page=50`
|
|
159
|
+
- **Response**:
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"data": [ ... ],
|
|
163
|
+
"meta": {
|
|
164
|
+
"total": 450,
|
|
165
|
+
"page": 2,
|
|
166
|
+
"per_page": 50,
|
|
167
|
+
"total_pages": 9
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 5. Filtering, Sorting, and Field Projections
|
|
175
|
+
|
|
176
|
+
- **Filtering**: Use explicit query parameters:
|
|
177
|
+
`GET /api/v1/orders?status=shipped&created_after=2026-01-01T00:00:00Z`
|
|
178
|
+
- **Sorting**: Multi-field comma-separated sorting with `-` prefix for descending order:
|
|
179
|
+
`GET /api/v1/products?sort=-price,created_at`
|
|
180
|
+
- **Sparse Fieldsets / Projections**:
|
|
181
|
+
`GET /api/v1/users?fields=id,name,email`
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 6. Reliability & Production Hardening
|
|
186
|
+
|
|
187
|
+
### 🔒 Idempotency Keys (Stripe Pattern)
|
|
188
|
+
For mutating operations (financial transactions, webhook dispatches, state transitions):
|
|
189
|
+
- Client sends header: `Idempotency-Key: <unique-uuid>`.
|
|
190
|
+
- Server checks distributed cache (Redis / DB) with 24h TTL.
|
|
191
|
+
- If request is currently processing: return `409 Conflict` or wait.
|
|
192
|
+
- If already completed: replay cached response code and body with `Idempotent-Replay: true`.
|
|
193
|
+
|
|
194
|
+
### ⏱️ Rate Limiting Headers
|
|
195
|
+
Every API response should supply rate-limiting telemetry:
|
|
196
|
+
- `X-RateLimit-Limit`: Maximum requests permitted per window.
|
|
197
|
+
- `X-RateLimit-Remaining`: Remaining request quota.
|
|
198
|
+
- `X-RateLimit-Reset`: UTC epoch timestamp when current window resets.
|
|
199
|
+
- `Retry-After`: Seconds to wait before retrying (on `429 Too Many Requests`).
|
|
200
|
+
|
|
201
|
+
### 📦 Upstream Service Invariants
|
|
202
|
+
- **Connection pooling & singleton clients**: Never re-create API client instances per request.
|
|
203
|
+
- **Timeout budgets**: Hard timeouts on all outbound calls (e.g., 3000ms connect, 5000ms read).
|
|
204
|
+
- **Graceful degradation**: Fall back to stale cache or return candidate list on ambiguous inputs; never crash the caller.
|