Skip to content

Commit 42a53d0

Browse files
committed
Tweak prompts
1 parent cd4ba24 commit 42a53d0

3 files changed

Lines changed: 59 additions & 32 deletions

File tree

.github/prompts/extract-xmapi-endpoint-documentation.prompt.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@ description: 'Extract and format documentation for a specific xmAPI endpoint fro
77

88
# Extract xmAPI Endpoint Documentation
99

10-
You are tasked with extracting and formatting documentation for a specific xmAPI endpoint from the official xMatters API documentation website.
10+
You are tasked with extracting and formatting documentation for a specific xmAPI endpoint from the
11+
official xMatters API documentation website.
1112

1213
## Input
1314

1415
You will be provided with:
15-
1. A URL to a specific section of the xMatters API documentation (e.g., `https://help.xmatters.com/xmapi/#services`)
16+
17+
1. A URL to a specific section of the xMatters API documentation (e.g.,
18+
`https://help.xmatters.com/xmapi/#services`)
1619
2. The endpoint name (e.g., "services", "people", "groups", etc.)
1720

1821
## Output Format
1922

2023
Generate a markdown file that follows this exact structure and formatting:
2124

2225
### Header Block
26+
2327
```markdown
24-
> This file's content is copy-pasted straight from the
25-
> [online doc here](ACTUAL_URL_PROVIDED), mistakes, typos and all. This is
26-
> meant to be used as a starting point to build the endpoint, and then as a reference to generate
27-
> validation scenarios in the sandbox. Once the documentation is confirmed accurate or proving to be
28-
> inaccurate, the relevant code implementation is rectified to match the reality of the API, but
29-
> this markdown file here will be left untouched.
28+
> This file's content is copy-pasted straight from the [online doc here](ACTUAL_URL_PROVIDED),
29+
> mistakes, typos and all. This is meant to be used as a starting point to build the endpoint, and
30+
> then as a reference to generate validation scenarios in the sandbox. Once the documentation is
31+
> confirmed accurate or proving to be inaccurate, the relevant code implementation is rectified to
32+
> match the reality of the API, but this markdown file here will be left untouched.
3033
```
3134

3235
### Main Content Structure
@@ -58,18 +61,24 @@ Generate a markdown file that follows this exact structure and formatting:
5861

5962
## Requirements
6063

61-
- **Preserve all original text exactly**: Copy all content verbatim, including any typos, formatting inconsistencies, or errors from the source
62-
- **Include complete descriptions**: For each API operation, copy the main description AND all additional explanatory paragraphs that follow
64+
- **Preserve all original text exactly**: Copy all content verbatim, including any typos, formatting
65+
inconsistencies, or errors from the source
66+
- **Include complete descriptions**: For each API operation, copy the main description AND all
67+
additional explanatory paragraphs that follow
6368
- **Maintain formatting**: Keep the same markdown structure, code block formatting, and indentation
6469
- **Include all examples**: Copy all curl commands and JSON responses exactly as shown
6570
- **Preserve parameter details**: Include all parameter descriptions, valid values, and constraints
66-
- **Keep structure consistent**: Follow the same heading hierarchy and section organization as shown in the reference
71+
- **Keep structure consistent**: Follow the same heading hierarchy and section organization as shown
72+
in the reference
73+
- **Avoid markdown tables**: because `deno fmt` will break them, do NOT create tables.
6774

6875
## Quality Checklist
6976

7077
Before submitting, ensure:
78+
7179
- [ ] The header block is present with the correct URL
72-
- [ ] All HTTP operations are documented with complete descriptions (including all explanatory paragraphs)
80+
- [ ] All HTTP operations are documented with complete descriptions (including all explanatory
81+
paragraphs)
7382
- [ ] Parameter tables are complete with types and descriptions
7483
- [ ] JSON examples are properly formatted in code blocks
7584
- [ ] The object definition section is included at the end
@@ -78,4 +87,11 @@ Before submitting, ensure:
7887

7988
## Example Reference
8089

81-
Use the structure and formatting shown in the services endpoint documentation as your template for consistency across all endpoint documentation files.
90+
Use the structure and formatting shown in the services endpoint documentation as your template for
91+
consistency across all endpoint documentation files.
92+
93+
### Out of Scope
94+
95+
- **Actual implementation**: Do not create or modify any `.ts` file. This task is strictly for
96+
documentation extraction. Writing the `index.ts`, `types.ts` and testing files will be handled in
97+
a separate process.

.github/prompts/new-endpoint.prompt.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Adhere to the development guidelines in the project's
2626
3. **Define Types**:
2727
- In the new `types.ts` file, draft the necessary TypeScript interfaces based on the provided API
2828
documentation.
29-
- Leverage the reusable, common types available in `src/core/types/` whenever possible.
29+
- Leverage the reusable, common types available in the `src/core/types/` directories whenever
30+
possible.
3031
- Use an existing endpoint's `types.ts` file (e.g., `src/endpoints/services/types.ts`) as a
3132
reference to ensure a consistent style for properties and naming conventions.
3233

@@ -77,15 +78,19 @@ Adhere to the development guidelines in the project's
7778
```
7879

7980
- **Common Methods**:
80-
- While not a strict rule, most standard endpoints should implement the following core methods
81-
if the API supports them:
81+
- While not a strict rule, most standard endpoints should implement the following default
82+
methods if the API supports them:
8283
- `get()`: To fetch a list of resources (paginated).
8384
- `getByIdentifier(id)`: To fetch a single resource by its ID or name.
8485
- `save(payload)`: Creates a new resource or updates an existing one. The payload determines
8586
the action: provide an `id` to update, or omit the `id` and provide a `targetName` (usually)
8687
to create.
8788
- `delete(id)`: To remove a resource.
8889

90+
- **type and lint check**:
91+
- Ensure the new endpoint compiles without type errors and passes lint checks.
92+
- Run `deno check` and `deno lint` to verify.
93+
8994
5. **Export New Endpoint**:
9095
- Finally, open `src/index.ts` and add the new endpoint to the `XmApi` class.
9196
- Import the new endpoint class.

README.maintainers.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,40 +63,46 @@ pattern:
6363

6464
To streamline endpoint creation, use these AI assistant prompts in sequence:
6565

66-
1. **`/extract-xmapi-endpoint-documentation`** - Extract and format official API documentation into a markdown file for reference in subsequent prompts.
66+
1. **`/extract-xmapi-endpoint-documentation`** - Extract and format official API documentation into
67+
a markdown file for reference in subsequent prompts.
6768

68-
2. **`/new-endpoint`** - Generate the initial endpoint implementation (types, class, and exports) based on the extracted documentation.
69+
2. **`/new-endpoint`** - Generate the initial endpoint implementation (types, class, and exports)
70+
based on the extracted documentation.
6971

70-
3. **`/docs-vs-irl`** - Create validation scenarios that test the endpoint against real API responses, then update the endpoint code based on the observed real behavior to fix any discrepancies with the documentation.
72+
3. **`/docs-vs-irl`** - Create validation scenarios that test the endpoint against real API
73+
responses, then update the endpoint code based on the observed real behavior to fix any
74+
discrepancies with the documentation.
7175

7276
#### ✨ The `/extract-xmapi-endpoint-documentation` prompt
7377

7478
1. **Initiate the process**:
7579

76-
In VS Code, start a new chat with your A.I. assistant and type:
77-
```sh
78-
/extract-xmapi-endpoint-documentation <endpoint-online-doc>
79-
# e.g.: /extract-xmapi-endpoint-documentation https://help.xmatters.com/xmapi/#shifts
80-
```
80+
In VS Code, start a new chat with your A.I. assistant and type:
81+
```sh
82+
/extract-xmapi-endpoint-documentation <endpoint-online-doc>
83+
# e.g.: /extract-xmapi-endpoint-documentation https://help.xmatters.com/xmapi/#shifts
84+
```
8185

8286
2. **Verify the output**
8387

84-
The LLM will be spinning its wheels for a short while but usually does a really good job in 1 shot. Still, proof-read a little.
88+
The LLM will be spinning its wheels for a short while but usually does a really good job in 1
89+
shot. Still, proof-read a little.
8590

8691
#### ✨ The `/new-endpoint` prompt
8792

8893
1. **Initiate the process**:
89-
90-
In VS Code, start a new chat with your A.I. assistant and type `/new-endpoint` to begin.
94+
95+
In VS Code, start a new chat with your A.I. assistant and type `/new-endpoint` to begin.
9196

9297
2. **Provide details**:
9398

94-
The assistant will guide you through creating the necessary files and code, asking for the endpoint name and its official documentation if you didn't provide them in the prompt.
99+
The assistant will guide you through creating the necessary files and code, asking for the
100+
endpoint name and its official documentation if you didn't provide them in the prompt.
95101

96-
```sh
97-
/new-endpoint <endpoint-name> <endpoint-doc-file>
98-
# e.g.: /new-endpoint shifts #file:xmapi-official-documentation.md
99-
```
102+
```sh
103+
/new-endpoint <endpoint-name> <endpoint-doc-file>
104+
# e.g.: /new-endpoint shifts #file:xmapi-official-documentation.md
105+
```
100106

101107
#### ❌✨ `xm-endpoint` VS Code Snippet
102108

0 commit comments

Comments
 (0)