Skip to content

Commit 191e86c

Browse files
authored
RULES: Unnecessary template rule removed, md table made yaml (#650)
Unnecessary template rule removed, md table made yaml
1 parent ffc6892 commit 191e86c

File tree

17 files changed

+1000
-316
lines changed

17 files changed

+1000
-316
lines changed

ai/.rules/rest_api_extract_parameters.md

Lines changed: 100 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -202,30 +202,106 @@ Response:
202202

203203
Map diverse API documentation terms to consistent `dlt` parameters. Identify the API's term first, then find the corresponding `dlt` key.
204204

205-
| Concept | Common API Terms | dlt Parameter Key(s) | Notes |
206-
|---------------------|-----------------------------------------------------|----------------------|--------------------------------------------|
207-
| **Client** | | | |
208-
| Base URL | Base URL, API Endpoint, Root URL, Service URL | `client.base_url` | Include version path (e.g., `/v1/`) |
209-
| API Key (value) | API Key, Access Token, Secret, Token, Key | `client.auth.api_key`| (Handled via Secret Handling patterns) |
210-
| API Key (param name)| `api_key`, `token`, `key`, `access_token` | `client.auth.name` | Query param name or Header name |
211-
| API Key (location) | Query parameter, Header | `client.auth.location`| `query` or `header` |
212-
| Bearer Token | Bearer Token, JWT | `client.auth.token` | (Handled via Secret Handling patterns) |
213-
| **Pagination** | | | **Define per-resource if strategies differ!** |
214-
| Next Cursor (source)| `next_cursor`, `next_page`, `nextToken`, `marker` | `paginator.cursor_path`| JSON path in response |
215-
| Next Cursor (param) | `cursor`, `page_token`, `after`, `next`, `marker` | `paginator.cursor_param`| Query param name to send cursor |
216-
| Offset (param) | `offset`, `skip`, `start`, `startIndex` | `paginator.offset_param`| Query param name |
217-
| Page Number (param) | `page`, `page_number`, `pageNum` | `paginator.page_param`| Query param name |
218-
| Page Size (param) | `limit`, `per_page`, `page_size`, `count`, `maxItems` | `paginator.limit_param`| Query param name |
219-
| Total Items (source)| `total`, `total_count`, `total_results`, `count` | `paginator.total_path`| Optional JSON path in response |
220-
| Link Header Relation| `next`, `last` | `paginator.next_url_path`| `rel` value in `Link` header |
221-
| **Incremental** | | | **Define per-resource if strategies differ!** |
222-
| Timestamp (param) | `since`, `updated_since`, `modified_since`, `from`| `incremental.start_param`| Query param name |
223-
| Timestamp (source) | `updated_at`, `modified`, `last_updated`, `ts` | `incremental.cursor_path`| JSON path in response item |
224-
| ID/Sequence (param) | `since_id`, `min_id`, `after_id`, `sequence` | `incremental.start_param`| Query param name |
225-
| ID/Sequence (source)| `id`, `event_id`, `sequence_id`, `_id` | `incremental.cursor_path`| JSON path in response item |
226-
| Initial Value | N/A | `incremental.initial_value`| Start value for first run |
227-
| **Data** | | | |
228-
| Data Array Path | `data`, `results`, `items`, `records`, `entries` | `endpoint.data_selector`| JSON path to the list of items |
205+
```yaml
206+
client:
207+
base_url:
208+
common_api_terms: ["Base URL", "API Endpoint", "Root URL", "Service URL"]
209+
dlt_parameter: "client.base_url"
210+
notes: "Include version path (e.g., /v1/)"
211+
212+
auth:
213+
api_key_value:
214+
common_api_terms: ["API Key", "Access Token", "Secret", "Token", "Key"]
215+
dlt_parameter: "client.auth.api_key"
216+
notes: "Handled via Secret Handling patterns"
217+
218+
api_key_param_name:
219+
common_api_terms: ["api_key", "token", "key", "access_token"]
220+
dlt_parameter: "client.auth.name"
221+
notes: "Query param name or Header name"
222+
223+
api_key_location:
224+
common_api_terms: ["Query parameter", "Header"]
225+
dlt_parameter: "client.auth.location"
226+
notes: "query or header"
227+
228+
bearer_token:
229+
common_api_terms: ["Bearer Token", "JWT"]
230+
dlt_parameter: "client.auth.token"
231+
notes: "Handled via Secret Handling patterns"
232+
233+
pagination:
234+
note: "Define per-resource if strategies differ!"
235+
236+
next_cursor_source:
237+
common_api_terms: ["next_cursor", "next_page", "nextToken", "marker"]
238+
dlt_parameter: "paginator.cursor_path"
239+
notes: "JSON path in response"
240+
241+
next_cursor_param:
242+
common_api_terms: ["cursor", "page_token", "after", "next", "marker"]
243+
dlt_parameter: "paginator.cursor_param"
244+
notes: "Query param name to send cursor"
245+
246+
offset_param:
247+
common_api_terms: ["offset", "skip", "start", "startIndex"]
248+
dlt_parameter: "paginator.offset_param"
249+
notes: "Query param name"
250+
251+
page_number_param:
252+
common_api_terms: ["page", "page_number", "pageNum"]
253+
dlt_parameter: "paginator.page_param"
254+
notes: "Query param name"
255+
256+
page_size_param:
257+
common_api_terms: ["limit", "per_page", "page_size", "count", "maxItems"]
258+
dlt_parameter: "paginator.limit_param"
259+
notes: "Query param name"
260+
261+
total_items_source:
262+
common_api_terms: ["total", "total_count", "total_results", "count"]
263+
dlt_parameter: "paginator.total_path"
264+
notes: "Optional JSON path in response"
265+
266+
link_header_relation:
267+
common_api_terms: ["next", "last"]
268+
dlt_parameter: "paginator.next_url_path"
269+
notes: "rel value in Link header"
270+
271+
incremental:
272+
note: "Define per-resource if strategies differ!"
273+
274+
timestamp_param:
275+
common_api_terms: ["since", "updated_since", "modified_since", "from"]
276+
dlt_parameter: "incremental.start_param"
277+
notes: "Query param name"
278+
279+
timestamp_source:
280+
common_api_terms: ["updated_at", "modified", "last_updated", "ts"]
281+
dlt_parameter: "incremental.cursor_path"
282+
notes: "JSON path in response item"
283+
284+
id_sequence_param:
285+
common_api_terms: ["since_id", "min_id", "after_id", "sequence"]
286+
dlt_parameter: "incremental.start_param"
287+
notes: "Query param name"
288+
289+
id_sequence_source:
290+
common_api_terms: ["id", "event_id", "sequence_id", "_id"]
291+
dlt_parameter: "incremental.cursor_path"
292+
notes: "JSON path in response item"
293+
294+
initial_value:
295+
common_api_terms: ["N/A"]
296+
dlt_parameter: "incremental.initial_value"
297+
notes: "Start value for first run"
298+
299+
data:
300+
data_array_path:
301+
common_api_terms: ["data", "results", "items", "records", "entries"]
302+
dlt_parameter: "endpoint.data_selector"
303+
notes: "JSON path to the list of items"
304+
```
229305

230306
## 7. Verification Checklist
231307

ai/.rules/rule.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

ai/amp/AGENT.md

Lines changed: 100 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -467,30 +467,106 @@ Response:
467467

468468
Map diverse API documentation terms to consistent `dlt` parameters. Identify the API's term first, then find the corresponding `dlt` key.
469469

470-
| Concept | Common API Terms | dlt Parameter Key(s) | Notes |
471-
|---------------------|-----------------------------------------------------|----------------------|--------------------------------------------|
472-
| **Client** | | | |
473-
| Base URL | Base URL, API Endpoint, Root URL, Service URL | `client.base_url` | Include version path (e.g., `/v1/`) |
474-
| API Key (value) | API Key, Access Token, Secret, Token, Key | `client.auth.api_key`| (Handled via Secret Handling patterns) |
475-
| API Key (param name)| `api_key`, `token`, `key`, `access_token` | `client.auth.name` | Query param name or Header name |
476-
| API Key (location) | Query parameter, Header | `client.auth.location`| `query` or `header` |
477-
| Bearer Token | Bearer Token, JWT | `client.auth.token` | (Handled via Secret Handling patterns) |
478-
| **Pagination** | | | **Define per-resource if strategies differ!** |
479-
| Next Cursor (source)| `next_cursor`, `next_page`, `nextToken`, `marker` | `paginator.cursor_path`| JSON path in response |
480-
| Next Cursor (param) | `cursor`, `page_token`, `after`, `next`, `marker` | `paginator.cursor_param`| Query param name to send cursor |
481-
| Offset (param) | `offset`, `skip`, `start`, `startIndex` | `paginator.offset_param`| Query param name |
482-
| Page Number (param) | `page`, `page_number`, `pageNum` | `paginator.page_param`| Query param name |
483-
| Page Size (param) | `limit`, `per_page`, `page_size`, `count`, `maxItems` | `paginator.limit_param`| Query param name |
484-
| Total Items (source)| `total`, `total_count`, `total_results`, `count` | `paginator.total_path`| Optional JSON path in response |
485-
| Link Header Relation| `next`, `last` | `paginator.next_url_path`| `rel` value in `Link` header |
486-
| **Incremental** | | | **Define per-resource if strategies differ!** |
487-
| Timestamp (param) | `since`, `updated_since`, `modified_since`, `from`| `incremental.start_param`| Query param name |
488-
| Timestamp (source) | `updated_at`, `modified`, `last_updated`, `ts` | `incremental.cursor_path`| JSON path in response item |
489-
| ID/Sequence (param) | `since_id`, `min_id`, `after_id`, `sequence` | `incremental.start_param`| Query param name |
490-
| ID/Sequence (source)| `id`, `event_id`, `sequence_id`, `_id` | `incremental.cursor_path`| JSON path in response item |
491-
| Initial Value | N/A | `incremental.initial_value`| Start value for first run |
492-
| **Data** | | | |
493-
| Data Array Path | `data`, `results`, `items`, `records`, `entries` | `endpoint.data_selector`| JSON path to the list of items |
470+
```yaml
471+
client:
472+
base_url:
473+
common_api_terms: ["Base URL", "API Endpoint", "Root URL", "Service URL"]
474+
dlt_parameter: "client.base_url"
475+
notes: "Include version path (e.g., /v1/)"
476+
477+
auth:
478+
api_key_value:
479+
common_api_terms: ["API Key", "Access Token", "Secret", "Token", "Key"]
480+
dlt_parameter: "client.auth.api_key"
481+
notes: "Handled via Secret Handling patterns"
482+
483+
api_key_param_name:
484+
common_api_terms: ["api_key", "token", "key", "access_token"]
485+
dlt_parameter: "client.auth.name"
486+
notes: "Query param name or Header name"
487+
488+
api_key_location:
489+
common_api_terms: ["Query parameter", "Header"]
490+
dlt_parameter: "client.auth.location"
491+
notes: "query or header"
492+
493+
bearer_token:
494+
common_api_terms: ["Bearer Token", "JWT"]
495+
dlt_parameter: "client.auth.token"
496+
notes: "Handled via Secret Handling patterns"
497+
498+
pagination:
499+
note: "Define per-resource if strategies differ!"
500+
501+
next_cursor_source:
502+
common_api_terms: ["next_cursor", "next_page", "nextToken", "marker"]
503+
dlt_parameter: "paginator.cursor_path"
504+
notes: "JSON path in response"
505+
506+
next_cursor_param:
507+
common_api_terms: ["cursor", "page_token", "after", "next", "marker"]
508+
dlt_parameter: "paginator.cursor_param"
509+
notes: "Query param name to send cursor"
510+
511+
offset_param:
512+
common_api_terms: ["offset", "skip", "start", "startIndex"]
513+
dlt_parameter: "paginator.offset_param"
514+
notes: "Query param name"
515+
516+
page_number_param:
517+
common_api_terms: ["page", "page_number", "pageNum"]
518+
dlt_parameter: "paginator.page_param"
519+
notes: "Query param name"
520+
521+
page_size_param:
522+
common_api_terms: ["limit", "per_page", "page_size", "count", "maxItems"]
523+
dlt_parameter: "paginator.limit_param"
524+
notes: "Query param name"
525+
526+
total_items_source:
527+
common_api_terms: ["total", "total_count", "total_results", "count"]
528+
dlt_parameter: "paginator.total_path"
529+
notes: "Optional JSON path in response"
530+
531+
link_header_relation:
532+
common_api_terms: ["next", "last"]
533+
dlt_parameter: "paginator.next_url_path"
534+
notes: "rel value in Link header"
535+
536+
incremental:
537+
note: "Define per-resource if strategies differ!"
538+
539+
timestamp_param:
540+
common_api_terms: ["since", "updated_since", "modified_since", "from"]
541+
dlt_parameter: "incremental.start_param"
542+
notes: "Query param name"
543+
544+
timestamp_source:
545+
common_api_terms: ["updated_at", "modified", "last_updated", "ts"]
546+
dlt_parameter: "incremental.cursor_path"
547+
notes: "JSON path in response item"
548+
549+
id_sequence_param:
550+
common_api_terms: ["since_id", "min_id", "after_id", "sequence"]
551+
dlt_parameter: "incremental.start_param"
552+
notes: "Query param name"
553+
554+
id_sequence_source:
555+
common_api_terms: ["id", "event_id", "sequence_id", "_id"]
556+
dlt_parameter: "incremental.cursor_path"
557+
notes: "JSON path in response item"
558+
559+
initial_value:
560+
common_api_terms: ["N/A"]
561+
dlt_parameter: "incremental.initial_value"
562+
notes: "Start value for first run"
563+
564+
data:
565+
data_array_path:
566+
common_api_terms: ["data", "results", "items", "records", "entries"]
567+
dlt_parameter: "endpoint.data_selector"
568+
notes: "JSON path to the list of items"
569+
```
494570

495571
## 7. Verification Checklist
496572

@@ -708,9 +784,3 @@ The presence of a field in the JSON that looks like a cryptic token (often base6
708784
API docs using terminology like “cursor”, “continuation token”, “next token”, or showing request examples with parameters such as after, nextToken, cursor, etc.
709785
Choose JSONResponseCursorPaginator if the API’s pagination is driven by such tokens in the response body. You will configure cursor_path to point at the JSON field containing the token (e.g. "cursors.next" as default, or "next_cursor", etc.), and cursor_param to the name of the query parameter the API expects (commonly "cursor" or "after"). The paginator will then automatically extract the token and append it as ?cursor=<token> (or your specified param name) on subsequent calls​
710786

711-
## Example markdown
712-
713-
# Example markdown
714-
715-
This is where you can write your first rule.
716-

0 commit comments

Comments
 (0)